From 16b2b60ab3405050bcbd48cf658966198fb442e2 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 14 Nov 2024 11:28:26 -0500 Subject: [PATCH 01/12] add definitions codec gen --- .../src/enums/definitions.json | 197 ++++++----- .../tools/generateDefinitions.js | 315 ++++++++++++++++++ 2 files changed, 410 insertions(+), 102 deletions(-) create mode 100644 packages/ripple-binary-codec/tools/generateDefinitions.js diff --git a/packages/ripple-binary-codec/src/enums/definitions.json b/packages/ripple-binary-codec/src/enums/definitions.json index 797be9ce21..aa517a3ed2 100644 --- a/packages/ripple-binary-codec/src/enums/definitions.json +++ b/packages/ripple-binary-codec/src/enums/definitions.json @@ -30,116 +30,113 @@ "Metadata": 10004 }, "LEDGER_ENTRY_TYPES": { + "Any": -3, + "Child": -2, "Invalid": -1, + "NFTokenOffer": 55, + "Check": 67, + "DID": 73, + "NegativeUNL": 78, + "NFTokenPage": 80, + "SignerList": 83, + "Ticket": 84, "AccountRoot": 97, "DirectoryNode": 100, - "RippleState": 114, - "Ticket": 84, - "SignerList": 83, - "Offer": 111, - "Bridge": 105, - "LedgerHashes": 104, "Amendments": 102, + "LedgerHashes": 104, + "Bridge": 105, + "Offer": 111, + "DepositPreauth": 112, "XChainOwnedClaimID": 113, - "XChainOwnedCreateAccountClaimID": 116, + "RippleState": 114, "FeeSettings": 115, + "XChainOwnedCreateAccountClaimID": 116, "Escrow": 117, "PayChannel": 120, - "Check": 67, - "DepositPreauth": 112, - "NegativeUNL": 78, - "NFTokenPage": 80, - "NFTokenOffer": 55, "AMM": 121, - "DID": 73, - "Oracle": 128, - "Any": -3, - "Child": -2, - "Nickname": 110, - "Contract": 99, - "GeneratorMap": 103 + "Oracle": 128 }, "FIELDS": [ [ - "Generic", - { - "nth": 0, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Unknown" - } - ], - [ - "Invalid", - { - "nth": -1, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Unknown" - } - ], - [ - "ObjectEndMarker", - { - "nth": 1, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "STObject" - } - ], - [ - "ArrayEndMarker", - { - "nth": 1, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "STArray" - } - ], - [ - "hash", - { - "nth": 257, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Hash256" - } - ], - [ - "index", - { - "nth": 258, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Hash256" - } - ], - [ - "taker_gets_funded", - { - "nth": 258, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Amount" - } - ], - [ - "taker_pays_funded", - { - "nth": 259, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Amount" - } - ], + "Generic", + { + "nth": 0, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Unknown" + } + ], + [ + "Invalid", + { + "nth": -1, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Unknown" + } + ], + [ + "ObjectEndMarker", + { + "nth": 1, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "STObject" + } + ], + [ + "ArrayEndMarker", + { + "nth": 1, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "STArray" + } + ], + [ + "hash", + { + "nth": 257, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Hash256" + } + ], + [ + "index", + { + "nth": 258, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Hash256" + } + ], + [ + "taker_gets_funded", + { + "nth": 258, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Amount" + } + ], + [ + "taker_pays_funded", + { + "nth": 259, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Amount" + } + ], [ "LedgerEntry", { @@ -2933,12 +2930,9 @@ "AccountSet": 3, "EscrowCancel": 4, "SetRegularKey": 5, - "NickNameSet": 6, "OfferCreate": 7, "OfferCancel": 8, - "Contract": 9, "TicketCreate": 10, - "TicketCancel": 11, "SignerListSet": 12, "PaymentChannelCreate": 13, "PaymentChannelFund": 14, @@ -2949,7 +2943,6 @@ "DepositPreauth": 19, "TrustSet": 20, "AccountDelete": 21, - "SetHook": 22, "NFTokenMint": 25, "NFTokenBurn": 26, "NFTokenCreateOffer": 27, diff --git a/packages/ripple-binary-codec/tools/generateDefinitions.js b/packages/ripple-binary-codec/tools/generateDefinitions.js new file mode 100644 index 0000000000..e39a5e402a --- /dev/null +++ b/packages/ripple-binary-codec/tools/generateDefinitions.js @@ -0,0 +1,315 @@ +if (process.argv.length != 3) { + console.log( + 'Usage: ' + process.argv[0] + ' ' + process.argv[1] + ' path/to/rippled', + ) + process.exit(1) +} + +//////////////////////////////////////////////////////////////////////// +// Get all necessary files from rippled +//////////////////////////////////////////////////////////////////////// +const sfield_h_fn = process.argv[2] + '/include/xrpl/protocol/SField.h' +const sfield_macro_fn = + process.argv[2] + '/include/xrpl/protocol/detail/sfields.macro' +const ledgerformats_macro_fn = + process.argv[2] + '/include/xrpl/protocol/detail/ledger_entries.macro' +const ter_h_fn = process.argv[2] + '/include/xrpl/protocol/TER.h' +const txformats_macro_fn = + process.argv[2] + '/include/xrpl/protocol/detail/transactions.macro' + +const fs = require('fs') + +const sfield_h = fs.readFileSync(sfield_h_fn).toString('utf-8') +const sfield_macro = fs.readFileSync(sfield_macro_fn).toString('utf-8') +const ledgerformats_macro = fs + .readFileSync(ledgerformats_macro_fn) + .toString('utf-8') +const ter_h = fs.readFileSync(ter_h_fn).toString('utf-8') +const txformats_macro = fs.readFileSync(txformats_macro_fn).toString('utf-8') + +const capitalization_exceptions = { + NFTOKEN: 'NFToken', + URITOKEN: 'URIToken', + URI: 'URI', + UNL: 'UNL', + XCHAIN: 'XChain', + DID: 'DID', + ID: 'ID', + AMM: 'AMM', +} + +// Translate from rippled string format to what the binary codecs expect +function translate(inp) { + try { + if (inp.match(/^UINT/m)) + if (inp.match(/256/m) || inp.match(/160/m) || inp.match(/128/m)) + return inp.replace('UINT', 'Hash') + else return inp.replace('UINT', 'UInt') + if (inp == 'OBJECT' || inp == 'ARRAY') + return 'ST' + inp.substr(0, 1).toUpperCase() + inp.substr(1).toLowerCase() + if (inp == 'AMM') return inp + if (inp == 'ACCOUNT') return 'AccountID' + if (inp == 'LEDGERENTRY') return 'LedgerEntry' + if (inp == 'NOTPRESENT') return 'NotPresent' + if (inp == 'PATHSET') return 'PathSet' + if (inp == 'VL') return 'Blob' + if (inp == 'DIR_NODE') return 'DirectoryNode' + if (inp == 'PAYCHAN') return 'PayChannel' + + const parts = inp.split('_') + let result = '' + for (x in parts) + if (capitalization_exceptions[parts[x]] != null) { + result += capitalization_exceptions[parts[x]] + } else + result += + parts[x].substr(0, 1).toUpperCase() + parts[x].substr(1).toLowerCase() + return result + } catch (e) { + console.log(e, 'inp="' + inp + '"') + } +} + +//////////////////////////////////////////////////////////////////////// +// Serialized type processing +//////////////////////////////////////////////////////////////////////// +console.log('{') +console.log(' "TYPES": {') +console.log(' "Done": -1,') + +let hits = [ + ...sfield_h.matchAll(/^ *STYPE\(STI_([^ ]*?) *, *([0-9-]+) *\) *\\?$/gm), +] +if (hits.length === 0) + hits = [...sfield_h.matchAll(/^ *STI_([^ ]*?) *= *([0-9-]+) *,?$/gm)] +for (let x = 0; x < hits.length; ++x) { + console.log( + ' "' + + translate(hits[x][1]) + + '": ' + + hits[x][2] + + (x < hits.length - 1 ? ',' : ''), + ) +} + +console.log(' },') + +//////////////////////////////////////////////////////////////////////// +// Ledger entry type processing +//////////////////////////////////////////////////////////////////////// +console.log(' "LEDGER_ENTRY_TYPES": {') +console.log(' "Any": -3,') +console.log(' "Child": -2,') +console.log(' "Invalid": -1,') + +const unhex = (x) => { + x = ('' + x).trim() + if (x.substr(0, 2) == '0x') return '' + parseInt(x) + if (x.substr(0, 1) == "'" && x.length == 3) return x.charCodeAt(1) + return x +} +hits = [ + ...ledgerformats_macro.matchAll( + /^ *LEDGER_ENTRY\(lt[A-Z_]+ *, *([x0-9a-f]+) *, *([^,]+), \({$/gm, + ), +] +for (let x = 0; x < hits.length; ++x) + console.log( + ' "' + + hits[x][2] + + '": ' + + unhex(hits[x][1]) + + (x < hits.length - 1 ? ',' : ''), + ) +console.log(' },') + +//////////////////////////////////////////////////////////////////////// +// SField processing +//////////////////////////////////////////////////////////////////////// +console.log(' "FIELDS": [') +// The ones that are harder to parse directly from SField.cpp +console.log(` [ + "Generic", + { + "nth": 0, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Unknown" + } + ], + [ + "Invalid", + { + "nth": -1, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Unknown" + } + ], + [ + "ObjectEndMarker", + { + "nth": 1, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "STObject" + } + ], + [ + "ArrayEndMarker", + { + "nth": 1, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "STArray" + } + ], + [ + "hash", + { + "nth": 257, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Hash256" + } + ], + [ + "index", + { + "nth": 258, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Hash256" + } + ], + [ + "taker_gets_funded", + { + "nth": 258, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Amount" + } + ], + [ + "taker_pays_funded", + { + "nth": 259, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Amount" + } + ],`) + +const isVLEncoded = (t) => { + if (t == 'VL' || t == 'ACCOUNT' || t == 'VECTOR256') return 'true' + return 'false' +} + +const isSerialized = (t) => { + if ( + t == 'LEDGERENTRY' || + t == 'TRANSACTION' || + t == 'VALIDATION' || + t == 'METADATA' + ) + return 'false' + return 'true' +} + +const isSigningField = (t, notSigningField) => { + if (notSigningField == 'notSigning') return 'false' + if ( + t == 'LEDGERENTRY' || + t == 'TRANSACTION' || + t == 'VALIDATION' || + t == 'METADATA' + ) + return 'false' + return 'true' +} + +// Parse SField.cpp for all the SFields and their serialization info +hits = [ + ...sfield_macro.matchAll( + /^ *[A-Z]*TYPED_SFIELD *\( *sf([^,\n]*),[ \n]*([^, \n]+)[ \n]*,[ \n]*([0-9]+)(,.*?(notSigning))?/gm, + ), +] +for (let x = 0; x < hits.length; ++x) { + console.log(' [') + console.log(' "' + hits[x][1] + '",') + console.log(' {') + console.log(' "nth": ' + hits[x][3] + ',') + console.log(' "isVLEncoded": ' + isVLEncoded(hits[x][2]) + ',') + console.log(' "isSerialized": ' + isSerialized(hits[x][2]) + ',') + console.log( + ' "isSigningField": ' + isSigningField(hits[x][2], hits[x][5]) + ',', + ) + console.log(' "type": "' + translate(hits[x][2]) + '"') + console.log(' }') + console.log(' ]' + (x < hits.length - 1 ? ',' : '')) +} + +console.log(' ],') + +//////////////////////////////////////////////////////////////////////// +// TER code processing +//////////////////////////////////////////////////////////////////////// +console.log(' "TRANSACTION_RESULTS": {') +const cleaned_ter_h = ('' + ter_h).replace('[[maybe_unused]]', '') + +hits = [ + ...cleaned_ter_h.matchAll( + /^ *((tel|tem|tef|ter|tes|tec)[A-Z_]+)( *= *([0-9-]+))? *,? *(\/\/[^\n]*)?$/gm, + ), +] +let upto = -1 +let last = '' +for (let x = 0; x < hits.length; ++x) { + if (hits[x][4] !== undefined) upto = hits[x][4] + + let current = hits[x][2] + if (current != last && last != '') console.log('') + last = current + + console.log( + ' "' + hits[x][1] + '": ' + upto + (x < hits.length - 1 ? ',' : ''), + ) + + upto++ +} + +console.log(' },') + +//////////////////////////////////////////////////////////////////////// +// Transaction type processing +//////////////////////////////////////////////////////////////////////// +console.log(' "TRANSACTION_TYPES": {') +console.log(' "Invalid": -1,') + +hits = [ + ...txformats_macro.matchAll( + /^ *TRANSACTION\(tt[A-Z_]+ *,* ([0-9]+) *, *([A-Za-z]+).*$/gm, + ), +] +// console.log(hits) +for (let x = 0; x < hits.length; ++x) { + console.log( + ' "' + + hits[x][2] + + '": ' + + hits[x][1] + + (x < hits.length - 1 ? ',' : ''), + ) +} + +console.log(' }') +console.log('}') From e9c94412daf2a235f53bb078134384b3a0dd84ac Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 14 Nov 2024 11:38:06 -0500 Subject: [PATCH 02/12] fix spacing --- .../src/enums/definitions.json | 159 +++++++++--------- .../tools/generateDefinitions.js | 158 ++++++++--------- 2 files changed, 159 insertions(+), 158 deletions(-) diff --git a/packages/ripple-binary-codec/src/enums/definitions.json b/packages/ripple-binary-codec/src/enums/definitions.json index aa517a3ed2..911ff3664c 100644 --- a/packages/ripple-binary-codec/src/enums/definitions.json +++ b/packages/ripple-binary-codec/src/enums/definitions.json @@ -58,85 +58,85 @@ }, "FIELDS": [ [ - "Generic", - { - "nth": 0, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Unknown" - } - ], - [ - "Invalid", - { - "nth": -1, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Unknown" - } - ], - [ - "ObjectEndMarker", - { - "nth": 1, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "STObject" - } - ], - [ - "ArrayEndMarker", - { - "nth": 1, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "STArray" - } - ], - [ - "hash", - { - "nth": 257, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Hash256" - } - ], - [ - "index", - { - "nth": 258, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Hash256" - } - ], - [ - "taker_gets_funded", - { - "nth": 258, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Amount" - } - ], - [ - "taker_pays_funded", - { - "nth": 259, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Amount" - } - ], + "Generic", + { + "nth": 0, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Unknown" + } + ], + [ + "Invalid", + { + "nth": -1, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Unknown" + } + ], + [ + "ObjectEndMarker", + { + "nth": 1, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "STObject" + } + ], + [ + "ArrayEndMarker", + { + "nth": 1, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "STArray" + } + ], + [ + "hash", + { + "nth": 257, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Hash256" + } + ], + [ + "index", + { + "nth": 258, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Hash256" + } + ], + [ + "taker_gets_funded", + { + "nth": 258, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Amount" + } + ], + [ + "taker_pays_funded", + { + "nth": 259, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Amount" + } + ], [ "LedgerEntry", { @@ -2805,6 +2805,7 @@ "temEMPTY_DID": -254, "temARRAY_EMPTY": -253, "temARRAY_TOO_LARGE": -252, + "temBAD_TRANSFER_FEE": -251, "tefFAILURE": -199, "tefALREADY": -198, diff --git a/packages/ripple-binary-codec/tools/generateDefinitions.js b/packages/ripple-binary-codec/tools/generateDefinitions.js index e39a5e402a..9e43480371 100644 --- a/packages/ripple-binary-codec/tools/generateDefinitions.js +++ b/packages/ripple-binary-codec/tools/generateDefinitions.js @@ -129,85 +129,85 @@ console.log(' },') console.log(' "FIELDS": [') // The ones that are harder to parse directly from SField.cpp console.log(` [ - "Generic", - { - "nth": 0, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Unknown" - } - ], - [ - "Invalid", - { - "nth": -1, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Unknown" - } - ], - [ - "ObjectEndMarker", - { - "nth": 1, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "STObject" - } - ], - [ - "ArrayEndMarker", - { - "nth": 1, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "STArray" - } - ], - [ - "hash", - { - "nth": 257, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Hash256" - } - ], - [ - "index", - { - "nth": 258, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Hash256" - } - ], - [ - "taker_gets_funded", - { - "nth": 258, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Amount" - } - ], - [ - "taker_pays_funded", - { - "nth": 259, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Amount" - } - ],`) + "Generic", + { + "nth": 0, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Unknown" + } + ], + [ + "Invalid", + { + "nth": -1, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Unknown" + } + ], + [ + "ObjectEndMarker", + { + "nth": 1, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "STObject" + } + ], + [ + "ArrayEndMarker", + { + "nth": 1, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "STArray" + } + ], + [ + "hash", + { + "nth": 257, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Hash256" + } + ], + [ + "index", + { + "nth": 258, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Hash256" + } + ], + [ + "taker_gets_funded", + { + "nth": 258, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Amount" + } + ], + [ + "taker_pays_funded", + { + "nth": 259, + "isVLEncoded": false, + "isSerialized": false, + "isSigningField": false, + "type": "Amount" + } + ],`) const isVLEncoded = (t) => { if (t == 'VL' || t == 'ACCOUNT' || t == 'VECTOR256') return 'true' From c7b72a2cecff508c7d034c374115d223b1092c95 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 14 Nov 2024 11:38:34 -0500 Subject: [PATCH 03/12] remove new field --- packages/ripple-binary-codec/src/enums/definitions.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/ripple-binary-codec/src/enums/definitions.json b/packages/ripple-binary-codec/src/enums/definitions.json index 911ff3664c..6eb3305f38 100644 --- a/packages/ripple-binary-codec/src/enums/definitions.json +++ b/packages/ripple-binary-codec/src/enums/definitions.json @@ -2805,7 +2805,6 @@ "temEMPTY_DID": -254, "temARRAY_EMPTY": -253, "temARRAY_TOO_LARGE": -252, - "temBAD_TRANSFER_FEE": -251, "tefFAILURE": -199, "tefALREADY": -198, From b0ea5fb6d425ef10a5ae12ce8744be364d4e3f69 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 14 Nov 2024 13:28:51 -0500 Subject: [PATCH 04/12] clean up --- .../tools/generateDefinitions.js | 126 +++++++++++------- 1 file changed, 75 insertions(+), 51 deletions(-) diff --git a/packages/ripple-binary-codec/tools/generateDefinitions.js b/packages/ripple-binary-codec/tools/generateDefinitions.js index 9e43480371..5013119fc2 100644 --- a/packages/ripple-binary-codec/tools/generateDefinitions.js +++ b/packages/ripple-binary-codec/tools/generateDefinitions.js @@ -8,26 +8,41 @@ if (process.argv.length != 3) { //////////////////////////////////////////////////////////////////////// // Get all necessary files from rippled //////////////////////////////////////////////////////////////////////// -const sfield_h_fn = process.argv[2] + '/include/xrpl/protocol/SField.h' -const sfield_macro_fn = - process.argv[2] + '/include/xrpl/protocol/detail/sfields.macro' -const ledgerformats_macro_fn = - process.argv[2] + '/include/xrpl/protocol/detail/ledger_entries.macro' -const ter_h_fn = process.argv[2] + '/include/xrpl/protocol/TER.h' -const txformats_macro_fn = - process.argv[2] + '/include/xrpl/protocol/detail/transactions.macro' +const path = require('path') const fs = require('fs') +function readFile(filename) { + try { + return fs.readFileSync(filename).toString('utf-8') + } catch (err) { + console.error(`Error reading file ${filename}:`, err.message) + process.exit(1) + } +} -const sfield_h = fs.readFileSync(sfield_h_fn).toString('utf-8') -const sfield_macro = fs.readFileSync(sfield_macro_fn).toString('utf-8') -const ledgerformats_macro = fs - .readFileSync(ledgerformats_macro_fn) - .toString('utf-8') -const ter_h = fs.readFileSync(ter_h_fn).toString('utf-8') -const txformats_macro = fs.readFileSync(txformats_macro_fn).toString('utf-8') +const sfieldHeaderFile = readFile( + path.join(process.argv[2], '/include/xrpl/protocol/SField.h'), +) +const sfieldMacroFile = readFile( + path.join(process.argv[2], '/include/xrpl/protocol/detail/sfields.macro'), +) +const ledgerFormatsMacroFile = readFile( + path.join( + process.argv[2], + '/include/xrpl/protocol/detail/ledger_entries.macro', + ), +) +const terFile = readFile( + path.join(process.argv[2], '/include/xrpl/protocol/TER.h'), +) +const transactionsMacro = readFile( + path.join( + process.argv[2], + '/include/xrpl/protocol/detail/transactions.macro', + ), +) -const capitalization_exceptions = { +const capitalizationExceptions = { NFTOKEN: 'NFToken', URITOKEN: 'URIToken', URI: 'URI', @@ -59,8 +74,8 @@ function translate(inp) { const parts = inp.split('_') let result = '' for (x in parts) - if (capitalization_exceptions[parts[x]] != null) { - result += capitalization_exceptions[parts[x]] + if (capitalizationExceptions[parts[x]] != null) { + result += capitalizationExceptions[parts[x]] } else result += parts[x].substr(0, 1).toUpperCase() + parts[x].substr(1).toLowerCase() @@ -77,18 +92,22 @@ console.log('{') console.log(' "TYPES": {') console.log(' "Done": -1,') -let hits = [ - ...sfield_h.matchAll(/^ *STYPE\(STI_([^ ]*?) *, *([0-9-]+) *\) *\\?$/gm), +let stypeHits = [ + ...sfieldHeaderFile.matchAll( + /^ *STYPE\(STI_([^ ]*?) *, *([0-9-]+) *\) *\\?$/gm, + ), ] -if (hits.length === 0) - hits = [...sfield_h.matchAll(/^ *STI_([^ ]*?) *= *([0-9-]+) *,?$/gm)] -for (let x = 0; x < hits.length; ++x) { +if (stypeHits.length === 0) + stypeHits = [ + ...sfieldHeaderFile.matchAll(/^ *STI_([^ ]*?) *= *([0-9-]+) *,?$/gm), + ] +for (let x = 0; x < stypeHits.length; ++x) { console.log( ' "' + - translate(hits[x][1]) + + translate(stypeHits[x][1]) + '": ' + - hits[x][2] + - (x < hits.length - 1 ? ',' : ''), + stypeHits[x][2] + + (x < stypeHits.length - 1 ? ',' : ''), ) } @@ -109,7 +128,7 @@ const unhex = (x) => { return x } hits = [ - ...ledgerformats_macro.matchAll( + ...ledgerFormatsMacroFile.matchAll( /^ *LEDGER_ENTRY\(lt[A-Z_]+ *, *([x0-9a-f]+) *, *([^,]+), \({$/gm, ), ] @@ -238,24 +257,26 @@ const isSigningField = (t, notSigningField) => { } // Parse SField.cpp for all the SFields and their serialization info -hits = [ - ...sfield_macro.matchAll( +let sfieldHits = [ + ...sfieldMacroFile.matchAll( /^ *[A-Z]*TYPED_SFIELD *\( *sf([^,\n]*),[ \n]*([^, \n]+)[ \n]*,[ \n]*([0-9]+)(,.*?(notSigning))?/gm, ), ] -for (let x = 0; x < hits.length; ++x) { +for (let x = 0; x < sfieldHits.length; ++x) { console.log(' [') - console.log(' "' + hits[x][1] + '",') + console.log(' "' + sfieldHits[x][1] + '",') console.log(' {') - console.log(' "nth": ' + hits[x][3] + ',') - console.log(' "isVLEncoded": ' + isVLEncoded(hits[x][2]) + ',') - console.log(' "isSerialized": ' + isSerialized(hits[x][2]) + ',') + console.log(' "nth": ' + sfieldHits[x][3] + ',') + console.log(' "isVLEncoded": ' + isVLEncoded(sfieldHits[x][2]) + ',') + console.log(' "isSerialized": ' + isSerialized(sfieldHits[x][2]) + ',') console.log( - ' "isSigningField": ' + isSigningField(hits[x][2], hits[x][5]) + ',', + ' "isSigningField": ' + + isSigningField(sfieldHits[x][2], sfieldHits[x][5]) + + ',', ) - console.log(' "type": "' + translate(hits[x][2]) + '"') + console.log(' "type": "' + translate(sfieldHits[x][2]) + '"') console.log(' }') - console.log(' ]' + (x < hits.length - 1 ? ',' : '')) + console.log(' ]' + (x < sfieldHits.length - 1 ? ',' : '')) } console.log(' ],') @@ -264,24 +285,28 @@ console.log(' ],') // TER code processing //////////////////////////////////////////////////////////////////////// console.log(' "TRANSACTION_RESULTS": {') -const cleaned_ter_h = ('' + ter_h).replace('[[maybe_unused]]', '') +const cleanedTerFile = ('' + terFile).replace('[[maybe_unused]]', '') -hits = [ - ...cleaned_ter_h.matchAll( +let terHits = [ + ...cleanedTerFile.matchAll( /^ *((tel|tem|tef|ter|tes|tec)[A-Z_]+)( *= *([0-9-]+))? *,? *(\/\/[^\n]*)?$/gm, ), ] let upto = -1 let last = '' -for (let x = 0; x < hits.length; ++x) { - if (hits[x][4] !== undefined) upto = hits[x][4] +for (let x = 0; x < terHits.length; ++x) { + if (terHits[x][4] !== undefined) upto = terHits[x][4] - let current = hits[x][2] + let current = terHits[x][2] if (current != last && last != '') console.log('') last = current console.log( - ' "' + hits[x][1] + '": ' + upto + (x < hits.length - 1 ? ',' : ''), + ' "' + + terHits[x][1] + + '": ' + + upto + + (x < terHits.length - 1 ? ',' : ''), ) upto++ @@ -295,19 +320,18 @@ console.log(' },') console.log(' "TRANSACTION_TYPES": {') console.log(' "Invalid": -1,') -hits = [ - ...txformats_macro.matchAll( +let txHits = [ + ...transactionsMacro.matchAll( /^ *TRANSACTION\(tt[A-Z_]+ *,* ([0-9]+) *, *([A-Za-z]+).*$/gm, ), ] -// console.log(hits) -for (let x = 0; x < hits.length; ++x) { +for (let x = 0; x < txHits.length; ++x) { console.log( ' "' + - hits[x][2] + + txHits[x][2] + '": ' + - hits[x][1] + - (x < hits.length - 1 ? ',' : ''), + txHits[x][1] + + (x < txHits.length - 1 ? ',' : ''), ) } From 3e1756d2d9c7b9e3aff50a6838bd55ea8398b15a Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 14 Nov 2024 13:43:34 -0500 Subject: [PATCH 05/12] pipe to file --- .../tools/generateDefinitions.js | 95 +++++++++++-------- 1 file changed, 58 insertions(+), 37 deletions(-) diff --git a/packages/ripple-binary-codec/tools/generateDefinitions.js b/packages/ripple-binary-codec/tools/generateDefinitions.js index 5013119fc2..9bd3b39bc4 100644 --- a/packages/ripple-binary-codec/tools/generateDefinitions.js +++ b/packages/ripple-binary-codec/tools/generateDefinitions.js @@ -1,6 +1,10 @@ -if (process.argv.length != 3) { - console.log( - 'Usage: ' + process.argv[0] + ' ' + process.argv[1] + ' path/to/rippled', +if (process.argv.length != 3 && process.argv.length != 4) { + console.error( + 'Usage: ' + + process.argv[0] + + ' ' + + process.argv[1] + + ' path/to/rippled [path/to/pipe/to]', ) process.exit(1) } @@ -81,16 +85,21 @@ function translate(inp) { parts[x].substr(0, 1).toUpperCase() + parts[x].substr(1).toLowerCase() return result } catch (e) { - console.log(e, 'inp="' + inp + '"') + console.error(e, 'inp="' + inp + '"') } } +let output = '' +function addLine(line) { + output += line + '\n' +} + //////////////////////////////////////////////////////////////////////// // Serialized type processing //////////////////////////////////////////////////////////////////////// -console.log('{') -console.log(' "TYPES": {') -console.log(' "Done": -1,') +addLine('{') +addLine(' "TYPES": {') +addLine(' "Done": -1,') let stypeHits = [ ...sfieldHeaderFile.matchAll( @@ -102,7 +111,7 @@ if (stypeHits.length === 0) ...sfieldHeaderFile.matchAll(/^ *STI_([^ ]*?) *= *([0-9-]+) *,?$/gm), ] for (let x = 0; x < stypeHits.length; ++x) { - console.log( + addLine( ' "' + translate(stypeHits[x][1]) + '": ' + @@ -111,15 +120,15 @@ for (let x = 0; x < stypeHits.length; ++x) { ) } -console.log(' },') +addLine(' },') //////////////////////////////////////////////////////////////////////// // Ledger entry type processing //////////////////////////////////////////////////////////////////////// -console.log(' "LEDGER_ENTRY_TYPES": {') -console.log(' "Any": -3,') -console.log(' "Child": -2,') -console.log(' "Invalid": -1,') +addLine(' "LEDGER_ENTRY_TYPES": {') +addLine(' "Any": -3,') +addLine(' "Child": -2,') +addLine(' "Invalid": -1,') const unhex = (x) => { x = ('' + x).trim() @@ -133,21 +142,21 @@ hits = [ ), ] for (let x = 0; x < hits.length; ++x) - console.log( + addLine( ' "' + hits[x][2] + '": ' + unhex(hits[x][1]) + (x < hits.length - 1 ? ',' : ''), ) -console.log(' },') +addLine(' },') //////////////////////////////////////////////////////////////////////// // SField processing //////////////////////////////////////////////////////////////////////// -console.log(' "FIELDS": [') +addLine(' "FIELDS": [') // The ones that are harder to parse directly from SField.cpp -console.log(` [ +addLine(` [ "Generic", { "nth": 0, @@ -263,28 +272,28 @@ let sfieldHits = [ ), ] for (let x = 0; x < sfieldHits.length; ++x) { - console.log(' [') - console.log(' "' + sfieldHits[x][1] + '",') - console.log(' {') - console.log(' "nth": ' + sfieldHits[x][3] + ',') - console.log(' "isVLEncoded": ' + isVLEncoded(sfieldHits[x][2]) + ',') - console.log(' "isSerialized": ' + isSerialized(sfieldHits[x][2]) + ',') - console.log( + addLine(' [') + addLine(' "' + sfieldHits[x][1] + '",') + addLine(' {') + addLine(' "nth": ' + sfieldHits[x][3] + ',') + addLine(' "isVLEncoded": ' + isVLEncoded(sfieldHits[x][2]) + ',') + addLine(' "isSerialized": ' + isSerialized(sfieldHits[x][2]) + ',') + addLine( ' "isSigningField": ' + isSigningField(sfieldHits[x][2], sfieldHits[x][5]) + ',', ) - console.log(' "type": "' + translate(sfieldHits[x][2]) + '"') - console.log(' }') - console.log(' ]' + (x < sfieldHits.length - 1 ? ',' : '')) + addLine(' "type": "' + translate(sfieldHits[x][2]) + '"') + addLine(' }') + addLine(' ]' + (x < sfieldHits.length - 1 ? ',' : '')) } -console.log(' ],') +addLine(' ],') //////////////////////////////////////////////////////////////////////// // TER code processing //////////////////////////////////////////////////////////////////////// -console.log(' "TRANSACTION_RESULTS": {') +addLine(' "TRANSACTION_RESULTS": {') const cleanedTerFile = ('' + terFile).replace('[[maybe_unused]]', '') let terHits = [ @@ -298,10 +307,10 @@ for (let x = 0; x < terHits.length; ++x) { if (terHits[x][4] !== undefined) upto = terHits[x][4] let current = terHits[x][2] - if (current != last && last != '') console.log('') + if (current != last && last != '') addLine('') last = current - console.log( + addLine( ' "' + terHits[x][1] + '": ' + @@ -312,13 +321,13 @@ for (let x = 0; x < terHits.length; ++x) { upto++ } -console.log(' },') +addLine(' },') //////////////////////////////////////////////////////////////////////// // Transaction type processing //////////////////////////////////////////////////////////////////////// -console.log(' "TRANSACTION_TYPES": {') -console.log(' "Invalid": -1,') +addLine(' "TRANSACTION_TYPES": {') +addLine(' "Invalid": -1,') let txHits = [ ...transactionsMacro.matchAll( @@ -326,7 +335,7 @@ let txHits = [ ), ] for (let x = 0; x < txHits.length; ++x) { - console.log( + addLine( ' "' + txHits[x][2] + '": ' + @@ -335,5 +344,17 @@ for (let x = 0; x < txHits.length; ++x) { ) } -console.log(' }') -console.log('}') +addLine(' }') +addLine('}') + +const outputFile = + process.argv.length == 4 + ? process.argv[3] + : path.join(__dirname, '../src/enums/definitions.json') +fs.writeFile(outputFile, output, 'utf8', (err) => { + if (err) { + console.error('Error writing to file:', err) + } else { + console.log('File written successfully to', outputFile) + } +}) From 5d7c1a54c12d30c0d0b53bd7763d513fd3353220 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Fri, 15 Nov 2024 11:59:15 -0500 Subject: [PATCH 06/12] add package.json script --- packages/ripple-binary-codec/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/ripple-binary-codec/package.json b/packages/ripple-binary-codec/package.json index 41aca52356..7a8259dd98 100644 --- a/packages/ripple-binary-codec/package.json +++ b/packages/ripple-binary-codec/package.json @@ -21,7 +21,8 @@ "prepublishOnly": "npm test", "test": "npm run build && jest --verbose false --silent=false ./test/*.test.ts", "test:browser": "npm run build && karma start ./karma.config.js", - "lint": "eslint . --ext .ts --ext .test.js" + "lint": "eslint . --ext .ts --ext .test.js", + "generateDefinitions": "node ./tools/generateDefinitions.js" }, "keywords": [ "ripple", From 6267de4bc76209ce710e6313a4b1c0fa1aaf92a5 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Mon, 18 Nov 2024 17:30:30 -0500 Subject: [PATCH 07/12] fix generateModels script --- .../tools/generateDefinitions.js | 4 +-- packages/xrpl/tools/generateModels.js | 28 ++++++++----------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/packages/ripple-binary-codec/tools/generateDefinitions.js b/packages/ripple-binary-codec/tools/generateDefinitions.js index 9bd3b39bc4..6fca037d68 100644 --- a/packages/ripple-binary-codec/tools/generateDefinitions.js +++ b/packages/ripple-binary-codec/tools/generateDefinitions.js @@ -39,7 +39,7 @@ const ledgerFormatsMacroFile = readFile( const terFile = readFile( path.join(process.argv[2], '/include/xrpl/protocol/TER.h'), ) -const transactionsMacro = readFile( +const transactionsMacroFile = readFile( path.join( process.argv[2], '/include/xrpl/protocol/detail/transactions.macro', @@ -330,7 +330,7 @@ addLine(' "TRANSACTION_TYPES": {') addLine(' "Invalid": -1,') let txHits = [ - ...transactionsMacro.matchAll( + ...transactionsMacroFile.matchAll( /^ *TRANSACTION\(tt[A-Z_]+ *,* ([0-9]+) *, *([A-Za-z]+).*$/gm, ), ] diff --git a/packages/xrpl/tools/generateModels.js b/packages/xrpl/tools/generateModels.js index dca58317dd..3bf12d7fdb 100644 --- a/packages/xrpl/tools/generateModels.js +++ b/packages/xrpl/tools/generateModels.js @@ -14,32 +14,26 @@ function readFile(filename) { let jsTransactionFile function processRippledSource(folder) { - const sfieldCpp = readFile( - path.join(folder, 'src/libxrpl/protocol/SField.cpp'), + const sfieldMacroFile = readFile( + path.join(process.argv[2], '/include/xrpl/protocol/detail/sfields.macro'), ) - const sfieldHits = sfieldCpp.match( - /^ *CONSTRUCT_[^\_]+_SFIELD *\( *[^,\n]*,[ \n]*"([^\"\n ]+)"[ \n]*,[ \n]*([^, \n]+)[ \n]*,[ \n]*([0-9]+)(,.*?(notSigning))?/gm, + const sfieldHits = sfieldMacroFile.matchAll( + /^ *[A-Z]*TYPED_SFIELD *\( *sf([^,\n]*),[ \n]*([^, \n]+)[ \n]*,[ \n]*([0-9]+)(,.*?(notSigning))?/gm, ) const sfields = {} for (const hit of sfieldHits) { - const matches = hit.match( - /^ *CONSTRUCT_[^\_]+_SFIELD *\( *[^,\n]*,[ \n]*"([^\"\n ]+)"[ \n]*,[ \n]*([^, \n]+)[ \n]*,[ \n]*([0-9]+)(,.*?(notSigning))?/, - ) - sfields[matches[1]] = matches.slice(2) + sfields[hit[1]] = hit[2] } - const txFormatsCpp = readFile( - path.join(folder, 'src/libxrpl/protocol/TxFormats.cpp'), + const transactionsMacroFile = readFile( + path.join(folder, '/include/xrpl/protocol/detail/transactions.macro'), ) - const txFormatsHits = txFormatsCpp.match( - /^ *add\(jss::([^\"\n, ]+),[ \n]*tt[A-Z_]+,[ \n]*{[ \n]*(({sf[A-Za-z0-9]+, soe(OPTIONAL|REQUIRED|DEFAULT)},[ \n]+)*)},[ \n]*[pseudocC]+ommonFields\);/gm, + const txFormatsHits = transactionsMacroFile.matchAll( + /^ *TRANSACTION\(tt[A-Z_]+ *,* [0-9]+ *, *([A-Za-z]+)[ \n]*,[ \n]*\({[ \n]*(({sf[A-Za-z0-9]+, soe(OPTIONAL|REQUIRED|DEFAULT)(, soeMPT(None|Supported|NotSupported))?},[ \n]+)*)}\)\)$/gm, ) const txFormats = {} for (const hit of txFormatsHits) { - const matches = hit.match( - /^ *add\(jss::([^\"\n, ]+),[ \n]*tt[A-Z_]+,[ \n]*{[ \n]*(({sf[A-Za-z0-9]+, soe(OPTIONAL|REQUIRED|DEFAULT)},[ \n]+)*)},[ \n]*[pseudocC]+ommonFields\);/, - ) - txFormats[matches[1]] = formatTxFormat(matches[2]) + txFormats[hit[1]] = formatTxFormat(hit[2]) } jsTransactionFile = readFile( @@ -168,7 +162,7 @@ export { ${tx} } from './${tx}'`, function generateParamLine(sfields, param, isRequired) { const paramName = param.slice(2) - const paramType = sfields[paramName][0] + const paramType = sfields[paramName] const paramTypeOutput = typeMap[paramType] return ` ${paramName}${isRequired ? '' : '?'}: ${paramTypeOutput}\n` } From 85f0f646ca518f2e5dd1a0a65522719743739775 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Mon, 18 Nov 2024 18:29:09 -0500 Subject: [PATCH 08/12] clean up --- packages/xrpl/tools/generateModels.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/xrpl/tools/generateModels.js b/packages/xrpl/tools/generateModels.js index 3bf12d7fdb..550f40b48e 100644 --- a/packages/xrpl/tools/generateModels.js +++ b/packages/xrpl/tools/generateModels.js @@ -15,7 +15,7 @@ let jsTransactionFile function processRippledSource(folder) { const sfieldMacroFile = readFile( - path.join(process.argv[2], '/include/xrpl/protocol/detail/sfields.macro'), + path.join(folder, '/include/xrpl/protocol/detail/sfields.macro'), ) const sfieldHits = sfieldMacroFile.matchAll( /^ *[A-Z]*TYPED_SFIELD *\( *sf([^,\n]*),[ \n]*([^, \n]+)[ \n]*,[ \n]*([0-9]+)(,.*?(notSigning))?/gm, @@ -162,7 +162,7 @@ export { ${tx} } from './${tx}'`, function generateParamLine(sfields, param, isRequired) { const paramName = param.slice(2) - const paramType = sfields[paramName] + const paramType = sfields[paramName] ?? 'any' const paramTypeOutput = typeMap[paramType] return ` ${paramName}${isRequired ? '' : '?'}: ${paramTypeOutput}\n` } From 7ec1ff5506ca196e93e7817262659f4260ba8561 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Fri, 20 Dec 2024 15:01:41 -0800 Subject: [PATCH 09/12] fix Hash192 --- packages/ripple-binary-codec/src/enums/definitions.json | 4 ++-- packages/ripple-binary-codec/tools/generateDefinitions.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ripple-binary-codec/src/enums/definitions.json b/packages/ripple-binary-codec/src/enums/definitions.json index 512091d657..8855a8b01a 100644 --- a/packages/ripple-binary-codec/src/enums/definitions.json +++ b/packages/ripple-binary-codec/src/enums/definitions.json @@ -19,7 +19,7 @@ "PathSet": 18, "Vector256": 19, "UInt96": 20, - "UInt192": 21, + "Hash192": 21, "UInt384": 22, "UInt512": 23, "Issue": 24, @@ -1198,7 +1198,7 @@ "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt192" + "type": "Hash192" } ], [ diff --git a/packages/ripple-binary-codec/tools/generateDefinitions.js b/packages/ripple-binary-codec/tools/generateDefinitions.js index 6fca037d68..88dc720abd 100644 --- a/packages/ripple-binary-codec/tools/generateDefinitions.js +++ b/packages/ripple-binary-codec/tools/generateDefinitions.js @@ -61,7 +61,7 @@ const capitalizationExceptions = { function translate(inp) { try { if (inp.match(/^UINT/m)) - if (inp.match(/256/m) || inp.match(/160/m) || inp.match(/128/m)) + if (inp.match(/256/m) || inp.match(/160/m) || inp.match(/128/m) || inp.match(/192/m)) return inp.replace('UINT', 'Hash') else return inp.replace('UINT', 'UInt') if (inp == 'OBJECT' || inp == 'ARRAY') From aca417c6f57468b0ced863f3b6f3c573e7cf79ca Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Wed, 5 Feb 2025 21:17:39 -0800 Subject: [PATCH 10/12] switch script to use server_definitions order --- .../src/enums/definitions.json | 2452 +++++++++-------- .../tools/generateDefinitions.js | 209 +- 2 files changed, 1353 insertions(+), 1308 deletions(-) diff --git a/packages/ripple-binary-codec/src/enums/definitions.json b/packages/ripple-binary-codec/src/enums/definitions.json index 8855a8b01a..bc86c2c194 100644 --- a/packages/ripple-binary-codec/src/enums/definitions.json +++ b/packages/ripple-binary-codec/src/enums/definitions.json @@ -1,3161 +1,3183 @@ { - "TYPES": { - "Done": -1, - "Unknown": -2, - "NotPresent": 0, - "UInt16": 1, - "UInt32": 2, - "UInt64": 3, - "Hash128": 4, - "Hash256": 5, - "Amount": 6, - "Blob": 7, - "AccountID": 8, - "Number": 9, - "STObject": 14, - "STArray": 15, - "UInt8": 16, - "Hash160": 17, - "PathSet": 18, - "Vector256": 19, - "UInt96": 20, - "Hash192": 21, - "UInt384": 22, - "UInt512": 23, - "Issue": 24, - "XChainBridge": 25, - "Currency": 26, - "Transaction": 10001, - "LedgerEntry": 10002, - "Validation": 10003, - "Metadata": 10004 - }, - "LEDGER_ENTRY_TYPES": { - "Any": -3, - "Child": -2, - "Invalid": -1, - "NFTokenOffer": 55, - "Check": 67, - "DID": 73, - "NegativeUNL": 78, - "NFTokenPage": 80, - "SignerList": 83, - "Ticket": 84, - "AccountRoot": 97, - "DirectoryNode": 100, - "Amendments": 102, - "LedgerHashes": 104, - "Bridge": 105, - "Offer": 111, - "DepositPreauth": 112, - "XChainOwnedClaimID": 113, - "RippleState": 114, - "FeeSettings": 115, - "XChainOwnedCreateAccountClaimID": 116, - "Escrow": 117, - "PayChannel": 120, - "AMM": 121, - "Oracle": 128, - "MPTokenIssuance": 126, - "MPToken": 127, - "Credential": 129 - }, "FIELDS": [ [ "Generic", { - "nth": 0, - "isVLEncoded": false, "isSerialized": false, "isSigningField": false, + "isVLEncoded": false, + "nth": 0, "type": "Unknown" } ], [ "Invalid", { - "nth": -1, - "isVLEncoded": false, "isSerialized": false, "isSigningField": false, + "isVLEncoded": false, + "nth": -1, "type": "Unknown" } ], [ "ObjectEndMarker", { - "nth": 1, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 1, "type": "STObject" } ], [ "ArrayEndMarker", { - "nth": 1, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 1, "type": "STArray" } ], [ - "hash", + "taker_gets_funded", { - "nth": 257, - "isVLEncoded": false, "isSerialized": false, "isSigningField": false, - "type": "Hash256" - } - ], - [ - "index", - { - "nth": 258, "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Hash256" - } - ], - [ - "taker_gets_funded", - { "nth": 258, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, "type": "Amount" } ], [ "taker_pays_funded", { - "nth": 259, - "isVLEncoded": false, "isSerialized": false, "isSigningField": false, + "isVLEncoded": false, + "nth": 259, "type": "Amount" } ], [ - "LedgerEntry", + "LedgerEntryType", { - "nth": 257, + "isSerialized": true, + "isSigningField": true, "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "LedgerEntry" + "nth": 1, + "type": "UInt16" } ], [ - "Transaction", + "TransactionType", { - "nth": 257, + "isSerialized": true, + "isSigningField": true, "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Transaction" + "nth": 2, + "type": "UInt16" } ], [ - "Validation", + "SignerWeight", { - "nth": 257, + "isSerialized": true, + "isSigningField": true, "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Validation" + "nth": 3, + "type": "UInt16" } ], [ - "Metadata", + "TransferFee", { - "nth": 257, + "isSerialized": true, + "isSigningField": true, "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Metadata" + "nth": 4, + "type": "UInt16" } ], [ - "CloseResolution", + "TradingFee", { - "nth": 1, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt8" + "isVLEncoded": false, + "nth": 5, + "type": "UInt16" } ], [ - "Method", + "DiscountedFee", { - "nth": 2, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt8" + "isVLEncoded": false, + "nth": 6, + "type": "UInt16" } ], [ - "TransactionResult", + "Version", { - "nth": 3, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt8" + "isVLEncoded": false, + "nth": 16, + "type": "UInt16" } ], [ - "Scale", + "HookStateChangeCount", { - "nth": 4, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt8" + "isVLEncoded": false, + "nth": 17, + "type": "UInt16" } ], [ - "AssetScale", + "HookEmitCount", { - "nth": 5, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt8" + "isVLEncoded": false, + "nth": 18, + "type": "UInt16" } ], [ - "TickSize", + "HookExecutionIndex", { - "nth": 16, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt8" + "isVLEncoded": false, + "nth": 19, + "type": "UInt16" } ], [ - "UNLModifyDisabling", + "HookApiVersion", { - "nth": 17, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt8" + "isVLEncoded": false, + "nth": 20, + "type": "UInt16" } ], [ - "HookResult", + "LedgerFixType", { - "nth": 18, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt8" + "isVLEncoded": false, + "nth": 21, + "type": "UInt16" } ], [ - "WasLockingChainSend", + "NetworkID", { - "nth": 19, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt8" + "isVLEncoded": false, + "nth": 1, + "type": "UInt32" } ], [ - "LedgerEntryType", + "Flags", { - "nth": 1, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt16" + "isVLEncoded": false, + "nth": 2, + "type": "UInt32" } ], [ - "TransactionType", + "SourceTag", { - "nth": 2, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt16" + "isVLEncoded": false, + "nth": 3, + "type": "UInt32" } ], [ - "SignerWeight", + "Sequence", { - "nth": 3, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt16" + "isVLEncoded": false, + "nth": 4, + "type": "UInt32" } ], [ - "TransferFee", + "PreviousTxnLgrSeq", { - "nth": 4, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt16" + "isVLEncoded": false, + "nth": 5, + "type": "UInt32" } ], [ - "TradingFee", + "LedgerSequence", { - "nth": 5, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt16" + "isVLEncoded": false, + "nth": 6, + "type": "UInt32" } ], [ - "DiscountedFee", + "CloseTime", { - "nth": 6, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt16" - } - ], - [ - "Version", - { - "nth": 16, "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt16" + "nth": 7, + "type": "UInt32" } ], [ - "HookStateChangeCount", + "ParentCloseTime", { - "nth": 17, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt16" + "isVLEncoded": false, + "nth": 8, + "type": "UInt32" } ], [ - "HookEmitCount", + "SigningTime", { - "nth": 18, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt16" + "isVLEncoded": false, + "nth": 9, + "type": "UInt32" } ], [ - "HookExecutionIndex", + "Expiration", { - "nth": 19, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt16" + "isVLEncoded": false, + "nth": 10, + "type": "UInt32" } ], [ - "HookApiVersion", + "TransferRate", { - "nth": 20, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt16" + "isVLEncoded": false, + "nth": 11, + "type": "UInt32" } ], [ - "LedgerFixType", + "WalletSize", { - "nth": 21, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt16" + "isVLEncoded": false, + "nth": 12, + "type": "UInt32" } ], [ - "NetworkID", + "OwnerCount", { - "nth": 1, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 13, "type": "UInt32" } ], [ - "Flags", + "DestinationTag", { - "nth": 2, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 14, "type": "UInt32" } ], [ - "SourceTag", + "LastUpdateTime", { - "nth": 3, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 15, "type": "UInt32" } ], [ - "Sequence", + "HighQualityIn", { - "nth": 4, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 16, "type": "UInt32" } ], [ - "PreviousTxnLgrSeq", + "HighQualityOut", { - "nth": 5, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 17, "type": "UInt32" } ], [ - "LedgerSequence", + "LowQualityIn", { - "nth": 6, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 18, "type": "UInt32" } ], [ - "CloseTime", + "LowQualityOut", { - "nth": 7, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 19, "type": "UInt32" } ], [ - "ParentCloseTime", + "QualityIn", { - "nth": 8, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 20, "type": "UInt32" } ], [ - "SigningTime", + "QualityOut", { - "nth": 9, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 21, "type": "UInt32" } ], [ - "Expiration", + "StampEscrow", { - "nth": 10, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 22, "type": "UInt32" } ], [ - "TransferRate", + "BondAmount", { - "nth": 11, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 23, "type": "UInt32" } ], [ - "WalletSize", + "LoadFee", { - "nth": 12, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 24, "type": "UInt32" } ], [ - "OwnerCount", + "OfferSequence", { - "nth": 13, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 25, "type": "UInt32" } ], [ - "DestinationTag", + "FirstLedgerSequence", { - "nth": 14, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 26, "type": "UInt32" } ], [ - "LastUpdateTime", + "LastLedgerSequence", { - "nth": 15, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 27, "type": "UInt32" } ], [ - "HighQualityIn", + "TransactionIndex", { - "nth": 16, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 28, "type": "UInt32" } ], [ - "HighQualityOut", + "OperationLimit", { - "nth": 17, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 29, "type": "UInt32" } ], [ - "LowQualityIn", + "ReferenceFeeUnits", { - "nth": 18, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 30, "type": "UInt32" } ], [ - "LowQualityOut", + "ReserveBase", { - "nth": 19, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 31, "type": "UInt32" } ], [ - "QualityIn", + "ReserveIncrement", { - "nth": 20, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 32, "type": "UInt32" } ], [ - "QualityOut", + "SetFlag", { - "nth": 21, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 33, "type": "UInt32" } ], [ - "StampEscrow", + "ClearFlag", { - "nth": 22, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 34, "type": "UInt32" } ], [ - "BondAmount", + "SignerQuorum", { - "nth": 23, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 35, "type": "UInt32" } ], [ - "LoadFee", + "CancelAfter", { - "nth": 24, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 36, "type": "UInt32" } ], [ - "OfferSequence", + "FinishAfter", { - "nth": 25, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 37, "type": "UInt32" } ], [ - "FirstLedgerSequence", + "SignerListID", { - "nth": 26, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 38, "type": "UInt32" } ], [ - "LastLedgerSequence", + "SettleDelay", { - "nth": 27, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 39, "type": "UInt32" } ], [ - "TransactionIndex", + "TicketCount", { - "nth": 28, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 40, "type": "UInt32" } ], [ - "OperationLimit", + "TicketSequence", { - "nth": 29, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 41, "type": "UInt32" } ], [ - "ReferenceFeeUnits", + "NFTokenTaxon", { - "nth": 30, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 42, "type": "UInt32" } ], [ - "ReserveBase", + "MintedNFTokens", { - "nth": 31, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 43, "type": "UInt32" } ], [ - "ReserveIncrement", + "BurnedNFTokens", { - "nth": 32, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 44, "type": "UInt32" } ], [ - "SetFlag", + "HookStateCount", { - "nth": 33, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 45, "type": "UInt32" } ], [ - "ClearFlag", + "EmitGeneration", { - "nth": 34, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 46, "type": "UInt32" } ], [ - "SignerQuorum", + "VoteWeight", { - "nth": 35, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt32" - } - ], - [ - "CancelAfter", - { - "nth": 36, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt32" - } - ], - [ - "FinishAfter", - { - "nth": 37, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt32" - } - ], - [ - "SignerListID", - { - "nth": 38, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt32" - } - ], - [ - "SettleDelay", - { - "nth": 39, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt32" - } - ], - [ - "TicketCount", - { - "nth": 40, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt32" - } - ], - [ - "TicketSequence", - { - "nth": 41, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt32" - } - ], - [ - "NFTokenTaxon", - { - "nth": 42, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt32" - } - ], - [ - "MintedNFTokens", - { - "nth": 43, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt32" - } - ], - [ - "BurnedNFTokens", - { - "nth": 44, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt32" - } - ], - [ - "HookStateCount", - { - "nth": 45, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" - } - ], - [ - "EmitGeneration", - { - "nth": 46, "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt32" - } - ], - [ - "VoteWeight", - { "nth": 48, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, "type": "UInt32" } ], [ "FirstNFTokenSequence", { - "nth": 50, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 50, "type": "UInt32" } ], [ "OracleDocumentID", { - "nth": 51, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 51, "type": "UInt32" } ], [ "IndexNext", { - "nth": 1, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 1, "type": "UInt64" } ], [ "IndexPrevious", { - "nth": 2, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 2, "type": "UInt64" } ], [ "BookNode", { - "nth": 3, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 3, "type": "UInt64" } ], [ "OwnerNode", { - "nth": 4, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 4, "type": "UInt64" } ], [ "BaseFee", { - "nth": 5, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 5, "type": "UInt64" } ], [ "ExchangeRate", { - "nth": 6, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 6, "type": "UInt64" } ], [ "LowNode", { - "nth": 7, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 7, "type": "UInt64" } ], [ "HighNode", { - "nth": 8, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 8, "type": "UInt64" } ], [ "DestinationNode", { - "nth": 9, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 9, "type": "UInt64" } ], [ "Cookie", { - "nth": 10, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 10, "type": "UInt64" } ], [ "ServerVersion", { - "nth": 11, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 11, "type": "UInt64" } ], [ "NFTokenOfferNode", { - "nth": 12, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 12, "type": "UInt64" } ], [ "EmitBurden", { - "nth": 13, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 13, "type": "UInt64" } ], [ "HookOn", { - "nth": 16, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 16, "type": "UInt64" } ], [ "HookInstructionCount", { - "nth": 17, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 17, "type": "UInt64" } ], [ "HookReturnCode", { - "nth": 18, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 18, "type": "UInt64" } ], [ "ReferenceCount", { - "nth": 19, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 19, "type": "UInt64" } ], [ "XChainClaimID", { - "nth": 20, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 20, "type": "UInt64" } ], [ "XChainAccountCreateCount", { - "nth": 21, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 21, "type": "UInt64" } ], [ "XChainAccountClaimCount", { - "nth": 22, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 22, "type": "UInt64" } ], [ "AssetPrice", { - "nth": 23, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 23, "type": "UInt64" } ], [ "MaximumAmount", { - "nth": 24, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 24, "type": "UInt64" } ], [ "OutstandingAmount", { - "nth": 25, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 25, "type": "UInt64" } ], [ "MPTAmount", { - "nth": 26, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 26, "type": "UInt64" } ], [ "IssuerNode", { - "nth": 27, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 27, "type": "UInt64" } ], [ "SubjectNode", { - "nth": 28, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 28, "type": "UInt64" } ], [ "EmailHash", { - "nth": 1, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 1, "type": "Hash128" } ], [ - "TakerPaysCurrency", + "LedgerHash", { - "nth": 1, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash160" + "isVLEncoded": false, + "nth": 1, + "type": "Hash256" } ], [ - "TakerPaysIssuer", + "ParentHash", { - "nth": 2, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash160" + "isVLEncoded": false, + "nth": 2, + "type": "Hash256" } ], [ - "TakerGetsCurrency", + "TransactionHash", { - "nth": 3, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash160" - } - ], - [ - "TakerGetsIssuer", - { - "nth": 4, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "Hash160" - } - ], - [ - "MPTokenIssuanceID", - { - "nth": 1, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "Hash192" - } - ], - [ - "LedgerHash", - { - "nth": 1, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "Hash256" - } - ], - [ - "ParentHash", - { - "nth": 2, "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "Hash256" - } - ], - [ - "TransactionHash", - { "nth": 3, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, "type": "Hash256" } ], [ "AccountHash", { - "nth": 4, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 4, "type": "Hash256" } ], [ "PreviousTxnID", { - "nth": 5, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 5, "type": "Hash256" } ], [ "LedgerIndex", { - "nth": 6, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 6, "type": "Hash256" } ], [ "WalletLocator", { - "nth": 7, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 7, "type": "Hash256" } ], [ "RootIndex", { - "nth": 8, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 8, "type": "Hash256" } ], [ "AccountTxnID", { - "nth": 9, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 9, "type": "Hash256" } ], [ "NFTokenID", { - "nth": 10, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 10, "type": "Hash256" } ], [ "EmitParentTxnID", { - "nth": 11, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 11, "type": "Hash256" } ], [ "EmitNonce", { - "nth": 12, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 12, "type": "Hash256" } ], [ "EmitHookHash", { - "nth": 13, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 13, "type": "Hash256" } ], [ "AMMID", { - "nth": 14, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 14, "type": "Hash256" } ], [ "BookDirectory", { - "nth": 16, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 16, "type": "Hash256" } ], [ "InvoiceID", { - "nth": 17, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 17, "type": "Hash256" } ], [ "Nickname", { - "nth": 18, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 18, "type": "Hash256" } ], [ "Amendment", { - "nth": 19, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 19, "type": "Hash256" } ], [ "Digest", { - "nth": 21, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 21, "type": "Hash256" } ], [ "Channel", { - "nth": 22, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 22, "type": "Hash256" } ], [ "ConsensusHash", { - "nth": 23, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 23, "type": "Hash256" } ], [ "CheckID", { - "nth": 24, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 24, "type": "Hash256" } ], [ "ValidatedHash", { - "nth": 25, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 25, "type": "Hash256" } ], [ "PreviousPageMin", { - "nth": 26, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 26, "type": "Hash256" } ], [ "NextPageMin", { - "nth": 27, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 27, "type": "Hash256" } ], [ "NFTokenBuyOffer", { - "nth": 28, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 28, "type": "Hash256" } ], [ "NFTokenSellOffer", { - "nth": 29, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 29, "type": "Hash256" } ], [ "HookStateKey", { - "nth": 30, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 30, "type": "Hash256" } ], [ "HookHash", { - "nth": 31, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 31, "type": "Hash256" } ], [ "HookNamespace", { - "nth": 32, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 32, "type": "Hash256" } ], [ "HookSetTxnID", { - "nth": 33, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 33, "type": "Hash256" } ], [ - "Number", + "DomainID", { - "nth": 1, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Number" + "isVLEncoded": false, + "nth": 34, + "type": "Hash256" } ], [ - "Amount", + "hash", { - "nth": 1, + "isSerialized": false, + "isSigningField": false, + "isVLEncoded": false, + "nth": 257, + "type": "Hash256" + } + ], + [ + "index", + { + "isSerialized": false, + "isSigningField": false, "isVLEncoded": false, + "nth": 258, + "type": "Hash256" + } + ], + [ + "Amount", + { "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 1, "type": "Amount" } ], [ "Balance", { - "nth": 2, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 2, "type": "Amount" } ], [ "LimitAmount", { - "nth": 3, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 3, "type": "Amount" } ], [ "TakerPays", { - "nth": 4, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 4, "type": "Amount" } ], [ "TakerGets", { - "nth": 5, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 5, "type": "Amount" } ], [ "LowLimit", { - "nth": 6, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 6, "type": "Amount" } ], [ "HighLimit", { - "nth": 7, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 7, "type": "Amount" } ], [ "Fee", { - "nth": 8, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 8, "type": "Amount" } ], [ "SendMax", { - "nth": 9, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 9, "type": "Amount" } ], [ "DeliverMin", { - "nth": 10, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 10, "type": "Amount" } ], [ "Amount2", { - "nth": 11, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 11, "type": "Amount" } ], [ "BidMin", { - "nth": 12, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 12, "type": "Amount" } ], [ "BidMax", { - "nth": 13, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 13, "type": "Amount" } ], [ "MinimumOffer", { - "nth": 16, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 16, "type": "Amount" } ], [ "RippleEscrow", { - "nth": 17, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 17, "type": "Amount" } ], [ "DeliveredAmount", { - "nth": 18, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 18, "type": "Amount" } ], [ "NFTokenBrokerFee", { - "nth": 19, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 19, "type": "Amount" } ], [ "BaseFeeDrops", { - "nth": 22, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 22, "type": "Amount" } ], [ "ReserveBaseDrops", { - "nth": 23, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 23, "type": "Amount" } ], [ "ReserveIncrementDrops", { - "nth": 24, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 24, "type": "Amount" } ], [ "LPTokenOut", { - "nth": 25, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 25, "type": "Amount" } ], [ "LPTokenIn", { - "nth": 26, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 26, "type": "Amount" } ], [ "EPrice", { - "nth": 27, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 27, "type": "Amount" } ], [ "Price", { - "nth": 28, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 28, "type": "Amount" } ], [ "SignatureReward", { - "nth": 29, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 29, "type": "Amount" } ], [ "MinAccountCreateAmount", { - "nth": 30, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 30, "type": "Amount" } ], [ "LPTokenBalance", { - "nth": 31, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 31, "type": "Amount" } ], [ "PublicKey", { - "nth": 1, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 1, "type": "Blob" } ], [ "MessageKey", { - "nth": 2, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 2, "type": "Blob" } ], [ "SigningPubKey", { - "nth": 3, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 3, "type": "Blob" } ], [ "TxnSignature", { - "nth": 4, - "isVLEncoded": true, "isSerialized": true, "isSigningField": false, + "isVLEncoded": true, + "nth": 4, "type": "Blob" } ], [ "URI", { - "nth": 5, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 5, "type": "Blob" } ], [ "Signature", { - "nth": 6, - "isVLEncoded": true, "isSerialized": true, "isSigningField": false, + "isVLEncoded": true, + "nth": 6, "type": "Blob" } ], [ "Domain", { - "nth": 7, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 7, "type": "Blob" } ], [ "FundCode", { - "nth": 8, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 8, "type": "Blob" } ], [ "RemoveCode", { - "nth": 9, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 9, "type": "Blob" } ], [ "ExpireCode", { - "nth": 10, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 10, "type": "Blob" } ], [ "CreateCode", { - "nth": 11, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 11, "type": "Blob" } ], [ "MemoType", { - "nth": 12, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 12, "type": "Blob" } ], [ "MemoData", { - "nth": 13, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 13, "type": "Blob" } ], [ "MemoFormat", { - "nth": 14, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 14, "type": "Blob" } ], [ "Fulfillment", { - "nth": 16, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 16, "type": "Blob" } ], [ "Condition", { - "nth": 17, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 17, "type": "Blob" } ], [ "MasterSignature", { - "nth": 18, - "isVLEncoded": true, "isSerialized": true, "isSigningField": false, + "isVLEncoded": true, + "nth": 18, "type": "Blob" } ], [ "UNLModifyValidator", { - "nth": 19, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 19, "type": "Blob" } ], [ "ValidatorToDisable", { - "nth": 20, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 20, "type": "Blob" } ], [ "ValidatorToReEnable", { - "nth": 21, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 21, "type": "Blob" } ], [ "HookStateData", { - "nth": 22, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 22, "type": "Blob" } ], [ "HookReturnString", { - "nth": 23, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 23, "type": "Blob" } ], [ "HookParameterName", { - "nth": 24, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 24, "type": "Blob" } ], [ "HookParameterValue", { - "nth": 25, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 25, "type": "Blob" } ], [ "DIDDocument", { - "nth": 26, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 26, "type": "Blob" } ], [ "Data", { - "nth": 27, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 27, "type": "Blob" } ], [ "AssetClass", { - "nth": 28, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 28, "type": "Blob" } ], [ "Provider", { - "nth": 29, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 29, "type": "Blob" } ], [ "MPTokenMetadata", { - "nth": 30, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 30, "type": "Blob" } ], [ "CredentialType", { - "nth": 31, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 31, "type": "Blob" } ], [ "Account", { - "nth": 1, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 1, "type": "AccountID" } ], [ "Owner", { - "nth": 2, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 2, "type": "AccountID" } ], [ "Destination", { - "nth": 3, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 3, "type": "AccountID" } ], [ "Issuer", { - "nth": 4, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 4, "type": "AccountID" } ], [ "Authorize", { - "nth": 5, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 5, "type": "AccountID" } ], [ "Unauthorize", { - "nth": 6, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 6, "type": "AccountID" } ], [ "RegularKey", { - "nth": 8, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 8, "type": "AccountID" } ], [ "NFTokenMinter", { - "nth": 9, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 9, "type": "AccountID" } ], [ "EmitCallback", { - "nth": 10, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 10, "type": "AccountID" } ], [ "Holder", { - "nth": 11, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 11, "type": "AccountID" } ], [ "HookAccount", { - "nth": 16, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 16, "type": "AccountID" } ], [ "OtherChainSource", { - "nth": 18, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 18, "type": "AccountID" } ], [ "OtherChainDestination", { - "nth": 19, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 19, "type": "AccountID" } ], [ "AttestationSignerAccount", { - "nth": 20, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 20, "type": "AccountID" } ], [ "AttestationRewardAccount", { - "nth": 21, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 21, "type": "AccountID" } ], [ "LockingChainDoor", { - "nth": 22, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 22, "type": "AccountID" } ], [ "IssuingChainDoor", { - "nth": 23, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 23, "type": "AccountID" } ], [ "Subject", { - "nth": 24, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, + "isVLEncoded": true, + "nth": 24, "type": "AccountID" } ], [ - "Indexes", + "Number", { - "nth": 1, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, - "type": "Vector256" + "isVLEncoded": false, + "nth": 1, + "type": "Number" } ], [ - "Hashes", + "TransactionMetaData", { - "nth": 2, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, - "type": "Vector256" + "isVLEncoded": false, + "nth": 2, + "type": "STObject" } ], [ - "Amendments", + "CreatedNode", { - "nth": 3, - "isVLEncoded": true, "isSerialized": true, "isSigningField": true, - "type": "Vector256" + "isVLEncoded": false, + "nth": 3, + "type": "STObject" } ], [ - "NFTokenOffers", + "DeletedNode", { - "nth": 4, - "isVLEncoded": true, - "isSerialized": true, - "isSigningField": true, - "type": "Vector256" - } - ], - [ - "CredentialIDs", - { - "nth": 5, - "isVLEncoded": true, - "isSerialized": true, - "isSigningField": true, - "type": "Vector256" - } - ], - [ - "Paths", - { - "nth": 1, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "PathSet" - } - ], - [ - "BaseAsset", - { - "nth": 1, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Currency" - } - ], - [ - "QuoteAsset", - { - "nth": 2, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "Currency" - } - ], - [ - "LockingChainIssue", - { - "nth": 1, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "Issue" - } - ], - [ - "IssuingChainIssue", - { - "nth": 2, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "Issue" - } - ], - [ - "Asset", - { - "nth": 3, "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "Issue" - } - ], - [ - "Asset2", - { "nth": 4, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "Issue" - } - ], - [ - "XChainBridge", - { - "nth": 1, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "XChainBridge" - } - ], - [ - "TransactionMetaData", - { - "nth": 2, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, "type": "STObject" } ], [ - "CreatedNode", + "ModifiedNode", { - "nth": 3, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "STObject" - } - ], - [ - "DeletedNode", - { - "nth": 4, "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "STObject" - } - ], - [ - "ModifiedNode", - { "nth": 5, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, "type": "STObject" } ], [ "PreviousFields", { - "nth": 6, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 6, "type": "STObject" } ], [ "FinalFields", { - "nth": 7, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 7, "type": "STObject" } ], [ "NewFields", { - "nth": 8, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 8, "type": "STObject" } ], [ "TemplateEntry", { - "nth": 9, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 9, "type": "STObject" } ], [ "Memo", { - "nth": 10, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 10, "type": "STObject" } ], [ "SignerEntry", { - "nth": 11, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 11, "type": "STObject" } ], [ "NFToken", { - "nth": 12, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 12, "type": "STObject" } ], [ "EmitDetails", { - "nth": 13, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 13, "type": "STObject" } ], [ "Hook", { - "nth": 14, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 14, "type": "STObject" } ], [ "Signer", { - "nth": 16, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 16, "type": "STObject" } ], [ "Majority", { - "nth": 18, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 18, "type": "STObject" } ], [ "DisabledValidator", { - "nth": 19, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 19, "type": "STObject" } ], [ "EmittedTxn", { - "nth": 20, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 20, "type": "STObject" } ], [ "HookExecution", { - "nth": 21, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 21, "type": "STObject" } ], [ "HookDefinition", { - "nth": 22, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 22, "type": "STObject" } ], [ "HookParameter", { - "nth": 23, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 23, "type": "STObject" } ], [ "HookGrant", { - "nth": 24, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 24, "type": "STObject" } ], [ "VoteEntry", { - "nth": 25, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 25, "type": "STObject" } ], [ "AuctionSlot", { - "nth": 26, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 26, "type": "STObject" } ], [ "AuthAccount", { - "nth": 27, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 27, "type": "STObject" } ], [ "XChainClaimProofSig", { - "nth": 28, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 28, "type": "STObject" } ], [ "XChainCreateAccountProofSig", { - "nth": 29, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 29, "type": "STObject" } ], [ "XChainClaimAttestationCollectionElement", { - "nth": 30, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 30, "type": "STObject" } ], [ "XChainCreateAccountAttestationCollectionElement", { - "nth": 31, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 31, "type": "STObject" } ], [ "PriceData", { - "nth": 32, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 32, "type": "STObject" } ], [ "Credential", { - "nth": 33, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 33, "type": "STObject" } ], [ "Signers", { - "nth": 3, - "isVLEncoded": false, "isSerialized": true, "isSigningField": false, + "isVLEncoded": false, + "nth": 3, "type": "STArray" } ], [ "SignerEntries", { - "nth": 4, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 4, "type": "STArray" } ], [ "Template", { - "nth": 5, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 5, "type": "STArray" } ], [ "Necessary", { - "nth": 6, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 6, "type": "STArray" } ], [ "Sufficient", { - "nth": 7, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 7, "type": "STArray" } ], [ "AffectedNodes", { - "nth": 8, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 8, "type": "STArray" } ], [ "Memos", { - "nth": 9, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 9, "type": "STArray" } ], [ "NFTokens", { - "nth": 10, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 10, "type": "STArray" } ], [ "Hooks", { - "nth": 11, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 11, "type": "STArray" } ], [ "VoteSlots", { - "nth": 12, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 12, "type": "STArray" } ], [ "Majorities", { - "nth": 16, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 16, "type": "STArray" } ], [ "DisabledValidators", { - "nth": 17, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 17, "type": "STArray" } ], [ "HookExecutions", { - "nth": 18, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 18, "type": "STArray" } ], [ "HookParameters", { - "nth": 19, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 19, "type": "STArray" } ], [ "HookGrants", { - "nth": 20, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 20, "type": "STArray" } ], [ "XChainClaimAttestations", { - "nth": 21, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 21, "type": "STArray" } ], [ "XChainCreateAccountAttestations", { - "nth": 22, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 22, "type": "STArray" } ], [ "PriceDataSeries", { - "nth": 24, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 24, "type": "STArray" } ], [ "AuthAccounts", { - "nth": 25, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 25, "type": "STArray" } ], [ "AuthorizeCredentials", { - "nth": 26, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 26, "type": "STArray" } ], [ "UnauthorizeCredentials", { - "nth": 27, + "isSerialized": true, + "isSigningField": true, "isVLEncoded": false, + "nth": 27, + "type": "STArray" + } + ], + [ + "AcceptedCredentials", + { "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 28, "type": "STArray" } - ] - ], - "TRANSACTION_RESULTS": { - "telLOCAL_ERROR": -399, - "telBAD_DOMAIN": -398, - "telBAD_PATH_COUNT": -397, - "telBAD_PUBLIC_KEY": -396, - "telFAILED_PROCESSING": -395, - "telINSUF_FEE_P": -394, - "telNO_DST_PARTIAL": -393, - "telCAN_NOT_QUEUE": -392, - "telCAN_NOT_QUEUE_BALANCE": -391, - "telCAN_NOT_QUEUE_BLOCKS": -390, - "telCAN_NOT_QUEUE_BLOCKED": -389, - "telCAN_NOT_QUEUE_FEE": -388, - "telCAN_NOT_QUEUE_FULL": -387, - "telWRONG_NETWORK": -386, - "telREQUIRES_NETWORK_ID": -385, - "telNETWORK_ID_MAKES_TX_NON_CANONICAL": -384, - "telENV_RPC_FAILED": -383, - - "temMALFORMED": -299, - "temBAD_AMOUNT": -298, - "temBAD_CURRENCY": -297, - "temBAD_EXPIRATION": -296, - "temBAD_FEE": -295, - "temBAD_ISSUER": -294, - "temBAD_LIMIT": -293, - "temBAD_OFFER": -292, - "temBAD_PATH": -291, - "temBAD_PATH_LOOP": -290, - "temBAD_REGKEY": -289, - "temBAD_SEND_XRP_LIMIT": -288, - "temBAD_SEND_XRP_MAX": -287, - "temBAD_SEND_XRP_NO_DIRECT": -286, - "temBAD_SEND_XRP_PARTIAL": -285, - "temBAD_SEND_XRP_PATHS": -284, - "temBAD_SEQUENCE": -283, - "temBAD_SIGNATURE": -282, - "temBAD_SRC_ACCOUNT": -281, - "temBAD_TRANSFER_RATE": -280, - "temDST_IS_SRC": -279, - "temDST_NEEDED": -278, - "temINVALID": -277, - "temINVALID_FLAG": -276, - "temREDUNDANT": -275, - "temRIPPLE_EMPTY": -274, - "temDISABLED": -273, - "temBAD_SIGNER": -272, - "temBAD_QUORUM": -271, - "temBAD_WEIGHT": -270, - "temBAD_TICK_SIZE": -269, - "temINVALID_ACCOUNT_ID": -268, - "temCANNOT_PREAUTH_SELF": -267, - "temINVALID_COUNT": -266, - "temUNCERTAIN": -265, - "temUNKNOWN": -264, - "temSEQ_AND_TICKET": -263, - "temBAD_NFTOKEN_TRANSFER_FEE": -262, - "temBAD_AMM_TOKENS": -261, - "temXCHAIN_EQUAL_DOOR_ACCOUNTS": -260, - "temXCHAIN_BAD_PROOF": -259, - "temXCHAIN_BRIDGE_BAD_ISSUES": -258, - "temXCHAIN_BRIDGE_NONDOOR_OWNER": -257, - "temXCHAIN_BRIDGE_BAD_MIN_ACCOUNT_CREATE_AMOUNT": -256, - "temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT": -255, - "temEMPTY_DID": -254, - "temARRAY_EMPTY": -253, - "temARRAY_TOO_LARGE": -252, - "temBAD_TRANSFER_FEE": -251, - - "tefFAILURE": -199, - "tefALREADY": -198, - "tefBAD_ADD_AUTH": -197, - "tefBAD_AUTH": -196, - "tefBAD_LEDGER": -195, - "tefCREATED": -194, - "tefEXCEPTION": -193, - "tefINTERNAL": -192, - "tefNO_AUTH_REQUIRED": -191, - "tefPAST_SEQ": -190, - "tefWRONG_PRIOR": -189, - "tefMASTER_DISABLED": -188, - "tefMAX_LEDGER": -187, - "tefBAD_SIGNATURE": -186, - "tefBAD_QUORUM": -185, - "tefNOT_MULTI_SIGNING": -184, - "tefBAD_AUTH_MASTER": -183, - "tefINVARIANT_FAILED": -182, - "tefTOO_BIG": -181, - "tefNO_TICKET": -180, - "tefNFTOKEN_IS_NOT_TRANSFERABLE": -179, - "tefINVALID_LEDGER_FIX_TYPE": -178, - - "terRETRY": -99, - "terFUNDS_SPENT": -98, - "terINSUF_FEE_B": -97, - "terNO_ACCOUNT": -96, - "terNO_AUTH": -95, - "terNO_LINE": -94, - "terOWNERS": -93, - "terPRE_SEQ": -92, - "terLAST": -91, - "terNO_RIPPLE": -90, - "terQUEUED": -89, - "terPRE_TICKET": -88, - "terNO_AMM": -87, - - "tesSUCCESS": 0, - - "tecCLAIM": 100, - "tecPATH_PARTIAL": 101, - "tecUNFUNDED_ADD": 102, - "tecUNFUNDED_OFFER": 103, - "tecUNFUNDED_PAYMENT": 104, - "tecFAILED_PROCESSING": 105, - "tecDIR_FULL": 121, - "tecINSUF_RESERVE_LINE": 122, - "tecINSUF_RESERVE_OFFER": 123, - "tecNO_DST": 124, - "tecNO_DST_INSUF_XRP": 125, - "tecNO_LINE_INSUF_RESERVE": 126, - "tecNO_LINE_REDUNDANT": 127, - "tecPATH_DRY": 128, - "tecUNFUNDED": 129, - "tecNO_ALTERNATIVE_KEY": 130, - "tecNO_REGULAR_KEY": 131, - "tecOWNERS": 132, - "tecNO_ISSUER": 133, - "tecNO_AUTH": 134, - "tecNO_LINE": 135, - "tecINSUFF_FEE": 136, - "tecFROZEN": 137, - "tecNO_TARGET": 138, - "tecNO_PERMISSION": 139, - "tecNO_ENTRY": 140, - "tecINSUFFICIENT_RESERVE": 141, - "tecNEED_MASTER_KEY": 142, - "tecDST_TAG_NEEDED": 143, - "tecINTERNAL": 144, - "tecOVERSIZE": 145, - "tecCRYPTOCONDITION_ERROR": 146, - "tecINVARIANT_FAILED": 147, - "tecEXPIRED": 148, - "tecDUPLICATE": 149, - "tecKILLED": 150, - "tecHAS_OBLIGATIONS": 151, - "tecTOO_SOON": 152, - "tecHOOK_REJECTED": 153, - "tecMAX_SEQUENCE_REACHED": 154, - "tecNO_SUITABLE_NFTOKEN_PAGE": 155, - "tecNFTOKEN_BUY_SELL_MISMATCH": 156, - "tecNFTOKEN_OFFER_TYPE_MISMATCH": 157, - "tecCANT_ACCEPT_OWN_NFTOKEN_OFFER": 158, - "tecINSUFFICIENT_FUNDS": 159, - "tecOBJECT_NOT_FOUND": 160, - "tecINSUFFICIENT_PAYMENT": 161, - "tecUNFUNDED_AMM": 162, - "tecAMM_BALANCE": 163, - "tecAMM_FAILED": 164, - "tecAMM_INVALID_TOKENS": 165, - "tecAMM_EMPTY": 166, - "tecAMM_NOT_EMPTY": 167, - "tecAMM_ACCOUNT": 168, - "tecINCOMPLETE": 169, - "tecXCHAIN_BAD_TRANSFER_ISSUE": 170, - "tecXCHAIN_NO_CLAIM_ID": 171, - "tecXCHAIN_BAD_CLAIM_ID": 172, - "tecXCHAIN_CLAIM_NO_QUORUM": 173, - "tecXCHAIN_PROOF_UNKNOWN_KEY": 174, - "tecXCHAIN_CREATE_ACCOUNT_NONXRP_ISSUE": 175, - "tecXCHAIN_WRONG_CHAIN": 176, - "tecXCHAIN_REWARD_MISMATCH": 177, - "tecXCHAIN_NO_SIGNERS_LIST": 178, - "tecXCHAIN_SENDING_ACCOUNT_MISMATCH": 179, - "tecXCHAIN_INSUFF_CREATE_AMOUNT": 180, - "tecXCHAIN_ACCOUNT_CREATE_PAST": 181, - "tecXCHAIN_ACCOUNT_CREATE_TOO_MANY": 182, - "tecXCHAIN_PAYMENT_FAILED": 183, - "tecXCHAIN_SELF_COMMIT": 184, - "tecXCHAIN_BAD_PUBLIC_KEY_ACCOUNT_PAIR": 185, - "tecXCHAIN_CREATE_ACCOUNT_DISABLED": 186, - "tecEMPTY_DID": 187, - "tecINVALID_UPDATE_TIME": 188, - "tecTOKEN_PAIR_NOT_FOUND": 189, - "tecARRAY_EMPTY": 190, - "tecARRAY_TOO_LARGE": 191, - "tecLOCKED": 192, - "tecBAD_CREDENTIALS": 193 - }, - "TRANSACTION_TYPES": { - "Invalid": -1, - "Payment": 0, - "EscrowCreate": 1, - "EscrowFinish": 2, - "AccountSet": 3, - "EscrowCancel": 4, - "SetRegularKey": 5, - "OfferCreate": 7, - "OfferCancel": 8, - "TicketCreate": 10, - "SignerListSet": 12, - "PaymentChannelCreate": 13, - "PaymentChannelFund": 14, - "PaymentChannelClaim": 15, - "CheckCreate": 16, - "CheckCash": 17, - "CheckCancel": 18, - "DepositPreauth": 19, - "TrustSet": 20, - "AccountDelete": 21, - "NFTokenMint": 25, - "NFTokenBurn": 26, - "NFTokenCreateOffer": 27, - "NFTokenCancelOffer": 28, - "NFTokenAcceptOffer": 29, - "Clawback": 30, + ], + [ + "CloseResolution", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 1, + "type": "UInt8" + } + ], + [ + "Method", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 2, + "type": "UInt8" + } + ], + [ + "TransactionResult", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 3, + "type": "UInt8" + } + ], + [ + "Scale", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 4, + "type": "UInt8" + } + ], + [ + "AssetScale", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 5, + "type": "UInt8" + } + ], + [ + "TickSize", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 16, + "type": "UInt8" + } + ], + [ + "UNLModifyDisabling", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 17, + "type": "UInt8" + } + ], + [ + "HookResult", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 18, + "type": "UInt8" + } + ], + [ + "WasLockingChainSend", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 19, + "type": "UInt8" + } + ], + [ + "TakerPaysCurrency", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 1, + "type": "Hash160" + } + ], + [ + "TakerPaysIssuer", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 2, + "type": "Hash160" + } + ], + [ + "TakerGetsCurrency", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 3, + "type": "Hash160" + } + ], + [ + "TakerGetsIssuer", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 4, + "type": "Hash160" + } + ], + [ + "Paths", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 1, + "type": "PathSet" + } + ], + [ + "Indexes", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": true, + "nth": 1, + "type": "Vector256" + } + ], + [ + "Hashes", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": true, + "nth": 2, + "type": "Vector256" + } + ], + [ + "Amendments", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": true, + "nth": 3, + "type": "Vector256" + } + ], + [ + "NFTokenOffers", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": true, + "nth": 4, + "type": "Vector256" + } + ], + [ + "CredentialIDs", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": true, + "nth": 5, + "type": "Vector256" + } + ], + [ + "MPTokenIssuanceID", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 1, + "type": "Hash192" + } + ], + [ + "LockingChainIssue", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 1, + "type": "Issue" + } + ], + [ + "IssuingChainIssue", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 2, + "type": "Issue" + } + ], + [ + "Asset", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 3, + "type": "Issue" + } + ], + [ + "Asset2", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 4, + "type": "Issue" + } + ], + [ + "XChainBridge", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 1, + "type": "XChainBridge" + } + ], + [ + "BaseAsset", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 1, + "type": "Currency" + } + ], + [ + "QuoteAsset", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 2, + "type": "Currency" + } + ], + [ + "Transaction", + { + "isSerialized": false, + "isSigningField": false, + "isVLEncoded": false, + "nth": 257, + "type": "Transaction" + } + ], + [ + "LedgerEntry", + { + "isSerialized": false, + "isSigningField": false, + "isVLEncoded": false, + "nth": 257, + "type": "LedgerEntry" + } + ], + [ + "Validation", + { + "isSerialized": false, + "isSigningField": false, + "isVLEncoded": false, + "nth": 257, + "type": "Validation" + } + ], + [ + "Metadata", + { + "isSerialized": false, + "isSigningField": false, + "isVLEncoded": false, + "nth": 257, + "type": "Metadata" + } + ] + ], + "LEDGER_ENTRY_TYPES": { + "AMM": 121, + "AccountRoot": 97, + "Amendments": 102, + "Bridge": 105, + "Check": 67, + "Credential": 129, + "DID": 73, + "DepositPreauth": 112, + "DirectoryNode": 100, + "Escrow": 117, + "FeeSettings": 115, + "Invalid": -1, + "LedgerHashes": 104, + "MPToken": 127, + "MPTokenIssuance": 126, + "NFTokenOffer": 55, + "NFTokenPage": 80, + "NegativeUNL": 78, + "Offer": 111, + "Oracle": 128, + "PayChannel": 120, + "PermissionedDomain": 130, + "RippleState": 114, + "SignerList": 83, + "Ticket": 84, + "XChainOwnedClaimID": 113, + "XChainOwnedCreateAccountClaimID": 116 + }, + "TRANSACTION_RESULTS": { + "tecAMM_ACCOUNT": 168, + "tecAMM_BALANCE": 163, + "tecAMM_EMPTY": 166, + "tecAMM_FAILED": 164, + "tecAMM_INVALID_TOKENS": 165, + "tecAMM_NOT_EMPTY": 167, + "tecARRAY_EMPTY": 190, + "tecARRAY_TOO_LARGE": 191, + "tecBAD_CREDENTIALS": 193, + "tecCANT_ACCEPT_OWN_NFTOKEN_OFFER": 158, + "tecCLAIM": 100, + "tecCRYPTOCONDITION_ERROR": 146, + "tecDIR_FULL": 121, + "tecDST_TAG_NEEDED": 143, + "tecDUPLICATE": 149, + "tecEMPTY_DID": 187, + "tecEXPIRED": 148, + "tecFAILED_PROCESSING": 105, + "tecFROZEN": 137, + "tecHAS_OBLIGATIONS": 151, + "tecHOOK_REJECTED": 153, + "tecINCOMPLETE": 169, + "tecINSUFFICIENT_FUNDS": 159, + "tecINSUFFICIENT_PAYMENT": 161, + "tecINSUFFICIENT_RESERVE": 141, + "tecINSUFF_FEE": 136, + "tecINSUF_RESERVE_LINE": 122, + "tecINSUF_RESERVE_OFFER": 123, + "tecINTERNAL": 144, + "tecINVALID_UPDATE_TIME": 188, + "tecINVARIANT_FAILED": 147, + "tecKILLED": 150, + "tecLOCKED": 192, + "tecMAX_SEQUENCE_REACHED": 154, + "tecNEED_MASTER_KEY": 142, + "tecNFTOKEN_BUY_SELL_MISMATCH": 156, + "tecNFTOKEN_OFFER_TYPE_MISMATCH": 157, + "tecNO_ALTERNATIVE_KEY": 130, + "tecNO_AUTH": 134, + "tecNO_DST": 124, + "tecNO_DST_INSUF_XRP": 125, + "tecNO_ENTRY": 140, + "tecNO_ISSUER": 133, + "tecNO_LINE": 135, + "tecNO_LINE_INSUF_RESERVE": 126, + "tecNO_LINE_REDUNDANT": 127, + "tecNO_PERMISSION": 139, + "tecNO_REGULAR_KEY": 131, + "tecNO_SUITABLE_NFTOKEN_PAGE": 155, + "tecNO_TARGET": 138, + "tecOBJECT_NOT_FOUND": 160, + "tecOVERSIZE": 145, + "tecOWNERS": 132, + "tecPATH_DRY": 128, + "tecPATH_PARTIAL": 101, + "tecTOKEN_PAIR_NOT_FOUND": 189, + "tecTOO_SOON": 152, + "tecUNFUNDED": 129, + "tecUNFUNDED_ADD": 102, + "tecUNFUNDED_AMM": 162, + "tecUNFUNDED_OFFER": 103, + "tecUNFUNDED_PAYMENT": 104, + "tecXCHAIN_ACCOUNT_CREATE_PAST": 181, + "tecXCHAIN_ACCOUNT_CREATE_TOO_MANY": 182, + "tecXCHAIN_BAD_CLAIM_ID": 172, + "tecXCHAIN_BAD_PUBLIC_KEY_ACCOUNT_PAIR": 185, + "tecXCHAIN_BAD_TRANSFER_ISSUE": 170, + "tecXCHAIN_CLAIM_NO_QUORUM": 173, + "tecXCHAIN_CREATE_ACCOUNT_DISABLED": 186, + "tecXCHAIN_CREATE_ACCOUNT_NONXRP_ISSUE": 175, + "tecXCHAIN_INSUFF_CREATE_AMOUNT": 180, + "tecXCHAIN_NO_CLAIM_ID": 171, + "tecXCHAIN_NO_SIGNERS_LIST": 178, + "tecXCHAIN_PAYMENT_FAILED": 183, + "tecXCHAIN_PROOF_UNKNOWN_KEY": 174, + "tecXCHAIN_REWARD_MISMATCH": 177, + "tecXCHAIN_SELF_COMMIT": 184, + "tecXCHAIN_SENDING_ACCOUNT_MISMATCH": 179, + "tecXCHAIN_WRONG_CHAIN": 176, + + "tefALREADY": -198, + "tefBAD_ADD_AUTH": -197, + "tefBAD_AUTH": -196, + "tefBAD_AUTH_MASTER": -183, + "tefBAD_LEDGER": -195, + "tefBAD_QUORUM": -185, + "tefBAD_SIGNATURE": -186, + "tefCREATED": -194, + "tefEXCEPTION": -193, + "tefFAILURE": -199, + "tefINTERNAL": -192, + "tefINVALID_LEDGER_FIX_TYPE": -178, + "tefINVARIANT_FAILED": -182, + "tefMASTER_DISABLED": -188, + "tefMAX_LEDGER": -187, + "tefNFTOKEN_IS_NOT_TRANSFERABLE": -179, + "tefNOT_MULTI_SIGNING": -184, + "tefNO_AUTH_REQUIRED": -191, + "tefNO_TICKET": -180, + "tefPAST_SEQ": -190, + "tefTOO_BIG": -181, + "tefWRONG_PRIOR": -189, + + "telBAD_DOMAIN": -398, + "telBAD_PATH_COUNT": -397, + "telBAD_PUBLIC_KEY": -396, + "telCAN_NOT_QUEUE": -392, + "telCAN_NOT_QUEUE_BALANCE": -391, + "telCAN_NOT_QUEUE_BLOCKED": -389, + "telCAN_NOT_QUEUE_BLOCKS": -390, + "telCAN_NOT_QUEUE_FEE": -388, + "telCAN_NOT_QUEUE_FULL": -387, + "telENV_RPC_FAILED": -383, + "telFAILED_PROCESSING": -395, + "telINSUF_FEE_P": -394, + "telLOCAL_ERROR": -399, + "telNETWORK_ID_MAKES_TX_NON_CANONICAL": -384, + "telNO_DST_PARTIAL": -393, + "telREQUIRES_NETWORK_ID": -385, + "telWRONG_NETWORK": -386, + + "temARRAY_EMPTY": -253, + "temARRAY_TOO_LARGE": -252, + "temBAD_AMM_TOKENS": -261, + "temBAD_AMOUNT": -298, + "temBAD_CURRENCY": -297, + "temBAD_EXPIRATION": -296, + "temBAD_FEE": -295, + "temBAD_ISSUER": -294, + "temBAD_LIMIT": -293, + "temBAD_NFTOKEN_TRANSFER_FEE": -262, + "temBAD_OFFER": -292, + "temBAD_PATH": -291, + "temBAD_PATH_LOOP": -290, + "temBAD_QUORUM": -271, + "temBAD_REGKEY": -289, + "temBAD_SEND_XRP_LIMIT": -288, + "temBAD_SEND_XRP_MAX": -287, + "temBAD_SEND_XRP_NO_DIRECT": -286, + "temBAD_SEND_XRP_PARTIAL": -285, + "temBAD_SEND_XRP_PATHS": -284, + "temBAD_SEQUENCE": -283, + "temBAD_SIGNATURE": -282, + "temBAD_SIGNER": -272, + "temBAD_SRC_ACCOUNT": -281, + "temBAD_TICK_SIZE": -269, + "temBAD_TRANSFER_FEE": -251, + "temBAD_TRANSFER_RATE": -280, + "temBAD_WEIGHT": -270, + "temCANNOT_PREAUTH_SELF": -267, + "temDISABLED": -273, + "temDST_IS_SRC": -279, + "temDST_NEEDED": -278, + "temEMPTY_DID": -254, + "temINVALID": -277, + "temINVALID_ACCOUNT_ID": -268, + "temINVALID_COUNT": -266, + "temINVALID_FLAG": -276, + "temMALFORMED": -299, + "temREDUNDANT": -275, + "temRIPPLE_EMPTY": -274, + "temSEQ_AND_TICKET": -263, + "temUNCERTAIN": -265, + "temUNKNOWN": -264, + "temXCHAIN_BAD_PROOF": -259, + "temXCHAIN_BRIDGE_BAD_ISSUES": -258, + "temXCHAIN_BRIDGE_BAD_MIN_ACCOUNT_CREATE_AMOUNT": -256, + "temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT": -255, + "temXCHAIN_BRIDGE_NONDOOR_OWNER": -257, + "temXCHAIN_EQUAL_DOOR_ACCOUNTS": -260, + + "terFUNDS_SPENT": -98, + "terINSUF_FEE_B": -97, + "terLAST": -91, + "terNO_ACCOUNT": -96, + "terNO_AMM": -87, + "terNO_AUTH": -95, + "terNO_LINE": -94, + "terNO_RIPPLE": -90, + "terOWNERS": -93, + "terPRE_SEQ": -92, + "terPRE_TICKET": -88, + "terQUEUED": -89, + "terRETRY": -99, + + "tesSUCCESS": 0 + }, + "TRANSACTION_TYPES": { + "AMMBid": 39, "AMMClawback": 31, "AMMCreate": 35, + "AMMDelete": 40, "AMMDeposit": 36, - "AMMWithdraw": 37, "AMMVote": 38, - "AMMBid": 39, - "AMMDelete": 40, - "XChainCreateClaimID": 41, - "XChainCommit": 42, - "XChainClaim": 43, - "XChainAccountCreateCommit": 44, - "XChainAddClaimAttestation": 45, - "XChainAddAccountCreateAttestation": 46, - "XChainModifyBridge": 47, - "XChainCreateBridge": 48, - "DIDSet": 49, + "AMMWithdraw": 37, + "AccountDelete": 21, + "AccountSet": 3, + "CheckCancel": 18, + "CheckCash": 17, + "CheckCreate": 16, + "Clawback": 30, + "CredentialAccept": 59, + "CredentialCreate": 58, + "CredentialDelete": 60, "DIDDelete": 50, - "OracleSet": 51, - "OracleDelete": 52, + "DIDSet": 49, + "DepositPreauth": 19, + "EnableAmendment": 100, + "EscrowCancel": 4, + "EscrowCreate": 1, + "EscrowFinish": 2, + "Invalid": -1, "LedgerStateFix": 53, + "MPTokenAuthorize": 57, "MPTokenIssuanceCreate": 54, "MPTokenIssuanceDestroy": 55, "MPTokenIssuanceSet": 56, - "MPTokenAuthorize": 57, - "CredentialCreate": 58, - "CredentialAccept": 59, - "CredentialDelete": 60, - "EnableAmendment": 100, + "NFTokenAcceptOffer": 29, + "NFTokenBurn": 26, + "NFTokenCancelOffer": 28, + "NFTokenCreateOffer": 27, + "NFTokenMint": 25, + "NFTokenModify": 61, + "OfferCancel": 8, + "OfferCreate": 7, + "OracleDelete": 52, + "OracleSet": 51, + "Payment": 0, + "PaymentChannelClaim": 15, + "PaymentChannelCreate": 13, + "PaymentChannelFund": 14, + "PermissionedDomainDelete": 63, + "PermissionedDomainSet": 62, "SetFee": 101, - "UNLModify": 102 + "SetRegularKey": 5, + "SignerListSet": 12, + "TicketCreate": 10, + "TrustSet": 20, + "UNLModify": 102, + "XChainAccountCreateCommit": 44, + "XChainAddAccountCreateAttestation": 46, + "XChainAddClaimAttestation": 45, + "XChainClaim": 43, + "XChainCommit": 42, + "XChainCreateBridge": 48, + "XChainCreateClaimID": 41, + "XChainModifyBridge": 47 + }, + "TYPES": { + "AccountID": 8, + "Amount": 6, + "Blob": 7, + "Currency": 26, + "Done": -1, + "Hash128": 4, + "Hash160": 17, + "Hash192": 21, + "Hash256": 5, + "Issue": 24, + "LedgerEntry": 10002, + "Metadata": 10004, + "NotPresent": 0, + "Number": 9, + "PathSet": 18, + "STArray": 15, + "STObject": 14, + "Transaction": 10001, + "UInt16": 1, + "UInt32": 2, + "UInt384": 22, + "UInt512": 23, + "UInt64": 3, + "UInt8": 16, + "UInt96": 20, + "Unknown": -2, + "Validation": 10003, + "Vector256": 19, + "XChainBridge": 25 } } diff --git a/packages/ripple-binary-codec/tools/generateDefinitions.js b/packages/ripple-binary-codec/tools/generateDefinitions.js index 88dc720abd..60b835f53d 100644 --- a/packages/ripple-binary-codec/tools/generateDefinitions.js +++ b/packages/ripple-binary-codec/tools/generateDefinitions.js @@ -61,7 +61,12 @@ const capitalizationExceptions = { function translate(inp) { try { if (inp.match(/^UINT/m)) - if (inp.match(/256/m) || inp.match(/160/m) || inp.match(/128/m) || inp.match(/192/m)) + if ( + inp.match(/256/m) || + inp.match(/160/m) || + inp.match(/128/m) || + inp.match(/192/m) + ) return inp.replace('UINT', 'Hash') else return inp.replace('UINT', 'UInt') if (inp == 'OBJECT' || inp == 'ARRAY') @@ -94,13 +99,15 @@ function addLine(line) { output += line + '\n' } -//////////////////////////////////////////////////////////////////////// -// Serialized type processing -//////////////////////////////////////////////////////////////////////// +function sorter(a, b) { + if (a < b) return -1 + if (a > b) return 1 + return 0 +} + addLine('{') -addLine(' "TYPES": {') -addLine(' "Done": -1,') +// process STypes let stypeHits = [ ...sfieldHeaderFile.matchAll( /^ *STYPE\(STI_([^ ]*?) *, *([0-9-]+) *\) *\\?$/gm, @@ -110,46 +117,10 @@ if (stypeHits.length === 0) stypeHits = [ ...sfieldHeaderFile.matchAll(/^ *STI_([^ ]*?) *= *([0-9-]+) *,?$/gm), ] -for (let x = 0; x < stypeHits.length; ++x) { - addLine( - ' "' + - translate(stypeHits[x][1]) + - '": ' + - stypeHits[x][2] + - (x < stypeHits.length - 1 ? ',' : ''), - ) -} - -addLine(' },') - -//////////////////////////////////////////////////////////////////////// -// Ledger entry type processing -//////////////////////////////////////////////////////////////////////// -addLine(' "LEDGER_ENTRY_TYPES": {') -addLine(' "Any": -3,') -addLine(' "Child": -2,') -addLine(' "Invalid": -1,') - -const unhex = (x) => { - x = ('' + x).trim() - if (x.substr(0, 2) == '0x') return '' + parseInt(x) - if (x.substr(0, 1) == "'" && x.length == 3) return x.charCodeAt(1) - return x -} -hits = [ - ...ledgerFormatsMacroFile.matchAll( - /^ *LEDGER_ENTRY\(lt[A-Z_]+ *, *([x0-9a-f]+) *, *([^,]+), \({$/gm, - ), -] -for (let x = 0; x < hits.length; ++x) - addLine( - ' "' + - hits[x][2] + - '": ' + - unhex(hits[x][1]) + - (x < hits.length - 1 ? ',' : ''), - ) -addLine(' },') +const stypeMap = {} +stypeHits.forEach(([_, key, value]) => { + stypeMap[key] = value +}) //////////////////////////////////////////////////////////////////////// // SField processing @@ -159,80 +130,60 @@ addLine(' "FIELDS": [') addLine(` [ "Generic", { - "nth": 0, - "isVLEncoded": false, "isSerialized": false, "isSigningField": false, + "isVLEncoded": false, + "nth": 0, "type": "Unknown" } ], [ "Invalid", { - "nth": -1, - "isVLEncoded": false, "isSerialized": false, "isSigningField": false, + "isVLEncoded": false, + "nth": -1, "type": "Unknown" } ], [ "ObjectEndMarker", { - "nth": 1, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 1, "type": "STObject" } ], [ "ArrayEndMarker", { - "nth": 1, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 1, "type": "STArray" } ], [ - "hash", + "taker_gets_funded", { - "nth": 257, - "isVLEncoded": false, "isSerialized": false, "isSigningField": false, - "type": "Hash256" - } - ], - [ - "index", - { - "nth": 258, "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Hash256" - } - ], - [ - "taker_gets_funded", - { "nth": 258, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, "type": "Amount" } ], [ "taker_pays_funded", { - "nth": 259, - "isVLEncoded": false, "isSerialized": false, "isSigningField": false, + "isVLEncoded": false, + "nth": 259, "type": "Amount" } ],`) @@ -242,7 +193,7 @@ const isVLEncoded = (t) => { return 'false' } -const isSerialized = (t) => { +const isSerialized = (t, field) => { if ( t == 'LEDGERENTRY' || t == 'TRANSACTION' || @@ -250,6 +201,7 @@ const isSerialized = (t) => { t == 'METADATA' ) return 'false' + if (field == 'hash' || field == 'index') return 'false' return 'true' } @@ -271,18 +223,35 @@ let sfieldHits = [ /^ *[A-Z]*TYPED_SFIELD *\( *sf([^,\n]*),[ \n]*([^, \n]+)[ \n]*,[ \n]*([0-9]+)(,.*?(notSigning))?/gm, ), ] +sfieldHits.push( + ...[ + ['', 'hash', 'UINT256', '257', '', 'notSigning'], + ['', 'index', 'UINT256', '258', '', 'notSigning'], + ], +) +sfieldHits.sort((a, b) => { + const aValue = parseInt(stypeMap[a[2]]) * 2 ** 16 + parseInt(a[3]) + const bValue = parseInt(stypeMap[b[2]]) * 2 ** 16 + parseInt(b[3]) + return aValue - bValue // Ascending order +}) +console.log(stypeMap) +console.log(sfieldHits.map((x) => [x[1], x[2], x[3], x[5]])) for (let x = 0; x < sfieldHits.length; ++x) { addLine(' [') addLine(' "' + sfieldHits[x][1] + '",') addLine(' {') - addLine(' "nth": ' + sfieldHits[x][3] + ',') - addLine(' "isVLEncoded": ' + isVLEncoded(sfieldHits[x][2]) + ',') - addLine(' "isSerialized": ' + isSerialized(sfieldHits[x][2]) + ',') + addLine( + ' "isSerialized": ' + + isSerialized(sfieldHits[x][2], sfieldHits[x][1]) + + ',', + ) addLine( ' "isSigningField": ' + isSigningField(sfieldHits[x][2], sfieldHits[x][5]) + ',', ) + addLine(' "isVLEncoded": ' + isVLEncoded(sfieldHits[x][2]) + ',') + addLine(' "nth": ' + sfieldHits[x][3] + ',') addLine(' "type": "' + translate(sfieldHits[x][2]) + '"') addLine(' }') addLine(' ]' + (x < sfieldHits.length - 1 ? ',' : '')) @@ -290,6 +259,34 @@ for (let x = 0; x < sfieldHits.length; ++x) { addLine(' ],') +//////////////////////////////////////////////////////////////////////// +// Ledger entry type processing +//////////////////////////////////////////////////////////////////////// +addLine(' "LEDGER_ENTRY_TYPES": {') + +const unhex = (x) => { + x = ('' + x).trim() + if (x.substr(0, 2) == '0x') return '' + parseInt(x) + if (x.substr(0, 1) == "'" && x.length == 3) return x.charCodeAt(1) + return x +} +hits = [ + ...ledgerFormatsMacroFile.matchAll( + /^ *LEDGER_ENTRY[A-Z_]*\(lt[A-Z_]+ *, *([x0-9a-f]+) *, *([^,]+), *([^,]+), \({$/gm, + ), +] +hits.push(['', '-1', 'Invalid']) +hits.sort((a, b) => sorter(a[2], b[2])) +for (let x = 0; x < hits.length; ++x) + addLine( + ' "' + + hits[x][2] + + '": ' + + unhex(hits[x][1]) + + (x < hits.length - 1 ? ',' : ''), + ) +addLine(' },') + //////////////////////////////////////////////////////////////////////// // TER code processing //////////////////////////////////////////////////////////////////////// @@ -302,23 +299,29 @@ let terHits = [ ), ] let upto = -1 -let last = '' +const terCodes = [] for (let x = 0; x < terHits.length; ++x) { - if (terHits[x][4] !== undefined) upto = terHits[x][4] - - let current = terHits[x][2] - if (current != last && last != '') addLine('') - last = current + if (terHits[x][4] !== undefined) upto = parseInt(terHits[x][4]) + terCodes.push([terHits[x][1], upto]) + upto++ +} +terCodes.sort((a, b) => sorter(a[0], b[0])) +let currentType = '' +for (let x = 0; x < terCodes.length; ++x) { + if (currentType === '') { + currentType = terCodes[x][0].substr(0, 3) + } else if (currentType != terCodes[x][0].substr(0, 3)) { + addLine('') + currentType = terCodes[x][0].substr(0, 3) + } addLine( ' "' + - terHits[x][1] + + terCodes[x][0] + '": ' + - upto + - (x < terHits.length - 1 ? ',' : ''), + terCodes[x][1] + + (x < terCodes.length - 1 ? ',' : ''), ) - - upto++ } addLine(' },') @@ -327,13 +330,14 @@ addLine(' },') // Transaction type processing //////////////////////////////////////////////////////////////////////// addLine(' "TRANSACTION_TYPES": {') -addLine(' "Invalid": -1,') let txHits = [ ...transactionsMacroFile.matchAll( /^ *TRANSACTION\(tt[A-Z_]+ *,* ([0-9]+) *, *([A-Za-z]+).*$/gm, ), ] +txHits.push(['', '-1', 'Invalid']) +txHits.sort((a, b) => sorter(a[2], b[2])) for (let x = 0; x < txHits.length; ++x) { addLine( ' "' + @@ -344,6 +348,25 @@ for (let x = 0; x < txHits.length; ++x) { ) } +addLine(' },') + +//////////////////////////////////////////////////////////////////////// +// Serialized type processing +//////////////////////////////////////////////////////////////////////// +addLine(' "TYPES": {') + +stypeHits.push(['', 'DONE', -1]) +stypeHits.sort((a, b) => sorter(translate(a[1]), translate(b[1]))) +for (let x = 0; x < stypeHits.length; ++x) { + addLine( + ' "' + + translate(stypeHits[x][1]) + + '": ' + + stypeHits[x][2] + + (x < stypeHits.length - 1 ? ',' : ''), + ) +} + addLine(' }') addLine('}') From c6fd141a0a58aced23ccba5bb748ceea78dda6cd Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 6 Feb 2025 10:37:04 -0800 Subject: [PATCH 11/12] fix tests --- packages/xrpl/test/integration/requests/serverInfo.test.ts | 1 + packages/xrpl/test/integration/requests/serverState.test.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/xrpl/test/integration/requests/serverInfo.test.ts b/packages/xrpl/test/integration/requests/serverInfo.test.ts index 465301abd6..848f8dab9c 100644 --- a/packages/xrpl/test/integration/requests/serverInfo.test.ts +++ b/packages/xrpl/test/integration/requests/serverInfo.test.ts @@ -125,6 +125,7 @@ describe('server_info (rippled)', function () { 'build_version', 'node_size', 'initial_sync_duration_us', + 'git', ] assert.deepEqual( omit(response.result.info, removeKeys), diff --git a/packages/xrpl/test/integration/requests/serverState.test.ts b/packages/xrpl/test/integration/requests/serverState.test.ts index a5ceeee31e..9848a803b0 100644 --- a/packages/xrpl/test/integration/requests/serverState.test.ts +++ b/packages/xrpl/test/integration/requests/serverState.test.ts @@ -116,6 +116,7 @@ describe('server_state', function () { 'node_size', 'initial_sync_duration_us', 'ports', + 'git', ] assert.deepEqual( omit(response.result.state, removeKeys), From 0bc8a106b19c9312f7fbd823b1a3c422f1a0081e Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 6 Feb 2025 14:55:16 -0800 Subject: [PATCH 12/12] clean up --- .../tools/generateDefinitions.js | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/packages/ripple-binary-codec/tools/generateDefinitions.js b/packages/ripple-binary-codec/tools/generateDefinitions.js index 60b835f53d..adb92a1515 100644 --- a/packages/ripple-binary-codec/tools/generateDefinitions.js +++ b/packages/ripple-binary-codec/tools/generateDefinitions.js @@ -47,14 +47,7 @@ const transactionsMacroFile = readFile( ) const capitalizationExceptions = { - NFTOKEN: 'NFToken', - URITOKEN: 'URIToken', - URI: 'URI', - UNL: 'UNL', XCHAIN: 'XChain', - DID: 'DID', - ID: 'ID', - AMM: 'AMM', } // Translate from rippled string format to what the binary codecs expect @@ -69,16 +62,20 @@ function translate(inp) { ) return inp.replace('UINT', 'Hash') else return inp.replace('UINT', 'UInt') - if (inp == 'OBJECT' || inp == 'ARRAY') - return 'ST' + inp.substr(0, 1).toUpperCase() + inp.substr(1).toLowerCase() - if (inp == 'AMM') return inp - if (inp == 'ACCOUNT') return 'AccountID' - if (inp == 'LEDGERENTRY') return 'LedgerEntry' - if (inp == 'NOTPRESENT') return 'NotPresent' - if (inp == 'PATHSET') return 'PathSet' - if (inp == 'VL') return 'Blob' - if (inp == 'DIR_NODE') return 'DirectoryNode' - if (inp == 'PAYCHAN') return 'PayChannel' + + const nonstandardRenames = { + OBJECT: 'STObject', + ARRAY: 'STArray', + AMM: 'AMM', + ACCOUNT: 'AccountID', + LEDGERENTRY: 'LedgerEntry', + NOTPRESENT: 'NotPresent', + PATHSET: 'PathSet', + VL: 'Blob', + DIR_NODE: 'DirectoryNode', + PAYCHAN: 'PayChannel', + } + if (nonstandardRenames[inp] != null) return nonstandardRenames[inp] const parts = inp.split('_') let result = '' @@ -234,8 +231,6 @@ sfieldHits.sort((a, b) => { const bValue = parseInt(stypeMap[b[2]]) * 2 ** 16 + parseInt(b[3]) return aValue - bValue // Ascending order }) -console.log(stypeMap) -console.log(sfieldHits.map((x) => [x[1], x[2], x[3], x[5]])) for (let x = 0; x < sfieldHits.length; ++x) { addLine(' [') addLine(' "' + sfieldHits[x][1] + '",')