diff --git a/src/core/definitions/definitions.json b/src/core/definitions/definitions.json index 1ffda30c..bbe1a7dd 100644 --- a/src/core/definitions/definitions.json +++ b/src/core/definitions/definitions.json @@ -1,29 +1,35 @@ { "TYPES": { - "Validation": 10003, "Done": -1, + "Unknown": -2, + "NotPresent": 0, + "UInt16": 1, + "UInt32": 2, + "UInt64": 3, "Hash128": 4, + "Hash256": 5, + "Amount": 6, "Blob": 7, "AccountID": 8, - "Amount": 6, - "Hash256": 5, - "UInt8": 16, - "Vector256": 19, "STObject": 14, - "Unknown": -2, - "Transaction": 10001, + "STArray": 15, + "UInt8": 16, "Hash160": 17, "PathSet": 18, + "Vector256": 19, + "UInt96": 20, + "UInt192": 21, + "UInt384": 22, + "UInt512": 23, + "Issue": 24, + "XChainBridge": 25, + "Currency": 26, + "Transaction": 10001, "LedgerEntry": 10002, - "UInt16": 1, - "NotPresent": 0, - "UInt64": 3, - "UInt32": 2, - "STArray": 15 + "Validation": 10003, + "Metadata": 10004 }, "LEDGER_ENTRY_TYPES": { - "Any": -3, - "Child": -2, "Invalid": -1, "AccountRoot": 97, "DirectoryNode": 100, @@ -31,17 +37,27 @@ "Ticket": 84, "SignerList": 83, "Offer": 111, + "Bridge": 105, "LedgerHashes": 104, "Amendments": 102, + "XChainOwnedClaimID": 113, + "XChainOwnedCreateAccountClaimID": 116, "FeeSettings": 115, "Escrow": 117, "PayChannel": 120, - "DepositPreauth": 112, "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, - "NegativeUNL": 78 + "GeneratorMap": 103 }, "FIELDS": [ [ @@ -65,299 +81,299 @@ } ], [ - "LedgerEntryType", + "ObjectEndMarker", { "nth": 1, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt16" + "type": "STObject" } ], [ - "TransactionType", + "ArrayEndMarker", { - "nth": 2, + "nth": 1, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt16" + "type": "STArray" } ], [ - "SignerWeight", + "hash", { - "nth": 3, + "nth": 257, "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt16" + "isSerialized": false, + "isSigningField": false, + "type": "Hash256" } ], [ - "Flags", + "index", { - "nth": 2, + "nth": 258, "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt32" + "isSerialized": false, + "isSigningField": false, + "type": "Hash256" } ], [ - "SourceTag", + "taker_gets_funded", { - "nth": 3, + "nth": 258, "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt32" + "isSerialized": false, + "isSigningField": false, + "type": "Amount" } ], [ - "Sequence", + "taker_pays_funded", { - "nth": 4, + "nth": 259, "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt32" + "isSerialized": false, + "isSigningField": false, + "type": "Amount" } ], [ - "PreviousTxnLgrSeq", + "LedgerEntry", { - "nth": 5, + "nth": 257, "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt32" + "isSerialized": false, + "isSigningField": false, + "type": "LedgerEntry" } ], [ - "LedgerSequence", + "Transaction", { - "nth": 6, + "nth": 257, "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt32" + "isSerialized": false, + "isSigningField": false, + "type": "Transaction" } ], [ - "CloseTime", + "Validation", { - "nth": 7, + "nth": 257, "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt32" + "isSerialized": false, + "isSigningField": false, + "type": "Validation" } ], [ - "ParentCloseTime", + "Metadata", { - "nth": 8, + "nth": 257, "isVLEncoded": false, - "isSerialized": true, - "isSigningField": true, - "type": "UInt32" + "isSerialized": false, + "isSigningField": false, + "type": "Metadata" } ], [ - "SigningTime", + "CloseResolution", { - "nth": 9, + "nth": 1, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "UInt8" } ], [ - "Expiration", + "Method", { - "nth": 10, + "nth": 2, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "UInt8" } ], [ - "TransferRate", + "TransactionResult", { - "nth": 11, + "nth": 3, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "UInt8" } ], [ - "WalletSize", + "Scale", { - "nth": 12, + "nth": 4, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "UInt8" } ], [ - "OwnerCount", + "TickSize", { - "nth": 13, + "nth": 16, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "UInt8" } ], [ - "DestinationTag", + "UNLModifyDisabling", { - "nth": 14, + "nth": 17, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "UInt8" } ], [ - "HighQualityIn", + "HookResult", { - "nth": 16, + "nth": 18, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "UInt8" } ], [ - "HighQualityOut", + "WasLockingChainSend", { - "nth": 17, + "nth": 19, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "UInt8" } ], [ - "LowQualityIn", + "LedgerEntryType", { - "nth": 18, + "nth": 1, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "UInt16" } ], [ - "LowQualityOut", + "TransactionType", { - "nth": 19, + "nth": 2, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "UInt16" } ], [ - "QualityIn", + "SignerWeight", { - "nth": 20, + "nth": 3, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "UInt16" } ], [ - "QualityOut", + "TransferFee", { - "nth": 21, + "nth": 4, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "UInt16" } ], [ - "StampEscrow", + "TradingFee", { - "nth": 22, + "nth": 5, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "UInt16" } ], [ - "BondAmount", + "DiscountedFee", { - "nth": 23, + "nth": 6, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "UInt16" } ], [ - "LoadFee", + "Version", { - "nth": 24, + "nth": 16, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "UInt16" } ], [ - "OfferSequence", + "HookStateChangeCount", { - "nth": 25, + "nth": 17, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "UInt16" } ], [ - "FirstLedgerSequence", + "HookEmitCount", { - "nth": 26, + "nth": 18, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "UInt16" } ], [ - "LastLedgerSequence", + "HookExecutionIndex", { - "nth": 27, + "nth": 19, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "UInt16" } ], [ - "TransactionIndex", + "HookApiVersion", { - "nth": 28, + "nth": 20, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "UInt16" } ], [ - "OperationLimit", + "NetworkID", { - "nth": 29, + "nth": 1, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, @@ -365,9 +381,9 @@ } ], [ - "ReferenceFeeUnits", + "Flags", { - "nth": 30, + "nth": 2, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, @@ -375,9 +391,9 @@ } ], [ - "ReserveBase", + "SourceTag", { - "nth": 31, + "nth": 3, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, @@ -385,9 +401,9 @@ } ], [ - "ReserveIncrement", + "Sequence", { - "nth": 32, + "nth": 4, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, @@ -395,9 +411,9 @@ } ], [ - "SetFlag", + "PreviousTxnLgrSeq", { - "nth": 33, + "nth": 5, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, @@ -405,9 +421,9 @@ } ], [ - "ClearFlag", + "LedgerSequence", { - "nth": 34, + "nth": 6, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, @@ -415,9 +431,9 @@ } ], [ - "SignerQuorum", + "CloseTime", { - "nth": 35, + "nth": 7, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, @@ -425,9 +441,9 @@ } ], [ - "CancelAfter", + "ParentCloseTime", { - "nth": 36, + "nth": 8, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, @@ -435,9 +451,9 @@ } ], [ - "FinishAfter", + "SigningTime", { - "nth": 37, + "nth": 9, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, @@ -445,443 +461,1273 @@ } ], [ - "IndexNext", + "Expiration", { - "nth": 1, + "nth": 10, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt64" + "type": "UInt32" } ], [ - "IndexPrevious", + "TransferRate", { - "nth": 2, + "nth": 11, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt64" + "type": "UInt32" } ], [ - "BookNode", + "WalletSize", { - "nth": 3, + "nth": 12, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt64" + "type": "UInt32" } ], [ - "OwnerNode", + "OwnerCount", { - "nth": 4, + "nth": 13, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt64" + "type": "UInt32" } ], [ - "BaseFee", + "DestinationTag", { - "nth": 5, + "nth": 14, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt64" + "type": "UInt32" } ], [ - "ExchangeRate", + "LastUpdateTime", { - "nth": 6, + "nth": 15, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt64" + "type": "UInt32" } ], [ - "LowNode", + "HighQualityIn", { - "nth": 7, + "nth": 16, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt64" + "type": "UInt32" } ], [ - "HighNode", + "HighQualityOut", { - "nth": 8, + "nth": 17, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt64" + "type": "UInt32" } ], [ - "EmailHash", + "LowQualityIn", { - "nth": 1, + "nth": 18, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash128" + "type": "UInt32" } ], [ - "LedgerHash", + "LowQualityOut", { - "nth": 1, + "nth": 19, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash256" + "type": "UInt32" } ], [ - "ParentHash", + "QualityIn", { - "nth": 2, + "nth": 20, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash256" + "type": "UInt32" } ], [ - "TransactionHash", + "QualityOut", { - "nth": 3, + "nth": 21, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash256" + "type": "UInt32" } ], [ - "AccountHash", + "StampEscrow", { - "nth": 4, + "nth": 22, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash256" + "type": "UInt32" } ], [ - "PreviousTxnID", + "BondAmount", { - "nth": 5, + "nth": 23, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash256" + "type": "UInt32" } ], [ - "LedgerIndex", + "LoadFee", { - "nth": 6, + "nth": 24, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash256" + "type": "UInt32" } ], [ - "WalletLocator", + "OfferSequence", { - "nth": 7, + "nth": 25, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash256" + "type": "UInt32" } ], [ - "RootIndex", + "FirstLedgerSequence", { - "nth": 8, + "nth": 26, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash256" + "type": "UInt32" } ], [ - "AccountTxnID", + "LastLedgerSequence", { - "nth": 9, + "nth": 27, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash256" + "type": "UInt32" } ], [ - "BookDirectory", + "TransactionIndex", { - "nth": 16, + "nth": 28, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash256" + "type": "UInt32" } ], [ - "InvoiceID", + "OperationLimit", { - "nth": 17, + "nth": 29, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash256" + "type": "UInt32" } ], [ - "Nickname", + "ReferenceFeeUnits", { - "nth": 18, + "nth": 30, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash256" + "type": "UInt32" } ], [ - "Amendment", + "ReserveBase", { - "nth": 19, + "nth": 31, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash256" + "type": "UInt32" } ], [ - "TicketID", + "ReserveIncrement", { - "nth": 20, + "nth": 32, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash256" + "type": "UInt32" } ], [ - "Digest", + "SetFlag", { - "nth": 21, + "nth": 33, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash256" - } - ], - [ - "hash", - { - "nth": 257, - "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Hash256" + "type": "UInt32" } ], [ - "index", + "ClearFlag", { - "nth": 258, + "nth": 34, "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Hash256" + "isSerialized": true, + "isSigningField": true, + "type": "UInt32" } ], [ - "Amount", + "SignerQuorum", { - "nth": 1, + "nth": 35, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Amount" + "type": "UInt32" } ], [ - "Balance", + "CancelAfter", { - "nth": 2, + "nth": 36, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Amount" + "type": "UInt32" } ], [ - "LimitAmount", + "FinishAfter", { - "nth": 3, + "nth": 37, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Amount" + "type": "UInt32" } ], [ - "TakerPays", + "SignerListID", { - "nth": 4, + "nth": 38, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Amount" + "type": "UInt32" } ], [ - "TakerGets", + "SettleDelay", { - "nth": 5, + "nth": 39, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Amount" + "type": "UInt32" } ], [ - "LowLimit", + "TicketCount", { - "nth": 6, + "nth": 40, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Amount" + "type": "UInt32" } ], [ - "HighLimit", + "TicketSequence", { - "nth": 7, + "nth": 41, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Amount" + "type": "UInt32" } ], [ - "Fee", + "NFTokenTaxon", { - "nth": 8, + "nth": 42, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Amount" + "type": "UInt32" } ], [ - "SendMax", + "MintedNFTokens", { - "nth": 9, + "nth": 43, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Amount" + "type": "UInt32" } ], [ - "DeliverMin", + "BurnedNFTokens", { - "nth": 10, + "nth": 44, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Amount" + "type": "UInt32" } ], [ - "MinimumOffer", + "HookStateCount", { - "nth": 16, + "nth": 45, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Amount" + "type": "UInt32" } ], [ - "RippleEscrow", + "EmitGeneration", { - "nth": 17, + "nth": 46, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Amount" + "type": "UInt32" } ], [ - "DeliveredAmount", + "VoteWeight", { - "nth": 18, + "nth": 48, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Amount" + "type": "UInt32" } ], [ - "taker_gets_funded", + "FirstNFTokenSequence", { - "nth": 258, + "nth": 50, "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Amount" + "isSerialized": true, + "isSigningField": true, + "type": "UInt32" } ], [ - "taker_pays_funded", + "OracleDocumentID", { - "nth": 259, + "nth": 51, "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Amount" + "isSerialized": true, + "isSigningField": true, + "type": "UInt32" } ], [ - "PublicKey", + "IndexNext", { "nth": 1, - "isVLEncoded": true, + "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Blob" + "type": "UInt64" } ], [ - "MessageKey", + "IndexPrevious", { "nth": 2, - "isVLEncoded": true, + "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Blob" + "type": "UInt64" } ], [ - "SigningPubKey", + "BookNode", { "nth": 3, - "isVLEncoded": true, + "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Blob" + "type": "UInt64" + } + ], + [ + "OwnerNode", + { + "nth": 4, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "UInt64" + } + ], + [ + "BaseFee", + { + "nth": 5, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "UInt64" + } + ], + [ + "ExchangeRate", + { + "nth": 6, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "UInt64" + } + ], + [ + "LowNode", + { + "nth": 7, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "UInt64" + } + ], + [ + "HighNode", + { + "nth": 8, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "UInt64" + } + ], + [ + "DestinationNode", + { + "nth": 9, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "UInt64" + } + ], + [ + "Cookie", + { + "nth": 10, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "UInt64" + } + ], + [ + "ServerVersion", + { + "nth": 11, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "UInt64" + } + ], + [ + "NFTokenOfferNode", + { + "nth": 12, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "UInt64" + } + ], + [ + "EmitBurden", + { + "nth": 13, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "UInt64" + } + ], + [ + "HookOn", + { + "nth": 16, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "UInt64" + } + ], + [ + "HookInstructionCount", + { + "nth": 17, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "UInt64" + } + ], + [ + "HookReturnCode", + { + "nth": 18, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "UInt64" + } + ], + [ + "ReferenceCount", + { + "nth": 19, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "UInt64" + } + ], + [ + "XChainClaimID", + { + "nth": 20, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "UInt64" + } + ], + [ + "XChainAccountCreateCount", + { + "nth": 21, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "UInt64" + } + ], + [ + "XChainAccountClaimCount", + { + "nth": 22, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "UInt64" + } + ], + [ + "AssetPrice", + { + "nth": 23, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "UInt64" + } + ], + [ + "EmailHash", + { + "nth": 1, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash128" + } + ], + [ + "TakerPaysCurrency", + { + "nth": 1, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash160" + } + ], + [ + "TakerPaysIssuer", + { + "nth": 2, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash160" + } + ], + [ + "TakerGetsCurrency", + { + "nth": 3, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash160" + } + ], + [ + "TakerGetsIssuer", + { + "nth": 4, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash160" + } + ], + [ + "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, + "type": "Hash256" + } + ], + [ + "PreviousTxnID", + { + "nth": 5, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "LedgerIndex", + { + "nth": 6, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "WalletLocator", + { + "nth": 7, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "RootIndex", + { + "nth": 8, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "AccountTxnID", + { + "nth": 9, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "NFTokenID", + { + "nth": 10, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "EmitParentTxnID", + { + "nth": 11, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "EmitNonce", + { + "nth": 12, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "EmitHookHash", + { + "nth": 13, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "AMMID", + { + "nth": 14, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "BookDirectory", + { + "nth": 16, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "InvoiceID", + { + "nth": 17, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "Nickname", + { + "nth": 18, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "Amendment", + { + "nth": 19, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "Digest", + { + "nth": 21, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "Channel", + { + "nth": 22, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "ConsensusHash", + { + "nth": 23, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "CheckID", + { + "nth": 24, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "ValidatedHash", + { + "nth": 25, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "PreviousPageMin", + { + "nth": 26, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "NextPageMin", + { + "nth": 27, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "NFTokenBuyOffer", + { + "nth": 28, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "NFTokenSellOffer", + { + "nth": 29, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "HookStateKey", + { + "nth": 30, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "HookHash", + { + "nth": 31, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "HookNamespace", + { + "nth": 32, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "HookSetTxnID", + { + "nth": 33, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Hash256" + } + ], + [ + "Amount", + { + "nth": 1, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "Balance", + { + "nth": 2, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "LimitAmount", + { + "nth": 3, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "TakerPays", + { + "nth": 4, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "TakerGets", + { + "nth": 5, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "LowLimit", + { + "nth": 6, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "HighLimit", + { + "nth": 7, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "Fee", + { + "nth": 8, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "SendMax", + { + "nth": 9, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "DeliverMin", + { + "nth": 10, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "Amount2", + { + "nth": 11, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "BidMin", + { + "nth": 12, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "BidMax", + { + "nth": 13, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "MinimumOffer", + { + "nth": 16, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "RippleEscrow", + { + "nth": 17, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "DeliveredAmount", + { + "nth": 18, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "NFTokenBrokerFee", + { + "nth": 19, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "BaseFeeDrops", + { + "nth": 22, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "ReserveBaseDrops", + { + "nth": 23, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "ReserveIncrementDrops", + { + "nth": 24, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "LPTokenOut", + { + "nth": 25, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "LPTokenIn", + { + "nth": 26, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "EPrice", + { + "nth": 27, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "Price", + { + "nth": 28, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "SignatureReward", + { + "nth": 29, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "MinAccountCreateAmount", + { + "nth": 30, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "LPTokenBalance", + { + "nth": 31, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "Amount" + } + ], + [ + "PublicKey", + { + "nth": 1, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "Blob" + } + ], + [ + "MessageKey", + { + "nth": 2, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "Blob" + } + ], + [ + "SigningPubKey", + { + "nth": 3, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "Blob" } ], [ @@ -895,7 +1741,7 @@ } ], [ - "Generator", + "URI", { "nth": 5, "isVLEncoded": true, @@ -1047,7 +1893,87 @@ [ "ValidatorToReEnable", { - "nth": 20, + "nth": 21, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "Blob" + } + ], + [ + "HookStateData", + { + "nth": 22, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "Blob" + } + ], + [ + "HookReturnString", + { + "nth": 23, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "Blob" + } + ], + [ + "HookParameterName", + { + "nth": 24, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "Blob" + } + ], + [ + "HookParameterValue", + { + "nth": 25, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "Blob" + } + ], + [ + "DIDDocument", + { + "nth": 26, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "Blob" + } + ], + [ + "Data", + { + "nth": 27, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "Blob" + } + ], + [ + "AssetClass", + { + "nth": 28, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "Blob" + } + ], + [ + "Provider", + { + "nth": 29, "isVLEncoded": true, "isSerialized": true, "isSigningField": true, @@ -1081,67 +2007,257 @@ "isVLEncoded": true, "isSerialized": true, "isSigningField": true, - "type": "AccountID" + "type": "AccountID" + } + ], + [ + "Issuer", + { + "nth": 4, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "AccountID" + } + ], + [ + "Authorize", + { + "nth": 5, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "AccountID" + } + ], + [ + "Unauthorize", + { + "nth": 6, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "AccountID" + } + ], + [ + "RegularKey", + { + "nth": 8, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "AccountID" + } + ], + [ + "NFTokenMinter", + { + "nth": 9, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "AccountID" + } + ], + [ + "EmitCallback", + { + "nth": 10, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "AccountID" + } + ], + [ + "HookAccount", + { + "nth": 16, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "AccountID" + } + ], + [ + "OtherChainSource", + { + "nth": 18, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "AccountID" + } + ], + [ + "OtherChainDestination", + { + "nth": 19, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "AccountID" + } + ], + [ + "AttestationSignerAccount", + { + "nth": 20, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "AccountID" + } + ], + [ + "AttestationRewardAccount", + { + "nth": 21, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "AccountID" + } + ], + [ + "LockingChainDoor", + { + "nth": 22, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "AccountID" + } + ], + [ + "IssuingChainDoor", + { + "nth": 23, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "AccountID" + } + ], + [ + "Indexes", + { + "nth": 1, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "Vector256" + } + ], + [ + "Hashes", + { + "nth": 2, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "Vector256" + } + ], + [ + "Amendments", + { + "nth": 3, + "isVLEncoded": true, + "isSerialized": true, + "isSigningField": true, + "type": "Vector256" + } + ], + [ + "NFTokenOffers", + { + "nth": 4, + "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" } ], [ - "Issuer", + "QuoteAsset", { - "nth": 4, - "isVLEncoded": true, + "nth": 2, + "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "AccountID" + "type": "Currency" } ], [ - "Authorize", + "LockingChainIssue", { - "nth": 5, - "isVLEncoded": true, + "nth": 1, + "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "AccountID" + "type": "Issue" } ], [ - "Unauthorize", + "IssuingChainIssue", { - "nth": 6, - "isVLEncoded": true, + "nth": 2, + "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "AccountID" + "type": "Issue" } ], [ - "Target", + "Asset", { - "nth": 7, - "isVLEncoded": true, + "nth": 3, + "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "AccountID" + "type": "Issue" } ], [ - "RegularKey", + "Asset2", { - "nth": 8, - "isVLEncoded": true, + "nth": 4, + "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "AccountID" + "type": "Issue" } ], [ - "ObjectEndMarker", + "XChainBridge", { "nth": 1, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "STObject" + "type": "XChainBridge" } ], [ @@ -1245,9 +2361,9 @@ } ], [ - "Signer", + "NFToken", { - "nth": 16, + "nth": 12, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, @@ -1255,9 +2371,9 @@ } ], [ - "Majority", + "EmitDetails", { - "nth": 18, + "nth": 13, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, @@ -1265,9 +2381,9 @@ } ], [ - "DisabledValidator", + "Hook", { - "nth": 19, + "nth": 14, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, @@ -1275,333 +2391,353 @@ } ], [ - "ArrayEndMarker", + "Signer", { - "nth": 1, + "nth": 16, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "STArray" + "type": "STObject" } ], [ - "Signers", + "Majority", { - "nth": 3, + "nth": 18, "isVLEncoded": false, "isSerialized": true, - "isSigningField": false, - "type": "STArray" + "isSigningField": true, + "type": "STObject" } ], [ - "SignerEntries", + "DisabledValidator", { - "nth": 4, + "nth": 19, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "STArray" + "type": "STObject" } ], [ - "Template", + "EmittedTxn", { - "nth": 5, + "nth": 20, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "STArray" + "type": "STObject" } ], [ - "Necessary", + "HookExecution", { - "nth": 6, + "nth": 21, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "STArray" + "type": "STObject" } ], [ - "Sufficient", + "HookDefinition", { - "nth": 7, + "nth": 22, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "STArray" + "type": "STObject" } ], [ - "AffectedNodes", + "HookParameter", { - "nth": 8, + "nth": 23, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "STArray" + "type": "STObject" } ], [ - "Memos", + "HookGrant", { - "nth": 9, + "nth": 24, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "STArray" + "type": "STObject" } ], [ - "Majorities", + "VoteEntry", { - "nth": 16, + "nth": 25, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "STArray" + "type": "STObject" } ], [ - "DisabledValidators", + "AuctionSlot", { - "nth": 17, + "nth": 26, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "STArray" + "type": "STObject" } ], [ - "CloseResolution", + "AuthAccount", { - "nth": 1, + "nth": 27, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt8" + "type": "STObject" } ], [ - "Method", + "XChainClaimProofSig", { - "nth": 2, + "nth": 28, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt8" + "type": "STObject" } ], [ - "TransactionResult", + "XChainCreateAccountProofSig", { - "nth": 3, + "nth": 29, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt8" + "type": "STObject" } ], [ - "TakerPaysCurrency", + "XChainClaimAttestationCollectionElement", { - "nth": 1, + "nth": 30, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash160" + "type": "STObject" } ], [ - "TakerPaysIssuer", + "XChainCreateAccountAttestationCollectionElement", { - "nth": 2, + "nth": 31, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash160" + "type": "STObject" } ], [ - "TakerGetsCurrency", + "PriceData", { - "nth": 3, + "nth": 32, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash160" + "type": "STObject" } ], [ - "TakerGetsIssuer", + "Signers", + { + "nth": 3, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": false, + "type": "STArray" + } + ], + [ + "SignerEntries", { "nth": 4, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash160" + "type": "STArray" } ], [ - "Paths", + "Template", { - "nth": 1, + "nth": 5, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "PathSet" + "type": "STArray" } ], [ - "Indexes", + "Necessary", { - "nth": 1, - "isVLEncoded": true, + "nth": 6, + "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Vector256" + "type": "STArray" } ], [ - "Hashes", + "Sufficient", { - "nth": 2, - "isVLEncoded": true, + "nth": 7, + "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Vector256" + "type": "STArray" } ], [ - "Amendments", + "AffectedNodes", { - "nth": 3, - "isVLEncoded": true, + "nth": 8, + "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Vector256" + "type": "STArray" } ], [ - "Transaction", + "Memos", { - "nth": 1, + "nth": 9, "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Transaction" + "isSerialized": true, + "isSigningField": true, + "type": "STArray" } ], [ - "LedgerEntry", + "NFTokens", { - "nth": 1, + "nth": 10, "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "LedgerEntry" + "isSerialized": true, + "isSigningField": true, + "type": "STArray" } ], [ - "Validation", + "Hooks", { - "nth": 1, + "nth": 11, "isVLEncoded": false, - "isSerialized": false, - "isSigningField": false, - "type": "Validation" + "isSerialized": true, + "isSigningField": true, + "type": "STArray" } ], [ - "SignerListID", + "VoteSlots", { - "nth": 38, + "nth": 12, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "STArray" } ], [ - "SettleDelay", + "Majorities", { - "nth": 39, + "nth": 16, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "STArray" } ], [ - "BeginLedgerSeq", + "DisabledValidators", { - "nth": 40, + "nth": 17, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt32" + "type": "STArray" } ], [ - "Channel", + "HookExecutions", { - "nth": 22, + "nth": 18, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash256" + "type": "STArray" } ], [ - "ConsensusHash", + "HookParameters", { - "nth": 23, + "nth": 19, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash256" + "type": "STArray" } ], [ - "CheckID", + "HookGrants", { - "nth": 24, + "nth": 20, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "Hash256" + "type": "STArray" } ], [ - "TickSize", + "XChainClaimAttestations", { - "nth": 16, + "nth": 21, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt8" + "type": "STArray" } ], [ - "UNLModifyDisabling", + "XChainCreateAccountAttestations", { - "nth": 17, + "nth": 22, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt8" + "type": "STArray" } ], [ - "DestinationNode", + "PriceDataSeries", { - "nth": 9, + "nth": 24, "isVLEncoded": false, "isSerialized": true, "isSigningField": true, - "type": "UInt64" + "type": "STArray" + } + ], + [ + "AuthAccounts", + { + "nth": 25, + "isVLEncoded": false, + "isSerialized": true, + "isSigningField": true, + "type": "STArray" } ] ], @@ -1619,6 +2755,10 @@ "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, @@ -1652,8 +2792,21 @@ "temBAD_TICK_SIZE": -269, "temINVALID_ACCOUNT_ID": -268, "temCANNOT_PREAUTH_SELF": -267, - "temUNCERTAIN": -266, - "temUNKNOWN": -265, + "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, "tefFAILURE": -199, "tefALREADY": -198, "tefBAD_ADD_AUTH": -197, @@ -1673,6 +2826,8 @@ "tefBAD_AUTH_MASTER": -183, "tefINVARIANT_FAILED": -182, "tefTOO_BIG": -181, + "tefNO_TICKET": -180, + "tefNFTOKEN_IS_NOT_TRANSFERABLE": -179, "terRETRY": -99, "terFUNDS_SPENT": -98, "terINSUF_FEE_B": -97, @@ -1684,6 +2839,8 @@ "terLAST": -91, "terNO_RIPPLE": -90, "terQUEUED": -89, + "terPRE_TICKET": -88, + "terNO_AMM": -87, "tesSUCCESS": 0, "tecCLAIM": 100, "tecPATH_PARTIAL": 101, @@ -1722,7 +2879,46 @@ "tecDUPLICATE": 149, "tecKILLED": 150, "tecHAS_OBLIGATIONS": 151, - "tecTOO_SOON": 152 + "tecTOO_SOON": 152, + "tecHOOK_REJECTED": 153, + "tecMAX_SEQUENCE_REACHED": 154, + "tecNO_SUITABLE_NFTOKEN_PAGE": 155, + "tecNFTOKEN_BUY_SELL_MISMATCH": 156, + "tecNFTOKEN_OFFER_TYPE_MISMATCH": 157, + "tecCANT_ACCEPT_OWN_NFTOKEN_OFFER": 158, + "tecINSUFFICIENT_FUNDS": 159, + "tecOBJECT_NOT_FOUND": 160, + "tecINSUFFICIENT_PAYMENT": 161, + "tecUNFUNDED_AMM": 162, + "tecAMM_BALANCE": 163, + "tecAMM_FAILED": 164, + "tecAMM_INVALID_TOKENS": 165, + "tecAMM_EMPTY": 166, + "tecAMM_NOT_EMPTY": 167, + "tecAMM_ACCOUNT": 168, + "tecINCOMPLETE": 169, + "tecXCHAIN_BAD_TRANSFER_ISSUE": 170, + "tecXCHAIN_NO_CLAIM_ID": 171, + "tecXCHAIN_BAD_CLAIM_ID": 172, + "tecXCHAIN_CLAIM_NO_QUORUM": 173, + "tecXCHAIN_PROOF_UNKNOWN_KEY": 174, + "tecXCHAIN_CREATE_ACCOUNT_NONXRP_ISSUE": 175, + "tecXCHAIN_WRONG_CHAIN": 176, + "tecXCHAIN_REWARD_MISMATCH": 177, + "tecXCHAIN_NO_SIGNERS_LIST": 178, + "tecXCHAIN_SENDING_ACCOUNT_MISMATCH": 179, + "tecXCHAIN_INSUFF_CREATE_AMOUNT": 180, + "tecXCHAIN_ACCOUNT_CREATE_PAST": 181, + "tecXCHAIN_ACCOUNT_CREATE_TOO_MANY": 182, + "tecXCHAIN_PAYMENT_FAILED": 183, + "tecXCHAIN_SELF_COMMIT": 184, + "tecXCHAIN_BAD_PUBLIC_KEY_ACCOUNT_PAIR": 185, + "tecXCHAIN_CREATE_ACCOUNT_DISABLED": 186, + "tecEMPTY_DID": 187, + "tecINVALID_UPDATE_TIME": 188, + "tecTOKEN_PAIR_NOT_FOUND": 189, + "tecARRAY_EMPTY": 190, + "tecARRAY_TOO_LARGE": 191 }, "TRANSACTION_TYPES": { "Invalid": -1, @@ -1748,6 +2944,31 @@ "DepositPreauth": 19, "TrustSet": 20, "AccountDelete": 21, + "SetHook": 22, + "NFTokenMint": 25, + "NFTokenBurn": 26, + "NFTokenCreateOffer": 27, + "NFTokenCancelOffer": 28, + "NFTokenAcceptOffer": 29, + "Clawback": 30, + "AMMCreate": 35, + "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, + "DIDDelete": 50, + "OracleSet": 51, + "OracleDelete": 52, "EnableAmendment": 100, "SetFee": 101, "UNLModify": 102 diff --git a/src/core/definitions/types.rs b/src/core/definitions/types.rs index 8a374c89..c971d2cf 100644 --- a/src/core/definitions/types.rs +++ b/src/core/definitions/types.rs @@ -49,6 +49,11 @@ pub struct Types { pub u_int_32: i16, #[serde(rename = "STArray")] pub st_array: i16, + pub metadata: i16, + pub currency: i16, + pub issue: i16, + #[serde(rename = "XChainBridge")] + pub xchain_bridge: i16, } #[derive(Debug, Serialize, Deserialize, Clone)] @@ -476,7 +481,6 @@ impl DefinitionMaker for DefinitionMap { ) -> (FieldInfoMap, FieldHeaderNameMap) { let mut field_info_map = FieldInfoMap::default(); let mut field_header_name_map = FieldHeaderNameMap::default(); - for field in fields { let field_name: &str = &(field.0); let field_info: FieldInfo = (field.1).to_owned(); diff --git a/src/core/test_data/codec-fixtures.json b/src/core/test_data/codec-fixtures.json index be2e637a..a584f879 100644 --- a/src/core/test_data/codec-fixtures.json +++ b/src/core/test_data/codec-fixtures.json @@ -33,7 +33,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "059D1E86DE5DCCCF956BF4799675B2425AF9AD44FE4CCA6FEE1C812EEF6423E6", - "Indexes": ["908D554AA0D29F660716A3EE65C61DD886B744DDF60DE70E6B16EADB770635DB"] + "Indexes": [ + "908D554AA0D29F660716A3EE65C61DD886B744DDF60DE70E6B16EADB770635DB" + ] } }, { @@ -327,7 +329,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "17CC40C6872E0C0E658C49B75D0812A70D4161DDA53324DF51FA58D3819C814B", - "Indexes": ["571BF14F28C4D97871CDACD344A8CF57E6BA287BF0440B9E0D0683D02751CC7B"] + "Indexes": [ + "571BF14F28C4D97871CDACD344A8CF57E6BA287BF0440B9E0D0683D02751CC7B" + ] } }, { @@ -376,7 +380,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "1BCA9161A199AD5E907751CBF3FBA49689D517F0E8EE823AE17B737039B41DE1", - "Indexes": ["26B894EE68470AD5AEEB55D5EBF936E6397CEE6957B93C56A2E7882CA9082873"] + "Indexes": [ + "26B894EE68470AD5AEEB55D5EBF936E6397CEE6957B93C56A2E7882CA9082873" + ] } }, { @@ -440,7 +446,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "1F9FF48419CA69FDDCC294CCEEE608F5F8A8BE11E286AD5743ED2D457C5570C4", - "Indexes": ["7D4325BE338A40BBCBCC1F351B3272EB3E76305A878E76603DE206A795871619"] + "Indexes": [ + "7D4325BE338A40BBCBCC1F351B3272EB3E76305A878E76603DE206A795871619" + ] } }, { @@ -606,7 +614,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "289CFC476B5876F28C8A3B3C5B7058EC2BDF668C37B846EA7E5E1A73A4AA0816", - "Indexes": ["BC10E40AFB79298004CDE51CB065DBDCABA86EC406E3A1CF02CE5F8A9628A2BD"] + "Indexes": [ + "BC10E40AFB79298004CDE51CB065DBDCABA86EC406E3A1CF02CE5F8A9628A2BD" + ] } }, { @@ -709,7 +719,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "2C9F00EFA5CCBD43452EF364B12C8DFCEF2B910336E5EFCE3AA412A556991582", - "Indexes": ["F721E924498EE68BFF906CD856E8332073DD350BAC9E8977AC3F31860BA1E33A"] + "Indexes": [ + "F721E924498EE68BFF906CD856E8332073DD350BAC9E8977AC3F31860BA1E33A" + ] } }, { @@ -746,7 +758,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "2FB4904ACFB96228FC002335B1B5A4C5584D9D727BBE82144F0415EB4EA0C727", - "Indexes": ["5F22826818CC83448C9DF34939AB4019D3F80C70DEB8BDBDCF0496A36DC68719"], + "Indexes": [ + "5F22826818CC83448C9DF34939AB4019D3F80C70DEB8BDBDCF0496A36DC68719" + ], "TakerPaysIssuer": "2B6C42A95B3F7EE1971E4A10098E8F1B5F66AA08" } }, @@ -760,7 +774,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "2FB4904ACFB96228FC002335B1B5A4C5584D9D727BBE82145003BAF82D03A000", - "Indexes": ["5B7F148A8DDB4EB7386C9E75C4C1ED918DEDE5C52D5BA51B694D7271EF8BDB46"], + "Indexes": [ + "5B7F148A8DDB4EB7386C9E75C4C1ED918DEDE5C52D5BA51B694D7271EF8BDB46" + ], "TakerPaysIssuer": "2B6C42A95B3F7EE1971E4A10098E8F1B5F66AA08" } }, @@ -951,7 +967,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "3F2BADB38F12C87D111D3970CD1F05FE698DB86F14DC7C5FAEB05BFB6391B00E", - "Indexes": ["73E075E64CA5E7CE60FFCD5359C1D730EDFFEE7C4D992760A87DF7EA0A34E40F"] + "Indexes": [ + "73E075E64CA5E7CE60FFCD5359C1D730EDFFEE7C4D992760A87DF7EA0A34E40F" + ] } }, { @@ -976,7 +994,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "4235CD082112FB621C02D6DA2E4F4ACFAFC91CB0585E034B936C29ABF4A76B01", - "Indexes": ["6C4C3F1C6B9D76A6EF50F377E7C3991825694C604DBE0C1DD09362045EE41997"] + "Indexes": [ + "6C4C3F1C6B9D76A6EF50F377E7C3991825694C604DBE0C1DD09362045EE41997" + ] } }, { @@ -1075,7 +1095,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "48E91FD14597FB089654DADE7B70EB08CAF421EA611D703F3E871F7D4B5AAB5D", - "Indexes": ["25DCAC87FBE4C3B66A1AFDE3C3F98E5A16333975C4FD46682F7497F27DFB9766"] + "Indexes": [ + "25DCAC87FBE4C3B66A1AFDE3C3F98E5A16333975C4FD46682F7497F27DFB9766" + ] } }, { @@ -1137,7 +1159,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "4EFC0442D07AE681F7FDFAA89C75F06F8E28CFF888593440201B0320E8F2C7BD", - "Indexes": ["1595E5D5197330F58A479200A2FDD434D7A244BD1FFEC5E5EE8CF064AE77D3F5"] + "Indexes": [ + "1595E5D5197330F58A479200A2FDD434D7A244BD1FFEC5E5EE8CF064AE77D3F5" + ] } }, { @@ -1351,7 +1375,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "98082E695CAB618590BEEA0647A5F24D2B610A686ECD49310604FC7431FAAB0D", - "Indexes": ["9BF3216E42575CA5A3CB4D0F2021EE81D0F7835BA2EDD78E05CAB44B655962BB"] + "Indexes": [ + "9BF3216E42575CA5A3CB4D0F2021EE81D0F7835BA2EDD78E05CAB44B655962BB" + ] } }, { @@ -1556,7 +1582,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "62AE37A44FE44BDCFC2BA5DD14D74BEC0AC346DA2DC1F04756044364C5BB0000", - "Indexes": ["600A398F57CAE44461B4C8C25DE12AC289F87ED125438440B33B97417FE3D82C"], + "Indexes": [ + "600A398F57CAE44461B4C8C25DE12AC289F87ED125438440B33B97417FE3D82C" + ], "TakerPaysIssuer": "2B6C42A95B3F7EE1971E4A10098E8F1B5F66AA08" } }, @@ -1932,7 +1960,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "72D60CCD3905A3ABE19049B6EE76E8E0F3A2CBAC852625C757176F1B73EF617F", - "Indexes": ["AB124EEAB087452070EC70D9DEA1A22C9766FFBBEE1025FD46495CC74148CCA8"] + "Indexes": [ + "AB124EEAB087452070EC70D9DEA1A22C9766FFBBEE1025FD46495CC74148CCA8" + ] } }, { @@ -2061,7 +2091,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "80AB25842B230D48027800213EB86023A3EAF4430E22C092D333795FFF1E5219", - "Indexes": ["42E28285A82D01DCA856118A064C8AEEE1BF8167C08186DA5BFC678687E86F7C"] + "Indexes": [ + "42E28285A82D01DCA856118A064C8AEEE1BF8167C08186DA5BFC678687E86F7C" + ] } }, { @@ -2186,7 +2218,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "8ADF3C5527CCF6D0B5863365EF40254171536C3901F1CBD9E2BC5F918A7D492A", - "Indexes": ["BC10E40AFB79298004CDE51CB065DBDCABA86EC406E3A1CF02CE5F8A9628A2BD"] + "Indexes": [ + "BC10E40AFB79298004CDE51CB065DBDCABA86EC406E3A1CF02CE5F8A9628A2BD" + ] } }, { @@ -2587,7 +2621,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "A00CD19C13A5CFA3FECB409D42B38017C07A4AEAE05A7A00347DDA17199BA683", - "Indexes": ["E49318D6DF22411C3F35581B1D28297A36E47F68B45F36A587C156E6E43CE0A6"] + "Indexes": [ + "E49318D6DF22411C3F35581B1D28297A36E47F68B45F36A587C156E6E43CE0A6" + ] } }, { @@ -2634,7 +2670,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "A39F044D860C5B5846AA7E0FAAD44DC8897F0A62B2F628AA073B21B3EC146010", - "Indexes": ["CD34D8FF7C656B66E2298DB420C918FE27DFFF2186AC8D1785D8CBF2C6BC3488"] + "Indexes": [ + "CD34D8FF7C656B66E2298DB420C918FE27DFFF2186AC8D1785D8CBF2C6BC3488" + ] } }, { @@ -2683,7 +2721,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "A7E461C6DC98F472991FDE51FADDC0082D755F553F5849875D554B52624EF1C3", - "Indexes": ["116C6D5E5C6C59C9C5362B84CB9DD30BD3D4B7CB98CE993D49C068323BF19747"] + "Indexes": [ + "116C6D5E5C6C59C9C5362B84CB9DD30BD3D4B7CB98CE993D49C068323BF19747" + ] } }, { @@ -2717,7 +2757,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "AA539C8EECE0A0CFF0DBF3BFACD6B42CD4421715428AD90B034091BD3C721038", - "Indexes": ["72307CB57E53604A0C50E653AB10E386F3835460B5585B70CB7F668C1E04AC8B"] + "Indexes": [ + "72307CB57E53604A0C50E653AB10E386F3835460B5585B70CB7F668C1E04AC8B" + ] } }, { @@ -3777,7 +3819,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "D4A00D9B3452C7F93C5F0531FA8FFB4599FEEC405CA803FBEFE0FA22137D863D", - "Indexes": ["C1C5FB39D6C15C581D822DBAF725EF7EDE40BEC9F93C52398CF5CE9F64154D6C"] + "Indexes": [ + "C1C5FB39D6C15C581D822DBAF725EF7EDE40BEC9F93C52398CF5CE9F64154D6C" + ] } }, { @@ -3787,7 +3831,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "D4B68B54869E428428078E1045B8BB66C24DD101DB3FCCBB099929B3B63BCB40", - "Indexes": ["9A551971E78FE2FB80D930A77EA0BAC2139A49D6BEB98406427C79F52A347A09"] + "Indexes": [ + "9A551971E78FE2FB80D930A77EA0BAC2139A49D6BEB98406427C79F52A347A09" + ] } }, { @@ -3862,7 +3908,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "DD23E2C60C9BC58180AC6EA7C668233EC51A0947E42FD1FAD4F5FBAED9698D95", - "Indexes": ["908D554AA0D29F660716A3EE65C61DD886B744DDF60DE70E6B16EADB770635DB"] + "Indexes": [ + "908D554AA0D29F660716A3EE65C61DD886B744DDF60DE70E6B16EADB770635DB" + ] } }, { @@ -4013,7 +4061,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "E2EC9E1BC7B4667B7A5F2F68857F6E6A478A09B5BB4F99E09F694437C4152DED", - "Indexes": ["65492B9F30F1CBEA168509128EB8619BAE02A7A7A4725FF3F8DAA70FA707A26E"] + "Indexes": [ + "65492B9F30F1CBEA168509128EB8619BAE02A7A7A4725FF3F8DAA70FA707A26E" + ] } }, { @@ -4190,7 +4240,9 @@ "IndexPrevious": "0000000000000002", "Flags": 0, "RootIndex": "8E92E688A132410427806A734DF6154B7535E439B72DECA5E4BC7CE17135C5A4", - "Indexes": ["73E075E64CA5E7CE60FFCD5359C1D730EDFFEE7C4D992760A87DF7EA0A34E40F"] + "Indexes": [ + "73E075E64CA5E7CE60FFCD5359C1D730EDFFEE7C4D992760A87DF7EA0A34E40F" + ] } }, { @@ -4294,7 +4346,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "F774E0321809251174AC85531606FB46B75EEF9F842F9697531AA535D3D0C000", - "Indexes": ["D1CB738BD08AC36DCB77191DB87C6E40FA478B86503371ED497F30931D7F4F52"], + "Indexes": [ + "D1CB738BD08AC36DCB77191DB87C6E40FA478B86503371ED497F30931D7F4F52" + ], "TakerPaysIssuer": "E8ACFC6B5EF4EA0601241525375162F43C2FF285" } }, @@ -4355,7 +4409,9 @@ "LedgerEntryType": "DirectoryNode", "Flags": 0, "RootIndex": "F95F6D3A1EF7981E5CA4D5AEC4DA63392B126C76469735BCCA26150A1AF6D9C3", - "Indexes": ["CAD951AB279A749AE648FD1DFF56C021BD66E36187022E772C31FE52106CB13B"] + "Indexes": [ + "CAD951AB279A749AE648FD1DFF56C021BD66E36187022E772C31FE52106CB13B" + ] } }, { @@ -4435,32 +4491,548 @@ } } ], - "transactions": [{ - "binary": "1200002200000000240000003E6140000002540BE40068400000000000000A7321034AADB09CFF4A4804073701EC53C3510CDC95917C2BB0150FB742D0C66E6CEE9E74473045022022EB32AECEF7C644C891C19F87966DF9C62B1F34BABA6BE774325E4BB8E2DD62022100A51437898C28C2B297112DF8131F2BB39EA5FE613487DDD611525F17962646398114550FC62003E785DC231A1058A05E56E3F09CF4E68314D4CC8AB5B21D86A82C3E9E8D0ECF2404B77FECBA", - "json": { - "Account": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV", - "Destination": "rLQBHVhFnaC5gLEkgr6HgBJJ3bgeZHg9cj", - "TransactionType": "Payment", - "TxnSignature": "3045022022EB32AECEF7C644C891C19F87966DF9C62B1F34BABA6BE774325E4BB8E2DD62022100A51437898C28C2B297112DF8131F2BB39EA5FE613487DDD611525F1796264639", - "SigningPubKey": "034AADB09CFF4A4804073701EC53C3510CDC95917C2BB0150FB742D0C66E6CEE9E", - "Amount": "10000000000", - "Fee": "10", - "Flags": 0, - "Sequence": 62 + "transactions": [ + { + "binary": "1200002200000000240000003E6140000002540BE40068400000000000000A7321034AADB09CFF4A4804073701EC53C3510CDC95917C2BB0150FB742D0C66E6CEE9E74473045022022EB32AECEF7C644C891C19F87966DF9C62B1F34BABA6BE774325E4BB8E2DD62022100A51437898C28C2B297112DF8131F2BB39EA5FE613487DDD611525F17962646398114550FC62003E785DC231A1058A05E56E3F09CF4E68314D4CC8AB5B21D86A82C3E9E8D0ECF2404B77FECBA", + "json": { + "Account": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV", + "Destination": "rLQBHVhFnaC5gLEkgr6HgBJJ3bgeZHg9cj", + "TransactionType": "Payment", + "TxnSignature": "3045022022EB32AECEF7C644C891C19F87966DF9C62B1F34BABA6BE774325E4BB8E2DD62022100A51437898C28C2B297112DF8131F2BB39EA5FE613487DDD611525F1796264639", + "SigningPubKey": "034AADB09CFF4A4804073701EC53C3510CDC95917C2BB0150FB742D0C66E6CEE9E", + "Amount": "10000000000", + "Fee": "10", + "Flags": 0, + "Sequence": 62 + } + }, + { + "binary": "1200302200000000240000000168400000000000000A601D40000000000003E8601E400000000000271073210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020744630440220101BCA4B5B5A37C6F44480F9A34752C9AA8B2CDF5AD47E3CB424DEDC21C06DB702206EEB257E82A89B1F46A0A2C7F070B0BD181D980FF86FE4269E369F6FC7A270918114B5F762798A53D543A014CAF8B297CFF8F2F937E8011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000000000000000000000", + "json": { + "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "XChainBridge": { + "LockingChainDoor": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL", + "LockingChainIssue": { + "currency": "XRP" + }, + "IssuingChainDoor": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV", + "IssuingChainIssue": { + "currency": "XRP" + } + }, + "Fee": "10", + "Flags": 0, + "MinAccountCreateAmount": "10000", + "Sequence": 1, + "SignatureReward": "1000", + "SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020", + "TransactionType": "XChainCreateBridge", + "TxnSignature": "30440220101BCA4B5B5A37C6F44480F9A34752C9AA8B2CDF5AD47E3CB424DEDC21C06DB702206EEB257E82A89B1F46A0A2C7F070B0BD181D980FF86FE4269E369F6FC7A27091" + } + }, + { + "binary": "12002F2200000000240000000168400000000000000A601D40000000000003E8601E400000000000271073210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD02074473045022100D2CABC1B0E0635A8EE2E6554F6D474C49BC292C995C5C9F83179F4A60634B04C02205D1DB569D9593136F2FBEA7140010C8F46794D653AFDBEA8D30B8750BA4805E58114B5F762798A53D543A014CAF8B297CFF8F2F937E8011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000000000000000000000", + "json": { + "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "XChainBridge": { + "LockingChainDoor": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL", + "LockingChainIssue": { + "currency": "XRP" + }, + "IssuingChainDoor": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV", + "IssuingChainIssue": { + "currency": "XRP" + } + }, + "Fee": "10", + "Flags": 0, + "MinAccountCreateAmount": "10000", + "Sequence": 1, + "SignatureReward": "1000", + "SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020", + "TransactionType": "XChainModifyBridge", + "TxnSignature": "3045022100D2CABC1B0E0635A8EE2E6554F6D474C49BC292C995C5C9F83179F4A60634B04C02205D1DB569D9593136F2FBEA7140010C8F46794D653AFDBEA8D30B8750BA4805E5" + } + }, + { + "binary": "1200292280000000240000000168400000000000000A601D400000000000271073210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020744630440220247B20A1B9C48E21A374CB9B3E1FE2A7C528151868DF8D307E9FBE15237E531A02207C20C092DDCC525E583EF4AB7CB91E862A6DED19426997D3F0A2C84E2BE8C5DD8114B5F762798A53D543A014CAF8B297CFF8F2F937E8801214AF80285F637EE4AF3C20378F9DFB12511ACB8D27011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000000000000000000000", + "json": { + "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "XChainBridge": { + "LockingChainDoor": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL", + "LockingChainIssue": { + "currency": "XRP" + }, + "IssuingChainDoor": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV", + "IssuingChainIssue": { + "currency": "XRP" + } + }, + "Fee": "10", + "Flags": 2147483648, + "OtherChainSource": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL", + "Sequence": 1, + "SignatureReward": "10000", + "SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020", + "TransactionType": "XChainCreateClaimID", + "TxnSignature": "30440220247B20A1B9C48E21A374CB9B3E1FE2A7C528151868DF8D307E9FBE15237E531A02207C20C092DDCC525E583EF4AB7CB91E862A6DED19426997D3F0A2C84E2BE8C5DD" + } + }, + { + "binary": "12002A228000000024000000013014000000000000000161400000000000271068400000000000000A73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD02074453043021F177323F0D93612C82A4393A99B23905A7E675753FD80C52997AFAB13F5F9D002203BFFAF457E90BDA65AABE8F8762BD96162FAD98A0C030CCD69B06EE9B12BBFFE8114B5F762798A53D543A014CAF8B297CFF8F2F937E8011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000000000000000000000", + "json": { + "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "Amount": "10000", + "XChainBridge": { + "LockingChainDoor": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL", + "LockingChainIssue": { + "currency": "XRP" + }, + "IssuingChainDoor": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV", + "IssuingChainIssue": { + "currency": "XRP" + } + }, + "Fee": "10", + "Flags": 2147483648, + "Sequence": 1, + "SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020", + "TransactionType": "XChainCommit", + "TxnSignature": "3043021F177323F0D93612C82A4393A99B23905A7E675753FD80C52997AFAB13F5F9D002203BFFAF457E90BDA65AABE8F8762BD96162FAD98A0C030CCD69B06EE9B12BBFFE", + "XChainClaimID": "0000000000000001" + } + }, + { + "binary": "12002B228000000024000000013014000000000000000161400000000000271068400000000000000A73210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020744630440220445F7469FDA401787D9EE8A9B6E24DFF81E94F4C09FD311D2C0A58FCC02C684A022029E2EF34A5EA35F50D5BB57AC6320AD3AE12C13C8D1379B255A486D72CED142E8114B5F762798A53D543A014CAF8B297CFF8F2F937E88314550FC62003E785DC231A1058A05E56E3F09CF4E6011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000000000000000000000", + "json": { + "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "Amount": "10000", + "XChainBridge": { + "LockingChainDoor": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL", + "LockingChainIssue": { + "currency": "XRP" + }, + "IssuingChainDoor": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV", + "IssuingChainIssue": { + "currency": "XRP" + } + }, + "Destination": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV", + "Fee": "10", + "Flags": 2147483648, + "Sequence": 1, + "SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020", + "TransactionType": "XChainClaim", + "TxnSignature": "30440220445F7469FDA401787D9EE8A9B6E24DFF81E94F4C09FD311D2C0A58FCC02C684A022029E2EF34A5EA35F50D5BB57AC6320AD3AE12C13C8D1379B255A486D72CED142E", + "XChainClaimID": "0000000000000001" + } + }, + { + "binary": "12002C228000000024000000016140000000000F424068400000000000000A601D400000000000271073210330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD0207446304402202984DDE7F0B566F081F7953D7212BF031ACBF8860FE114102E9512C4C8768C77022070113F4630B1DC3045E4A98DDD648CEBC31B12774F7B44A1B8123CD2C9F5CF188114B5F762798A53D543A014CAF8B297CFF8F2F937E88314AF80285F637EE4AF3C20378F9DFB12511ACB8D27011914AF80285F637EE4AF3C20378F9DFB12511ACB8D27000000000000000000000000000000000000000014550FC62003E785DC231A1058A05E56E3F09CF4E60000000000000000000000000000000000000000", + "json": { + "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "XChainBridge": { + "LockingChainDoor": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL", + "LockingChainIssue": { + "currency": "XRP" + }, + "IssuingChainDoor": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV", + "IssuingChainIssue": { + "currency": "XRP" + } + }, + "Amount": "1000000", + "Fee": "10", + "Flags": 2147483648, + "Destination": "rGzx83BVoqTYbGn7tiVAnFw7cbxjin13jL", + "Sequence": 1, + "SignatureReward": "10000", + "SigningPubKey": "0330E7FC9D56BB25D6893BA3F317AE5BCF33B3291BD63DB32654A313222F7FD020", + "TransactionType": "XChainAccountCreateCommit", + "TxnSignature": "304402202984DDE7F0B566F081F7953D7212BF031ACBF8860FE114102E9512C4C8768C77022070113F4630B1DC3045E4A98DDD648CEBC31B12774F7B44A1B8123CD2C9F5CF18" + } + }, + { + "binary": "12002E2400000005201B0000000D30150000000000000006614000000000989680684000000000000014601D40000000000000647121ED1F4A024ACFEBDB6C7AA88DEDE3364E060487EA31B14CC9E0D610D152B31AADC27321EDF54108BA2E0A0D3DC2AE3897F8BE0EFE776AE8D0F9FB0D0B9D64233084A8DDD1744003E74AEF1F585F156786429D2FC87A89E5C6B5A56D68BFC9A6A329F3AC67CBF2B6958283C663A4522278CA162C69B23CF75149AF022B410EA0508C16F42058007640EEFCFA3DC2AB4AB7C4D2EBBC168CB621A11B82BABD86534DFC8EFA72439A49662D744073CD848E7A587A95B35162CDF9A69BB237E72C9537A987F5B8C394F30D81145E7A3E3D7200A794FA801C66CE3775B6416EE4128314C15F113E49BCC4B9FFF43CD0366C23ACD82F75638012143FD9ED9A79DEA67CB5D585111FEF0A29203FA0408015145E7A3E3D7200A794FA801C66CE3775B6416EE4120010130101191486F0B1126CE1205E59FDFDD2661A9FB7505CA70F000000000000000000000000000000000000000014B5F762798A53D543A014CAF8B297CFF8F2F937E80000000000000000000000000000000000000000", + "json": { + "Account": "r9cYxdjQsoXAEz3qQJc961SNLaXRkWXCvT", + "Amount": "10000000", + "AttestationRewardAccount": "r9cYxdjQsoXAEz3qQJc961SNLaXRkWXCvT", + "Destination": "rJdTJRJZ6GXCCRaamHJgEqVzB7Zy4557Pi", + "Fee": "20", + "LastLedgerSequence": 13, + "OtherChainSource": "raFcdz1g8LWJDJWJE2ZKLRGdmUmsTyxaym", + "PublicKey": "ED1F4A024ACFEBDB6C7AA88DEDE3364E060487EA31B14CC9E0D610D152B31AADC2", + "Sequence": 5, + "Signature": "EEFCFA3DC2AB4AB7C4D2EBBC168CB621A11B82BABD86534DFC8EFA72439A49662D744073CD848E7A587A95B35162CDF9A69BB237E72C9537A987F5B8C394F30D", + "SignatureReward": "100", + "SigningPubKey": "EDF54108BA2E0A0D3DC2AE3897F8BE0EFE776AE8D0F9FB0D0B9D64233084A8DDD1", + "TransactionType": "XChainAddAccountCreateAttestation", + "TxnSignature": "03E74AEF1F585F156786429D2FC87A89E5C6B5A56D68BFC9A6A329F3AC67CBF2B6958283C663A4522278CA162C69B23CF75149AF022B410EA0508C16F4205800", + "WasLockingChainSend": 1, + "XChainAccountCreateCount": "0000000000000006", + "XChainBridge": { + "IssuingChainDoor": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "IssuingChainIssue": { + "currency": "XRP" + }, + "LockingChainDoor": "rDJVtEuDKr4rj1B3qtW7R5TVWdXV2DY7Qg", + "LockingChainIssue": { + "currency": "XRP" + } + } + } + }, + { + "binary": "12002D2400000009201B00000013301400000000000000016140000000009896806840000000000000147121ED7541DEC700470F54276C90C333A13CDBB5D341FD43C60CEA12170F6D6D4E11367321ED0406B134786FE0751717226657F7BF8AFE96442C05D28ACEC66FB64852BA604C7440D0423649E48A44F181262CF5FC08A68E7FA5CD9E55843E4F09014B76E602574741E8553383A4B43CABD194BB96713647FC0B885BE248E4FFA068FA3E6994CF0476407C175050B08000AD35EEB2D87E16CD3F95A0AEEBF2A049474275153D9D4DD44528FE99AA50E71660A15B0B768E1B90E609BBD5DC7AFAFD45D9705D72D40EA10C81141F30A4D728AB98B0950EC3B9815E6C8D43A7D5598314C15F113E49BCC4B9FFF43CD0366C23ACD82F75638012143FD9ED9A79DEA67CB5D585111FEF0A29203FA0408015141F30A4D728AB98B0950EC3B9815E6C8D43A7D5590010130101191486F0B1126CE1205E59FDFDD2661A9FB7505CA70F000000000000000000000000000000000000000014B5F762798A53D543A014CAF8B297CFF8F2F937E80000000000000000000000000000000000000000", + "json": { + "Account": "rsqvD8WFFEBBv4nztpoW9YYXJ7eRzLrtc3", + "Amount": "10000000", + "AttestationRewardAccount": "rsqvD8WFFEBBv4nztpoW9YYXJ7eRzLrtc3", + "Destination": "rJdTJRJZ6GXCCRaamHJgEqVzB7Zy4557Pi", + "Fee": "20", + "LastLedgerSequence": 19, + "OtherChainSource": "raFcdz1g8LWJDJWJE2ZKLRGdmUmsTyxaym", + "PublicKey": "ED7541DEC700470F54276C90C333A13CDBB5D341FD43C60CEA12170F6D6D4E1136", + "Sequence": 9, + "Signature": "7C175050B08000AD35EEB2D87E16CD3F95A0AEEBF2A049474275153D9D4DD44528FE99AA50E71660A15B0B768E1B90E609BBD5DC7AFAFD45D9705D72D40EA10C", + "SigningPubKey": "ED0406B134786FE0751717226657F7BF8AFE96442C05D28ACEC66FB64852BA604C", + "TransactionType": "XChainAddClaimAttestation", + "TxnSignature": "D0423649E48A44F181262CF5FC08A68E7FA5CD9E55843E4F09014B76E602574741E8553383A4B43CABD194BB96713647FC0B885BE248E4FFA068FA3E6994CF04", + "WasLockingChainSend": 1, + "XChainBridge": { + "IssuingChainDoor": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "IssuingChainIssue": { + "currency": "XRP" + }, + "LockingChainDoor": "rDJVtEuDKr4rj1B3qtW7R5TVWdXV2DY7Qg", + "LockingChainIssue": { + "currency": "XRP" + } + }, + "XChainClaimID": "0000000000000001" + } + }, + { + "binary": "12002315000A2200000000240015DAE161400000000000271068400000000000000A6BD5838D7EA4C680000000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C7321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B87440B3154D968314FCEB58001E1B0C3A4CFB33DF9FF6C73207E5EAEB9BD07E2747672168E1A2786D950495C38BD8DEE3391BF45F3008DD36F4B12E7C07D82CA5250E8114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A", + "json": { + "Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw", + "TransactionType": "AMMCreate", + "TxnSignature": "B3154D968314FCEB58001E1B0C3A4CFB33DF9FF6C73207E5EAEB9BD07E2747672168E1A2786D950495C38BD8DEE3391BF45F3008DD36F4B12E7C07D82CA5250E", + "Amount": "10000", + "Amount2": { + "currency": "ETH", + "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9", + "value": "10000" + }, + "TradingFee": 10, + "Fee": "10", + "Flags": 0, + "Sequence": 1432289, + "SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8" + } + }, + { + "binary": "1200242200010000240015DAE168400000000000000A6019D5438D7EA4C68000B3813FCAB4EE68B3D0D735D6849465A9113EE048B3813FCAB4EE68B3D0D735D6849465A9113EE0487321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B874408073C588E7EF672DD171E414638D9AF8DBE9A1359E030DE3E1C9AA6A38A2CE9E138CB56482BB844F7228D48B1E4AD7D09BB7E9F639C115958EEEA374749CA00B8114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C", + "json": { + "Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw", + "TransactionType": "AMMDeposit", + "TxnSignature": "8073C588E7EF672DD171E414638D9AF8DBE9A1359E030DE3E1C9AA6A38A2CE9E138CB56482BB844F7228D48B1E4AD7D09BB7E9F639C115958EEEA374749CA00B", + "Asset": { + "currency": "XRP" + }, + "Asset2": { + "currency": "ETH", + "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9" + }, + "LPTokenOut": { + "currency": "B3813FCAB4EE68B3D0D735D6849465A9113EE048", + "issuer": "rH438jEAzTs5PYtV6CHZqpDpwCKQmPW9Cg", + "value": "1000" + }, + "Fee": "10", + "Flags": 65536, + "Sequence": 1432289, + "SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8" + } + }, + { + "binary": "1200242200080000240015DAE16140000000000003E868400000000000000A7321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8744096CA066F42871C55088D2758D64148921B1ACAA5C6C648D0F7D675BBF47F87DF711F17C5BD172666D5AEC257520C587A849A6E063345609D91E121A78816EB048114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C", + "json": { + "Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw", + "TransactionType": "AMMDeposit", + "Asset": { + "currency": "XRP" + }, + "Asset2": { + "currency": "ETH", + "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9" + }, + "Amount": "1000", + "Fee": "10", + "Flags": 524288, + "Sequence": 1432289, + "SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8", + "TxnSignature": "96CA066F42871C55088D2758D64148921B1ACAA5C6C648D0F7D675BBF47F87DF711F17C5BD172666D5AEC257520C587A849A6E063345609D91E121A78816EB04" + } + }, + { + "binary": "1200242200100000240015DAE16140000000000003E868400000000000000A6BD511C37937E080000000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C7321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B87440FC22B16A098C236ED7EDB3EBC983026DFD218A03C8BAA848F3E1D5389D5B8B00473C1178C5BA257BFA2DCD433C414690A430A5CFD71C1C0A7F7BF725EC1759018114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C", + "json": { + "Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw", + "TransactionType": "AMMDeposit", + "Asset": { + "currency": "XRP" + }, + "Asset2": { + "currency": "ETH", + "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9" + }, + "Amount": "1000", + "Amount2": { + "currency": "ETH", + "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9", + "value": "500" + }, + "Fee": "10", + "Flags": 1048576, + "Sequence": 1432289, + "SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8", + "TxnSignature": "FC22B16A098C236ED7EDB3EBC983026DFD218A03C8BAA848F3E1D5389D5B8B00473C1178C5BA257BFA2DCD433C414690A430A5CFD71C1C0A7F7BF725EC175901" + } + }, + { + "binary": "1200242200200000240015DAE16140000000000003E868400000000000000A6019D5438D7EA4C68000B3813FCAB4EE68B3D0D735D6849465A9113EE048B3813FCAB4EE68B3D0D735D6849465A9113EE0487321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B87440117CF90F9B113AD3BD638B6DB63562B37C287D5180F278B3CCF58FC14A5BAEE98307EA0F6DFE19E2FBA887C92955BA5D1A04F92ADAAEB309DE89C3610D074C098114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C", + "json": { + "Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw", + "TransactionType": "AMMDeposit", + "Asset": { + "currency": "XRP" + }, + "Asset2": { + "currency": "ETH", + "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9" + }, + "Amount": "1000", + "LPTokenOut": { + "currency": "B3813FCAB4EE68B3D0D735D6849465A9113EE048", + "issuer": "rH438jEAzTs5PYtV6CHZqpDpwCKQmPW9Cg", + "value": "1000" + }, + "Fee": "10", + "Flags": 2097152, + "Sequence": 1432289, + "SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8", + "TxnSignature": "117CF90F9B113AD3BD638B6DB63562B37C287D5180F278B3CCF58FC14A5BAEE98307EA0F6DFE19E2FBA887C92955BA5D1A04F92ADAAEB309DE89C3610D074C09" + } + }, + { + "binary": "1200242200400000240015DAE16140000000000003E868400000000000000A601B40000000000000197321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B874405E51EBC6B52A7C3BA5D0AE2FC8F62E779B80182009B3108A87AB6D770D68F56053C193DB0640128E4765565970625B1E2878E116AC854E6DED412202CCDE0B0D8114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C", + "json": { + "Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw", + "TransactionType": "AMMDeposit", + "Asset": { + "currency": "XRP" + }, + "Asset2": { + "currency": "ETH", + "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9" + }, + "Amount": "1000", + "EPrice": "25", + "Fee": "10", + "Flags": 4194304, + "Sequence": 1432289, + "SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8", + "TxnSignature": "5E51EBC6B52A7C3BA5D0AE2FC8F62E779B80182009B3108A87AB6D770D68F56053C193DB0640128E4765565970625B1E2878E116AC854E6DED412202CCDE0B0D" + } + }, + { + "binary": "1200252200010000240015DAE168400000000000000A601AD5438D7EA4C68000B3813FCAB4EE68B3D0D735D6849465A9113EE048B3813FCAB4EE68B3D0D735D6849465A9113EE0487321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B874409D4F41FC452526C0AD17191959D9B6D04A3C73B3A6C29E0F34C8459675A83A7A7D6E3021390EC8C9BE6C93E11C167E12016465E523F64F9EB3194B0A52E418028114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C", + "json": { + "Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw", + "TransactionType": "AMMWithdraw", + "Asset": { + "currency": "XRP" + }, + "Asset2": { + "currency": "ETH", + "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9" + }, + "LPTokenIn": { + "currency": "B3813FCAB4EE68B3D0D735D6849465A9113EE048", + "issuer": "rH438jEAzTs5PYtV6CHZqpDpwCKQmPW9Cg", + "value": "1000" + }, + "Fee": "10", + "Flags": 65536, + "Sequence": 1432289, + "SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8", + "TxnSignature": "9D4F41FC452526C0AD17191959D9B6D04A3C73B3A6C29E0F34C8459675A83A7A7D6E3021390EC8C9BE6C93E11C167E12016465E523F64F9EB3194B0A52E41802" + } + }, + { + "binary": "1200252200080000240015DAE16140000000000003E868400000000000000A7321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B87440E2C60D56C337D6D73E4B7D53579C93C666605494E82A89DD58CFDE79E2A4866BCF52370A2146877A2EF748E98168373710001133A51B645D89491849079035018114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C", + "json": { + "Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw", + "TransactionType": "AMMWithdraw", + "Asset": { + "currency": "XRP" + }, + "Asset2": { + "currency": "ETH", + "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9" + }, + "Amount": "1000", + "Fee": "10", + "Flags": 524288, + "Sequence": 1432289, + "SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8", + "TxnSignature": "E2C60D56C337D6D73E4B7D53579C93C666605494E82A89DD58CFDE79E2A4866BCF52370A2146877A2EF748E98168373710001133A51B645D8949184907903501" + } + }, + { + "binary": "1200252200100000240015DAE16140000000000003E868400000000000000A6BD511C37937E080000000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C7321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B87440D2FCD7D03E53358BC6188BA88A7BA4FF2519B639C3B5C0EBCBDCB704426CA2837111430E92A6003D1CD0D81C63682C74839320539EC4F89B82AA5607714952028114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C", + "json": { + "Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw", + "TransactionType": "AMMWithdraw", + "Asset": { + "currency": "XRP" + }, + "Asset2": { + "currency": "ETH", + "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9" + }, + "Amount": "1000", + "Amount2": { + "currency": "ETH", + "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9", + "value": "500" + }, + "Fee": "10", + "Flags": 1048576, + "Sequence": 1432289, + "SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8", + "TxnSignature": "D2FCD7D03E53358BC6188BA88A7BA4FF2519B639C3B5C0EBCBDCB704426CA2837111430E92A6003D1CD0D81C63682C74839320539EC4F89B82AA560771495202" + } + }, + { + "binary": "1200252200200000240015DAE16140000000000003E868400000000000000A601AD5438D7EA4C68000B3813FCAB4EE68B3D0D735D6849465A9113EE048B3813FCAB4EE68B3D0D735D6849465A9113EE0487321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8744042DA5620E924E2D2059BBB4E0C4F03244140ACED93B543136FEEDF802165F814D09F45C7E2A4618468442516F4712A23B1D3332D5DBDBAE830337F39F259C90F8114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C", + "json": { + "Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw", + "TransactionType": "AMMWithdraw", + "Asset": { + "currency": "XRP" + }, + "Asset2": { + "currency": "ETH", + "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9" + }, + "Amount": "1000", + "LPTokenIn": { + "currency": "B3813FCAB4EE68B3D0D735D6849465A9113EE048", + "issuer": "rH438jEAzTs5PYtV6CHZqpDpwCKQmPW9Cg", + "value": "1000" + }, + "Fee": "10", + "Flags": 2097152, + "Sequence": 1432289, + "SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8", + "TxnSignature": "42DA5620E924E2D2059BBB4E0C4F03244140ACED93B543136FEEDF802165F814D09F45C7E2A4618468442516F4712A23B1D3332D5DBDBAE830337F39F259C90F" + } + }, + { + "binary": "1200252200400000240015DAE16140000000000003E868400000000000000A601B40000000000000197321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8744045BCEE5A12E5F5F1FB085A24F2F7FD962BBCB0D89A44A5319E3F7E3799E1870341880B6F684132971DDDF2E6B15356B3F407962D6D4E8DE10989F3B16E3CB90D8114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C", + "json": { + "Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw", + "TransactionType": "AMMWithdraw", + "Asset": { + "currency": "XRP" + }, + "Asset2": { + "currency": "ETH", + "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9" + }, + "Amount": "1000", + "EPrice": "25", + "Fee": "10", + "Flags": 4194304, + "Sequence": 1432289, + "SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8", + "TxnSignature": "45BCEE5A12E5F5F1FB085A24F2F7FD962BBCB0D89A44A5319E3F7E3799E1870341880B6F684132971DDDF2E6B15356B3F407962D6D4E8DE10989F3B16E3CB90D" + } + }, + { + "binary": "1200272200000000240015DAE168400000000000000A6CD4C8E1BC9BF04000B3813FCAB4EE68B3D0D735D6849465A9113EE048B3813FCAB4EE68B3D0D735D6849465A9113EE0486DD4CC6F3B40B6C000B3813FCAB4EE68B3D0D735D6849465A9113EE048B3813FCAB4EE68B3D0D735D6849465A9113EE0487321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B87440F8EAAFB5EC1A69275167589969F0B9764BACE6BC8CC81482C2FC5ACCE691EDBD0D88D141137B1253BB1B9AC90A8A52CB37F5B6F7E1028B06DD06F91BE06F5A0F8114F92F27CC5EE2F2760278FE096D0CBE32BDD3653AF019E01B81149A91957F8F16BC57F3F200CD8C98375BF1791586E1F10318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C", + "json": { + "Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw", + "TransactionType": "AMMBid", + "Asset": { + "currency": "XRP" + }, + "Asset2": { + "currency": "ETH", + "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9" + }, + "AuthAccounts": [ + { + "AuthAccount": { + "Account": "rEaHTti4HZsMBpxTAF4ncWxkcdqDh1h6P7" + } + } + ], + "BidMax": { + "currency": "B3813FCAB4EE68B3D0D735D6849465A9113EE048", + "issuer": "rH438jEAzTs5PYtV6CHZqpDpwCKQmPW9Cg", + "value": "35" + }, + "BidMin": { + "currency": "B3813FCAB4EE68B3D0D735D6849465A9113EE048", + "issuer": "rH438jEAzTs5PYtV6CHZqpDpwCKQmPW9Cg", + "value": "25" + }, + "Fee": "10", + "Flags": 0, + "Sequence": 1432289, + "SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8", + "TxnSignature": "F8EAAFB5EC1A69275167589969F0B9764BACE6BC8CC81482C2FC5ACCE691EDBD0D88D141137B1253BB1B9AC90A8A52CB37F5B6F7E1028B06DD06F91BE06F5A0F" + } + }, + { + "binary": "1200261500EA2200000000240015DAE168400000000000000A7321ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B87440BC2F6E76969E3747E9BDE183C97573B086212F09D5387460E6EE2F32953E85EAEB9618FBBEF077276E30E59D619FCF7C7BDCDDDD9EB94D7CE1DD5CE9246B21078114F92F27CC5EE2F2760278FE096D0CBE32BDD3653A0318000000000000000000000000000000000000000004180000000000000000000000004554480000000000FBEF9A3A2B814E807745FA3D9C32FFD155FA2E8C", + "json": { + "Account": "rP5ZkB5RZQaECsSVR4DeSFK4fAw52BYtbw", + "TransactionType": "AMMVote", + "Asset": { + "currency": "XRP" + }, + "Asset2": { + "currency": "ETH", + "issuer": "rPyfep3gcLzkosKC9XiE77Y8DZWG6iWDT9" + }, + "TradingFee": 234, + "Fee": "10", + "Flags": 0, + "Sequence": 1432289, + "SigningPubKey": "ED7453D2572A2104E7B266A45888C53F503CEB1F11DC4BB3710EB2995238EC65B8", + "TxnSignature": "BC2F6E76969E3747E9BDE183C97573B086212F09D5387460E6EE2F32953E85EAEB9618FBBEF077276E30E59D619FCF7C7BDCDDDD9EB94D7CE1DD5CE9246B2107" + } } - }], - "ledgerData": [{ - "binary": "01E91435016340767BF1C4A3EACEB081770D8ADE216C85445DD6FB002C6B5A2930F2DECE006DA18150CB18F6DD33F6F0990754C962A7CCE62F332FF9C13939B03B864117F0BDA86B6E9B4F873B5C3E520634D343EF5D9D9A4246643D64DAD278BA95DC0EAC6EB5350CF970D521276CDE21276CE60A00", - "json": { - "account_hash": "3B5C3E520634D343EF5D9D9A4246643D64DAD278BA95DC0EAC6EB5350CF970D5", - "close_flags": 0, - "close_time": 556231910, - "close_time_resolution": 10, - "ledger_index": 32052277, - "parent_close_time": 556231902, - "parent_hash": "EACEB081770D8ADE216C85445DD6FB002C6B5A2930F2DECE006DA18150CB18F6", - "total_coins": "99994494362043555", - "transaction_hash": "DD33F6F0990754C962A7CCE62F332FF9C13939B03B864117F0BDA86B6E9B4F87" + ], + "ledgerData": [ + { + "binary": "01E91435016340767BF1C4A3EACEB081770D8ADE216C85445DD6FB002C6B5A2930F2DECE006DA18150CB18F6DD33F6F0990754C962A7CCE62F332FF9C13939B03B864117F0BDA86B6E9B4F873B5C3E520634D343EF5D9D9A4246643D64DAD278BA95DC0EAC6EB5350CF970D521276CDE21276CE60A00", + "json": { + "account_hash": "3B5C3E520634D343EF5D9D9A4246643D64DAD278BA95DC0EAC6EB5350CF970D5", + "close_flags": 0, + "close_time": 556231910, + "close_time_resolution": 10, + "ledger_index": 32052277, + "parent_close_time": 556231902, + "parent_hash": "EACEB081770D8ADE216C85445DD6FB002C6B5A2930F2DECE006DA18150CB18F6", + "total_coins": "99994494362043555", + "transaction_hash": "DD33F6F0990754C962A7CCE62F332FF9C13939B03B864117F0BDA86B6E9B4F87" + } } - }] -} + ] +} \ No newline at end of file diff --git a/src/core/test_data/data-driven-tests.json b/src/core/test_data/data-driven-tests.json index 017624dd..7f860d39 100644 --- a/src/core/test_data/data-driven-tests.json +++ b/src/core/test_data/data-driven-tests.json @@ -483,13 +483,6 @@ "type": 5, "expected_hex": "5013" }, - { - "type_name": "Hash256", - "name": "TicketID", - "nth_of_type": 20, - "type": 5, - "expected_hex": "5014" - }, { "type_name": "Hash256", "name": "Digest", @@ -611,7 +604,7 @@ }, { "type_name": "Blob", - "name": "Generator", + "name": "URI", "nth_of_type": 5, "type": 7, "expected_hex": "75" @@ -721,13 +714,6 @@ "type": 8, "expected_hex": "84" }, - { - "type_name": "AccountID", - "name": "Target", - "nth_of_type": 7, - "type": 8, - "expected_hex": "87" - }, { "type_name": "AccountID", "name": "RegularKey", diff --git a/src/core/test_data/x-codec-fixtures.json b/src/core/test_data/x-codec-fixtures.json index 5408b721..5f5e4b79 100644 --- a/src/core/test_data/x-codec-fixtures.json +++ b/src/core/test_data/x-codec-fixtures.json @@ -1,232 +1,190 @@ { - "transactions": [{ - "rjson": { - "Account": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV", - "Destination": "rLQBHVhFnaC5gLEkgr6HgBJJ3bgeZHg9cj", - "TransactionType": "Payment", - "TxnSignature": "3045022022EB32AECEF7C644C891C19F87966DF9C62B1F34BABA6BE774325E4BB8E2DD62022100A51437898C28C2B297112DF8131F2BB39EA5FE613487DDD611525F1796264639", - "SigningPubKey": "034AADB09CFF4A4804073701EC53C3510CDC95917C2BB0150FB742D0C66E6CEE9E", - "Amount": "10000000000", - "DestinationTag": 1010, - "SourceTag": 84854, - "Fee": "10", - "Flags": 0, - "Sequence": 62 - }, - "xjson": { - "Account": "X7tFPvjMH7nDxP8nTGkeeggcUpCZj8UbyT2QoiRHGDfjqrB", - "Destination": "XVYmGpJqHS95ir411XvanwY1xt5Z2314WsamHPVgUNABUGV", - "TransactionType": "Payment", - "TxnSignature": "3045022022EB32AECEF7C644C891C19F87966DF9C62B1F34BABA6BE774325E4BB8E2DD62022100A51437898C28C2B297112DF8131F2BB39EA5FE613487DDD611525F1796264639", - "SigningPubKey": "034AADB09CFF4A4804073701EC53C3510CDC95917C2BB0150FB742D0C66E6CEE9E", - "Amount": "10000000000", - "Fee": "10", - "Flags": 0, - "Sequence": 62 - } - }, - { - "rjson": { - "Account": "r4DymtkgUAh2wqRxVfdd3Xtswzim6eC6c5", - "Amount": "199000000", - "Destination": "rsekGH9p9neiPxym2TMJhqaCzHFuokenTU", - "DestinationTag": 3663729509, - "Fee": "6335", - "Flags": 2147483648, - "LastLedgerSequence": 57313352, - "Sequence": 105791, - "SigningPubKey": "02053A627976CE1157461336AC65290EC1571CAAD1B327339980F7BF65EF776F83", - "TransactionType": "Payment", - "TxnSignature": "30440220086D3330CD6CE01D891A26BA0355D8D5A5D28A5C9A1D0C5E06E321C81A02318A0220027C3F6606E41FEA35103EDE5224CC489B6514ACFE27543185B0419DD02E301C" - }, - "xjson": { - "Account": "r4DymtkgUAh2wqRxVfdd3Xtswzim6eC6c5", - "Amount": "199000000", - "Destination": "X7cBoj6a5xSEfPCr6AStN9YPhbMAA2yaN2XYWwRJKAKb3y5", - "Fee": "6335", - "Flags": 2147483648, - "LastLedgerSequence": 57313352, - "Sequence": 105791, - "SigningPubKey": "02053A627976CE1157461336AC65290EC1571CAAD1B327339980F7BF65EF776F83", - "TransactionType": "Payment", - "TxnSignature": "30440220086D3330CD6CE01D891A26BA0355D8D5A5D28A5C9A1D0C5E06E321C81A02318A0220027C3F6606E41FEA35103EDE5224CC489B6514ACFE27543185B0419DD02E301C" - } - }, - { - "rjson": { - "Account": "rDsbeomae4FXwgQTJp9Rs64Qg9vDiTCdBv", - "Amount": "105302107", - "Destination": "r33hypJXDs47LVpmvta7hMW9pR8DYeBtkW", - "DestinationTag": 1658156118, - "Fee": "60000", - "Flags": 2147483648, - "LastLedgerSequence": 57313566, - "Sequence": 1113196, - "SigningPubKey": "03D847C2DBED3ABF0453F71DCD7641989136277218DF516AD49519C9693F32727E", - "TransactionType": "Payment", - "TxnSignature": "3045022100FCA10FBAC65EA60C115A970CD52E6A526B1F9DDB6C4F843DA3DE7A97DFF9492D022037824D0FC6F663FB08BE0F2812CBADE1F61836528D44945FC37F10CC03215111" - }, - "xjson": { - "Account": "rDsbeomae4FXwgQTJp9Rs64Qg9vDiTCdBv", - "Amount": "105302107", - "Destination": "X7ikFY5asEwp6ikt2AJdTfBLALEs5JN35kkeqKVeT1GdvY1", - "Fee": "60000", - "Flags": 2147483648, - "LastLedgerSequence": 57313566, - "Sequence": 1113196, - "SigningPubKey": "03D847C2DBED3ABF0453F71DCD7641989136277218DF516AD49519C9693F32727E", - "TransactionType": "Payment", - "TxnSignature": "3045022100FCA10FBAC65EA60C115A970CD52E6A526B1F9DDB6C4F843DA3DE7A97DFF9492D022037824D0FC6F663FB08BE0F2812CBADE1F61836528D44945FC37F10CC03215111" - } - }, - { - "rjson": { - "Account": "rDsbeomae4FXwgQTJp9Rs64Qg9vDiTCdBv", - "Amount": "3899911571", - "Destination": "rU2mEJSLqBRkYLVTv55rFTgQajkLTnT6mA", - "DestinationTag": 255406, - "Fee": "60000", - "Flags": 2147483648, - "LastLedgerSequence": 57313566, - "Sequence": 1113197, - "SigningPubKey": "03D847C2DBED3ABF0453F71DCD7641989136277218DF516AD49519C9693F32727E", - "TransactionType": "Payment", - "TxnSignature": "3044022077642D94BB3C49BF3CB4C804255EC830D2C6009EA4995E38A84602D579B8AAD702206FAD977C49980226E8B495BF03C8D9767380F1546BBF5A4FD47D604C0D2CCF9B" - }, - "xjson": { - "Account": "rDsbeomae4FXwgQTJp9Rs64Qg9vDiTCdBv", - "Amount": "3899911571", - "Destination": "XVfH8gwNWVbB5Kft16jmTNgGTqgw1dzA8ZTBkNjSLw6JdXS", - "Fee": "60000", - "Flags": 2147483648, - "LastLedgerSequence": 57313566, - "Sequence": 1113197, - "SigningPubKey": "03D847C2DBED3ABF0453F71DCD7641989136277218DF516AD49519C9693F32727E", - "TransactionType": "Payment", - "TxnSignature": "3044022077642D94BB3C49BF3CB4C804255EC830D2C6009EA4995E38A84602D579B8AAD702206FAD977C49980226E8B495BF03C8D9767380F1546BBF5A4FD47D604C0D2CCF9B" - } - }, - { - "rjson": { - "Account": "r4eEbLKZGbVSBHnSUBZW8i5XaMjGLdqT4a", - "Amount": "820370849", - "Destination": "rDhmyBh4JwDAtXyRZDarNgg52UcLLRoGje", - "DestinationTag": 2017780486, - "Fee": "6000", - "Flags": 2147483648, - "LastLedgerSequence": 57315579, - "Sequence": 234254, - "SigningPubKey": "038CF47114672A12B269AEE015BF7A8438609B994B0640E4B28B2F56E93D948B15", - "TransactionType": "Payment", - "TxnSignature": "3044022015004653B1CBDD5CCA1F7B38555F1B37FE3F811E9D5070281CCC6C8A93460D870220679E9899184901EA69750C8A9325768490B1B9C1A733842446727653FF3D1DC0" + "transactions": [ + { + "rjson": { + "Account": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV", + "Destination": "rLQBHVhFnaC5gLEkgr6HgBJJ3bgeZHg9cj", + "TransactionType": "Payment", + "TxnSignature": "3045022022EB32AECEF7C644C891C19F87966DF9C62B1F34BABA6BE774325E4BB8E2DD62022100A51437898C28C2B297112DF8131F2BB39EA5FE613487DDD611525F1796264639", + "SigningPubKey": "034AADB09CFF4A4804073701EC53C3510CDC95917C2BB0150FB742D0C66E6CEE9E", + "Amount": "10000000000", + "DestinationTag": 1010, + "SourceTag": 84854, + "Fee": "10", + "Flags": 0, + "Sequence": 62 + }, + "xjson": { + "Account": "X7tFPvjMH7nDxP8nTGkeeggcUpCZj8UbyT2QoiRHGDfjqrB", + "Destination": "XVYmGpJqHS95ir411XvanwY1xt5Z2314WsamHPVgUNABUGV", + "TransactionType": "Payment", + "TxnSignature": "3045022022EB32AECEF7C644C891C19F87966DF9C62B1F34BABA6BE774325E4BB8E2DD62022100A51437898C28C2B297112DF8131F2BB39EA5FE613487DDD611525F1796264639", + "SigningPubKey": "034AADB09CFF4A4804073701EC53C3510CDC95917C2BB0150FB742D0C66E6CEE9E", + "Amount": "10000000000", + "Fee": "10", + "Flags": 0, + "Sequence": 62 + } }, - "xjson": { - "Account": "r4eEbLKZGbVSBHnSUBZW8i5XaMjGLdqT4a", - "Amount": "820370849", - "Destination": "XV31huWNJQXsAJFwgE6rnC8uf8jRx4H4waq4MyGUxz5CXzS", - "Fee": "6000", - "Flags": 2147483648, - "LastLedgerSequence": 57315579, - "Sequence": 234254, - "SigningPubKey": "038CF47114672A12B269AEE015BF7A8438609B994B0640E4B28B2F56E93D948B15", - "TransactionType": "Payment", - "TxnSignature": "3044022015004653B1CBDD5CCA1F7B38555F1B37FE3F811E9D5070281CCC6C8A93460D870220679E9899184901EA69750C8A9325768490B1B9C1A733842446727653FF3D1DC0" - } - }, - { - "rjson": { - "Account": "rsGeDwS4rpocUumu9smpXomzaaeG4Qyifz", - "Amount": "1500000000", - "Destination": "rDxfhNRgCDNDckm45zT5ayhKDC4Ljm7UoP", - "DestinationTag": 1000635172, - "Fee": "5000", - "Flags": 2147483648, - "Sequence": 55741075, - "SigningPubKey": "02ECB814477DF9D8351918878E235EE6AF147A2A5C20F1E71F291F0F3303357C36", - "SourceTag": 1000635172, - "TransactionType": "Payment", - "TxnSignature": "304402202A90972E21823214733082E1977F9EA2D6B5101902F108E7BDD7D128CEEA7AF3022008852C8DAD746A7F18E66A47414FABF551493674783E8EA7409C501D3F05F99A" + { + "rjson": { + "Account": "r4DymtkgUAh2wqRxVfdd3Xtswzim6eC6c5", + "Amount": "199000000", + "Destination": "rsekGH9p9neiPxym2TMJhqaCzHFuokenTU", + "DestinationTag": 3663729509, + "Fee": "6335", + "Flags": 2147483648, + "LastLedgerSequence": 57313352, + "Sequence": 105791, + "SigningPubKey": "02053A627976CE1157461336AC65290EC1571CAAD1B327339980F7BF65EF776F83", + "TransactionType": "Payment", + "TxnSignature": "30440220086D3330CD6CE01D891A26BA0355D8D5A5D28A5C9A1D0C5E06E321C81A02318A0220027C3F6606E41FEA35103EDE5224CC489B6514ACFE27543185B0419DD02E301C" + }, + "xjson": { + "Account": "r4DymtkgUAh2wqRxVfdd3Xtswzim6eC6c5", + "Amount": "199000000", + "Destination": "X7cBoj6a5xSEfPCr6AStN9YPhbMAA2yaN2XYWwRJKAKb3y5", + "Fee": "6335", + "Flags": 2147483648, + "LastLedgerSequence": 57313352, + "Sequence": 105791, + "SigningPubKey": "02053A627976CE1157461336AC65290EC1571CAAD1B327339980F7BF65EF776F83", + "TransactionType": "Payment", + "TxnSignature": "30440220086D3330CD6CE01D891A26BA0355D8D5A5D28A5C9A1D0C5E06E321C81A02318A0220027C3F6606E41FEA35103EDE5224CC489B6514ACFE27543185B0419DD02E301C" + } }, - "xjson": { - "Account": "rsGeDwS4rpocUumu9smpXomzaaeG4Qyifz", - "Amount": "1500000000", - "Destination": "XVBkK1yLutMqFGwTm6hykn7YXGDUrjsZSkpzMgRveZrMbHs", - "Fee": "5000", - "Flags": 2147483648, - "Sequence": 55741075, - "SigningPubKey": "02ECB814477DF9D8351918878E235EE6AF147A2A5C20F1E71F291F0F3303357C36", - "SourceTag": 1000635172, - "TransactionType": "Payment", - "TxnSignature": "304402202A90972E21823214733082E1977F9EA2D6B5101902F108E7BDD7D128CEEA7AF3022008852C8DAD746A7F18E66A47414FABF551493674783E8EA7409C501D3F05F99A" - } - }, - { - "rjson": { - "Account": "rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt", - "Amount": "48918500000", - "Destination": "rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh", - "DestinationTag": 105959914, - "Fee": "10", - "Flags": 2147483648, - "Sequence": 32641, - "SigningPubKey": "02E98DA545CCCC5D14C82594EE9E6CCFCF5171108E2410B3E784183E1068D33429", - "TransactionType": "Payment", - "TxnSignature": "304502210091DCA7AF189CD9DC93BDE24DEAE87381FBF16789C43113EE312241D648982B2402201C6055FEFFF1F119640AAC0B32C4F37375B0A96033E0527A21C1366920D6A524" + { + "rjson": { + "Account": "rDsbeomae4FXwgQTJp9Rs64Qg9vDiTCdBv", + "Amount": "105302107", + "Destination": "r33hypJXDs47LVpmvta7hMW9pR8DYeBtkW", + "DestinationTag": 1658156118, + "Fee": "60000", + "Flags": 2147483648, + "LastLedgerSequence": 57313566, + "Sequence": 1113196, + "SigningPubKey": "03D847C2DBED3ABF0453F71DCD7641989136277218DF516AD49519C9693F32727E", + "TransactionType": "Payment", + "TxnSignature": "3045022100FCA10FBAC65EA60C115A970CD52E6A526B1F9DDB6C4F843DA3DE7A97DFF9492D022037824D0FC6F663FB08BE0F2812CBADE1F61836528D44945FC37F10CC03215111" + }, + "xjson": { + "Account": "rDsbeomae4FXwgQTJp9Rs64Qg9vDiTCdBv", + "Amount": "105302107", + "Destination": "X7ikFY5asEwp6ikt2AJdTfBLALEs5JN35kkeqKVeT1GdvY1", + "Fee": "60000", + "Flags": 2147483648, + "LastLedgerSequence": 57313566, + "Sequence": 1113196, + "SigningPubKey": "03D847C2DBED3ABF0453F71DCD7641989136277218DF516AD49519C9693F32727E", + "TransactionType": "Payment", + "TxnSignature": "3045022100FCA10FBAC65EA60C115A970CD52E6A526B1F9DDB6C4F843DA3DE7A97DFF9492D022037824D0FC6F663FB08BE0F2812CBADE1F61836528D44945FC37F10CC03215111" + } }, - "xjson": { - "Account": "rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt", - "Amount": "48918500000", - "Destination": "XVH3aqvbYGhRhrD1FYSzGooNuxdzbG3VR2fuM47oqbXxQr7", - "Fee": "10", - "Flags": 2147483648, - "Sequence": 32641, - "SigningPubKey": "02E98DA545CCCC5D14C82594EE9E6CCFCF5171108E2410B3E784183E1068D33429", - "TransactionType": "Payment", - "TxnSignature": "304502210091DCA7AF189CD9DC93BDE24DEAE87381FBF16789C43113EE312241D648982B2402201C6055FEFFF1F119640AAC0B32C4F37375B0A96033E0527A21C1366920D6A524" - } - }, - { - "rjson": { - "PreviousTxnLgrSeq": 239, - "LedgerEntryType": "RippleState", - "LowLimit": { - "currency": "USD", - "value": "0", - "issuer": "rnziParaNb8nsU4aruQdwYE3j5jUcqjzFm" + { + "rjson": { + "Account": "rDsbeomae4FXwgQTJp9Rs64Qg9vDiTCdBv", + "Amount": "3899911571", + "Destination": "rU2mEJSLqBRkYLVTv55rFTgQajkLTnT6mA", + "DestinationTag": 255406, + "Fee": "60000", + "Flags": 2147483648, + "LastLedgerSequence": 57313566, + "Sequence": 1113197, + "SigningPubKey": "03D847C2DBED3ABF0453F71DCD7641989136277218DF516AD49519C9693F32727E", + "TransactionType": "Payment", + "TxnSignature": "3044022077642D94BB3C49BF3CB4C804255EC830D2C6009EA4995E38A84602D579B8AAD702206FAD977C49980226E8B495BF03C8D9767380F1546BBF5A4FD47D604C0D2CCF9B" }, - "PreviousTxnID": "C6A2521BBCCF13282C4FFEBC00D47BBA18C6CE5F5E4E0EFC3E3FCE364BAFC6B8", - "Flags": 131072, - "Balance": { - "currency": "USD", - "value": "0", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji" + "xjson": { + "Account": "rDsbeomae4FXwgQTJp9Rs64Qg9vDiTCdBv", + "Amount": "3899911571", + "Destination": "XVfH8gwNWVbB5Kft16jmTNgGTqgw1dzA8ZTBkNjSLw6JdXS", + "Fee": "60000", + "Flags": 2147483648, + "LastLedgerSequence": 57313566, + "Sequence": 1113197, + "SigningPubKey": "03D847C2DBED3ABF0453F71DCD7641989136277218DF516AD49519C9693F32727E", + "TransactionType": "Payment", + "TxnSignature": "3044022077642D94BB3C49BF3CB4C804255EC830D2C6009EA4995E38A84602D579B8AAD702206FAD977C49980226E8B495BF03C8D9767380F1546BBF5A4FD47D604C0D2CCF9B" + } + }, + { + "rjson": { + "Account": "r4eEbLKZGbVSBHnSUBZW8i5XaMjGLdqT4a", + "Amount": "820370849", + "Destination": "rDhmyBh4JwDAtXyRZDarNgg52UcLLRoGje", + "DestinationTag": 2017780486, + "Fee": "6000", + "Flags": 2147483648, + "LastLedgerSequence": 57315579, + "Sequence": 234254, + "SigningPubKey": "038CF47114672A12B269AEE015BF7A8438609B994B0640E4B28B2F56E93D948B15", + "TransactionType": "Payment", + "TxnSignature": "3044022015004653B1CBDD5CCA1F7B38555F1B37FE3F811E9D5070281CCC6C8A93460D870220679E9899184901EA69750C8A9325768490B1B9C1A733842446727653FF3D1DC0" }, - "HighLimit": { - "currency": "USD", - "value": "10", - "issuer": "rMYBVwiY95QyUnCeuBQA1D47kXA9zuoBui" + "xjson": { + "Account": "r4eEbLKZGbVSBHnSUBZW8i5XaMjGLdqT4a", + "Amount": "820370849", + "Destination": "XV31huWNJQXsAJFwgE6rnC8uf8jRx4H4waq4MyGUxz5CXzS", + "Fee": "6000", + "Flags": 2147483648, + "LastLedgerSequence": 57315579, + "Sequence": 234254, + "SigningPubKey": "038CF47114672A12B269AEE015BF7A8438609B994B0640E4B28B2F56E93D948B15", + "TransactionType": "Payment", + "TxnSignature": "3044022015004653B1CBDD5CCA1F7B38555F1B37FE3F811E9D5070281CCC6C8A93460D870220679E9899184901EA69750C8A9325768490B1B9C1A733842446727653FF3D1DC0" } }, - "xjson": { - "PreviousTxnLgrSeq": 239, - "LedgerEntryType": "RippleState", - "LowLimit": { - "currency": "USD", - "value": "0", - "issuer": "X7jqKn4UidCF7AQ7Eeyfn3vJubztfhF1LwTD9PV2QhPpnvx" + { + "rjson": { + "Account": "rsGeDwS4rpocUumu9smpXomzaaeG4Qyifz", + "Amount": "1500000000", + "Destination": "rDxfhNRgCDNDckm45zT5ayhKDC4Ljm7UoP", + "DestinationTag": 1000635172, + "Fee": "5000", + "Flags": 2147483648, + "Sequence": 55741075, + "SigningPubKey": "02ECB814477DF9D8351918878E235EE6AF147A2A5C20F1E71F291F0F3303357C36", + "SourceTag": 1000635172, + "TransactionType": "Payment", + "TxnSignature": "304402202A90972E21823214733082E1977F9EA2D6B5101902F108E7BDD7D128CEEA7AF3022008852C8DAD746A7F18E66A47414FABF551493674783E8EA7409C501D3F05F99A" }, - "PreviousTxnID": "C6A2521BBCCF13282C4FFEBC00D47BBA18C6CE5F5E4E0EFC3E3FCE364BAFC6B8", - "Flags": 131072, - "Balance": { - "currency": "USD", - "value": "0", - "issuer": "X7TYFRtYHMcHtT2qNycMwgXzFbcRvdrhMLy5kJrYHpJDkc2" + "xjson": { + "Account": "rsGeDwS4rpocUumu9smpXomzaaeG4Qyifz", + "Amount": "1500000000", + "Destination": "XVBkK1yLutMqFGwTm6hykn7YXGDUrjsZSkpzMgRveZrMbHs", + "Fee": "5000", + "Flags": 2147483648, + "Sequence": 55741075, + "SigningPubKey": "02ECB814477DF9D8351918878E235EE6AF147A2A5C20F1E71F291F0F3303357C36", + "SourceTag": 1000635172, + "TransactionType": "Payment", + "TxnSignature": "304402202A90972E21823214733082E1977F9EA2D6B5101902F108E7BDD7D128CEEA7AF3022008852C8DAD746A7F18E66A47414FABF551493674783E8EA7409C501D3F05F99A" + } + }, + { + "rjson": { + "Account": "rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt", + "Amount": "48918500000", + "Destination": "rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh", + "DestinationTag": 105959914, + "Fee": "10", + "Flags": 2147483648, + "Sequence": 32641, + "SigningPubKey": "02E98DA545CCCC5D14C82594EE9E6CCFCF5171108E2410B3E784183E1068D33429", + "TransactionType": "Payment", + "TxnSignature": "304502210091DCA7AF189CD9DC93BDE24DEAE87381FBF16789C43113EE312241D648982B2402201C6055FEFFF1F119640AAC0B32C4F37375B0A96033E0527A21C1366920D6A524" }, - "HighLimit": { - "currency": "USD", - "value": "10", - "issuer": "XVc7LPeF5cfwQ1XRmz6Ursck9i8yWpb1yqApvW4ZGuDNZbD" + "xjson": { + "Account": "rHWcuuZoFvDS6gNbmHSdpb7u1hZzxvCoMt", + "Amount": "48918500000", + "Destination": "XVH3aqvbYGhRhrD1FYSzGooNuxdzbG3VR2fuM47oqbXxQr7", + "Fee": "10", + "Flags": 2147483648, + "Sequence": 32641, + "SigningPubKey": "02E98DA545CCCC5D14C82594EE9E6CCFCF5171108E2410B3E784183E1068D33429", + "TransactionType": "Payment", + "TxnSignature": "304502210091DCA7AF189CD9DC93BDE24DEAE87381FBF16789C43113EE312241D648982B2402201C6055FEFFF1F119640AAC0B32C4F37375B0A96033E0527A21C1366920D6A524" } } - }] -} + ] +} \ No newline at end of file diff --git a/src/models/currency/mod.rs b/src/models/currency/mod.rs index dc2a5331..afcff11a 100644 --- a/src/models/currency/mod.rs +++ b/src/models/currency/mod.rs @@ -8,6 +8,8 @@ use serde::{Deserialize, Serialize}; use strum_macros::Display; pub use xrp::*; +use super::{IssuedCurrencyAmount, XRPAmount}; + pub trait ToAmount<'a, A> { fn to_amount(&self, value: Cow<'a, str>) -> A; } @@ -38,3 +40,31 @@ impl<'a> From> for Currency<'a> { Self::XRP(value) } } + +impl<'a> From> for Currency<'a> { + fn from(value: IssuedCurrencyAmount<'a>) -> Self { + IssuedCurrency::from(IssuedCurrency::new(value.currency, value.issuer)).into() + } +} + +impl<'a> From> for Currency<'a> { + fn from(_value: XRPAmount<'a>) -> Self { + XRP::from(XRP::new()).into() + } +} + +impl<'a> From<&IssuedCurrencyAmount<'a>> for Currency<'a> { + fn from(value: &IssuedCurrencyAmount<'a>) -> Self { + IssuedCurrency::from(IssuedCurrency::new( + value.currency.clone(), + value.issuer.clone(), + )) + .into() + } +} + +impl<'a> From<&XRPAmount<'a>> for Currency<'a> { + fn from(_value: &XRPAmount<'a>) -> Self { + XRP::from(XRP::new()).into() + } +} diff --git a/src/models/ledger/objects/bridge.rs b/src/models/ledger/objects/bridge.rs new file mode 100644 index 00000000..6c99eee8 --- /dev/null +++ b/src/models/ledger/objects/bridge.rs @@ -0,0 +1,63 @@ +use alloc::borrow::Cow; +use serde::{Deserialize, Serialize}; +use serde_with::skip_serializing_none; + +use crate::models::{Model, NoFlags, XChainBridge, XRPAmount}; + +use super::{CommonFields, LedgerEntryType, LedgerObject}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +#[skip_serializing_none] +pub struct Bridge<'a> { + #[serde(flatten)] + pub common_fields: CommonFields<'a, NoFlags>, + pub account: Cow<'a, str>, + pub signature_reward: XRPAmount<'a>, + #[serde(rename = "XChainAccountClaimCount")] + pub xchain_account_claim_count: u64, + #[serde(rename = "XChainAccountCreateCount")] + pub xchain_account_create_count: u64, + pub xchain_bridge: XChainBridge<'a>, + #[serde(rename = "XChainClaimID")] + pub xchain_claim_id: Cow<'a, str>, + pub min_account_create_amount: Option>, +} + +impl Model for Bridge<'_> {} + +impl LedgerObject for Bridge<'_> { + fn get_ledger_entry_type(&self) -> super::LedgerEntryType { + self.common_fields.get_ledger_entry_type() + } +} + +impl<'a> Bridge<'a> { + pub fn new( + index: Option>, + ledger_index: Option>, + account: Cow<'a, str>, + signature_reward: XRPAmount<'a>, + xchain_account_claim_count: u64, + xchain_account_create_count: u64, + xchain_bridge: XChainBridge<'a>, + xchain_claim_id: Cow<'a, str>, + min_account_create_amount: Option>, + ) -> Bridge<'a> { + Bridge { + common_fields: CommonFields { + flags: Default::default(), + ledger_entry_type: LedgerEntryType::Bridge, + index, + ledger_index, + }, + account, + signature_reward, + xchain_account_claim_count, + xchain_account_create_count, + xchain_bridge, + xchain_claim_id, + min_account_create_amount, + } + } +} diff --git a/src/models/ledger/objects/mod.rs b/src/models/ledger/objects/mod.rs index 1800162a..b8c99ea7 100644 --- a/src/models/ledger/objects/mod.rs +++ b/src/models/ledger/objects/mod.rs @@ -1,6 +1,7 @@ pub mod account_root; pub mod amendments; pub mod amm; +pub mod bridge; pub mod check; pub mod deposit_preauth; pub mod directory_node; @@ -15,6 +16,8 @@ pub mod pay_channel; pub mod ripple_state; pub mod signer_list; pub mod ticket; +pub mod xchain_owned_claim_id; +pub mod xchain_owned_create_account_claim_id; pub use account_root::*; pub use amendments::*; @@ -42,13 +45,14 @@ use serde_with::skip_serializing_none; use strum_macros::Display; use crate::_serde::lgr_obj_flags; -use crate::models::FlagCollection; +use crate::models::{Amount, FlagCollection}; #[derive(Debug, Clone, Serialize, Deserialize, Display, PartialEq, Eq)] pub enum LedgerEntryType { AccountRoot = 0x0061, Amendments = 0x0066, AMM = 0x0079, + Bridge = 0x0069, Check = 0x0043, DepositPreauth = 0x0070, DirectoryNode = 0x0064, @@ -63,6 +67,20 @@ pub enum LedgerEntryType { RippleState = 0x0072, SignerList = 0x0053, Ticket = 0x0054, + XChainOwnedClaimID = 0x0071, + XChainOwnedCreateAccountClaimID = 0x0074, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +#[skip_serializing_none] +pub struct XChainClaimProofSig<'a> { + pub amount: Amount<'a>, + pub attestation_reward_account: Cow<'a, str>, + pub attestation_signer_account: Cow<'a, str>, + pub destination: Cow<'a, str>, + pub public_key: Cow<'a, str>, + pub was_locking_chain_send: u8, } /// The base fields for all ledger object models. diff --git a/src/models/ledger/objects/xchain_owned_claim_id.rs b/src/models/ledger/objects/xchain_owned_claim_id.rs new file mode 100644 index 00000000..b08693a4 --- /dev/null +++ b/src/models/ledger/objects/xchain_owned_claim_id.rs @@ -0,0 +1,59 @@ +use alloc::{borrow::Cow, vec::Vec}; +use serde::{Deserialize, Serialize}; +use serde_with::skip_serializing_none; + +use crate::models::{Amount, Model, NoFlags, XChainBridge}; + +use super::{CommonFields, LedgerEntryType, LedgerObject, XChainClaimProofSig}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +#[skip_serializing_none] +pub struct XChainOwnedClaimID<'a> { + #[serde(flatten)] + pub common_fields: CommonFields<'a, NoFlags>, + pub account: Cow<'a, str>, + pub other_chain_source: Cow<'a, str>, + pub signature_reward: Amount<'a>, + #[serde(rename = "XChainBridge")] + pub xchain_bridge: XChainBridge<'a>, + #[serde(rename = "XChainClaimAttestations")] + pub xchain_claim_attestations: Vec>, + pub xchain_claim_id: Cow<'a, str>, +} + +impl Model for XChainOwnedClaimID<'_> {} + +impl LedgerObject for XChainOwnedClaimID<'_> { + fn get_ledger_entry_type(&self) -> super::LedgerEntryType { + self.common_fields.get_ledger_entry_type() + } +} + +impl<'a> XChainOwnedClaimID<'a> { + pub fn new( + index: Option>, + ledger_index: Option>, + account: Cow<'a, str>, + other_chain_source: Cow<'a, str>, + signature_reward: Amount<'a>, + xchain_bridge: XChainBridge<'a>, + xchain_claim_attestations: Vec>, + xchain_claim_id: Cow<'a, str>, + ) -> XChainOwnedClaimID<'a> { + XChainOwnedClaimID { + common_fields: CommonFields { + flags: Default::default(), + ledger_entry_type: LedgerEntryType::XChainOwnedClaimID, + index, + ledger_index, + }, + account, + other_chain_source, + signature_reward, + xchain_bridge, + xchain_claim_attestations, + xchain_claim_id, + } + } +} diff --git a/src/models/ledger/objects/xchain_owned_create_account_claim_id.rs b/src/models/ledger/objects/xchain_owned_create_account_claim_id.rs new file mode 100644 index 00000000..b81ec981 --- /dev/null +++ b/src/models/ledger/objects/xchain_owned_create_account_claim_id.rs @@ -0,0 +1,21 @@ +use alloc::{borrow::Cow, vec::Vec}; +use serde::{Deserialize, Serialize}; +use serde_with::skip_serializing_none; + +use crate::models::{NoFlags, XChainBridge}; + +use super::{CommonFields, XChainClaimProofSig}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +#[skip_serializing_none] +pub struct XChainOwnedCreateAccountClaimID<'a> { + #[serde(flatten)] + pub common_fields: CommonFields<'a, NoFlags>, + pub account: Cow<'a, str>, + #[serde(rename = "XChainAccountCreateCount")] + pub xchain_account_create_count: u64, + #[serde(rename = "XChainBridge")] + pub xchain_bridge: XChainBridge<'a>, + pub xchain_create_account_attestations: Vec>, +} diff --git a/src/models/mod.rs b/src/models/mod.rs index 2e402d77..815e4aa3 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -47,6 +47,15 @@ pub struct PathStep<'a> { type_hex: Option>, } +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +pub struct XChainBridge<'a> { + pub issuing_chain_door: Cow<'a, str>, + pub issuing_chain_issue: Currency<'a>, + pub locking_chain_door: Cow<'a, str>, + pub locking_chain_issue: Currency<'a>, +} + /// For use with serde defaults. fn default_false() -> Option { Some(false) diff --git a/src/models/model.rs b/src/models/model.rs index 7271c0de..1fbc2278 100644 --- a/src/models/model.rs +++ b/src/models/model.rs @@ -11,9 +11,6 @@ pub trait Model { /// Simply forwards the error from `get_errors` if there was one. fn validate(&self) -> Result<()> { - match self.get_errors() { - Ok(_no_error) => Ok(()), - Err(error) => Err(error), - } + self.get_errors() } } diff --git a/src/models/transactions/account_set.rs b/src/models/transactions/account_set.rs index 60558e2a..66082045 100644 --- a/src/models/transactions/account_set.rs +++ b/src/models/transactions/account_set.rs @@ -120,7 +120,7 @@ pub struct AccountSet<'a> { pub tick_size: Option, } -impl<'a: 'static> Model for AccountSet<'a> { +impl<'a> Model for AccountSet<'a> { fn get_errors(&self) -> Result<()> { match self._get_tick_size_error() { Err(error) => Err!(error), diff --git a/src/models/transactions/exceptions.rs b/src/models/transactions/exceptions.rs index c13198fb..432f6fae 100644 --- a/src/models/transactions/exceptions.rs +++ b/src/models/transactions/exceptions.rs @@ -345,3 +345,52 @@ pub enum XRPLSignerListSetException<'a> { #[cfg(feature = "std")] impl<'a> alloc::error::Error for XRPLSignerListSetException<'a> {} + +#[derive(Debug, Clone, PartialEq, Eq, Error)] +pub enum XRPLXChainClaimException { + #[error("`amount` must match either `locking_chain_issue` or `issuing_chain_issue`")] + AmountMismatch, +} + +#[cfg(feature = "std")] +impl alloc::error::Error for XRPLXChainClaimException {} + +#[derive(Debug, Clone, PartialEq, Eq, Error)] +pub enum XRPLXChainCreateBridgeException { + #[error("Cannot have the same door accounts on the locking and issuing chain")] + SameDoorAccounts, + #[error( + "The `account` field must either match the `locking_chain_door` or `issuing_chain_door`" + )] + AccountDoorMismatch, + #[error("Bridge must be XRP-XRP or IOU-IOU")] + CrossCurrencyBridgeNotAllowed, + #[error("Cannot have MinAccountCreateAmount if bridge is IOU-IOU")] + MinAccountCreateAmountForIOU, + #[error("`signature_reward` must be numeric")] + SignatureRewartMustBeNumberic, + #[error("`min_account_create_amount` must be numeric")] + MinAccountCreateAmountMustBeNumberic, +} + +#[cfg(feature = "std")] +impl alloc::error::Error for XRPLXChainCreateBridgeException {} + +#[derive(Debug, Clone, PartialEq, Eq, Error)] +pub enum XRPLXChainCreateClaimIDException { + #[error("`other_chain_source` must be a valid XRPL address")] + OtherChainSourceIsInvalid, +} + +#[cfg(feature = "std")] +impl alloc::error::Error for XRPLXChainCreateClaimIDException {} + +#[derive(Debug, Clone, PartialEq, Eq, Error)] +pub enum XRPLXChainModifyBridgeException { + #[error("Must either change `signature_reward`, change `min_account_create_amount`, or clear `min_account_create_amount`")] + MustChangeOrClear, + #[error("`account` must be either `locking_chain_door` or `issuing_chain_door`")] + AccountDoorMismatch, + #[error("Cannot have MinAccountCreateAmount if bridge is IOU-IOU")] + CannotHaveMinAccountCreateAmount, +} diff --git a/src/models/transactions/mod.rs b/src/models/transactions/mod.rs index 25e4dd06..3715da97 100644 --- a/src/models/transactions/mod.rs +++ b/src/models/transactions/mod.rs @@ -24,6 +24,14 @@ pub mod set_regular_key; pub mod signer_list_set; pub mod ticket_create; pub mod trust_set; +pub mod xchain_account_create_commit; +pub mod xchain_add_account_create_attestation; +pub mod xchain_add_claim_attestation; +pub mod xchain_claim; +pub mod xchain_commit; +pub mod xchain_create_bridge; +pub mod xchain_create_claim_id; +pub mod xchain_modify_bridge; use super::FlagCollection; use crate::core::binarycodec::encode; @@ -75,6 +83,14 @@ pub enum TransactionType { SignerListSet, TicketCreate, TrustSet, + XChainAccountCreateCommit, + XChainAddAccountCreateAttestation, + XChainAddClaimAttestation, + XChainClaim, + XChainCommit, + XChainCreateBridge, + XChainCreateClaimID, + XChainModifyBridge, // Psuedo-Transaction types, EnableAmendment, diff --git a/src/models/transactions/xchain_account_create_commit.rs b/src/models/transactions/xchain_account_create_commit.rs new file mode 100644 index 00000000..9c9fe4dd --- /dev/null +++ b/src/models/transactions/xchain_account_create_commit.rs @@ -0,0 +1,107 @@ +use core::fmt::Debug; + +use alloc::{borrow::Cow, vec::Vec}; +use serde::{Deserialize, Serialize}; +use serde_with::skip_serializing_none; + +use crate::models::{Amount, FlagCollection, Model, NoFlags, XChainBridge, XRPAmount}; + +use super::{CommonFields, Memo, Signer, Transaction, TransactionType}; + +#[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +#[skip_serializing_none] +pub struct XChainAccountCreateCommit<'a> { + #[serde(flatten)] + pub common_fields: CommonFields<'a, NoFlags>, + pub amount: Amount<'a>, + pub destination: Cow<'a, str>, + #[serde(rename = "XChainBridge")] + pub xchain_bridge: XChainBridge<'a>, + pub signature_reward: Option>, +} + +impl Model for XChainAccountCreateCommit<'_> {} + +impl<'a> Transaction<'a, NoFlags> for XChainAccountCreateCommit<'a> { + fn get_transaction_type(&self) -> super::TransactionType { + TransactionType::XChainAccountCreateCommit + } + + fn get_common_fields(&self) -> &CommonFields<'_, NoFlags> { + &self.common_fields + } + + fn get_mut_common_fields(&mut self) -> &mut CommonFields<'a, NoFlags> { + &mut self.common_fields + } +} + +impl<'a> XChainAccountCreateCommit<'a> { + pub fn new( + account: Cow<'a, str>, + account_txn_id: Option>, + fee: Option>, + last_ledger_sequence: Option, + memos: Option>, + sequence: Option, + signers: Option>>, + source_tag: Option, + ticket_sequence: Option, + amount: Amount<'a>, + destination: Cow<'a, str>, + xchain_bridge: XChainBridge<'a>, + signature_reward: Option>, + ) -> XChainAccountCreateCommit<'a> { + XChainAccountCreateCommit { + common_fields: CommonFields { + account, + transaction_type: TransactionType::XChainAccountCreateCommit, + account_txn_id, + fee, + flags: FlagCollection::default(), + last_ledger_sequence, + memos, + sequence, + signers, + source_tag, + ticket_sequence, + network_id: None, + signing_pub_key: None, + txn_signature: None, + }, + amount, + destination, + xchain_bridge, + signature_reward, + } + } +} + +#[cfg(test)] +mod test_serde { + use super::XChainAccountCreateCommit; + + #[test] + fn test_deserialize() { + let json = r#"{ + "Account": "rwEqJ2UaQHe7jihxGqmx6J4xdbGiiyMaGa", + "Destination": "rD323VyRjgzzhY4bFpo44rmyh2neB5d8Mo", + "TransactionType": "XChainAccountCreateCommit", + "Amount": "20000000", + "SignatureReward": "100", + "XChainBridge": { + "LockingChainDoor": "rMAXACCrp3Y8PpswXcg3bKggHX76V3F8M4", + "LockingChainIssue": { + "currency": "XRP" + }, + "IssuingChainDoor": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "IssuingChainIssue": { + "currency": "XRP" + } + } + }"#; + let txn: XChainAccountCreateCommit<'_> = serde_json::from_str(json).unwrap(); + assert_eq!(txn.amount, "20000000".into()); + } +} diff --git a/src/models/transactions/xchain_add_account_create_attestation.rs b/src/models/transactions/xchain_add_account_create_attestation.rs new file mode 100644 index 00000000..b7fe5052 --- /dev/null +++ b/src/models/transactions/xchain_add_account_create_attestation.rs @@ -0,0 +1,149 @@ +use alloc::{borrow::Cow, vec::Vec}; +use serde::{Deserialize, Serialize}; +use serde_with::skip_serializing_none; + +use crate::models::{Amount, FlagCollection, Model, NoFlags, XChainBridge, XRPAmount}; + +use super::{CommonFields, Memo, Signer, Transaction, TransactionType}; + +#[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +#[skip_serializing_none] +pub struct XChainAddAccountCreateAttestation<'a> { + #[serde(flatten)] + pub common_fields: CommonFields<'a, NoFlags>, + pub amount: Amount<'a>, + pub attestation_reward_account: Cow<'a, str>, + pub attestation_signer_account: Cow<'a, str>, + pub destination: Cow<'a, str>, + pub other_chain_source: Cow<'a, str>, + pub public_key: Cow<'a, str>, + pub signature: Cow<'a, str>, + pub signature_reward: Amount<'a>, + pub was_locking_chain_send: u8, + #[serde(rename = "XChainAccountCreateCount")] + pub xchain_account_create_count: Cow<'a, str>, + #[serde(rename = "XChainBridge")] + pub xchain_bridge: XChainBridge<'a>, +} + +impl Model for XChainAddAccountCreateAttestation<'_> {} + +impl<'a> Transaction<'a, NoFlags> for XChainAddAccountCreateAttestation<'a> { + fn get_transaction_type(&self) -> super::TransactionType { + TransactionType::XChainAddAccountCreateAttestation + } + + fn get_common_fields(&self) -> &super::CommonFields<'_, NoFlags> { + &self.common_fields + } + + fn get_mut_common_fields(&mut self) -> &mut super::CommonFields<'a, NoFlags> { + &mut self.common_fields + } +} + +impl<'a> XChainAddAccountCreateAttestation<'a> { + pub fn new( + account: Cow<'a, str>, + account_txn_id: Option>, + fee: Option>, + last_ledger_sequence: Option, + memos: Option>, + sequence: Option, + signers: Option>>, + source_tag: Option, + ticket_sequence: Option, + amount: Amount<'a>, + attestation_reward_account: Cow<'a, str>, + attestation_signer_account: Cow<'a, str>, + destination: Cow<'a, str>, + other_chain_source: Cow<'a, str>, + public_key: Cow<'a, str>, + signature: Cow<'a, str>, + signature_reward: Amount<'a>, + was_locking_chain_send: u8, + xchain_account_create_count: Cow<'a, str>, + xchain_bridge: XChainBridge<'a>, + ) -> XChainAddAccountCreateAttestation<'a> { + XChainAddAccountCreateAttestation { + common_fields: CommonFields { + account, + transaction_type: TransactionType::XChainAddAccountCreateAttestation, + account_txn_id, + fee, + flags: FlagCollection::default(), + last_ledger_sequence, + memos, + sequence, + signers, + source_tag, + ticket_sequence, + network_id: None, + signing_pub_key: None, + txn_signature: None, + }, + amount, + attestation_reward_account, + attestation_signer_account, + destination, + other_chain_source, + public_key, + signature, + signature_reward, + was_locking_chain_send, + xchain_account_create_count, + xchain_bridge, + } + } +} + +#[cfg(test)] +mod test_serde { + const EXAMPLE_JSON: &'static str = r#"{ + "Account": "rDr5okqGKmMpn44Bbhe5WAfDQx8e9XquEv", + "Flags": 0, + "TransactionType": "XChainAddAccountCreateAttestation", + "OtherChainSource": "rUzB7yg1LcFa7m3q1hfrjr5w53vcWzNh3U", + "Destination": "rJMfWNVbyjcCtds8kpoEjEbYQ41J5B6MUd", + "Amount": "2000000000", + "PublicKey": "EDF7C3F9C80C102AF6D241752B37356E91ED454F26A35C567CF6F8477960F66614", + "Signature": "F95675BA8FDA21030DE1B687937A79E8491CE51832D6BEEBC071484FA5AF5B8A0E9AFF11A4AA46F09ECFFB04C6A8DAE8284AF3ED8128C7D0046D842448478500", + "WasLockingChainSend": 1, + "AttestationRewardAccount": "rpFp36UHW6FpEcZjZqq5jSJWY6UCj3k4Es", + "AttestationSignerAccount": "rpWLegmW9WrFBzHUj7brhQNZzrxgLj9oxw", + "XChainAccountCreateCount": "2", + "SignatureReward": "204", + "XChainBridge": { + "LockingChainDoor": "r3nCVTbZGGYoWvZ58BcxDmiMUU7ChMa1eC", + "LockingChainIssue": { + "currency": "XRP" + }, + "IssuingChainDoor": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "IssuingChainIssue": { + "currency": "XRP" + } + }, + "Fee": "20" + }"#; + use serde_json::Value; + + use super::*; + + #[test] + fn test_deserialize() { + let json = EXAMPLE_JSON; + let deserialized: Result = serde_json::from_str(json); + assert!(deserialized.is_ok()); + } + + #[test] + fn test_serialize() { + let attestation: XChainAddAccountCreateAttestation<'_> = + serde_json::from_str(EXAMPLE_JSON).unwrap(); + let actual = serde_json::to_value(&attestation).unwrap(); + let expected: Value = serde_json::from_str(EXAMPLE_JSON).unwrap(); + + assert_eq!(actual, expected); + } +} diff --git a/src/models/transactions/xchain_add_claim_attestation.rs b/src/models/transactions/xchain_add_claim_attestation.rs new file mode 100644 index 00000000..274c8f3f --- /dev/null +++ b/src/models/transactions/xchain_add_claim_attestation.rs @@ -0,0 +1,96 @@ +use alloc::{borrow::Cow, vec::Vec}; +use serde::{Deserialize, Serialize}; +use serde_with::skip_serializing_none; + +use crate::models::{Amount, FlagCollection, Model, NoFlags, XChainBridge}; + +use super::{CommonFields, Transaction, TransactionType}; + +#[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +#[skip_serializing_none] +pub struct XChainAddClaimAttestation<'a> { + #[serde(flatten)] + pub common_fields: CommonFields<'a, NoFlags>, + pub amount: Amount<'a>, + pub attestation_reward_account: Cow<'a, str>, + pub attestation_signer_account: Cow<'a, str>, + pub other_chain_source: Cow<'a, str>, + pub public_key: Cow<'a, str>, + pub signature: Cow<'a, str>, + pub was_locking_chain_send: u8, + #[serde(rename = "XChainBridge")] + pub xchain_bridge: XChainBridge<'a>, + #[serde(rename = "XChainClaimID")] + pub xchain_claim_id: Cow<'a, str>, + pub destination: Option>, +} + +impl Model for XChainAddClaimAttestation<'_> {} + +impl<'a> Transaction<'a, NoFlags> for XChainAddClaimAttestation<'a> { + fn get_transaction_type(&self) -> super::TransactionType { + TransactionType::XChainAddClaimAttestation + } + + fn get_common_fields(&self) -> &CommonFields<'_, NoFlags> { + &self.common_fields + } + + fn get_mut_common_fields(&mut self) -> &mut CommonFields<'a, NoFlags> { + &mut self.common_fields + } +} + +impl<'a> XChainAddClaimAttestation<'a> { + pub fn new( + account: Cow<'a, str>, + account_txn_id: Option>, + fee: Option>, + last_ledger_sequence: Option, + memos: Option>, + sequence: Option, + signers: Option>>, + source_tag: Option, + ticket_sequence: Option, + amount: Amount<'a>, + attestation_reward_account: Cow<'a, str>, + attestation_signer_account: Cow<'a, str>, + other_chain_source: Cow<'a, str>, + public_key: Cow<'a, str>, + signature: Cow<'a, str>, + was_locking_chain_send: u8, + xchain_bridge: XChainBridge<'a>, + xchain_claim_id: Cow<'a, str>, + destination: Option>, + ) -> XChainAddClaimAttestation<'a> { + XChainAddClaimAttestation { + common_fields: CommonFields { + account, + transaction_type: TransactionType::XChainAddClaimAttestation, + account_txn_id, + fee, + flags: FlagCollection::default(), + last_ledger_sequence, + memos, + sequence, + signers, + source_tag, + ticket_sequence, + network_id: None, + signing_pub_key: None, + txn_signature: None, + }, + amount, + attestation_reward_account, + attestation_signer_account, + other_chain_source, + public_key, + signature, + was_locking_chain_send, + xchain_bridge, + xchain_claim_id, + destination, + } + } +} diff --git a/src/models/transactions/xchain_claim.rs b/src/models/transactions/xchain_claim.rs new file mode 100644 index 00000000..44b79a00 --- /dev/null +++ b/src/models/transactions/xchain_claim.rs @@ -0,0 +1,116 @@ +use alloc::{borrow::Cow, vec::Vec}; +use anyhow::Result; +use serde::{Deserialize, Serialize}; +use serde_with::skip_serializing_none; + +use crate::{ + models::{ + transactions::exceptions::XRPLXChainClaimException, Amount, Currency, FlagCollection, + Model, NoFlags, XChainBridge, + }, + Err, +}; + +use super::{CommonFields, Memo, Signer, Transaction, TransactionType}; + +#[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +#[skip_serializing_none] +pub struct XChainClaim<'a> { + #[serde(flatten)] + pub common_fields: CommonFields<'a, NoFlags>, + pub amount: Amount<'a>, + pub destination: Cow<'a, str>, + #[serde(rename = "XChainBridge")] + pub xchain_bridge: XChainBridge<'a>, + #[serde(rename = "XChainClaimID")] + pub xchain_claim_id: Cow<'a, str>, + pub destination_tag: Option, +} + +impl Model for XChainClaim<'_> { + fn get_errors(&self) -> Result<()> { + self.get_amount_mismatch_error() + } +} + +impl<'a> Transaction<'a, NoFlags> for XChainClaim<'a> { + fn get_transaction_type(&self) -> super::TransactionType { + TransactionType::XChainClaim + } + + fn get_common_fields(&self) -> &CommonFields<'_, NoFlags> { + &self.common_fields + } + + fn get_mut_common_fields(&mut self) -> &mut CommonFields<'a, NoFlags> { + &mut self.common_fields + } +} + +impl<'a> XChainClaim<'a> { + pub fn new( + account: Cow<'a, str>, + account_txn_id: Option>, + fee: Option>, + last_ledger_sequence: Option, + memos: Option>, + sequence: Option, + signers: Option>>, + source_tag: Option, + ticket_sequence: Option, + amount: Amount<'a>, + destination: Cow<'a, str>, + xchain_bridge: XChainBridge<'a>, + xchain_claim_id: Cow<'a, str>, + destination_tag: Option, + ) -> XChainClaim<'a> { + XChainClaim { + common_fields: CommonFields { + account, + transaction_type: TransactionType::XChainClaim, + account_txn_id, + fee, + last_ledger_sequence, + memos, + sequence, + signers, + source_tag, + ticket_sequence, + flags: FlagCollection::default(), + network_id: None, + signing_pub_key: None, + txn_signature: None, + }, + amount, + destination, + xchain_bridge, + xchain_claim_id, + destination_tag, + } + } + + fn get_amount_mismatch_error(&self) -> Result<()> { + let bridge = &self.xchain_bridge; + match &self.amount { + Amount::XRPAmount(amount) => { + if Currency::from(amount) != bridge.locking_chain_issue + && Currency::from(amount) != bridge.issuing_chain_issue + { + Err!(XRPLXChainClaimException::AmountMismatch) + } else { + Ok(()) + } + } + Amount::IssuedCurrencyAmount(amount) => { + if Currency::from(amount) != bridge.locking_chain_issue + && Currency::from(amount) != bridge.issuing_chain_issue + { + Err!(XRPLXChainClaimException::AmountMismatch) + } else { + Ok(()) + } + } + } + } +} diff --git a/src/models/transactions/xchain_commit.rs b/src/models/transactions/xchain_commit.rs new file mode 100644 index 00000000..1a96dddf --- /dev/null +++ b/src/models/transactions/xchain_commit.rs @@ -0,0 +1,120 @@ +use alloc::{borrow::Cow, vec::Vec}; +use serde::{Deserialize, Serialize}; +use serde_with::skip_serializing_none; + +use crate::models::{Amount, FlagCollection, Model, NoFlags, XChainBridge, XRPAmount}; + +use super::{CommonFields, Memo, Signer, Transaction, TransactionType}; + +#[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +#[skip_serializing_none] +pub struct XChainCommit<'a> { + #[serde(flatten)] + pub common_fields: CommonFields<'a, NoFlags>, + pub amount: Amount<'a>, + #[serde(rename = "XChainBridge")] + pub xchain_bridge: XChainBridge<'a>, + #[serde(rename = "XChainClaimID")] + pub xchain_claim_id: Cow<'a, str>, + pub other_chain_destination: Option>, +} + +impl Model for XChainCommit<'_> {} + +impl<'a> Transaction<'a, NoFlags> for XChainCommit<'a> { + fn get_common_fields(&self) -> &CommonFields<'_, NoFlags> { + &self.common_fields + } + + fn get_mut_common_fields(&mut self) -> &mut CommonFields<'a, NoFlags> { + &mut self.common_fields + } + + fn get_transaction_type(&self) -> super::TransactionType { + TransactionType::XChainCommit + } +} + +impl<'a> XChainCommit<'a> { + pub fn new( + account: Cow<'a, str>, + account_txn_id: Option>, + fee: Option>, + last_ledger_sequence: Option, + memos: Option>, + sequence: Option, + signers: Option>>, + source_tag: Option, + ticket_sequence: Option, + amount: Amount<'a>, + xchain_bridge: XChainBridge<'a>, + xchain_claim_id: Cow<'a, str>, + other_chain_destination: Option>, + ) -> XChainCommit<'a> { + XChainCommit { + common_fields: CommonFields { + account, + transaction_type: TransactionType::XChainCommit, + account_txn_id, + fee, + last_ledger_sequence, + memos, + sequence, + signers, + source_tag, + ticket_sequence, + flags: FlagCollection::default(), + network_id: None, + signing_pub_key: None, + txn_signature: None, + }, + amount, + other_chain_destination, + xchain_bridge, + xchain_claim_id, + } + } +} + +#[cfg(test)] +mod test_serde { + use serde_json::Value; + + use crate::models::transactions::xchain_commit::XChainCommit; + + const EXAMPLE_JSON: &'static str = r#"{ + "Account": "rMTi57fNy2UkUb4RcdoUeJm7gjxVQvxzUo", + "Flags": 0, + "TransactionType": "XChainCommit", + "XChainBridge": { + "LockingChainDoor": "rMAXACCrp3Y8PpswXcg3bKggHX76V3F8M4", + "LockingChainIssue": { + "currency": "XRP" + }, + "IssuingChainDoor": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "IssuingChainIssue": { + "currency": "XRP" + } + }, + "Amount": "10000", + "XChainClaimID": "13f", + "OtherChainDestination": null + }"#; + + #[test] + fn test_deserialize() { + let json = EXAMPLE_JSON; + let deserialized: Result, _> = serde_json::from_str(json); + assert!(deserialized.is_ok()); + } + + #[test] + fn test_serialize() { + let attestation: XChainCommit<'_> = serde_json::from_str(EXAMPLE_JSON).unwrap(); + let actual = serde_json::to_value(&attestation).unwrap(); + let expected: Value = serde_json::from_str(EXAMPLE_JSON).unwrap(); + + assert_eq!(actual, expected); + } +} diff --git a/src/models/transactions/xchain_create_bridge.rs b/src/models/transactions/xchain_create_bridge.rs new file mode 100644 index 00000000..d072379e --- /dev/null +++ b/src/models/transactions/xchain_create_bridge.rs @@ -0,0 +1,130 @@ +use alloc::{borrow::Cow, vec::Vec}; +use anyhow::Result; +use serde::{Deserialize, Serialize}; +use serde_with::skip_serializing_none; + +use crate::{ + models::{ + transactions::exceptions::XRPLXChainCreateBridgeException, Amount, FlagCollection, Model, + NoFlags, XChainBridge, XRPAmount, XRP, + }, + Err, +}; + +use super::{CommonFields, Memo, Signer, Transaction, TransactionType}; + +#[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +#[skip_serializing_none] +pub struct XChainCreateBridge<'a> { + #[serde(flatten)] + pub common_fields: CommonFields<'a, NoFlags>, + pub signature_reward: Amount<'a>, + #[serde(rename = "XChainBridge")] + pub xchain_bridge: XChainBridge<'a>, + pub min_account_create_amount: Option>, +} + +impl Model for XChainCreateBridge<'_> { + fn get_errors(&self) -> Result<()> { + self.get_same_door_error()?; + self.get_account_door_mismatch_error()?; + self.get_cross_currency_bridge_not_allowed_error()?; + self.get_min_account_create_amount_for_iou_error() + } +} + +impl<'a> Transaction<'a, NoFlags> for XChainCreateBridge<'a> { + fn get_transaction_type(&self) -> super::TransactionType { + TransactionType::XChainCreateBridge + } + + fn get_common_fields(&self) -> &CommonFields<'_, NoFlags> { + &self.common_fields + } + + fn get_mut_common_fields(&mut self) -> &mut CommonFields<'a, NoFlags> { + &mut self.common_fields + } +} + +impl<'a> XChainCreateBridge<'a> { + pub fn new( + account: Cow<'a, str>, + account_txn_id: Option>, + fee: Option>, + last_ledger_sequence: Option, + memos: Option>, + sequence: Option, + signers: Option>>, + source_tag: Option, + ticket_sequence: Option, + signature_reward: Amount<'a>, + xchain_bridge: XChainBridge<'a>, + min_account_create_amount: Option>, + ) -> XChainCreateBridge<'a> { + XChainCreateBridge { + common_fields: CommonFields { + account, + transaction_type: TransactionType::XChainCreateBridge, + account_txn_id, + fee, + flags: FlagCollection::default(), + last_ledger_sequence, + memos, + sequence, + signers, + source_tag, + ticket_sequence, + network_id: None, + signing_pub_key: None, + txn_signature: None, + }, + signature_reward, + xchain_bridge, + min_account_create_amount, + } + } + + fn get_same_door_error(&self) -> Result<()> { + let bridge = &self.xchain_bridge; + if bridge.issuing_chain_door == bridge.locking_chain_door { + Err!(XRPLXChainCreateBridgeException::SameDoorAccounts) + } else { + Ok(()) + } + } + + fn get_account_door_mismatch_error(&self) -> Result<()> { + let bridge = &self.xchain_bridge; + if [&bridge.issuing_chain_door, &bridge.locking_chain_door] + .contains(&&self.common_fields.account) + { + Err!(XRPLXChainCreateBridgeException::AccountDoorMismatch) + } else { + Ok(()) + } + } + + fn get_cross_currency_bridge_not_allowed_error(&self) -> Result<()> { + let bridge = &self.xchain_bridge; + if (bridge.locking_chain_issue == XRP::new().into()) + != (bridge.issuing_chain_issue == XRP::new().into()) + { + Err!(XRPLXChainCreateBridgeException::CrossCurrencyBridgeNotAllowed) + } else { + Ok(()) + } + } + + fn get_min_account_create_amount_for_iou_error(&self) -> Result<()> { + let bridge = &self.xchain_bridge; + if self.min_account_create_amount.is_some() + && bridge.locking_chain_issue != XRP::new().into() + { + Err!(XRPLXChainCreateBridgeException::MinAccountCreateAmountForIOU) + } else { + Ok(()) + } + } +} diff --git a/src/models/transactions/xchain_create_claim_id.rs b/src/models/transactions/xchain_create_claim_id.rs new file mode 100644 index 00000000..f855b008 --- /dev/null +++ b/src/models/transactions/xchain_create_claim_id.rs @@ -0,0 +1,94 @@ +use alloc::{borrow::Cow, vec::Vec}; +use anyhow::Result; +use serde::{Deserialize, Serialize}; +use serde_with::skip_serializing_none; + +use crate::{ + core::addresscodec::is_valid_classic_address, + models::{ + transactions::exceptions::XRPLXChainCreateClaimIDException, FlagCollection, Model, NoFlags, + XChainBridge, XRPAmount, + }, + Err, +}; + +use super::{CommonFields, Memo, Signer, Transaction, TransactionType}; + +#[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +#[skip_serializing_none] +pub struct XChainCreateClaimID<'a> { + #[serde(flatten)] + pub common_fields: CommonFields<'a, NoFlags>, + pub other_chain_source: Cow<'a, str>, + pub signature_reward: Cow<'a, str>, + #[serde(rename = "XChainBridge")] + pub xchain_bridge: XChainBridge<'a>, +} + +impl Model for XChainCreateClaimID<'_> { + fn get_errors(&self) -> Result<()> { + self.get_other_chain_source_is_invalid_error() + } +} + +impl<'a> Transaction<'a, NoFlags> for XChainCreateClaimID<'a> { + fn get_transaction_type(&self) -> super::TransactionType { + TransactionType::XChainCreateClaimID + } + + fn get_common_fields(&self) -> &CommonFields<'_, NoFlags> { + &self.common_fields + } + + fn get_mut_common_fields(&mut self) -> &mut CommonFields<'a, NoFlags> { + &mut self.common_fields + } +} + +impl<'a> XChainCreateClaimID<'a> { + pub fn new( + account: Cow<'a, str>, + account_txn_id: Option>, + fee: Option>, + last_ledger_sequence: Option, + memos: Option>, + sequence: Option, + signers: Option>>, + source_tag: Option, + ticket_sequence: Option, + other_chain_source: Cow<'a, str>, + signature_reward: Cow<'a, str>, + xchain_bridge: XChainBridge<'a>, + ) -> XChainCreateClaimID<'a> { + XChainCreateClaimID { + common_fields: CommonFields { + account, + transaction_type: TransactionType::XChainCreateClaimID, + account_txn_id, + fee, + flags: FlagCollection::default(), + last_ledger_sequence, + memos, + sequence, + signers, + source_tag, + ticket_sequence, + network_id: None, + signing_pub_key: None, + txn_signature: None, + }, + other_chain_source, + signature_reward, + xchain_bridge, + } + } + + fn get_other_chain_source_is_invalid_error(&self) -> Result<()> { + if !is_valid_classic_address(self.other_chain_source.as_ref()) { + Err!(XRPLXChainCreateClaimIDException::OtherChainSourceIsInvalid) + } else { + Ok(()) + } + } +} diff --git a/src/models/transactions/xchain_modify_bridge.rs b/src/models/transactions/xchain_modify_bridge.rs new file mode 100644 index 00000000..7910bdfb --- /dev/null +++ b/src/models/transactions/xchain_modify_bridge.rs @@ -0,0 +1,133 @@ +use alloc::{borrow::Cow, vec::Vec}; +use anyhow::Result; +use serde::{Deserialize, Serialize}; +use serde_repr::{Deserialize_repr, Serialize_repr}; +use serde_with::skip_serializing_none; +use strum_macros::{AsRefStr, Display, EnumIter}; + +use crate::{ + models::{ + transactions::exceptions::XRPLXChainModifyBridgeException, Amount, FlagCollection, Model, + XChainBridge, XRPAmount, XRP, + }, + Err, +}; + +use super::{CommonFields, Memo, Signer, Transaction, TransactionType}; + +#[derive( + Debug, Eq, PartialEq, Clone, Serialize_repr, Deserialize_repr, Display, AsRefStr, EnumIter, +)] +#[repr(u32)] +pub enum XChainModifyBridgeFlags { + /// Clears the MinAccountCreateAmount of the bridge. + TfClearAccountCreateAmount = 0x00010000, +} + +#[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "PascalCase")] +#[skip_serializing_none] +pub struct XChainModifyBridge<'a> { + #[serde(flatten)] + pub common_fields: CommonFields<'a, XChainModifyBridgeFlags>, + #[serde(rename = "XChainBridge")] + pub xchain_bridge: XChainBridge<'a>, + pub min_account_create_amount: Option>, + pub signature_reward: Option>, +} + +impl Model for XChainModifyBridge<'_> { + fn get_errors(&self) -> Result<()> { + self.get_must_change_or_clear_error()?; + self.get_account_door_mismatch_error()?; + self.get_cannot_have_min_account_create_amount()?; + Ok(()) + } +} + +impl<'a> Transaction<'a, XChainModifyBridgeFlags> for XChainModifyBridge<'a> { + fn get_common_fields(&self) -> &CommonFields<'_, XChainModifyBridgeFlags> { + &self.common_fields + } + + fn get_mut_common_fields(&mut self) -> &mut CommonFields<'a, XChainModifyBridgeFlags> { + &mut self.common_fields + } + + fn get_transaction_type(&self) -> super::TransactionType { + TransactionType::XChainModifyBridge + } +} + +impl<'a> XChainModifyBridge<'a> { + pub fn new( + account: Cow<'a, str>, + account_txn_id: Option>, + fee: Option>, + flags: Option>, + last_ledger_sequence: Option, + memos: Option>, + sequence: Option, + signers: Option>>, + source_tag: Option, + ticket_sequence: Option, + xchain_bridge: XChainBridge<'a>, + min_account_create_amount: Option>, + signature_reward: Option>, + ) -> XChainModifyBridge<'a> { + XChainModifyBridge { + common_fields: CommonFields { + account, + transaction_type: TransactionType::XChainModifyBridge, + account_txn_id, + fee, + flags: flags.unwrap_or_default(), + last_ledger_sequence, + memos, + sequence, + signers, + source_tag, + ticket_sequence, + network_id: None, + signing_pub_key: None, + txn_signature: None, + }, + xchain_bridge, + min_account_create_amount, + signature_reward, + } + } + + fn get_must_change_or_clear_error(&self) -> Result<()> { + if self.signature_reward.is_none() + && self.min_account_create_amount.is_none() + && !self.has_flag(&XChainModifyBridgeFlags::TfClearAccountCreateAmount) + { + Err!(XRPLXChainModifyBridgeException::MustChangeOrClear) + } else { + Ok(()) + } + } + + fn get_account_door_mismatch_error(&self) -> Result<()> { + let bridge = &self.xchain_bridge; + if [&bridge.locking_chain_door, &bridge.issuing_chain_door] + .contains(&&self.get_common_fields().account) + { + Err!(XRPLXChainModifyBridgeException::AccountDoorMismatch) + } else { + Ok(()) + } + } + + fn get_cannot_have_min_account_create_amount(&self) -> Result<()> { + let bridge = &self.xchain_bridge; + if self.min_account_create_amount.is_some() + && bridge.locking_chain_issue != XRP::new().into() + { + Err!(XRPLXChainModifyBridgeException::CannotHaveMinAccountCreateAmount) + } else { + Ok(()) + } + } +}