6 releases (breaking)

0.5.0 Jan 5, 2026
0.4.0 Jul 24, 2025
0.3.0 Mar 19, 2025
0.2.1 Jan 3, 2025
0.1.0 Nov 5, 2024

#11 in #pinocchio

Download history 3349/week @ 2025-10-28 5210/week @ 2025-11-04 4701/week @ 2025-11-11 4372/week @ 2025-11-18 2833/week @ 2025-11-25 4268/week @ 2025-12-02 4290/week @ 2025-12-09 4557/week @ 2025-12-16 2022/week @ 2025-12-23 2897/week @ 2025-12-30 5051/week @ 2026-01-06 3595/week @ 2026-01-13 3876/week @ 2026-01-20 3996/week @ 2026-01-27 5506/week @ 2026-02-03 4377/week @ 2026-02-10

18,035 downloads per month
Used in 3 crates (2 directly)

Apache-2.0

63KB
1K SLoC

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 `Address`.
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

Dependencies

~250KB