@bithomp/xrpl-api 3.2.8 → 3.2.10

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 (95) hide show
  1. package/lib/ledger/account_lines.d.ts +1 -1
  2. package/lib/ledger/account_lines.js +11 -2
  3. package/lib/ledger/currency.d.ts +1 -0
  4. package/lib/ledger/currency.js +4 -2
  5. package/lib/ledger/transaction.js +6 -0
  6. package/lib/models/book_offers.d.ts +3 -3
  7. package/lib/models/book_offers.js +1 -1
  8. package/lib/parse/ledger/amount.d.ts +2 -2
  9. package/lib/parse/ledger/amount.js +1 -0
  10. package/lib/parse/ledger/asset.d.ts +1 -1
  11. package/lib/parse/ledger/asset.js +1 -0
  12. package/lib/parse/ledger/destination.d.ts +2 -0
  13. package/lib/parse/ledger/destination.js +12 -0
  14. package/lib/parse/ledger/gateway-balances.js +4 -4
  15. package/lib/parse/ledger/ledger.js +12 -8
  16. package/lib/parse/ledger/regular-key.d.ts +2 -0
  17. package/lib/parse/ledger/regular-key.js +14 -0
  18. package/lib/parse/ledger/signers.d.ts +2 -0
  19. package/lib/parse/ledger/signers.js +12 -0
  20. package/lib/parse/ledger/source.d.ts +3 -0
  21. package/lib/parse/ledger/source.js +28 -0
  22. package/lib/parse/outcome/amm_changes.js +4 -2
  23. package/lib/parse/outcome/balance_changes.d.ts +2 -1
  24. package/lib/parse/outcome/balance_changes.js +5 -3
  25. package/lib/parse/outcome/locked_balance_changes.d.ts +2 -1
  26. package/lib/parse/outcome/locked_balance_changes.js +2 -1
  27. package/lib/parse/outcome.js +3 -2
  28. package/lib/parse/specification/account-delete.js +8 -11
  29. package/lib/parse/specification/amm-bid.js +6 -6
  30. package/lib/parse/specification/amm-clawback.js +6 -5
  31. package/lib/parse/specification/amm-create.js +6 -6
  32. package/lib/parse/specification/amm-delete.js +6 -6
  33. package/lib/parse/specification/amm-deposit.js +6 -6
  34. package/lib/parse/specification/amm-vote.js +6 -6
  35. package/lib/parse/specification/amm-withdraw.js +6 -6
  36. package/lib/parse/specification/check-cancel.js +6 -0
  37. package/lib/parse/specification/check-cash.js +6 -0
  38. package/lib/parse/specification/check-create.js +8 -11
  39. package/lib/parse/specification/clawback.js +6 -6
  40. package/lib/parse/specification/deposit-preauth.js +6 -0
  41. package/lib/parse/specification/did-delete.js +6 -6
  42. package/lib/parse/specification/did-set.js +6 -6
  43. package/lib/parse/specification/escrow-cancel.js +6 -5
  44. package/lib/parse/specification/escrow-create.js +8 -10
  45. package/lib/parse/specification/escrow-finish.js +6 -5
  46. package/lib/parse/specification/fee-update.js +2 -0
  47. package/lib/parse/specification/genesis-mint.js +2 -0
  48. package/lib/parse/specification/import.js +6 -5
  49. package/lib/parse/specification/invoke.js +8 -10
  50. package/lib/parse/specification/mptoken-authorize.js +6 -6
  51. package/lib/parse/specification/mptoken-issuance-create.js +6 -6
  52. package/lib/parse/specification/mptoken-issuance-destroy.js +6 -6
  53. package/lib/parse/specification/mptoken-issuance-set.js +6 -6
  54. package/lib/parse/specification/nftoken-accept-offer.js +6 -5
  55. package/lib/parse/specification/nftoken-burn.js +6 -5
  56. package/lib/parse/specification/nftoken-cancel-offer.js +6 -5
  57. package/lib/parse/specification/nftoken-create-offer.js +8 -10
  58. package/lib/parse/specification/nftoken-mint.js +8 -10
  59. package/lib/parse/specification/offer-cancel.js +8 -5
  60. package/lib/parse/specification/offer-create.js +8 -5
  61. package/lib/parse/specification/oracle-delete.js +6 -6
  62. package/lib/parse/specification/oracle-set.js +6 -6
  63. package/lib/parse/specification/payment-channel-claim.js +9 -3
  64. package/lib/parse/specification/payment-channel-create.js +10 -13
  65. package/lib/parse/specification/payment-channel-fund.js +8 -2
  66. package/lib/parse/specification/payment.js +8 -15
  67. package/lib/parse/specification/remit.js +8 -11
  68. package/lib/parse/specification/settings.js +6 -0
  69. package/lib/parse/specification/ticket-create.js +6 -0
  70. package/lib/parse/specification/trustline.js +6 -0
  71. package/lib/parse/specification/unl-report.js +2 -7
  72. package/lib/parse/specification/unrecognized.js +6 -6
  73. package/lib/parse/specification/uritoken-burn.js +6 -0
  74. package/lib/parse/specification/uritoken-buy.js +6 -0
  75. package/lib/parse/specification/uritoken-cancel-sell-offer.js +6 -0
  76. package/lib/parse/specification/uritoken-create-sell-offer.js +8 -10
  77. package/lib/parse/specification/uritoken-mint.js +8 -10
  78. package/lib/parse/utils.d.ts +2 -2
  79. package/lib/parse/utils.js +3 -0
  80. package/lib/types/account.d.ts +5 -2
  81. package/lib/types/adjustments.d.ts +4 -4
  82. package/lib/types/amounts.d.ts +1 -1
  83. package/lib/types/escrows.d.ts +0 -5
  84. package/lib/types/gateway_balances.d.ts +3 -3
  85. package/lib/types/import.d.ts +0 -2
  86. package/lib/types/invoke.d.ts +2 -3
  87. package/lib/types/ledger.d.ts +1 -0
  88. package/lib/types/outcome.d.ts +1 -0
  89. package/lib/types/payments.d.ts +2 -2
  90. package/lib/types/remits.d.ts +0 -3
  91. package/lib/types/signers.d.ts +16 -0
  92. package/lib/types/specification.d.ts +4 -1
  93. package/lib/types/unl_reports.d.ts +0 -2
  94. package/lib/v1/transaction/payment.js +14 -2
  95. package/package.json +1 -1
