From 906cb050f2479d9b1d462e112d8efce8b2ee3681 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 14 Nov 2024 13:19:09 -0500 Subject: [PATCH 01/16] add definitions.json generation script --- tools/generate_definitions.py | 326 ++++++++++++++++++ .../binarycodec/definitions/definitions.json | 44 +-- 2 files changed, 342 insertions(+), 28 deletions(-) create mode 100644 tools/generate_definitions.py diff --git a/tools/generate_definitions.py b/tools/generate_definitions.py new file mode 100644 index 000000000..00727fbb2 --- /dev/null +++ b/tools/generate_definitions.py @@ -0,0 +1,326 @@ +"""Script to generate the definitions.json file from rippled source code.""" + +import re +import sys + +CAPITALIZATION_EXCEPTIONS = { + "NFTOKEN": "NFToken", + "URITOKEN": "URIToken", + "URI": "URI", + "UNL": "UNL", + "XCHAIN": "XChain", + "DID": "DID", + "ID": "ID", + "AMM": "AMM", +} + +if len(sys.argv) != 2: + print("Usage: python " + sys.argv[0] + " path/to/rippled") + sys.exit(1) + +######################################################################## +# Get all necessary files from rippled +######################################################################## + + +def _read_file(filename: str) -> str: + with open(filename, "r") as f: + return f.read() + + +sfield_h_fn = sys.argv[1] + "/include/xrpl/protocol/SField.h" +sfield_macro_fn = sys.argv[1] + "/include/xrpl/protocol/detail/sfields.macro" +ledger_entries_macro_fn = ( + sys.argv[1] + "/include/xrpl/protocol/detail/ledger_entries.macro" +) +ter_h_fn = sys.argv[1] + "/include/xrpl/protocol/TER.h" +transactions_macro_fn = sys.argv[1] + "/include/xrpl/protocol/detail/transactions.macro" + +sfield_h = _read_file(sfield_h_fn) +sfield_macro_file = _read_file(sfield_macro_fn) +ledger_entries_file = _read_file(ledger_entries_macro_fn) +ter_h = _read_file(ter_h_fn) +transactions_file = _read_file(transactions_macro_fn) + + +# Translate from rippled string format to what the binary codecs expect +def _translate(inp: str) -> str: + if re.match(r"^UINT", inp): + if re.search(r"256|160|128", inp): + return inp.replace("UINT", "Hash") + else: + return inp.replace("UINT", "UInt") + if inp == "OBJECT" or inp == "ARRAY": + return "ST" + inp[0:1].upper() + inp[1:].lower() + 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" + + parts = inp.split("_") + result = "" + for part in parts: + if part in CAPITALIZATION_EXCEPTIONS: + result += CAPITALIZATION_EXCEPTIONS[part] + else: + result += part[0:1].upper() + part[1:].lower() + return result + + +######################################################################## +# Serialized type processing +######################################################################## +print("{") +print(' "TYPES": {') +print(' "Done": -1,') + +type_hits = re.findall( + r"^ *STYPE\(STI_([^ ]*?) *, *([0-9-]+) *\) *\\?$", sfield_h, re.MULTILINE +) +if len(type_hits) == 0: + type_hits = re.findall( + r"^ *STI_([^ ]*?) *= *([0-9-]+) *,?$", sfield_h, re.MULTILINE + ) +for x in range(len(type_hits)): + print( + ' "' + + _translate(type_hits[x][0]) + + '": ' + + type_hits[x][1] + + ("," if x < len(type_hits) - 1 else "") + ) + +print(" },") + +######################################################################## +# Ledger entry type processing +######################################################################## +print(' "LEDGER_ENTRY_TYPES": {') +print(' "Any": -3,') +print(' "Child": -2,') +print(' "Invalid": -1,') + + +def _unhex(x: str) -> str: + if (x + "")[0:2] == "0x": + return str(int(x, 16)) + return x + + +lt_hits = re.findall( + r"^ *LEDGER_ENTRY\(lt[A-Z_]+ *, *([x0-9a-f]+) *, *([^,]+), \({$", + ledger_entries_file, + re.MULTILINE, +) +for x in range(len(lt_hits)): + print( + ' "' + + lt_hits[x][1] + + '": ' + + _unhex(lt_hits[x][0]) + + ("," if x < len(lt_hits) - 1 else "") + ) +print(" },") + +######################################################################## +# SField processing +######################################################################## +print(' "FIELDS": [') +# The ones that are harder to parse directly from SField.cpp +print( + """ [ + "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" + } + ],""" +) + + +def _is_vl_encoded(t: str) -> str: + if t == "VL" or t == "ACCOUNT" or t == "VECTOR256": + return "true" + return "false" + + +def _is_serialized(t: str) -> str: + if t == "LEDGERENTRY" or t == "TRANSACTION" or t == "VALIDATION" or t == "METADATA": + return "false" + return "true" + + +def _is_signing_field(t: str, not_signing_field: str) -> str: + if not_signing_field == "notSigning": + return "false" + if t == "LEDGERENTRY" or t == "TRANSACTION" or t == "VALIDATION" or t == "METADATA": + return "false" + return "true" + + +# Parse SField.cpp for all the SFields and their serialization info +sfield_hits = re.findall( + r"^ *[A-Z]*TYPED_SFIELD *\( *sf([^,\n]*),[ \n]*([^, \n]+)[ \n]*,[ \n]*" + r"([0-9]+)(,.*?(notSigning))?", + sfield_macro_file, + re.MULTILINE, +) +for x in range(len(sfield_hits)): + print(" [") + print(' "' + sfield_hits[x][0] + '",') + print(" {") + print(' "nth": ' + sfield_hits[x][2] + ",") + print(' "isVLEncoded": ' + _is_vl_encoded(sfield_hits[x][1]) + ",") + print(' "isSerialized": ' + _is_serialized(sfield_hits[x][1]) + ",") + print( + ' "isSigningField": ' + + _is_signing_field(sfield_hits[x][1], sfield_hits[x][4]) + + "," + ) + print(' "type": "' + _translate(sfield_hits[x][1]) + '"') + print(" }") + print(" ]" + ("," if x < len(sfield_hits) - 1 else "")) + +print(" ],") + +######################################################################## +# TER code processing +######################################################################## +print(' "TRANSACTION_RESULTS": {') +ter_h = str(ter_h).replace("[[maybe_unused]]", "") + +ter_code_hits = re.findall( + r"^ *((tel|tem|tef|ter|tes|tec)[A-Z_]+)( *= *([0-9-]+))? *,? *(\/\/[^\n]*)?$", + ter_h, + re.MULTILINE, +) +upto = -1 +last = "" + +for x in range(len(ter_code_hits)): + if ter_code_hits[x][3] != "": + upto = int(ter_code_hits[x][3]) + + current = ter_code_hits[x][1] + if current != last and last != "": + print("") + pass + last = current + + print( + ' "' + + ter_code_hits[x][0] + + '": ' + + str(upto) + + ("," if x < len(ter_code_hits) - 1 else "") + ) + + upto += 1 + +print(" },") + +######################################################################## +# Transaction type processing +######################################################################## +print(' "TRANSACTION_TYPES": {') +print(' "Invalid": -1,') + +tx_hits = re.findall( + r"^ *TRANSACTION\(tt[A-Z_]+ *,* ([0-9]+) *, *([A-Za-z]+).*$", + transactions_file, + re.MULTILINE, +) +for x in range(len(tx_hits)): + print( + ' "' + + tx_hits[x][1] + + '": ' + + tx_hits[x][0] + + ("," if x < len(tx_hits) - 1 else "") + ) + +print(" }") +print("}") diff --git a/xrpl/core/binarycodec/definitions/definitions.json b/xrpl/core/binarycodec/definitions/definitions.json index 797be9ce2..89f1deb49 100644 --- a/xrpl/core/binarycodec/definitions/definitions.json +++ b/xrpl/core/binarycodec/definitions/definitions.json @@ -30,34 +30,31 @@ "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": [ [ @@ -2759,7 +2756,6 @@ "telREQUIRES_NETWORK_ID": -385, "telNETWORK_ID_MAKES_TX_NON_CANONICAL": -384, "telENV_RPC_FAILED": -383, - "temMALFORMED": -299, "temBAD_AMOUNT": -298, "temBAD_CURRENCY": -297, @@ -2808,7 +2804,6 @@ "temEMPTY_DID": -254, "temARRAY_EMPTY": -253, "temARRAY_TOO_LARGE": -252, - "tefFAILURE": -199, "tefALREADY": -198, "tefBAD_ADD_AUTH": -197, @@ -2830,7 +2825,6 @@ "tefTOO_BIG": -181, "tefNO_TICKET": -180, "tefNFTOKEN_IS_NOT_TRANSFERABLE": -179, - "terRETRY": -99, "terFUNDS_SPENT": -98, "terINSUF_FEE_B": -97, @@ -2844,9 +2838,7 @@ "terQUEUED": -89, "terPRE_TICKET": -88, "terNO_AMM": -87, - "tesSUCCESS": 0, - "tecCLAIM": 100, "tecPATH_PARTIAL": 101, "tecUNFUNDED_ADD": 102, @@ -2933,12 +2925,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 +2938,6 @@ "DepositPreauth": 19, "TrustSet": 20, "AccountDelete": 21, - "SetHook": 22, "NFTokenMint": 25, "NFTokenBurn": 26, "NFTokenCreateOffer": 27, From 4474908756beb9dfcfa9a3500f3077ed5f58c930 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Wed, 20 Nov 2024 15:22:49 -0500 Subject: [PATCH 02/16] fix model generation --- tools/generate_tx_models.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tools/generate_tx_models.py b/tools/generate_tx_models.py index 28b0dcbef..2331d571b 100644 --- a/tools/generate_tx_models.py +++ b/tools/generate_tx_models.py @@ -26,10 +26,12 @@ def _parse_rippled_source( folder: str, ) -> Tuple[Dict[str, List[str]], Dict[str, List[Tuple[str, ...]]]]: # Get SFields - sfield_cpp = _read_file(os.path.join(folder, "src/ripple/protocol/impl/SField.cpp")) + sfield_cpp = _read_file( + os.path.join(folder, "include/xrpl/protocol/detail/sfields.macro") + ) sfield_hits = re.findall( - r'^ *CONSTRUCT_[^\_]+_SFIELD *\( *[^,\n]*,[ \n]*"([^\"\n ]+)"[ \n]*,[ \n]*' - + r"([^, \n]+)[ \n]*,[ \n]*([0-9]+)(,.*?(notSigning))?", + r"^ *[A-Z]*TYPED_SFIELD *\( *sf([^,\n]*),[ \n]*([^, \n]+)[ \n]*,[ \n]*([0-9]+)" + + r"(,.*?(notSigning))?", sfield_cpp, re.MULTILINE, ) @@ -37,11 +39,12 @@ def _parse_rippled_source( # Get TxFormats tx_formats_cpp = _read_file( - os.path.join(folder, "src/ripple/protocol/impl/TxFormats.cpp") + os.path.join(folder, "include/xrpl/protocol/detail/transactions.macro") ) tx_formats_hits = re.findall( - r"^ *add\(jss::([^\"\n, ]+),[ \n]*tt[A-Z_]+,[ \n]*{[ \n]*(({sf[A-Za-z0-9]+, " - + r"soe(OPTIONAL|REQUIRED|DEFAULT)},[ \n]+)*)},[ \n]*[pseudocC]+ommonFields\);", + r"^ *TRANSACTION\(tt[A-Z_]+ *,* [0-9]+ *, *([A-Za-z]+)[ \n]*,[ \n]*\({[ \n]*" + + r"(({sf[A-Za-z0-9]+, soe(OPTIONAL|REQUIRED|DEFAULT)" + + r"(, soeMPT(None|Supported|NotSupported))?},[ \n]+)*)}\)\)$", tx_formats_cpp, re.MULTILINE, ) @@ -57,6 +60,7 @@ def _parse_rippled_source( "UINT64": "Union[int, str]", "UINT128": "str", "UINT160": "str", + "UINT192": "str", "UINT256": "str", "AMOUNT": "Amount", "VL": "str", From 76897e9766e35d2968ac583bb1704b4a2abad983 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Fri, 20 Dec 2024 15:02:07 -0800 Subject: [PATCH 03/16] fix Hash192 --- tools/generate_definitions.py | 2 +- xrpl/core/binarycodec/definitions/definitions.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/generate_definitions.py b/tools/generate_definitions.py index 00727fbb2..f9c829a8d 100644 --- a/tools/generate_definitions.py +++ b/tools/generate_definitions.py @@ -46,7 +46,7 @@ def _read_file(filename: str) -> str: # Translate from rippled string format to what the binary codecs expect def _translate(inp: str) -> str: if re.match(r"^UINT", inp): - if re.search(r"256|160|128", inp): + if re.search(r"256|160|128|192", inp): return inp.replace("UINT", "Hash") else: return inp.replace("UINT", "UInt") diff --git a/xrpl/core/binarycodec/definitions/definitions.json b/xrpl/core/binarycodec/definitions/definitions.json index 512091d65..8855a8b01 100644 --- a/xrpl/core/binarycodec/definitions/definitions.json +++ b/xrpl/core/binarycodec/definitions/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" } ], [ From fe906c6979444aca947a5d069e0a1049f258aa59 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Wed, 5 Feb 2025 18:30:15 -0800 Subject: [PATCH 04/16] update script to follow server_definitions format --- tools/generate_definitions.py | 197 +- .../binarycodec/definitions/definitions.json | 2482 +++++++++-------- 2 files changed, 1380 insertions(+), 1299 deletions(-) diff --git a/tools/generate_definitions.py b/tools/generate_definitions.py index 390c5d0e1..e15896b3e 100644 --- a/tools/generate_definitions.py +++ b/tools/generate_definitions.py @@ -77,149 +77,87 @@ def _translate(inp: str) -> str: return result -######################################################################## -# Serialized type processing -######################################################################## +# start print("{") -print(' "TYPES": {') -print(' "Done": -1,') - -type_hits = re.findall( - r"^ *STYPE\(STI_([^ ]*?) *, *([0-9-]+) *\) *\\?$", sfield_h, re.MULTILINE -) -if len(type_hits) == 0: - type_hits = re.findall( - r"^ *STI_([^ ]*?) *= *([0-9-]+) *,?$", sfield_h, re.MULTILINE - ) -for x in range(len(type_hits)): - print( - ' "' - + _translate(type_hits[x][0]) - + '": ' - + type_hits[x][1] - + ("," if x < len(type_hits) - 1 else "") - ) - -print(" },") - -######################################################################## -# Ledger entry type processing -######################################################################## -print(' "LEDGER_ENTRY_TYPES": {') -print(' "Any": -3,') -print(' "Child": -2,') -print(' "Invalid": -1,') - - -def _unhex(x: str) -> str: - if (x + "")[0:2] == "0x": - return str(int(x, 16)) - return x - - -lt_hits = re.findall( - r"^ *LEDGER_ENTRY[A-Z_]*\(lt[A-Z_]+ *, *([x0-9a-f]+) *, *([^,]+), *([^,]+), \({$", - ledger_entries_file, - re.MULTILINE, -) -for x in range(len(lt_hits)): - print( - ' "' - + lt_hits[x][1] - + '": ' - + _unhex(lt_hits[x][0]) - + ("," if x < len(lt_hits) - 1 else "") - ) -print(" },") ######################################################################## # SField processing ######################################################################## print(' "FIELDS": [') + # The ones that are harder to parse directly from SField.cpp print( """ [ "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" } ],""" ) +type_hits = re.findall( + r"^ *STYPE\(STI_([^ ]*?) *, *([0-9-]+) *\) *\\?$", sfield_h, re.MULTILINE +) +if len(type_hits) == 0: + type_hits = re.findall( + r"^ *STI_([^ ]*?) *= *([0-9-]+) *,?$", sfield_h, re.MULTILINE + ) +type_map = {x[0]: x[1] for x in type_hits} + def _is_vl_encoded(t: str) -> str: if t == "VL" or t == "ACCOUNT" or t == "VECTOR256": @@ -227,9 +165,11 @@ def _is_vl_encoded(t: str) -> str: return "false" -def _is_serialized(t: str) -> str: +def _is_serialized(t: str, name: str) -> str: if t == "LEDGERENTRY" or t == "TRANSACTION" or t == "VALIDATION" or t == "METADATA": return "false" + if name == "hash" or name == "index": + return "false" return "true" @@ -248,24 +188,62 @@ def _is_signing_field(t: str, not_signing_field: str) -> str: sfield_macro_file, re.MULTILINE, ) +sfield_hits += [ + ("hash", "UINT256", "257", "", "notSigning"), + ("index", "UINT256", "258", "", "notSigning"), +] +sfield_hits.sort(key=lambda x: int(type_map[x[1]]) * 2**16 + int(x[2])) for x in range(len(sfield_hits)): print(" [") print(' "' + sfield_hits[x][0] + '",') print(" {") - print(' "nth": ' + sfield_hits[x][2] + ",") - print(' "isVLEncoded": ' + _is_vl_encoded(sfield_hits[x][1]) + ",") - print(' "isSerialized": ' + _is_serialized(sfield_hits[x][1]) + ",") + print( + ' "isSerialized": ' + + _is_serialized(sfield_hits[x][1], sfield_hits[x][0]) + + "," + ) print( ' "isSigningField": ' + _is_signing_field(sfield_hits[x][1], sfield_hits[x][4]) + "," ) + print(' "isVLEncoded": ' + _is_vl_encoded(sfield_hits[x][1]) + ",") + print(' "nth": ' + sfield_hits[x][2] + ",") print(' "type": "' + _translate(sfield_hits[x][1]) + '"') print(" }") print(" ]" + ("," if x < len(sfield_hits) - 1 else "")) print(" ],") +######################################################################## +# Ledger entry type processing +######################################################################## +print(' "LEDGER_ENTRY_TYPES": {') + + +def _unhex(x: str) -> str: + if (x + "")[0:2] == "0x": + return str(int(x, 16)) + return x + + +lt_hits = re.findall( + r"^ *LEDGER_ENTRY[A-Z_]*\(lt[A-Z_]+ *, *([x0-9a-f]+) *, *([^,]+), *([^,]+), \({$", + ledger_entries_file, + re.MULTILINE, +) +lt_hits.append(("-1", "Invalid")) +lt_hits.sort(key=lambda x: x[1]) +for x in range(len(lt_hits)): + print( + ' "' + + lt_hits[x][1] + + '": ' + + _unhex(lt_hits[x][0]) + + ("," if x < len(lt_hits) - 1 else "") + ) +print(" },") + ######################################################################## # TER code processing ######################################################################## @@ -277,6 +255,7 @@ def _is_signing_field(t: str, not_signing_field: str) -> str: ter_h, re.MULTILINE, ) +ter_codes = [] upto = -1 last = "" @@ -286,33 +265,43 @@ def _is_signing_field(t: str, not_signing_field: str) -> str: current = ter_code_hits[x][1] if current != last and last != "": - print("") pass last = current + ter_codes.append((ter_code_hits[x][0], upto)) + + upto += 1 + +ter_codes.sort(key=lambda x: x[0]) +current_type = "" +for x in range(len(ter_codes)): + if current_type == "": + current_type = ter_codes[x][0][:3] + elif current_type != ter_codes[x][0][:3]: + print("") + current_type = ter_codes[x][0][:3] print( ' "' - + ter_code_hits[x][0] + + ter_codes[x][0] + '": ' - + str(upto) - + ("," if x < len(ter_code_hits) - 1 else "") + + str(ter_codes[x][1]) + + ("," if x < len(ter_codes) - 1 else "") ) - upto += 1 - print(" },") ######################################################################## # Transaction type processing ######################################################################## print(' "TRANSACTION_TYPES": {') -print(' "Invalid": -1,') tx_hits = re.findall( r"^ *TRANSACTION\(tt[A-Z_]+ *,* ([0-9]+) *, *([A-Za-z]+).*$", transactions_file, re.MULTILINE, ) +tx_hits.append(("-1", "Invalid")) +tx_hits.sort(key=lambda x: x[1]) for x in range(len(tx_hits)): print( ' "' @@ -322,5 +311,23 @@ def _is_signing_field(t: str, not_signing_field: str) -> str: + ("," if x < len(tx_hits) - 1 else "") ) +print(" },") + +######################################################################## +# Serialized type processing +######################################################################## +print(' "TYPES": {') + +type_hits.append(("DONE", "-1")) +type_hits.sort(key=lambda x: _translate(x[0])) +for x in range(len(type_hits)): + print( + ' "' + + _translate(type_hits[x][0]) + + '": ' + + type_hits[x][1] + + ("," if x < len(type_hits) - 1 else "") + ) + print(" }") print("}") diff --git a/xrpl/core/binarycodec/definitions/definitions.json b/xrpl/core/binarycodec/definitions/definitions.json index 8855a8b01..e06ebcf3c 100644 --- a/xrpl/core/binarycodec/definitions/definitions.json +++ b/xrpl/core/binarycodec/definitions/definitions.json @@ -1,3161 +1,3235 @@ { - "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, + "isSerialized": true, + "isSigningField": true, "isVLEncoded": false, + "nth": 34, + "type": "Hash256" + } + ], + [ + "ParentBatchID", + { "isSerialized": true, "isSigningField": true, - "type": "Number" + "isVLEncoded": false, + "nth": 35, + "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, - "type": "Amount" + "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", - { - "nth": 3, - "isVLEncoded": true, - "isSerialized": true, - "isSigningField": true, - "type": "Vector256" - } - ], - [ - "NFTokenOffers", - { - "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", + "CreatedNode", { - "nth": 1, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "XChainBridge" - } - ], - [ - "TransactionMetaData", - { - "nth": 2, "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "STObject" - } - ], - [ - "CreatedNode", - { "nth": 3, - "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, "type": "STObject" } ], [ "DeletedNode", { - "nth": 4, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 4, "type": "STObject" } ], [ "ModifiedNode", { - "nth": 5, - "isVLEncoded": false, "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 5, "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", { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, "nth": 33, + "type": "STObject" + } + ], + [ + "RawTransaction", + { + "isSerialized": true, + "isSigningField": true, "isVLEncoded": false, + "nth": 34, + "type": "STObject" + } + ], + [ + "BatchSigner", + { "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 35, "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", { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, "nth": 27, + "type": "STArray" + } + ], + [ + "AcceptedCredentials", + { + "isSerialized": true, + "isSigningField": true, "isVLEncoded": false, + "nth": 28, + "type": "STArray" + } + ], + [ + "RawTransactions", + { "isSerialized": true, "isSigningField": true, + "isVLEncoded": false, + "nth": 29, "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, + ], + [ + "BatchSigners", + { + "isSerialized": true, + "isSigningField": false, + "isVLEncoded": false, + "nth": 30, + "type": "STArray" + } + ], + [ + "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_PROOF_UNKNOWN_KEY": 174, + "tecXCHAIN_CREATE_ACCOUNT_DISABLED": 186, "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_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_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 + "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, + "temINVALID_INNER_BATCH": -250, + "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": { - "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, + "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, + "Batch": 64, + "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 } } From 5ab6aad2c57446b1c509db0b50c9a8f26fc3b27e Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Wed, 5 Feb 2025 18:32:56 -0800 Subject: [PATCH 05/16] oops wrong branch --- .../binarycodec/definitions/definitions.json | 52 ------------------- 1 file changed, 52 deletions(-) diff --git a/xrpl/core/binarycodec/definitions/definitions.json b/xrpl/core/binarycodec/definitions/definitions.json index e06ebcf3c..bc86c2c19 100644 --- a/xrpl/core/binarycodec/definitions/definitions.json +++ b/xrpl/core/binarycodec/definitions/definitions.json @@ -1260,16 +1260,6 @@ "type": "Hash256" } ], - [ - "ParentBatchID", - { - "isSerialized": true, - "isSigningField": true, - "isVLEncoded": false, - "nth": 35, - "type": "Hash256" - } - ], [ "hash", { @@ -2350,26 +2340,6 @@ "type": "STObject" } ], - [ - "RawTransaction", - { - "isSerialized": true, - "isSigningField": true, - "isVLEncoded": false, - "nth": 34, - "type": "STObject" - } - ], - [ - "BatchSigner", - { - "isSerialized": true, - "isSigningField": true, - "isVLEncoded": false, - "nth": 35, - "type": "STObject" - } - ], [ "Signers", { @@ -2590,26 +2560,6 @@ "type": "STArray" } ], - [ - "RawTransactions", - { - "isSerialized": true, - "isSigningField": true, - "isVLEncoded": false, - "nth": 29, - "type": "STArray" - } - ], - [ - "BatchSigners", - { - "isSerialized": true, - "isSigningField": false, - "isVLEncoded": false, - "nth": 30, - "type": "STArray" - } - ], [ "CloseResolution", { @@ -3109,7 +3059,6 @@ "temINVALID_ACCOUNT_ID": -268, "temINVALID_COUNT": -266, "temINVALID_FLAG": -276, - "temINVALID_INNER_BATCH": -250, "temMALFORMED": -299, "temREDUNDANT": -275, "temRIPPLE_EMPTY": -274, @@ -3149,7 +3098,6 @@ "AMMWithdraw": 37, "AccountDelete": 21, "AccountSet": 3, - "Batch": 64, "CheckCancel": 18, "CheckCash": 17, "CheckCreate": 16, From 8efdc44dbc1f73017da0cbc88f6b0faf3ae3c23e Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Wed, 5 Feb 2025 21:46:16 -0800 Subject: [PATCH 06/16] add basic Github support --- tools/generate_definitions.py | 47 ++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/tools/generate_definitions.py b/tools/generate_definitions.py index e15896b3e..ddb53d6e7 100644 --- a/tools/generate_definitions.py +++ b/tools/generate_definitions.py @@ -3,6 +3,8 @@ import re import sys +import httpx + CAPITALIZATION_EXCEPTIONS = { "NFTOKEN": "NFToken", "URITOKEN": "URIToken", @@ -16,6 +18,9 @@ if len(sys.argv) != 2: print("Usage: python " + sys.argv[0] + " path/to/rippled") + print( + "Usage: python " + sys.argv[0] + " github.com/user/rippled/tree/feature-branch" + ) sys.exit(1) ######################################################################## @@ -23,24 +28,32 @@ ######################################################################## -def _read_file(filename: str) -> str: - with open(filename, "r") as f: +def _read_file_from_github(repo: str, filename: str) -> str: + url = repo.replace("github.com", "raw.githubusercontent.com") + url = url.replace("tree", "refs/heads") + url += filename + if not url.startswith("http"): + url = "https://" + url + response = httpx.get(url) + return response.text + + +def _read_file(folder: str, filename: str) -> str: + with open(folder + filename, "r") as f: return f.read() -sfield_h_fn = sys.argv[1] + "/include/xrpl/protocol/SField.h" -sfield_macro_fn = sys.argv[1] + "/include/xrpl/protocol/detail/sfields.macro" -ledger_entries_macro_fn = ( - sys.argv[1] + "/include/xrpl/protocol/detail/ledger_entries.macro" -) -ter_h_fn = sys.argv[1] + "/include/xrpl/protocol/TER.h" -transactions_macro_fn = sys.argv[1] + "/include/xrpl/protocol/detail/transactions.macro" +func = _read_file_from_github if "github.com" in sys.argv[1] else _read_file -sfield_h = _read_file(sfield_h_fn) -sfield_macro_file = _read_file(sfield_macro_fn) -ledger_entries_file = _read_file(ledger_entries_macro_fn) -ter_h = _read_file(ter_h_fn) -transactions_file = _read_file(transactions_macro_fn) +sfield_h = func(sys.argv[1], "/include/xrpl/protocol/SField.h") +sfield_macro_file = func(sys.argv[1], "/include/xrpl/protocol/detail/sfields.macro") +ledger_entries_file = func( + sys.argv[1], "/include/xrpl/protocol/detail/ledger_entries.macro" +) +ter_h = func(sys.argv[1], "/include/xrpl/protocol/TER.h") +transactions_file = func( + sys.argv[1], "/include/xrpl/protocol/detail/transactions.macro" +) # Translate from rippled string format to what the binary codecs expect @@ -257,16 +270,10 @@ def _unhex(x: str) -> str: ) ter_codes = [] upto = -1 -last = "" for x in range(len(ter_code_hits)): if ter_code_hits[x][3] != "": upto = int(ter_code_hits[x][3]) - - current = ter_code_hits[x][1] - if current != last and last != "": - pass - last = current ter_codes.append((ter_code_hits[x][0], upto)) upto += 1 From b31251f55d98fc0a05f25ccbf641ebf4426eca0e Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Wed, 5 Feb 2025 21:56:16 -0800 Subject: [PATCH 07/16] pipe automatically to file --- tools/generate_definitions.py | 86 ++++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 31 deletions(-) diff --git a/tools/generate_definitions.py b/tools/generate_definitions.py index ddb53d6e7..99a1ab2f2 100644 --- a/tools/generate_definitions.py +++ b/tools/generate_definitions.py @@ -1,5 +1,6 @@ """Script to generate the definitions.json file from rippled source code.""" +import os import re import sys @@ -16,10 +17,12 @@ "AMM": "AMM", } -if len(sys.argv) != 2: - print("Usage: python " + sys.argv[0] + " path/to/rippled") +if len(sys.argv) != 2 and len(sys.argv) != 3: + print("Usage: python " + sys.argv[0] + " path/to/rippled [path/to/pipe/to]") print( - "Usage: python " + sys.argv[0] + " github.com/user/rippled/tree/feature-branch" + "Usage: python " + + sys.argv[0] + + " github.com/user/rippled/tree/feature-branch [path/to/pipe/to]" ) sys.exit(1) @@ -90,16 +93,24 @@ def _translate(inp: str) -> str: return result +output = "" + + +def _add_line(line: str) -> None: + global output + output += line + "\n" + + # start -print("{") +_add_line("{") ######################################################################## # SField processing ######################################################################## -print(' "FIELDS": [') +_add_line(' "FIELDS": [') # The ones that are harder to parse directly from SField.cpp -print( +_add_line( """ [ "Generic", { @@ -207,31 +218,31 @@ def _is_signing_field(t: str, not_signing_field: str) -> str: ] sfield_hits.sort(key=lambda x: int(type_map[x[1]]) * 2**16 + int(x[2])) for x in range(len(sfield_hits)): - print(" [") - print(' "' + sfield_hits[x][0] + '",') - print(" {") - print( + _add_line(" [") + _add_line(' "' + sfield_hits[x][0] + '",') + _add_line(" {") + _add_line( ' "isSerialized": ' + _is_serialized(sfield_hits[x][1], sfield_hits[x][0]) + "," ) - print( + _add_line( ' "isSigningField": ' + _is_signing_field(sfield_hits[x][1], sfield_hits[x][4]) + "," ) - print(' "isVLEncoded": ' + _is_vl_encoded(sfield_hits[x][1]) + ",") - print(' "nth": ' + sfield_hits[x][2] + ",") - print(' "type": "' + _translate(sfield_hits[x][1]) + '"') - print(" }") - print(" ]" + ("," if x < len(sfield_hits) - 1 else "")) + _add_line(' "isVLEncoded": ' + _is_vl_encoded(sfield_hits[x][1]) + ",") + _add_line(' "nth": ' + sfield_hits[x][2] + ",") + _add_line(' "type": "' + _translate(sfield_hits[x][1]) + '"') + _add_line(" }") + _add_line(" ]" + ("," if x < len(sfield_hits) - 1 else "")) -print(" ],") +_add_line(" ],") ######################################################################## # Ledger entry type processing ######################################################################## -print(' "LEDGER_ENTRY_TYPES": {') +_add_line(' "LEDGER_ENTRY_TYPES": {') def _unhex(x: str) -> str: @@ -248,19 +259,19 @@ def _unhex(x: str) -> str: lt_hits.append(("-1", "Invalid")) lt_hits.sort(key=lambda x: x[1]) for x in range(len(lt_hits)): - print( + _add_line( ' "' + lt_hits[x][1] + '": ' + _unhex(lt_hits[x][0]) + ("," if x < len(lt_hits) - 1 else "") ) -print(" },") +_add_line(" },") ######################################################################## # TER code processing ######################################################################## -print(' "TRANSACTION_RESULTS": {') +_add_line(' "TRANSACTION_RESULTS": {') ter_h = str(ter_h).replace("[[maybe_unused]]", "") ter_code_hits = re.findall( @@ -284,10 +295,10 @@ def _unhex(x: str) -> str: if current_type == "": current_type = ter_codes[x][0][:3] elif current_type != ter_codes[x][0][:3]: - print("") + _add_line("") current_type = ter_codes[x][0][:3] - print( + _add_line( ' "' + ter_codes[x][0] + '": ' @@ -295,12 +306,12 @@ def _unhex(x: str) -> str: + ("," if x < len(ter_codes) - 1 else "") ) -print(" },") +_add_line(" },") ######################################################################## # Transaction type processing ######################################################################## -print(' "TRANSACTION_TYPES": {') +_add_line(' "TRANSACTION_TYPES": {') tx_hits = re.findall( r"^ *TRANSACTION\(tt[A-Z_]+ *,* ([0-9]+) *, *([A-Za-z]+).*$", @@ -310,7 +321,7 @@ def _unhex(x: str) -> str: tx_hits.append(("-1", "Invalid")) tx_hits.sort(key=lambda x: x[1]) for x in range(len(tx_hits)): - print( + _add_line( ' "' + tx_hits[x][1] + '": ' @@ -318,17 +329,17 @@ def _unhex(x: str) -> str: + ("," if x < len(tx_hits) - 1 else "") ) -print(" },") +_add_line(" },") ######################################################################## # Serialized type processing ######################################################################## -print(' "TYPES": {') +_add_line(' "TYPES": {') type_hits.append(("DONE", "-1")) type_hits.sort(key=lambda x: _translate(x[0])) for x in range(len(type_hits)): - print( + _add_line( ' "' + _translate(type_hits[x][0]) + '": ' @@ -336,5 +347,18 @@ def _unhex(x: str) -> str: + ("," if x < len(type_hits) - 1 else "") ) -print(" }") -print("}") +_add_line(" }") +_add_line("}") + + +if len(sys.argv) == 3: + output_file = sys.argv[2] +else: + output_file = os.path.join( + os.path.dirname(__file__), + "../xrpl/core/binarycodec/definitions/definitions.json", + ) + +with open(output_file, "w") as f: + f.write(output) +print("File written successfully to " + output_file) From a072e49fdfb18906d6f64315f4fb5e11946e8e43 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Wed, 5 Feb 2025 22:03:12 -0800 Subject: [PATCH 08/16] add Github support to model generation --- tools/generate_tx_models.py | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/tools/generate_tx_models.py b/tools/generate_tx_models.py index 2331d571b..d13e6ea01 100644 --- a/tools/generate_tx_models.py +++ b/tools/generate_tx_models.py @@ -5,13 +5,25 @@ import sys from typing import Dict, List, Tuple +import httpx + from xrpl.models.base_model import _key_to_json from xrpl.models.transactions.types.pseudo_transaction_type import PseudoTransactionType from xrpl.models.transactions.types.transaction_type import TransactionType -def _read_file(filename: str) -> str: - with open(filename) as f: +def _read_file_from_github(repo: str, filename: str) -> str: + url = repo.replace("github.com", "raw.githubusercontent.com") + url = url.replace("tree", "refs/heads") + url += "/" + filename + if not url.startswith("http"): + url = "https://" + url + response = httpx.get(url) + return response.text + + +def _read_file(folder: str, filename: str) -> str: + with open(os.path.join(folder, filename), "r") as f: return f.read() @@ -25,22 +37,21 @@ def _format_tx_format(raw_tx_format: str) -> List[Tuple[str, ...]]: def _parse_rippled_source( folder: str, ) -> Tuple[Dict[str, List[str]], Dict[str, List[Tuple[str, ...]]]]: + func = _read_file_from_github if "github.com" in sys.argv[1] else _read_file # Get SFields - sfield_cpp = _read_file( - os.path.join(folder, "include/xrpl/protocol/detail/sfields.macro") - ) + sfield_cpp = func(folder, "include/xrpl/protocol/detail/sfields.macro") sfield_hits = re.findall( - r"^ *[A-Z]*TYPED_SFIELD *\( *sf([^,\n]*),[ \n]*([^, \n]+)[ \n]*,[ \n]*([0-9]+)" - + r"(,.*?(notSigning))?", + ( + r"^ *[A-Z]*TYPED_SFIELD *\( *sf([^,\n]*),[ \n]*([^, \n]+)[ \n]*,[ \n]*" + r"([0-9]+)(,.*?(notSigning))?" + ), sfield_cpp, re.MULTILINE, ) sfields = {hit[0]: hit[1:] for hit in sfield_hits} # Get TxFormats - tx_formats_cpp = _read_file( - os.path.join(folder, "include/xrpl/protocol/detail/transactions.macro") - ) + tx_formats_cpp = func(folder, "include/xrpl/protocol/detail/transactions.macro") tx_formats_hits = re.findall( r"^ *TRANSACTION\(tt[A-Z_]+ *,* [0-9]+ *, *([A-Za-z]+)[ \n]*,[ \n]*\({[ \n]*" + r"(({sf[A-Za-z0-9]+, soe(OPTIONAL|REQUIRED|DEFAULT)" @@ -134,7 +145,7 @@ def _generate_param_line(param: str, is_required: bool) -> str: param_lines.sort(key=lambda x: "REQUIRED" not in x) params = "\n".join(param_lines) model = f"""@require_kwargs_on_init -@dataclass(frozen=True, **KW_ONLY_DATACLASS) +@dataclass(frozen=True, **KW_ONLY_DATACLASS) class {tx}(Transaction): \"\"\"Represents a {tx} transaction.\"\"\" From 98c267dbf339733e4e1c7f78cf1830349ff837cb Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Wed, 5 Feb 2025 22:09:07 -0800 Subject: [PATCH 09/16] add poe script --- pyproject.toml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index f57081b7b..fedd560f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,6 +79,14 @@ test_integration = "coverage run -m unittest discover tests/integration" cmd = "python3 -m unittest ${FILE_PATHS}" args = [{ name = "FILE_PATHS", positional = true, multiple = true }] +[tool.poe.tasks.generate] +help = "Generate the models and definitions for a new amendment" +sequence = [ + { cmd = "python3 tools/generate_definitions.py ${FILE_OR_GITHUB_PATH}" }, + { cmd = "python3 tools/generate_tx_models.py ${FILE_OR_GITHUB_PATH}" }, +] +args = [{ name = "FILE_OR_GITHUB_PATH", positional = true, required = true }] + [tool.poe.tasks.test_coverage] sequence = [ { cmd = "coverage run -m unittest discover" }, From 1dda243bef5c8bc39e0e5da46bb656036f01ce1f Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 6 Feb 2025 15:46:38 -0800 Subject: [PATCH 10/16] clean up --- tools/generate_definitions.py | 58 ++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/tools/generate_definitions.py b/tools/generate_definitions.py index 99a1ab2f2..d195b2a69 100644 --- a/tools/generate_definitions.py +++ b/tools/generate_definitions.py @@ -7,14 +7,7 @@ import httpx CAPITALIZATION_EXCEPTIONS = { - "NFTOKEN": "NFToken", - "URITOKEN": "URIToken", - "URI": "URI", - "UNL": "UNL", "XCHAIN": "XChain", - "DID": "DID", - "ID": "ID", - "AMM": "AMM", } if len(sys.argv) != 2 and len(sys.argv) != 3: @@ -66,22 +59,21 @@ def _translate(inp: str) -> str: return inp.replace("UINT", "Hash") else: return inp.replace("UINT", "UInt") - if inp == "OBJECT" or inp == "ARRAY": - return "ST" + inp[0:1].upper() + inp[1:].lower() - 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" + + non_standard_renames = { + "OBJECT": "STObject", + "ARRAY": "STArray", + "AMM": "AMM", + "ACCOUNT": "AccountID", + "LEDGERENTRY": "LedgerEntry", + "NOTPRESENT": "NotPresent", + "PATHSET": "PathSet", + "VL": "Blob", + "DIR_NODE": "DirectoryNode", + "PAYCHAN": "PayChannel", + } + if inp in non_standard_renames: + return non_standard_renames[inp] parts = inp.split("_") result = "" @@ -96,6 +88,7 @@ def _translate(inp: str) -> str: output = "" +# add a new line of content to the output def _add_line(line: str) -> None: global output output += line + "\n" @@ -173,6 +166,9 @@ def _add_line(line: str) -> None: ],""" ) +# Parse STypes +# Example line: +# STYPE(STI_UINT32, 2) \ type_hits = re.findall( r"^ *STYPE\(STI_([^ ]*?) *, *([0-9-]+) *\) *\\?$", sfield_h, re.MULTILINE ) @@ -180,6 +176,7 @@ def _add_line(line: str) -> None: type_hits = re.findall( r"^ *STI_([^ ]*?) *= *([0-9-]+) *,?$", sfield_h, re.MULTILINE ) +# name-to-value map - needed for SField processing type_map = {x[0]: x[1] for x in type_hits} @@ -206,6 +203,9 @@ def _is_signing_field(t: str, not_signing_field: str) -> str: # Parse SField.cpp for all the SFields and their serialization info +# Example lines: +# TYPED_SFIELD(sfFee, AMOUNT, 8) +# UNTYPED_SFIELD(sfSigners, ARRAY, 3, SField::sMD_Default, SField::notSigning) sfield_hits = re.findall( r"^ *[A-Z]*TYPED_SFIELD *\( *sf([^,\n]*),[ \n]*([^, \n]+)[ \n]*,[ \n]*" r"([0-9]+)(,.*?(notSigning))?", @@ -251,6 +251,9 @@ def _unhex(x: str) -> str: return x +# Parse ledger entries +# Example line: +# LEDGER_ENTRY(ltNFTOKEN_OFFER, 0x0037, NFTokenOffer, nft_offer, ({ lt_hits = re.findall( r"^ *LEDGER_ENTRY[A-Z_]*\(lt[A-Z_]+ *, *([x0-9a-f]+) *, *([^,]+), *([^,]+), \({$", ledger_entries_file, @@ -274,6 +277,7 @@ def _unhex(x: str) -> str: _add_line(' "TRANSACTION_RESULTS": {') ter_h = str(ter_h).replace("[[maybe_unused]]", "") +# Parse TER codes ter_code_hits = re.findall( r"^ *((tel|tem|tef|ter|tes|tec)[A-Z_]+)( *= *([0-9-]+))? *,? *(\/\/[^\n]*)?$", ter_h, @@ -282,16 +286,18 @@ def _unhex(x: str) -> str: ter_codes = [] upto = -1 +# Get the exact values of the TER codes and sort them for x in range(len(ter_code_hits)): if ter_code_hits[x][3] != "": upto = int(ter_code_hits[x][3]) ter_codes.append((ter_code_hits[x][0], upto)) upto += 1 - ter_codes.sort(key=lambda x: x[0]) + current_type = "" for x in range(len(ter_codes)): + # print newline between the different code types if current_type == "": current_type = ter_codes[x][0][:3] elif current_type != ter_codes[x][0][:3]: @@ -313,6 +319,9 @@ def _unhex(x: str) -> str: ######################################################################## _add_line(' "TRANSACTION_TYPES": {') +# Parse transaction types +# Example line: +# TRANSACTION(ttCHECK_CREATE, 16, CheckCreate, ({ tx_hits = re.findall( r"^ *TRANSACTION\(tt[A-Z_]+ *,* ([0-9]+) *, *([A-Za-z]+).*$", transactions_file, @@ -320,6 +329,7 @@ def _unhex(x: str) -> str: ) tx_hits.append(("-1", "Invalid")) tx_hits.sort(key=lambda x: x[1]) + for x in range(len(tx_hits)): _add_line( ' "' From e6c174237fb61a2e1d264ae1bf53ca30e5d781cc Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Fri, 7 Feb 2025 13:13:57 -0800 Subject: [PATCH 11/16] more cleanup --- tools/generate_definitions.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/generate_definitions.py b/tools/generate_definitions.py index d195b2a69..a2dd22308 100644 --- a/tools/generate_definitions.py +++ b/tools/generate_definitions.py @@ -6,10 +6,6 @@ import httpx -CAPITALIZATION_EXCEPTIONS = { - "XCHAIN": "XChain", -} - if len(sys.argv) != 2 and len(sys.argv) != 3: print("Usage: python " + sys.argv[0] + " path/to/rippled [path/to/pipe/to]") print( @@ -71,6 +67,7 @@ def _translate(inp: str) -> str: "VL": "Blob", "DIR_NODE": "DirectoryNode", "PAYCHAN": "PayChannel", + "XCHAIN_BRIDGE": "XChainBridge", } if inp in non_standard_renames: return non_standard_renames[inp] @@ -78,10 +75,7 @@ def _translate(inp: str) -> str: parts = inp.split("_") result = "" for part in parts: - if part in CAPITALIZATION_EXCEPTIONS: - result += CAPITALIZATION_EXCEPTIONS[part] - else: - result += part[0:1].upper() + part[1:].lower() + result += part[0:1].upper() + part[1:].lower() return result From 201820b0e792ab606f84204b700eb47555698091 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Tue, 11 Feb 2025 21:03:45 -0500 Subject: [PATCH 12/16] respond to comments --- CONTRIBUTING.md | 17 ++++++++++------- pyproject.toml | 1 + tools/generate_definitions.py | 36 +++++++++++++++++++++-------------- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 262418473..6950b3357 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -179,16 +179,19 @@ In order to test how a change in docs configuration looks like on ReadTheDocs be Examples can be found in subfolders of [tests/integrations](https://github.com/XRPLF/xrpl-py/tree/main/tests/integration) -## Updating `definitions.json` +## Updating `definitions.json` and models -This should almost always be done using the [`xrpl-codec-gen`](https://github.com/RichardAH/xrpl-codec-gen) script - if the output needs manual intervention afterwards, consider updating the script instead. +To update just the `definitions.json` file: +```bash +poetry run poe definitions https://github.com/XRPLF/rippled/tree/develop +``` -1. Clone / pull the latest changes from [rippled](https://github.com/XRPLF/rippled) - Specifically the `develop` branch is usually the right one. -2. Clone / pull the latest changes from [`xrpl-codec-gen`](https://github.com/RichardAH/xrpl-codec-gen) -3. From the `xrpl-codec-gen` tool, follow the steps in the `README.md` to generate a new `definitions.json` file. -4. Replace the `definitions.json` file in the `ripple-binary-codec` with the newly generated file. -5. Verify that the changes make sense by inspection before submitting, as there may be updates required for the `xrpl-codec-gen` tool depending on the latest amendments we're updating to match. +Any Github branch link or local path to rippled will work here. +To update the models as well: +```bash +poetry run poe generate https://github.com/XRPLF/rippled/tree/develop +``` ## Release process diff --git a/pyproject.toml b/pyproject.toml index be67c9db2..991e1b1e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,6 +78,7 @@ precision = 2 test_unit = "coverage run -m unittest discover tests/unit" test_integration = "coverage run -m unittest discover tests/integration" lint = "poetry run flake8 xrpl tests snippets" +definitions = "poetry run python3 tools/generate_definitions.py" [tool.poe.tasks.test] cmd = "python3 -m unittest ${FILE_PATHS}" diff --git a/tools/generate_definitions.py b/tools/generate_definitions.py index a2dd22308..d6e4842c4 100644 --- a/tools/generate_definitions.py +++ b/tools/generate_definitions.py @@ -3,6 +3,7 @@ import os import re import sys +from pathlib import Path import httpx @@ -21,31 +22,38 @@ def _read_file_from_github(repo: str, filename: str) -> str: + if "tree" not in repo: + repo += "/tree/HEAD" url = repo.replace("github.com", "raw.githubusercontent.com") - url = url.replace("tree", "refs/heads") - url += filename + url = url.replace("tree/", "") + url += "/" + filename if not url.startswith("http"): url = "https://" + url - response = httpx.get(url) - return response.text + try: + response = httpx.get(url) + response.raise_for_status() + return response.text + except httpx.HTTPError as e: + print(f"Error reading {url}: {e}", file=sys.stderr) + sys.exit(1) def _read_file(folder: str, filename: str) -> str: - with open(folder + filename, "r") as f: - return f.read() + file_path = Path(folder) / filename + if not file_path.exists(): + raise FileNotFoundError(f"File not found: {file_path}") + return file_path.read_text() func = _read_file_from_github if "github.com" in sys.argv[1] else _read_file -sfield_h = func(sys.argv[1], "/include/xrpl/protocol/SField.h") -sfield_macro_file = func(sys.argv[1], "/include/xrpl/protocol/detail/sfields.macro") +sfield_h = func(sys.argv[1], "include/xrpl/protocol/SField.h") +sfield_macro_file = func(sys.argv[1], "include/xrpl/protocol/detail/sfields.macro") ledger_entries_file = func( - sys.argv[1], "/include/xrpl/protocol/detail/ledger_entries.macro" -) -ter_h = func(sys.argv[1], "/include/xrpl/protocol/TER.h") -transactions_file = func( - sys.argv[1], "/include/xrpl/protocol/detail/transactions.macro" + sys.argv[1], "include/xrpl/protocol/detail/ledger_entries.macro" ) +ter_h = func(sys.argv[1], "include/xrpl/protocol/TER.h") +transactions_file = func(sys.argv[1], "include/xrpl/protocol/detail/transactions.macro") # Translate from rippled string format to what the binary codecs expect @@ -240,7 +248,7 @@ def _is_signing_field(t: str, not_signing_field: str) -> str: def _unhex(x: str) -> str: - if (x + "")[0:2] == "0x": + if x[0:2] == "0x": return str(int(x, 16)) return x From b059f4480707f1ad859e7753fef623728fd8297c Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Wed, 12 Feb 2025 12:43:48 -0500 Subject: [PATCH 13/16] remove unneeded rename --- tools/generate_definitions.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/generate_definitions.py b/tools/generate_definitions.py index d6e4842c4..329b988aa 100644 --- a/tools/generate_definitions.py +++ b/tools/generate_definitions.py @@ -67,7 +67,6 @@ def _translate(inp: str) -> str: non_standard_renames = { "OBJECT": "STObject", "ARRAY": "STArray", - "AMM": "AMM", "ACCOUNT": "AccountID", "LEDGERENTRY": "LedgerEntry", "NOTPRESENT": "NotPresent", From b6ba563a09259a36fdc5f507bd6b8b9d4587675c Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Wed, 12 Feb 2025 18:53:13 -0500 Subject: [PATCH 14/16] change wording --- tools/generate_definitions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/generate_definitions.py b/tools/generate_definitions.py index 329b988aa..8f9490d5e 100644 --- a/tools/generate_definitions.py +++ b/tools/generate_definitions.py @@ -8,7 +8,7 @@ import httpx if len(sys.argv) != 2 and len(sys.argv) != 3: - print("Usage: python " + sys.argv[0] + " path/to/rippled [path/to/pipe/to]") + print("Usage: python " + sys.argv[0] + " path/to/rippled [path/to/output/file]") print( "Usage: python " + sys.argv[0] From 561c38816b045e1738a28fe59efcb715cd4bb10c Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Wed, 12 Feb 2025 18:58:09 -0500 Subject: [PATCH 15/16] fix wording --- tools/generate_definitions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/generate_definitions.py b/tools/generate_definitions.py index 8f9490d5e..250b1d9ee 100644 --- a/tools/generate_definitions.py +++ b/tools/generate_definitions.py @@ -12,7 +12,7 @@ print( "Usage: python " + sys.argv[0] - + " github.com/user/rippled/tree/feature-branch [path/to/pipe/to]" + + " github.com/user/rippled/tree/feature-branch [path/to/output/file]" ) sys.exit(1) From ee68c0a0be0537684a9de7260b9f6e130a12f4c0 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Thu, 13 Feb 2025 13:16:35 -0500 Subject: [PATCH 16/16] respond to comments --- tools/generate_definitions.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/generate_definitions.py b/tools/generate_definitions.py index 250b1d9ee..8355559cd 100644 --- a/tools/generate_definitions.py +++ b/tools/generate_definitions.py @@ -173,10 +173,6 @@ def _add_line(line: str) -> None: type_hits = re.findall( r"^ *STYPE\(STI_([^ ]*?) *, *([0-9-]+) *\) *\\?$", sfield_h, re.MULTILINE ) -if len(type_hits) == 0: - type_hits = re.findall( - r"^ *STI_([^ ]*?) *= *([0-9-]+) *,?$", sfield_h, re.MULTILINE - ) # name-to-value map - needed for SField processing type_map = {x[0]: x[1] for x in type_hits} @@ -256,7 +252,8 @@ def _unhex(x: str) -> str: # Example line: # LEDGER_ENTRY(ltNFTOKEN_OFFER, 0x0037, NFTokenOffer, nft_offer, ({ lt_hits = re.findall( - r"^ *LEDGER_ENTRY[A-Z_]*\(lt[A-Z_]+ *, *([x0-9a-f]+) *, *([^,]+), *([^,]+), \({$", + r"^ *LEDGER_ENTRY[A-Z_]*\(lt[A-Z_]+ *, *([xX0-9a-fA-F]+) *, *([^,]+), *([^,]+), " + r"\({$", ledger_entries_file, re.MULTILINE, )