Snip20Tx Members
The Snip20Tx type exposes the following members.
Methods
Name | Description | |
---|---|---|
![]() |
Burn(MsgBurn, Nullable<(Of <<'(TxOptions>)>>)) |
MUST remove amount tokens from the balance of the Cosmos message sender and MUST reduce the total supply by the same amount.
MUST NOT transfer the funds to another account.
|
![]() |
Burn(String, String, Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(TxOptions>)>>)) |
MUST remove amount tokens from the balance of the Cosmos message sender and MUST reduce the total supply by the same amount.
MUST NOT transfer the funds to another account.
|
![]() |
BurnFrom(MsgBurnFrom, Nullable<(Of <<'(TxOptions>)>>)) |
This works like TransferFrom, but burns the tokens instead of transferring them.
This will reduce the owner's balance, total_supply and the caller's allowance.
This function should be available when a contract supports both the Mintable and Allowances interfaces.
|
![]() |
BurnFrom(String, String, String, Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(TxOptions>)>>)) |
This works like TransferFrom, but burns the tokens instead of transferring them.
This will reduce the owner's balance, total_supply and the caller's allowance.
This function should be available when a contract supports both the Mintable and Allowances interfaces.
|
![]() |
CreateViewingKey(MsgCreateViewingKey, Nullable<(Of <<'(TxOptions>)>>)) |
This function generates a new viewing key for the Cosmos message sender, which is used in ALL account specific queries. This key is used to validate the identity of the caller,
since in queries in Cosmos there is no way to cryptographically authenticate the querier's identity.
The Viewing Key MUST be stored in such a way that lookup takes a significant amount to time to perform, in order to be resistant to brute-force attacks.
The viewing key MUST NOT control any functions which actively affect the balance of the user.
The entropy field of the request should be a client supplied string used for entropy for generation of the viewing key.Secure implementation is left to the client,
but it is recommended to use base-64 encoded random bytes and not predictable inputs.
|
![]() |
CreateViewingKey(String, String, Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(TxOptions>)>>)) |
This function generates a new viewing key for the Cosmos message sender, which is used in ALL account specific queries. This key is used to validate the identity of the caller,
since in queries in Cosmos there is no way to cryptographically authenticate the querier's identity.
The Viewing Key MUST be stored in such a way that lookup takes a significant amount to time to perform, in order to be resistant to brute-force attacks.
The viewing key MUST NOT control any functions which actively affect the balance of the user.
The entropy field of the request should be a client supplied string used for entropy for generation of the viewing key.Secure implementation is left to the client,
but it is recommended to use base-64 encoded random bytes and not predictable inputs.
|
![]() |
DecreaseAllowance(MsgDecreaseAllowance, Nullable<(Of <<'(TxOptions>)>>)) |
Decrease or clear the allowance by a sent amount. This may optionally come with an expiration time, which if set limits when the approval can be used.
If amount is equal or greater than the current allowance, this action MUST set the allowance to zero, and return a "success" response.
|
![]() |
DecreaseAllowance(String, String, String, Nullable<(Of <<'(Int32>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(TxOptions>)>>)) |
Decrease or clear the allowance by a sent amount. This may optionally come with an expiration time, which if set limits when the approval can be used.
If amount is equal or greater than the current allowance, this action MUST set the allowance to zero, and return a "success" response.
|
![]() |
Deposit(MsgDeposit, Nullable<(Of <<'(TxOptions>)>>)) |
Deposits a native coin into the contract, which will mint an equivalent amount of tokens to be created.
The amount MUST be sent in the sent_funds field of the transaction itself, as coins must really be sent to the contract's native address.
The minted amounts MUST match the exchange rate specified by the ExchangeRate query.
The deposit MUST return an error if any coins that do not match expected denominations are sent.
|
![]() |
Deposit(String, array<Coin>[]()[][], Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(TxOptions>)>>)) |
Deposits a native coin into the contract, which will mint an equivalent amount of tokens to be created.
The amount MUST be sent in the sent_funds field of the transaction itself, as coins must really be sent to the contract's native address.
The minted amounts MUST match the exchange rate specified by the ExchangeRate query.
The deposit MUST return an error if any coins that do not match expected denominations are sent.
|
![]() |
IncreaseAllowance(MsgIncreaseAllowance, Nullable<(Of <<'(TxOptions>)>>)) |
Set or increase the allowance such that spender may access up to current_allowance + amount tokens from the Cosmos message sender account.
This may optionally come with an expiration time, which if set limits when the approval can be used (by time).
|
![]() |
IncreaseAllowance(String, String, String, Nullable<(Of <<'(Int32>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(TxOptions>)>>)) |
Set or increase the allowance such that spender may access up to current_allowance + amount tokens from the Cosmos message sender account.
This may optionally come with an expiration time, which if set limits when the approval can be used (by time).
|
![]() |
Instantiate |
Instantiates / configures the Token contract (https://github.com/SecretFoundation/SNIPs/blob/master/SNIP-20.md at 2022-07-11).
|
![]() |
Mint(MsgMint, Nullable<(Of <<'(TxOptions>)>>)) |
This function MUST be allowed only for accounts on the minters list.
If the Cosmos message sender is an allowed minter, this will create amount new tokens and add them to the balance of recipient.
|
![]() |
Mint(String, String, String, Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(TxOptions>)>>)) |
This function MUST be allowed only for accounts on the minters list.
If the Cosmos message sender is an allowed minter, this will create amount new tokens and add them to the balance of recipient.
|
![]() |
Redeem(MsgRedeem, Nullable<(Of <<'(TxOptions>)>>)) |
Redeems tokens in exchange for native coins.
The redeemed tokens SHOULD be burned, and taken out of the pool.
|
![]() |
Redeem(String, String, Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(TxOptions>)>>)) |
Redeems tokens in exchange for native coins.
The redeemed tokens SHOULD be burned, and taken out of the pool.
|
![]() |
RegisterReceive(MsgRegisterReceive, Nullable<(Of <<'(TxOptions>)>>)) |
This message is used to tell the SNIP-20 contract to call the Receive function of the Cosmos message sender after a successful Send.
In Secret Network this is used to pair a code hash with the contract address that must be called.
This means that the SNIP-20 MUST store the sent code_hash and use it when calling the Receive function.
|
![]() |
RegisterReceive(String, String, Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(TxOptions>)>>)) |
This message is used to tell the SNIP-20 contract to call the Receive function of the Cosmos message sender after a successful Send.
In Secret Network this is used to pair a code hash with the contract address that must be called.
This means that the SNIP-20 MUST store the sent code_hash and use it when calling the Receive function.
|
![]() |
Send(MsgSend, Nullable<(Of <<'(TxOptions>)>>)) |
Moves amount from the Cosmos message sender account to the recipient account. The receiver account MAY be a contract that has registered itself using a RegisterReceive message. If such a registration has been performed, a message MUST be sent to the contract's address as a callback, after completing the transfer. The format of this message is described under Receiver interface.
If the callback fails due to an error in the Receiver contract, the entire transaction will be reverted.
|
![]() |
Send(String, String, String, Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(TxOptions>)>>)) |
Moves amount from the Cosmos message sender account to the recipient account. The receiver account MAY be a contract that has registered itself using a RegisterReceive message. If such a registration has been performed, a message MUST be sent to the contract's address as a callback, after completing the transfer. The format of this message is described under Receiver interface.
If the callback fails due to an error in the Receiver contract, the entire transaction will be reverted.
|
![]() |
SendFrom(MsgSendFrom, Nullable<(Of <<'(TxOptions>)>>)) |
SendFrom is to Send, what TransferFrom is to Transfer.
This allows a pre-approved account to not just transfer the tokens, but to send them to another address to trigger a given action.
Note SendFrom will set the Receive{sender} to be the env.message.sender (the account that triggered the transfer) rather than the owner account (the account the money is coming from).
|
![]() |
SendFrom(String, String, String, String, Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(TxOptions>)>>)) |
SendFrom is to Send, what TransferFrom is to Transfer.
This allows a pre-approved account to not just transfer the tokens, but to send them to another address to trigger a given action.
Note SendFrom will set the Receive{sender} to be the env.message.sender (the account that triggered the transfer) rather than the owner account (the account the money is coming from).
|
![]() |
SetMinters(MsgSetMinters, Nullable<(Of <<'(TxOptions>)>>)) |
This function MUST only be allowed for authorized accounts.
The list of addresses in the message will be set to the list of minters in the contract. This completely overrides the previously saved list.
|
![]() |
SetMinters(String, String, Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(TxOptions>)>>)) |
This function MUST only be allowed for authorized accounts.
The list of addresses in the message will be set to the list of minters in the contract. This completely overrides the previously saved list.
|
![]() |
SetViewingKey(MsgSetViewingKey, Nullable<(Of <<'(TxOptions>)>>)) |
Set a viewing key with a predefined value for Cosmos message sender, without creating it. This is useful to manage multiple SNIP-20 tokens using the same viewing key.
If a viewing key is already set, the contract MUST replace the current key.If a viewing key is not set, the contract MUST set the provided key as the viewing key.
It is NOT RECOMMENDED to use this function to create easy to remember passwords for users, but this is left up to implementors to enforce.
|
![]() |
SetViewingKey(String, String, Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(TxOptions>)>>)) |
Set a viewing key with a predefined value for Cosmos message sender, without creating it. This is useful to manage multiple SNIP-20 tokens using the same viewing key.
If a viewing key is already set, the contract MUST replace the current key.If a viewing key is not set, the contract MUST set the provided key as the viewing key.
It is NOT RECOMMENDED to use this function to create easy to remember passwords for users, but this is left up to implementors to enforce.
|
![]() |
Transfer(MsgTransfer, Nullable<(Of <<'(TxOptions>)>>)) |
Moves tokens from the account that appears in the Cosmos message sender field to the account in the recipient field.
Variation from CW-20: It is NOT required to validate that the recipient is an address and not a contract. This command will work when trying to send funds to contract accounts as well.
|
![]() |
Transfer(String, String, String, Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(TxOptions>)>>)) |
Moves tokens from the account that appears in the Cosmos message sender field to the account in the recipient field.
Variation from CW-20: It is NOT required to validate that the recipient is an address and not a contract. This command will work when trying to send funds to contract accounts as well.
|
![]() |
TransferFrom(MsgTransferFrom, Nullable<(Of <<'(TxOptions>)>>)) |
Transfer an amount of tokens from a specified account, to another specified account.
This action MUST fail if the Cosmos message sender does not have an allowance limit that is equal or greater than the amount of tokens sent for the owner account.
|
![]() |
TransferFrom(String, String, String, String, Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(String>)>>), Nullable<(Of <<'(TxOptions>)>>)) |
Transfer an amount of tokens from a specified account, to another specified account.
This action MUST fail if the Cosmos message sender does not have an allowance limit that is equal or greater than the amount of tokens sent for the owner account.
|