max_change_rate defines the maximum daily increase of the validator commission, as a fraction.
max_rate defines the maximum commission rate which validator can ever charge, as a fraction.
rate is the commission rate charged to delegators, as a fraction.
The chain-id is used in encryption code & when signing txs.
Passing encryptionSeed will allow tx decryption at a later time. Ignored if encryptionUtils is supplied. Must be 32 bytes.
encryptionUtils overrides the default EncryptionUtilsImpl.
A URL to the API service, also known as LCD, REST API or gRPC-gateway, by default on port 1317
A wallet for signing transactions & permits. When wallet is supplied, walletAddress & chainId must be supplied too.
walletAddress is the specific account address in the wallet that is permitted to sign transactions & permits.
GenericAuthorization gives the grantee unrestricted permissions to execute the provided Msg on behalf of the granter's account. The provided Msg must implement the Authorization interface: https://github.com/cosmos/cosmos-sdk/blob/c44309bc694ea8b6069ae147743f0b25dc8b52c0/x/authz/authorizations.go#L9-L25
Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients
Normally the RevisionHeight is incremented at each height while keeping RevisionNumber the same. However some consensus algorithms may choose to reset the height in certain conditions e.g. hard forks, state-machine breaking changes In these cases, the RevisionNumber is incremented so that height continues to be monitonically increasing even as the RevisionHeight gets reset
the height within the given revision
the revision that the client is currently on
If false skip resolving the IBC response txs (acknowledge/timeout).
Defaults to true when broadcasting a tx or using getTx().
Defaults to false when using txsQuery().
When waiting for the IBC response txs (acknowledge/timeout) to commit on-chain, how much time (in milliseconds) to wait between checks.
Smaller intervals will cause more load on your node provider. Keep in mind that blocks on Secret Network take about 6 seconds to finalize.
Defaults to 15_000 (15 seconds).
How much time (in milliseconds) to wait for IBC response txs (acknowledge/timeout).
Defaults to 120_000 (2 minutes).
Returns a transaction with a txhash. Must be 64 character upper-case hex string
To tell which events you want, you need to provide a query. query is a string, which has a form: "condition AND condition ..." (no OR at the moment).
condition has a form: "key operation operand". key is a string with a restricted set of possible symbols (\t\n\r()"'=>< are not allowed).
operation can be "=", "<", "<=", ">", ">=", "CONTAINS" AND "EXISTS". operand can be a string (escaped with single quotes), number, date or time.
Examples:
tx.hash='XYZ' # single transactiontx.height=5 # all txs of the fifth blockcreate_validator.validator='ABC' # tx where validator ABC was createdTendermint provides a few predefined keys: tm.event, tx.hash and tx.height. You can provide additional event keys that were emitted during the transaction.
All events are indexed by a composite key of the form {eventType}.{evenAttrKey}.
Multiple event types with duplicate keys are allowed and are meant to categorize unique and distinct events.
To create a query for txs where AddrA transferred funds: transfer.sender='AddrA'.
NOTE: Stating from Cosmos SDK v0.46+, expressions cannot contain spaces anymore:
a.b='c'a.b = 'c'The SHA256 hash value of the contract's WASM bytecode, represented as case-insensitive 64 character hex string. This is used to make sure only the contract that's being invoked can decrypt the query data.
code_hash is an optional parameter but using it will result in way faster execution time.
Valid examples:
The address of the contract
A JSON object that will be passed to the contract as a query
SingleMsgTx is a function that broadcasts a single message transaction.
It also has a simulate() method to execute the transaction without
committing it on-chain. This is helpful for gas estimation.
WARNING: tx.compute.instantiateContract() & tx.compute.executeContract() simulation is not supported for security reasons!
StakeAuthorization defines authorization for delegate/undelegate/redelegate.
allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's account.
authorization_type defines one of AuthorizationType.
deny_list specifies list of validator addresses to whom grantee can not delegate tokens.
max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is empty, there is no spend limit and any amount of coins can be delegated.
When waiting for the tx to commit on-chain, how much time (in milliseconds) to wait between checks.
Smaller intervals will cause more load on your node provider. Keep in mind that blocks on Secret Network take about 6 seconds to finalize.
Defaults to 6_000. Ignored if waitForCommit = false.
If BroadcastMode.Sync - Broadcast transaction to mempool and wait for CheckTx response.
How much time (in milliseconds) to wait for tx to commit on-chain.
Defaults to 60_000. Ignored if waitForCommit = false.
explicitSignerData can be used to override chainId, accountNumber & accountSequence.
This is useful when using BroadcastMode.Async or when you don't want secretjs
to query for accountNumber & accountSequence from the chain. (smoother in UIs, less load on your node provider).
Defaults to "uscrt".
Address of the fee granter from which to charge gas fees.
Defaults to 25_000.
E.g. gasPriceInFeeDenom=0.1 & feeDenom="uscrt" => Total fee for tx is 0.1 * gasLimituscrt. Defaults to 0.1.
Options for resolving IBC ack/timeout txs that resulted from this tx.
Defaults to "".
If false returns immediately with only the transactionHash field set. Defaults to true.
A transaction that is indexed as part of the transaction history
If code = 0, arrayLog is a flattened jsonLog. Values are decrypted if possible.
Transaction execution error code. 0 on success. See TxResultCode.
Namespace for the Code
Return value (if there's any) for each input message
Events defines all the events emitted by processing a transaction. Note, these events include those emitted by processing all the messages and those emitted from the ante handler. Whereas Logs contains the events, with additional metadata, emitted only by processing the messages.
Note: events are not decrypted.
Amount of gas that was actually used by the transaction.
Gas limit that was originaly set by the transaction.
Block height in which the tx was committed on-chain
If code = 0 and the tx resulted in sending IBC packets, ibcAckTxs is a list of IBC acknowledgement or timeout transactions which signal whether the original IBC packet was accepted, rejected or timed-out on the receiving chain.
Additional information. May be non-deterministic.
If code = 0, jsonLog = JSON.parse(rawLow). Values are decrypted if possible.
If code != 0, rawLog contains the error.
If code = 0 you'll probably want to use jsonLog or arrayLog. Values are not decrypted.
An RFC 3339 timestamp of when the tx was committed on-chain.
The format is {year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z.
Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex
Decoded transaction input.
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.
Clear the admin of a contract
Execute a function on a contract
Instantiate a contract from code id
Runs a code upgrade/downgrade for a contract
Upload a compiled contract
Update the admin of a contract
MsgFundCommunityPool allows an account to directly fund the community pool.
MsgWithdrawValidatorCommission withdraws the full commission to the validator address.
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.
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.
MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between ICS20 enabled chains. See ICS Spec here: https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures
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
MsgCreateVestingAccount defines a message that enables creating a vesting account.
Sign and broadcast a transaction to Secret Network.
A list of messages, executed sequentially. If all messages succeeds then the transaction succeed, and the resulting TxResponse object will have code = 0. If at lease one message fails, the entire transaction is reverted and TxResponse code field will not be 0.
List of possible Msgs:
Broadcast a signed transactions
Signed transaction bytes, can be the output of signTx()
Simulates a transaction on the node 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 broadcast.
WARNING: MsgInstantiateContract & MsgExecuteContract simulation is not supported for security reasons!
proposal_id defines the unique id of the proposal.
proposer is the account address of the proposer.
proposal_id defines the unique id of the proposal.
proposer is the account address of the proposer.
amount is always less than or equal to unbonding delegation entry balance
creation_height is the height which the unbonding took place.
amount is always less than or equal to unbonding delegation entry balance
creation_height is the height which the unbonding took place.
authority is the address that controls the module (defaults to x/gov unless overwritten).
authority is the address that controls the module (defaults to x/gov unless overwritten).
NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC.
Deprecated: this field is unused. Crossing hello's are no longer supported in core IBC.
NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC.
Deprecated: this field is unused. Crossing hello's are no longer supported in core IBC.
authority is the address that controls the module (defaults to x/gov unless overwritten).
authority is the address that controls the module (defaults to x/gov unless overwritten).
optional proof data for host state machines that are unable to introspect their own consensus state
proof of client state included in message
proof of client consensus state
proof of the initialization the connection on Chain B: UNITIALIZED -> TRYOPEN
optional proof data for host state machines that are unable to introspect their own consensus state
proof of client state included in message
proof of client consensus state
proof of the initialization the connection on Chain B: UNITIALIZED -> TRYOPEN
proof for the change of the connection state on Chain A: INIT -> OPEN
proof for the change of the connection state on Chain A: INIT -> OPEN
optional proof data for host state machines that are unable to introspect their own consensus state
Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC.
proof of client state included in message
proof of client consensus state
proof of the initialization the connection on Chain A: UNITIALIZED -> INIT
optional proof data for host state machines that are unable to introspect their own consensus state
Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC.
proof of client state included in message
proof of client consensus state
proof of the initialization the connection on Chain A: UNITIALIZED -> INIT
light client state
consensus state associated with the client that corresponds to a given height.
signer address
light client state
consensus state associated with the client that corresponds to a given height.
signer address
start of vesting as unix time (in seconds).
start of vesting as unix time (in seconds).
end of vesting as unix time (in seconds).
end of vesting as unix time (in seconds).
amount to be deposited by depositor.
depositor defines the deposit addresses from the proposals.
proposal_id defines the unique id of the proposal.
amount to be deposited by depositor.
depositor defines the deposit addresses from the proposals.
proposal_id defines the unique id of the proposal.
Data contains base64-encoded bytes to returned from the contract
Data contains base64-encoded bytes to returned from the contract
signer address
An UpgradedClientState must be provided to perform an IBC breaking upgrade. This will make the chain commit to the correct upgraded (self) client state before the upgrade occurs, so that connecting chains can verify that the new upgraded client is valid by verifying a proof on the previous version of the chain. This will allow IBC connections to persist smoothly across planned chain upgrades. Correspondingly, the UpgradedClientState field has been deprecated in the Cosmos SDK to allow for this logic to exist solely in the 02-client module.
signer address
An UpgradedClientState must be provided to perform an IBC breaking upgrade. This will make the chain commit to the correct upgraded (self) client state before the upgrade occurs, so that connecting chains can verify that the new upgraded client is valid by verifying a proof on the previous version of the chain. This will allow IBC connections to persist smoothly across planned chain upgrades. Correspondingly, the UpgradedClientState field has been deprecated in the Cosmos SDK to allow for this logic to exist solely in the 02-client module.
Address is the bech32 address of the new contract instance.
Data contains base64-encoded bytes to returned from the contract
Address is the bech32 address of the new contract instance.
Data contains base64-encoded bytes to returned from the contract
Inputs, despite being repeated, only allows one sender input. This is
checked in MsgMultiSend's ValidateBasic.
Inputs, despite being repeated, only allows one sender input. This is
checked in MsgMultiSend's ValidateBasic.
the packet fee associated with a particular IBC packet
unique packet identifier comprised of the channel ID, port ID and sequence
the packet fee associated with a particular IBC packet
unique packet identifier comprised of the channel ID, port ID and sequence
fee encapsulates the recv, ack and timeout fees associated with an IBC packet
optional list of relayers permitted to the receive packet fees
account address to refund fee if necessary
the source channel unique identifer
the source port unique identifier
fee encapsulates the recv, ack and timeout fees associated with an IBC packet
optional list of relayers permitted to the receive packet fees
account address to refund fee if necessary
the source channel unique identifer
the source port unique identifier
pruner is the address of the user pruning expired allowances.
pruner is the address of the user pruning expired allowances.
signer address
the client identifier for the client to be updated if the proposal passes
the substitute client identifier for the client which will replace the subject client
signer address
the client identifier for the client to be updated if the proposal passes
the substitute client identifier for the client which will replace the subject client
unique channel identifier
the counterparty payee address
unique port identifier
the relayer address
unique channel identifier
the counterparty payee address
unique port identifier
the relayer address
unique channel identifier
the payee address
unique port identifier
the relayer address
unique channel identifier
the payee address
unique port identifier
the relayer address
grantee is the address of the user being granted an allowance of another user's funds.
granter is the address of the user granting an allowance of their funds.
grantee is the address of the user being granted an allowance of another user's funds.
granter is the address of the user granting an allowance of their funds.
Relative timeout timestamp provided will be added to the current block time during transaction execution. The timeout timestamp must be non-zero.
Relative timeout timestamp provided will be added to the current block time during transaction execution. The timeout timestamp must be non-zero.
authority is the address that controls the module.
send_enabled is the list of entries to add or update.
use_default_for is a list of denoms that should use the params.default_send_enabled value. Denoms listed here will have their SendEnabled entries deleted. If a denom is included that doesn't have a SendEnabled entry, it will be ignored.
authority is the address that controls the module.
send_enabled is the list of entries to add or update.
use_default_for is a list of denoms that should use the params.default_send_enabled value. Denoms listed here will have their SendEnabled entries deleted. If a denom is included that doesn't have a SendEnabled entry, it will be ignored.
authority is the address that controls the module (defaults to x/gov unless overwritten).
plan is the upgrade plan.
authority is the address that controls the module (defaults to x/gov unless overwritten).
plan is the upgrade plan.
CodeID is the reference to the stored WASM code
CodeID is the reference to the stored WASM code
evidence defines the evidence of misbehavior.
submitter is the signer account address of evidence.
evidence defines the evidence of misbehavior.
submitter is the signer account address of evidence.
client unique identifier
misbehaviour used for freezing the light client
signer address
client unique identifier
misbehaviour used for freezing the light client
signer address
client unique identifier
client message to update the light client
signer address
client unique identifier
client message to update the light client
signer address
authority is the address of the governance account.
params defines the x/emergencybutton parameters to update.
NOTE: All parameters must be supplied.
authority is the address of the governance account.
params defines the x/emergencybutton parameters to update.
NOTE: All parameters must be supplied.
client unique identifier
upgraded client state
upgraded consensus state, only contains enough information to serve as a basis of trust in update logic
proof that old chain committed to new client
proof that old chain committed to new consensus state
signer address
client unique identifier
upgraded client state
upgraded consensus state, only contains enough information to serve as a basis of trust in update logic
proof that old chain committed to new client
proof that old chain committed to new consensus state
signer address
metadata is any arbitrary metadata attached to the Vote.
option defines the vote option.
proposal_id defines the unique id of the proposal.
voter is the voter address for the proposal.
metadata is any arbitrary metadata attached to the Vote.
option defines the vote option.
proposal_id defines the unique id of the proposal.
voter is the voter address for the proposal.
metadata is any arbitrary metadata attached to the VoteWeighted.
options defines the weighted vote options.
proposal_id defines the unique id of the proposal.
voter is the voter address for the proposal.
metadata is any arbitrary metadata attached to the VoteWeighted.
options defines the weighted vote options.
proposal_id defines the unique id of the proposal.
voter is the voter address for the proposal.
details define other optional details.
identity defines an optional identity signature (ex. UPort or Keybase).
moniker defines a human-readable name for the validator.
security_contact defines an optional email for security contact.
website defines an optional website link.
details define other optional details.
identity defines an optional identity signature (ex. UPort or Keybase).
moniker defines a human-readable name for the validator.
security_contact defines an optional email for security contact.
website defines an optional website link.
Converts an address from a bech32 string to the bytes representation.
The address bech32 string to convert.
Convert a secp256k1 compressed public key to an address
The account's pubkey as base64 string, should be 33 bytes (compressed secp256k1)
the account's address
Convert a secp256k1 compressed public key to an address
The account's pubkey as base64 string, should be 33 bytes (compressed secp256k1)
the account's address
Converts an address from bytes to the strong representation.
The address bytes to convert.
The bech32 prefix to use.
E.g. "1uscrt" => {amount:"1",denom:"uscrt"}
E.g. "1uscrt,1uatom,1uosmo" =>
[{amount:"1",denom:"uscrt"},{amount:"1",denom:"uatom"},{amount:"1",denom:"uosmo"}]
Takes UTF-8 data and decodes it to a string.
In lossy mode, the REPLACEMENT CHARACTER is used to substitude invalid encodings. By default lossy mode is off and invalid data will lead to exceptions.
Compute the IBC denom of a token that was sent over IBC.
For example, to get the IBC denom of SCRT on mainnet Osmosis:
ibcDenom([{incomingPortId: "transfer", incomingChannelId: "channel-88"}], "uscrt")
Copied here to avoid unnecessary deps
MIT License
Copyright (c) Kevin MÃ¥rtensson [email protected] (github.com/kevva)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Takes a bech32 address and returns a normalized (i.e. lower case) representation of it.
The input is validated along the way, which makes this significantly safer than
using address.toLowerCase().
Convert a secp256k1 compressed public key to an address
The account's pubkey, should be 33 bytes (compressed secp256k1)
the account's address
Convert self delegator address to validator address
The self delegator toBech32d address
the account's address
E.g. "1uscrt" => {amount:"1",denom:"uscrt"}
E.g. "1uscrt,1uatom,1uosmo" =>
[{amount:"1",denom:"uscrt"},{amount:"1",denom:"uatom"},{amount:"1",denom:"uosmo"}]
Convert a Tendermint ed25519 public key to a consensus address
The tendermint pubkey, should be 32 bytes (ed25519)
the valcons account's address
validateAddress checks if a given address is a valid address
the address to check
the address prefix, defaults to "secret"
{ isValid: true } if valid, { isValid: false, reason: "..." } if not valid
Convert self delegator address to validator address
The validator toBech32d address
the account's address
CommissionRates defines the initial commission rates to be used for creating a validator.