TypeScript Interface for Ethereum
Subclass for an "Atomicity not supported" EIP-5792 error.
Subclass for an "Atomic-ready wallet rejected upgrade" EIP-5792 error.
Compute commitments from a list of blobs.
Compute the proofs for a list of blobs and their commitments.
Represents a block number in the blockchain.
Specifies a particular block in the blockchain.
Encodes a boolean into a byte array.
Encodes a boolean into a hex string
Creates a branded type of T with the brand U.
Subclass for an "Bundle too large" EIP-5792 error.
Decodes a byte array into a bigint.
Decodes a byte array into a boolean.
Encodes a bytes array into a hex string
Decodes a byte array into a number.
Decodes a byte array into a UTF-8 string.
Subclass for an "Chain Disconnected" EIP-1193 error.
Transform a list of commitments to their versioned hashes.
Transform a commitment to it's versioned hash.
Defines a KZG interface.
Subclass for an "Duplicate ID" EIP-5792 error.
bytes32-flavored ERC-20 for tokens (ie. Maker) that use bytes32 instead of string.
Converts numerical wei to a string representation of ether.
Converts numerical wei to a string representation of gwei.
Divides a number by a given exponent of base 10 (10exponent), and formats it into a string representation of the number..
Decodes a byte array into a UTF-8 string, hex value, number, bigint or boolean.
Decodes a hex string into a string, number, bigint, boolean, or byte array.
Gets type-safe interface for performing contract-related actions with a specific abi and address.
Decodes a hex value into a bigint.
Decodes a hex value into a boolean.
Encodes a hex string into a byte array.
Decodes a hex string into a number.
Decodes a hex value into a UTF-8 string.
Subclass for an "Internal error" EIP-1474 error.
Subclass for an "Invalid input" EIP-1474 error.
Subclass for an "Invalid params" EIP-1474 error.
Subclass for a "Invalid request" EIP-1474 error.
Whether or not the signature is an ERC-6492 formatted signature.
Whether or not the signature is an ERC-8010 formatted signature.
Subclass for a "JSON-RPC version not supported" EIP-1474 error.
Subclass for a "Limit exceeded" EIP-1474 error.
Subclass for a "Method not found" EIP-1474 error.
Subclass for a "Method not supported" EIP-1474 error.
Removes readonly from all properties of an object.
Encodes a number into a byte array.
Encodes a number or bigint into a hex string
Converts a string representation of ether to numerical wei.
Extracts & decodes logs matching the provided signature(s) (abi + optional eventName)
from a set of opaque logs.
Converts a string representation of gwei to numerical wei.
Subclass for a "Parse error" EIP-1474 error.
Multiplies a string representation of a number by a given exponent of base 10 (10exponent).
Subclass for an "Disconnected" EIP-1193 error.
Error subclass implementing Ethereum Provider errors per EIP-1193.
- call
- createAccessList
- createBlockFilter
- createContractEventFilter
- createEventFilter
- createPendingTransactionFilter
- estimateContractGas
- estimateFeesPerGas
- estimateGas
- estimateMaxPriorityFeePerGas
- fillTransaction
- getBalance
- getBlobBaseFee
- getBlock
- getBlockNumber
- getBlockTransactionCount
- getBytecode
- getChainId
- getCode
- getContractEvents
- getEip712Domain
- getEnsAddress
- getEnsAvatar
- getEnsName
- getEnsResolver
- getEnsText
- getFeeHistory
- getFilterChanges
- getFilterLogs
- getGasPrice
- getLogs
- getProof
- getStorageAt
- getTransaction
- getTransactionConfirmations
- getTransactionCount
- getTransactionReceipt
- multicall
- prepareTransactionRequest
- readContract
- sendRawTransaction
- sendRawTransactionSync
- simulate
- simulateBlocks
- simulateCalls
- simulateContract
- uninstallFilter
- verifyHash
- verifyMessage
- verifySiweMessage
- verifyTypedData
- waitForTransactionReceipt
- watchBlockNumber
- watchBlocks
- watchContractEvent
- watchEvent
- watchPendingTransactions
Subclass for a "Resource not found" EIP-1474 error.
Error subclass implementing JSON RPC 2.0 errors and Ethereum RPC errors per EIP-1474.
Defines a typed JSON-RPC schema for the client. Note: This is a runtime noop function.
A key-value mapping of slot and storage values (supposedly 32 bytes each)
Sets up and returns a KZG interface.
Transforms a list of sidecars to their versioned hashes.
Encodes a UTF-8 string into a byte array.
Encodes a UTF-8 string into a hex string
- dropTransaction
- dumpState
- getAutomine
- getTxpoolContent
- getTxpoolStatus
- impersonateAccount
- increaseTime
- inspectTxpool
- loadState
- mine
- removeBlockTimestampInterval
- reset
- revert
- sendUnsignedTransaction
- setAutomine
- setBalance
- setBlockGasLimit
- setBlockTimestampInterval
- setCode
- setCoinbase
- setIntervalMining
- setLoggingEnabled
- setMinGasPrice
- setNextBlockBaseFeePerGas
- setNextBlockTimestamp
- setNonce
- setRpcUrl
- setStorageAt
- snapshot
- stopImpersonatingAccount
Transforms arbitrary data to blobs.
Transforms arbitrary data (or blobs, commitments, & proofs) into a sidecar array.
Encodes a UTF-8 string, hex value, bigint, number or boolean to a byte array.
Returns the hash (of the function/event signature) for a given event or function definition.
Returns the event selector for a given event definition.
Returns the signature for a given function or event definition.
Returns the function selector for a given function definition.
Encodes a string, number, bigint, or ByteArray into a hex string
Subclass for a "Transaction rejected" EIP-1474 error.
Subclass for an "Unknown bundle ID" EIP-5792 error.
Subclass for an unknown RPC error.
Subclass for an "Unsupported chain id" EIP-5792 error.
Subclass for an "Unsupported non-optional capability" EIP-5792 error.
Subclass for an "Unsupported Method" EIP-1193 error.
Subclass for a "User Rejected Request" EIP-1193 error.
Verify that a message was signed by the provided address.
Verify that a message was signed by the provided address.
Verify that typed data was signed by the provided address.
Creates a nonce manager for auto-incrementing transaction nonces.
Default Nonce Manager with a JSON-RPC source.
Sets extra entropy for signing functions.
Creates a Paymaster Client.
Returns an estimate of gas values necessary to execute the User Operation.
Retrieves paymaster-related User Operation properties to be used for sending the User Operation.
Retrieves paymaster-related User Operation properties to be used for gas estimation.
Returns the EntryPoints that the bundler supports.
Retrieves information about a User Operation given a hash.
Returns the User Operation Receipt given a User Operation hash.
Prepares a User Operation and fills in missing properties.
Broadcasts a User Operation to the Bundler.
Waits for the User Operation to be included on a Block (one confirmation), and then returns the User Operation receipt.
Adds an EVM chain to the wallet.
Executes a new message call immediately without submitting a transaction to the network.
Creates an EIP-2930 access list.
Creates a Filter to listen for new block hashes that can be used with getFilterChanges.
Creates a Filter to retrieve event logs that can be used with getFilterChanges or getFilterLogs.
Creates a Filter to listen for new events that can be used with getFilterChanges.
Creates a Filter to listen for new pending transaction hashes that can be used with getFilterChanges.
Deploys a contract to the network, given bytecode and constructor arguments.
Removes a transaction from the mempool.
Serializes the current state (including contracts code, contract's storage, accounts properties, etc.) into a savable data blob.
Estimates the gas required to successfully execute a contract write function call.
Returns an estimate for the fees per gas (in wei) for a
transaction to be likely included in the next block.
Defaults to chain.fees.estimateFeesPerGas if set.
Estimates the gas necessary to complete a transaction without submitting it to the network.
Returns an estimate for the max priority fee per gas (in wei) for a
transaction to be likely included in the next block.
Defaults to chain.fees.defaultPriorityFee if set.
Fills a transaction request with the necessary fields to be signed over.
Returns a list of account addresses owned by the wallet or client.
Returns the automatic mining status of the node.
Returns the balance of an address in wei.
Returns the base fee per blob gas in wei.
Returns information about a block at a block number, hash, or tag.
Returns the number of the most recent block seen.
Returns the number of Transactions at a block number, hash, or tag.
Retrieves the bytecode at an address.
Returns the status of a call batch that was sent via sendCalls.
Extract capabilities that a connected wallet supports (e.g. paymasters, session keys, etc).
Returns the chain ID associated with the current network.
Returns a list of event logs emitted by a contract.
Reads the EIP-712 domain from a contract, based on the ERC-5267 specification.
Gets address for ENS name.
Gets the avatar of an ENS name.
Gets primary name for specified address.
Gets resolver for ENS name.
Gets a text record for specified ENS name.
Returns a collection of historical gas information.
Returns a list of logs or hashes based on a Filter since the last time it was called.
Returns a list of event logs since the filter was created.
Returns the current price of gas (in wei).
Returns a list of event logs matching the provided parameters.
Gets the wallets current permissions.
Returns the account and storage values of the specified account including the Merkle-proof.
Returns the value from a storage slot at a given address.
Returns information about a Transaction given a hash or block identifier.
Returns the number of blocks passed (confirmations) since the transaction was processed on a block.
Returns the number of Transactions an Account has sent.
Returns the Transaction Receipt given a Transaction hash.
Returns the details of all transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only.
Returns a summary of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only.
Impersonate an account or contract address. This lets you send transactions from that account even if you don't have access to its private key.
Jump forward in time by the given amount of time, in seconds.
Returns a summary of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only.
Adds state previously dumped with dumpState to the current chain.
Mine a specified number of blocks.
Similar to readContract, but batches up multiple functions on a contract in a single RPC call via the multicall3 contract.
Prepares a transaction request for signing.
Calls a read-only function on a contract, and returns the response.
Removes setBlockTimestampInterval if it exists.
Requests a list of accounts managed by a wallet.
Requests permissions for a wallet.
Resets fork back to its original state.
Revert the state of the blockchain at the current block.
Requests the connected wallet to send a batch of calls.
Requests the connected wallet to send a batch of calls, and waits for the calls to be included in a block.
Sends a signed transaction to the network
Sends a signed transaction to the network synchronously, and waits for the transaction to be included in a block.
Creates, signs, and sends a new transaction to the network.
Creates, signs, and sends a new transaction to the network synchronously. Returns the transaction receipt.
Executes a transaction regardless of the signature.
Enables or disables the automatic mining of new blocks with each new transaction submitted to the network.
Modifies the balance of an account.
Sets the block's gas limit.
Similar to increaseTime, but sets a block timestamp interval. The timestamp of future blocks will be computed as lastBlock_timestamp + interval.
Modifies the bytecode stored at an account's address.
Sets the coinbase address to be used in new blocks.
Sets the automatic mining interval (in seconds) of blocks. Setting the interval to 0 will disable automatic mining.
Enable or disable logging on the test node network.
Change the minimum gas price accepted by the network (in wei).
Sets the next block's base fee per gas.
Sets the next block's timestamp.
Modifies (overrides) the nonce of an account.
Sets the backend RPC URL.
Writes to a slot of an account's storage.
Requests for the wallet to show information about a call batch
that was sent via sendCalls.
Calculates an Ethereum-specific signature in EIP-191 format: keccak256("\x19Ethereum Signed Message:\n" + len(message) + message)).
Signs a transaction.
Signs typed data and calculates an Ethereum-specific signature in https://eips.ethereum.org/EIPS/eip-712: sign(keccak256("\x19\x01" ‖ domainSeparator ‖ hashStruct(message)))
Simulates a set of calls on block(s) with optional block and state overrides.
Simulates execution of a batch of calls.
Simulates/validates a contract interaction. This is useful for retrieving return data and revert reasons of contract write functions.
Snapshot the state of the blockchain at the current block.
Stop impersonating an account after having previously used impersonateAccount.
Switch the target chain in a wallet.
Destroys a Filter.
Verifies a message hash onchain using ERC-6492.
Verify that a message was signed by the provided address.
Verify that typed data was signed by the provided address.
Waits for the status & receipts of a call bundle that was sent via sendCalls.
Waits for the Transaction to be included on a Block (one confirmation), and then returns the Transaction Receipt.
Adds an EVM chain to the wallet.
Watches and returns incoming block numbers.
Watches and returns information for incoming blocks.
Watches and returns emitted contract event logs.
Watches and returns emitted Event Logs.
Watches and returns pending transaction hashes.
Executes a write function on a contract.
Executes a write function on a contract synchronously. Returns the transaction receipt.
Strict version of built-in Omit type
A suite of EIP-5792 Wallet Actions.
- addChain
- deployContract
- fillTransaction
- getAddresses
- getCallsStatus
- getCapabilities
- getChainId
- getPermissions
- prepareAuthorization
- prepareTransactionRequest
- requestAddresses
- requestPermissions
- sendCalls
- sendCallsSync
- sendRawTransaction
- sendRawTransactionSync
- sendTransaction
- sendTransactionSync
- showCallsStatus
- signAuthorization
- signMessage
- signTransaction
- signTypedData
- switchChain
- waitForCallsStatus
- watchAsset
- writeContract
- writeContractSync
A suite of ERC-7715 Wallet Actions.
A suite of Actions based on Solady contracts.
A suite of ERC-7811 Wallet Actions.
A suite of Actions for ERC-7821.
A suite of ERC-7846 Wallet Actions.
A suite of ERC-7895 Wallet Actions.
Request permissions from a wallet to perform actions on behalf of a user.
Requests for the wallet to sign and broadcast a batch of write contract calls (transactions) to the network.
Estimates the gas and fees per gas necessary to complete a transaction without submitting it to the network.
Prepares parameters for a deposit transaction to be initiated on an L1.
Prepares parameters for a withdrawal from an L2 to the L1.
Builds the transaction that proves a withdrawal was initiated on an L2. Used in the Withdrawal flow.
Initiates a deposit transaction on an L1, which executes a transaction on L2.
Estimates the L1 data fee required to execute an L2 contract write.
Estimates the L1 data gas required to successfully execute a contract write function call.
Estimates the L1 data fee + L2 fee to execute an L2 contract write.
Estimates the L1 data gas + L2 gas required to successfully execute a contract write function call.
Estimates the L1 data fee required to execute an L2 transaction.
Estimates the L1 data gas required to execute an L2 transaction.
Estimates the operator fee required to execute an L2 transaction.
Estimates the L1 data fee + L2 fee + operator fee to execute an L2 transaction.
Estimates the amount of L1 data gas + L2 gas required to execute an L2 transaction.
Finalizes a withdrawal that occurred on an L2. Used in the Withdrawal flow.
Retrieves a valid dispute game on an L2 that occurred after a provided L2 block number.
Retrieves dispute games for an L2.
get the L1 base fee
Retrieves the first L2 output proposal that occurred after a provided block number.
Retrieves the current version of the Portal contract.
Returns the time until the withdrawal transaction can be finalized. Used for the Withdrawal flow.
Returns the time until the next L2 dispute game (after the provided block number) is submitted. Used for the Withdrawal flow.
Returns the time until the next L2 output (after the provided block number) is submitted. Used for the Withdrawal flow.
Returns the time until the withdrawal transaction is ready to prove. Used for the Withdrawal flow.
Returns the current status of a withdrawal. Used for the Withdrawal flow.
Initiates a withdrawal on an L2 to the L1.
Proves a withdrawal that occurred on an L2. Used in the Withdrawal flow.
A suite of Public Actions for suited for development with Layer 2 (OP Stack) chains.
A suite of Public Actions for suited for development with Layer 2 (OP Stack) chains.
Waits for the next dispute game (after the provided block number) to be submitted.
Waits for the next L2 output (after the provided block number) to be submitted.
Waits until the withdrawal transaction can be finalized. Used for the Withdrawal flow.
Waits until the L2 withdrawal transaction is ready to be proved. Used for the Withdrawal flow.
A suite of Wallet Actions for suited for development with Layer 2 (OP Stack) chains.
A suite of Wallet Actions for suited for development with Layer 2 (OP Stack) chains.
Verifies EIP-4361 formatted message was signed.
Retrieves and returns an action from the client (if exists), and falls back to the tree-shakable action.
Withdraws funds from the initiated deposit, which failed when finalizing on L2.
If the deposit L2 transaction has failed, it sends an L1 transaction calling claimFailedDeposit method of the
L1 bridge, which results in returning L1 tokens back to the depositor.
Deploys a contract to the network, given bytecode and constructor arguments using EIP712 transaction.
Transfers the specified token from the associated account on the L1 network to the target account on the L2 network.
The token can be either ETH or any ERC20 token. For ERC20 tokens, enough approved tokens must be associated with
the specified L1 bridge (default one or the one defined in bridgeAddress).
In this case, depending on is the chain ETH-based or not approveToken or approveBaseToken
can be enabled to perform token approval. If there are already enough approved tokens for the L1 bridge,
token approval will be skipped.
Proves the inclusion of the L2->L1 withdrawal message.
Returns the L1 token address equivalent for a L2 token address as they are not equal. ETH address is set to zero address.
Returns the hash of the L2 priority operation from a given L1 transaction receipt.
Returns the L2 token address equivalent for a L1 token address as they are not equal. ETH address is set to zero address.
Returns whether the withdrawal transaction is finalized on the L1 network.
The address of the base token.
The address of the L1 ETH token.
- estimateFee
- estimateGasL1ToL2
- getAllBalances
- getBaseTokenL1Address
- getBlockDetails
- getBridgehubContractAddress
- getDefaultBridgeAddresses
- getGasPerPubdata
- getL1BatchBlockRange
- getL1BatchDetails
- getL1BatchNumber
- getL1ChainId
- getL1TokenAddress
- getL2TokenAddress
- getLogProof
- getMainContractAddress
- getRawBlockTransaction
- getTestnetPaymasterAddress
- getTransactionDetails
Requests execution of a L2 transaction from L1.
Creates, signs, and sends a new EIP712 transaction to the network.
Creates, signs, and sends a new transaction to the network.
Signs an EIP712 transaction.
Signs a transaction.
Creates a ZKsync Smart Account from a Contract Address and an array of Private Keys belonging to the owners.
Creates a ZKsync Smart Account from a Contract Address and a Private Key belonging to the owner.
Creates a ZKsync Smart Account from a Contract Address and a custom sign function.
Converts and returns the msg.sender viewed on L2 to the address that submitted a transaction to the inbox on L1.
Initiates the withdrawal process which withdraws ETH or any ERC20 token from the associated account on L2 network to the target account on L1 network.