Registry / crypto / spl-token

spl-token

JSON →
library9.0.0rscratesunverified

Solana Program Library Token

# Cargo.toml [dependencies] spl-token = "9.0.0"
INSTALL
IMPORT
SIG · SPL-TOKEN
S
spl-token
cryptorustv9.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

transfer
use spl_token::instruction::transfer;

Creates a token transfer instruction for the Solana blockchain.

use solana_program::pubkey::Pubkey; use spl_token::instruction::transfer; fn main() { let owner = Pubkey::new_unique(); let dest = Pubkey::new_unique(); let ix = transfer( &spl_token::id(), &owner, &dest, &owner, &[], 100, ).unwrap(); println!("{:?}", ix); }
Debug
Known issues
gotchaRequires `solana-program` and `solana-sdk` dependencies.
fix
Add `solana-program` and `solana-sdk` to Cargo.toml.
affects: >=9.0.0
Upgrade
Version history
9.0.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
27 hits · last 30 days
node
14
Amazon
1
Resources
spl-token — cargo add spl-token · libregistry