diff --git a/data/decoder.go b/data/decoder.go index 9e8dd10..f266832 100644 --- a/data/decoder.go +++ b/data/decoder.go @@ -310,6 +310,17 @@ func readObject(r Reader, v *reflect.Value) error { err := readObject(r, &m) v.Set(m.Elem()) return err + case "AuctionSlot": + var slot AuctionSlot + s := reflect.ValueOf(&slot) + err := readObject(r, &s) + v.Elem().FieldByName("AuctionSlot").Set(s) + if err == errorEndOfObject { + return nil + } + return err + case "VoteEntry": + return fmt.Errorf("VoteEntry not yet implemented...") case "Memo": var memo Memo m := reflect.ValueOf(&memo) diff --git a/data/encoder.go b/data/encoder.go index b7e90fc..373e9ae 100644 --- a/data/encoder.go +++ b/data/encoder.go @@ -195,6 +195,8 @@ func getFields(v *reflect.Value, depth int) fieldSlice { fields.Append(encoding, f.Addr().Interface(), nil) case ST_HASH96, ST_HASH128, ST_HASH160, ST_HASH192, ST_HASH256, ST_HASH384, ST_HASH512, ST_AMOUNT, ST_VL, ST_ACCOUNT, ST_PATHSET, ST_VECTOR256: fields.Append(encoding, f.Addr().Interface(), nil) + case ST_ISSUE: + fields.Append(encoding, f.Addr().Interface(), nil) case ST_ARRAY: var children fieldSlice for i := 0; i < f.Len(); i++ { diff --git a/data/format.go b/data/format.go index 6b94aec..6eedacc 100644 --- a/data/format.go +++ b/data/format.go @@ -103,10 +103,12 @@ var encodings = map[enc]string{ {ST_UINT8, 1}: "CloseResolution", {ST_UINT8, 2}: "Method", {ST_UINT8, 3}: "TransactionResult", + {ST_UINT8, 4}: "Scale", // 8-bit unsigned integers (uncommon) {ST_UINT8, 16}: "TickSize", {ST_UINT8, 17}: "UNLModifyDisabling", {ST_UINT8, 18}: "HookResult", + {ST_UINT8, 19}: "WasLockingChainSend", // 16-bit unsigned integers (common) {ST_UINT16, 1}: "LedgerEntryType", {ST_UINT16, 2}: "TransactionType", @@ -221,7 +223,7 @@ var encodings = map[enc]string{ // {ST_HASH256, 20}: "TicketID", {ST_HASH256, 21}: "Digest", {ST_HASH256, 22}: "Channel", - {ST_HASH256, 22}: "ConsensusHash", + {ST_HASH256, 23}: "ConsensusHash", {ST_HASH256, 24}: "CheckID", {ST_HASH256, 25}: "ValidatedHash", {ST_HASH256, 26}: "PreviousPageMin", @@ -246,6 +248,7 @@ var encodings = map[enc]string{ {ST_AMOUNT, 11}: "Amount2", {ST_AMOUNT, 12}: "BidMin", {ST_AMOUNT, 13}: "BidMax", + // currency amount (uncommon) {ST_AMOUNT, 16}: "MinimumOffer", {ST_AMOUNT, 17}: "RippleEscrow", @@ -258,6 +261,8 @@ var encodings = map[enc]string{ {ST_AMOUNT, 26}: "LPTokenIn", {ST_AMOUNT, 27}: "EPrice", {ST_AMOUNT, 28}: "Price", + {ST_AMOUNT, 29}: "SignatureReward", + {ST_AMOUNT, 30}: "MinAccountCreateAmount", {ST_AMOUNT, 31}: "LPTokenBalance", // variable length (common) diff --git a/data/ledgerentry.go b/data/ledgerentry.go index 0af13b2..721a068 100644 --- a/data/ledgerentry.go +++ b/data/ledgerentry.go @@ -15,6 +15,7 @@ type AccountRoot struct { leBase Flags *LedgerEntryFlag `json:",omitempty"` Account *Account `json:",omitempty"` + AMMID *Hash256 `json:",omitempty"` Sequence *uint32 `json:",omitempty"` Balance *Value `json:",omitempty"` OwnerCount *uint32 `json:",omitempty"` @@ -224,29 +225,35 @@ type NFTokenOffer struct { Expiration *uint32 `json:",omitempty"` } -type VoteEntry struct { +type VoteEntryItem struct { Account *Account `json:",omitempty"` TradingFee *uint16 `json:",omitempty"` VoteWeight *uint32 `json:",omitempty"` } +type VoteEntry struct { + VoteEntry VoteEntryItem `json:",omitempty"` +} + type AuctionSlot struct { Account *Account `json:",omitempty"` AuthAccounts []Account `json:",omitempty"` - DiscountedFee *uint32 `json:",omitempty"` + DiscountedFee *uint16 `json:",omitempty"` Price *Amount `json:",omitempty"` Expiration *uint32 `json:",omitempty"` } type AMM struct { leBase - Account *Account `json:",omitempty"` - TradingFee *uint16 `json:",omitempty"` - VoteSlots []VoteEntry `json:",omitempty"` - AuctionSlot *AuctionSlot `json:",omitempty"` - Asset *Hash160 `json:",omitempty"` - Asset2 *Hash160 `json:",omitempty"` - OwnerNode *NodeIndex `json:",omitempty"` + Flags *LedgerEntryFlag `json:",omitempty"` + Account *Account `json:",omitempty"` + TradingFee *uint16 `json:",omitempty"` + VoteSlots []VoteEntry `json:",omitempty"` + AuctionSlot *AuctionSlot `json:",omitempty"` + LPTokenBalance *Amount `json:",omitempty"` + Asset *Asset `json:",omitempty"` + Asset2 *Asset `json:",omitempty"` + OwnerNode *NodeIndex `json:",omitempty"` } func (a *AccountRoot) Affects(account Account) bool { diff --git a/data/result.go b/data/result.go index 88a13c8..fb69293 100644 --- a/data/result.go +++ b/data/result.go @@ -71,6 +71,36 @@ const ( tecINSUFFICIENT_FUNDS tecOBJECT_NOT_FOUND tecINSUFFICIENT_PAYMENT + tecUNFUNDED_AMM + tecAMM_BALANCE + tecAMM_FAILED + tecAMM_INVALID_TOKENS + tecAMM_EMPTY + tecAMM_NOT_EMPTY + tecAMM_ACCOUNT + tecINCOMPLETE + tecXCHAIN_BAD_TRANSFER_ISSUE + tecXCHAIN_NO_CLAIM_ID + tecXCHAIN_BAD_CLAIM_ID + tecXCHAIN_CLAIM_NO_QUORUM + tecXCHAIN_PROOF_UNKNOWN_KEY + tecXCHAIN_CREATE_ACCOUNT_NONXRP_ISSUE + tecXCHAIN_WRONG_CHAIN + tecXCHAIN_REWARD_MISMATCH + tecXCHAIN_NO_SIGNERS_LIST + tecXCHAIN_SENDING_ACCOUNT_MISMATCH + tecXCHAIN_INSUFF_CREATE_AMOUNT + tecXCHAIN_ACCOUNT_CREATE_PAST + tecXCHAIN_ACCOUNT_CREATE_TOO_MANY + tecXCHAIN_PAYMENT_FAILED + tecXCHAIN_SELF_COMMIT + tecXCHAIN_BAD_PUBLIC_KEY_ACCOUNT_PAIR + tecXCHAIN_CREATE_ACCOUNT_DISABLED + tecEMPTY_DID + tecINVALID_UPDATE_TIME + tecTOKEN_PAIR_NOT_FOUND + tecARRAY_EMPTY + tecARRAY_TOO_LARGE ) const ( @@ -139,6 +169,16 @@ const ( temUNKNOWN temSEQ_AND_TICKET temBAD_NFTOKEN_TRANSFER_FEE + temBAD_AMM_TOKENS + temXCHAIN_EQUAL_DOOR_ACCOUNTS + temXCHAIN_BAD_PROOF + temXCHAIN_BRIDGE_BAD_ISSUES + temXCHAIN_BRIDGE_NONDOOR_OWNER + temXCHAIN_BRIDGE_BAD_MIN_ACCOUNT_CREATE_AMOUNT + temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT + temEMPTY_DID + temARRAY_EMPTY + temARRAY_TOO_LARGE ) const ( // -199 .. -100: F Failure (sequence number previously used) @@ -198,59 +238,91 @@ const ( terLAST // Process after all other transactions terNO_RIPPLE // Rippling not allowed terQUEUED // Transaction is being held in TxQ until fee drops + terPRE_TICKET //Ticket is not yet in ledger but might be on its way + terNO_AMM // AMM doesn't exist for the asset pair ) var resultNames = map[TransactionResult]struct { Token string Human string }{ - tesSUCCESS: {"tesSUCCESS", "The transaction was applied."}, - tecCLAIM: {"tecCLAIM", "Fee claimed. Sequence used. No action."}, - tecDIR_FULL: {"tecDIR_FULL", "Can not add entry to full directory."}, - tecFAILED_PROCESSING: {"tecFAILED_PROCESSING", "Failed to correctly process transaction."}, - tecINSUF_RESERVE_LINE: {"tecINSUF_RESERVE_LINE", "Insufficient reserve to add trust line."}, - tecINSUF_RESERVE_OFFER: {"tecINSUF_RESERVE_OFFER", "Insufficient reserve to create offer."}, - tecNO_DST: {"tecNO_DST", "Destination does not exist. Send XRP to create it."}, - tecNO_DST_INSUF_XRP: {"tecNO_DST_INSUF_XRP", "Destination does not exist. Too little XRP sent to create it."}, - tecNO_LINE_INSUF_RESERVE: {"tecNO_LINE_INSUF_RESERVE", "No such line. Too little reserve to create it."}, - tecNO_LINE_REDUNDANT: {"tecNO_LINE_REDUNDANT", "Can't set non-existant line to default."}, - tecPATH_DRY: {"tecPATH_DRY", "Path could not send partial amount."}, - tecPATH_PARTIAL: {"tecPATH_PARTIAL", "Path could not send full amount."}, - tecNO_ALTERNATIVE_KEY: {"tecNO_ALTERNATIVE_KEY", "The operation would remove the ability to sign transactions with the account."}, - tecNO_REGULAR_KEY: {"tecNO_REGULAR_KEY", "Regular key is not set."}, - tecUNFUNDED: {"tecUNFUNDED", "One of _ADD, _OFFER, or _SEND. Deprecated."}, - tecUNFUNDED_ADD: {"tecUNFUNDED_ADD", "Insufficient XRP balance for WalletAdd."}, - tecUNFUNDED_OFFER: {"tecUNFUNDED_OFFER", "Insufficient balance to fund created offer."}, - tecUNFUNDED_PAYMENT: {"tecUNFUNDED_PAYMENT", "Insufficient XRP balance to send."}, - tecOWNERS: {"tecOWNERS", "Non-zero owner count."}, - tecNO_ISSUER: {"tecNO_ISSUER", "Issuer account does not exist."}, - tecNO_AUTH: {"tecNO_AUTH", "Not authorized to hold asset."}, - tecNO_LINE: {"tecNO_LINE", "No such line."}, - tecINSUFF_FEE: {"tecINSUFF_FEE", "Insufficient balance to pay fee."}, - tecFROZEN: {"tecFROZEN", "Asset is frozen."}, - tecNO_TARGET: {"tecNO_TARGET", "Target account does not exist."}, - tecNO_PERMISSION: {"tecNO_PERMISSION", "No permission to perform requested operation."}, - tecNO_ENTRY: {"tecNO_ENTRY", "No matching entry found."}, - tecINSUFFICIENT_RESERVE: {"tecINSUFFICIENT_RESERVE", "Insufficient reserve to complete requested operation."}, - tecNEED_MASTER_KEY: {"tecNEED_MASTER_KEY", "The operation requires the use of the Master Key."}, - tecDST_TAG_NEEDED: {"tecDST_TAG_NEEDED", "A destination tag is required."}, - tecINTERNAL: {"tecINTERNAL", "An internal error has occurred during processing."}, - tecCRYPTOCONDITION_ERROR: {"tecCRYPTOCONDITION_ERROR", "Malformed, invalid, or mismatched conditional or fulfillment."}, - tecINVARIANT_FAILED: {"tecINVARIANT_FAILED", "One or more invariants for the transaction were not satisfied."}, - tecOVERSIZE: {"tecOVERSIZE", "Object exceeded serialization limits"}, - tecEXPIRED: {"tecEXPIRED", "Expiration time is passed."}, - tecDUPLICATE: {"tecDUPLICATE", "Ledger object already exists."}, - tecKILLED: {"tecKILLED", "FillOrKill offer killed."}, - tecHAS_OBLIGATIONS: {"tecHAS_OBLIGATIONS", "The account cannot be deleted since it has obligations."}, - tecTOO_SOON: {"tecTOO_SOON", "It is too early to attempt the requested operation. Please wait."}, - tecMAX_SEQUENCE_REACHED: {"tecMAX_SEQUENCE_REACHED", "The maximum sequence number was reached."}, - tecNO_SUITABLE_NFTOKEN_PAGE: {"tecNO_SUITABLE_NFTOKEN_PAGE", "A suitable NFToken page could not be located."}, - tecNFTOKEN_BUY_SELL_MISMATCH: {"tecNFTOKEN_BUY_SELL_MISMATCH", "The 'Buy' and 'Sell' NFToken offers are mismatched."}, - tecNFTOKEN_OFFER_TYPE_MISMATCH: {"tecNFTOKEN_OFFER_TYPE_MISMATCH", "The type of NFToken offer is incorrect."}, - tecCANT_ACCEPT_OWN_NFTOKEN_OFFER: {"tecCANT_ACCEPT_OWN_NFTOKEN_OFFER", "An NFToken offer cannot be claimed by its owner."}, - tecINSUFFICIENT_FUNDS: {"tecINSUFFICIENT_FUNDS", "Not enough funds available to complete requested transaction."}, - tecOBJECT_NOT_FOUND: {"tecOBJECT_NOT_FOUND", "A requested object could not be located."}, - tecINSUFFICIENT_PAYMENT: {"tecINSUFFICIENT_PAYMENT", "The payment is not sufficient."}, + tesSUCCESS: {"tesSUCCESS", "The transaction was applied."}, + tecCLAIM: {"tecCLAIM", "Fee claimed. Sequence used. No action."}, + tecDIR_FULL: {"tecDIR_FULL", "Can not add entry to full directory."}, + tecFAILED_PROCESSING: {"tecFAILED_PROCESSING", "Failed to correctly process transaction."}, + tecINSUF_RESERVE_LINE: {"tecINSUF_RESERVE_LINE", "Insufficient reserve to add trust line."}, + tecINSUF_RESERVE_OFFER: {"tecINSUF_RESERVE_OFFER", "Insufficient reserve to create offer."}, + tecNO_DST: {"tecNO_DST", "Destination does not exist. Send XRP to create it."}, + tecNO_DST_INSUF_XRP: {"tecNO_DST_INSUF_XRP", "Destination does not exist. Too little XRP sent to create it."}, + tecNO_LINE_INSUF_RESERVE: {"tecNO_LINE_INSUF_RESERVE", "No such line. Too little reserve to create it."}, + tecNO_LINE_REDUNDANT: {"tecNO_LINE_REDUNDANT", "Can't set non-existant line to default."}, + tecPATH_DRY: {"tecPATH_DRY", "Path could not send partial amount."}, + tecPATH_PARTIAL: {"tecPATH_PARTIAL", "Path could not send full amount."}, + tecNO_ALTERNATIVE_KEY: {"tecNO_ALTERNATIVE_KEY", "The operation would remove the ability to sign transactions with the account."}, + tecNO_REGULAR_KEY: {"tecNO_REGULAR_KEY", "Regular key is not set."}, + tecUNFUNDED: {"tecUNFUNDED", "One of _ADD, _OFFER, or _SEND. Deprecated."}, + tecUNFUNDED_ADD: {"tecUNFUNDED_ADD", "Insufficient XRP balance for WalletAdd."}, + tecUNFUNDED_OFFER: {"tecUNFUNDED_OFFER", "Insufficient balance to fund created offer."}, + tecUNFUNDED_PAYMENT: {"tecUNFUNDED_PAYMENT", "Insufficient XRP balance to send."}, + tecOWNERS: {"tecOWNERS", "Non-zero owner count."}, + tecNO_ISSUER: {"tecNO_ISSUER", "Issuer account does not exist."}, + tecNO_AUTH: {"tecNO_AUTH", "Not authorized to hold asset."}, + tecNO_LINE: {"tecNO_LINE", "No such line."}, + tecINSUFF_FEE: {"tecINSUFF_FEE", "Insufficient balance to pay fee."}, + tecFROZEN: {"tecFROZEN", "Asset is frozen."}, + tecNO_TARGET: {"tecNO_TARGET", "Target account does not exist."}, + tecNO_PERMISSION: {"tecNO_PERMISSION", "No permission to perform requested operation."}, + tecNO_ENTRY: {"tecNO_ENTRY", "No matching entry found."}, + tecINSUFFICIENT_RESERVE: {"tecINSUFFICIENT_RESERVE", "Insufficient reserve to complete requested operation."}, + tecNEED_MASTER_KEY: {"tecNEED_MASTER_KEY", "The operation requires the use of the Master Key."}, + tecDST_TAG_NEEDED: {"tecDST_TAG_NEEDED", "A destination tag is required."}, + tecINTERNAL: {"tecINTERNAL", "An internal error has occurred during processing."}, + tecCRYPTOCONDITION_ERROR: {"tecCRYPTOCONDITION_ERROR", "Malformed, invalid, or mismatched conditional or fulfillment."}, + tecINVARIANT_FAILED: {"tecINVARIANT_FAILED", "One or more invariants for the transaction were not satisfied."}, + tecOVERSIZE: {"tecOVERSIZE", "Object exceeded serialization limits"}, + tecEXPIRED: {"tecEXPIRED", "Expiration time is passed."}, + tecDUPLICATE: {"tecDUPLICATE", "Ledger object already exists."}, + tecKILLED: {"tecKILLED", "FillOrKill offer killed."}, + tecHAS_OBLIGATIONS: {"tecHAS_OBLIGATIONS", "The account cannot be deleted since it has obligations."}, + tecTOO_SOON: {"tecTOO_SOON", "It is too early to attempt the requested operation. Please wait."}, + tecMAX_SEQUENCE_REACHED: {"tecMAX_SEQUENCE_REACHED", "The maximum sequence number was reached."}, + tecNO_SUITABLE_NFTOKEN_PAGE: {"tecNO_SUITABLE_NFTOKEN_PAGE", "A suitable NFToken page could not be located."}, + tecNFTOKEN_BUY_SELL_MISMATCH: {"tecNFTOKEN_BUY_SELL_MISMATCH", "The 'Buy' and 'Sell' NFToken offers are mismatched."}, + tecNFTOKEN_OFFER_TYPE_MISMATCH: {"tecNFTOKEN_OFFER_TYPE_MISMATCH", "The type of NFToken offer is incorrect."}, + tecCANT_ACCEPT_OWN_NFTOKEN_OFFER: {"tecCANT_ACCEPT_OWN_NFTOKEN_OFFER", "An NFToken offer cannot be claimed by its owner."}, + tecINSUFFICIENT_FUNDS: {"tecINSUFFICIENT_FUNDS", "Not enough funds available to complete requested transaction."}, + tecOBJECT_NOT_FOUND: {"tecOBJECT_NOT_FOUND", "A requested object could not be located."}, + tecINSUFFICIENT_PAYMENT: {"tecINSUFFICIENT_PAYMENT", "The payment is not sufficient."}, + tecUNFUNDED_AMM: {"tecUNFUNDED_AMM", "Insufficient balance to fund AMM."}, + tecAMM_BALANCE: {"tecAMM_BALANCE", "AMM has invalid balance."}, + tecAMM_FAILED: {"tecAMM_FAILED", "AMM transaction failed."}, + tecAMM_INVALID_TOKENS: {"tecAMM_INVALID_TOKENS", "AMM invalid LP tokens."}, + tecAMM_EMPTY: {"tecAMM_EMPTY", "AMM is in empty state."}, + tecAMM_NOT_EMPTY: {"tecAMM_NOT_EMPTY", "AMM is not in empty state."}, + tecAMM_ACCOUNT: {"tecAMM_ACCOUNT", "This operation is not allowed on an AMM Account."}, + tecINCOMPLETE: {"tecINCOMPLETE", "Some work was completed, but more submissions required to finish."}, + tecXCHAIN_BAD_TRANSFER_ISSUE: {"tecXCHAIN_BAD_TRANSFER_ISSUE", "Bad xchain transfer issue."}, + tecXCHAIN_NO_CLAIM_ID: {"tecXCHAIN_NO_CLAIM_ID", "No such xchain claim id."}, + tecXCHAIN_BAD_CLAIM_ID: {"tecXCHAIN_BAD_CLAIM_ID", "Bad xchain claim id."}, + tecXCHAIN_CLAIM_NO_QUORUM: {"tecXCHAIN_CLAIM_NO_QUORUM", "Quorum was not reached on the xchain claim."}, + tecXCHAIN_PROOF_UNKNOWN_KEY: {"tecXCHAIN_PROOF_UNKNOWN_KEY", "Unknown key for the xchain proof."}, + tecXCHAIN_CREATE_ACCOUNT_NONXRP_ISSUE: {"tecXCHAIN_CREATE_ACCOUNT_NONXRP_ISSUE", "Only XRP may be used for xchain create account."}, + tecXCHAIN_WRONG_CHAIN: {"tecXCHAIN_WRONG_CHAIN", "XChain Transaction was submitted to the wrong chain."}, + tecXCHAIN_REWARD_MISMATCH: {"tecXCHAIN_REWARD_MISMATCH", "The reward amount must match the reward specified in the xchain bridge."}, + tecXCHAIN_NO_SIGNERS_LIST: {"tecXCHAIN_NO_SIGNERS_LIST", "The account did not have a signers list."}, + tecXCHAIN_SENDING_ACCOUNT_MISMATCH: {"tecXCHAIN_SENDING_ACCOUNT_MISMATCH", "The sending account did not match the expected sending account."}, + tecXCHAIN_INSUFF_CREATE_AMOUNT: {"tecXCHAIN_INSUFF_CREATE_AMOUNT", "Insufficient amount to create an account."}, + tecXCHAIN_ACCOUNT_CREATE_PAST: {"tecXCHAIN_ACCOUNT_CREATE_PAST", "The account create count has already passed."}, + tecXCHAIN_ACCOUNT_CREATE_TOO_MANY: {"tecXCHAIN_ACCOUNT_CREATE_TOO_MANY", "There are too many pending account create transactions to submit a new one."}, + tecXCHAIN_PAYMENT_FAILED: {"tecXCHAIN_PAYMENT_FAILED", "Failed to transfer funds in a xchain transaction."}, + tecXCHAIN_SELF_COMMIT: {"tecXCHAIN_SELF_COMMIT", "Account cannot commit funds to itself."}, + tecXCHAIN_BAD_PUBLIC_KEY_ACCOUNT_PAIR: {"tecXCHAIN_BAD_PUBLIC_KEY_ACCOUNT_PAIR", "Bad public key account pair in an xchain transaction."}, + tecXCHAIN_CREATE_ACCOUNT_DISABLED: {"tecXCHAIN_CREATE_ACCOUNT_DISABLED", "This bridge does not support account creation."}, + tecEMPTY_DID: {"tecEMPTY_DID", "The DID object did not have a URI or DIDDocument field."}, + tecINVALID_UPDATE_TIME: {"tecINVALID_UPDATE_TIME", "The Oracle object has invalid LastUpdateTime field."}, + tecTOKEN_PAIR_NOT_FOUND: {"tecTOKEN_PAIR_NOT_FOUND", "Token pair is not found in Oracle object."}, + tecARRAY_EMPTY: {"tecARRAY_EMPTY", "Array is empty."}, + tecARRAY_TOO_LARGE: {"tecARRAY_TOO_LARGE", "Array is too large."}, tefFAILURE: {"tefFAILURE", "Failed to apply."}, tefALREADY: {"tefALREADY", "The exact transaction was already in this ledger."}, @@ -291,40 +363,50 @@ var resultNames = map[TransactionResult]struct { telCAN_NOT_QUEUE_FEE: {"telCAN_NOT_QUEUE_FEE", "Can not queue at this time: fee insufficient to replace queued transaction."}, telCAN_NOT_QUEUE_FULL: {"telCAN_NOT_QUEUE_FULL", "Can not queue at this time: queue is full."}, - temMALFORMED: {"temMALFORMED", "Malformed transaction."}, - temBAD_AMOUNT: {"temBAD_AMOUNT", "Can only send positive amounts."}, - temBAD_CURRENCY: {"temBAD_CURRENCY", "Malformed: Bad currency."}, - temBAD_FEE: {"temBAD_FEE", "Invalid fee, negative or not XRP."}, - temBAD_EXPIRATION: {"temBAD_EXPIRATION", "Malformed: Bad expiration."}, - temBAD_ISSUER: {"temBAD_ISSUER", "Malformed: Bad issuer."}, - temBAD_LIMIT: {"temBAD_LIMIT", "Limits must be non-negative."}, - temBAD_OFFER: {"temBAD_OFFER", "Malformed: Bad offer."}, - temBAD_PATH: {"temBAD_PATH", "Malformed: Bad path."}, - temBAD_PATH_LOOP: {"temBAD_PATH_LOOP", "Malformed: Loop in path."}, - temBAD_SIGNATURE: {"temBAD_SIGNATURE", "Malformed: Bad signature."}, - temBAD_SRC_ACCOUNT: {"temBAD_SRC_ACCOUNT", "Malformed: Bad source account."}, - temBAD_TRANSFER_RATE: {"temBAD_TRANSFER_RATE", "Malformed: Transfer rate must be >= 1.0"}, - temBAD_SEQUENCE: {"temBAD_SEQUENCE", "Malformed: Sequence is not in the past."}, - temBAD_SEND_XRP_LIMIT: {"temBAD_SEND_XRP_LIMIT", "Malformed: Limit quality is not allowed for XRP to XRP."}, - temBAD_SEND_XRP_MAX: {"temBAD_SEND_XRP_MAX", "Malformed: Send max is not allowed for XRP to XRP."}, - temBAD_SEND_XRP_NO_DIRECT: {"temBAD_SEND_XRP_NO_DIRECT", "Malformed: No Ripple direct is not allowed for XRP to XRP."}, - temBAD_SEND_XRP_PARTIAL: {"temBAD_SEND_XRP_PARTIAL", "Malformed: Partial payment is not allowed for XRP to XRP."}, - temBAD_SEND_XRP_PATHS: {"temBAD_SEND_XRP_PATHS", "Malformed: Paths are not allowed for XRP to XRP."}, - temDST_IS_SRC: {"temDST_IS_SRC", "Destination may not be source."}, - temDST_NEEDED: {"temDST_NEEDED", "Destination not specified."}, - temINVALID: {"temINVALID", "The transaction is ill-formed."}, - temINVALID_FLAG: {"temINVALID_FLAG", "The transaction has an invalid flag."}, - temREDUNDANT: {"temREDUNDANT", "Sends same currency to self."}, - temRIPPLE_EMPTY: {"temRIPPLE_EMPTY", "PathSet with no paths."}, - temUNCERTAIN: {"temUNCERTAIN", "In process of determining result. Never returned."}, - temUNKNOWN: {"temUNKNOWN", "The transactions requires logic not implemented yet."}, - temDISABLED: {"temDISABLED", "The transaction requires logic that is currently disabled."}, - temBAD_TICK_SIZE: {"temBAD_TICK_SIZE", "Malformed: Tick size out of range."}, - temINVALID_ACCOUNT_ID: {"temINVALID_ACCOUNT_ID", "Malformed: A field contains an invalid account ID."}, - temCANNOT_PREAUTH_SELF: {"temCANNOT_PREAUTH_SELF", "Malformed: An account may not preauthorize itself."}, - temSEQ_AND_TICKET: {"temSEQ_AND_TICKET", "Transaction contains a TicketSequence and a non-zero Sequence"}, - temBAD_NFTOKEN_TRANSFER_FEE: {"temBAD_NFTOKEN_TRANSFER_FEE", "Malformed: The NFToken transfer fee must be between 1 and 5000, inclusive."}, - temBAD_WEIGHT: {"temBAD_WEIGHT", "The SignerListSet transaction includes a SignerWeight that is invalid, for example a zero or negative value."}, + temMALFORMED: {"temMALFORMED", "Malformed transaction."}, + temBAD_AMOUNT: {"temBAD_AMOUNT", "Can only send positive amounts."}, + temBAD_CURRENCY: {"temBAD_CURRENCY", "Malformed: Bad currency."}, + temBAD_FEE: {"temBAD_FEE", "Invalid fee, negative or not XRP."}, + temBAD_EXPIRATION: {"temBAD_EXPIRATION", "Malformed: Bad expiration."}, + temBAD_ISSUER: {"temBAD_ISSUER", "Malformed: Bad issuer."}, + temBAD_LIMIT: {"temBAD_LIMIT", "Limits must be non-negative."}, + temBAD_OFFER: {"temBAD_OFFER", "Malformed: Bad offer."}, + temBAD_PATH: {"temBAD_PATH", "Malformed: Bad path."}, + temBAD_PATH_LOOP: {"temBAD_PATH_LOOP", "Malformed: Loop in path."}, + temBAD_SIGNATURE: {"temBAD_SIGNATURE", "Malformed: Bad signature."}, + temBAD_SRC_ACCOUNT: {"temBAD_SRC_ACCOUNT", "Malformed: Bad source account."}, + temBAD_TRANSFER_RATE: {"temBAD_TRANSFER_RATE", "Malformed: Transfer rate must be >= 1.0"}, + temBAD_SEQUENCE: {"temBAD_SEQUENCE", "Malformed: Sequence is not in the past."}, + temBAD_SEND_XRP_LIMIT: {"temBAD_SEND_XRP_LIMIT", "Malformed: Limit quality is not allowed for XRP to XRP."}, + temBAD_SEND_XRP_MAX: {"temBAD_SEND_XRP_MAX", "Malformed: Send max is not allowed for XRP to XRP."}, + temBAD_SEND_XRP_NO_DIRECT: {"temBAD_SEND_XRP_NO_DIRECT", "Malformed: No Ripple direct is not allowed for XRP to XRP."}, + temBAD_SEND_XRP_PARTIAL: {"temBAD_SEND_XRP_PARTIAL", "Malformed: Partial payment is not allowed for XRP to XRP."}, + temBAD_SEND_XRP_PATHS: {"temBAD_SEND_XRP_PATHS", "Malformed: Paths are not allowed for XRP to XRP."}, + temDST_IS_SRC: {"temDST_IS_SRC", "Destination may not be source."}, + temDST_NEEDED: {"temDST_NEEDED", "Destination not specified."}, + temINVALID: {"temINVALID", "The transaction is ill-formed."}, + temINVALID_FLAG: {"temINVALID_FLAG", "The transaction has an invalid flag."}, + temREDUNDANT: {"temREDUNDANT", "Sends same currency to self."}, + temRIPPLE_EMPTY: {"temRIPPLE_EMPTY", "PathSet with no paths."}, + temUNCERTAIN: {"temUNCERTAIN", "In process of determining result. Never returned."}, + temUNKNOWN: {"temUNKNOWN", "The transactions requires logic not implemented yet."}, + temDISABLED: {"temDISABLED", "The transaction requires logic that is currently disabled."}, + temBAD_TICK_SIZE: {"temBAD_TICK_SIZE", "Malformed: Tick size out of range."}, + temINVALID_ACCOUNT_ID: {"temINVALID_ACCOUNT_ID", "Malformed: A field contains an invalid account ID."}, + temCANNOT_PREAUTH_SELF: {"temCANNOT_PREAUTH_SELF", "Malformed: An account may not preauthorize itself."}, + temSEQ_AND_TICKET: {"temSEQ_AND_TICKET", "Transaction contains a TicketSequence and a non-zero Sequence"}, + temBAD_NFTOKEN_TRANSFER_FEE: {"temBAD_NFTOKEN_TRANSFER_FEE", "Malformed: The NFToken transfer fee must be between 1 and 5000, inclusive."}, + temBAD_WEIGHT: {"temBAD_WEIGHT", "The SignerListSet transaction includes a SignerWeight that is invalid, for example a zero or negative value."}, + temBAD_AMM_TOKENS: {"temBAD_AMM_TOKENS", ""}, + temXCHAIN_EQUAL_DOOR_ACCOUNTS: {"temXCHAIN_EQUAL_DOOR_ACCOUNTS", ""}, + temXCHAIN_BAD_PROOF: {"temXCHAIN_BAD_PROOF", ""}, + temXCHAIN_BRIDGE_BAD_ISSUES: {"temXCHAIN_BRIDGE_BAD_ISSUES", ""}, + temXCHAIN_BRIDGE_NONDOOR_OWNER: {"temXCHAIN_BRIDGE_NONDOOR_OWNER", ""}, + temXCHAIN_BRIDGE_BAD_MIN_ACCOUNT_CREATE_AMOUNT: {"temXCHAIN_BRIDGE_BAD_MIN_ACCOUNT_CREATE_AMOUNT", ""}, + temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT: {"temXCHAIN_BRIDGE_BAD_REWARD_AMOUNT", ""}, + temEMPTY_DID: {"temEMPTY_DID", ""}, + temARRAY_EMPTY: {"temARRAY_EMPTY", ""}, + temARRAY_TOO_LARGE: {"temARRAY_TOO_LARGE", ""}, terRETRY: {"terRETRY", "Retry transaction."}, terFUNDS_SPENT: {"terFUNDS_SPENT", "Can't set password, password set funds already spent."}, @@ -337,6 +419,8 @@ var resultNames = map[TransactionResult]struct { terPRE_SEQ: {"terPRE_SEQ", "Missing/inapplicable prior transaction."}, terOWNERS: {"terOWNERS", "Non-zero owner count."}, terQUEUED: {"terQUEUED", "Held until escalated fee drops."}, + terPRE_TICKET: {"terPRE_TICKET", "Ticket is not yet in ledger."}, + terNO_AMM: {"terNO_AMM", "AMM doesn't exist for the asset pair."}, } var reverseResults map[string]TransactionResult diff --git a/data/transaction.go b/data/transaction.go index 6cc0c1e..c1fb6c9 100644 --- a/data/transaction.go +++ b/data/transaction.go @@ -90,8 +90,8 @@ type AMMCreate struct { type AMMDeposit struct { TxBase - Asset Hash160 - Asset2 Hash160 + Asset Asset + Asset2 Asset Amount *Amount `json:",omitempty"` Amount2 *Amount `json:",omitempty"` EPrice *Amount `json:",omitempty"` @@ -101,8 +101,8 @@ type AMMDeposit struct { type AMMWithdraw struct { TxBase - Asset Hash160 - Asset2 Hash160 + Asset Asset + Asset2 Asset Amount *Amount `json:",omitempty"` Amount2 *Amount `json:",omitempty"` EPrice *Amount `json:",omitempty"` @@ -111,15 +111,15 @@ type AMMWithdraw struct { type AMMVote struct { TxBase - Asset Hash160 - Asset2 Hash160 + Asset Asset + Asset2 Asset TradingFee uint16 } type AMMBid struct { TxBase - Asset Hash160 - Asset2 Hash160 + Asset Asset + Asset2 Asset BidMin *Amount `json:",omitempty"` BidMax *Amount `json:",omitempty"` AuthAccounts []Account `json:",omitempty"` @@ -127,8 +127,8 @@ type AMMBid struct { type AMMDelete struct { TxBase - Asset Hash160 - Asset2 Hash160 + Asset Asset + Asset2 Asset } type TrustSet struct {