githubEdit

Sending Queries

Learn how to send queries with SecretJS.

Secret Network Client Setup

import { SecretNetworkClient, Wallet } from "secretjs";

const wallet = new Wallet("Your mnemonic words go here");

const secretjs = new SecretNetworkClient({
  chainId: "pulsar-3",
  url: "https://pulsar.lcd.secretnodes.com",
  wallet: wallet,
  walletAddress: wallet.address,
});

SecretJS Queries

secretjs.query.auth.account()arrow-up-right

Returns account details based on address.

const { address, accountNumber, sequence } = await secretjs.query.auth.account({
  address: myAddress,
});

secretjs.query.auth.accounts()arrow-up-right

Returns all existing accounts on the blockchain.

secretjs.query.auth.params()arrow-up-right

Queries all x/auth parameters.

secretjs.query.authz.grants()arrow-up-right

Returns list of authorizations, granted to the grantee by the granter.

secretjs.query.bank.balance()arrow-up-right

Balance queries the balance of a single coin for a single account.

secretjs.query.bank.allBalances()arrow-up-right

AllBalances queries the balance of all coins for a single account.

secretjs.query.bank.totalSupply()arrow-up-right

TotalSupply queries the total supply of all coins.

secretjs.query.bank.supplyOf()arrow-up-right

SupplyOf queries the supply of a single coin.

secretjs.query.bank.params()arrow-up-right

Params queries the parameters of x/bank module.

secretjs.query.bank.denomMetadata()arrow-up-right

DenomsMetadata queries the client metadata of a given coin denomination.

secretjs.query.bank.denomsMetadata()arrow-up-right

DenomsMetadata queries the client metadata for all registered coin denominations.

secretjs.query.compute.codeHashByContractAddress()arrow-up-right

Get codeHash of a Secret Contract.

secretjs.query.compute.codeHashByCodeId()arrow-up-right

Get codeHash from a code id.

secretjs.query.compute.contractInfo()arrow-up-right

Get metadata of a Secret Contract.

secretjs.query.compute.contractsByCode()arrow-up-right

Get all contracts that were instantiated from a code id.

secretjs.query.compute.queryContract()arrow-up-right

Query a Secret Contract

secretjs.query.compute.code()arrow-up-right

Get WASM bytecode and metadata for a code id.

secretjs.query.compute.codes()arrow-up-right

Query all contract codes on-chain.

secretjs.query.compute.contractHistory()arrow-up-right

Get upgrades history of a Secret Contract.

secretjs.query.distribution.params()arrow-up-right

Params queries params of the distribution module.

secretjs.query.distribution.validatorOutstandingRewards()arrow-up-right

ValidatorOutstandingRewards queries rewards of a validator address.

secretjs.query.distribution.validatorCommission()arrow-up-right

ValidatorCommission queries accumulated commission for a validator.

secretjs.query.distribution.validatorSlashes()arrow-up-right

ValidatorSlashes queries slash events of a validator.

secretjs.query.distribution.delegationRewards()arrow-up-right

DelegationRewards queries the total rewards accrued by a delegation.

secretjs.query.distribution.delegationTotalRewards()arrow-up-right

DelegationTotalRewards queries the total rewards accrued by a each validator.

secretjs.query.distribution.delegatorValidators()arrow-up-right

DelegatorValidators queries the validators of a delegator.

secretjs.query.distribution.delegatorWithdrawAddress()arrow-up-right

DelegatorWithdrawAddress queries withdraw address of a delegator.

secretjs.query.distribution.communityPool()arrow-up-right

CommunityPool queries the community pool coins.

secretjs.query.distribution.foundationTax()arrow-up-right

DelegatorWithdrawAddress queries withdraw address of a delegator.

secretjs.query.evidence.evidence()arrow-up-right

Evidence queries evidence based on evidence hash.

secretjs.query.evidence.allEvidence()arrow-up-right

AllEvidence queries all evidence.

secretjs.query.feegrant.allowance()arrow-up-right

Allowance returns fee granted to the grantee by the granter.

secretjs.query.feegrant.allowances()arrow-up-right

Allowances returns all the grants for address.

