use of the constructor is discouraged and isn't guaranteed to be stable. Use the get() function instead.
ReadonlyaccountUser's account data. Will be null if this isn't associated with an account
ReadonlychainThe Sei network ID this client is connected to
ProtectedcometReadonlycosmThe stargateClient needs this to encode things properly.
ReadonlyethereumIf an ethereum wallet is connected, it will be exposed here.
ReadonlyqueryThe underlying query client, used to query the specific modules on Sei.
ReadonlyreadonlyIf this is a read-only account, this says why.
ProtectedsignerReadonlystargateA SigningStargateClient if this ClientEnv is used with an account which can sign transactions, or a
StargateClient otherwise. Used for general network information and optionally signing things.
StaticgasOptionalfunds: Coin[]Optionalfinality: { OptionaltimeoutOptionalfinality: TransactionFinalityEncodes the specified contract instructions into an array of cosmos messages
⚠️ This uses a placeholder typeUrl for EVM invocations, as at the time of writing, Sei does not support
calling the EVM in a top-level cosmos message without an EVM signature. Though the resulting EncodeObject[]
may still be used with cosmosMessagesToEvmMessages and makeHackyTransactionSequenceAsNeeded
contract instructions to encode
Executes a single contract instrcution
⚠️ This currently cannot be used to execute EVM contracts, as the transaction will be signed with a cosmos signature, and Sei currently requires all top-level EVM invocations to have EVM signatures.
The contract instruction to execute.
the transaction hash or its receipt, depending on how finality was specified
Optionalmemo: stringOptionalmemo: stringOptionalfee: "auto" | StdFeeOptionalmemo: stringOptionalfee: "auto" | StdFeeOptionalfinality: { OptionaltimeoutOptionalmemo: stringOptionalfee: "auto" | StdFeeOptionalfinality: TransactionFinalityExecutes the specified contract instructions
⚠️ This currently cannot be used to execute EVM contracts, as the transaction will be signed with a cosmos signature, and Sei currently requires all top-level EVM invocations to have EVM signatures.
the transaction hash or its receipt, depending on how finality was specified
Optionalmemo: stringOptionalmemo: stringOptionalfee: "auto" | StdFeeOptionalmemo: stringOptionalfee: "auto" | StdFeeOptionalfinality: { OptionaltimeoutOptionalmemo: stringOptionalfee: "auto" | StdFeeOptionalfinality: TransactionFinalityConveniently throws an error with the underlying reason if the account property is null
Gets the balance of the specified fungible asset
the fungible to get the balance of
OptionalaccountAddress: stringaccount address, can be a 0x or sei1 address (if they're associated) defaults to this
user's 0x or sei1 address depending on whether which asset is specified.
the raw value. If you wish to make it look pretty, use it with UIAmount.
Gets the total supply of the specified fungible asset.
the asset to look up
the raw value. If you wish to make it look pretty, use it with UIAmount.
If you want to actually check if transactions can be sent, use the isSignable method
true if the wallet is known
true if ethereum transaction signing is available
Optionalfunds: Coin[]true if ethereum transaction signing is available, and cosmos tranasction signing is not available
true if cosmos tranasction signing is available and the wallet is known
true if cosmos tranasction signing and ethereum transaction signing is available
A key compontent in compensating for Sei's idiosyncracies in its CosmWasm <> EVM interop.
Idiosyncracies being:
Additionally, ethereum wallets cannot bundle multiple instructions per transaction.
To help with this, this function takes the EncodeObject[] provided, which may include an internal typeUrl
which reprensts EVM invocations, and seperates them into EVM messages or Cosmos messages as needed.
Makes a read-only call to a solidity contract
The 0x... contract address
Function to call with its return types
Function arguments
the returned values as an array
Makes a read-only call to a solidity contract
The 0x... contract address
Function to call with its return types
Function arguments
the returned values as a struct
Optionalmemo: stringOptionalmemo: stringOptionalfee: "auto" | StdFeeOptionalmemo: stringOptionalfee: "auto" | StdFeeOptionalfinality: { OptionaltimeoutOptionalmemo: stringOptionalfee: "auto" | StdFeeOptionalfinality: TransactionFinalityconvenience function for simulating transactions containing a single cosmwasm message
cosmwasm instructions to execute
the simulation result
convenience function for simulating transactions containing cosmwasm messages
cosmwasm instructions to execute
the simulation result
Simulates the transaction and provides actually useful information. Like the events emitted.
Waits for the specified EVM transaction hash to confirm
the transcation hash
OptionaltimeoutMs: numberhow long to wait until timing out. Defaults to 60 seconds
OptionalthrowOnTimeout: booleanwhether or not to throw an error if the timeout time has elapsed instead of returning null
the confirmed transaction, or null if we waited too long and throwOnTimeout is falsy
Waits for the specified EVM transaction hash to confirm
the transcation hash
how long to wait until timing out. Defaults to 60 seconds if undefined
you explicitly set this to true, so prepare for error throwing
the confirmed transaction
Waits for the specified cosmos transaction to confirm
the transcation hash
OptionaltimeoutMs: numberhow long to wait until timing out. Defaults to 60 seconds
OptionalthrowOnTimeout: booleanwhether or not to throw an error if the timeout time has elapsed instead of returning null
the confirmed transaction, or null if we waited too long and throwOnTimeout is falsy
Waits for the specified cosmos transaction to confirm
the transcation hash
how long to wait until timing out. Defaults to 60 seconds if undefined
you explicitly set this to true, so prepare for error throwing
the confirmed transaction
StaticgetDon't be afraid of the type definition, just use ClientEnv.get()
This gets a ClientEnv from the provider specified.
The provider to use
The network ID to connect to
gas price
StaticgetStaticgetReturns the current default provider
The default provider
StaticnullifyStaticsetStaticsetSets the specified provider as the default one when ClientEnv.get is called.
the provider to use.
if false, this will throw an error on failure
An extended
ClientEnvwith more methods for contract deployments. Implemented as a seperate class so tree-shaking can actually happen.