Skip to content

Commit 8da9f68

Browse files
Merge branch 'main' into java-documentation-factoring
2 parents af6905a + d9e2aae commit 8da9f68

25 files changed

+1140
-829
lines changed

content/sdk/00.index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Integrate ZKsync GO SDK for ZKsync Era features.
7474
---
7575
title: Python
7676
icon: i-heroicons-circle-stack
77-
to: /sdk/python/quickstart/getting-started
77+
to: /sdk/python/introduction/overview
7878
---
7979
Explore Nuxt built-in components for pages, layouts, head, and more.
8080
::

content/sdk/20.go/00.introduction/00.overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Overview
3-
description: An introduction to `zksync2-go`
3+
description: An introduction to zksync2-go
44
tags: ["zksync", "zksync2-go", "ethereum", "layer-2", "zero-knowledge rollups", "go library", "blockchain scalability", "crypto transactions"]
55
---
66

content/sdk/30.python/00.getting-started.md

Lines changed: 0 additions & 65 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: Overview
3+
description: An introduction to the ZKsync Python SDK and its features.
4+
tags: ["zksync", "python", "sdk", "overview"]
5+
---
6+
7+
The ZKsync Python SDK is a powerful tool designed to facilitate interaction with the ZKsync Layer-2 scaling solution
8+
on the Ethereum blockchain. Leveraging zero-knowledge proofs, ZKsync provides efficient, low-cost transactions while
9+
ensuring security and scalability. This SDK makes it easier for developers to integrate and utilize ZKsync's advanced
10+
features in their applications.
11+
12+
## Concept
13+
14+
Most existing SDKs work right away, but deploying smart contracts or using unique ZKsync features, like account
15+
abstraction, needs extra fields that Ethereum transactions don't have by default.
16+
17+
To make it easy to use all ZKsync Era features, we created the `zksync2` Python SDK. This SDK has an interface similar
18+
to [web3.py](https://web3py.readthedocs.io/en/latest/index.html). In fact, `web3.py` is a peer dependency of our
19+
library. Most objects exported by `zksync2` inherit from `web3.py` objects and only change the fields that need adjustments.
20+
21+
::callout{icon="i-heroicons-light-bulb"}
22+
Explore the [Python SDK examples](https://github.com/zksync-sdk/zksync2-examples/tree/main/python) to quickly and
23+
efficiently develop applications with the ZKsync protocol.
24+
::
25+
26+
## Key features
27+
28+
- **Transaction management**: Easily create, sign, and send transactions on the ZKsync network.
29+
- **Account operations**: Manage accounts, including creating, funding, and querying balances.
30+
- **Token support**: Support for multiple tokens, enabling transfers and swaps.
31+
- **Contract interaction**: Interact with smart contracts deployed on ZKsync.
32+
- **Batch transactions**: Bundle multiple transactions to reduce costs and improve efficiency.
33+
- **Security**: Leverage zero-knowledge proofs for enhanced security and privacy.
34+
- **Scalability**: Benefit from the scalability improvements provided by the ZKsync Layer-2 solution.
35+
36+
### Additional resources
37+
38+
For more detailed information and advanced usage, refer to the [official ZKsync documentation](https://docs.zksync.io/sdk).
39+
40+
::callout{icon="i-heroicons-light-bulb"}
41+
To use the `Python SDK`, visit the [Getting Started](/sdk/python/guides/getting-started) page.
42+
::

content/sdk/30.python/00.quickstart/01.why-python-sdk.md renamed to content/sdk/30.python/00.introduction/01.why-zksync-python.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ The SDK is actively developed and maintained by the ZKsync team. This ensures th
4040
latest features and improvements, keeping your projects up to date with the evolving blockchain landscape.
4141

4242
::callout{icon="i-heroicons-light-bulb"}
43-
Explore the [Python SDK documentation](/sdk/python/quickstart/getting-started) to get started and take advantage of all the
43+
Explore the [Python SDK documentation](/sdk/python/guides/getting-started) to get started and take advantage of all the
4444
features and benefits it offers.
4545
::

content/sdk/30.python/00.quickstart/00.getting-started.md

Lines changed: 0 additions & 64 deletions
This file was deleted.

content/sdk/30.python/00.quickstart/03.platform-compatibility-python.md

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: Getting Started
3+
description: A guide to getting started with the ZKsync Python SDK.
4+
tags: ["zksync", "python", "sdk", "getting started"]
5+
---
6+
7+
This guide will help you get started with the ZKsync Python SDK, from connecting to the network to performing basic operations.
8+
9+
::callout{icon="i-heroicons-light-bulb"}
10+
Check the [installation guide](/sdk/python/introduction/installation) for instructions.
11+
::
12+
13+
## Connecting to ZKsync Era
14+
15+
Once you have all the necessary dependencies, connect to ZKsync Era using the endpoint of the operator node.
16+
17+
```python
18+
from zksync2.module.module_builder import ZkSyncBuilder
19+
...
20+
sdk = ZkSyncBuilder.build("https://sepolia.era.zksync.dev")
21+
```
22+
23+
Get chain id:
24+
25+
```python
26+
chain_id = zk_web3.zksync.chain_id
27+
```
28+
29+
Get block number:
30+
31+
```python
32+
block_number = zk_web3.zksync.block_number
33+
```
34+
35+
Get the transaction by hash:
36+
37+
```ts
38+
transaction = zksync_web3.zksync.eth_get_transaction_by_hash(hash);
39+
```
40+
41+
## Examples
42+
43+
Also, the following examples demonstrate how to:
44+
45+
1. [Deposit ETH and tokens from Ethereum into ZKsync Era](https://github.com/zksync-sdk/zksync2-examples/blob/main/python/01_deposit.py)
46+
2. [Transfer ETH and tokens on ZKsync Era](https://github.com/zksync-sdk/zksync2-examples/blob/main/python/02_transfer.py)
47+
3. [Withdraw ETH and tokens from ZKsync Era to Ethereum](https://github.com/zksync-sdk/zksync2-examples/blob/main/python/09_withdrawal.py)
48+
4. [Use paymaster to pay fees with tokens](https://github.com/zksync-sdk/zksync2-examples/blob/main/python/15_use_paymaster.py)
49+
50+
Full code for all examples is available in the [Python ZKsync SDK](https://github.com/zksync-sdk/zksync2-examples/tree/main/python).
51+
Examples are configured to interact with `ZKsync Era` and `Sepolia` test networks.

content/sdk/30.python/01.features.md renamed to content/sdk/30.python/01.guides/01.features.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: ZKsync Era Features
3-
description:
3+
description: Unique features and differences of ZKsync Era compared to Ethereum.
4+
tags: ["zksync", "ethereum", "sdk", "features"]
45
---
56

67
While ZKsync is mostly Web3-compatible, it has some differences compared to Ethereum. The major of those are:
@@ -22,7 +23,7 @@ While the paymaster feature by itself does not impose any limitations on values
2223
the Matter Labs team endorses certain types of paymaster flows that are processable by EOAs.
2324

2425
ZKsync SDK provides a utility method that can be used to get the correctly formed `paymasterParams` object:
25-
[PaymasterFlowEncoder](/sdk/python/paymaster-utils#paymasterflowencoder).
26+
[PaymasterFlowEncoder](/sdk/python/api/utilities/paymaster-utils#paymasterflowencoder).
2627

2728
## See in action
2829

Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
2-
title: Accounts | L1<->L2 Transactions
3-
description:
2+
title: L1<->L2 Transactions
3+
description: Methods to facilitate transactions between L1 and L2 networks
4+
tags: ["zksync", "l1", "l2", "transactions", "python", "sdk"]
45
---
56

6-
This section explores the methods which allow the [account](/sdk/python/accounts)
7+
This section explores the methods which allow the [account](/sdk/python/api/accounts/wallet)
78
classes to send transactions from L1 to L2.
89

910
If you want to get some background on how L1->L2 interaction works on ZKsync Era, go through the
@@ -14,34 +15,34 @@ Full examples of actions below are available on the getting started page.
1415
## Deposit
1516

1617
`Wallet` object provides a deposit workflow. For more information, please refer to the
17-
method specification [`Deposit`](/sdk/python/accounts#deposit).
18+
method specification [`Deposit`](/sdk/python/api/accounts/wallet#deposit).
1819

1920
For a complete example of how to execute the deposit workflow, take a look at the following:
2021
[Deposit ETH and ERC20 token](https://github.com/zksync-sdk/zksync2-examples/blob/main/python/01_deposit.py).
2122

2223
## Request execute
2324

2425
`Wallet` and `L1Signer` objects provide an option to request execution of L2 transaction from L1.
25-
For more information, please refer to the method specification [`request_execute`](/sdk/python/accounts#requestexecute).
26+
For more information, please refer to the method specification [`request_execute`](/sdk/python/api/accounts/wallet#requestexecute).
2627

2728
## Base cost
2829

2930
`Wallet` object provides an option to calculate base cost for L2 transaction. For more information, please refer to the
30-
method specification [`getBaseCost`](/sdk/python/accounts#getbasecost).
31+
method specification [`getBaseCost`](/sdk/python/api/accounts/wallet#getbasecost).
3132

3233
## Claim failed deposit
3334

3435
`Wallet` object provides a claim fail deposit workflow. For more information, please refer to the method specification
35-
[`claimFailedDeposit`](/sdk/python/accounts#claimfaileddeposit).
36+
[`claimFailedDeposit`](/sdk/python/api/accounts/wallet#claimfaileddeposit).
3637

3738
## Finalize withdraw
3839

3940
`Wallet` object provides a finalize withdraw workflow. For more information, please refer to the method specification
40-
[`finalizeWithdrawal`](/sdk/python/accounts#finalizewithdrawal).
41+
[`finalizeWithdrawal`](/sdk/python/api/accounts/wallet#finalizewithdrawal).
4142

4243
## Withdrawal
4344

44-
`Wallet` object provides a withdrawal workflow. For more information, please refer to the method specification [`Deposit`](/sdk/python/accounts#deposit).
45+
`Wallet` object provides a withdrawal workflow. For more information, please refer to the method specification [`Deposit`](/sdk/python/api/accounts/wallet#deposit).
4546

4647
For a complete example of how to execute the deposit workflow, take a look at the following:
4748
[Withdraw ETH and ERC20 token](https://github.com/zksync-sdk/zksync2-examples/blob/main/python/09_withdrawal.py).
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: Introduction
3+
description: Overview of Web3Providers and their functions.
4+
tags: ["web3", "blockchain", "provider", "zksync"]
5+
---
6+
7+
A Web3 Provider object provides application-layer access to underlying blockchain networks. It serves as a crucial
8+
interface for interacting with various blockchain functionalities, enabling developers to connect, communicate, and
9+
perform operations on the blockchain.
10+
11+
The [`zksync2`](https://pypi.org/project/zksync2/) library supports provider methods from
12+
the [`web3.py`](https://web3py.readthedocs.io/en/stable/providers.html) library and supplies additional functionality
13+
tailored for the ZKsync Era network.
14+
15+
### Key features
16+
17+
- **Network connectivity:** Establishes connections to blockchain networks, allowing applications to interact with them.
18+
- **Transaction management:** Facilitates the creation, sending, and tracking of transactions.
19+
- **Gas estimation:** Provides estimations for the amount of gas required for transactions.
20+
- **Account management:** Retrieves balances and transaction histories for accounts.
21+
- **Contract interaction:** Enables interaction with smart contracts, including deploying and calling contract methods.

0 commit comments

Comments
 (0)