testnet
GitHub

Msg/Mint

Mint(minter: string, recipient: string, amount: cosmos.base.v1beta1.Coin) → MsgMintResponse

Mints a specified amount of aokrw tokens and sends them to a recipient address. This transaction can only be successfully executed by the address designated as the minter_address in the module's parameters. The minter field in the message is implicitly set to the transaction signer's address.

Parameters

Name Type Required Description
minter string The Bech32 address of the account initiating the mint. This MUST match the minter_address parameter. When sending a transaction, this is automatically populated with the signer's address.
recipient string The Bech32 address of the account that will receive the newly minted tokens.
amount Coin The amount of tokens to mint. The coin's denom must match the mint_denom parameter (e.g., aokrw), and the amount must be a positive integer.

Returns

Type: MsgMintResponse

Returns an empty response on success.

Errors

Code Name Description
sdkerrors.ErrUnauthorized Unauthorized Occurs if the transaction signer is not the authorized `minter_address`.
sdkerrors.ErrInvalidAddress InvalidAddress Occurs if the `recipient` address is not a valid Bech32 address, or if the `minter_address` parameter has not been set.
sdkerrors.ErrInvalidCoins InvalidCoins Occurs if the `amount` is not positive or if the `denom` does not match the `mint_denom` parameter.

Examples

Minting 1,000 OKRW via CLI

This command mints 1,000 OKRW (1,000,000,000 aokrw) to a recipient address. The `--from` flag specifies the minter account, which must be authorized in the module parameters.

marood tx okrw mint maroo1...recipient... 1000000000aokrw --from my-minter-key --chain-id maroo-testnet -y

Minting to a different recipient

This example shows minting 5,000 OKRW to a different address, demonstrating the flexibility of the recipient parameter. It also includes a gas price specification.

marood tx okrw mint maroo1...another-recipient... 5000000000aokrw --from my-minter-key --chain-id maroo-testnet --gas-prices 0.1aokrw -y
ESC
Type to search