junobuild_shared::ledger::icp

Function transfer_payment

Source
pub async fn transfer_payment(
    to: &Principal,
    to_sub_account: &Subaccount,
    memo: Memo,
    amount: Tokens,
    fee: Tokens,
) -> CallResult<TransferResult>
Expand description

Transfers tokens to a specified account.

§Arguments

  • to - The principal of the destination account.
  • to_sub_account - The subaccount of the destination account.
  • memo - A memo for the transaction.
  • amount - The amount of tokens to transfer.
  • fee - The transaction fee.

§Returns

A result containing the transfer result or an error message.