Function transferFunds

  • Spend a fraction of coin balance to another account. Useful if needed to drain account balance completely, sending funds to another account (with fraction set to 1).

    Parameters

    • fraction: string | number

      Fraction of balance to spend (between 0 and 1)

    • recipientIdOrName: `${string}.chain` | `ak_${string}`

      Address or name of recipient account

    • options: TransferFundsOptions

      Options

    Returns ReturnType<typeof sendTransaction>

    Example

    // `fraction` * 100 = % of AE to be transferred (e.g. `0.42` for 42% or `1` for 100%)
    const { blockHeight } = await aeSdk.transferFunds(
    0.42,
    'ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E',
    );
    console.log('Transaction mined at', blockHeight);

Generated using TypeDoc