Client
is defined by the IEthClient
interface.
Creating a client requires a Chain
. This will use our highly available and responsive Node Gateway service for your RPC requests; accessed using the API key from the Builder you’ve provided in your SequenceConfig
scriptable object. If you prefer to use your own RPC URL, you can create a SequenceEthClient
using a URL string as a parameter instead.
You can create a client using this snippet:
Methods
As your connection point to Ethereum nodes, there are a number of methods that can be performed by a client, these can be found in theIEthClient
interface and are implemented by SequenceEthClient
.
Note: with the exception of BalanceAt (potentially), most users will not need to make use of these methods, but we have included them in our documentation for completeness.
BalanceAt
Used to get the gas currency balance of a given wallet at a given blockNumber (in hexadecimal format provided as a string)Unless you really want to get into the weeds with how things work, it is HIGHLY recommended to move on to the next page of the documentation at this point
BlockByNumber
Used to get theBlock
with a specific block number.
BlockByHash
Used to get theBlock
by a specified block hash (string)
BlockNumber
Used to get the most recent block number in hexadecimal formatBlockRange
Used to get aList<Block>
from the blocks in a range specified by blockNumbers
ChainID
Used to get the chain id in hexadecimal format for the chain the client is connected toCodeAt
Used to get the bytecode for a smart contract at a given address in hexadecimal format at a specified blockNumberEstimateGas
Given aTransactionCall
estimate the amount of gas required for the transaction
FeeHistory
Get aFeeHistoryResult
for gas fees paid blockCount blocks since newestBlock (blockNumber)
NetworkId
Used to get the chain id in integer format (as string) for the chain the client is connected toNonceAt
Used to get the recommended nonce for a givenAddress
at a given blockNumber (defaults to “latest”)
SendRawTransaction
Given a signed transaction string, submit the transaction to the network and return a transaction hashSuggestGasPrice
Used to get a suggested gas priceSuggestGasTipCap
Used to get the max suggested priority fee for gasTransactionByHash
Used to get aTransaction
by transaction hash
TransactionCount
Used to get the number of transactions in a block by block hashWaitForTransactionReceipt
Provide a transaction hash in order to wait for and return theTransactionReceipt