@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
@@ -1,5 +1,18 @@
1
+ import { PaymentFlags } from "xrpl";
1
2
  import { FormattedBaseSpecification } from "./specification";
2
3
  import { FormattedSourceAddress, FormattedDestinationAddress } from "./account";
4
+ import { TxGlobalFlagsKeysInterface } from "./global";
5
+ export declare const PaymentFlagsKeys: {
6
+ noRippleDirect: PaymentFlags;
7
+ partialPayment: PaymentFlags;
8
+ limitQuality: PaymentFlags;
9
+ };
10
+ export declare function getPaymentFlagsKeys(nativeCurrency?: string): Record<string, number>;
11
+ export interface PaymentKeysInterface extends TxGlobalFlagsKeysInterface {
12
+ noRippleDirect?: boolean;
13
+ partialPayment?: boolean;
14
+ limitQuality?: boolean;
15
+ }
3
16
  export type FormattedPaymentSpecification = {
4
17
  source?: FormattedSourceAddress;
5
18
  destination?: FormattedDestinationAddress;
@@ -1,2 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PaymentFlagsKeys = void 0;
4
+ exports.getPaymentFlagsKeys = getPaymentFlagsKeys;
5
+ const xrpl_1 = require("xrpl");
6
+ const global_1 = require("./global");
7
+ const common_1 = require("../common");
8
+ exports.PaymentFlagsKeys = {
9
+ noRippleDirect: xrpl_1.PaymentFlags.tfNoRippleDirect,
10
+ partialPayment: xrpl_1.PaymentFlags.tfPartialPayment,
11
+ limitQuality: xrpl_1.PaymentFlags.tfLimitQuality,
12
+ };
13
+ const nativeCurrencyPaymentFlags = {};
14
+ function getPaymentFlagsKeys(nativeCurrency) {
15
+ if (!nativeCurrency) {
16
+ nativeCurrency = common_1.MAINNET_NATIVE_CURRENCY;
17
+ }
18
+ if (!nativeCurrencyPaymentFlags[nativeCurrency]) {
19
+ nativeCurrencyPaymentFlags[nativeCurrency] = {
20
+ ...(0, global_1.getTxGlobalFlagsKeys)(nativeCurrency),
21
+ ...exports.PaymentFlagsKeys,
22
+ };
23
+ }
24
+ return nativeCurrencyPaymentFlags[nativeCurrency];
25
+ }
@@ -2,11 +2,13 @@ import { FormattedSourceAddress, FormattedSignerRegularKey } from "./account";
2
2
  import { FormattedEmitDetails } from "./emit_details";
3
3
  import { FormattedMemo } from "./memos";
4
4
  import { FormattedTransactionSigner } from "./signers";
5
+ import { TxGlobalFlagsKeysInterface } from "./global";
5
6
  export type FormattedBaseSpecification = {
6
7
  source?: FormattedSourceAddress;
7
8
  signers?: FormattedTransactionSigner[];
8
9
  signer?: FormattedSignerRegularKey;
9
10
  delegate?: FormattedSignerRegularKey;
10
11
  emittedDetails?: FormattedEmitDetails;
12
+ flags?: TxGlobalFlagsKeysInterface;
11
13
  memos?: FormattedMemo[];
12
14
  };
@@ -1,5 +1,25 @@
1
- import { LedgerEntry } from "xrpl";
1
+ import { LedgerEntry, TrustSetFlags } from "xrpl";
2
2
  import { FormattedBaseSpecification } from "./specification";
3
+ import { TxGlobalFlagsKeysInterface } from "./global";
4
+ export declare const TrustSetFlagsKeys: {
5
+ setfAuth: TrustSetFlags;
6
+ setNoRipple: TrustSetFlags;
7
+ clearNoRipple: TrustSetFlags;
8
+ setFreeze: TrustSetFlags;
9
+ clearFreeze: TrustSetFlags;
10
+ setDeepFreeze: TrustSetFlags;
11
+ clearDeepFreeze: TrustSetFlags;
12
+ };
13
+ export declare function getTrustSetFlagsKeys(nativeCurrency?: string): Record<string, number>;
14
+ export interface TrustSetFlagsKeysInterface extends TxGlobalFlagsKeysInterface {
15
+ setfAuth?: boolean;
16
+ setNoRipple?: boolean;
17
+ clearNoRipple?: boolean;
18
+ setFreeze?: boolean;
19
+ clearFreeze?: boolean;
20
+ setDeepFreeze?: boolean;
21
+ clearDeepFreeze?: boolean;
22
+ }
3
23
  export declare const TrustlineFlagsKeys: {
4
24
  lowReserve: LedgerEntry.RippleStateFlags;
5
25
  highReserve: LedgerEntry.RippleStateFlags;
@@ -1,8 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TrustlineFlagsKeys = void 0;
3
+ exports.TrustlineFlagsKeys = exports.TrustSetFlagsKeys = void 0;
4
+ exports.getTrustSetFlagsKeys = getTrustSetFlagsKeys;
4
5
  const xrpl_1 = require("xrpl");
5
6
  const { RippleStateFlags } = xrpl_1.LedgerEntry;
7
+ const global_1 = require("./global");
8
+ const common_1 = require("../common");
9
+ exports.TrustSetFlagsKeys = {
10
+ setfAuth: xrpl_1.TrustSetFlags.tfSetfAuth,
11
+ setNoRipple: xrpl_1.TrustSetFlags.tfSetNoRipple,
12
+ clearNoRipple: xrpl_1.TrustSetFlags.tfClearNoRipple,
13
+ setFreeze: xrpl_1.TrustSetFlags.tfSetFreeze,
14
+ clearFreeze: xrpl_1.TrustSetFlags.tfClearFreeze,
15
+ setDeepFreeze: xrpl_1.TrustSetFlags.tfSetDeepFreeze,
16
+ clearDeepFreeze: xrpl_1.TrustSetFlags.tfClearDeepFreeze,
17
+ };
18
+ const nativeCurrencyTrustSetFlags = {};
19
+ function getTrustSetFlagsKeys(nativeCurrency) {
20
+ if (!nativeCurrency) {
21
+ nativeCurrency = common_1.MAINNET_NATIVE_CURRENCY;
22
+ }
23
+ if (!nativeCurrencyTrustSetFlags[nativeCurrency]) {
24
+ nativeCurrencyTrustSetFlags[nativeCurrency] = {
25
+ ...(0, global_1.getTxGlobalFlagsKeys)(nativeCurrency),
26
+ ...exports.TrustSetFlagsKeys,
27
+ };
28
+ }
29
+ return nativeCurrencyTrustSetFlags[nativeCurrency];
30
+ }
6
31
  exports.TrustlineFlagsKeys = {
7
32
  lowReserve: RippleStateFlags.lsfLowReserve,
8
33
  highReserve: RippleStateFlags.lsfHighReserve,
@@ -2,10 +2,12 @@ import { URITokenMintFlags } from "../models/transactions/URITokenMint";
2
2
  import { FormattedBaseSpecification } from "./specification";
3
3
  import { Amount } from "./amounts";
4
4
  import { FormattedSourceAddress, FormattedDestinationAddress } from "./account";
5
+ import { TxGlobalFlagsKeysInterface } from "./global";
5
6
  export declare const URITokenFlagsKeys: {
6
7
  burnable: URITokenMintFlags;
7
8
  };
8
- export interface URITokenFlagsKeysInterface {
9
+ export declare function getURITokenMintFlagsKeys(nativeCurrency?: string): Record<string, number>;
10
+ export interface URITokenFlagsKeysInterface extends TxGlobalFlagsKeysInterface {
9
11
  burnable?: boolean;
10
12
  }
11
13
  export type FormattedURITokenBurnSpecification = {
@@ -1,6 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.URITokenFlagsKeys = void 0;
4
+ exports.getURITokenMintFlagsKeys = getURITokenMintFlagsKeys;
5
+ const global_1 = require("./global");
6
+ const common_1 = require("../common");
4
7
  exports.URITokenFlagsKeys = {
5
8
  burnable: 1,
6
9
  };
10
+ const nativeCurrencyURITokenMintFlags = {};
11
+ function getURITokenMintFlagsKeys(nativeCurrency) {
12
+ if (!nativeCurrency) {
13
+ nativeCurrency = common_1.MAINNET_NATIVE_CURRENCY;
14
+ }
15
+ if (!nativeCurrencyURITokenMintFlags[nativeCurrency]) {
16
+ nativeCurrencyURITokenMintFlags[nativeCurrency] = {
17
+ ...(0, global_1.getTxGlobalFlagsKeys)(nativeCurrency),
18
+ ...exports.URITokenFlagsKeys,
19
+ };
20
+ }
21
+ return nativeCurrencyURITokenMintFlags[nativeCurrency];
22
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bithomp/xrpl-api",
3
- "version": "3.5.1",
3
+ "version": "3.6.1",
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",
@@ -43,7 +43,7 @@
43
43
  "format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
44
44
  "lint": "eslint",
45
45
  "prepare": "npm run build",
46
- "prepublishOnly": "npm test && npm run lint",
46
+ "-prepublishOnly": "npm test && npm run lint",
47
47
  "preversion": "npm run lint",
48
48
  "version": "npm run format && git add -A src",
49
49
  "postversion": "git push && git push --tags"
@@ -60,7 +60,7 @@
60
60
  "ripple-address-codec": "5.0.0",
61
61
  "ripple-binary-codec": "2.5.0",
62
62
  "ripple-keypairs": "2.0.0",
63
- "xrpl": "4.4.0"
63
+ "xrpl": "4.4.1"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@eslint/eslintrc": "^3.3.1",
@@ -70,8 +70,8 @@
70
70
  "@types/mocha": "^10.0.10",
71
71
  "@types/nconf": "^0.10.7",
72
72
  "@types/node": "^22.15.21",
73
- "@typescript-eslint/eslint-plugin": "^8.38.0",
74
- "@typescript-eslint/parser": "^8.38.0",
73
+ "@typescript-eslint/eslint-plugin": "^8.42.0",
74
+ "@typescript-eslint/parser": "^8.42.0",
75
75
  "chai": "^6.0.1",
76
76
  "chai-as-promised": "^8.0.2",
77
77
  "eslint": "^9.34.0",
@@ -80,10 +80,10 @@
80
80
  "eslint-plugin-import": "^2.32.0",
81
81
  "eslint-plugin-n": "^17.21.3",
82
82
  "eslint-plugin-promise": "^7.2.1",
83
- "mocha": "^11.7.1",
83
+ "mocha": "^11.7.2",
84
84
  "nconf": "^0.13.0",
85
85
  "ts-jest": "^29.4.1",
86
86
  "ts-node": "^10.9.2",
87
- "typescript": "^5.8.3"
87
+ "typescript": "^5.9.2"
88
88
  }
89
89
  }