TransactionBuilderABI constructor

TransactionBuilderABI(
  1. List<Uint8List> abis, {
  2. ABIBuilderConfig? builderConfig,
})

Implementation

TransactionBuilderABI(List<Uint8List> abis, {ABIBuilderConfig? builderConfig}) {

  abis.forEach((abi) {
    var deserializer = Deserializer(abi);
    final scriptABI = ScriptABI.deserialize(deserializer);
    String k;
    if (scriptABI is EntryFunctionABI) {
      final module = scriptABI.moduleName;
      k = "${HexString.fromUint8Array(module.address.address).toShortString()}::${module.name.value}::${scriptABI.name}";
    } else {
      final funcABI = scriptABI as TransactionScriptABI;
      k = funcABI.name;
    }

    if (abiMap.containsKey(k)) {
      throw ArgumentError("Found conflicting ABI interfaces");
    }

    abiMap[k] = scriptABI;
  });

  this.builderConfig = ABIBuilderConfig(
      maxGasAmount: builderConfig?.maxGasAmount ?? BigInt.from(DEFAULT_MAX_GAS_AMOUNT),
      expSecFromNow: builderConfig?.expSecFromNow ?? BigInt.from(DEFAULT_TXN_EXP_SEC_FROM_NOW),
      sender: builderConfig?.sender,
      sequenceNumber: builderConfig?.sequenceNumber,
      gasUnitPrice: builderConfig?.gasUnitPrice,
      chainId: builderConfig?.chainId
    );
}