-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
use spl_associated_token_account::{get_associated_token_address_with_program_id, id as ata_program_id, solana_program::pubkey::Pubkey};
use std::str::FromStr;
fn main() {
let owner = Pubkey::from_str("6gfi6GSjrhqc5xDLtDkVrTR61Hi7GMNPmJknxvbqzb1x").unwrap();
let mint = Pubkey::from_str("So11111111111111111111111111111111111111112").unwrap();
let token_program = Pubkey::from_str("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA").unwrap();
let ata = get_associated_token_address_with_program_id(&owner, &mint, &token_program);
println!("{ata}"); // prints: 3bVtJCvGznrA6Pc6bjgjqvVeFha2foZd6a3KikdhiFUM
}Cargo.toml
[dependencies]
spl-associated-token-account = "7.0.0"Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels