pyra-tokens

Crates.iopyra-tokens
lib.rspyra-tokens
version0.2.8
created_at2025-08-06 00:22:09.391052+00
updated_at2026-01-19 21:04:14.456795+00
descriptionToken definitions for supported assets on Pyra
homepage
repositoryhttps://github.com/pyra-labs/pyra-rust-sdk
max_upload_size
id1783216
size22,921
Iarla Crewe (iarlacrewe)

documentation

README

Pyra Tokens

A Rust crate containing supported tokens for Pyra Solana smart contracts. This crate provides a shared interface for token metadata that can be used by both on-chain programs and backend services.

Usage

Add this to your Cargo.toml:

[dependencies]
pyra-tokens = "0.1.0"

Basic Usage

use pyra_tokens::{Token, SUPPORTED_TOKENS};

// Access all supported tokens
for token in SUPPORTED_TOKENS.iter() {
    println!("Token at market index {}: {}", token.market_index, token.mint);
}

// Find token by market index
if let Some(token) = Token::find_by_market_index(0) {
    println!("USDC mint: {}", token.mint);
}

// Find token by mint address
use solana_program::pubkey;
let usdc_mint = pubkey!("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");
if let Some(token) = Token::find_by_mint(&usdc_mint) {
    println!("USDC market index: {}", token.market_index);
}

License

This project is licensed under MIT license.

Commit count: 0

cargo fmt