borrowData function

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

Borrow an app's attached Data. Open (no witness): the slot is namespaced by App and on-chain state is public, so composing apps can read it. Aborts if nothing is attached.

Implementation

MoveCallBuilder borrowData(
    {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::borrow_data',
        typeArguments: typeArguments,
        arguments: normalizeMoveArguments(tx, arguments, [null], ['self']),
      );
}