Nagaprasad V R 55ecb47a4f `feat` : add token-2022 core ixs and state (#190) 3 mesi fa
..
src 55ecb47a4f `feat` : add token-2022 core ixs and state (#190) 3 mesi fa
Cargo.toml 2a7fa8b9ea Publish pinocchio-token v0.4.0 4 mesi fa
README.md 8ffab5aaaf Update README layout (#100) 8 mesi fa

README.md

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