secretjs.query.gov.proposal()arrow-up-right

Proposal queries proposal details based on ProposalID.

secretjs.query.gov.proposals()arrow-up-right

Proposals queries all proposals based on given status.

secretjs.query.gov.vote()arrow-up-right

Vote queries voted information based on proposalID, voterAddr.

secretjs.query.gov.votes()arrow-up-right

Votes queries votes of a given proposal.

secretjs.query.gov.params()arrow-up-right

Params queries all parameters of the gov module.

secretjs.query.gov.deposit()arrow-up-right

Deposit queries single deposit information based proposalID, depositAddr.

secretjs.query.gov.deposits()arrow-up-right

Deposits queries all deposits of a single proposal.

secretjs.query.gov.tallyResult()arrow-up-right

TallyResult queries the tally of a proposal vote.

secretjs.query.ibc_channel.channel()arrow-up-right

Channel queries an IBC Channel.

secretjs.query.ibc_channel.channels()arrow-up-right

Channels queries all the IBC channels of a chain.

secretjs.query.ibc_channel.connectionChannels()arrow-up-right

ConnectionChannels queries all the channels associated with a connection end.

secretjs.query.ibc_channel.channelClientState()arrow-up-right

ChannelClientState queries for the client state for the channel associated with the provided channel identifiers.

secretjs.query.ibc_channel.channelConsensusState()arrow-up-right

ChannelConsensusState queries for the consensus state for the channel associated with the provided channel identifiers.

secretjs.query.ibc_channel.packetCommitment()arrow-up-right

PacketCommitment queries a stored packet commitment hash.

secretjs.query.ibc_channel.packetCommitments()arrow-up-right

PacketCommitments returns all the packet commitments hashes associated with a channel.

secretjs.query.ibc_channel.packetReceipt()arrow-up-right

PacketReceipt queries if a given packet sequence has been received on the queried chain

secretjs.query.ibc_channel.packetAcknowledgement()arrow-up-right

PacketAcknowledgement queries a stored packet acknowledgement hash.

secretjs.query.ibc_channel.packetAcknowledgements()arrow-up-right

PacketAcknowledgements returns all the packet acknowledgements associated with a channel.

secretjs.query.ibc_channel.unreceivedPackets()arrow-up-right

UnreceivedPackets returns all the unreceived IBC packets associated with a channel and sequences.

secretjs.query.ibc_channel.unreceivedAcks()arrow-up-right

UnreceivedAcks returns all the unreceived IBC acknowledgements associated with a channel and sequences.

secretjs.query.ibc_channel.nextSequenceReceive()arrow-up-right

NextSequenceReceive returns the next receive sequence for a given channel.

secretjs.query.ibc_client.clientState()arrow-up-right

ClientState queries an IBC light client.

secretjs.query.ibc_client.clientStates()arrow-up-right

ClientStates queries all the IBC light clients of a chain.

secretjs.query.ibc_client.consensusState()arrow-up-right

ConsensusState queries a consensus state associated with a client state at a given height.

secretjs.query.ibc_client.consensusStates()arrow-up-right

ConsensusStates queries all the consensus state associated with a given client.

secretjs.query.ibc_client.clientStatus()arrow-up-right

Status queries the status of an IBC client.

secretjs.query.ibc_client.clientParams()arrow-up-right

ClientParams queries all parameters of the ibc client.

secretjs.query.ibc_client.upgradedClientState()arrow-up-right

UpgradedClientState queries an Upgraded IBC light client.

secretjs.query.ibc_client.upgradedConsensusState()arrow-up-right

UpgradedConsensusState queries an Upgraded IBC consensus state.

secretjs.query.ibc_connection.connection()arrow-up-right

Connection queries an IBC connection end.

secretjs.query.ibc_connection.connections()arrow-up-right

Connections queries all the IBC connections of a chain.

secretjs.query.ibc_connection.clientConnections()arrow-up-right

ClientConnections queries the connection paths associated with a client state.

secretjs.query.ibc_connection.connectionClientState()arrow-up-right

ConnectionClientState queries the client state associated with the connection.

secretjs.query.ibc_connection.connectionConsensusState()arrow-up-right

