diff --git a/example/example.dart b/example/example.dart index 6c8cb54c..b2c478f2 100644 --- a/example/example.dart +++ b/example/example.dart @@ -21,7 +21,7 @@ void main(List args) { ) .build('mysuperpassphraseorseed', 0, curve: 'P256') .transaction - ..convertToJSON(); + ..toNodeRPC(); /// Sign the transaction with an origin device private key final originKeypair = deriveKeyPair('origin_seed', 0, isSeedHexa: false); @@ -39,7 +39,7 @@ void main(List args) { uint8ListToHex( Uint8List.fromList(originKeypair.privateKey!), ), - )..convertToJSON(); + )..toNodeRPC(); /// Export the transaction generated into JSON final transaction3 = Transaction( @@ -52,5 +52,5 @@ void main(List args) { ) .build('mysuperpassphraseorseed', 0, curve: 'P256') .transaction - ..convertToJSON(); + ..toNodeRPC(); } diff --git a/lib/src/model/transaction.dart b/lib/src/model/transaction.dart index f009c1ad..d7dbe50b 100644 --- a/lib/src/model/transaction.dart +++ b/lib/src/model/transaction.dart @@ -495,7 +495,7 @@ class Transaction with _$Transaction { } /// Convert the transaction in JSON - String convertToJSON() { + String toNodeRPC() { final json = jsonEncode({ 'version': version, 'address': address == null ? '' : address!.address, diff --git a/lib/src/services/api_service.dart b/lib/src/services/api_service.dart index 1a5e7701..8532bb13 100644 --- a/lib/src/services/api_service.dart +++ b/lib/src/services/api_service.dart @@ -74,7 +74,7 @@ class ApiService with JsonRPCUtil { 'send_transaction', { 'transaction': jsonDecode( - transaction.convertToJSON(), + transaction.toNodeRPC(), ), }, ); @@ -495,7 +495,7 @@ class ApiService with JsonRPCUtil { 'estimate_transaction_fee', { 'transaction': jsonDecode( - transaction.convertToJSON(), + transaction.toNodeRPC(), ), }, ); diff --git a/test/keychain_test.dart b/test/keychain_test.dart index f13bcea0..0fb0c5c5 100644 --- a/test/keychain_test.dart +++ b/test/keychain_test.dart @@ -206,7 +206,7 @@ void main() { derivationPath: kDerivationPath, ); dev.log( - 'keychainTransaction: ${keychainTransaction.convertToJSON()}', + 'keychainTransaction: ${keychainTransaction.toNodeRPC()}', ); /// Create Keychain Access for wallet @@ -219,7 +219,7 @@ void main() { Uint8List.fromList(hexToUint8List(originPrivateKey)), blockchainTxVersion, ); - dev.log('accessKeychainTx: ${accessKeychainTx.convertToJSON()}'); + dev.log('accessKeychainTx: ${accessKeychainTx.toNodeRPC()}'); // ignore: unused_local_variable final transactionStatusKeychain = @@ -361,7 +361,7 @@ void main() { derivationPath: kDerivationPath, ); dev.log( - 'keychainTransaction: ${keychainTransaction.convertToJSON()}', + 'keychainTransaction: ${keychainTransaction.toNodeRPC()}', ); /// Create Keychain Access for wallet @@ -374,7 +374,7 @@ void main() { Uint8List.fromList(hexToUint8List(originPrivateKey)), blockchainTxVersion, ); - dev.log('accessKeychainTx: ${accessKeychainTx.convertToJSON()}'); + dev.log('accessKeychainTx: ${accessKeychainTx.toNodeRPC()}'); // ignore: unused_local_variable final transactionStatusKeychain = diff --git a/test/transaction_test.dart b/test/transaction_test.dart index a940960a..9d0327af 100644 --- a/test/transaction_test.dart +++ b/test/transaction_test.dart @@ -51,7 +51,7 @@ void main() { ]) .build('seed', 0, curve: 'P256', isSeedHexa: false) .transaction; - final dynamic parsedTx = json.decode(tx.convertToJSON()); + final dynamic parsedTx = json.decode(tx.toNodeRPC()); expect( parsedTx['data']['ownerships'][0]['authorizedKeys'], >[ @@ -693,7 +693,7 @@ condition inherit: [ uint8ListToHex(Uint8List.fromList(originKeypair.privateKey!)), ); - final Map parsedTx = json.decode(tx.convertToJSON()); + final Map parsedTx = json.decode(tx.toNodeRPC()); final previousSig = crypto.sign( tx.previousSignaturePayload(),