@bithomp/xrpl-api 2.7.14 → 3.0.0

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 (212) hide show
  1. package/lib/common/errors/index.d.ts +2 -2
  2. package/lib/common/errors/index.js +3 -3
  3. package/lib/common/errors/validation_error.d.ts +2 -2
  4. package/lib/common/errors/validation_error.js +2 -2
  5. package/lib/common/errors/xrpl_api_error.d.ts +9 -0
  6. package/lib/common/errors/xrpl_api_error.js +28 -0
  7. package/lib/common/utils.d.ts +1 -0
  8. package/lib/common/utils.js +17 -1
  9. package/lib/ledger/account_info.js +7 -0
  10. package/lib/ledger/account_offers.d.ts +1 -1
  11. package/lib/ledger/ledger.d.ts +1 -1
  12. package/lib/ledger/transaction.d.ts +3 -3
  13. package/lib/ledger/transaction.js +4 -4
  14. package/lib/models/account_info.d.ts +1 -1
  15. package/lib/models/account_lines.d.ts +2 -0
  16. package/lib/models/account_nfts.js +2 -1
  17. package/lib/models/account_object.d.ts +1 -1
  18. package/lib/models/account_object.js +9 -2
  19. package/lib/models/account_offers.d.ts +9 -0
  20. package/lib/models/account_offers.js +2 -0
  21. package/lib/models/account_uritokens.d.ts +1 -1
  22. package/lib/models/path_find.d.ts +11 -0
  23. package/lib/models/path_find.js +2 -0
  24. package/lib/models/transaction.d.ts +1 -1
  25. package/lib/models/vl.js +1 -1
  26. package/lib/parse/index.d.ts +1 -0
  27. package/lib/parse/index.js +2 -1
  28. package/lib/parse/ledger/account-order.d.ts +1 -1
  29. package/lib/parse/ledger/account-order.js +1 -1
  30. package/lib/parse/ledger/account-trustline.d.ts +1 -1
  31. package/lib/parse/ledger/amount.d.ts +1 -1
  32. package/lib/parse/ledger/currency-amount.d.ts +1 -1
  33. package/lib/parse/ledger/emit_details.d.ts +1 -1
  34. package/lib/parse/ledger/import.d.ts +1 -1
  35. package/lib/parse/ledger/index.d.ts +1 -1
  36. package/lib/parse/ledger/index.js +2 -2
  37. package/lib/parse/ledger/ledger.d.ts +1 -1
  38. package/lib/parse/ledger/memos.d.ts +3 -2
  39. package/lib/parse/ledger/memos.js +12 -1
  40. package/lib/parse/ledger/nftoken-flags.d.ts +1 -1
  41. package/lib/parse/ledger/nftoken-flags.js +1 -1
  42. package/lib/parse/ledger/nftoken-offer-flags.d.ts +1 -1
  43. package/lib/parse/ledger/nftoken-offer-flags.js +1 -1
  44. package/lib/parse/ledger/orderbook-order.d.ts +7 -2
  45. package/lib/parse/ledger/orderbook-order.js +1 -1
  46. package/lib/parse/ledger/pathfind.d.ts +3 -3
  47. package/lib/parse/ledger/ripple-amount.d.ts +1 -1
  48. package/lib/parse/ledger/uritoken-flags.d.ts +1 -1
  49. package/lib/parse/ledger/uritoken-flags.js +1 -1
  50. package/lib/parse/outcome/balance_changes.js +1 -1
  51. package/lib/parse/outcome/channel_changes.js +1 -1
  52. package/lib/parse/outcome/escrow_changes.d.ts +1 -1
  53. package/lib/parse/outcome/escrow_changes.js +3 -4
  54. package/lib/parse/outcome/locked_balance_changes.js +1 -1
  55. package/lib/parse/outcome/orderbook_changes.js +1 -1
  56. package/lib/parse/outcome/unl_report_changes.js +1 -1
  57. package/lib/parse/outcome.d.ts +1 -1
  58. package/lib/parse/specification/account-delete.d.ts +1 -1
  59. package/lib/parse/specification/account-delete.js +13 -7
  60. package/lib/parse/specification/amendment.d.ts +1 -1
  61. package/lib/parse/specification/amendment.js +2 -5
  62. package/lib/parse/specification/check-cancel.d.ts +1 -1
  63. package/lib/parse/specification/check-cancel.js +2 -5
  64. package/lib/parse/specification/check-cash.d.ts +1 -1
  65. package/lib/parse/specification/check-cash.js +2 -2
  66. package/lib/parse/specification/check-create.d.ts +1 -1
  67. package/lib/parse/specification/check-create.js +13 -4
  68. package/lib/parse/specification/deposit-preauth.d.ts +1 -1
  69. package/lib/parse/specification/deposit-preauth.js +2 -5
  70. package/lib/parse/specification/escrow-cancel.d.ts +1 -1
  71. package/lib/parse/specification/escrow-cancel.js +2 -5
  72. package/lib/parse/specification/escrow-create.d.ts +1 -1
  73. package/lib/parse/specification/escrow-create.js +2 -5
  74. package/lib/parse/specification/escrow-finish.d.ts +1 -1
  75. package/lib/parse/specification/escrow-finish.js +2 -5
  76. package/lib/parse/specification/fee-update.d.ts +1 -1
  77. package/lib/parse/specification/fee-update.js +2 -2
  78. package/lib/parse/specification/import.d.ts +1 -1
  79. package/lib/parse/specification/import.js +2 -5
  80. package/lib/parse/specification/invoke.d.ts +1 -1
  81. package/lib/parse/specification/invoke.js +2 -5
  82. package/lib/parse/specification/nftoken-accept-offer.d.ts +1 -1
  83. package/lib/parse/specification/nftoken-accept-offer.js +2 -5
  84. package/lib/parse/specification/nftoken-burn.d.ts +1 -1
  85. package/lib/parse/specification/nftoken-burn.js +2 -5
  86. package/lib/parse/specification/nftoken-cancel-offer.d.ts +1 -1
  87. package/lib/parse/specification/nftoken-cancel-offer.js +2 -5
  88. package/lib/parse/specification/nftoken-create-offer.d.ts +1 -1
  89. package/lib/parse/specification/nftoken-create-offer.js +12 -3
  90. package/lib/parse/specification/nftoken-mint.d.ts +1 -1
  91. package/lib/parse/specification/nftoken-mint.js +2 -2
  92. package/lib/parse/specification/offer-cancel.d.ts +1 -1
  93. package/lib/parse/specification/offer-cancel.js +2 -5
  94. package/lib/parse/specification/offer-create.d.ts +1 -1
  95. package/lib/parse/specification/offer-create.js +2 -2
  96. package/lib/parse/specification/payment-channel-claim.d.ts +1 -1
  97. package/lib/parse/specification/payment-channel-claim.js +2 -2
  98. package/lib/parse/specification/payment-channel-create.d.ts +1 -1
  99. package/lib/parse/specification/payment-channel-create.js +13 -5
  100. package/lib/parse/specification/payment-channel-fund.d.ts +1 -1
  101. package/lib/parse/specification/payment-channel-fund.js +2 -2
  102. package/lib/parse/specification/payment.d.ts +1 -1
  103. package/lib/parse/specification/payment.js +3 -7
  104. package/lib/parse/specification/remit.d.ts +1 -1
  105. package/lib/parse/specification/remit.js +2 -2
  106. package/lib/parse/specification/settings.js +2 -2
  107. package/lib/parse/specification/ticket-create.d.ts +1 -1
  108. package/lib/parse/specification/ticket-create.js +2 -5
  109. package/lib/parse/specification/trustline.d.ts +1 -1
  110. package/lib/parse/specification/trustline.js +2 -5
  111. package/lib/parse/specification/unl-report.d.ts +1 -1
  112. package/lib/parse/specification/unl-report.js +2 -5
  113. package/lib/parse/specification/uritoken-burn.d.ts +1 -1
  114. package/lib/parse/specification/uritoken-burn.js +2 -5
  115. package/lib/parse/specification/uritoken-buy.d.ts +1 -1
  116. package/lib/parse/specification/uritoken-buy.js +2 -5
  117. package/lib/parse/specification/uritoken-cancel-sell-offer.d.ts +1 -1
  118. package/lib/parse/specification/uritoken-cancel-sell-offer.js +2 -5
  119. package/lib/parse/specification/uritoken-create-sell-offer.d.ts +2 -2
  120. package/lib/parse/specification/uritoken-create-sell-offer.js +12 -6
  121. package/lib/parse/specification/uritoken-mint.d.ts +3 -3
  122. package/lib/parse/specification/uritoken-mint.js +14 -5
  123. package/lib/parse/transaction.d.ts +19 -19
  124. package/lib/parse/utils.d.ts +10 -1
  125. package/lib/parse/utils.js +49 -1
  126. package/lib/types/account.d.ts +15 -0
  127. package/lib/types/account.js +2 -0
  128. package/lib/types/adjustments.d.ts +16 -0
  129. package/lib/types/adjustments.js +2 -0
  130. package/lib/types/amendments.d.ts +4 -0
  131. package/lib/types/amendments.js +2 -0
  132. package/lib/types/checks.d.ts +18 -0
  133. package/lib/types/checks.js +2 -0
  134. package/lib/types/deposits.d.ts +5 -0
  135. package/lib/types/deposits.js +2 -0
  136. package/lib/types/emit_details.d.ts +7 -0
  137. package/lib/types/emit_details.js +2 -0
  138. package/lib/types/escrows.d.ts +23 -0
  139. package/lib/types/escrows.js +2 -0
  140. package/lib/types/fees.d.ts +7 -0
  141. package/lib/types/fees.js +2 -0
  142. package/lib/types/flags.d.ts +5 -0
  143. package/lib/types/flags.js +8 -0
  144. package/lib/types/hooks.d.ts +14 -0
  145. package/lib/types/hooks.js +2 -0
  146. package/lib/types/import.d.ts +23 -0
  147. package/lib/types/import.js +2 -0
  148. package/lib/types/index.d.ts +24 -1
  149. package/lib/types/index.js +38 -0
  150. package/lib/types/invoke.d.ts +6 -0
  151. package/lib/types/invoke.js +2 -0
  152. package/lib/types/ledger.d.ts +45 -0
  153. package/lib/types/ledger.js +2 -0
  154. package/lib/types/ledger_data.d.ts +10 -0
  155. package/lib/types/ledger_data.js +2 -0
  156. package/lib/types/ledger_entries.d.ts +158 -0
  157. package/lib/types/ledger_entries.js +2 -0
  158. package/lib/types/memos.d.ts +12 -0
  159. package/lib/types/memos.js +2 -0
  160. package/lib/types/nftokens.d.ts +50 -0
  161. package/lib/types/nftokens.js +13 -0
  162. package/lib/types/offers.d.ts +15 -0
  163. package/lib/types/offers.js +2 -0
  164. package/lib/types/outcome.d.ts +33 -0
  165. package/lib/types/outcome.js +2 -0
  166. package/lib/types/path_find.d.ts +28 -0
  167. package/lib/types/path_find.js +2 -0
  168. package/lib/types/payment_channels.d.ts +25 -0
  169. package/lib/types/payment_channels.js +2 -0
  170. package/lib/types/payments.d.ts +11 -0
  171. package/lib/types/payments.js +2 -0
  172. package/lib/types/queue_data.d.ts +15 -0
  173. package/lib/types/queue_data.js +2 -0
  174. package/lib/types/remits.d.ts +18 -0
  175. package/lib/types/remits.js +2 -0
  176. package/lib/types/settings.d.ts +34 -0
  177. package/lib/types/settings.js +2 -0
  178. package/lib/types/signers.d.ts +6 -0
  179. package/lib/types/signers.js +2 -0
  180. package/lib/types/specification.d.ts +4 -0
  181. package/lib/types/specification.js +2 -0
  182. package/lib/types/tickets.d.ts +4 -0
  183. package/lib/types/tickets.js +2 -0
  184. package/lib/types/transactions.d.ts +21 -0
  185. package/lib/types/transactions.js +2 -0
  186. package/lib/types/trustlines.d.ts +38 -0
  187. package/lib/types/trustlines.js +2 -0
  188. package/lib/types/unl_reports.d.ts +7 -0
  189. package/lib/types/unl_reports.js +2 -0
  190. package/lib/types/uri_tokens.d.ts +7 -0
  191. package/lib/types/uri_tokens.js +6 -0
  192. package/lib/types/uritokens.d.ts +39 -0
  193. package/lib/types/uritokens.js +6 -0
  194. package/lib/v1/common/types/objects/account.d.ts +2 -2
  195. package/lib/v1/common/types/objects/checks.d.ts +3 -2
  196. package/lib/v1/common/types/objects/nftokens.d.ts +3 -1
  197. package/lib/v1/common/types/objects/payment_channels.d.ts +3 -3
  198. package/lib/v1/common/types/objects/uritokens.d.ts +5 -2
  199. package/lib/v1/common/types/objects/uritokens.js +1 -1
  200. package/lib/v1/transaction/payment.d.ts +2 -2
  201. package/lib/v1/transaction/payment.js +9 -9
  202. package/lib/v1/transaction/types.d.ts +1 -34
  203. package/lib/v1/transaction/utils.d.ts +2 -3
  204. package/lib/v1/transaction/utils.js +19 -15
  205. package/lib/v1/types.d.ts +9 -0
  206. package/lib/v1/types.js +2 -0
  207. package/lib/v1/utils.d.ts +7 -0
  208. package/lib/v1/utils.js +42 -0
  209. package/lib/validator.js +5 -4
  210. package/lib/wallet.d.ts +3 -0
  211. package/lib/wallet.js +26 -1
  212. package/package.json +20 -20
