Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Learn how to send queries with SecretJS.
Returns account details based on address.
secretjs.query.auth.accounts()
Returns all existing accounts on the blockchain.
Queries all x/auth parameters.
Returns list of authorizations, granted to the grantee by the granter.
Balance queries the balance of a single coin for a single account.
secretjs.query.bank.allBalances()
AllBalances queries the balance of all coins for a single account.
secretjs.query.bank.totalSupply()
TotalSupply queries the total supply of all coins.
secretjs.query.bank.supplyOf()
SupplyOf queries the supply of a single coin.
Params queries the parameters of x/bank module.
secretjs.query.bank.denomMetadata()
DenomsMetadata queries the client metadata of a given coin denomination.
secretjs.query.bank.denomsMetadata()
DenomsMetadata queries the client metadata for all registered coin denominations.
secretjs.query.compute.codeHashByContractAddress()
Get codeHash of a Secret Contract.
secretjs.query.compute.codeHashByCodeId()
Get codeHash from a code id.
secretjs.query.compute.contractInfo()
Get metadata of a Secret Contract.
secretjs.query.compute.contractsByCode()
Get all contracts that were instantiated from a code id.
secretjs.query.compute.queryContract()
Query a Secret Contract
Get WASM bytecode and metadata for a code id.
secretjs.query.compute.codes()
Query all contract codes on-chain.
secretjs.query.compute.contractHistory()
Get upgrades history of a Secret Contract.
secretjs.query.distribution.params()
Params queries params of the distribution module.
secretjs.query.distribution.validatorOutstandingRewards()
ValidatorOutstandingRewards queries rewards of a validator address.
secretjs.query.distribution.validatorCommission()
ValidatorCommission queries accumulated commission for a validator.
secretjs.query.distribution.validatorSlashes()
ValidatorSlashes queries slash events of a validator.
secretjs.query.distribution.delegationRewards()
DelegationRewards queries the total rewards accrued by a delegation.
secretjs.query.distribution.delegationTotalRewards()
DelegationTotalRewards queries the total rewards accrued by a each validator.
secretjs.query.distribution.delegatorValidators()
DelegatorValidators queries the validators of a delegator.
secretjs.query.distribution.delegatorWithdrawAddress()
DelegatorWithdrawAddress queries withdraw address of a delegator.
secretjs.query.distribution.communityPool()
CommunityPool queries the community pool coins.
secretjs.query.distribution.foundationTax()
DelegatorWithdrawAddress queries withdraw address of a delegator.
secretjs.query.evidence.evidence()
Evidence queries evidence based on evidence hash.
secretjs.query.evidence.allEvidence()
AllEvidence queries all evidence.
secretjs.query.feegrant.allowance()
Allowance returns fee granted to the grantee by the granter.
secretjs.query.feegrant.allowances()
Allowances returns all the grants for address.
Proposal queries proposal details based on ProposalID.
secretjs.query.gov.proposals()
Proposals queries all proposals based on given status.
Vote queries voted information based on proposalID, voterAddr.
Votes queries votes of a given proposal.
Params queries all parameters of the gov module.
Deposit queries single deposit information based proposalID, depositAddr.
Deposits queries all deposits of a single proposal.
secretjs.query.gov.tallyResult()
TallyResult queries the tally of a proposal vote.
secretjs.query.ibc_channel.channel()
Channel queries an IBC Channel.
secretjs.query.ibc_channel.channels()
Channels queries all the IBC channels of a chain.
secretjs.query.ibc_channel.connectionChannels()
ConnectionChannels queries all the channels associated with a connection end.
secretjs.query.ibc_channel.channelClientState()
ChannelClientState queries for the client state for the channel associated with the provided channel identifiers.
secretjs.query.ibc_channel.channelConsensusState()
ChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.
secretjs.query.ibc_channel.packetCommitment()
PacketCommitment queries a stored packet commitment hash.
secretjs.query.ibc_channel.packetCommitments()
PacketCommitments returns all the packet commitments hashes associated with a channel.
secretjs.query.ibc_channel.packetReceipt()
PacketReceipt queries if a given packet sequence has been received on the queried chain
secretjs.query.ibc_channel.packetAcknowledgement()
PacketAcknowledgement queries a stored packet acknowledgement hash.
secretjs.query.ibc_channel.packetAcknowledgements()
PacketAcknowledgements returns all the packet acknowledgements associated with a channel.
secretjs.query.ibc_channel.unreceivedPackets()
UnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.
secretjs.query.ibc_channel.unreceivedAcks()
UnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.
secretjs.query.ibc_channel.nextSequenceReceive()
NextSequenceReceive returns the next receive sequence for a given channel.
secretjs.query.ibc_client.clientState()
ClientState queries an IBC light client.
secretjs.query.ibc_client.clientStates()
ClientStates queries all the IBC light clients of a chain.
secretjs.query.ibc_client.consensusState()
ConsensusState queries a consensus state associated with a client state at a given height.
secretjs.query.ibc_client.consensusStates()
ConsensusStates queries all the consensus state associated with a given client.
secretjs.query.ibc_client.clientStatus()
Status queries the status of an IBC client.
secretjs.query.ibc_client.clientParams()
ClientParams queries all parameters of the ibc client.
secretjs.query.ibc_client.upgradedClientState()
UpgradedClientState queries an Upgraded IBC light client.
secretjs.query.ibc_client.upgradedConsensusState()
UpgradedConsensusState queries an Upgraded IBC consensus state.
secretjs.query.ibc_connection.connection()
Connection queries an IBC connection end.
secretjs.query.ibc_connection.connections()
Connections queries all the IBC connections of a chain.
secretjs.query.ibc_connection.clientConnections()
ClientConnections queries the connection paths associated with a client state.
secretjs.query.ibc_connection.connectionClientState()
ConnectionClientState queries the client state associated with the connection.
secretjs.query.ibc_connection.connectionConsensusState()
ConnectionConsensusState queries the consensus state associated with the connection.
secretjs.query.ibc_transfer.denomTrace()
DenomTrace queries a denomination trace information.
secretjs.query.ibc_transfer.denomTraces()
DenomTraces queries all denomination traces.
secretjs.query.ibc_transfer.params()
Params queries all parameters of the ibc-transfer module.
Params returns the total set of minting parameters.
secretjs.query.mint.inflation()
Inflation returns the current minting inflation value.
secretjs.query.mint.annualProvisions()
AnnualProvisions current minting annual provisions value.
secretjs.query.params.params()
Params queries a specific parameter of a module, given its subspace and key.
secretjs.query.registration.txKey()
Returns the key used for transactions.
secretjs.query.registration.registrationKey()
Returns the key used for registration.
secretjs.query.registration.encryptedSeed()
Returns the encrypted seed for a registered node by public key.
secretjs.query.slashing.params()
Params queries the parameters of slashing module.
secretjs.query.slashing.signingInfo()
SigningInfo queries the signing info of given cons address.
secretjs.query.slashing.signingInfos()
SigningInfos queries signing info of all validators.
secretjs.query.staking.validators()
Validators queries all validators that match the given status.
secretjs.query.staking.validator()
Validator queries validator info for given validator address.
secretjs.query.staking.validatorDelegations()
ValidatorDelegations queries delegate info for given validator.
secretjs.query.staking.validatorUnbondingDelegations()
ValidatorUnbondingDelegations queries unbonding delegations of a validator.
secretjs.query.staking.delegation()
Delegation queries delegate info for given validator delegator pair.
secretjs.query.staking.unbondingDelegation()
UnbondingDelegation queries unbonding info for given validator delegator pair.
secretjs.query.staking.delegatorDelegations()
DelegatorDelegations queries all delegations of a given delegator address.
secretjs.query.staking.delegatorUnbondingDelegations()
DelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.
secretjs.query.staking.redelegations()
Redelegations queries redelegations of given address.
secretjs.query.staking.delegatorValidators()
DelegatorValidators queries all validators info for given delegator address.
secretjs.query.staking.delegatorValidator()
DelegatorValidator queries validator info for given delegator validator pair.
secretjs.query.staking.historicalInfo()
HistoricalInfo queries the historical info for given height.
Pool queries the pool info.
secretjs.query.staking.params()
Parameters queries the staking parameters.
secretjs.query.tendermint.getNodeInfo()
GetNodeInfo queries the current node info.
secretjs.query.tendermint.getSyncing()
GetSyncing queries node syncing.
secretjs.query.tendermint.getLatestBlock()
GetLatestBlock returns the latest block.
secretjs.query.tendermint.getBlockByHeight()
GetBlockByHeight queries block for given height.
secretjs.query.tendermint.getLatestValidatorSet()
GetLatestValidatorSet queries latest validator-set.
secretjs.query.tendermint.getValidatorSetByHeight()
GetValidatorSetByHeight queries validator-set at a given height.
secretjs.query.upgrade.currentPlan()
CurrentPlan queries the current upgrade plan.
secretjs.query.upgrade.appliedPlan()
AppliedPlan queries a previously applied upgrade plan by its name.
secretjs.query.upgrade.upgradedConsensusState()
UpgradedConsensusState queries the consensus state that will serve as a trusted kernel for the next version of this chain. It will only be stored at the last height of this chain.
secretjs.query.upgrade.moduleVersions()
ModuleVersions queries the list of module versions from state.
Learn how to do contract migration with SecretJS.
secretjs.tx.compute.migrateContract()
Migrate a contract's code while keeping the same address. Invokes the migrate()
function on the new code.
Input: MsgMigrateContractParams
See here for further docs on contract migration.
Learn how to integrate various web3 wallets with SecretJS.
Notes:
MetaMask supports mobile!
MetaMask supports Ledger.
Secretjs MetaMaskWallet
will automatically prompt the user to sign a personal_sign
message, which is used to recover the users public key and derive the user's Secret Network address.
You might want to pass encryptionSeed
to SecretNetworkClient.create()
to use the same encryption key for the user across sessions. This value should be a true random 32 byte number that is stored securly in your app, such that only the user can decrypt it. This can also be a sha256(user_password)
but might impair UX.
The recommended way of integrating Keplr is by using window.keplr.getOfflineSignerOnlyAmino()
:
Notes:
No mobile support yet.
Keplr supports Ledger.
By using encryptionUtils
you let Keplr handle user encryption keys for you, which allows you to easily decrypt transactions across sessions.
Links:
TLDR:
Although this is the legacy way of signing transactions on cosmos-sdk, it's still the most recommended for connecting to Keplr due to Ledger support & better UI on Keplr.
🟩 Looks good on Keplr
🟩 Supports users signing with Ledger
🟥 Doesn't support signing these transactions:
The new way of signing transactions on cosmos-sdk, it's more efficient but still doesn't have Ledger support, so it's most recommended for usage in apps that don't require signing transactions with Ledger.
🟥 Looks bad on Keplr
🟥 Doesn't support users signing with Ledger
🟩 Supports signing transactions with all types of Msgs
If the connected Keplr account uses Ledger, returns window.keplr.getOfflineSignerOnlyAmino()
.
Otherwise returns window.keplr.getOfflineSigner()
.
Fina supports deep linking into its in-app browser.
Example1: fina://wllet/dapps?network=secret-4&url=https%3A%2F%2Fdash.scrt.network
Example2:
If a user accessed your app using a regular mobile browser, you can open your app in the Fina in-app browser using this code:
Links:
The recommended way of integrating Leap is by using window.leap.getOfflineSignerOnlyAmino()
:
Links:
Links:
@cosmjs/ledger-amino
can be used to sign transactions with a Ledger wallet running the Cosmos app.
Notes:
Use the appropriate hw-transport
package for your environment (Node or Browser)
The Ledger Cosmos app only supports coin type 118
You might want to pass encryptionSeed
to SecretNetworkClient.create()
to use the same encryption key for the user across sessions. This value should be a true random 32 byte number that is stored securly in your app, such that only the user can decrypt it. This can also be a sha256(user_password)
but might impair UX.
Links:
SecretJS usage examples.
Learn how to send messages with SecretJS.
On a signer secret.js, secretjs.tx
is used to broadcast transactions. Every function under secretjs.tx
can receive an optional .
Used to send a complex transactions, which contains a list of messages. The messages are executed in sequence, and the transaction succeeds if all messages succeed.
For a list of all messages see:
Used to simulate a complex transactions, which contains a list of messages, without broadcasting it to the chain. Can be used to get a gas estimation or to see the output without actually committing a transaction on-chain.
The input should be exactly how you'd use it in secretjs.tx.broadcast()
, except that you don't have to pass in gasLimit
, gasPriceInFeeDenom
& feeDenom
.
Notes:
On mainnet, it's recommended to not simulate every transaction as this can burden your node provider. Instead, use this while testing to determine the gas limit for each of your app's transactions, then in production use hard-coded values.
Gas estimation is known to be a bit off, so you might need to adjust it a bit before broadcasting.
MsgInstantiateContract
, MsgExecuteContract
, MsgMigrateContract
, MsgUpdateAdmin
& MsgClearAdmin
simulations are not supported for security reasons.
Used to sign transactions independently from the broadcast process. This is useful when you want to keep your seed safe and sign transactions offline.
Used to send offline signed transactions.
MsgExec attempts to execute the provided messages using authorizations granted to the grantee. Each message should have only one signer corresponding to the granter of the authorization.
MsgGrant is a request type for Grant method. It declares authorization to the grantee on behalf of the granter with the provided expiration time.
MsgRevoke revokes any authorization with the provided sdk.Msg type on the granter's account with that has been granted to the grantee.
MsgMultiSend represents an arbitrary multi-in, multi-out send message.
MsgSend represents a message to send coins from one account to another.
Upload a compiled contract to Secret Network
Instantiate a contract from code id
ateContractParams)
WARNING: secretjs.tx.compute
simulations are not supported for security reasons.
Execute a function on a contract
WARNING: secretjs.tx.compute
simulations are not supported for security reasons.
Migrate a contract's code while keeping the same address. Invokes the migrate()
function on the new code.
WARNING: secretjs.tx.compute
simulations are not supported for security reasons.
Update a contract's admin.
WARNING: secretjs.tx.compute
simulations are not supported for security reasons.
clear a contract's admin.
WARNING: secretjs.tx.compute
simulations are not supported for security reasons.
MsgVerifyInvariant represents a message to verify a particular invariance.
MsgFundCommunityPool allows an account to directly fund the community pool.
MsgSetWithdrawAddress sets the withdraw address for a delegator (or validator self-delegation).
MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator from a single validator.
MsgWithdrawValidatorCommission withdraws the full commission to the validator address.
Or a better one:
MsgSubmitEvidence represents a message that supports submitting arbitrary evidence of misbehavior such as equivocation or counterfactual signing.
MsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.
MsgRevokeAllowance removes any existing Allowance from Granter to Grantee.
MsgDeposit defines a message to submit a deposit to an existing proposal.
MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary proposal Content.
MsgVote defines a message to cast a vote.
MsgVoteWeighted defines a message to cast a vote, with an option to split the vote.
MsgUnjail defines a message to release a validator from jail.
MsgBeginRedelegate defines an SDK message for performing a redelegation of coins from a delegator and source validator to a destination validator.
MsgCreateValidator defines an SDK message for creating a new validator.
MsgDelegate defines an SDK message for performing a delegation of coins from a delegator to a validator.
MsgEditValidator defines an SDK message for editing an existing validator.
MsgUndelegate defines an SDK message for performing an undelegation from a delegate and a validator
See Keplr's for list of unsupported transactions.
: The recommended way. Supports Ledger, has a nice UI.
: No Ledger support, ugly UI, can send IBC relayer txs and submit IBC gov proposals.
: If Ledger alias for getOfflineSignerOnlyAmino()
, otherwise alias for getOfflineSigner()
.
Every tx type under ibc_client
, ibc_connection
and ibc_channel
(meaning IBC relaying, for example with )
Note that for sending funds across IBC is supported.
Fina implements the Keplr API, so applies. If you support Keplr, your app will also work on the Fina Wallet mobile app. This works because the Fina Wallet mobile app has webview to which it injects its objects under window.keplr
.
StarShell implements the Keplr API, so applies. If you support Keplr, your app will also work on StarShell wallet. This works because StarShell wallet asks the user to turn off Keplr and then overrides window.keplr
with its objects.
See Keplr's for list of unsupported transactions.
Learn more about Query Permits .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input: [MsgInstantiateContractParams](
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here:
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .
Input:
Simulates execution without sending a transactions. Input is exactly like the parent function. For more info see .