Sending Messages
Learn how to send messages with SecretJS.
Last updated
Was this helpful?
Learn how to send messages with SecretJS.
Last updated
Was this helpful?
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
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 .