@bithomp/xrpl-api 3.5.1 → 3.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/lib/client.js +3 -2
  2. package/lib/common/index.d.ts +2 -0
  3. package/lib/common/index.js +3 -1
  4. package/lib/ledger/transaction.js +4 -4
  5. package/lib/models/account_info.js +1 -1
  6. package/lib/parse/ledger/amount.js +3 -0
  7. package/lib/parse/ledger/batch-flags.d.ts +5 -0
  8. package/lib/parse/ledger/batch-flags.js +8 -0
  9. package/lib/parse/ledger/global-flags.d.ts +4 -0
  10. package/lib/parse/ledger/global-flags.js +8 -0
  11. package/lib/parse/ledger/ledger.js +35 -1
  12. package/lib/parse/ledger/tx-account-set-flags.d.ts +4 -0
  13. package/lib/parse/ledger/tx-account-set-flags.js +42 -0
  14. package/lib/parse/ledger/tx-amm-clawback-flags.d.ts +6 -0
  15. package/lib/parse/ledger/tx-amm-clawback-flags.js +8 -0
  16. package/lib/parse/ledger/tx-amm-deposit-flags.d.ts +6 -0
  17. package/lib/parse/ledger/tx-amm-deposit-flags.js +8 -0
  18. package/lib/parse/ledger/tx-amm-withdraw-flags.d.ts +6 -0
  19. package/lib/parse/ledger/tx-amm-withdraw-flags.js +8 -0
  20. package/lib/parse/ledger/tx-batch-flags.d.ts +6 -0
  21. package/lib/parse/ledger/tx-batch-flags.js +8 -0
  22. package/lib/parse/ledger/tx-global-flags.d.ts +5 -0
  23. package/lib/parse/ledger/tx-global-flags.js +8 -0
  24. package/lib/parse/ledger/tx-mptoken-authorize-flags.d.ts +6 -0
  25. package/lib/parse/ledger/tx-mptoken-authorize-flags.js +8 -0
  26. package/lib/parse/ledger/tx-mptoken-issuance-create-flags.d.ts +6 -0
  27. package/lib/parse/ledger/tx-mptoken-issuance-create-flags.js +8 -0
  28. package/lib/parse/ledger/tx-mptoken-issuance-set-flags.d.ts +6 -0
  29. package/lib/parse/ledger/tx-mptoken-issuance-set-flags.js +8 -0
  30. package/lib/parse/ledger/tx-nftoken-mint-flags.d.ts +6 -0
  31. package/lib/parse/ledger/tx-nftoken-mint-flags.js +8 -0
  32. package/lib/parse/ledger/tx-nftoken-offer-create-flags.d.ts +6 -0
  33. package/lib/parse/ledger/tx-nftoken-offer-create-flags.js +8 -0
  34. package/lib/parse/ledger/tx-offer-create-flags.d.ts +6 -0
  35. package/lib/parse/ledger/tx-offer-create-flags.js +8 -0
  36. package/lib/parse/ledger/tx-payment-flags.d.ts +6 -0
  37. package/lib/parse/ledger/tx-payment-flags.js +8 -0
  38. package/lib/parse/ledger/tx-trust-set-flags.d.ts +6 -0
  39. package/lib/parse/ledger/tx-trust-set-flags.js +8 -0
  40. package/lib/parse/ledger/tx-uritoken-mint-flags.d.ts +6 -0
  41. package/lib/parse/ledger/tx-uritoken-mint-flags.js +8 -0
  42. package/lib/parse/outcome/emitted_txns.d.ts +1 -1
  43. package/lib/parse/outcome/emitted_txns.js +6 -5
  44. package/lib/parse/outcome.js +10 -9
  45. package/lib/parse/specification/account-delete.d.ts +1 -1
  46. package/lib/parse/specification/account-delete.js +3 -1
  47. package/lib/parse/specification/amendment.d.ts +1 -1
  48. package/lib/parse/specification/amendment.js +3 -1
  49. package/lib/parse/specification/amm-bid.d.ts +1 -1
  50. package/lib/parse/specification/amm-bid.js +3 -1
  51. package/lib/parse/specification/amm-clawback.d.ts +1 -1
  52. package/lib/parse/specification/amm-clawback.js +3 -3
  53. package/lib/parse/specification/amm-create.d.ts +1 -1
  54. package/lib/parse/specification/amm-create.js +3 -1
  55. package/lib/parse/specification/amm-delete.d.ts +1 -1
  56. package/lib/parse/specification/amm-delete.js +3 -1
  57. package/lib/parse/specification/amm-deposit.d.ts +1 -1
  58. package/lib/parse/specification/amm-deposit.js +3 -3
  59. package/lib/parse/specification/amm-vote.d.ts +1 -1
  60. package/lib/parse/specification/amm-vote.js +3 -1
  61. package/lib/parse/specification/amm-withdraw.d.ts +1 -1
  62. package/lib/parse/specification/amm-withdraw.js +3 -3
  63. package/lib/parse/specification/batch.d.ts +4 -0
  64. package/lib/parse/specification/batch.js +83 -0
  65. package/lib/parse/specification/check-cancel.d.ts +1 -1
  66. package/lib/parse/specification/check-cancel.js +3 -1
  67. package/lib/parse/specification/check-cash.d.ts +1 -1
  68. package/lib/parse/specification/check-cash.js +3 -1
  69. package/lib/parse/specification/check-create.d.ts +1 -1
  70. package/lib/parse/specification/check-create.js +3 -1
  71. package/lib/parse/specification/clawback.d.ts +1 -1
  72. package/lib/parse/specification/clawback.js +3 -1
  73. package/lib/parse/specification/credential-accept.d.ts +2 -1
  74. package/lib/parse/specification/credential-accept.js +3 -1
  75. package/lib/parse/specification/credential-create.d.ts +2 -1
  76. package/lib/parse/specification/credential-create.js +3 -1
  77. package/lib/parse/specification/credential-delete.d.ts +2 -1
  78. package/lib/parse/specification/credential-delete.js +4 -2
  79. package/lib/parse/specification/delegate-set.d.ts +1 -1
  80. package/lib/parse/specification/delegate-set.js +3 -1
  81. package/lib/parse/specification/deposit-preauth.d.ts +1 -1
  82. package/lib/parse/specification/deposit-preauth.js +12 -1
  83. package/lib/parse/specification/did-delete.d.ts +1 -1
  84. package/lib/parse/specification/did-delete.js +3 -1
  85. package/lib/parse/specification/did-set.d.ts +1 -1
  86. package/lib/parse/specification/did-set.js +3 -1
  87. package/lib/parse/specification/escrow-cancel.d.ts +1 -1
  88. package/lib/parse/specification/escrow-cancel.js +3 -1
  89. package/lib/parse/specification/escrow-create.d.ts +1 -1
  90. package/lib/parse/specification/escrow-create.js +3 -1
  91. package/lib/parse/specification/escrow-finish.d.ts +1 -1
  92. package/lib/parse/specification/escrow-finish.js +3 -1
  93. package/lib/parse/specification/fee-update.d.ts +1 -1
  94. package/lib/parse/specification/fee-update.js +3 -1
  95. package/lib/parse/specification/genesis-mint.d.ts +1 -1
  96. package/lib/parse/specification/genesis-mint.js +3 -1
  97. package/lib/parse/specification/mptoken-authorize.d.ts +1 -1
  98. package/lib/parse/specification/mptoken-authorize.js +3 -3
  99. package/lib/parse/specification/mptoken-issuance-create.d.ts +1 -1
  100. package/lib/parse/specification/mptoken-issuance-create.js +3 -3
  101. package/lib/parse/specification/mptoken-issuance-destroy.d.ts +1 -1
  102. package/lib/parse/specification/mptoken-issuance-destroy.js +3 -1
  103. package/lib/parse/specification/mptoken-issuance-set.d.ts +1 -1
  104. package/lib/parse/specification/mptoken-issuance-set.js +3 -3
  105. package/lib/parse/specification/nftoken-accept-offer.d.ts +1 -1
  106. package/lib/parse/specification/nftoken-accept-offer.js +3 -3
  107. package/lib/parse/specification/nftoken-burn.d.ts +1 -1
  108. package/lib/parse/specification/nftoken-burn.js +3 -3
  109. package/lib/parse/specification/nftoken-cancel-offer.d.ts +1 -1
  110. package/lib/parse/specification/nftoken-cancel-offer.js +3 -3
  111. package/lib/parse/specification/nftoken-create-offer.d.ts +1 -1
  112. package/lib/parse/specification/nftoken-create-offer.js +3 -5
  113. package/lib/parse/specification/nftoken-mint.d.ts +1 -1
  114. package/lib/parse/specification/nftoken-mint.js +3 -3
  115. package/lib/parse/specification/nftoken-modify.d.ts +1 -1
  116. package/lib/parse/specification/nftoken-modify.js +3 -3
  117. package/lib/parse/specification/offer-cancel.d.ts +1 -1
  118. package/lib/parse/specification/offer-cancel.js +3 -1
  119. package/lib/parse/specification/offer-create.d.ts +1 -1
  120. package/lib/parse/specification/offer-create.js +6 -6
  121. package/lib/parse/specification/oracle-delete.d.ts +1 -1
  122. package/lib/parse/specification/oracle-delete.js +3 -1
  123. package/lib/parse/specification/oracle-set.d.ts +1 -1
  124. package/lib/parse/specification/oracle-set.js +3 -1
  125. package/lib/parse/specification/payment-channel-claim.d.ts +1 -1
  126. package/lib/parse/specification/payment-channel-claim.js +3 -1
  127. package/lib/parse/specification/payment-channel-create.d.ts +1 -1
  128. package/lib/parse/specification/payment-channel-create.js +3 -1
  129. package/lib/parse/specification/payment-channel-fund.d.ts +1 -1
  130. package/lib/parse/specification/payment-channel-fund.js +3 -1
  131. package/lib/parse/specification/payment.d.ts +1 -1
  132. package/lib/parse/specification/payment.js +8 -3
  133. package/lib/parse/specification/remit.d.ts +1 -1
  134. package/lib/parse/specification/remit.js +3 -1
  135. package/lib/parse/specification/set-remarks.d.ts +1 -1
  136. package/lib/parse/specification/set-remarks.js +3 -1
  137. package/lib/parse/specification/settings.d.ts +2 -1
  138. package/lib/parse/specification/settings.js +3 -1
  139. package/lib/parse/specification/ticket-create.d.ts +1 -1
  140. package/lib/parse/specification/ticket-create.js +3 -1
  141. package/lib/parse/specification/trust-set.d.ts +1 -1
  142. package/lib/parse/specification/trust-set.js +6 -1
  143. package/lib/parse/specification/unrecognized.d.ts +1 -1
  144. package/lib/parse/specification/unrecognized.js +3 -1
  145. package/lib/parse/specification/uritoken-burn.d.ts +1 -1
  146. package/lib/parse/specification/uritoken-burn.js +3 -1
  147. package/lib/parse/specification/uritoken-buy.d.ts +1 -1
  148. package/lib/parse/specification/uritoken-buy.js +3 -1
  149. package/lib/parse/specification/uritoken-cancel-sell-offer.d.ts +1 -1
  150. package/lib/parse/specification/uritoken-cancel-sell-offer.js +3 -1
  151. package/lib/parse/specification/uritoken-create-sell-offer.d.ts +1 -1
  152. package/lib/parse/specification/uritoken-create-sell-offer.js +3 -1
  153. package/lib/parse/specification/uritoken-mint.d.ts +1 -1
  154. package/lib/parse/specification/uritoken-mint.js +3 -3
  155. package/lib/parse/transaction.d.ts +118 -1
  156. package/lib/parse/transaction.js +8 -4
  157. package/lib/types/amm.d.ts +8 -7
  158. package/lib/types/amm.js +46 -6
  159. package/lib/types/batch.d.ts +21 -0
  160. package/lib/types/batch.js +26 -0
  161. package/lib/types/credentials.d.ts +1 -1
  162. package/lib/types/deposits.d.ts +6 -0
  163. package/lib/types/global.d.ts +19 -0
  164. package/lib/types/global.js +28 -0
  165. package/lib/types/mptokens.d.ts +7 -3
  166. package/lib/types/mptokens.js +44 -0
  167. package/lib/types/nftokens.d.ts +5 -2
  168. package/lib/types/nftokens.js +30 -0
  169. package/lib/types/offers.d.ts +3 -1
  170. package/lib/types/offers.js +16 -0
  171. package/lib/types/payments.d.ts +13 -0
  172. package/lib/types/payments.js +23 -0
  173. package/lib/types/specification.d.ts +2 -0
  174. package/lib/types/trustlines.d.ts +21 -1
  175. package/lib/types/trustlines.js +26 -1
  176. package/lib/types/uritokens.d.ts +3 -1
  177. package/lib/types/uritokens.js +16 -0
  178. package/package.json +7 -7
