@bithomp/xrpl-api 3.1.17 → 3.2.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 (129) hide show
  1. package/lib/client.js +1 -0
  2. package/lib/common/index.js +17 -7
  3. package/lib/index.js +17 -7
  4. package/lib/ledger/account_info.js +17 -7
  5. package/lib/ledger/account_lines.js +17 -7
  6. package/lib/ledger/account_namespace.js +17 -7
  7. package/lib/ledger/account_nfts.js +17 -7
  8. package/lib/ledger/account_objects.js +17 -7
  9. package/lib/ledger/account_offers.js +17 -7
  10. package/lib/ledger/account_tx.js +17 -7
  11. package/lib/ledger/amm_info.js +17 -7
  12. package/lib/ledger/book_offers.js +17 -7
  13. package/lib/ledger/currency.js +17 -7
  14. package/lib/ledger/fee.js +17 -7
  15. package/lib/ledger/gateway_balances.js +17 -7
  16. package/lib/ledger/ledger.js +17 -7
  17. package/lib/ledger/ledger_entry.js +17 -7
  18. package/lib/ledger/manifest.js +17 -7
  19. package/lib/ledger/nft_info.js +17 -7
  20. package/lib/ledger/server_definitions.js +17 -7
  21. package/lib/ledger/server_info.js +17 -7
  22. package/lib/ledger/transaction.js +17 -7
  23. package/lib/ledger/vl-v2.js +17 -7
  24. package/lib/ledger/vl.js +17 -7
  25. package/lib/models/index.d.ts +3 -0
  26. package/lib/models/index.js +6 -1
  27. package/lib/models/manifest.js +17 -7
  28. package/lib/models/mptoken.d.ts +7 -0
  29. package/lib/models/mptoken.js +26 -0
  30. package/lib/models/vl.js +17 -7
  31. package/lib/parse/index.js +17 -7
  32. package/lib/parse/ledger/account-order.js +3 -3
  33. package/lib/parse/ledger/amount.d.ts +2 -2
  34. package/lib/parse/ledger/amount.js +8 -5
  35. package/lib/parse/ledger/mptoken-authorize-flags.d.ts +5 -0
  36. package/lib/parse/ledger/mptoken-authorize-flags.js +8 -0
  37. package/lib/parse/ledger/mptoken-issuance-create-flags.d.ts +5 -0
  38. package/lib/parse/ledger/mptoken-issuance-create-flags.js +8 -0
  39. package/lib/parse/ledger/mptoken-issuance-set-flags.d.ts +5 -0
  40. package/lib/parse/ledger/mptoken-issuance-set-flags.js +8 -0
  41. package/lib/parse/ledger/orderbook-order.js +3 -3
  42. package/lib/parse/outcome/amm_changes.d.ts +2 -1
  43. package/lib/parse/outcome/balance_changes.d.ts +15 -2
  44. package/lib/parse/outcome/balance_changes.js +33 -2
  45. package/lib/parse/outcome/delivered_amount.d.ts +2 -2
  46. package/lib/parse/outcome/did_changes.d.ts +2 -1
  47. package/lib/parse/outcome/escrow_changes.d.ts +1 -1
  48. package/lib/parse/outcome/index.d.ts +2 -0
  49. package/lib/parse/outcome/index.js +5 -1
  50. package/lib/parse/outcome/locked_balance_changes.d.ts +14 -2
  51. package/lib/parse/outcome/locked_balance_changes.js +2 -21
  52. package/lib/parse/outcome/mptoken_changes.d.ts +1 -0
  53. package/lib/parse/outcome/mptoken_changes.js +84 -0
  54. package/lib/parse/outcome/mptoken_issuance_changes.d.ts +1 -0
  55. package/lib/parse/outcome/mptoken_issuance_changes.js +94 -0
  56. package/lib/parse/outcome/oracle_changes.d.ts +2 -1
  57. package/lib/parse/outcome/orderbook_changes.d.ts +14 -2
  58. package/lib/parse/outcome/orderbook_changes.js +2 -2
  59. package/lib/parse/outcome/orderbook_quality.js +17 -7
  60. package/lib/parse/outcome.js +4 -20
  61. package/lib/parse/specification/account-delete.js +17 -7
  62. package/lib/parse/specification/amendment.js +17 -7
  63. package/lib/parse/specification/amm-bid.js +17 -7
  64. package/lib/parse/specification/amm-create.js +17 -7
  65. package/lib/parse/specification/amm-delete.js +17 -7
  66. package/lib/parse/specification/amm-deposit.js +17 -7
  67. package/lib/parse/specification/amm-vote.js +17 -7
  68. package/lib/parse/specification/amm-withdraw.js +17 -7
  69. package/lib/parse/specification/check-cancel.js +17 -7
  70. package/lib/parse/specification/check-cash.js +17 -7
  71. package/lib/parse/specification/check-create.js +17 -7
  72. package/lib/parse/specification/clawback.js +17 -7
  73. package/lib/parse/specification/deposit-preauth.js +17 -7
  74. package/lib/parse/specification/did-delete.js +17 -7
  75. package/lib/parse/specification/did-set.js +17 -7
  76. package/lib/parse/specification/escrow-cancel.js +17 -7
  77. package/lib/parse/specification/escrow-create.js +17 -7
  78. package/lib/parse/specification/escrow-finish.js +17 -7
  79. package/lib/parse/specification/genesis-mint.js +17 -7
  80. package/lib/parse/specification/import.js +17 -7
  81. package/lib/parse/specification/invoke.js +17 -7
  82. package/lib/parse/specification/mptoken-authorize.d.ts +3 -0
  83. package/lib/parse/specification/mptoken-authorize.js +58 -0
  84. package/lib/parse/specification/mptoken-issuance-create.d.ts +3 -0
  85. package/lib/parse/specification/mptoken-issuance-create.js +60 -0
  86. package/lib/parse/specification/mptoken-issuance-destroy.d.ts +3 -0
  87. package/lib/parse/specification/mptoken-issuance-destroy.js +52 -0
  88. package/lib/parse/specification/mptoken-issuance-set.d.ts +3 -0
  89. package/lib/parse/specification/mptoken-issuance-set.js +58 -0
  90. package/lib/parse/specification/nftoken-accept-offer.js +22 -7
  91. package/lib/parse/specification/nftoken-burn.js +22 -7
  92. package/lib/parse/specification/nftoken-cancel-offer.js +22 -7
  93. package/lib/parse/specification/nftoken-create-offer.js +17 -7
  94. package/lib/parse/specification/nftoken-mint.js +34 -7
  95. package/lib/parse/specification/offer-cancel.js +22 -9
  96. package/lib/parse/specification/offer-create.js +22 -9
  97. package/lib/parse/specification/oracle-delete.js +17 -9
  98. package/lib/parse/specification/oracle-set.js +17 -7
  99. package/lib/parse/specification/payment-channel-claim.js +17 -7
  100. package/lib/parse/specification/payment-channel-create.js +17 -7
  101. package/lib/parse/specification/payment-channel-fund.js +17 -7
  102. package/lib/parse/specification/payment.js +17 -7
  103. package/lib/parse/specification/remit.js +17 -7
  104. package/lib/parse/specification/settings.js +17 -7
  105. package/lib/parse/specification/ticket-create.js +17 -7
  106. package/lib/parse/specification/trustline.js +17 -7
  107. package/lib/parse/specification/unl-report.js +17 -7
  108. package/lib/parse/specification/uritoken-burn.js +17 -7
  109. package/lib/parse/specification/uritoken-buy.js +17 -7
  110. package/lib/parse/specification/uritoken-cancel-sell-offer.js +17 -7
  111. package/lib/parse/specification/uritoken-create-sell-offer.js +17 -7
  112. package/lib/parse/specification/uritoken-mint.js +17 -7
  113. package/lib/parse/transaction.d.ts +4 -1
  114. package/lib/parse/transaction.js +24 -8
  115. package/lib/parse/utils.d.ts +2 -2
  116. package/lib/parse/utils.js +4 -1
  117. package/lib/types/account.d.ts +2 -2
  118. package/lib/types/amounts.d.ts +6 -2
  119. package/lib/types/checks.d.ts +2 -2
  120. package/lib/types/mptokens.d.ts +69 -0
  121. package/lib/types/mptokens.js +36 -0
  122. package/lib/types/nftokens.d.ts +3 -0
  123. package/lib/types/outcome.d.ts +6 -19
  124. package/lib/v1/utils.d.ts +1 -1
  125. package/lib/v1/utils.js +18 -10
  126. package/lib/validator.js +18 -16
  127. package/lib/wallet.d.ts +8 -1
  128. package/lib/wallet.js +94 -11
  129. package/package.json +18 -15
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  const assert = __importStar(require("assert"));
27
37
  const common_1 = require("../../common");
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  const assert = __importStar(require("assert"));
27
37
  const xrpl_1 = require("xrpl");
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  const assert = __importStar(require("assert"));
27
37
  const common_1 = require("../../common");
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  const assert = __importStar(require("assert"));
27
37
  const common_1 = require("../../common");
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  const assert = __importStar(require("assert"));
27
37
  const common_1 = require("../../common");
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  const assert = __importStar(require("assert"));
27
37
  const common_1 = require("../../common");
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  const assert = __importStar(require("assert"));
27
37
  const common_1 = require("../../common");
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -18,11 +18,14 @@ import { FormattedUNLReportSpecification } from "../types/unl_reports";
18
18
  import { FormattedRemitsSpecification } from "../types/remits";
