Mint To (Token)

You can mint some token for testing.

Token Program - Mint To Checked

tokenprog.MintToChecked(tokenprog.MintToCheckedParam{
	Mint:     mintPubkey,
	Auth:     alice.PublicKey,
	Signers:  []common.PublicKey{},
	To:       aliceTokenRandomTokenPubkey,
	Amount:   1e8,
	Decimals: 8,
}),

Mint is the mint you want to mint

To is the receiver

Auth is the mint owner, need to sign the tx.

Signers we pass empty first, I will take another chapter to discuss it

Amount the number you want to mint. It is the minimum number. If decimals is 8 and you want to mint 1, you will pass 1e8

Decimals the mint decimals

There is an instruction call MintTo You also can use it to mint token.

Full Code

Last updated

Was this helpful?