@@ -47,10 +47,10 @@ const signers_1 = require("../ledger/signers");
47
47
  const regular_key_1 = require("../ledger/regular-key");
48
48
  const delegate_1 = require("../ledger/delegate");
49
49
  const source_1 = require("../ledger/source");
50
- const offer_create_flags_1 = __importDefault(require("../ledger/offer-create-flags"));
51
- function parseOfferCreate(tx) {
50
+ const tx_offer_create_flags_1 = __importDefault(require("../ledger/tx-offer-create-flags"));
51
+ function parseOfferCreate(tx, nativeCurrency) {
52
52
  assert.ok(tx.TransactionType === "OfferCreate");
53
- const flags = (0, offer_create_flags_1.default)(tx.Flags);
53
+ const flags = (0, tx_offer_create_flags_1.default)(tx.Flags, { nativeCurrency });
54
54
  const takerGets = (0, amount_1.default)(tx.TakerGets);
55
55
  const takerPays = (0, amount_1.default)(tx.TakerPays);
56
56
  const quantity = flags.sell === true ? takerGets : takerPays;
@@ -63,13 +63,13 @@ function parseOfferCreate(tx) {
63
63
  flags,
64
64
  quantity: quantity,
65
65
  totalPrice: totalPrice,
66
+ expirationTime: (0, utils_1.parseTimestamp)(tx.Expiration),
67
+ emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
68
+ memos: (0, memos_1.parseMemos)(tx),
66
69
  direction: (tx.Flags & xrpl_1.OfferCreateFlags.tfSell) === 0 ? "buy" : "sell",
67
70
  passive: (tx.Flags & xrpl_1.OfferCreateFlags.tfPassive) !== 0 || undefined,
68
71
  immediateOrCancel: (tx.Flags & xrpl_1.OfferCreateFlags.tfImmediateOrCancel) !== 0 || undefined,
69
72
  fillOrKill: (tx.Flags & xrpl_1.OfferCreateFlags.tfFillOrKill) !== 0 || undefined,
70
- expirationTime: (0, utils_1.parseTimestamp)(tx.Expiration),
71
- emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
72
- memos: (0, memos_1.parseMemos)(tx),
73
73
  });
74
74
  }