@@ -1,7 +1,5 @@
1
1
  import { FormattedBaseSpecification } from "./specification";
2
- import { FormattedSourceAddress } from "./account";
3
2
  export type FormattedUNLReportSpecification = {
4
- source: FormattedSourceAddress;
5
3
  activeValidator?: string;
6
4
  importVLKey?: string;
7
5
  } & FormattedBaseSpecification;
@@ -26,13 +26,25 @@ function isXRPToXRPPayment(payment) {
26
26
  (destinationCurrency === (0, client_1.getNativeCurrency)() || destinationCurrency === "drops"));
27
27
  }
28
28
  function isIOUWithoutCounterparty(amount) {
29
- return (amount && amount.currency !== (0, client_1.getNativeCurrency)() && amount.currency !== "drops" && amount.counterparty == null);
29
+ if (typeof amount === "object") {
30
+ if ("currency" in amount && amount.currency !== (0, client_1.getNativeCurrency)() && amount.currency !== "drops") {
31
+ return false;
32
+ }
33
+ if ("mpt_issuance_id" in amount && amount.mpt_issuance_id) {
34
+ return false;
35
+ }
36
+ if (amount.issuer == null &&
37
+ amount.counterparty == null) {
38
+ return true;
39
+ }
40
+ }
41
+ return false;
30
42
  }
31
43
  function applyAnyCounterpartyEncoding(payment) {
32
44
  [payment.source, payment.destination].forEach((adjustment) => {
33
45
  ["amount", "minAmount", "maxAmount"].forEach((key) => {
34
46
  if (isIOUWithoutCounterparty(adjustment[key])) {
35
- adjustment[key].counterparty = adjustment.address;
47
+ adjustment[key].issuer = adjustment.address;
36
48
  }
37
49
  });
38
50
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bithomp/xrpl-api",
3
- "version": "3.2.8",
3
+ "version": "3.2.10",
4
4
  "description": "A Bithomp JavaScript/TypeScript library for interacting with the XRP Ledger",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",