Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update links
Browse files Browse the repository at this point in the history
Ngozi-Txfusion committed Jul 6, 2024
1 parent bcc7d35 commit f661742
Showing 16 changed files with 105 additions and 98 deletions.
10 changes: 5 additions & 5 deletions content/sdk/20.go/01.guides/01.features.md
Original file line number Diff line number Diff line change
@@ -21,14 +21,14 @@ This document will focus solely on how to pass these arguments to the SDK.

## EIP-712 Metadata

[`EIP712Meta`](/sdk/go/types/types#eip712meta) contains EIP-712 transaction metadata.
[`EIP712Meta`](/sdk/go/api/types/types#eip712meta) contains EIP-712 transaction metadata.
The following objects contain `EIP712Meta` and provides working with
EIP-712 transactions:

- [`types.CallMsg`](/sdk/go/types/types#callmsg)
- [`types.Transaction712`](/sdk/go/types/types#transaction712)
- [`accounts.CallMsg`](/sdk/go/types/types#callmsg)
- [`accounts.Transaction`](/sdk/go/types/types#transactiondetails)
- [`types.CallMsg`](/sdk/go/api/types/types#callmsg)
- [`types.Transaction712`](/sdk/go/api/types/types#transaction712)
- [`accounts.CallMsg`](/sdk/go/api/types/types#callmsg)
- [`accounts.Transaction`](/sdk/go/api/types/types#transactiondetails)

## Encoding paymaster params

25 changes: 13 additions & 12 deletions content/sdk/20.go/02.api/00.clients/01.baseclient.md
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ defer wsClient.Close()

Executes a log filter operation, blocking during execution, and returns all the results in one batch. This method is
a replacement for `FilterLogs` because the returned `types.Log` type does not contain additional data specific to L2,
as found in [`Log`](/sdk/go/types/types#log). The `FilterLogs` method is kept in order to be compatible with `bind.ContractBackend`,
as found in [`Log`](/sdk/go/api/types/types#log). The `FilterLogs` method is kept in order to be compatible with `bind.ContractBackend`,
and this method can be used, but additional L2 data won't be retrieved.

#### Inputs
@@ -95,7 +95,8 @@ for _, l := range zkLogs {

Creates a background log filtering operation, returning a subscription immediately, which can be used to stream the
found events. This method is a replacement for `SubscribeFilterLogs` because the returned `types.Log` type does not
contain additional data specific to L2, as found in [`Log`](/sdk/go/types/types#log). The `SubscribeFilterLogs` method is
contain additional data specific to L2, as found
in [`Log`](/sdk/go/api/types/types#log). The `SubscribeFilterLogs` method is
kept in order to be compatible with `bind.ContractBackend`, and this method can be used, but additional L2 data
won't be retrieved.

@@ -105,7 +106,7 @@ won't be retrieved.
| --------- | --------------------------------------------------------------------------------------------- | -------------------------- |
| `ctx` | `context.Context` | Context. |
| `query` | [`ethereum.FilterQuery`](https://pkg.go.dev/github.com/ethereum/[email protected]#FilterQuery) | Filter query parameters. |
| `ch` | [`chan<- zkTypes.Log`](/sdk/go/types/types#log) | Channel that receives Log. |
| `ch` | [`chan<- zkTypes.Log`](/sdk/go/api/types/types#log) | Channel that receives Log. |

```go
SubscribeFilterLogsL2(ctx context.Context, query ethereum.FilterQuery, ch chan<- zkTypes.Log) (ethereum.Subscription, error)
@@ -152,7 +153,7 @@ but never mined into the blockchain.
| Parameter | Type | Description |
| ------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ctx` | `context.Context` | Context. |
| `msg` | [`zkTypes.CallMsg`](/sdk/go/types/types#callmsg) | Contains parameters for contract call using EIP-712 transaction. |
| `msg` | [`zkTypes.CallMsg`](/sdk/go/api/types/types#callmsg) | Contains parameters for contract call using EIP-712 transaction. |
| `blockNumber` | `*big.Int` (optional) | Selects the block height at which the call runs. It can be `nil`, in which case the code is taken from the latest known block. Note that state from very old blocks might not be available. |

```go
@@ -201,7 +202,7 @@ block height.
| Parameter | Type | Description |
| ----------- | ---------------------------------------- | ---------------------------------------------------------------- |
| `ctx` | `context.Context` | Context. |
| `msg` | [`zkTypes.CallMsg`](/sdk/go/types/types#callmsg) | Contains parameters for contract call using EIP-712 transaction. |
| `msg` | [`zkTypes.CallMsg`](/sdk/go/api/types/types#callmsg) | Contains parameters for contract call using EIP-712 transaction. |
| `blockHash` | `common.Hash` | Block hash. |

```go
@@ -218,7 +219,7 @@ pending state.
| Parameter | Type | Description |
| --------- | ---------------------------------------- | ---------------------------------------------------------------- |
| `ctx` | `context.Context` | Context. |
| `msg` | [`zkTypes.CallMsg`](/sdk/go/types/types#callmsg) | Contains parameters for contract call using EIP-712 transaction. |
| `msg` | [`zkTypes.CallMsg`](/sdk/go/api/types/types#callmsg) | Contains parameters for contract call using EIP-712 transaction. |

```go
PendingCallContractL2(ctx context.Context, msg zkTypes.CallMsg) ([]byte, error)
@@ -235,7 +236,7 @@ transactions may be added or removed by miners, but it should provide a basis fo
| Parameter | Type | Description |
| --------- | ---------------------------------------- | ---------------------------------------------------------------- |
| `ctx` | `context.Context` | Context. |
| `msg` | [`zkTypes.CallMsg`](/sdk/go/types/types#callmsg) | Contains parameters for contract call using EIP-712 transaction. |
| `msg` | [`zkTypes.CallMsg`](/sdk/go/api/types/types#callmsg) | Contains parameters for contract call using EIP-712 transaction. |

```go
EstimateGasL2(ctx context.Context, msg zkTypes.CallMsg) (uint64, error)
@@ -1069,7 +1070,7 @@ Returns the fee for the transaction.
| Parameter | Type | Description |
| --------- | ---------------------------------------- | ---------------------------------------------------------------- |
| `ctx` | `context.Context` | Context. |
| `msg` | [`zkTypes.CallMsg`](/sdk/go/types/types#callmsg) | Contains parameters for contract call using EIP-712 transaction. |
| `msg` | [`zkTypes.CallMsg`](/sdk/go/api/types/types#callmsg) | Contains parameters for contract call using EIP-712 transaction. |

```go
EstimateFee(ctx context.Context, tx zkTypes.CallMsg) (*zkTypes.Fee, error)
@@ -1102,7 +1103,7 @@ Estimates the amount of gas required to submit a transaction from L1 to L2.
| Parameter | Type | Description |
| --------- | ---------------------------------------- | ---------------------------------------------------------------- |
| `ctx` | `context.Context` | Context. |
| `msg` | [`zkTypes.CallMsg`](/sdk/go/types/types#callmsg) | Contains parameters for contract call using EIP-712 transaction. |
| `msg` | [`zkTypes.CallMsg`](/sdk/go/api/types/types#callmsg) | Contains parameters for contract call using EIP-712 transaction. |

```go
EstimateGasL1(ctx context.Context, tx zkTypes.CallMsg) (uint64, error)
@@ -1137,7 +1138,7 @@ Estimates the amount of gas required for a transfer transaction.
| Parameter | Type | Description |
| --------- | -------------------------------------------------- | -------------------------------------- |
| `ctx` | `context.Context` | Context. |
| `msg` | [`TransferCallMsg`](/sdk/go/types/accounts#transfercallmsg) | Contains parameters for transfer call. |
| `msg` | [`TransferCallMsg`](/sdk/go/api/accounts/types#transfercallmsg) | Contains parameters for transfer call. |

```go
EstimateGasTransfer(ctx context.Context, msg TransferCallMsg) (uint64, error)
@@ -1167,7 +1168,7 @@ Estimates the amount of gas required for a withdrawal transaction.
| Parameter | Type | Description |
| --------- | ------------------------------------------------------ | ---------------------------------------- |
| `ctx` | `context.Context` | Context. |
| `msg` | [`WithdrawalCallMsg`](/sdk/go/types/accounts#withdrawalcallmsg) | Contains parameters for withdrawal call. |
| `msg` | [`WithdrawalCallMsg`](/sdk/go/api/accounts/types#withdrawalcallmsg) | Contains parameters for withdrawal call. |

```go
EstimateGasWithdraw(ctx context.Context, msg WithdrawalCallMsg) (uint64, error)
@@ -1197,7 +1198,7 @@ Estimates the amount of gas required for an L1 to L2 execute operation.
| Parameter | Type | Description |
| --------- | ------------------------------------------- | ---------------------------------------------------------------- |
| `ctx` | `context.Context` | Context. |
| `msg` | [`zkTypes.CallMsg`](/sdk/go/types/accounts#callmsg) | Contains parameters for contract call using EIP-712 transaction. |
| `msg` | [`zkTypes.CallMsg`](/sdk/go/api/accounts/types#callmsg) | Contains parameters for contract call using EIP-712 transaction. |

```go
EstimateL1ToL2Execute(ctx context.Context, msg zkTypes.CallMsg) (uint64, error)
16 changes: 8 additions & 8 deletions content/sdk/20.go/02.api/01.accounts/02.basedeployer.md
Original file line number Diff line number Diff line change
@@ -24,8 +24,8 @@ Deploys smart contract using CREATE2 method.

| Parameter | Type | Description |
| --------- | --------------------------------------------------------- | ------------------------------- |
| `auth` | [`*TransactOpts`](/sdk/go/types/accounts#transactopts) (optional) | Transaction options. |
| `tx` | [`Create2Transaction`](/sdk/go/types/accounts#create2transaction) | CREATE2 transaction parameters. |
| `auth` | [`*TransactOpts`](/sdk/go/api/accounts/types#transactopts) (optional) | Transaction options. |
| `tx` | [`Create2Transaction`](/sdk/go/api/accounts/types#create2transaction) | CREATE2 transaction parameters. |

```go
Deploy(auth *TransactOpts, tx Create2Transaction) (common.Hash, error)
@@ -55,8 +55,8 @@ Deploys smart contract using CREATE method.

| Parameter | Type | Description |
| --------- | ------------------------------------------------------- | ------------------------------ |
| `auth` | [`*TransactOpts`](/sdk/go/types/accounts#transactopts) (optional) | Transaction options. |
| `tx` | [`CreateTransaction`](/sdk/go/types/accounts#createtransaction) | CREATE transaction parameters. |
| `auth` | [`*TransactOpts`](/sdk/go/api/accounts/types#transactopts) (optional) | Transaction options. |
| `tx` | [`CreateTransaction`](/sdk/go/api/accounts/types#createtransaction) | CREATE transaction parameters. |

```go
DeployWithCreate(auth *TransactOpts, tx CreateTransaction) (common.Hash, error)
@@ -86,8 +86,8 @@ Deploys smart account using CREATE2 method.

| Parameter | Type | Description |
| --------- | --------------------------------------------------------- | ------------------------------- |
| `auth` | [`*TransactOpts`](/sdk/go/types/accounts#transactopts) (optional) | Transaction options. |
| `tx` | [`Create2Transaction`](/sdk/go/types/accounts#create2transaction) | CREATE2 transaction parameters. |
| `auth` | [`*TransactOpts`](/sdk/go/api/accounts/types#transactopts) (optional) | Transaction options. |
| `tx` | [`Create2Transaction`](/sdk/go/api/accounts/types#create2transaction) | CREATE2 transaction parameters. |

```go
DeployAccount(auth *TransactOpts, tx Create2Transaction) (common.Hash, error)
@@ -130,8 +130,8 @@ Deploys smart account using CREATE method.

| Parameter | Type | Description |
| --------- | ------------------------------------------------------- | ------------------------------ |
| `auth` | [`*TransactOpts`](/sdk/go/types/accounts#transactopts) (optional) | Transaction options. |
| `tx` | [`CreateTransaction`](/sdk/go/types/accounts#createtransaction) | CREATE transaction parameters. |
| `auth` | [`*TransactOpts`](/sdk/go/api/accounts/types#transactopts) (optional) | Transaction options. |
| `tx` | [`CreateTransaction`](/sdk/go/api/accounts/types#createtransaction) | CREATE transaction parameters. |

```go
DeployAccountWithCreate(auth *TransactOpts, tx CreateTransaction) (common.Hash, error)
2 changes: 1 addition & 1 deletion content/sdk/20.go/02.api/01.accounts/03.wallet.md
Original file line number Diff line number Diff line change
@@ -93,7 +93,7 @@ Returns a new instance of `Wallet` with the provided client for the L2 network.

| Parameter | Type | Description |
| --------- | ---------------------------- | ----------- |
| `client` | [`*clients.Client`](/sdk/go/clients) | L2 client. |
| `client` | [`*clients.Client`](/sdk/go/api/clients/introduction) | L2 client. |

```go
Connect(client *clients.Client) (*Wallet, error)
36 changes: 18 additions & 18 deletions content/sdk/20.go/02.api/01.accounts/04.walletl1.md
Original file line number Diff line number Diff line change
@@ -124,7 +124,7 @@ Returns the address of the base token on L1.

| Parameter | Type | Description |
|-----------|----------------------------------------------------------| ----------- |
| `opts` | [`CallOpts`](/sdk/go/types/accounts#callopts) (optional) | Call options. |
| `opts` | [`CallOpts`](/sdk/go/api/accounts/types#callopts) (optional) | Call options. |

```go
BaseToken(opts *CallOpts) (common.Address, error)
@@ -172,7 +172,7 @@ Returns the balance of the specified token on L1 that can be either ETH or any E

| Parameter | Type | Description |
| --------- | ------------------------------------------------ | -------------- |
| `opts` | [`CallOpts`](/sdk/go/types/accounts#callopts) (optional) | Call options. |
| `opts` | [`CallOpts`](/sdk/go/api/accounts/types#callopts) (optional) | Call options. |
| `token` | `common.Address` | Token address. |

```go
@@ -197,7 +197,7 @@ Returns the amount of approved tokens for a specific L1 bridge.

| Parameter | Type | Description |
| --------------- | ------------------------------------------------ | --------------- |
| `opts` | [`CallOpts`](/sdk/go/types/accounts#callopts) (optional) | Call options. |
| `opts` | [`CallOpts`](/sdk/go/api/accounts/types#callopts) (optional) | Call options. |
| `token` | `common.Address` | Token address. |
| `bridgeAddress` | `common.Address` | Bridge address. |

@@ -289,7 +289,7 @@ Returns base cost for L2 transaction.

| Parameter | Type | Description |
| ------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------- |
| `opts` | [`CallOpts`](/sdk/go/types/accounts#callopts) (optional) | Call options. |
| `opts` | [`CallOpts`](/sdk/go/api/accounts/types#callopts) (optional) | Call options. |
| `gasLimit` | `*big.Int` | The gasLimit for the the L2 contract call. |
| `gasPerPubdataByte` | `*big.Int` | The L2 gas price for each published L1 calldata byte. |
| `gasPrice` | `*big.Int` (optional) | The L1 gas price of the L1 transaction that will send the request for an execute call. |
@@ -323,8 +323,8 @@ allowance is calculated solely based on the specified amount.

| Parameter | Type | Description |
|---------------------| ---------------------------------------- | -------------------------------------------------------------------------------------- |
| `opts` | [`CallOpts`](/sdk/go/types/accounts#callopts) (optional) | Call options. |
| `msg` | [`DepositCallMsg`](/sdk/go/types/accounts#depositcallmsg) | Deposit call parameters. |
| `opts` | [`CallOpts`](/sdk/go/api/accounts/types#callopts) (optional) | Call options. |
| `msg` | [`DepositCallMsg`](/sdk/go/api/accounts/types#depositcallmsg) | Deposit call parameters. |

```go
DepositAllowanceParams(opts *CallOpts, msg DepositCallMsg) ([]struct {
@@ -490,8 +490,8 @@ skipped. To check the amount of approved tokens for a specific bridge, use the [

| Parameter | Type | Description |
| --------- | --------------------------------------------------------- |--------------------------------|
| `auth` | [`*TransactOpts`](/sdk/go/types/accounts#transactopts) (optional) | Transaction options. |
| `tx` | [`DepositTransaction`](/sdk/go/types/accounts#deposittransaction) | Deposit transaction parameters.|
| `auth` | [`*TransactOpts`](/sdk/go/api/accounts/types#transactopts) (optional) | Transaction options. |
| `tx` | [`DepositTransaction`](/sdk/go/api/accounts/types#deposittransaction) | Deposit transaction parameters.|

```go
Deposit(auth *TransactOpts, tx DepositTransaction) (*types.Transaction, error)
@@ -664,7 +664,7 @@ included in the estimation.
| Parameter | Type | Description |
| --------- | ------------------------------------------------- | ------------------------ |
| `ctx` | `context.Context` | Context. |
| `msg` | [`DepositCallMsg`](/sdk/go/types/accounts#depositcallmsg) | Deposit call parameters. |
| `msg` | [`DepositCallMsg`](/sdk/go/api/accounts/types#depositcallmsg) | Deposit call parameters. |

```go
EstimateGasDeposit(ctx context.Context, msg DepositCallMsg) (uint64, error)
@@ -693,7 +693,7 @@ Retrieves the full needed ETH fee for the deposit on both L1 and L2 networks.
| Parameter | Type | Description |
| --------- | ------------------------------------------------- | ------------------------ |
| `ctx` | `context.Context` | Context. |
| `msg` | [`DepositCallMsg`](/sdk/go/types/accounts#depositcallmsg) | Deposit call parameters. |
| `msg` | [`DepositCallMsg`](/sdk/go/api/accounts/types#depositcallmsg) | Deposit call parameters. |

```go
FullRequiredDepositFee(ctx context.Context, msg DepositCallMsg) (*FullDepositFee, error)
@@ -721,7 +721,7 @@ Proves the inclusion of the L2 -> L1 withdrawal message.

| Parameter | Type | Description |
| ---------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `auth` | [`*TransactOpts`](/sdk/go/types/accounts#transactopts) (optional) | Transaction options. |
| `auth` | [`*TransactOpts`](/sdk/go/api/accounts/types#transactopts) (optional) | Transaction options. |
| `withdrawalHash` | `common.Hash` | Hash of the L2 transaction where the withdrawal was initiated. |
| `index` | `int` | In case there were multiple withdrawals in one transaction, you may pass an index of the withdrawal you want to finalize. |

@@ -748,7 +748,7 @@ Checks if the withdrawal finalized on L1 network.

| Parameter | Type | Description |
| ---------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
| `opts` | [`CallOpts`](/sdk/go/types/accounts#callopts) (optional) | Call options. |
| `opts` | [`CallOpts`](/sdk/go/api/accounts/types#callopts) (optional) | Call options. |
| `withdrawalHash` | `common.Hash` | Hash of the L2 transaction where the withdrawal was initiated. |
| `index` | `int` | In case there where multiple withdrawals in one transaction, you may pass an index of the withdrawal you want to finalize. |

@@ -777,7 +777,7 @@ L1 tokens back to the depositor, otherwise throws the error.

| Parameter | Type | Description |
| ------------- | --------------------------------------------------------- | ---------------------------------------------- |
| `auth` | [`*TransactOpts`](/sdk/go/types/accounts#transactopts) (optional) | Transaction options. |
| `auth` | [`*TransactOpts`](/sdk/go/api/accounts/types#transactopts) (optional) | Transaction options. |
| `depositHash` | `common.Hash` | The L2 transaction hash of the failed deposit. |

```go
@@ -803,8 +803,8 @@ Request execution of L2 transaction from L1.

| Parameter | Type | Description |
| --------- | ----------------------------------------------------------------------- | --------------------------------------- |
| `auth` | [`*TransactOpts`](/sdk/go/types/accounts#transactopts) (optional) | Transaction options. |
| `tx` | [`RequestExecuteTransaction`](/sdk/go/types/accounts#requestexecutetransaction) | Request execute transaction parameters. |
| `auth` | [`*TransactOpts`](/sdk/go/api/accounts/types#transactopts) (optional) | Transaction options. |
| `tx` | [`RequestExecuteTransaction`](/sdk/go/api/accounts/types#requestexecutetransaction) | Request execute transaction parameters. |

```go
RequestExecute(auth *TransactOpts, tx RequestExecuteTransaction) (*types.Transaction, error)
@@ -836,7 +836,7 @@ Estimates the amount of gas required for a request execute transaction.
| Parameter | Type | Description |
| --------- | --------------------------------------------------------------- | -------------------------------- |
| `ctx` | `context.Context` | Context. |
| `msg` | [`RequestExecuteCallMsg`](/sdk/go/types/accounts#requestexecutecallmsg) | Request execute call parameters. |
| `msg` | [`RequestExecuteCallMsg`](/sdk/go/api/accounts/types#requestexecutecallmsg) | Request execute call parameters. |

```go
EstimateGasRequestExecute(ctx context.Context, msg RequestExecuteCallMsg) (uint64, error)
@@ -868,8 +868,8 @@ Existing allowance for the bridge is not checked; allowance is calculated solely

| Parameter | Type | Description |
| --------- | --------------------------------------------------------------- | -------------------------------- |
| `opts` | [`CallOpts`](/sdk/go/types/accounts#callopts) (optional) | Call options. |
| `msg` | [`RequestExecuteCallMsg`](/sdk/go/types/accounts#requestexecutecallmsg) | Request execute call parameters. |
| `opts` | [`CallOpts`](/sdk/go/api/accounts/types#callopts) (optional) | Call options. |
| `msg` | [`RequestExecuteCallMsg`](/sdk/go/api/accounts/types#requestexecutecallmsg) | Request execute call parameters. |

```go
RequestExecuteAllowanceParams(opts *CallOpts, msg RequestExecuteCallMsg) (AllowanceParams, error)
24 changes: 12 additions & 12 deletions content/sdk/20.go/02.api/01.accounts/05.walletl2.md
Original file line number Diff line number Diff line change
@@ -153,7 +153,7 @@ Returns the deployment nonce of the account.

| Parameter | Type | Description |
| --------- | ------------------------------------------------ | ------------- |
| `opts` | [`CallOpts`](/sdk/go/types/accounts#callopts) (optional) | Call options. |
| `opts` | [`CallOpts`](/sdk/go/api/accounts/types#callopts) (optional) | Call options. |

```go
func (a *WalletL2) DeploymentNonce(opts *CallOpts) (*big.Int, error)
@@ -205,8 +205,8 @@ to the target account on L1 network.

| Parameter | Type | Description |
| --------- | --------------------------------------------------------------- | ---------------------------------- |
| `auth` | [`*TransactOpts`](/sdk/go/types/accounts#transactopts) (optional) | Transaction options. |
| `tx` | [`WithdrawalTransaction`](/sdk/go/types/accounts#withdrawaltransaction) | Withdrawal transaction parameters. |
| `auth` | [`*TransactOpts`](/sdk/go/api/accounts/types#transactopts) (optional) | Transaction options. |
| `tx` | [`WithdrawalTransaction`](/sdk/go/api/accounts/types#withdrawaltransaction) | Withdrawal transaction parameters. |

```go
Withdraw(auth *TransactOpts, tx WithdrawalTransaction) (*types.Transaction, error)
@@ -235,7 +235,7 @@ Estimates the amount of gas required for a withdrawal transaction.
| Parameter | Type | Description |
| --------- | ------------------------------------------------------- | --------------------------- |
| `ctx` | `context.Context` | Context. |
| `msg` | [`WithdrawalCallMsg`](/sdk/go/types/accounts#withdrawalcallmsg) | Withdrawal call parameters. |
| `msg` | [`WithdrawalCallMsg`](/sdk/go/api/accounts/types#withdrawalcallmsg) | Withdrawal call parameters. |

```go
EstimateGasWithdraw(ctx context.Context, msg WithdrawalCallMsg) (uint64, error)
@@ -263,8 +263,8 @@ Moves the ETH or any ERC20 token from the associated account to the target accou

| Parameter | Type | Description |
| --------- | ----------------------------------------------------------- | -------------------------------- |
| `auth` | [`*TransactOpts`](/sdk/go/types/accounts#transactopts) (optional) | Transaction options. |
| `tx` | [`TransferTransaction`](/sdk/go/types/accounts#transfertransaction) | Transfer transaction parameters. |
| `auth` | [`*TransactOpts`](/sdk/go/api/accounts/types#transactopts) (optional) | Transaction options. |
| `tx` | [`TransferTransaction`](/sdk/go/api/accounts/types#transfertransaction) | Transfer transaction parameters. |

```go
Transfer(auth *TransactOpts, tx TransferTransaction) (*types.Transaction, error)
@@ -293,7 +293,7 @@ Estimates the amount of gas required for a transfer transaction.
| Parameter | Type | Description |
| --------- | --------------------------------------------------- | ------------------------- |
| `ctx` | `context.Context` | Context. |
| `msg` | [`TransferCallMsg`](/sdk/go/types/accounts#transfercallmsg) | Transfer call parameters. |
| `msg` | [`TransferCallMsg`](/sdk/go/api/accounts/types#transfercallmsg) | Transfer call parameters. |

```go
EstimateGasTransfer(ctx context.Context, msg TransferCallMsg) (uint64, error)
@@ -323,7 +323,7 @@ into the blockchain.
| Parameter | Type | Description |
| ------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ctx` | `context.Context` | Context. |
| `msg` | [`CallMsg`](/sdk/go/types/accounts#callmsg) | Contains parameters for contract call using EIP-712 transaction. |
| `msg` | [`CallMsg`](/sdk/go/api/accounts/types#callmsg) | Contains parameters for contract call using EIP-712 transaction. |
| `blockNumber` | `*big.Int` (optional) | Selects the block height at which the call runs. It can be `nil`, in which case the code is taken from the latest known block. Note that state from very old blocks might not be available. |

```go
@@ -365,7 +365,7 @@ fmt.Println("Symbol: ", symbol)
### PopulateTransaction

Designed for users who prefer a simplified approach by providing only the necessary data to create a valid
[EIP-712 transaction](/sdk/go/types/types#transaction712). The only required fields are `Transaction.To` and either
[EIP-712 transaction](/sdk/go/api/types/types#transaction712). The only required fields are `Transaction.To` and either
`Transaction.Data` or `Transaction.Value` (or both, if the method is payable).
Any other fields that are not set will be prepared by this method.

@@ -374,7 +374,7 @@ Any other fields that are not set will be prepared by this method.
| Parameter | Type | Description |
| --------- | ------------------------------------------- | ----------------------- |
| `ctx` | `context.Context` | Context. |
| `tx` | [`Transaction`](/sdk/go/types/accounts#transaction) | Transaction parameters. |
| `tx` | [`Transaction`](/sdk/go/api/accounts/types#transaction) | Transaction parameters. |

```go
PopulateTransaction(ctx context.Context, tx Transaction) (*zkTypes.Transaction712, error)
@@ -417,7 +417,7 @@ transaction with all fields having appropriate values. To obtain a valid transac

| Parameter | Type | Description |
| --------- |----------------------------------------------------------------| ------------------------------- |
| `tx` | [`zkTypes.Transaction712`](/sdk/go/types/types#transaction712) | EIP-712 transaction parameters. |
| `tx` | [`zkTypes.Transaction712`](/sdk/go/api/types/types#transaction712) | EIP-712 transaction parameters. |

```go
SignTransaction(tx *zkTypes.Transaction712) ([]byte, error)
@@ -465,7 +465,7 @@ Injects a transaction into the pending pool for execution. Any unset transaction
| Parameter | Type | Description |
| --------- | ------------------------------------------- | ----------------------- |
| `ctx` | `context.Context` | Context. |
| `tx` | [`Transaction`](/sdk/go/types/accounts#transaction) | Transaction parameters. |
| `tx` | [`Transaction`](/sdk/go/api/accounts/types#transaction) | Transaction parameters. |

```go
SendTransaction(ctx context.Context, tx *Transaction) (common.Hash, error)
6 changes: 3 additions & 3 deletions content/sdk/20.go/02.api/01.accounts/06.smartaccount.md
Original file line number Diff line number Diff line change
@@ -21,9 +21,9 @@ requires private key in hex format to be provided.
|-----------|--------------------------------------------------------------------|---------------------------------------------------------|
| `address` | `common.Address` | Account address. |
| `secret` | `interface{}` | Secret used for signing. |
| `signer` | [`*PayloadSigner`](/sdk/go/types/accounts#payloadsigner) | Function used for signing payload. |
| `builder` | [`*TransactionBuilder`](/sdk/go/types/accounts#transactionbuilder) | Function used for populating transaction. |
| `client` | [`*clients.BaseClient`](/sdk/go/clients#baseclient) | The client to connect to. Can be `nil` for offline usage. |
| `signer` | [`*PayloadSigner`](/sdk/go/api/accounts/types#payloadsigner) | Function used for signing payload. |
| `builder` | [`*TransactionBuilder`](/sdk/go/api/accounts/types#transactionbuilder) | Function used for populating transaction. |
| `client` | [`*clients.BaseClient`](/sdk/go/api/clients/baseclient) | The client to connect to. Can be `nil` for offline usage. |

```go

Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ Creates a `SmartAccount` instance that uses single ECDSA key for signing payload
|--------------|-----------------------------------------------------|----------------------------------------------------------|
| `address` | `common.Address` | Account address. |
| `privateKey` | `string` | The ECDSA private key. |
| `client` | [`*clients.BaseClient`](/sdk/go/clients#baseclient) | The client to connect to. Can be `nil` for offline usage. |
| `client` | [`*clients.BaseClient`](/sdk/go/api/clients/baseclient) | The client to connect to. Can be `nil` for offline usage. |

```go

Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ The signature is generated by concatenating signatures created by signing with e
|---------------|-----------------------------------------------------|-----------------------------------------------------------|
| `address` | `common.Address` | Account address. |
| `privateKeys` | `[]string` | The list of the ECDSA private keys. |
| `client` | [`*clients.BaseClient`](/sdk/go/clients#baseclient) | The client to connect to. Can be `nil` for offline usage. |
| `client` | [`*clients.BaseClient`](/sdk/go/api/clients/baseclient) | The client to connect to. Can be `nil` for offline usage. |

```go
NewMultisigECDSASmartAccount(address common.Address, privateKeys []string, client *clients.BaseClient) *SmartAccount
@@ -43,7 +43,7 @@ detached from any provider if `nil` is provided.

| Parameter | Type | Description |
| --------- |---------------------------------------------------|---------------------------------------------------------------------------------------------------------------|
| `client` | [`*clients.DialBase`](/sdk/go/clients#baseclient) | The client to connect the `SmartAccount` to. If `nil`, the `SmartAccount` will be detached from any provider. |
| `client` | [`*clients.DialBase`](/sdk/go/api/clients/baseclient) | The client to connect the `SmartAccount` to. If `nil`, the `SmartAccount` will be detached from any provider. |

```go
Connect(client *clients.BaseClient) *SmartAccount
@@ -164,7 +164,7 @@ Returns the deployment nonce of the account.

| Parameter | Type | Description |
| --------- | ------------------------------------------------ | ------------- |
| `opts` | [`CallOpts`](/sdk/go/types/accounts#callopts) (optional) | Call options. |
| `opts` | [`CallOpts`](/sdk/go/api/accounts/types#callopts) (optional) | Call options. |

```go
DeploymentNonce(opts *CallOpts) (*big.Int, error)
@@ -181,7 +181,7 @@ if err != nil {

### `PopulateTransaction`

Populates the transaction `tx` using the provided [`TransactionBuilder`](/sdk/go/types/accounts#transactionbuilder) function.
Populates the transaction `tx` using the provided [`TransactionBuilder`](/sdk/go/api/accounts/types#transactionbuilder) function.
If `tx.From` is not set, it sets the value from the `Address()` method which can
be utilized in the `TransactionBuilder` function.

@@ -190,7 +190,7 @@ be utilized in the `TransactionBuilder` function.
| Parameter | Type | Description |
|-----------|----------------------------------------------------------|------------------------------------|
| `ctx` | `context.Context` | Context. |
| `tx` | [`*zkTypes.Transaction712`](/sdk/go/types/types#transaction712) | The transaction that needs to be populated. |
| `tx` | [`*zkTypes.Transaction712`](/sdk/go/api/types/types#transaction712) | The transaction that needs to be populated. |

```go
PopulateTransaction(ctx context.Context, tx *zkTypes.Transaction712) error
@@ -222,7 +222,7 @@ necessary properties for the transaction to be valid have been populated.
| Parameter | Type | Description |
|-----------|---------------------------------------------------------|------------------------------------------|
| `ctx` | `context.Context` | Context. |
| `tx` | [`*zkTypes.Transaction712`](/sdk/go/types/types#transaction712) | The transaction that needs to be signed. |
| `tx` | [`*zkTypes.Transaction712`](/sdk/go/api/types/types#transaction712) | The transaction that needs to be signed. |

```go

@@ -252,7 +252,7 @@ The `SignTransaction` is called first to ensure transaction is properly signed.
| Parameter | Type | Description |
|-----------|---------------------------------------------------------|------------------------------------------|
| `ctx` | `context.Context` | Context. |
| `tx` | [`*zkTypes.Transaction712`](/sdk/go/types/types#transaction712) | The transaction that needs to be signed. |
| `tx` | [`*zkTypes.Transaction712`](/sdk/go/api/types/types#transaction712) | The transaction that needs to be signed. |

```go
SendTransaction(ctx context.Context, tx *zkTypes.Transaction712) (common.Hash, error)
@@ -273,7 +273,7 @@ if err != nil {

### `SignMessage`

Signs a message using the provided [`PayloadSigner`](/sdk/go/types/accounts#payloadsigner) function.
Signs a message using the provided [`PayloadSigner`](/sdk/go/api/accounts/types#payloadsigner) function.

#### Inputs

@@ -297,7 +297,7 @@ if err != nil {

### `SignTypedData`

signs a typed data using the provided [`PayloadSigner`](/sdk/go/types/accounts#payloadsigner) function.
signs a typed data using the provided [`PayloadSigner`](/sdk/go/api/accounts/types#payloadsigner) function.

#### Inputs

@@ -350,8 +350,8 @@ to the target account on L1 network.

| Parameter | Type | Description |
| --------- | --------------------------------------------------------------- | ---------------------------------- |
| `auth` | [`*TransactOpts`](/sdk/go/types/accounts#transactopts) (optional) | Transaction options. |
| `tx` | [`WithdrawalTransaction`](/sdk/go/types/accounts#withdrawaltransaction) | Withdrawal transaction parameters. |
| `auth` | [`*TransactOpts`](/sdk/go/api/accounts/types#transactopts) (optional) | Transaction options. |
| `tx` | [`WithdrawalTransaction`](/sdk/go/api/accounts/types#withdrawaltransaction) | Withdrawal transaction parameters. |

```go
Withdraw(auth *TransactOpts, tx WithdrawalTransaction) (common.Hash, error)
@@ -406,8 +406,8 @@ Moves the ETH or any ERC20 token from the associated account to the target accou

| Parameter | Type | Description |
| --------- | ----------------------------------------------------------- | -------------------------------- |
| `auth` | [`*TransactOpts`](/sdk/go/types/accounts#transactopts) (optional) | Transaction options. |
| `tx` | [`TransferTransaction`](/sdk/go/types/accounts#transfertransaction) | Transfer transaction parameters. |
| `auth` | [`*TransactOpts`](/sdk/go/api/accounts/types#transactopts) (optional) | Transaction options. |
| `tx` | [`TransferTransaction`](/sdk/go/api/accounts/types#transfertransaction) | Transfer transaction parameters. |

```go
Transfer(auth *TransactOpts, tx TransferTransaction) (common.Hash, error)
16 changes: 8 additions & 8 deletions content/sdk/20.go/02.api/01.accounts/08.smart-account-utils.md
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ the ZKsync Era.

### `SignPayloadWithECDSA`

Implementation of [`PayloadSigner`](/sdk/go/types/accounts#payloadsigner) which signs the payload using
Implementation of [`PayloadSigner`](/sdk/go/api/accounts/types#payloadsigner) which signs the payload using
an ECDSA private key.

#### Inputs
@@ -22,7 +22,7 @@ an ECDSA private key.
| `ctx` | `context.Context` | Context. |
| `payload` | `[]byte` | The payload that needs to be signed. |
| `secret` | `string` | The ECDSA private key. |
| `client` | [`*clients.BaseClient`](/sdk/go/clients#baseclient) | Not used and should be `nil`. |
| `client` | [`*clients.BaseClient`](/sdk/go/api/clients/baseclient) | Not used and should be `nil`. |

```go
var SignPayloadWithECDSA PayloadSigner = func(ctx context.Context, payload []byte, secret interface{}, client *clients.BaseClient) ([]byte, error)
@@ -146,7 +146,7 @@ if err != nil {

### `SignPayloadWithMultipleECDSA`

Implementation of [`PayloadSigner`](/sdk/go/types/accounts#payloadsigner) which signs the payload using
Implementation of [`PayloadSigner`](/sdk/go/api/accounts/types#payloadsigner) which signs the payload using
multiple ECDSA private keys.
The signature is generated by concatenating signatures created by signing with each key individually.
The length of the resulting signature is `len(secret) * 65`.
@@ -158,7 +158,7 @@ The length of the resulting signature is `len(secret) * 65`.
| `ctx` | `context.Context` | Context. |
| `payload` | `[]byte` | The payload that needs to be signed. |
| `secret` | `[]string` | The list of the ECDSA private keys. |
| `client` | [`*clients.BaseClient`](/sdk/go/clients#baseclient) | Not used and should be `nil`. |
| `client` | [`*clients.BaseClient`](/sdk/go/api/clients/baseclient) | Not used and should be `nil`. |

```go
var SignPayloadWithMultipleECDSA PayloadSigner = func(ctx context.Context, payload []byte, secret interface{}, client *clients.BaseClient) ([]byte, error)
@@ -305,9 +305,9 @@ Expects the secret to be ECDSA private in hex format.
| Parameter | Type | Description |
|-----------|-----------------------------------------------------------------|------------------------------------|
| `ctx` | `context.Context` | Context. |
| `tx` | [`*zkTypes.Transaction712`](/sdk/go/types/types#transaction712) | The transaction that needs to be populated. |
| `tx` | [`*zkTypes.Transaction712`](/sdk/go/api/types/types#transaction712) | The transaction that needs to be populated. |
| `secret` | `string` | The ECDSA private key. |
| `client` | [`*clients.BaseClient`](/sdk/go/clients#baseclient) | The client which fetches data from the network. |
| `client` | [`*clients.BaseClient`](/sdk/go/api/clients/baseclient) | The client which fetches data from the network. |

```go
var PopulateTransactionECDSA TransactionBuilder = func(ctx context.Context, tx *zkTypes.Transaction712, secret interface{}, client *clients.BaseClient) error
@@ -347,9 +347,9 @@ Expects the secret to be a slice of ECDSA private in hex format.
| Parameter | Type | Description |
|-----------|-----------------------------------------------------------------|-------------------------------------------------|
| `ctx` | `context.Context` | Context. |
| `tx` | [`*zkTypes.Transaction712`](/sdk/go/types/types#transaction712) | The transaction that needs to be populated. |
| `tx` | [`*zkTypes.Transaction712`](/sdk/go/api/types/types#transaction712) | The transaction that needs to be populated. |
| `secret` | `[]string` | The list of the ECDSA private keys. |
| `client` | [`*clients.BaseClient`](/sdk/go/clients#baseclient) | The client which fetches data from the network. |
| `client` | [`*clients.BaseClient`](/sdk/go/api/clients/baseclient) | The client which fetches data from the network. |

```go
var PopulateTransactionMultipleECDSA TransactionBuilder = func(ctx context.Context, tx *zkTypes.Transaction712, secret interface{}, client *clients.BaseClient) error
2 changes: 1 addition & 1 deletion content/sdk/20.go/02.api/01.accounts/09.types.md
Original file line number Diff line number Diff line change
@@ -225,7 +225,7 @@ func (t *TransactOpts) ToTransactOpts(from common.Address, signer bind.SignerFn)

### `Transaction`

Transaction is similar to [`types.Transaction712`](/sdk/go/types/types#eip712txtype) but does not include the From field.
Transaction is similar to [`types.Transaction712`](/sdk/go/api/types/types#eip712txtype) but does not include the From field.
This design is intended for use abstraction which already have an associated account with `AdapterL2`.
The From field is bound to the specific account, and thus, it is not included in this type.

4 changes: 2 additions & 2 deletions content/sdk/20.go/02.api/03.contracts/00.contracts.md
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@ an EIP-712 transaction, the deployment function generated with the `abigen` tool
the `Deploy` interface is created, which provides methods for the deployment of smart contracts and smart
accounts. There are the following objects that implement the `Deploy` interface:

- [`BaseDeployer`](/sdk/go/accounts#basedeployer),
- [`Wallet`](/sdk/go/accounts#wallet).
- [`BaseDeployer`](/sdk/go/api/accounts/basedeployer),
- [`Wallet`](/sdk/go/api/accounts/wallet).

Contract instantiation is the same as in the
[`geth`](https://geth.ethereum.org/docs/developers/dapp-developer/native-bindings)
4 changes: 2 additions & 2 deletions content/sdk/20.go/02.api/04.utilities/00.utils.md
Original file line number Diff line number Diff line change
@@ -209,7 +209,7 @@ Returns the encoded constructor data for CREATE method used for smart account de
| ---------- | -------------------------------------------------------------------------- | ---------------------------------- |
| `bytecode` | `[]byte` | Output from zkSolc. |
| `calldata` | `[]byte` | ABI encoded constructor arguments. |
| `version` | [`types.AccountAbstractionVersion`](/sdk/go/types/types#accountabstractionversion) | Account abstraction version. |
| `version` | [`types.AccountAbstractionVersion`](/sdk/go/api/types/types#accountabstractionversion) | Account abstraction version. |
```go
EncodeCreate2Account(bytecode, calldata, version types.AccountAbstractionVersion) ([]byte, error)
@@ -226,7 +226,7 @@ Returns the encoded constructor data for CREATE2 method used for smart account d
| `bytecode` | `[]byte` | Output from zkSolc. |
| `calldata` | `[]byte` | ABI encoded constructor arguments. |
| `salt` | `[]byte` | Randomization element. |
| `version` | [`types.AccountAbstractionVersion`](/sdk/go/types/types#accountabstractionversion) | Account abstraction version. |
| `version` | [`types.AccountAbstractionVersion`](/sdk/go/api/types/types#accountabstractionversion) | Account abstraction version. |
```go
EncodeCreate2Account(bytecode, calldata, salt []byte, version types.AccountAbstractionVersion) ([]byte, error)
Original file line number Diff line number Diff line change
@@ -71,5 +71,5 @@ Returns a correctly-formed `paymasterParams` object for common paymaster flows.
func GetPaymasterParams(paymasterAddress common.Address, paymasterInput types.PaymasterInput) (*types.PaymasterParams, error)
```

Find out more about the [`PaymasterInput` type](/sdk/go/types/types).
Find out more about the [`PaymasterInput` type](/sdk/go/api/types/types).
Check out the [example](https://github.com/zksync-sdk/zksync2-examples/blob/main/go/18_use_paymaster.go) how to use paymaster.
19 changes: 10 additions & 9 deletions content/sdk/20.go/02.api/05.types/00.intro.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
title: Types
description:
title: Introduction
description: Overview of the different type packages
tags: ["go", "sdk", "types", "zksync"]
---

Types are placed in three packages for different purposes:

- [`types`](/sdk/go/types/types): Contains common and general types used to build basic features and other types.
- [`eip712`](/sdk/go/types/eip712): Contains types used for EIP-712 implementation.
- [`clients`](/sdk/go/types/clients): Contains types that are meant to be used along with [`Client`](/sdk/go/clients).
- [`accounts`](/sdk/go/types/accounts): Contains types that are meant to be used along with an account,
specifically with the [`Adapter`](/sdk/go/types/accounts) abstraction.
Many types are similar to those from the `geth` library, but the `From` or `Signer` fields are omitted
because these fields are inherited from `Adapter`, which already has an associated account.
- [`types`](/sdk/go/api/types/types): Contains common and general types used to build basic features and other types.
- [`eip712`](/sdk/go/api/eip712/eip712): Contains types used for EIP-712 implementation.
- [`clients`](/sdk/go/api/clients/types): Contains types that are meant to be used along with [`Client`](/sdk/go/api/clients/introduction).
- [`accounts`](/sdk/go/api/accounts/types): Contains types that are meant to be used along with an account, specifically
with the [`Adapter`](/sdk/go/api/accounts/types) abstraction. Many types are similar to those from the `geth` library, but
the `From` or `Signer` fields are omitted because these fields are inherited from `Adapter`, which already has an
associated account.
9 changes: 7 additions & 2 deletions content/sdk/20.go/02.api/05.types/04.types.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
---
title: Types Package
description:
title: Types
description: Defines various types for ZKsync Go SDK.
tags: ["go", "zksync", "sdk", "types"]
---

This section provides a list of various types used in the ZKsync Go SDK. These types are categorized based on their
purposes and usage within the SDK. The types are crucial for building features, interacting with contracts, managing
transactions, and handling blockchain data in a ZKsync Era environment.

### `AccountAbstractionVersion`

Represents an enumeration of account abstraction versions.

0 comments on commit f661742

Please sign in to comment.