75
75
  exports.default = parseOfferCreate;
@@ -1,4 +1,4 @@
1
1
  import { OracleDelete } from "xrpl";
2
2
  import { FormattedOracleDeleteSpecification } from "../../types/oracle";
3
- declare function parseDidDelete(tx: OracleDelete): FormattedOracleDeleteSpecification;
3
+ declare function parseDidDelete(tx: OracleDelete, nativeCurrency?: string): FormattedOracleDeleteSpecification;
4
4
  export default parseDidDelete;
@@ -35,12 +35,13 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const assert = __importStar(require("assert"));
37
37
  const common_1 = require("../../common");
38
+ const tx_global_flags_1 = require("../ledger/tx-global-flags");
38
39
  const memos_1 = require("../ledger/memos");
39
40
  const signers_1 = require("../ledger/signers");
40
41
  const regular_key_1 = require("../ledger/regular-key");
41
42
  const delegate_1 = require("../ledger/delegate");
42
43
  const source_1 = require("../ledger/source");
43
- function parseDidDelete(tx) {
44
+ function parseDidDelete(tx, nativeCurrency) {
44
45
  assert.ok(tx.TransactionType === "OracleDelete");
45
46
  return (0, common_1.removeUndefined)({
46
47
  signers: (0, signers_1.parseSigners)(tx),
@@ -48,6 +49,7 @@ function parseDidDelete(tx) {
48
49
  delegate: (0, delegate_1.parseDelegate)(tx),
49
50
  source: (0, source_1.parseSource)(tx),
50
51
  oracleDocumentID: tx.OracleDocumentID,
52
+ flags: (0, tx_global_flags_1.parseTxGlobalFlags)(tx.Flags, { nativeCurrency }),
51
53
  memos: (0, memos_1.parseMemos)(tx),
52
54
  });
53
55
  }
@@ -1,4 +1,4 @@
1
1
  import { OracleSet } from "xrpl";
2
2
  import { FormattedOracleSetSpecification } from "../../types/oracle";
3
- declare function parseDidSet(tx: OracleSet): FormattedOracleSetSpecification;
3
+ declare function parseDidSet(tx: OracleSet, nativeCurrency?: string): FormattedOracleSetSpecification;
4
4
  export default parseDidSet;
@@ -35,13 +35,14 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const assert = __importStar(require("assert"));
37
37
  const common_1 = require("../../common");
38
+ const tx_global_flags_1 = require("../ledger/tx-global-flags");
38
39
  const memos_1 = require("../ledger/memos");
39
40
  const signers_1 = require("../ledger/signers");
40
41
  const regular_key_1 = require("../ledger/regular-key");
41
42
  const delegate_1 = require("../ledger/delegate");
42
43
  const source_1 = require("../ledger/source");
43
44
  const oracle_changes_1 = require("../outcome/oracle_changes");
44
- function parseDidSet(tx) {
45
+ function parseDidSet(tx, nativeCurrency) {
45
46
  assert.ok(tx.TransactionType === "OracleSet");
46
47
  return (0, common_1.removeUndefined)({
47
48
  signers: (0, signers_1.parseSigners)(tx),
@@ -54,6 +55,7 @@ function parseDidSet(tx) {
54
55
  assetClass: tx.AssetClass,
55
56
  lastUpdateTime: tx.LastUpdateTime,
56
57
  priceDataSeries: tx.PriceDataSeries ? tx.PriceDataSeries.map(oracle_changes_1.parsePriceDataSeries) : undefined,
58
+ flags: (0, tx_global_flags_1.parseTxGlobalFlags)(tx.Flags, { nativeCurrency }),
57
59
  memos: (0, memos_1.parseMemos)(tx),
58
60
  });
59
61
  }
@@ -1,4 +1,4 @@
1
1
  import { PaymentChannelClaim } from "xrpl";
2
2
  import { FormattedPaymentChannelClaimSpecification } from "../../types/payment_channels";
3
- declare function parsePaymentChannelClaim(tx: PaymentChannelClaim): FormattedPaymentChannelClaimSpecification;
3
+ declare function parsePaymentChannelClaim(tx: PaymentChannelClaim, nativeCurrency?: string): FormattedPaymentChannelClaimSpecification;
4
4
  export default parsePaymentChannelClaim;
@@ -41,12 +41,13 @@ const xrpl_1 = require("xrpl");
41
41
  const common_1 = require("../../common");
42
42
  const amount_1 = __importDefault(require("../ledger/amount"));
43
43
  const emit_details_1 = require("../ledger/emit_details");
44
+ const tx_global_flags_1 = require("../ledger/tx-global-flags");
44
45
  const memos_1 = require("../ledger/memos");
45
46
  const signers_1 = require("../ledger/signers");
46
47
  const regular_key_1 = require("../ledger/regular-key");
47
48
  const delegate_1 = require("../ledger/delegate");
48
49
  const source_1 = require("../ledger/source");
49
- function parsePaymentChannelClaim(tx) {
50
+ function parsePaymentChannelClaim(tx, nativeCurrency) {
50
51
  assert.ok(tx.TransactionType === "PaymentChannelClaim");
51
52
  return (0, common_1.removeUndefined)({
52
53
  signers: (0, signers_1.parseSigners)(tx),
@@ -59,6 +60,7 @@ function parsePaymentChannelClaim(tx) {
59
60
  renew: Boolean(tx.Flags & xrpl_1.PaymentChannelClaimFlags.tfRenew) || undefined,
60
61
  close: Boolean(tx.Flags & xrpl_1.PaymentChannelClaimFlags.tfClose) || undefined,
61
62
  emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
63
+ flags: (0, tx_global_flags_1.parseTxGlobalFlags)(tx.Flags, { nativeCurrency }),
62
64
  memos: (0, memos_1.parseMemos)(tx),
63
65
  });
64
66
  }
@@ -1,4 +1,4 @@
1
1
  import { PaymentChannelCreate } from "xrpl";
2
2
  import { FormattedPaymentChannelCreateSpecification } from "../../types/payment_channels";
3
- declare function parsePaymentChannelCreate(tx: PaymentChannelCreate): FormattedPaymentChannelCreateSpecification;
3
+ declare function parsePaymentChannelCreate(tx: PaymentChannelCreate, nativeCurrency?: string): FormattedPaymentChannelCreateSpecification;
4
4
  export default parsePaymentChannelCreate;
@@ -41,13 +41,14 @@ const common_1 = require("../../common");
41
41
  const utils_1 = require("../utils");
42
42
  const amount_1 = __importDefault(require("../ledger/amount"));
43
43
  const emit_details_1 = require("../ledger/emit_details");
44
+ const tx_global_flags_1 = require("../ledger/tx-global-flags");
44
45
  const memos_1 = require("../ledger/memos");
45
46
  const signers_1 = require("../ledger/signers");
46
47
  const regular_key_1 = require("../ledger/regular-key");
47
48
  const delegate_1 = require("../ledger/delegate");
48
49
  const source_1 = require("../ledger/source");
49
50
  const destination_1 = require("../ledger/destination");
50
- function parsePaymentChannelCreate(tx) {
51
+ function parsePaymentChannelCreate(tx, nativeCurrency) {
51
52
  assert.ok(tx.TransactionType === "PaymentChannelCreate");
52
53
  return (0, common_1.removeUndefined)({
53
54
  signers: (0, signers_1.parseSigners)(tx),
@@ -60,6 +61,7 @@ function parsePaymentChannelCreate(tx) {
60
61
  publicKey: tx.PublicKey,
61
62
  cancelAfter: tx.CancelAfter && (0, utils_1.parseTimestamp)(tx.CancelAfter),
62
63
  emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
64
+ flags: (0, tx_global_flags_1.parseTxGlobalFlags)(tx.Flags, { nativeCurrency }),
63
65
  memos: (0, memos_1.parseMemos)(tx),
64
66
  });
65
67
  }
@@ -1,4 +1,4 @@
1
1
  import { PaymentChannelFund } from "xrpl";
2
2
  import { FormattedPaymentChannelFundSpecification } from "../../types/payment_channels";
3
- declare function parsePaymentChannelFund(tx: PaymentChannelFund): FormattedPaymentChannelFundSpecification;
3
+ declare function parsePaymentChannelFund(tx: PaymentChannelFund, nativeCurrency?: string): FormattedPaymentChannelFundSpecification;
4
4
  export default parsePaymentChannelFund;
@@ -41,12 +41,13 @@ const common_1 = require("../../common");
41
41
  const utils_1 = require("../utils");
42
42
  const amount_1 = __importDefault(require("../ledger/amount"));
43
43
  const emit_details_1 = require("../ledger/emit_details");
44
+ const tx_global_flags_1 = require("../ledger/tx-global-flags");
44
45
  const memos_1 = require("../ledger/memos");
45
46
  const signers_1 = require("../ledger/signers");
46
47
  const regular_key_1 = require("../ledger/regular-key");
47
48
  const delegate_1 = require("../ledger/delegate");
48
49
  const source_1 = require("../ledger/source");
49
- function parsePaymentChannelFund(tx) {
50
+ function parsePaymentChannelFund(tx, nativeCurrency) {
50
51
  assert.ok(tx.TransactionType === "PaymentChannelFund");
51
52
  return (0, common_1.removeUndefined)({
52
53
  signers: (0, signers_1.parseSigners)(tx),
@@ -57,6 +58,7 @@ function parsePaymentChannelFund(tx) {
57
58
  amount: (0, amount_1.default)(tx.Amount),
58
59
  expiration: tx.Expiration && (0, utils_1.parseTimestamp)(tx.Expiration),
59
60
  emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
61
+ flags: (0, tx_global_flags_1.parseTxGlobalFlags)(tx.Flags, { nativeCurrency }),
60
62
  memos: (0, memos_1.parseMemos)(tx),
61
63
  });
62
64
  }
@@ -1,4 +1,4 @@
1
1
  import { Payment } from "xrpl";
2
2
  import { FormattedPaymentSpecification } from "../../types/payments";
3
- declare function parsePayment(tx: Payment): FormattedPaymentSpecification;
3
+ declare function parsePayment(tx: Payment, nativeCurrency?: string): FormattedPaymentSpecification;
4
4
  export default parsePayment;
@@ -32,12 +32,16 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
35
38
  Object.defineProperty(exports, "__esModule", { value: true });
36
39
  const assert = __importStar(require("assert"));
37
40
  const xrpl_1 = require("xrpl");
38
41
  const utils_1 = require("../utils");
39
42
  const common_1 = require("../../common");
40
43
  const emit_details_1 = require("../ledger/emit_details");
44
+ const tx_payment_flags_1 = __importDefault(require("../ledger/tx-payment-flags"));
41
45
  const memos_1 = require("../ledger/memos");
42
46
  const signers_1 = require("../ledger/signers");
43
47
  const regular_key_1 = require("../ledger/regular-key");
@@ -50,7 +54,7 @@ function isNoDirectRipple(tx) {
50
54
  function isQualityLimited(tx) {
51
55
  return (tx.Flags & xrpl_1.PaymentFlags.tfLimitQuality) !== 0;
52
56
  }
53
- function parsePayment(tx) {
57
+ function parsePayment(tx, nativeCurrency) {
54
58
  assert.ok(tx.TransactionType === "Payment");
55
59
  return (0, common_1.removeUndefined)({
56
60
  source: (0, source_1.parseSourceWithAmount)(tx),
@@ -60,11 +64,12 @@ function parsePayment(tx) {
60
64
  delegate: (0, delegate_1.parseDelegate)(tx),
61
65
  invoiceID: tx.InvoiceID,
62
66
  paths: tx.Paths ? JSON.stringify(tx.Paths) : undefined,
67
+ emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
68
+ flags: (0, tx_payment_flags_1.default)(tx.Flags, { nativeCurrency }),
69
+ memos: (0, memos_1.parseMemos)(tx),
63
70
  allowPartialPayment: (0, utils_1.isPartialPayment)(tx) || undefined,
64
71
  noDirectRipple: isNoDirectRipple(tx) || undefined,
65
72
  limitQuality: isQualityLimited(tx) || undefined,
66
- emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
67
- memos: (0, memos_1.parseMemos)(tx),
68
73
  });
69
74
  }
70
75
  exports.default = parsePayment;
@@ -1,3 +1,3 @@
1
1
  import { FormattedRemitsSpecification } from "../../types/remits";
2
- declare function parseRemit(tx: any): FormattedRemitsSpecification;
2
+ declare function parseRemit(tx: any, nativeCurrency?: string): FormattedRemitsSpecification;
3
3
  export default parseRemit;
@@ -39,6 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  const assert = __importStar(require("assert"));
40
40
  const common_1 = require("../../common");
41
41
  const emit_details_1 = require("../ledger/emit_details");
42
+ const tx_global_flags_1 = require("../ledger/tx-global-flags");
42
43
  const memos_1 = require("../ledger/memos");
43
44
  const signers_1 = require("../ledger/signers");
44
45
  const regular_key_1 = require("../ledger/regular-key");
@@ -70,7 +71,7 @@ function parseMintURIToken(mintURIToken) {
70
71
  digest: mintURIToken.Digest,
71
72
  });
72
73
  }
73
- function parseRemit(tx) {
74
+ function parseRemit(tx, nativeCurrency) {
74
75
  assert.ok(tx.TransactionType === "Remit");
75
76
  return (0, common_1.removeUndefined)({
76
77
  signers: (0, signers_1.parseSigners)(tx),
@@ -84,6 +85,7 @@ function parseRemit(tx) {
84
85
  inform: tx.Inform,
85
86
  invoiceID: tx.InvoiceID,
86
87
  emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
88
+ flags: (0, tx_global_flags_1.parseTxGlobalFlags)(tx.Flags, { nativeCurrency }),
87
89
  memos: (0, memos_1.parseMemos)(tx),
88
90
  });
89
91
  }
@@ -1,3 +1,3 @@
1
1
  import { FormattedSetRemarksSpecification } from "../../types/remarks";
2
- declare function parseSetRemarks(tx: any): FormattedSetRemarksSpecification;
2
+ declare function parseSetRemarks(tx: any, nativeCurrency?: string): FormattedSetRemarksSpecification;
3
3
  export default parseSetRemarks;
@@ -36,12 +36,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const assert = __importStar(require("assert"));
37
37
  const common_1 = require("../../common");
38
38
  const emit_details_1 = require("../ledger/emit_details");
39
+ const tx_global_flags_1 = require("../ledger/tx-global-flags");
39
40
  const memos_1 = require("../ledger/memos");
40
41
  const signers_1 = require("../ledger/signers");
41
42
  const regular_key_1 = require("../ledger/regular-key");
42
43
  const source_1 = require("../ledger/source");
43
44
  const remarks_1 = require("../ledger/remarks");
44
- function parseSetRemarks(tx) {
45
+ function parseSetRemarks(tx, nativeCurrency) {
45
46
  assert.ok(tx.TransactionType === "SetRemarks");
46
47
  return (0, common_1.removeUndefined)({
47
48
  objectID: tx.ObjectID,
@@ -50,6 +51,7 @@ function parseSetRemarks(tx) {
50
51
  signers: (0, signers_1.parseSigners)(tx),
51
52
  signer: (0, regular_key_1.parseSignerRegularKey)(tx),
52
53
  emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
54
+ flags: (0, tx_global_flags_1.parseTxGlobalFlags)(tx.Flags, { nativeCurrency }),
53
55
  memos: (0, memos_1.parseMemos)(tx),
54
56
  });
55
57
  }
@@ -1,2 +1,3 @@
1
- declare function parseSettings(tx: any): any;
1
+ import { AccountSet, SetRegularKey, SignerListSet } from "xrpl";
2
+ declare function parseSettings(tx: AccountSet | SetRegularKey | SignerListSet, nativeCurrency?: string): any;
2
3
  export default parseSettings;
@@ -42,6 +42,7 @@ const account_info_1 = require("../../models/account_info");
42
42
  const common_1 = require("../../common");
43
43
  const fields_1 = __importDefault(require("../ledger/fields"));
44
44
  const emit_details_1 = require("../ledger/emit_details");
45
+ const tx_account_set_flags_1 = __importDefault(require("../ledger/tx-account-set-flags"));
45
46
  const memos_1 = require("../ledger/memos");
46
47
  const signers_1 = require("../ledger/signers");
47
48
  const regular_key_1 = require("../ledger/regular-key");
@@ -84,7 +85,7 @@ function parseSettingsFlags(tx) {
84
85
  }
85
86
  return settings;
86
87
  }
87
- function parseSettings(tx) {
88
+ function parseSettings(tx, nativeCurrency) {
88
89
  const txType = tx.TransactionType;
89
90
  assert.ok(txType === "AccountSet" || txType === "SetRegularKey" || txType === "SignerListSet");
90
91
  const baseSettings = (0, common_1.removeUndefined)({
@@ -93,6 +94,7 @@ function parseSettings(tx) {
93
94
  signer: (0, regular_key_1.parseSignerRegularKey)(tx),
94
95
  delegate: (0, delegate_1.parseDelegate)(tx),
95
96
  emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
97
+ flags: (0, tx_account_set_flags_1.default)(tx.Flags, { nativeCurrency }),
96
98
  memos: (0, memos_1.parseMemos)(tx),
97
99
  });
98
100
  return Object.assign(baseSettings, parseSettingsFlags(tx), (0, fields_1.default)(tx));
@@ -1,4 +1,4 @@
1
1
  import { TicketCreate } from "xrpl";
2
2
  import { FormattedTicketCreateSpecification } from "../../types/tickets";
3
- declare function parseTicketCreate(tx: TicketCreate): FormattedTicketCreateSpecification;
3
+ declare function parseTicketCreate(tx: TicketCreate, nativeCurrency?: string): FormattedTicketCreateSpecification;
4
4
  export default parseTicketCreate;
@@ -36,12 +36,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const assert = __importStar(require("assert"));
37
37
  const common_1 = require("../../common");
38
38
  const emit_details_1 = require("../ledger/emit_details");
39
+ const tx_global_flags_1 = require("../ledger/tx-global-flags");
39
40
  const memos_1 = require("../ledger/memos");
40
41
  const signers_1 = require("../ledger/signers");
41
42
  const regular_key_1 = require("../ledger/regular-key");
42
43
  const delegate_1 = require("../ledger/delegate");
43
44
  const source_1 = require("../ledger/source");
44
- function parseTicketCreate(tx) {
45
+ function parseTicketCreate(tx, nativeCurrency) {
45
46
  assert.ok(tx.TransactionType === "TicketCreate");
46
47
  return (0, common_1.removeUndefined)({
47
48
  signers: (0, signers_1.parseSigners)(tx),
@@ -50,6 +51,7 @@ function parseTicketCreate(tx) {
50
51
  source: (0, source_1.parseSource)(tx),
51
52
  ticketCount: tx.TicketCount,
52
53
  emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
54
+ flags: (0, tx_global_flags_1.parseTxGlobalFlags)(tx.Flags, { nativeCurrency }),
53
55
  memos: (0, memos_1.parseMemos)(tx),
54
56
  });
55
57
  }
@@ -1,4 +1,4 @@
1
1
  import { TrustSet } from "xrpl";
2
2
  import { FormattedTrustlineSpecification } from "../../types/trustlines";
3
- declare function parseTrustSet(tx: TrustSet): FormattedTrustlineSpecification;
3
+ declare function parseTrustSet(tx: TrustSet, nativeCurrency?: string): FormattedTrustlineSpecification;
4
4
  export default parseTrustSet;
@@ -32,12 +32,16 @@ var __importStar = (this && this.__importStar) || (function () {
32
32
  return result;
33
33
  };
34
34
  })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
35
38
  Object.defineProperty(exports, "__esModule", { value: true });
36
39
  const assert = __importStar(require("assert"));
37
40
  const xrpl_1 = require("xrpl");
38
41
  const utils_1 = require("../utils");
39
42
  const common_1 = require("../../common");
40
43
  const emit_details_1 = require("../ledger/emit_details");
44
+ const tx_trust_set_flags_1 = __importDefault(require("../ledger/tx-trust-set-flags"));
41
45
  const memos_1 = require("../ledger/memos");
42
46
  const signers_1 = require("../ledger/signers");
43
47
  const regular_key_1 = require("../ledger/regular-key");
@@ -52,7 +56,7 @@ function parseFlag(flagsValue, trueValue, falseValue) {
52
56
  }
53
57
  return undefined;
54
58
  }
55
- function parseTrustSet(tx) {
59
+ function parseTrustSet(tx, nativeCurrency) {
56
60
  assert.ok(tx.TransactionType === "TrustSet");
57
61
  return (0, common_1.removeUndefined)({
58
62
  signers: (0, signers_1.parseSigners)(tx),
@@ -69,6 +73,7 @@ function parseTrustSet(tx) {
69
73
  deepFrozen: parseFlag(tx.Flags, xrpl_1.TrustSetFlags.tfSetDeepFreeze, xrpl_1.TrustSetFlags.tfClearDeepFreeze),
70
74
  authorized: parseFlag(tx.Flags, xrpl_1.TrustSetFlags.tfSetfAuth, 0),
71
75
  emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
76
+ flags: (0, tx_trust_set_flags_1.default)(tx.Flags, { nativeCurrency }),
72
77
  memos: (0, memos_1.parseMemos)(tx),
73
78
  });
74
79
  }
@@ -1,4 +1,4 @@
1
1
  import { BaseTransaction } from "xrpl";
2
2
  import { FormattedUnrecognizedParserSpecification } from "../../types/unrecognized";
3
- declare function unrecognizedParser(tx: BaseTransaction): FormattedUnrecognizedParserSpecification;
3
+ declare function unrecognizedParser(tx: BaseTransaction, nativeCurrency?: string): FormattedUnrecognizedParserSpecification;
4
4
  export default unrecognizedParser;
@@ -2,12 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const common_1 = require("../../common");
4
4
  const emit_details_1 = require("../ledger/emit_details");
5
+ const tx_global_flags_1 = require("../ledger/tx-global-flags");
5
6
  const memos_1 = require("../ledger/memos");
6
7
  const signers_1 = require("../ledger/signers");
7
8
  const regular_key_1 = require("../ledger/regular-key");
8
9
  const delegate_1 = require("../ledger/delegate");
9
10
  const source_1 = require("../ledger/source");
10
- function unrecognizedParser(tx) {
11
+ function unrecognizedParser(tx, nativeCurrency) {
11
12
  return (0, common_1.removeUndefined)({
12
13
  UNAVAILABLE: "Unrecognized transaction type.",
13
14
  SEE_RAW_TRANSACTION: "Since this type is unrecognized, `rawTransaction` is may included in this response.",
@@ -16,6 +17,7 @@ function unrecognizedParser(tx) {
16
17
  signer: (0, regular_key_1.parseSignerRegularKey)(tx),
17
18
  delegate: (0, delegate_1.parseDelegate)(tx),
18
19
  emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
20
+ flags: (0, tx_global_flags_1.parseTxGlobalFlags)(tx.Flags, { nativeCurrency }),
19
21
  memos: (0, memos_1.parseMemos)(tx),
20
22
  });
21
23
  }
@@ -1,3 +1,3 @@
1
1
  import { FormattedURITokenBurnSpecification } from "../../types/uritokens";
2
- declare function parseURITokenBurn(tx: any): FormattedURITokenBurnSpecification;
2
+ declare function parseURITokenBurn(tx: any, nativeCurrency?: string): FormattedURITokenBurnSpecification;
3
3
  export default parseURITokenBurn;
@@ -36,11 +36,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const assert = __importStar(require("assert"));
37
37
  const common_1 = require("../../common");
38
38
  const emit_details_1 = require("../ledger/emit_details");
39
+ const tx_global_flags_1 = require("../ledger/tx-global-flags");
39
40
  const memos_1 = require("../ledger/memos");
40
41
  const signers_1 = require("../ledger/signers");
41
42
  const regular_key_1 = require("../ledger/regular-key");
42
43
  const source_1 = require("../ledger/source");
43
- function parseURITokenBurn(tx) {
44
+ function parseURITokenBurn(tx, nativeCurrency) {
44
45
  assert.ok(tx.TransactionType === "URITokenBurn");
45
46
  return (0, common_1.removeUndefined)({
46
47
  uritokenID: tx.URITokenID,
@@ -48,6 +49,7 @@ function parseURITokenBurn(tx) {
48
49
  signers: (0, signers_1.parseSigners)(tx),
49
50
  signer: (0, regular_key_1.parseSignerRegularKey)(tx),
50
51
  emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
52
+ flags: (0, tx_global_flags_1.parseTxGlobalFlags)(tx.Flags, { nativeCurrency }),
51
53
  memos: (0, memos_1.parseMemos)(tx),
52
54
  });
53
55
  }
@@ -1,3 +1,3 @@
1
1
  import { FormattedURITokenBuySpecification } from "../../types/uritokens";
2
- declare function parseURITokenBuy(tx: any): FormattedURITokenBuySpecification;
2
+ declare function parseURITokenBuy(tx: any, nativeCurrency?: string): FormattedURITokenBuySpecification;
3
3
  export default parseURITokenBuy;
@@ -36,11 +36,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const assert = __importStar(require("assert"));
37
37
  const common_1 = require("../../common");
38
38
  const emit_details_1 = require("../ledger/emit_details");
39
+ const tx_global_flags_1 = require("../ledger/tx-global-flags");
39
40
  const memos_1 = require("../ledger/memos");
40
41
  const signers_1 = require("../ledger/signers");
41
42
  const regular_key_1 = require("../ledger/regular-key");
42
43
  const source_1 = require("../ledger/source");
43
- function parseURITokenBuy(tx) {
44
+ function parseURITokenBuy(tx, nativeCurrency) {
44
45
  assert.ok(tx.TransactionType === "URITokenBuy");
45
46
  return (0, common_1.removeUndefined)({
46
47
  uritokenID: tx.URITokenID,
@@ -49,6 +50,7 @@ function parseURITokenBuy(tx) {
49
50
  signers: (0, signers_1.parseSigners)(tx),
50
51
  signer: (0, regular_key_1.parseSignerRegularKey)(tx),
51
52
  emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
53
+ flags: (0, tx_global_flags_1.parseTxGlobalFlags)(tx.Flags, { nativeCurrency }),
52
54
  memos: (0, memos_1.parseMemos)(tx),
53
55
  });
54
56
  }
@@ -1,3 +1,3 @@
1
1
  import { FormattedURITokenCancelSellOfferSpecification } from "../../types/uritokens";
2
- declare function parseURITokenCancelSellOffer(tx: any): FormattedURITokenCancelSellOfferSpecification;
2
+ declare function parseURITokenCancelSellOffer(tx: any, nativeCurrency?: string): FormattedURITokenCancelSellOfferSpecification;
3
3
  export default parseURITokenCancelSellOffer;
@@ -36,11 +36,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const assert = __importStar(require("assert"));
37
37
  const common_1 = require("../../common");
38
38
  const emit_details_1 = require("../ledger/emit_details");
39
+ const tx_global_flags_1 = require("../ledger/tx-global-flags");
39
40
  const memos_1 = require("../ledger/memos");
40
41
  const signers_1 = require("../ledger/signers");
41
42
  const regular_key_1 = require("../ledger/regular-key");
42
43
  const source_1 = require("../ledger/source");
43
- function parseURITokenCancelSellOffer(tx) {
44
+ function parseURITokenCancelSellOffer(tx, nativeCurrency) {
44
45
  assert.ok(tx.TransactionType === "URITokenCancelSellOffer");
45
46
  return (0, common_1.removeUndefined)({
46
47
  uritokenID: tx.URITokenID,
@@ -48,6 +49,7 @@ function parseURITokenCancelSellOffer(tx) {
48
49
  source: (0, source_1.parseSource)(tx),
49
50
  signer: (0, regular_key_1.parseSignerRegularKey)(tx),
50
51
  emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
52
+ flags: (0, tx_global_flags_1.parseTxGlobalFlags)(tx.Flags, { nativeCurrency }),
51
53
  memos: (0, memos_1.parseMemos)(tx),
52
54
  });
53
55
  }
@@ -1,3 +1,3 @@
1
1
  import { FormattedURITokenCreateSellOfferSpecification } from "../../types/uritokens";
2
- declare function parseURITokenCreateSellOffer(tx: any): FormattedURITokenCreateSellOfferSpecification;
2
+ declare function parseURITokenCreateSellOffer(tx: any, nativeCurrency?: string): FormattedURITokenCreateSellOfferSpecification;
3
3
  export default parseURITokenCreateSellOffer;
@@ -36,12 +36,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  const assert = __importStar(require("assert"));
37
37
  const common_1 = require("../../common");
38
38
  const emit_details_1 = require("../ledger/emit_details");
39
+ const tx_global_flags_1 = require("../ledger/tx-global-flags");
39
40
  const memos_1 = require("../ledger/memos");
40
41
  const signers_1 = require("../ledger/signers");
41
42
  const regular_key_1 = require("../ledger/regular-key");
42
43
  const source_1 = require("../ledger/source");
43
44
  const destination_1 = require("../ledger/destination");
44
- function parseURITokenCreateSellOffer(tx) {
45
+ function parseURITokenCreateSellOffer(tx, nativeCurrency) {
45
46
  assert.ok(tx.TransactionType === "URITokenCreateSellOffer");
46
47
  return (0, common_1.removeUndefined)({
47
48
  uritokenID: tx.URITokenID,
@@ -51,6 +52,7 @@ function parseURITokenCreateSellOffer(tx) {
51
52
  signers: (0, signers_1.parseSigners)(tx),
52
53
  signer: (0, regular_key_1.parseSignerRegularKey)(tx),
53
54
  emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
55
+ flags: (0, tx_global_flags_1.parseTxGlobalFlags)(tx.Flags, { nativeCurrency }),
54
56
  memos: (0, memos_1.parseMemos)(tx),
55
57
  });
56
58
  }
@@ -1,3 +1,3 @@
1
1
  import { FormattedURITokenMintSpecification } from "../../types/uritokens";
2
- declare function parseURITokenMint(tx: any): FormattedURITokenMintSpecification;
2
+ declare function parseURITokenMint(tx: any, nativeCurrency?: string): FormattedURITokenMintSpecification;
3
3
  export default parseURITokenMint;
@@ -38,18 +38,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  const assert = __importStar(require("assert"));
40
40
  const common_1 = require("../../common");
41
- const uritoken_flags_1 = __importDefault(require("../ledger/uritoken-flags"));
41
+ const tx_uritoken_mint_flags_1 = __importDefault(require("../ledger/tx-uritoken-mint-flags"));
42
42
  const emit_details_1 = require("../ledger/emit_details");
43
43
  const memos_1 = require("../ledger/memos");
44
44
  const signers_1 = require("../ledger/signers");
45
45
  const regular_key_1 = require("../ledger/regular-key");
46
46
  const source_1 = require("../ledger/source");
47
47
  const destination_1 = require("../ledger/destination");
48
- function parseURITokenMint(tx) {
48
+ function parseURITokenMint(tx, nativeCurrency) {
49
49
  assert.ok(tx.TransactionType === "URITokenMint");
50
50
  return (0, common_1.removeUndefined)({
51
51
  uri: tx.URI,
52
- flags: (0, uritoken_flags_1.default)(tx.Flags),
52
+ flags: (0, tx_uritoken_mint_flags_1.default)(tx.Flags, { nativeCurrency }),
53
53
  digest: tx.Digest,
54
54
  amount: tx.Amount,
55
55
  source: (0, source_1.parseSource)(tx),