Method: Xpring::Client#send_xrp

Defined in:
lib/xpring/client.rb

#send_xrp(amount:, to:, from:) ⇒ Org::Xrpl::Rpc::V1::SubmitTransactionResponse?

Parameters:

Returns:

Raises:



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/xpring/client.rb', line 58

def send_xrp(amount:, to:, from:)
  classic_from_address, classic_to_address,  =
    validate_and_prepare_sending_xrp(to.to_s, from)
  transaction_hash = {
    Account: classic_from_address,
    Fee: minimum_fee.to_s, # ripple-binary-codec requires string
    LastLedgerSequence: next_sequence_for_transaction,
    Sequence: ..sequence.value,
    SigningPubKey: from.public_key,
    Amount: amount.to_s, # ripple-binary-codec requires string
    Destination: classic_to_address,
    TransactionType: "Payment",
  }
  submit_transaction(from_wallet: from, transaction_hash: transaction_hash)
end