executeLocal function

Future<(String, Transaction)> executeLocal({
  1. required String config,
  2. required String account,
  3. required String message,
  4. required DateTime utime,
  5. required bool disableSignatureCheck,
  6. BigInt? overwriteBalance,
  7. int? globalId,
})

Run contract locally. config - value from Transport.getBlockchainConfig account - boc from makeFullAccountBoc message - base64-encoded boc from one of:

  1. encodeInternalMessage
  2. createRawExternalMessage
  3. createExternalMessageWithoutSignature
  4. UnsignedMessage.signFake

Returns boc, transaction if everything is ok or throws ExecuteLocalException if transaction failed, this is not code-related problem. or throws error

Implementation

Future<(String, Transaction)> executeLocal({
  required String config,
  required String account,
  required String message,
  required DateTime utime,
  required bool disableSignatureCheck,
  BigInt? overwriteBalance,
  int? globalId,
}) async {
  final result = await createLib().executeLocal(
    account: account,
    message: message,
    utime: utime.millisecondsSinceEpoch,
    globalId: globalId,
    config: config,
    overwriteBalance: overwriteBalance?.toString(),
    disableSignatureCheck: disableSignatureCheck,
  );
  if (result.length == 1) {
    throw ExecuteLocalException(result[0]);
  }

  return (result[0], Transaction.fromJson(jsonDecode(result[1])));
}