pub fn transfer_to_address(to: Address, asset_id: AssetId, amount: u64) 
Expand description

Transfer amount coins of type asset_id and send them to
the address to.

Arguments

  • to: [Address] - The recipient address.
  • asset_id: [AssetId] - The asset to transfer.
  • amount: [u64] - The amount of coins to transfer.

Reverts

  • When amount is greater than the contract balance for asset_id.
  • When amount is equal to zero.
  • When there are no free variable outputs.

Examples

use std::{constants::ZERO_B256, asset::transfer_to_address};

fn foo() {
    let to_address = Address::from(ZERO_B256);
    transfer_to_address(to_address, AssetId::base(), 500);
}