buildMintTokensTransaction
Call Signature
Create a transaction that can mint tokens to the desired wallet/owner, including creating their ATA if it does not exist
The transaction has the following defaults:
- Default
version
=legacy
- Default
computeUnitLimit
=31_000
Example
Type Parameters
Type Parameter | Default type |
---|---|
TVersion extends TransactionVersion | "legacy" |
TFeePayer extends TransactionSigner | TransactionSigner |
Parameters
Parameter | Type |
---|---|
args | { computeUnitLimit? : number | bigint ; computeUnitPrice? : number | bigint ; latestBlockhash? : undefined ; version? : TVersion ; } & { amount : number | bigint ; ata? : Address ; destination : Address | TransactionSigner ; feePayer : Address | TransactionSigner ; mint : Address | KeyPairSigner ; mintAuthority : Address | TransactionSigner ; tokenProgram? : Address ; } |
Returns
Promise
<{
feePayer
: Readonly
<{
address
: Address
<TAddress
>;
}>;
instructions
: readonly IInstruction
<string
, readonly (IAccountLookupMeta
<string
, string
> | IAccountMeta
<string
>)[]>[];
version
: TVersion
;
}>
Remarks
- minting without creating the ata is generally < 10_000cu
- validating the ata onchain during creation results in a ~5000cu fluctuation
Call Signature
Create a transaction that can mint tokens to the desired wallet/owner, including creating their ATA if it does not exist
The transaction has the following defaults:
- Default
version
=legacy
- Default
computeUnitLimit
=31_000
Example
Type Parameters
Type Parameter | Default type |
---|---|
TVersion extends TransactionVersion | "legacy" |
TFeePayer extends TransactionSigner | TransactionSigner |
TLifetimeConstraint extends Readonly <{ blockhash : Blockhash ; lastValidBlockHeight : bigint ; }> | Readonly <{ blockhash : Blockhash ; lastValidBlockHeight : bigint ; }> |
Parameters
Parameter | Type |
---|---|
args | { computeUnitLimit? : number | bigint ; computeUnitPrice? : number | bigint ; latestBlockhash? : TLifetimeConstraint ; version? : TVersion ; } & { amount : number | bigint ; ata? : Address ; destination : Address | TransactionSigner ; feePayer : Address | TransactionSigner ; mint : Address | KeyPairSigner ; mintAuthority : Address | TransactionSigner ; tokenProgram? : Address ; } |
Returns
Promise
<{
feePayer
: Readonly
<{
address
: Address
<TAddress
>;
}>;
instructions
: readonly IInstruction
<string
, readonly (IAccountLookupMeta
<string
, string
> | IAccountMeta
<string
>)[]>[];
lifetimeConstraint
: BlockhashLifetimeConstraint
;
version
: TVersion
;
}>
Remarks
- minting without creating the ata is generally < 10_000cu
- validating the ata onchain during creation results in a ~5000cu fluctuation