balance function

MoveCallBuilder balance({
  1. required dynamic arguments,
  2. String? package,
  3. List<String> typeArguments = const [],
  4. Map<String, dynamic>? config,
})

Returns the total balance of T available to the account, including funds delivered through the ambient accumulator but not yet settled into the account.

Implementation

MoveCallBuilder balance(
    {required dynamic arguments,
    String? package,
    List<String> typeArguments = const [],
    Map<String, dynamic>? config}) {
  final packageAddress = package ??
      (config?['accountPackageId'] as String?) ??
      '@local-pkg/account';
  return (tx) => tx.moveCall(
        '$packageAddress::account::balance',
        typeArguments: typeArguments,
        arguments: normalizeMoveArguments(
            tx,
            arguments,
            [null, '0x2::accumulator::AccumulatorRoot', '0x2::clock::Clock'],
            ['self']),
      );
}