ConnectionConsensusState queries the consensus state associated with the connection.

secretjs.query.ibc_transfer.denomTrace()arrow-up-right

DenomTrace queries a denomination trace information.

secretjs.query.ibc_transfer.denomTraces()arrow-up-right

DenomTraces queries all denomination traces.

secretjs.query.ibc_transfer.params()arrow-up-right

Params queries all parameters of the ibc-transfer module.

secretjs.query.mint.params()arrow-up-right

Params returns the total set of minting parameters.

secretjs.query.mint.inflation()arrow-up-right

Inflation returns the current minting inflation value.

secretjs.query.mint.annualProvisions()arrow-up-right

AnnualProvisions current minting annual provisions value.

secretjs.query.params.params()arrow-up-right

Params queries a specific parameter of a module, given its subspace and key.

secretjs.query.registration.txKey()arrow-up-right

Returns the key used for transactions.

secretjs.query.registration.registrationKey()arrow-up-right

Returns the key used for registration.

secretjs.query.registration.encryptedSeed()arrow-up-right

Returns the encrypted seed for a registered node by public key.

secretjs.query.slashing.params()arrow-up-right

Params queries the parameters of slashing module.

secretjs.query.slashing.signingInfo()arrow-up-right

SigningInfo queries the signing info of given cons address.

secretjs.query.slashing.signingInfos()arrow-up-right

SigningInfos queries signing info of all validators.

secretjs.query.staking.validators()arrow-up-right

Validators queries all validators that match the given status.

secretjs.query.staking.validator()arrow-up-right

Validator queries validator info for given validator address.

secretjs.query.staking.validatorDelegations()arrow-up-right

ValidatorDelegations queries delegate info for given validator.

secretjs.query.staking.validatorUnbondingDelegations()arrow-up-right

ValidatorUnbondingDelegations queries unbonding delegations of a validator.

secretjs.query.staking.delegation()arrow-up-right

Delegation queries delegate info for given validator delegator pair.

secretjs.query.staking.unbondingDelegation()arrow-up-right

UnbondingDelegation queries unbonding info for given validator delegator pair.

secretjs.query.staking.delegatorDelegations()arrow-up-right

DelegatorDelegations queries all delegations of a given delegator address.

secretjs.query.staking.delegatorUnbondingDelegations()arrow-up-right

DelegatorUnbondingDelegations queries all unbonding delegations of a given delegator address.

secretjs.query.staking.redelegations()arrow-up-right

Redelegations queries redelegations of given address.

secretjs.query.staking.delegatorValidators()arrow-up-right

DelegatorValidators queries all validators info for given delegator address.

secretjs.query.staking.delegatorValidator()arrow-up-right

DelegatorValidator queries validator info for given delegator validator pair.

secretjs.query.staking.historicalInfo()arrow-up-right

HistoricalInfo queries the historical info for given height.

secretjs.query.staking.pool()arrow-up-right

Pool queries the pool info.

secretjs.query.staking.params()arrow-up-right

Parameters queries the staking parameters.

secretjs.query.tendermint.getNodeInfo()arrow-up-right

GetNodeInfo queries the current node info.

secretjs.query.tendermint.getSyncing()arrow-up-right

GetSyncing queries node syncing.

secretjs.query.tendermint.getLatestBlock()arrow-up-right

GetLatestBlock returns the latest block.

secretjs.query.tendermint.getBlockByHeight()arrow-up-right

GetBlockByHeight queries block for given height.

secretjs.query.tendermint.getLatestValidatorSet()arrow-up-right

GetLatestValidatorSet queries latest validator-set.

secretjs.query.tendermint.getValidatorSetByHeight()arrow-up-right

GetValidatorSetByHeight queries validator-set at a given height.

secretjs.query.upgrade.currentPlan()arrow-up-right

CurrentPlan queries the current upgrade plan.

secretjs.query.upgrade.appliedPlan()arrow-up-right

AppliedPlan queries a previously applied upgrade plan by its name.

secretjs.query.upgrade.upgradedConsensusState()arrow-up-right

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()arrow-up-right

ModuleVersions queries the list of module versions from state.

Last updated

Was this helpful?