Msg/Mint
Mint(ctx context.Context, in *MsgMint) (*MsgMintResponse, error) Mints new OKRW tokens and sends them to a specified recipient address. This operation can only be performed by the address designated as the 'minter' in the module's parameters. It is a privileged action used to increase the total supply of OKRW.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
minter | string | ✓ | The bech32 address of the account authorized to mint tokens. This must match the minter_address parameter of the okrw module. |
recipient | string | ✓ | The bech32 address of the account that will receive the newly minted tokens. |
amount | cosmos.base.v1beta1.Coin | ✓ | The amount of tokens to mint. The denom must match the mint_denom parameter of the okrw module (e.g., 'aokrw'), and the amount should be a string representing an integer. |
Returns
Type:
MsgMintResponse Returns an empty response on success.
Errors
| Code | Name | Description |
|---|---|---|
codes.InvalidArgument | InvalidArgument | Occurs if the `minter` or `recipient` address is invalid, or if the `amount` is non-positive or has an incorrect denomination. |
codes.PermissionDenied | Unauthorized | Occurs if the `minter` address in the message does not match the authorized minter address in the module parameters. |
Examples
Mint OKRW using Go client
This example demonstrates how to construct and send a `MsgMint` transaction using a generated Go gRPC client to mint 1 OKRW.
import (
"context"
okrwv1 "maroo/api/maroo/okrw/v1"
"cosmossdk.io/api/cosmos/base/v1beta1"
"google.golang.org/grpc"
)
func mintOkrw(conn *grpc.ClientConn, minterAddr, recipientAddr string) (*okrwv1.MsgMintResponse, error) {
msgClient := okrwv1.NewMsgClient(conn)
msg := &okrwv1.MsgMint{
Minter: minterAddr,
Recipient: recipientAddr,
Amount: &v1beta1.Coin{
Denom: "aokrw", // atto-okrw
Amount: "1000000000000000000", // 1 OKRW
},
}
return msgClient.Mint(context.Background(), msg)
} Mint OKRW using grpcurl
A command-line example for minting 5 OKRW using `grpcurl`. This is useful for testing and scripting.
grpcurl -d '{
"minter": "maroo1...",
"recipient": "maroo1...",
"amount": {
"denom": "aokrw",
"amount": "5000000000000000000"
}
}' -plaintext [maroo-node-ip]:9090 maroo.okrw.v1.Msg.Mint