19
19
  import { FormattedClawbackSpecification } from "../types/clawback";
20
20
  import { FormattedAmmBidSpecification, FormattedAmmCreateSpecification, FormattedAmmDeleteSpecification, FormattedAmmDepositSpecification, FormattedAmmWithdrawSpecification, FormattedAmmVoteSpecification } from "../types/amm";
21
+ import { FormattedDIDSetSpecification, FormattedDIDDeleteSpecification } from "../types/did";
22
+ import { FormattedOracleSetSpecification, FormattedOracleDeleteSpecification } from "../types/oracle";
23
+ import { FormattedMPTokenIssuanceCreateSpecification, FormattedMPTokenAuthorizeSpecification, FormattedMPTokenIssuanceSetSpecification, FormattedMPTokenIssuanceDestroySpecification } from "../types/mptokens";
21
24
  import { FormattedGenesisMintSpecification } from "../types/genesis_mint";
22
25
  import { FormattedAmendmentSpecification } from "../types/amendments";
23
26
  import { FormattedFeeUpdateSpecification } from "../types/fees";
24
27
  declare function parseTransactionType(type: string): string;
25
- export type FormattedSpecification = FormattedSettingsSpecification | FormattedAccountDeleteSpecification | FormattedCheckCancelSpecification | FormattedCheckCashSpecification | FormattedCheckCreateSpecification | FormattedDepositPreauthSpecification | FormattedEscrowCancelSpecification | FormattedEscrowCreateSpecification | FormattedEscrowFinishSpecification | FormattedOfferCancelSpecification | FormattedOfferCreateSpecification | FormattedPaymentSpecification | FormattedPaymentChannelClaimSpecification | FormattedPaymentChannelCreateSpecification | FormattedPaymentChannelFundSpecification | FormattedTicketCreateSpecification | FormattedTrustlineSpecification | FormattedNFTokenBurnSpecification | FormattedNFTokenMintSpecification | FormattedNFTokenCancelOfferSpecification | FormattedNFTokenCreateOfferSpecification | FormattedNFTokenAcceptOfferSpecification | FormattedURITokenBurnSpecification | FormattedURITokenBuySpecification | FormattedURITokenCreateSellOfferSpecification | FormattedURITokenCancelSellOfferSpecification | FormattedURITokenMintSpecification | FormattedImportSpecification | FormattedInvokeSpecification | FormattedUNLReportSpecification | FormattedRemitsSpecification | FormattedClawbackSpecification | FormattedAmmBidSpecification | FormattedAmmCreateSpecification | FormattedAmmDeleteSpecification | FormattedAmmDepositSpecification | FormattedAmmWithdrawSpecification | FormattedAmmVoteSpecification | FormattedGenesisMintSpecification | FormattedAmendmentSpecification | FormattedFeeUpdateSpecification;
28
+ export type FormattedSpecification = FormattedSettingsSpecification | FormattedAccountDeleteSpecification | FormattedCheckCancelSpecification | FormattedCheckCashSpecification | FormattedCheckCreateSpecification | FormattedDepositPreauthSpecification | FormattedEscrowCancelSpecification | FormattedEscrowCreateSpecification | FormattedEscrowFinishSpecification | FormattedOfferCancelSpecification | FormattedOfferCreateSpecification | FormattedPaymentSpecification | FormattedPaymentChannelClaimSpecification | FormattedPaymentChannelCreateSpecification | FormattedPaymentChannelFundSpecification | FormattedTicketCreateSpecification | FormattedTrustlineSpecification | FormattedNFTokenBurnSpecification | FormattedNFTokenMintSpecification | FormattedNFTokenCancelOfferSpecification | FormattedNFTokenCreateOfferSpecification | FormattedNFTokenAcceptOfferSpecification | FormattedURITokenBurnSpecification | FormattedURITokenBuySpecification | FormattedURITokenCreateSellOfferSpecification | FormattedURITokenCancelSellOfferSpecification | FormattedURITokenMintSpecification | FormattedImportSpecification | FormattedInvokeSpecification | FormattedUNLReportSpecification | FormattedRemitsSpecification | FormattedClawbackSpecification | FormattedAmmBidSpecification | FormattedAmmCreateSpecification | FormattedAmmDeleteSpecification | FormattedAmmDepositSpecification | FormattedAmmWithdrawSpecification | FormattedAmmVoteSpecification | FormattedGenesisMintSpecification | FormattedAmendmentSpecification | FormattedFeeUpdateSpecification | FormattedDIDSetSpecification | FormattedDIDDeleteSpecification | FormattedOracleSetSpecification | FormattedOracleDeleteSpecification | FormattedMPTokenIssuanceCreateSpecification | FormattedMPTokenAuthorizeSpecification | FormattedMPTokenIssuanceSetSpecification | FormattedMPTokenIssuanceDestroySpecification;
26
29
  export interface FormattedTransaction {
27
30
  type: string;
28
31
  address: string;
@@ -50,6 +50,10 @@ const did_set_1 = __importDefault(require("./specification/did-set"));
50
50
  const did_delete_1 = __importDefault(require("./specification/did-delete"));
51
51
  const oracle_set_1 = __importDefault(require("./specification/oracle-set"));
52
52
  const oracle_delete_1 = __importDefault(require("./specification/oracle-delete"));
53
+ const mptoken_issuance_create_1 = __importDefault(require("./specification/mptoken-issuance-create"));
54
+ const mptoken_authorize_1 = __importDefault(require("./specification/mptoken-authorize"));
55
+ const mptoken_issuance_set_1 = __importDefault(require("./specification/mptoken-issuance-set"));
56
+ const mptoken_issuance_destroy_1 = __importDefault(require("./specification/mptoken-issuance-destroy"));
53
57
  const genesis_mint_1 = __importDefault(require("./specification/genesis-mint"));
54
58
  const amendment_1 = __importDefault(require("./specification/amendment"));
55
59
  const fee_update_1 = __importDefault(require("./specification/fee-update"));
@@ -98,6 +102,10 @@ const transactionTypeToType = {
98
102
  DIDDelete: "didDelete",
99
103
  OracleSet: "oracleSet",
100
104
  OracleDelete: "oracleDelete",
105
+ MPTokenIssuanceCreate: "MPTokenIssuanceCreate",
106
+ MPTokenAuthorize: "MPTokenAuthorize",
107
+ MPTokenIssuanceSet: "MPTokenIssuanceSet",
108
+ MPTokenIssuanceDestroy: "MPTokenIssuanceDestroy",
101
109
  GenesisMint: "genesisMint",
102
110
  EnableAmendment: "amendment",
103
111
  SetFee: "feeUpdate",
@@ -148,6 +156,10 @@ const parserTypeFunc = {
148
156
  didDelete: did_delete_1.default,
149
157
  oracleSet: oracle_set_1.default,
150
158
  oracleDelete: oracle_delete_1.default,
159
+ MPTokenIssuanceCreate: mptoken_issuance_create_1.default,
160
+ MPTokenAuthorize: mptoken_authorize_1.default,
161
+ MPTokenIssuanceSet: mptoken_issuance_set_1.default,
162
+ MPTokenIssuanceDestroy: mptoken_issuance_destroy_1.default,
151
163
  genesisMint: genesis_mint_1.default,
152
164
  amendment: amendment_1.default,
153
165
  feeUpdate: fee_update_1.default,
@@ -159,20 +171,24 @@ function unrecognizedParser(_tx) {
159
171
  };
160
172
  }
161
173
  function parseTransaction(tx, includeRawTransaction, nativeCurrency, definitions) {
162
- const type = parseTransactionType(tx.TransactionType);
174
+ let universalTx = tx;
175
+ if (universalTx.tx_json) {
176
+ universalTx = { ...universalTx, ...universalTx.tx_json };
177
+ }
178
+ const type = parseTransactionType(universalTx.TransactionType);
163
179
  const parser = parserTypeFunc[type];
164
- const specification = parser ? parser(tx) : unrecognizedParser(tx);
180
+ const specification = parser ? parser(universalTx) : unrecognizedParser(universalTx);
165
181
  if (!parser) {
166
182
  includeRawTransaction = true;
167
183
  }
168
- const outcome = (0, outcome_1.parseOutcome)(tx, nativeCurrency, definitions);
184
+ const outcome = (0, outcome_1.parseOutcome)(universalTx, nativeCurrency, definitions);
169
185
  return (0, common_1.removeUndefined)({
170
186
  type: type,
171
- address: (0, account_1.parseAccount)(tx.Account),
172
- sequence: tx.Sequence,
173
- ticketSequence: tx.TicketSequence,
174
- id: tx.hash,
175
- ctid: tx.ctid,
187
+ address: (0, account_1.parseAccount)(universalTx.Account),
188
+ sequence: universalTx.Sequence,
189
+ ticketSequence: universalTx.TicketSequence,
190
+ id: universalTx.hash,
191
+ ctid: universalTx.ctid,
176
192
  specification: (0, common_1.removeUndefined)(specification),
177
193
  outcome: outcome ? (0, common_1.removeUndefined)(outcome) : undefined,
178
194
  rawTransaction: includeRawTransaction ? JSON.stringify(tx) : undefined,
@@ -1,10 +1,10 @@
1
1
  import { TransactionMetadata } from "xrpl";
2
- import { FormattedIssuedCurrencyAmount } from "../types";
2
+ import { FormattedIssuedCurrencyAmount, FormattedIssuedMPTAmount } from "../types";
3
3
  declare function adjustQualityForXRP(quality: string, takerGetsCurrency: string, takerPaysCurrency: string): string;
4
4
  declare function parseQuality(quality?: number | null): number | undefined;
5
5
  declare function parseTimestamp(rippleTime?: number | null): string | undefined;
6
6
  declare function isPartialPayment(tx: any): boolean;
7
- declare function removeGenericCounterparty(amount: FormattedIssuedCurrencyAmount, address: string): FormattedIssuedCurrencyAmount;
7
+ declare function removeGenericCounterparty(amount: FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount, address: string): FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount;
8
8
  declare function normalizeNodes(metadata: TransactionMetadata): any[];
9
9
  declare function hexToString(hex: string | undefined): string | undefined;
10
10
  declare function stringToHex(value: string | undefined): string | undefined;
@@ -42,7 +42,10 @@ function isPartialPayment(tx) {
42
42
  return (tx.Flags & xrpl_1.PaymentFlags.tfPartialPayment) !== 0;
43
43
  }
44
44
  function removeGenericCounterparty(amount, address) {
45
- return amount.counterparty === address ? lodash_1.default.omit(amount, "counterparty") : amount;
45
+ if ("counterparty" in amount) {
46
+ return amount.counterparty === address ? lodash_1.default.omit(amount, "counterparty") : amount;
47
+ }
48
+ return amount;
46
49
  }
47
50
  function normalizeNode(affectedNode) {
48
51
  const diffType = Object.keys(affectedNode)[0];
@@ -1,12 +1,12 @@
1
1
  import { FormattedBaseSpecification } from "./specification";
2
- import { FormattedIssuedCurrencyAmount } from "./amounts";
2
+ import { FormattedIssuedCurrencyAmount, FormattedIssuedMPTAmount } from "./amounts";
3
3
  export type FormattedAccountDeleteSpecification = {
4
4
  source?: FormattedSourceAddress;
5
5
  destination?: FormattedDestinationAddress;
6
6
  } & FormattedBaseSpecification;
7
7
  export type FormattedSourceAddress = {
8
8
  address: string;
9
- maxAmount?: FormattedIssuedCurrencyAmount;
9
+ maxAmount?: FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount;
10
10
  tag?: number;
11
11
  };
12
12
  export type FormattedDestinationAddress = {
@@ -12,5 +12,9 @@ export interface IssuedCurrencyAmount extends IssuedCurrency {
12
12
  export interface FormattedIssuedCurrencyAmount extends FormattedIssuedCurrency {
13
13
  value: string;
14
14
  }
15
- export type Amount = IssuedCurrencyAmount | string;
16
- export type FormattedAmount = FormattedIssuedCurrencyAmount | string;
15
+ export interface FormattedIssuedMPTAmount {
16
+ mpt_issuance_id?: string;
17
+ value: string;
18
+ }
19
+ export type Amount = IssuedCurrencyAmount | FormattedIssuedMPTAmount | string;
20
+ export type FormattedAmount = FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount | string;
@@ -1,5 +1,5 @@
1
1
  import { FormattedBaseSpecification } from "./specification";
2
- import { FormattedIssuedCurrencyAmount } from "./amounts";
2
+ import { FormattedIssuedCurrencyAmount, FormattedIssuedMPTAmount } from "./amounts";
3
3
  import { FormattedSourceAddress, FormattedDestinationAddress } from "./account";
4
4
  export type FormattedCheckCancelSpecification = {
5
5
  checkID: string;
@@ -12,7 +12,7 @@ export type FormattedCheckCashSpecification = {
12
12
  export type FormattedCheckCreateSpecification = {
13
13
  source?: FormattedSourceAddress;
14
14
  destination?: FormattedDestinationAddress;
15
- sendMax: FormattedIssuedCurrencyAmount;
15
+ sendMax: FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount;
16
16
  expiration?: string;
17
17
  invoiceID?: string;
18
18
  } & FormattedBaseSpecification;
@@ -0,0 +1,69 @@
1
+ import { FormattedBaseSpecification } from "./specification";
2
+ declare enum MPTokenIssuanceCreateFlags {
3
+ tfMPTCanLock = 2,
4
+ tfMPTRequireAuth = 4,
5
+ tfMPTCanEscrow = 8,
6
+ tfMPTCanTrade = 16,
7
+ tfMPTCanTransfer = 32,
8
+ tfMPTCanClawback = 64
9
+ }
10
+ export declare const MPTokenIssuanceCreateFlagsKeys: {
11
+ canLock: MPTokenIssuanceCreateFlags;
12
+ requireAuth: MPTokenIssuanceCreateFlags;
13
+ canEscrow: MPTokenIssuanceCreateFlags;
14
+ canTrade: MPTokenIssuanceCreateFlags;
15
+ canTransfer: MPTokenIssuanceCreateFlags;
16
+ canClawback: MPTokenIssuanceCreateFlags;
17
+ };
18
+ export interface MPTokenIssuanceCreateFlagsKeysInterface {
19
+ canLock?: boolean;
20
+ requireAuth?: boolean;
21
+ canEscrow?: boolean;
22
+ canTrade?: boolean;
23
+ canTransfer?: boolean;
24
+ canClawback?: boolean;
25
+ }
26
+ declare enum MPTokenIssuanceSetFlags {
27
+ tfMPTLock = 1,
28
+ tfMPTUnlock = 2
29
+ }
30
+ export declare const MPTokenIssuanceSetFlagsKeys: {
31
+ lock: MPTokenIssuanceSetFlags;
32
+ unlock: MPTokenIssuanceSetFlags;
33
+ };
34
+ export interface MPTokenIssuanceSetFlagsKeysInterface {
35
+ lock?: boolean;
36
+ unlock?: boolean;
37
+ }
38
+ declare enum MPTokenAuthorizeFlags {
39
+ tfMPTUnauthorize = 1
40
+ }
41
+ export declare const MPTokenAuthorizeFlagsKeys: {
42
+ unauthorize: MPTokenAuthorizeFlags;
43
+ };
44
+ export interface MPTokenAuthorizeFlagsKeysInterface {
45
+ unauthorize?: boolean;
46
+ }
47
+ export type FormattedMPTokenAuthorizeSpecification = {
48
+ flags?: MPTokenAuthorizeFlagsKeysInterface;
49
+ holder?: string;
50
+ mptIssuanceID?: string;
51
+ } & FormattedBaseSpecification;
52
+ export type FormattedMPTokenIssuanceCreateSpecification = {
53
+ issuer?: string;
54
+ sequence?: number;
55
+ scale?: number;
56
+ flags?: MPTokenIssuanceCreateFlagsKeysInterface;
57
+ metadata?: string;
58
+ maximumAmount?: string;
59
+ transferFee?: number;
60
+ } & FormattedBaseSpecification;
61
+ export type FormattedMPTokenIssuanceDestroySpecification = {
62
+ mptIssuanceID?: string;
63
+ } & FormattedBaseSpecification;
64
+ export type FormattedMPTokenIssuanceSetSpecification = {
65
+ flags?: MPTokenIssuanceSetFlagsKeysInterface;
66
+ holder?: string;
67
+ mptIssuanceID?: string;
68
+ } & FormattedBaseSpecification;
69
+ export {};
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MPTokenAuthorizeFlagsKeys = exports.MPTokenIssuanceSetFlagsKeys = exports.MPTokenIssuanceCreateFlagsKeys = void 0;
4
+ var MPTokenIssuanceCreateFlags;
5
+ (function (MPTokenIssuanceCreateFlags) {
6
+ MPTokenIssuanceCreateFlags[MPTokenIssuanceCreateFlags["tfMPTCanLock"] = 2] = "tfMPTCanLock";
7
+ MPTokenIssuanceCreateFlags[MPTokenIssuanceCreateFlags["tfMPTRequireAuth"] = 4] = "tfMPTRequireAuth";
8
+ MPTokenIssuanceCreateFlags[MPTokenIssuanceCreateFlags["tfMPTCanEscrow"] = 8] = "tfMPTCanEscrow";
9
+ MPTokenIssuanceCreateFlags[MPTokenIssuanceCreateFlags["tfMPTCanTrade"] = 16] = "tfMPTCanTrade";
10
+ MPTokenIssuanceCreateFlags[MPTokenIssuanceCreateFlags["tfMPTCanTransfer"] = 32] = "tfMPTCanTransfer";
11
+ MPTokenIssuanceCreateFlags[MPTokenIssuanceCreateFlags["tfMPTCanClawback"] = 64] = "tfMPTCanClawback";
12
+ })(MPTokenIssuanceCreateFlags || (MPTokenIssuanceCreateFlags = {}));
13
+ exports.MPTokenIssuanceCreateFlagsKeys = {
14
+ canLock: MPTokenIssuanceCreateFlags.tfMPTCanLock,
15
+ requireAuth: MPTokenIssuanceCreateFlags.tfMPTRequireAuth,
16
+ canEscrow: MPTokenIssuanceCreateFlags.tfMPTCanEscrow,
17
+ canTrade: MPTokenIssuanceCreateFlags.tfMPTCanTrade,
18
+ canTransfer: MPTokenIssuanceCreateFlags.tfMPTCanTransfer,
19
+ canClawback: MPTokenIssuanceCreateFlags.tfMPTCanClawback,
20
+ };
21
+ var MPTokenIssuanceSetFlags;
22
+ (function (MPTokenIssuanceSetFlags) {
23
+ MPTokenIssuanceSetFlags[MPTokenIssuanceSetFlags["tfMPTLock"] = 1] = "tfMPTLock";
24
+ MPTokenIssuanceSetFlags[MPTokenIssuanceSetFlags["tfMPTUnlock"] = 2] = "tfMPTUnlock";
25
+ })(MPTokenIssuanceSetFlags || (MPTokenIssuanceSetFlags = {}));
26
+ exports.MPTokenIssuanceSetFlagsKeys = {
27
+ lock: MPTokenIssuanceSetFlags.tfMPTLock,
28
+ unlock: MPTokenIssuanceSetFlags.tfMPTUnlock,
29
+ };
30
+ var MPTokenAuthorizeFlags;
31
+ (function (MPTokenAuthorizeFlags) {
32
+ MPTokenAuthorizeFlags[MPTokenAuthorizeFlags["tfMPTUnauthorize"] = 1] = "tfMPTUnauthorize";
33
+ })(MPTokenAuthorizeFlags || (MPTokenAuthorizeFlags = {}));
34
+ exports.MPTokenAuthorizeFlagsKeys = {
35
+ unauthorize: MPTokenAuthorizeFlags.tfMPTUnauthorize,
36
+ };
@@ -30,6 +30,9 @@ export type FormattedNFTokenMintSpecification = {
30
30
  transferFee?: number;
31
31
  uri?: string;
32
32
  flags?: NFTokenFlagsKeysInterface;
33
+ amount?: Amount;
34
+ destination?: FormattedDestinationAddress;
35
+ expiration?: number;
33
36
  } & FormattedBaseSpecification;
34
37
  export type FormattedNFTokenCancelOfferSpecification = {
35
38
  nftokenOffers: string[];
@@ -1,22 +1,13 @@
1
+ import { FormattedIssuedCurrencyAmount, FormattedIssuedMPTAmount } from "./amounts";
2
+ import { LockedBalanceChanges } from "../parse/outcome/locked_balance_changes";
3
+ import { BalanceChanges } from "../parse/outcome/balance_changes";
1
4
  export type Outcome = {
2
5
  result?: string;
3
6
  ledgerVersion?: number;
4
7
  indexInLedger?: number;
5
8
  fee?: string;
6
- balanceChanges?: {
7
- [key: string]: {
8
- currency: string;
9
- counterparty?: string;
10
- value: string;
11
- }[];
12
- };
13
- lockedBalanceChanges?: {
14
- [key: string]: {
15
- currency: string;
16
- counterparty?: string;
17
- value: string;
18
- }[];
19
- };
9
+ balanceChanges?: BalanceChanges;
10
+ lockedBalanceChanges?: LockedBalanceChanges;
20
11
  orderbookChanges?: object;
21
12
  channelChanges?: object;
22
13
  nftokenChanges?: object;
@@ -25,10 +16,6 @@ export type Outcome = {
25
16
  uritokenSellOfferChanges?: object;
26
17
  affectedObjects?: object;
27
18
  ammChanges?: object;
28
- deliveredAmount?: {
29
- currency: string;
30
- counterparty?: string;
31
- value: string;
32
- };
19
+ deliveredAmount?: FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount;
33
20
  timestamp?: string;
34
21
  };
package/lib/v1/utils.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Amount, FormattedIssuedCurrencyAmount } from "../types";
2
- export declare function toRippledAmount(amount: Amount | FormattedIssuedCurrencyAmount): Amount;
2
+ export declare function toRippledAmount(amount: Amount | FormattedIssuedCurrencyAmount): Amount | undefined;
3
3
  export interface ClassicAccountAndTag {
4
4
  classicAccount: string;
5
5
  tag: number | false | undefined;