gill
Version:
a modern javascript/typescript client library for interacting with the Solana blockchain
38 lines • 2.16 kB
TypeScript
import type { ITransactionMessageWithFeePayer, TransactionMessageWithBlockhashLifetime, TransactionSigner, TransactionVersion } from "@solana/kit";
import type { FullTransaction, Simplify } from "../../../types";
import { type GetCreateTokenInstructionsArgs } from "../instructions/create-token";
import type { TransactionBuilderInput } from "./types";
type GetCreateTokenTransactionInput = Simplify<Omit<GetCreateTokenInstructionsArgs, "metadataAddress"> & Partial<Pick<GetCreateTokenInstructionsArgs, "metadataAddress">>>;
/**
* Create a transaction that can create a token with metadata
*
* The transaction has the following defaults:
* - Default `version` = `legacy`
* - Default `computeUnitLimit`:
* - for TOKEN_PROGRAM_ADDRESS => `60_000`
* - for TOKEN_2022_PROGRAM_ADDRESS => `10_000`
*
* @example
*
* ```
* const mint = await generateKeyPairSigner();
*
* const transaction = await buildCreateTokenTransaction({
* feePayer: signer,
* latestBlockhash,
* mint,
* metadata: {
* name: "Test Token",
* symbol: "TEST",
* uri: "https://example.com/metadata.json",
* isMutable: true,
* },
* // tokenProgram: TOKEN_PROGRAM_ADDRESS, // default
* // tokenProgram: TOKEN_2022_PROGRAM_ADDRESS,
* });
* ```
*/
export declare function buildCreateTokenTransaction<TVersion extends TransactionVersion = "legacy", TFeePayer extends TransactionSigner = TransactionSigner>(args: TransactionBuilderInput<TVersion, TFeePayer> & GetCreateTokenTransactionInput): Promise<FullTransaction<TVersion, ITransactionMessageWithFeePayer>>;
export declare function buildCreateTokenTransaction<TVersion extends TransactionVersion = "legacy", TFeePayer extends TransactionSigner = TransactionSigner, TLifetimeConstraint extends TransactionMessageWithBlockhashLifetime["lifetimeConstraint"] = TransactionMessageWithBlockhashLifetime["lifetimeConstraint"]>(args: TransactionBuilderInput<TVersion, TFeePayer, TLifetimeConstraint> & GetCreateTokenTransactionInput): Promise<FullTransaction<TVersion, ITransactionMessageWithFeePayer, TransactionMessageWithBlockhashLifetime>>;
export {};
//# sourceMappingURL=create-token.d.ts.map