Skip to content

Commit

Permalink
Merge branch '4.x' into canary-releases
Browse files Browse the repository at this point in the history
  • Loading branch information
jdevcs authored Jun 2, 2023
2 parents 6cac9a7 + 01ce365 commit d71df33
Show file tree
Hide file tree
Showing 50 changed files with 880 additions and 884 deletions.
5 changes: 5 additions & 0 deletions docs/docs/guides/advanced/_category_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
label: 'Advanced'
collapsible: true
collapsed: true
link: null
position: 5
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
sidebar_position: 4
sidebar_label: web3 Tree Shaking Guide
sidebar_label: Tree Shaking Guide
---

# web3 Tree shaking Support Guide
# Tree shaking Support Guide

1. Use the `production` mode configuration option to enable various optimizations including minification and tree shaking. Set your webpack.config:

Expand Down
5 changes: 5 additions & 0 deletions docs/docs/guides/basics/_category_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
label: 'Basic Interaction'
collapsible: true
collapsed: true
link: null
position: 3
4 changes: 2 additions & 2 deletions docs/docs/tutorials/eth.md → docs/docs/guides/basics/eth.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
sidebar_position: 3
sidebar_label: 'Using web3-eth package'
sidebar_position: 2
sidebar_label: 'Eth Package Usage Example'
---

# Getting Started with `eth` Package
Expand Down
14 changes: 14 additions & 0 deletions docs/docs/guides/basics/sign_and_send_tx/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
sidebar_position: 1
sidebar_label: 'Transactions'
---

# Sign and Send Transaction

You can sign and send transactions in different ways.

- [Local wallet signing](./local_wallet)
- [Using raw transaction](./raw)
- [Using wallet of Eth Node](./wallet_of_eth_node)

For each of them you can use [Web3PromiEvent](./promi_event) to catch extra transaction's events
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_label: 'Local wallet'

The simplest way to sign and send transactions is using a local wallet:

## Eth Transaction
## Ethereum Transaction

```ts
// First step: initialize `web3` instance
Expand Down
10 changes: 10 additions & 0 deletions docs/docs/guides/basics/sign_and_send_tx/raw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
sidebar_position: 2
sidebar_label: 'Raw Transaction'
---

# Using Raw Transaction

:::note
To be written!
:::
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
sidebar_position: 2
sidebar_label: 'Wallet of Eth Node'
sidebar_position: 1
sidebar_label: 'Node Wallet'
---

# Using Wallet of Eth Node
# Using Node Wallet

If Eth node have unlocked account in its wallet you can send transaction without need of signing locally in web3.js
If Ethereum node has unlocked account in its wallet you can send transaction without need of signing locally in web3.js

## Eth Transaction
## Transaction

```ts
// First step: initialize web3 instance
Expand Down
12 changes: 12 additions & 0 deletions docs/docs/guides/getting_started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
slug: /
sidebar_position: 1
sidebar_label: Getting Started
---

# Getting Started

Welcome to Web3.js Documentation.

web3.js is a collection of libraries that allow you to interact with a local or remote ethereum node using HTTP, IPC or WebSocket.
The following documentation will guide you through different use cases of Web3.js, upgrading from older versions as well as providing an API reference documentation with examples.
14 changes: 0 additions & 14 deletions docs/docs/guides/sign_and_send_tx/index.md

This file was deleted.

96 changes: 0 additions & 96 deletions docs/docs/guides/sign_and_send_tx/raw.md

This file was deleted.

5 changes: 5 additions & 0 deletions docs/docs/guides/smart_contracts/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_position: 4
---

# Smart Contracts
36 changes: 0 additions & 36 deletions docs/docs/guides/web3_migration_guide/subscribe_migration_guide.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/docs/guides/web3_plugin_guide/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
sidebar_position: 3
sidebar_label: 'web3 Plugins'
sidebar_position: 6
sidebar_label: 'Plugins'
---

# web3.js Plugins Guide
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/guides/web3_plugin_guide/plugin_authors.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
sidebar_position: 0
sidebar_label: 'Plugin Authors'
sidebar_position: 1
sidebar_label: 'For Plugin Developers'
---

# web3.js Plugin Author's Guide
# web3.js Plugin Developer Guide

This guide intends to provide the necessary context for developing plugins for web3.js.

