prepareSendingNativeSOL(from_to_amount_feePayer_) - p2p-org/solana-swift GitHub Wiki

prepareSendingNativeSOL(from:to:amount:feePayer:)

Create prepared transaction for sending SOL

public func prepareSendingNativeSOL(from account: Account,
                                        to destination: String,
                                        amount: UInt64,
                                        feePayer: PublicKey? = nil
    )
  • account

  • recentBlockhash optional

Parameters

  • to: destination wallet address
  • amount: amount in lamports
  • feePayer: customm fee payer, can be omited if the authorized user is the payer

Returns

PreparedTransaction, can be send either directly or via custom fee relayer