diff --git a/lib/src/network/explorer/explorer_client.dart b/lib/src/network/explorer/explorer_client.dart index 236d069..eaafeb7 100644 --- a/lib/src/network/explorer/explorer_client.dart +++ b/lib/src/network/explorer/explorer_client.dart @@ -590,9 +590,11 @@ class ExplorerClient { } } - Future send({required Map transaction}) async { + Future send( + {required Map transaction, bool test = false}) async { try { - var response = await client.post(api('transaction/send'), transaction); + var response = await client + .post(api('transaction/send'), {"test": test, ...transaction}); if (response.containsKey('error')) { throw ExplorerException(code: -3, message: response['error']); } diff --git a/lib/src/schema/transaction.dart b/lib/src/schema/transaction.dart index 42d91e3..4a64ac9 100644 --- a/lib/src/schema/transaction.dart +++ b/lib/src/schema/transaction.dart @@ -122,10 +122,9 @@ class Transaction extends GeneratedMessage { String toRawJson({bool asHex = false}) => json.encode(jsonMap(asHex: asHex)); - Map jsonMap({bool asHex = false, bool test = false}) { + Map jsonMap({bool asHex = false}) { final txType = hasDataRequest() ? 'DataRequest' : 'ValueTransfer'; return { - "test": test, "transaction": { txType: { "body": transaction.body.jsonMap(asHex: asHex),