@@ -9,7 +9,7 @@ const bignumber_js_1 = require("bignumber.js");
9
9
  const BigNumber = bignumber_js_1.BigNumber.clone({ DECIMAL_PLACES: 40 });
10
10
  const common_1 = require("../../common");
11
11
  const models_1 = require("../../models");
12
- const utils_1 = require("../../v1/common/utils");
12
+ const utils_1 = require("../utils");
13
13
  const orderbook_quality_1 = require("./orderbook_quality");
14
14
  const currency_amount_1 = __importDefault(require("../ledger/currency-amount"));
15
15
  const client_1 = require("../../client");
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parseUNLReportChanges = void 0;
4
4
  const common_1 = require("../../common");
5
- const utils_1 = require("../../v1/common/utils");
5
+ const utils_1 = require("../utils");
6
6
  function summarizeUNLReport(tx, node) {
7
7
  const final = node.diffType === "CreatedNode" ? node.newFields : node.finalFields;
8
8
  if (tx.ImportVLKey && final.ImportVLKeys) {
@@ -1,4 +1,4 @@
1
1
  import { XrplDefinitionsBase } from "ripple-binary-codec";
2
- import { Outcome } from "../v1/transaction/types";
2
+ import { Outcome } from "../types/outcome";
3
3
  declare function parseOutcome(tx: any, nativeCurrency?: string, definitions?: XrplDefinitionsBase): Outcome | undefined;
4
4
  export { parseOutcome };
@@ -1,3 +1,3 @@
1
- import { FormattedAccountDeleteSpecification } from "../../v1/common/types/objects/account";
1
+ import { FormattedAccountDeleteSpecification } from "../../types/account";
2
2
  declare function parseAccountDelete(tx: any): FormattedAccountDeleteSpecification;
3
3
  export default parseAccountDelete;
@@ -22,19 +22,25 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
25
  Object.defineProperty(exports, "__esModule", { value: true });
29
26
  const assert = __importStar(require("assert"));
30
27
  const common_1 = require("../../common");
31
- const memos_1 = __importDefault(require("../ledger/memos"));
28
+ const memos_1 = require("../ledger/memos");
29
+ const account_1 = require("../ledger/account");
32
30
  function parseAccountDelete(tx) {
33
31
  assert.ok(tx.TransactionType === "AccountDelete");
32
+ const source = (0, common_1.removeUndefined)({
33
+ address: (0, account_1.parseAccount)(tx.Account),
34
+ tag: tx.SourceTag,
35
+ });
36
+ const destination = (0, common_1.removeUndefined)({
37
+ address: tx.Destination,
38
+ tag: tx.DestinationTag,
39
+ });
34
40
  return (0, common_1.removeUndefined)({
35
- memos: (0, memos_1.default)(tx),
36
- destination: tx.Destination,
37
- destinationTag: tx.DestinationTag,
41
+ source: Object.keys(source).length > 0 ? source : undefined,
42
+ destination: Object.keys(destination).length > 0 ? destination : undefined,
43
+ memos: (0, memos_1.parseMemos)(tx),
38
44
  });
39
45
  }
40
46
  exports.default = parseAccountDelete;
@@ -1,3 +1,3 @@
1
- import { FormattedAmendmentSpecification } from "../../v1/common/types/objects/amendments";
1
+ import { FormattedAmendmentSpecification } from "../../types/amendments";
2
2
  declare function parseAmendment(tx: any): FormattedAmendmentSpecification;
3
3
  export default parseAmendment;
@@ -1,14 +1,11 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  const common_1 = require("../../common");
7
- const memos_1 = __importDefault(require("../ledger/memos"));
4
+ const memos_1 = require("../ledger/memos");
8
5
  function parseAmendment(tx) {
9
6
  return (0, common_1.removeUndefined)({
10
7
  amendment: tx.Amendment,
11
- memos: (0, memos_1.default)(tx),
8
+ memos: (0, memos_1.parseMemos)(tx),
12
9
  });
13
10
  }
14
11
  exports.default = parseAmendment;
@@ -1,3 +1,3 @@
1
- import { FormattedCheckCancelSpecification } from "../../v1/common/types/objects/checks";
1
+ import { FormattedCheckCancelSpecification } from "../../types/checks";
2
2
  declare function parseCheckCancel(tx: any): FormattedCheckCancelSpecification;
3
3
  export default parseCheckCancel;
@@ -22,17 +22,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
25
  Object.defineProperty(exports, "__esModule", { value: true });
29
26
  const assert = __importStar(require("assert"));
30
27
  const common_1 = require("../../common");
31
- const memos_1 = __importDefault(require("../ledger/memos"));
28
+ const memos_1 = require("../ledger/memos");
32
29
  function parseCheckCancel(tx) {
33
30
  assert.ok(tx.TransactionType === "CheckCancel");
34
31
  return (0, common_1.removeUndefined)({
35
- memos: (0, memos_1.default)(tx),
32
+ memos: (0, memos_1.parseMemos)(tx),
36
33
  checkID: tx.CheckID,
37
34
  });
38
35
  }
@@ -1,3 +1,3 @@
1
- import { FormattedCheckCashSpecification } from "../../v1/common/types/objects/checks";
1
+ import { FormattedCheckCashSpecification } from "../../types/checks";
2
2
  declare function parseCheckCash(tx: any): FormattedCheckCashSpecification;
3
3
  export default parseCheckCash;
@@ -29,11 +29,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  const assert = __importStar(require("assert"));
30
30
  const common_1 = require("../../common");
31
31
  const amount_1 = __importDefault(require("../ledger/amount"));
32
- const memos_1 = __importDefault(require("../ledger/memos"));
32
+ const memos_1 = require("../ledger/memos");
33
33
  function parseCheckCash(tx) {
34
34
  assert.ok(tx.TransactionType === "CheckCash");
35
35
  return (0, common_1.removeUndefined)({
36
- memos: (0, memos_1.default)(tx),
36
+ memos: (0, memos_1.parseMemos)(tx),
37
37
  checkID: tx.CheckID,
38
38
  amount: tx.Amount && (0, amount_1.default)(tx.Amount),
39
39
  deliverMin: tx.DeliverMin && (0, amount_1.default)(tx.DeliverMin),
@@ -1,3 +1,3 @@
1
- import { FormattedCheckCreateSpecification } from "../../v1/common/types/objects/checks";
1
+ import { FormattedCheckCreateSpecification } from "../../types/checks";
2
2
  declare function parseCheckCreate(tx: any): FormattedCheckCreateSpecification;
3
3
  export default parseCheckCreate;
@@ -30,14 +30,23 @@ const assert = __importStar(require("assert"));
30
30
  const common_1 = require("../../common");
31
31
  const utils_1 = require("../utils");
32
32
  const amount_1 = __importDefault(require("../ledger/amount"));
33
- const memos_1 = __importDefault(require("../ledger/memos"));
33
+ const memos_1 = require("../ledger/memos");
34
+ const account_1 = require("../ledger/account");
34
35
  function parseCheckCreate(tx) {
35
36
  assert.ok(tx.TransactionType === "CheckCreate");
37
+ const source = (0, common_1.removeUndefined)({
38
+ address: (0, account_1.parseAccount)(tx.Account),
39
+ tag: tx.SourceTag,
40
+ });
41
+ const destination = (0, common_1.removeUndefined)({
42
+ address: tx.Destination,
43
+ tag: tx.DestinationTag,
44
+ });
36
45
  return (0, common_1.removeUndefined)({
37
- memos: (0, memos_1.default)(tx),
38
- destination: tx.Destination,
46
+ source: Object.keys(source).length > 0 ? source : undefined,
47
+ destination: Object.keys(destination).length > 0 ? destination : undefined,
48
+ memos: (0, memos_1.parseMemos)(tx),
39
49
  sendMax: (0, amount_1.default)(tx.SendMax),
40
- destinationTag: tx.DestinationTag,
41
50
  expiration: tx.Expiration && (0, utils_1.parseTimestamp)(tx.Expiration),
42
51
  invoiceID: tx.InvoiceID,
43
52
  });
@@ -1,3 +1,3 @@
1
- import { FormattedDepositPreauthSpecification } from "../../v1/common/types/objects/deposits";
1
+ import { FormattedDepositPreauthSpecification } from "../../types/deposits";
2
2
  declare function parseDepositPreauth(tx: any): FormattedDepositPreauthSpecification;
3
3
  export default parseDepositPreauth;
@@ -22,17 +22,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
25
  Object.defineProperty(exports, "__esModule", { value: true });
29
26
  const assert = __importStar(require("assert"));
30
27
  const common_1 = require("../../common");
31
- const memos_1 = __importDefault(require("../ledger/memos"));
28
+ const memos_1 = require("../ledger/memos");
32
29
  function parseDepositPreauth(tx) {
33
30
  assert.ok(tx.TransactionType === "DepositPreauth");
34
31
  return (0, common_1.removeUndefined)({
35
- memos: (0, memos_1.default)(tx),
32
+ memos: (0, memos_1.parseMemos)(tx),
36
33
  authorize: tx.Authorize,
37
34
  unauthorize: tx.Unauthorize,
38
35
  });
@@ -1,3 +1,3 @@
1
- import { FormattedEscrowCancelSpecification } from "../../v1/common/types/objects/escrows";
1
+ import { FormattedEscrowCancelSpecification } from "../../types/escrows";
2
2
  declare function parseEscrowCancel(tx: any): FormattedEscrowCancelSpecification;
3
3
  export default parseEscrowCancel;
@@ -22,13 +22,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
25
  Object.defineProperty(exports, "__esModule", { value: true });
29
26
  const assert = __importStar(require("assert"));
30
27
  const common_1 = require("../../common");
31
- const memos_1 = __importDefault(require("../ledger/memos"));
28
+ const memos_1 = require("../ledger/memos");
32
29
  function parseEscrowCancel(tx) {
33
30
  assert.ok(tx.TransactionType === "EscrowCancel");
34
31
  const source = {
@@ -39,7 +36,7 @@ function parseEscrowCancel(tx) {
39
36
  source: (0, common_1.removeUndefined)(source),
40
37
  owner: tx.Owner,
41
38
  escrowSequence: tx.OfferSequence,
42
- memos: (0, memos_1.default)(tx),
39
+ memos: (0, memos_1.parseMemos)(tx),
43
40
  });
44
41
  }
45
42
  exports.default = parseEscrowCancel;
@@ -1,3 +1,3 @@
1
- import { FormattedEscrowCreateSpecification } from "../../v1/common/types/objects/escrows";
1
+ import { FormattedEscrowCreateSpecification } from "../../types/escrows";
2
2
  declare function parseEscrowCreation(tx: any): FormattedEscrowCreateSpecification;
3
3
  export default parseEscrowCreation;
@@ -22,14 +22,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
25
  Object.defineProperty(exports, "__esModule", { value: true });
29
26
  const assert = __importStar(require("assert"));
30
27
  const common_1 = require("../../common");
31
28
  const utils_1 = require("../utils");
32
- const memos_1 = __importDefault(require("../ledger/memos"));
29
+ const memos_1 = require("../ledger/memos");
33
30
  function parseEscrowCreation(tx) {
34
31
  assert.ok(tx.TransactionType === "EscrowCreate");
35
32
  const source = {
@@ -47,7 +44,7 @@ function parseEscrowCreation(tx) {
47
44
  condition: tx.Condition,
48
45
  allowCancelAfter: (0, utils_1.parseTimestamp)(tx.CancelAfter),
49
46
  allowExecuteAfter: (0, utils_1.parseTimestamp)(tx.FinishAfter),
50
- memos: (0, memos_1.default)(tx),
47
+ memos: (0, memos_1.parseMemos)(tx),
51
48
  });
52
49
  }
53
50
  exports.default = parseEscrowCreation;
@@ -1,3 +1,3 @@
1
- import { FormattedEscrowFinishSpecification } from "../../v1/common/types/objects/escrows";
1
+ import { FormattedEscrowFinishSpecification } from "../../types/escrows";
2
2
  declare function parseEscrowFinish(tx: any): FormattedEscrowFinishSpecification;
3
3
  export default parseEscrowFinish;
@@ -22,13 +22,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
25
  Object.defineProperty(exports, "__esModule", { value: true });
29
26
  const assert = __importStar(require("assert"));
30
27
  const common_1 = require("../../common");
31
- const memos_1 = __importDefault(require("../ledger/memos"));
28
+ const memos_1 = require("../ledger/memos");
32
29
  function parseEscrowFinish(tx) {
33
30
  assert.ok(tx.TransactionType === "EscrowFinish");
34
31
  const source = {
@@ -41,7 +38,7 @@ function parseEscrowFinish(tx) {
41
38
  escrowSequence: tx.OfferSequence,
42
39
  condition: tx.Condition,
43
40
  fulfillment: tx.Fulfillment,
44
- memos: (0, memos_1.default)(tx),
41
+ memos: (0, memos_1.parseMemos)(tx),
45
42
  });
46
43
  }
47
44
  exports.default = parseEscrowFinish;
@@ -1,3 +1,3 @@
1
- import { FormattedFeeUpdateSpecification } from "../../v1/common/types/objects/fees";
1
+ import { FormattedFeeUpdateSpecification } from "../../types/fees";
2
2
  declare function parseFeeUpdate(tx: any): FormattedFeeUpdateSpecification;
3
3
  export default parseFeeUpdate;
@@ -5,11 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
7
7
  const common_1 = require("../../common");
8
- const memos_1 = __importDefault(require("../ledger/memos"));
8
+ const memos_1 = require("../ledger/memos");
9
9
  function parseFeeUpdate(tx) {
10
10
  const baseFeeDrops = new bignumber_js_1.default(tx.BaseFee, 16).toString();
11
11
  return {
12
- memos: (0, memos_1.default)(tx),
12
+ memos: (0, memos_1.parseMemos)(tx),
13
13
  baseFeeXRP: (0, common_1.dropsToXrp)(baseFeeDrops),
14
14
  referenceFeeUnits: tx.ReferenceFeeUnits,
15
15
  reserveBaseXRP: (0, common_1.dropsToXrp)(tx.ReserveBase),
@@ -1,3 +1,3 @@
1
- import { FormattedImportSpecification } from "../../v1/common/types/objects/import";
1
+ import { FormattedImportSpecification } from "../../types/import";
2
2
  declare function parseImport(tx: any): FormattedImportSpecification;
3
3
  export default parseImport;
@@ -22,13 +22,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
25
  Object.defineProperty(exports, "__esModule", { value: true });
29
26
  const assert = __importStar(require("assert"));
30
27
  const common_1 = require("../../common");
31
- const memos_1 = __importDefault(require("../ledger/memos"));
28
+ const memos_1 = require("../ledger/memos");
32
29
  const import_1 = require("../ledger/import");
33
30
  function parseImport(tx) {
34
31
  assert.ok(tx.TransactionType === "Import");
@@ -39,7 +36,7 @@ function parseImport(tx) {
39
36
  return (0, common_1.removeUndefined)({
40
37
  blob: (0, import_1.parseImportBlob)(tx.Blob),
41
38
  source: (0, common_1.removeUndefined)(source),
42
- memos: (0, memos_1.default)(tx),
39
+ memos: (0, memos_1.parseMemos)(tx),
43
40
  });
44
41
  }
45
42
  exports.default = parseImport;
@@ -1,3 +1,3 @@
1
- import { FormattedInvokeSpecification } from "../../v1/common/types/objects/invoke";
1
+ import { FormattedInvokeSpecification } from "../../types/invoke";
2
2
  declare function parseInvoke(tx: any): FormattedInvokeSpecification;
3
3
  export default parseInvoke;
@@ -22,13 +22,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
25
  Object.defineProperty(exports, "__esModule", { value: true });
29
26
  const assert = __importStar(require("assert"));
30
27
  const common_1 = require("../../common");
31
- const memos_1 = __importDefault(require("../ledger/memos"));
28
+ const memos_1 = require("../ledger/memos");
32
29
  function parseInvoke(tx) {
33
30
  assert.ok(tx.TransactionType === "Invoke");
34
31
  const source = {
@@ -41,7 +38,7 @@ function parseInvoke(tx) {
41
38
  return {
42
39
  source: (0, common_1.removeUndefined)(source),
43
40
  destination: (0, common_1.removeUndefined)(destination),
44
- memos: (0, memos_1.default)(tx),
41
+ memos: (0, memos_1.parseMemos)(tx),
45
42
  };
46
43
  }
47
44
  exports.default = parseInvoke;
@@ -1,3 +1,3 @@
1
- import { FormattedNFTokenAcceptOfferSpecification } from "../../v1/common/types/objects/nftokens";
1
+ import { FormattedNFTokenAcceptOfferSpecification } from "../../types/nftokens";
2
2
  declare function parseNFTokenAcceptOffer(tx: any): FormattedNFTokenAcceptOfferSpecification;
3
3
  export default parseNFTokenAcceptOffer;
@@ -22,20 +22,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
25
  Object.defineProperty(exports, "__esModule", { value: true });
29
26
  const assert = __importStar(require("assert"));
30
27
  const common_1 = require("../../common");
31
- const memos_1 = __importDefault(require("../ledger/memos"));
28
+ const memos_1 = require("../ledger/memos");
32
29
  function parseNFTokenAcceptOffer(tx) {
33
30
  assert.ok(tx.TransactionType === "NFTokenAcceptOffer");
34
31
  return (0, common_1.removeUndefined)({
35
32
  nftokenSellOffer: tx.NFTokenSellOffer,
36
33
  nftokenBuyOffer: tx.NFTokenBuyOffer,
37
34
  nftokenBrokerFee: tx.NFTokenBrokerFee,
38
- memos: (0, memos_1.default)(tx),
35
+ memos: (0, memos_1.parseMemos)(tx),
39
36
  });
40
37
  }
41
38
  exports.default = parseNFTokenAcceptOffer;
@@ -1,3 +1,3 @@
1
- import { FormattedNFTokenBurnSpecification } from "../../v1/common/types/objects/nftokens";
1
+ import { FormattedNFTokenBurnSpecification } from "../../types/nftokens";
2
2
  declare function parseNFTokenBurn(tx: any): FormattedNFTokenBurnSpecification;
3
3
  export default parseNFTokenBurn;
@@ -22,19 +22,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
25
  Object.defineProperty(exports, "__esModule", { value: true });
29
26
  const assert = __importStar(require("assert"));
30
27
  const common_1 = require("../../common");
31
- const memos_1 = __importDefault(require("../ledger/memos"));
28
+ const memos_1 = require("../ledger/memos");
32
29
  function parseNFTokenBurn(tx) {
33
30
  assert.ok(tx.TransactionType === "NFTokenBurn");
34
31
  return (0, common_1.removeUndefined)({
35
32
  account: tx.Account,
36
33
  nftokenID: tx.NFTokenID,
37
- memos: (0, memos_1.default)(tx),
34
+ memos: (0, memos_1.parseMemos)(tx),
38
35
  });
39
36
  }
40
37
  exports.default = parseNFTokenBurn;
@@ -1,3 +1,3 @@
1
- import { FormattedNFTokenCancelOfferSpecification } from "../../v1/common/types/objects/nftokens";
1
+ import { FormattedNFTokenCancelOfferSpecification } from "../../types/nftokens";
2
2
  declare function parseNFTokenCancelOffer(tx: any): FormattedNFTokenCancelOfferSpecification;
3
3
  export default parseNFTokenCancelOffer;
@@ -22,18 +22,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
25
  Object.defineProperty(exports, "__esModule", { value: true });
29
26
  const assert = __importStar(require("assert"));
30
27
  const common_1 = require("../../common");
31
- const memos_1 = __importDefault(require("../ledger/memos"));
28
+ const memos_1 = require("../ledger/memos");
32
29
  function parseNFTokenCancelOffer(tx) {
33
30
  assert.ok(tx.TransactionType === "NFTokenCancelOffer");
34
31
  return (0, common_1.removeUndefined)({
35
32
  nftokenOffers: tx.NFTokenOffers,
36
- memos: (0, memos_1.default)(tx),
33
+ memos: (0, memos_1.parseMemos)(tx),
37
34
  });
38
35
  }
39
36
  exports.default = parseNFTokenCancelOffer;
@@ -1,3 +1,3 @@
1
- import { FormattedNFTokenCreateOfferSpecification } from "../../v1/common/types/objects/nftokens";
1
+ import { FormattedNFTokenCreateOfferSpecification } from "../../types/nftokens";
2
2
  declare function parseNFTokenCreateOffer(tx: any): FormattedNFTokenCreateOfferSpecification;
3
3
  export default parseNFTokenCreateOffer;
@@ -28,23 +28,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  const assert = __importStar(require("assert"));
30
30
  const common_1 = require("../../common");
31
- const memos_1 = __importDefault(require("../ledger/memos"));
31
+ const memos_1 = require("../ledger/memos");
32
32
  const nftoken_offer_flags_1 = __importDefault(require("../ledger/nftoken-offer-flags"));
33
33
  const ledger_1 = require("../../models/ledger");
34
+ const account_1 = require("../ledger/account");
34
35
  function parseNFTokenCreateOffer(tx) {
35
36
  assert.ok(tx.TransactionType === "NFTokenCreateOffer");
36
37
  let expiration;
37
38
  if (typeof tx.Expiration === "number") {
38
39
  expiration = (0, ledger_1.ledgerTimeToUnixTime)(tx.Expiration);
39
40
  }
41
+ const source = (0, common_1.removeUndefined)({
42
+ address: (0, account_1.parseAccount)(tx.Account),
43
+ tag: tx.SourceTag,
44
+ });
45
+ const destination = (0, common_1.removeUndefined)({
46
+ address: tx.Destination,
47
+ });
40
48
  return (0, common_1.removeUndefined)({
41
49
  nftokenID: tx.NFTokenID,
42
50
  amount: tx.Amount,
43
51
  owner: tx.Owner,
44
- destination: tx.Destination,
52
+ source: Object.keys(source).length > 0 ? source : undefined,
53
+ destination: Object.keys(destination).length > 0 ? destination : undefined,
45
54
  expiration,
46
55
  flags: (0, nftoken_offer_flags_1.default)(tx.Flags),
47
- memos: (0, memos_1.default)(tx),
56
+ memos: (0, memos_1.parseMemos)(tx),
48
57
  });
49
58
  }
50
59
  exports.default = parseNFTokenCreateOffer;
@@ -1,3 +1,3 @@
1
- import { FormattedNFTokenMintSpecification } from "../../v1/common/types/objects/nftokens";
1
+ import { FormattedNFTokenMintSpecification } from "../../types/nftokens";
2
2
  declare function parseNFTokenMint(tx: any): FormattedNFTokenMintSpecification;
3
3
  export default parseNFTokenMint;
@@ -28,7 +28,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  const assert = __importStar(require("assert"));
30
30
  const common_1 = require("../../common");
31
- const memos_1 = __importDefault(require("../ledger/memos"));
31
+ const memos_1 = require("../ledger/memos");
32
32
  const nftoken_flags_1 = __importDefault(require("../ledger/nftoken-flags"));
33
33
  function parseNFTokenMint(tx) {
34
34
  assert.ok(tx.TransactionType === "NFTokenMint");
@@ -38,7 +38,7 @@ function parseNFTokenMint(tx) {
38
38
  transferFee: tx.TransferFee,
39
39
  uri: tx.URI,
40
40
  flags: (0, nftoken_flags_1.default)(tx.Flags),
41
- memos: (0, memos_1.default)(tx),
41
+ memos: (0, memos_1.parseMemos)(tx),
42
42
  });
43
43
  }
44
44
  exports.default = parseNFTokenMint;
@@ -1,3 +1,3 @@
1
- import { FormattedOfferCancelSpecification } from "../../v1/common/types/objects/offers";
1
+ import { FormattedOfferCancelSpecification } from "../../types/offers";
2
2
  declare function parseOfferCancel(tx: any): FormattedOfferCancelSpecification;
3
3
  export default parseOfferCancel;
@@ -22,16 +22,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
25
  Object.defineProperty(exports, "__esModule", { value: true });
29
26
  const assert = __importStar(require("assert"));
30
- const memos_1 = __importDefault(require("../ledger/memos"));
27
+ const memos_1 = require("../ledger/memos");
31
28
  function parseOfferCancel(tx) {
32
29
  assert.ok(tx.TransactionType === "OfferCancel");
33
30
  return {
34
- memos: (0, memos_1.default)(tx),
31
+ memos: (0, memos_1.parseMemos)(tx),
35
32
  orderSequence: tx.OfferSequence,
36
33
  };
37
34
  }
@@ -1,3 +1,3 @@
1
- import { FormattedOfferCreateSpecification, OfferCreateTransaction } from "../../v1/common/types/objects/index";
1
+ import { FormattedOfferCreateSpecification, OfferCreateTransaction } from "../../types";
2
2
  declare function parseOfferCreate(tx: OfferCreateTransaction): FormattedOfferCreateSpecification;
3
3
  export default parseOfferCreate;
@@ -30,7 +30,7 @@ const assert = __importStar(require("assert"));
30
30
  const xrpl_1 = require("xrpl");
31
31
  const utils_1 = require("../utils");
32
32
  const amount_1 = __importDefault(require("../ledger/amount"));
33
- const memos_1 = __importDefault(require("../ledger/memos"));
33
+ const memos_1 = require("../ledger/memos");
34
34
  const common_1 = require("../../common");
35
35
  function parseOfferCreate(tx) {
36
36
  assert.ok(tx.TransactionType === "OfferCreate");
@@ -40,7 +40,7 @@ function parseOfferCreate(tx) {
40
40
  const quantity = direction === "buy" ? takerPaysAmount : takerGetsAmount;
41
41
  const totalPrice = direction === "buy" ? takerGetsAmount : takerPaysAmount;
42
42
  return (0, common_1.removeUndefined)({
43
- memos: (0, memos_1.default)(tx),
43
+ memos: (0, memos_1.parseMemos)(tx),
44
44
  direction: direction,
45
45
  quantity: quantity,
46
46
  totalPrice: totalPrice,
@@ -1,3 +1,3 @@
1
- import { FormattedPaymentChannelClaimSpecification } from "../../v1/common/types/objects/payment_channels";
1
+ import { FormattedPaymentChannelClaimSpecification } from "../../types/payment_channels";
2
2
  declare function parsePaymentChannelClaim(tx: any): FormattedPaymentChannelClaimSpecification;
3
3
  export default parsePaymentChannelClaim;
@@ -30,11 +30,11 @@ const assert = __importStar(require("assert"));
30
30
  const xrpl_1 = require("xrpl");
31
31
  const common_1 = require("../../common");
32
32
  const ripple_amount_1 = __importDefault(require("../ledger/ripple-amount"));
33
- const memos_1 = __importDefault(require("../ledger/memos"));
33
+ const memos_1 = require("../ledger/memos");
34
34
  function parsePaymentChannelClaim(tx) {
35
35
  assert.ok(tx.TransactionType === "PaymentChannelClaim");
36
36
  return (0, common_1.removeUndefined)({
37
- memos: (0, memos_1.default)(tx),
37
+ memos: (0, memos_1.parseMemos)(tx),
38
38
  channel: tx.Channel,
39
39
  balance: (0, ripple_amount_1.default)(tx.Balance),
40
40
  amount: (0, ripple_amount_1.default)(tx.Amount),
@@ -1,3 +1,3 @@
1
- import { FormattedPaymentChannelCreateSpecification } from "../../v1/common/types/objects/payment_channels";
1
+ import { FormattedPaymentChannelCreateSpecification } from "../../types/payment_channels";
2
2
  declare function parsePaymentChannelCreate(tx: any): FormattedPaymentChannelCreateSpecification;
3
3
  export default parsePaymentChannelCreate;