Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 7961

How to transfer SPL-tokens using Rust

$
0
0

I want to add to my smart-contract tranfer SPL-tokens. How i can do that?If I have ATA, receiverATA, mint, amount, decimals.

use solana_program::{    account_info::{next_account_info, AccountInfo},    entrypoint,    entrypoint::ProgramResult,    program::invoke,    program_error::ProgramError,    pubkey::Pubkey,    system_instruction,};entrypoint!(process_instruction);pub fn process_instruction(    _program_id: &Pubkey,    accounts: &[AccountInfo],    instruction_data: &[u8],) -> ProgramResult {    let accounts_iter = &mut accounts.iter();

How do I properly pass all data through JavaScript if I use TransactionInstruction how do I properly pass amount and decimals to data:


Viewing all articles
Browse latest Browse all 7961

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>