Skip to content

Commit 0499e05

Browse files
fix: edit urls
1 parent c548e2c commit 0499e05

File tree

12 files changed

+594
-629
lines changed

12 files changed

+594
-629
lines changed

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/01.guides/00.getting-started.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ tags: ["zksync", "python", "sdk", "getting started"]
77
This guide will help you get started with the ZKsync Python SDK, from connecting to the network to performing basic operations.
88

99
::callout{icon="i-heroicons-light-bulb"}
10-
Check the [installation guide](/sdk/python/quickstart/installation-python) for instructions.
10+
Check the [installation guide](/sdk/python/introduction/installation) for instructions.
1111
::
1212

1313
## Connecting to ZKsync Era
@@ -38,12 +38,14 @@ Get the transaction by hash:
3838
transaction = zksync_web3.zksync.eth_get_transaction_by_hash(hash);
3939
```
4040

41+
## Examples
42+
4143
Also, the following examples demonstrate how to:
4244

43-
1. Deposit ETH and tokens from Ethereum into ZKsync Era
44-
2. Transfer ETH and tokens on ZKsync Era
45-
3. Withdraw ETH and tokens from ZKsync Era to Ethereum
46-
4. Use paymaster to pay fee with token
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)
4749

48-
Full code for all examples is available in the [ZKsync Python guide](https://github.com/zksync-sdk/zksync2-examples/tree/main/python).
50+
Full code for all examples is available in the [Python ZKsync SDK](https://github.com/zksync-sdk/zksync2-examples/tree/main/python).
4951
Examples are configured to interact with `ZKsync Era` and `Sepolia` test networks.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ While the paymaster feature by itself does not impose any limitations on values
2323
the Matter Labs team endorses certain types of paymaster flows that are processable by EOAs.
2424

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

2828
## See in action
2929

content/sdk/30.python/01.guides/02.accounts-l1-l2.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Methods to facilitate transactions between L1 and L2 networks
44
tags: ["zksync", "l1", "l2", "transactions", "python", "sdk"]
55
---
66

7-
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/accounts)
88
classes to send transactions from L1 to L2.
99

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

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

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

2323
## Request execute
2424

2525
`Wallet` and `L1Signer` objects provide an option to request execution of L2 transaction from L1.
26-
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/accounts#requestexecute).
2727

2828
## Base cost
2929

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

3333
## Claim failed deposit
3434

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

3838
## Finalize withdraw
3939

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

4343
## Withdrawal
4444

45-
`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/accounts#deposit).
4646