:::caution
To provide type safety and IntelliSense for your plugin users, please refer to the [Setting Up Module Augmentation](/docs/guides/web3_plugin_guide/plugin_authors#setting-up-module-augmentation) section for how to augment the `Web3Context` module to enable typing features for your plugin.
To provide type safety and IntelliSense for your plugin users, please refer to the [Setting Up Module Augmentation](#setting-up-module-augmentation) section for how to augment the `Web3Context` module to enable typing features for your plugin.
:::

## Plugin Dependencies
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/guides/web3_plugin_guide/plugin_users.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
sidebar_position: 1
sidebar_label: 'Plugin Users'
sidebar_position: 0
sidebar_label: 'For Plugin Users'
---

# web3.js Plugin User's Guide
# Plugin User Guide

This guide intends to provide the necessary context for registering plugins with web3.js packages.

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/guides/web3_providers_guide/events_listening.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
sidebar_position: 0
sidebar_label: 'Providers Events Listening'
sidebar_position: 1
sidebar_label: 'Event Listening'
---

# Providers Events Listening
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
---
sidebar_position: 2
sidebar_label: Providers
sidebar_label: Examples
---

# Providers

## Introduction

web3.js providers are objects responsible for enabling connectivity with the Ethereum network in various ways. Connecting your web application to an Ethereum node is necessary for sending transactions, querying data, and interacting with smart contracts on the network. In this tutorial, we will explore the different types of providers available in web3.js version 4, how to set them up, and how to use them in your code.
# Example usage

## Prerequisites

Expand Down Expand Up @@ -593,5 +588,3 @@ A few points to consider:
## Conclusion
In this tutorial, we explored different types of providers available in web3.js and learned how to set them up and use them in our code. Depending on your application's needs, you can choose the provider that best suits your requirements. The HTTP Provider is the simplest and most widely used provider, while the Websocket Provider and IPC Provider offer real-time communication and faster performance, respectively. With these providers, you can connect your web application to the Ethereum network and start building decentralized applications.
To get more about providers like more about their priorities and options, check the [web3.js Providers Guide](/docs/guides/web3_providers_guide/) and [Providers Events Listening Guide](/docs/guides/web3_providers_guide/events_listening)
6 changes: 5 additions & 1 deletion docs/docs/guides/web3_providers_guide/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
---
sidebar_position: 1
sidebar_position: 2
sidebar_label: 'Providers'
---

# web3.js Providers Guide

## Introduction

web3.js providers are objects responsible for enabling connectivity with the Ethereum network in various ways. Connecting your web application to an Ethereum node is necessary for sending transactions, querying data, and interacting with smart contracts on the network. In this guide, we will explore the different types of providers available in web3.js, how to set them up, and how to use them in your code.

Connecting to a chain happens through a provider. You can pass the provider to the constructor as in the following example:

```ts
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
sidebar_position: 1
sidebar_label: 'Migration from 1.x'
sidebar_label: 'Upgrade from 1.x'
---

# Migration from 1.x
# Upgrade from 1.x

This migration guide is for migration from web3.js 1.x to web3.js 4.x.
This upgrade guide is for upgrading from web3.js 1.x to web3.js 4.x.

## Breaking Changes

Expand All @@ -32,6 +32,10 @@ const web3 = new Web3();

Passing callbacks to functions is no longer supported, except for event listeners.

For example, the approach to subscribing-to and listening-for blockchain events has changed in version 4.x. Detailed instructions can be found in the [**`web3.eth.subscribe` Migration Guide**](./subscribe_migration_guide.md#subscribing-to-events).

However, the approach to subscribing to Provider events remains the same, utilizing callbacks as explained in the [Providers Events Listening guide](../../web3_providers_guide/events_listening.md). It is important to note that Providers have undergone some breaking changes, including the renaming of the `on('close', ...)` to `on('disconnect', ...)`.

### Not Implemented or Exported

- [extend](https://web3js.readthedocs.io/en/v1.7.3/web3.html#extend) Extending web3 modules functionality is not implemented
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 2
sidebar_label: web3.providers
---

For full description about the providers, their priorities and their types, you can check [web3.js Providers Guide](/docs/guides/web3_providers_guide/).
For full description about the providers, their priorities and their types, you can check [web3.js Providers Guide](../../web3_providers_guide/).

### Provider Options Changes

Expand Down
Loading

0 comments on commit d71df33

Please sign in to comment.