pinocchio-token

Crates.iopinocchio-token
lib.rspinocchio-token
version
sourcesrc
created_at2024-11-05 09:47:40.797323+00
updated_at2025-03-19 00:49:58.865033+00
descriptionPinocchio helpers to invoke Token program instructions
homepage
repositoryhttps://github.com/anza-xyz/pinocchio
max_upload_size
id1436267
Cargo.toml error:TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
(anza-team)

documentation

README

pinocchio-token

pinocchio-token

Overview

This crate contains pinocchio helpers to perform cross-program invocations (CPIs) for SPL Token instructions.

Each instruction defines a struct with the accounts and parameters required. Once all values are set, you can call directly invoke or invoke_signed to perform the CPI.

This is a no_std crate.

Note: The API defined in this crate is subject to change.

Examples

Initializing a mint account:

// This example assumes that the instruction receives a writable `mint`
// account; `authority` is a `Pubkey`.
InitializeMint {
    mint,
    rent_sysvar,
    decimals: 9,
    mint_authority: authority,
    freeze_authority: Some(authority),
}.invoke()?;

Performing a transfer of tokens:

// This example assumes that the instruction receives writable `from` and `to`
// accounts, and a signer `authority` account.
Transfer {
    from,
    to,
    authority,
    amount: 10,
}.invoke()?;

License

The code is licensed under the Apache License Version 2.0

Commit count: 0

cargo fmt