4747
For a complete example of how to execute the deposit workflow, take a look at the following:
4848
[Withdraw ETH and ERC20 token](https://github.com/zksync-sdk/zksync2-examples/blob/main/python/09_withdrawal.py).

content/sdk/30.python/02.api/00.providers/01.providers.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ zksync = ZkSyncBuilder.build("https://sepolia.era.zksync.dev")
3434

3535
### `zks_estimate_fee`
3636

37-
Returns an estimated [`Fee`](/sdk/python/types#fee) for requested transaction.
37+
Returns an estimated [`Fee`](/sdk/python/api/types#fee) for requested transaction.
3838

3939
#### Inputs
4040

4141
| Parameter | Type | Description |
4242
| ------------- | --------------------------------------- | -------------------- |
43-
| `transaction` | [`Transaction`](/sdk/python/types#transaction) | Transaction request. |
43+
| `transaction` | [`Transaction`](/sdk/python/api/types#transaction) | Transaction request. |
4444

4545
#### Example
4646

@@ -62,7 +62,7 @@ Returns an estimate(`int`) of the amount of gas required to submit a transaction
6262

6363
| Parameter | Type | Description |
6464
| ------------- |-----------------------------------------| -------------------- |
65-
| `transaction` | [`Transaction`](/sdk/python/types#transaction) | Transaction request. |
65+
| `transaction` | [`Transaction`](/sdk/python/api/types#transaction) | Transaction request. |
6666

6767
[web3.py implementation.](https://web3py.readthedocs.io/en/stable/web3.eth.html#web3.eth.Eth.estimate_gas)
6868

@@ -110,7 +110,7 @@ to get the transfer transaction and sends it to the `eth_estimate_gas` method.
110110

111111
| Parameter | Type | Description |
112112
| ------------- | --------------------------------------- | ------------------------- |
113-
| `transaction` | [`Transaction`](/sdk/python/types#transaction) | Transaction. |
113+
| `transaction` | [`Transaction`](/sdk/python/api/types#transaction) | Transaction. |
114114
| `token` | Address string | Token address (optional). |
115115

116116
#### Example
@@ -134,7 +134,7 @@ Returns gas estimation for an L1 to L2 execute operation.
134134

135135
| Parameter | Type |
136136
| ------------- | --------------------------------------- |
137-
| `Transaction` | [`Transaction`](/sdk/python/types#transaction) |
137+
| `Transaction` | [`Transaction`](/sdk/python/api/types#transaction) |
138138

139139
#### Example
140140

@@ -211,7 +211,7 @@ if __name__ == "__main__":
211211

212212
### `zks_get_block_details`
213213

214-
Returns [`BlockDetails`](/sdk/python/types#blockdetails) additional ZKsync-specific information about the L2 block.
214+
Returns [`BlockDetails`](/sdk/python/api/types#blockdetails) additional ZKsync-specific information about the L2 block.
215215

216216
Calls the [`zks_getBlockDetails`](https://docs.zksync.io/build/api-reference/zks-rpc#zks_getblockdetailss) JSON-RPC method.
217217

@@ -276,7 +276,7 @@ if __name__ == "__main__":
276276

277277
### `getContractAccountInfo`
278278

279-
Returns [`ContractAccountInfo`](/sdk/python/types#contractaccountinfo) class with version of the supported account
279+
Returns [`ContractAccountInfo`](/sdk/python/api/types#contractaccountinfo) class with version of the supported account
280280
abstraction and nonce ordering from a given contract address.
281281

282282
#### Inputs
@@ -295,7 +295,7 @@ result = zksync_web3.zksync.get_contract_account_info(contract_address)
295295

296296
### `zks_get_bridge_contracts`
297297

298-
Returns [`BridgeAddresses`](/sdk/python/types#bridgeaddresses) class containing addresses of the default ZKsync Era
298+
Returns [`BridgeAddresses`](/sdk/python/api/types#bridgeaddresses) class containing addresses of the default ZKsync Era
299299
bridge contracts on both L1 and L2.
300300

301301
```python
@@ -477,7 +477,7 @@ Returns the populated transfer transaction.
477477

478478
| Name | Description |
479479
| ---------- |------------------------------------------------------|
480-
| transaction | [`TransferTransaction`](/sdk/python/types#withdrawtransaction) |
480+
| transaction | [`TransferTransaction`](/sdk/python/api/types#withdrawtransaction) |
481481
| `from` | From address. |
482482

483483
#### Examples
@@ -515,7 +515,7 @@ Returns the populated withdrawal transaction.
515515

516516
| Name | Description |
517517
| ---------- |------------------------------------------------------|
518-
| transaction | [`WithdrawTransaction`](/sdk/python/types#withdrawtransaction) |
518+
| transaction | [`WithdrawTransaction`](/sdk/python/api/types#withdrawtransaction) |
519519
| `from` | From address. |
520520

521521
#### Examples

content/sdk/30.python/02.api/01.accounts/00.introduction.md

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ description: Overview of account functionalities in the ZKsync Python SDK.
44
tags: ["web3", "blockchain", "zksync", "accounts"]
55
---
66

7-
The ZKsync Python SDK offers a comprehensive suite of tools to manage accounts and perform various operations on the
8-
ZKsync network. This includes creating wallets, signing transactions, verifying signatures, and interacting with smart contracts.
7+
The ZKsync Python SDK has a method that generates a signature and a method that verifies messages.
8+
9+
::callout{icon="i-heroicons-light-bulb"}
10+
For constructing the instance it needs only `account` and `chain_id`.
11+
::
912

1013
### Key Features
1114

@@ -27,41 +30,45 @@ ZKsync network. This includes creating wallets, signing transactions, verifying
2730
- Method to verify the signed EIP712-typed ZKsync transactions, ensuring that the transactions are authentic and
2831
have not been tampered with.
2932

30-
### Example Usage
31-
32-
Creating a wallet from a private key and interacting with the ZKsync network:
33+
#### Example
3334

3435
```python
3536
from zksync2.signer.eth_signer import PrivateKeyEthSigner
3637
from eth_account import Account
3738
from zksync2.module.module_builder import ZkSyncBuilder
3839

40+
3941
account = Account.from_key("PRIVATE_KEY")
4042
zksync_web3 = ZkSyncBuilder.build("ZKSYNC_NETWORK_URL")
4143

4244
chain_id = zksync_web3.zksync.chain_id
4345
signer = PrivateKeyEthSigner(account, chain_id)
46+
4447
```
4548

46-
Signing a typed data transaction:
49+
### sign_typed_data
4750

48-
```python
49-
from zksync2.core.types import TxFunctionCall
50-
51-
func_call = TxFunctionCall(
52-
chain_id=chain_id,
53-
nonce=nonce,
54-
from_=account.address,
55-
to=saccount.address,
56-
gas_limit=0,
57-
gas_price=gas_price,
58-
)
59-
signed_message = signer.sign_typed_data(func_call.tx)
60-
```
51+
The signer is used to generate the signature of the provided transaction based on your account(your private key).
6152

62-
Verifying a signed transaction:
53+
#### Parameters
6354

64-
```python
65-
is_valid = signer.verify_typed_data(signed_message, func_call.tx)
66-
print("Signature valid:", is_valid)
67-
```
55+
| Parameters | Return value | Description |
56+
| --------------------------------- | --------------------- | --------------------------------------------------------------------------- |
57+
| EIP712 Structure, optional domain | Web3 py SignedMessage | Builds `SignedMessage` based on the encoded in `EIP712` format Transaction. |
58+
59+
### verify_typed_data
60+
61+
It's used to verify the provided transaction, whose signature is added to the final `EIP712` transaction for its validation.
62+
63+
#### Parameters
64+
65+
| Parameters | Return value | Description |
66+
| -------------------------------------------- | ------------ | ------------------------------------------------------------------------------ |
67+
| signature, EIP712 structure, optional domain | bool | Returns **True** if the encoded transaction is signed with provided signature. |
68+
69+
The signer class also has the following properties:
70+
71+
| Attribute | Description |
72+
| --------- | ------------------------------------------------------------------------------- |
73+
| address | Account address |
74+
| domain | Domain that is used to generate signature. It depends on `chain_id` of network. |

0 commit comments

Comments
 (0)