solana_kit_token 0.4.0 copy "solana_kit_token: ^0.4.0" to clipboard
solana_kit_token: ^0.4.0 copied to clipboard

SPL Token and Associated Token Account client for the Solana Kit Dart SDK. Generated from the upstream Codama IDL with handwritten ergonomic helpers.

solana_kit_token #

pub package CI Coverage

SPL Token client for the Solana Kit Dart SDK.

Provides a generated low-level client from the upstream Codama IDL plus handwritten ergonomic helpers for common token workflows. Associated Token Account (ATA) APIs are shared from solana_kit_associated_token_account and re-exported for convenience.

Installation #

dependencies:
  solana_kit_token: ^0.4.0

Usage #

Create a mint #

import 'package:solana_kit_token/solana_kit_token.dart';

final result = await getCreateMintInstructionPlan(
  mintAuthority: mintAuthority,
  decimals: 9,
  rpc: rpc,
  signer: mintSigner,
);

Mint to an ATA #

final result = await getMintToAtaInstructionPlan(
  mint: mintAddress,
  destination: recipientAta,
  authority: mintAuthority,
  amount: BigInt.from(1000000000),
  rpc: rpc,
);

Transfer to an ATA #

final result = await getTransferToAtaInstructionPlan(
  source: senderAta,
  destination: recipientAta,
  authority: ownerSigner,
  amount: BigInt.from(500000000),
  rpc: rpc,
);

Use generated builders directly #

final ix = getTransferInstruction(
  programAddress: tokenProgramAddress,
  source: sourceAccount,
  destination: destAccount,
  owner: ownerAddress,
  amount: BigInt.from(1000),
);

Generated layer #

The generated code under src/generated/ is produced from the upstream Codama IDL at solana-program/token. It includes:

  • Instruction builders — typed functions for all SPL Token instructions
  • Account decoders — parse on-chain account data into typed structs
  • Codecs — binary encoders/decoders for all token types
  • Error definitions — typed error codes and messages
  • PDA helpers — derive associated token account addresses
  • Program addresstokenProgramAddress constant

Ergonomic helpers #

Higher-level functions compose generated instructions into common workflows:

Helper Description
getCreateMintInstructionPlan Create a new token mint with a payer and signer.
getMintToAtaInstructionPlan Mint tokens to an ATA, creating it if needed.
getTransferToAtaInstructionPlan Transfer tokens to a recipient's ATA.

Each helper handles ATA derivation, account existence checks, and instruction composition automatically.

Re-exports #

This package re-exports the full solana_kit_associated_token_account API surface so callers can access ATA PDA helpers and instruction builders without adding a separate dependency.

Upstream reference #

Generated layer mirrors solana-program/token.

0
likes
0
points
26
downloads

Publisher

unverified uploader

Weekly Downloads

SPL Token and Associated Token Account client for the Solana Kit Dart SDK. Generated from the upstream Codama IDL with handwritten ergonomic helpers.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

meta, solana_kit_accounts, solana_kit_addresses, solana_kit_associated_token_account, solana_kit_codecs_core, solana_kit_codecs_data_structures, solana_kit_codecs_numbers, solana_kit_codecs_strings, solana_kit_errors, solana_kit_instruction_plans, solana_kit_instructions, solana_kit_system

More

Packages that depend on solana_kit_token