在 rust 中转移 solana 代币

问题描述 投票:0回答:0

我可以使用转账功能转账 solana 代币(如 RAY 代币)吗?

sdk/src/system_transaction.rs :

pub fn transfer(
    from_keypair: &Keypair,
    to: &Pubkey,
    lamports: u64,
    recent_blockhash: Hash,
) -> Transaction {
    let from_pubkey = from_keypair.pubkey();
    let instruction = system_instruction::transfer(&from_pubkey, to, lamports);
    let message = Message::new(&[instruction], Some(&from_pubkey));
    Transaction::new(&[from_keypair], message, recent_blockhash)
}

我必须使用另一个功能吗?

谢谢你的回答。

rust token solana transfer ray
© www.soinside.com 2019 - 2024. All rights reserved.