use of the constructor is discouraged and isn't guaranteed to be stable. Use the get() function instead.
Readonly
accountUser's account data. Will be null
if this isn't associated with an account
Readonly
chainThe Sei network ID this client is connected to
Protected
cometReadonly
cosmThe stargateClient
needs this to encode things properly.
Readonly
ethereumIf an ethereum wallet is connected, it will be exposed here.
Readonly
queryThe underlying query client, used to query the specific modules on Sei.
Readonly
readonlyIf this is a read-only account, this says why.
Protected
signerReadonly
stargateA 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.
Static
gasOptional
funds: Coin[]Optional
finality: { Optional
timeoutOptional
finality: 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
Optional
memo: stringOptional
memo: stringOptional
fee: "auto" | StdFeeOptional
memo: stringOptional
fee: "auto" | StdFeeOptional
finality: { Optional
timeoutOptional
memo: stringOptional
fee: "auto" | StdFeeOptional
finality: 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
Optional
memo: stringOptional
memo: stringOptional
fee: "auto" | StdFeeOptional
memo: stringOptional
fee: "auto" | StdFeeOptional
finality: { Optional
timeoutOptional
memo: stringOptional
fee: "auto" | StdFeeOptional
finality: 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
Optional
accountAddress: 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
Optional
funds: 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
Optional
memo: stringOptional
memo: stringOptional
fee: "auto" | StdFeeOptional
memo: stringOptional
fee: "auto" | StdFeeOptional
finality: { Optional
timeoutOptional
memo: stringOptional
fee: "auto" | StdFeeOptional
finality: 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
Optional
timeoutMs: numberhow long to wait until timing out. Defaults to 60 seconds
Optional
throwOnTimeout: 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
Optional
timeoutMs: numberhow long to wait until timing out. Defaults to 60 seconds
Optional
throwOnTimeout: 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
Static
getDon'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
Static
getStatic
getReturns the current default provider
The default provider
Static
nullifyStatic
setStatic
setSets 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
ClientEnv
with more methods for contract deployments. Implemented as a seperate class so tree-shaking can actually happen.