Skip to main content
BETA
HomeIntegration BuilderAPI ReferenceGuides
View Mirror World on Github
Join the Discord server

Language:

transfer_sol

Transfers SOL from the user's wallet to another wallet address.


_23
use mirrorworld_sdk_rust::{ transfer_sol };
_23
_23
fn main() {
_23
let recipient: &str = "2BrLoxPTkPLyLuD3sPitNKXQRA9y8zzZ9P6vYwMTtgBL";
_23
let amount: &str = "1000";
_23
let result: TransferSpltoken = transfer_sol(recipient, amount).await?;
_23
}
_23
_23
// Return Types
_23
// ============
_23
_23
#[derive(Debug, Serialize, Deserialize)]
_23
pub struct TransferSpltoken {
_23
pub tx_signature: String
_23
}
_23
_23
// Error response if any
_23
// =====================
_23
#[derive(Debug, Serialize, Deserialize)]
_23
pub struct Err {
_23
#[serde(rename = "InstructionError")]
_23
pub instruction_error: Option<String>,
_23
}

Edit this page on GitHub

Copyright © Mirror World, Inc. 2023
On this page

    Home

    Tutorials

    Guides

    API Reference