@bithomp/xrpl-api 3.8.3 → 3.8.8

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.
@@ -1,2 +1,3 @@
1
1
  import { FormattedDestinationAddress } from "../../types/account";
2
2
  export declare function parseDestination(tx: any): FormattedDestinationAddress | undefined;
3
+ export declare function parseAddress(tx: any, field?: string): FormattedDestinationAddress | undefined;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parseDestination = parseDestination;
4
+ exports.parseAddress = parseAddress;
4
5
  const common_1 = require("../../common");
5
6
  function parseDestination(tx) {
6
7
  if (tx && tx.Destination) {
@@ -10,3 +11,10 @@ function parseDestination(tx) {
10
11
  });
11
12
  }
12
13
  }
14
+ function parseAddress(tx, field = "Destination") {
15
+ if (tx && tx[field]) {
16
+ return (0, common_1.removeUndefined)({
17
+ address: tx[field],
18
+ });
19
+ }
20
+ }
@@ -0,0 +1,6 @@
1
+ import { SponsorshipSetFlagsKeysInterface } from "../../types/sponsorship";
2
+ declare function parseTxSponsorshipSetFlags(value: number, options?: {
3
+ excludeFalse?: boolean;
4
+ nativeCurrency?: string;
5
+ }): SponsorshipSetFlagsKeysInterface;
6
+ export default parseTxSponsorshipSetFlags;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sponsorship_1 = require("../../types/sponsorship");
4
+ const flags_1 = require("./flags");
5
+ function parseTxSponsorshipSetFlags(value, options = {}) {
6
+ return (0, flags_1.parseFlags)(value, (0, sponsorship_1.getSponsorshipSetFlagsKeys)(options.nativeCurrency), options);
7
+ }
8
+ exports.default = parseTxSponsorshipSetFlags;
@@ -2,4 +2,5 @@ export declare function normalizeMPTokensPreviousFields(meta: any, tx: any): voi
2
2
  export declare function normalizeMPTokensPreviousFieldsEscrowCreate(meta: any): void;
3
3
  export declare function normalizeMPTokensPreviousFieldsEscrowFinish(meta: any): void;
4
4
  export declare function normalizeMPTokensPreviousFieldsEscrowCancel(meta: any): void;
5
+ export declare function normalizeMPTokensPreviousFieldsConfidentialMPTConvert(meta: any): void;
5
6
  export declare function normalizeMPTokensPreviousFieldsTransfer(meta: any, tx: any): void;
@@ -4,6 +4,7 @@ exports.normalizeMPTokensPreviousFields = normalizeMPTokensPreviousFields;
4
4
  exports.normalizeMPTokensPreviousFieldsEscrowCreate = normalizeMPTokensPreviousFieldsEscrowCreate;
5
5
  exports.normalizeMPTokensPreviousFieldsEscrowFinish = normalizeMPTokensPreviousFieldsEscrowFinish;
6
6
  exports.normalizeMPTokensPreviousFieldsEscrowCancel = normalizeMPTokensPreviousFieldsEscrowCancel;
7
+ exports.normalizeMPTokensPreviousFieldsConfidentialMPTConvert = normalizeMPTokensPreviousFieldsConfidentialMPTConvert;
7
8
  exports.normalizeMPTokensPreviousFieldsTransfer = normalizeMPTokensPreviousFieldsTransfer;
8
9
  const TRANSFER_TRANSACTION_TYPES = ["Payment", "CheckCash", "EscrowFinish", "Clawback", "AMMClawback"];
9
10
  function normalizeMPTokensPreviousFields(meta, tx) {
@@ -19,6 +20,9 @@ function normalizeMPTokensPreviousFields(meta, tx) {
19
20
  else if (tx.TransactionType === "EscrowCancel") {
20
21
  normalizeMPTokensPreviousFieldsEscrowCancel(meta);
21
22
  }
23
+ else if (tx.TransactionType === "ConfidentialMPTConvert") {
24
+ normalizeMPTokensPreviousFieldsConfidentialMPTConvert(meta);
25
+ }
22
26
  else if (TRANSFER_TRANSACTION_TYPES.includes(tx.TransactionType)) {
23
27
  normalizeMPTokensPreviousFieldsTransfer(meta, tx);
24
28
  }
@@ -175,6 +179,21 @@ function normalizeMPTokensPreviousFieldsEscrowCancel(meta) {
175
179
  }
176
180
  }
177
181
  }
182
+ function normalizeMPTokensPreviousFieldsConfidentialMPTConvert(meta) {
183
+ const confidentialMPTConvertNode = meta.AffectedNodes.find((node) => {
184
+ const modifiedNode = node.ModifiedNode;
185
+ return modifiedNode && modifiedNode.LedgerEntryType === "MPTokenIssuance";
186
+ });
187
+ if (!confidentialMPTConvertNode) {
188
+ return;
189
+ }
190
+ const prevFields = confidentialMPTConvertNode.ModifiedNode.PreviousFields;
191
+ if (prevFields && prevFields.ConfidentialOutstandingAmount === undefined) {
192
+ if (prevFields.ConfidentialOutstandingAmount === undefined) {
193
+ prevFields.ConfidentialOutstandingAmount = "0";
194
+ }
195
+ }
196
+ }
178
197
  function normalizeMPTokensPreviousFieldsTransfer(meta, tx) {
179
198
  if (tx.Destination === undefined) {
180
199
  return;
@@ -16,6 +16,8 @@ export interface BalanceChanges {
16
16
  interface ParseBalanceChangesOptions {
17
17
  adjustBalancesForNativeEscrow?: boolean;
18
18
  adjustBalancesForPaymentChannel?: boolean;
19
+ adjustBalancesForConfidentialMPTConvert?: boolean;
20
+ adjustBalancesForSponsorship?: boolean;
19
21
  }
20
22
  declare function parseBalanceChanges(metadata: TransactionMetadata, nativeCurrency?: string, tx?: any, options?: ParseBalanceChangesOptions): BalanceChanges;
21
23
  declare function parseFinalBalances(metadata: TransactionMetadata, nativeCurrency?: string): BalanceChanges;
@@ -14,8 +14,10 @@ const mptoken_1 = require("../../models/mptoken");
14
14
  const mptoken_normalize_1 = require("../mptoken_normalize");
15
15
  const amount_1 = __importDefault(require("../ledger/amount"));
16
16
  const channel_changes_1 = require("./channel_changes");
17
+ const sponsorship_changes_1 = require("./sponsorship_changes");
17
18
  const ESCROW_TYPES = ["EscrowFinish", "EscrowCreate", "EscrowCancel"];
18
19
  const PAYMENT_CHANNEL_TYPES = ["PaymentChannelClaim", "PaymentChannelCreate", "PaymentChannelFund"];
20
+ const CONFIDENTIAL_MPT_CONVERT_TYPES = ["ConfidentialMPTConvert"];
19
21
  function groupByAddress(balanceChanges) {
20
22
  const grouped = lodash_1.default.groupBy(balanceChanges, function (node) {
21
23
  return node.address;
@@ -297,6 +299,93 @@ function adjustBalancesForPaymentChannel(balanceChanges, metadata, nativeCurrenc
297
299
  }
298
300
  }
299
301
  }
302
+ function adjustBalancesForConfidentialMPTConvert(balanceChanges, tx) {
303
+ if (tx.TransactionType !== "ConfidentialMPTConvert") {
304
+ return;
305
+ }
306
+ const amount = tx.MPTAmount;
307
+ const mptIssuanceID = tx.MPTokenIssuanceID;
308
+ if (!amount || !mptIssuanceID) {
309
+ return;
310
+ }
311
+ const holder = tx.Account;
312
+ if (!holder) {
313
+ return;
314
+ }
315
+ const holderChanges = balanceChanges[holder];
316
+ if (!holderChanges) {
317
+ return;
318
+ }
319
+ const holderChange = holderChanges.find((c) => c.mpt_issuance_id === mptIssuanceID);
320
+ if (!holderChange) {
321
+ return;
322
+ }
323
+ adjustBalancesChanges(balanceChanges, holder, [{ value: `${amount}`, mpt_issuance_id: mptIssuanceID }]);
324
+ }
325
+ function adjustBalancesForConfidentialMPTClawback(balanceChanges, tx) {
326
+ const amount = tx.MPTAmount;
327
+ const mptIssuanceID = tx.MPTokenIssuanceID;
328
+ if (!amount || !mptIssuanceID) {
329
+ return;
330
+ }
331
+ const issuer = tx.Account;
332
+ const holder = tx.Holder;
333
+ if (!issuer || !holder) {
334
+ return;
335
+ }
336
+ const issuerChanges = balanceChanges[issuer];
337
+ if (!issuerChanges) {
338
+ return;
339
+ }
340
+ const issuerChange = issuerChanges.find((c) => c.mpt_issuance_id === mptIssuanceID);
341
+ if (!issuerChange) {
342
+ return;
343
+ }
344
+ adjustBalancesChanges(balanceChanges, holder, [{ value: `-${amount}`, mpt_issuance_id: mptIssuanceID }]);
345
+ }
346
+ function adjustBalancesForSponsorship(balanceChanges, metadata, nativeCurrency, tx) {
347
+ const sponsorshipChanges = (0, sponsorship_changes_1.parseSponsorshipChanges)(metadata);
348
+ if (!sponsorshipChanges) {
349
+ return;
350
+ }
351
+ const owner = sponsorshipChanges.owner?.address;
352
+ const sponsee = sponsorshipChanges.sponsee?.address;
353
+ if (!owner || !sponsee) {
354
+ return;
355
+ }
356
+ if (sponsorshipChanges.status === "created") {
357
+ adjustBalancesChanges(balanceChanges, owner, [
358
+ { currency: sponsorshipChanges.feeAmount.currency, value: `${sponsorshipChanges.feeAmount.value}` },
359
+ ]);
360
+ }
361
+ else if (sponsorshipChanges.status === "modified") {
362
+ if (tx.Account === owner) {
363
+ if (sponsorshipChanges.feeAmountChange) {
364
+ adjustBalancesChanges(balanceChanges, owner, [
365
+ {
366
+ currency: sponsorshipChanges.feeAmountChange.currency,
367
+ value: `${sponsorshipChanges.feeAmountChange.value}`,
368
+ },
369
+ ]);
370
+ }
371
+ }
372
+ else {
373
+ if (sponsorshipChanges.feeAmountChange) {
374
+ adjustBalancesChanges(balanceChanges, owner, [
375
+ {
376
+ currency: sponsorshipChanges.feeAmountChange.currency,
377
+ value: sponsorshipChanges.feeAmountChange.value,
378
+ },
379
+ ]);
380
+ }
381
+ }
382
+ }
383
+ else if (sponsorshipChanges.status === "deleted") {
384
+ adjustBalancesChanges(balanceChanges, owner, [
385
+ { currency: sponsorshipChanges.feeAmount.currency, value: `-${sponsorshipChanges.feeAmount.value}` },
386
+ ]);
387
+ }
388
+ }
300
389
  function adjustBalancesChanges(balanceChanges, address, changes) {
301
390
  const existingChanges = balanceChanges[address] || [];
302
391
  const change = existingChanges.find((c) => c.currency === changes[0].currency && c.issuer === changes[0].issuer);
@@ -325,12 +414,24 @@ function parseBalanceChanges(metadata, nativeCurrency, tx, options) {
325
414
  (0, mptoken_normalize_1.normalizeMPTokensPreviousFields)(metadata, tx);
326
415
  }
327
416
  const balanceChanges = parseQuantities(metadata, computeBalanceChange, nativeCurrency);
328
- if (tx && tx.TransactionType && options) {
329
- if (options.adjustBalancesForNativeEscrow && ESCROW_TYPES.includes(tx.TransactionType)) {
330
- adjustBalancesForNativeEscrow(balanceChanges, metadata, nativeCurrency, tx);
417
+ if (tx && tx.TransactionType) {
418
+ if (options) {
419
+ if (options.adjustBalancesForNativeEscrow && ESCROW_TYPES.includes(tx.TransactionType)) {
420
+ adjustBalancesForNativeEscrow(balanceChanges, metadata, nativeCurrency, tx);
421
+ }
422
+ else if (options.adjustBalancesForPaymentChannel && PAYMENT_CHANNEL_TYPES.includes(tx.TransactionType)) {
423
+ adjustBalancesForPaymentChannel(balanceChanges, metadata, nativeCurrency, tx);
424
+ }
425
+ else if (options.adjustBalancesForConfidentialMPTConvert &&
426
+ CONFIDENTIAL_MPT_CONVERT_TYPES.includes(tx.TransactionType)) {
427
+ adjustBalancesForConfidentialMPTConvert(balanceChanges, tx);
428
+ }
429
+ if (options.adjustBalancesForSponsorship && nativeCurrency === common_1.MAINNET_NATIVE_CURRENCY) {
430
+ adjustBalancesForSponsorship(balanceChanges, metadata, nativeCurrency, tx);
431
+ }
331
432
  }
332
- else if (options.adjustBalancesForPaymentChannel && PAYMENT_CHANNEL_TYPES.includes(tx.TransactionType)) {
333
- adjustBalancesForPaymentChannel(balanceChanges, metadata, nativeCurrency, tx);
433
+ if (tx.TransactionType === "ConfidentialMPTClawback") {
434
+ adjustBalancesForConfidentialMPTClawback(balanceChanges, tx);
334
435
  }
335
436
  }
336
437
  return balanceChanges;
@@ -20,6 +20,7 @@ export { parseMPTokenIssuanceChanges } from "./mptoken_issuance_changes";
20
20
  export { parseMPTokenChanges } from "./mptoken_changes";
21
21
  export { parseCredentialChanges } from "./credential_changes";
22
22
  export { parseDelegateChanges } from "./delegate_changes";
23
+ export { parseSponsorshipChanges } from "./sponsorship_changes";
23
24
  export { parseRemarksChanges } from "./remarks_changes";
24
25
  export { parseAmendmentChanges } from "./amendment_changes";
25
26
  export { parseCronChanges } from "./cron_changes";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseAccountSettingChanges = exports.parseCronChanges = exports.parseAmendmentChanges = exports.parseRemarksChanges = exports.parseDelegateChanges = exports.parseCredentialChanges = exports.parseMPTokenChanges = exports.parseMPTokenIssuanceChanges = exports.parseDeliveredAmount = exports.parseOracleChanges = exports.parseDIDChanges = exports.parseAmmChanges = exports.parseUNLReportChanges = exports.parseEscrowChanges = exports.parseEmittedTxns = exports.parseHooksExecutions = exports.parseOrderbookChanges = exports.parseCheckChanges = exports.parseChannelChanges = exports.parseLockedBalanceChanges = exports.parseBalanceChanges = exports.parseURITokenSellOfferChanges = exports.parseURITokenChanges = exports.parseNFTokenOfferChanges = exports.parseNFTokenChanges = exports.parseAffectedObjects = void 0;
3
+ exports.parseAccountSettingChanges = exports.parseCronChanges = exports.parseAmendmentChanges = exports.parseRemarksChanges = exports.parseSponsorshipChanges = exports.parseDelegateChanges = exports.parseCredentialChanges = exports.parseMPTokenChanges = exports.parseMPTokenIssuanceChanges = exports.parseDeliveredAmount = exports.parseOracleChanges = exports.parseDIDChanges = exports.parseAmmChanges = exports.parseUNLReportChanges = exports.parseEscrowChanges = exports.parseEmittedTxns = exports.parseHooksExecutions = exports.parseOrderbookChanges = exports.parseCheckChanges = exports.parseChannelChanges = exports.parseLockedBalanceChanges = exports.parseBalanceChanges = exports.parseURITokenSellOfferChanges = exports.parseURITokenChanges = exports.parseNFTokenOfferChanges = exports.parseNFTokenChanges = exports.parseAffectedObjects = void 0;
4
4
  var affected_objects_1 = require("./affected_objects");
5
5
  Object.defineProperty(exports, "parseAffectedObjects", { enumerable: true, get: function () { return affected_objects_1.parseAffectedObjects; } });
6
6
  var nftoken_changes_1 = require("./nftoken_changes");
@@ -45,6 +45,8 @@ var credential_changes_1 = require("./credential_changes");
45
45
  Object.defineProperty(exports, "parseCredentialChanges", { enumerable: true, get: function () { return credential_changes_1.parseCredentialChanges; } });
46
46
  var delegate_changes_1 = require("./delegate_changes");
47
47
  Object.defineProperty(exports, "parseDelegateChanges", { enumerable: true, get: function () { return delegate_changes_1.parseDelegateChanges; } });
48
+ var sponsorship_changes_1 = require("./sponsorship_changes");
49
+ Object.defineProperty(exports, "parseSponsorshipChanges", { enumerable: true, get: function () { return sponsorship_changes_1.parseSponsorshipChanges; } });
48
50
  var remarks_changes_1 = require("./remarks_changes");
49
51
  Object.defineProperty(exports, "parseRemarksChanges", { enumerable: true, get: function () { return remarks_changes_1.parseRemarksChanges; } });
50
52
  var amendment_changes_1 = require("./amendment_changes");
@@ -51,6 +51,9 @@ class MPTokenChanges {
51
51
  account,
52
52
  amount: node.NewFields.MPTAmount || "0",
53
53
  lockedAmount: node.NewFields.LockedAmount,
54
+ confidentialBalanceVersion: node.NewFields.ConfidentialBalanceVersion,
55
+ confidentialBalanceInbox: node.NewFields.ConfidentialBalanceInbox,
56
+ confidentialBalanceSpending: node.NewFields.ConfidentialBalanceSpending,
54
57
  });
55
58
  }
56
59
  if (affectedNode.ModifiedNode) {
@@ -90,6 +93,9 @@ class MPTokenChanges {
90
93
  account,
91
94
  amount: node.FinalFields.MPTAmount || "0",
92
95
  lockedAmount: node.FinalFields.LockedAmount,
96
+ confidentialBalanceVersion: node.FinalFields.ConfidentialBalanceVersion,
97
+ confidentialBalanceInbox: node.FinalFields.ConfidentialBalanceInbox,
98
+ confidentialBalanceSpending: node.FinalFields.ConfidentialBalanceSpending,
93
99
  amountChange,
94
100
  lockedAmountChange,
95
101
  flagsChange,
@@ -105,6 +111,8 @@ class MPTokenChanges {
105
111
  account,
106
112
  amount: node.FinalFields.MPTAmount,
107
113
  lockedAmount: node.FinalFields.LockedAmount,
114
+ confidentialBalanceInbox: node.FinalFields.ConfidentialBalanceInbox,
115
+ confidentialBalanceSpending: node.FinalFields.ConfidentialBalanceSpending,
108
116
  });
109
117
  }
110
118
  }
@@ -50,6 +50,7 @@ class MPTokenIssuanceChanges {
50
50
  transferFee: node.NewFields.TransferFee,
51
51
  maximumAmount: node.NewFields.MaximumAmount,
52
52
  outstandingAmount: node.NewFields.OutstandingAmount,
53
+ confidentialOutstandingAmount: node.NewFields.ConfidentialOutstandingAmount,
53
54
  lockedAmount: node.NewFields.LockedAmount,
54
55
  metadata: node.NewFields.Metadata,
55
56
  scale: node.NewFields.AssetScale,
@@ -57,9 +58,21 @@ class MPTokenIssuanceChanges {
57
58
  }
58
59
  if (affectedNode.ModifiedNode) {
59
60
  const mptIssuanceID = (0, mptoken_1.buildMPTokenIssuanceID)(node.FinalFields.Sequence, node.FinalFields.Issuer);
60
- let outstandingAmountChange = new bignumber_js_1.default(node.FinalFields.OutstandingAmount ?? 0)
61
- .minus(node.PreviousFields.OutstandingAmount ?? 0)
62
- .toString();
61
+ let confidentialOutstandingAmountChange;
62
+ let outstandingAmountChange;
63
+ if (node.PreviousFields.hasOwnProperty("ConfidentialOutstandingAmount")) {
64
+ confidentialOutstandingAmountChange = new bignumber_js_1.default(node.FinalFields.ConfidentialOutstandingAmount ?? 0)
65
+ .minus(node.PreviousFields.ConfidentialOutstandingAmount ?? 0)
66
+ .toString();
67
+ }
68
+ else {
69
+ outstandingAmountChange = new bignumber_js_1.default(node.FinalFields.OutstandingAmount ?? 0)
70
+ .minus(node.PreviousFields.OutstandingAmount ?? 0)
71
+ .toString();
72
+ }
73
+ if (confidentialOutstandingAmountChange === "0") {
74
+ confidentialOutstandingAmountChange = undefined;
75
+ }
63
76
  if (outstandingAmountChange === "0") {
64
77
  outstandingAmountChange = undefined;
65
78
  }
@@ -89,10 +102,12 @@ class MPTokenIssuanceChanges {
89
102
  transferFee: node.FinalFields.TransferFee,
90
103
  maximumAmount: node.FinalFields.MaximumAmount,
91
104
  outstandingAmount: node.FinalFields.OutstandingAmount,
105
+ confidentialOutstandingAmount: node.FinalFields.ConfidentialOutstandingAmount,
92
106
  lockedAmount,
93
107
  metadata: node.FinalFields.Metadata,
94
108
  scale: node.FinalFields.AssetScale,
95
109
  outstandingAmountChange,
110
+ confidentialOutstandingAmountChange,
96
111
  lockedAmountChange,
97
112
  flagsChange,
98
113
  });
@@ -108,6 +123,7 @@ class MPTokenIssuanceChanges {
108
123
  transferFee: node.FinalFields.TransferFee,
109
124
  maximumAmount: node.FinalFields.MaximumAmount,
110
125
  outstandingAmount: node.FinalFields.OutstandingAmount,
126
+ confidentialOutstandingAmount: node.FinalFields.ConfidentialOutstandingAmount,
111
127
  lockedAmount: node.FinalFields.LockedAmount,
112
128
  metadata: node.FinalFields.Metadata,
113
129
  scale: node.FinalFields.AssetScale,
@@ -0,0 +1,17 @@
1
+ import { TransactionMetadata } from "xrpl";
2
+ import { FormattedSourceAddress, FormattedDestinationAddress } from "../../types/account";
3
+ import { IssuedCurrencyAmount } from "../../types/amounts";
4
+ interface FormattedSponsorshipSummaryInterface {
5
+ status?: "created" | "modified" | "deleted";
6
+ sponsorshipID: string;
7
+ owner?: FormattedSourceAddress;
8
+ sponsee?: FormattedDestinationAddress;
9
+ feeAmountDrops: string;
10
+ feeAmount: IssuedCurrencyAmount;
11
+ feeAmountChangeDrops?: string;
12
+ feeAmountChange?: IssuedCurrencyAmount;
13
+ previousTxnLgrSeq?: number;
14
+ previousTxnID?: string;
15
+ }
16
+ declare function parseSponsorshipChanges(metadata: TransactionMetadata): FormattedSponsorshipSummaryInterface | undefined;
17
+ export { parseSponsorshipChanges };
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.parseSponsorshipChanges = parseSponsorshipChanges;
7
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
8
+ const amount_1 = __importDefault(require("../ledger/amount"));
9
+ const utils_1 = require("../utils");
10
+ function parseSponsorshipStatus(node) {
11
+ if (node.diffType === "CreatedNode") {
12
+ return "created";
13
+ }
14
+ if (node.diffType === "ModifiedNode") {
15
+ return "modified";
16
+ }
17
+ if (node.diffType === "DeletedNode") {
18
+ return "deleted";
19
+ }
20
+ return undefined;
21
+ }
22
+ function summarizeSponsorship(node) {
23
+ const final = node.diffType === "CreatedNode" ? node.newFields : node.finalFields;
24
+ const prev = node.previousFields;
25
+ const summary = {
26
+ status: parseSponsorshipStatus(node),
27
+ sponsorshipID: node.ledgerIndex,
28
+ owner: { address: final.Owner },
29
+ sponsee: { address: final.Sponsee },
30
+ feeAmountDrops: new bignumber_js_1.default(final.FeeAmount || 0).toString(10),
31
+ feeAmount: (0, amount_1.default)(final.FeeAmount),
32
+ };
33
+ if (prev.FeeAmount) {
34
+ summary.feeAmountChangeDrops = new bignumber_js_1.default(final.FeeAmount || 0)
35
+ .minus(new bignumber_js_1.default(prev.FeeAmount || 0))
36
+ .toString(10);
37
+ summary.feeAmountChange = (0, amount_1.default)(prev.FeeAmount);
38
+ summary.feeAmountChange.value = new bignumber_js_1.default(summary.feeAmount.value)
39
+ .minus(new bignumber_js_1.default(summary.feeAmountChange.value))
40
+ .toString(10);
41
+ }
42
+ if (node.PreviousTxnID) {
43
+ summary.previousTxnID = node.PreviousTxnID;
44
+ }
45
+ if (node.PreviousTxnLgrSeq) {
46
+ summary.previousTxnLgrSeq = node.PreviousTxnLgrSeq;
47
+ }
48
+ return summary;
49
+ }
50
+ function parseSponsorshipChanges(metadata) {
51
+ if (!metadata || !metadata.AffectedNodes) {
52
+ return undefined;
53
+ }
54
+ const affectedNodes = metadata.AffectedNodes.filter((affectedNode) => {
55
+ const node = affectedNode.CreatedNode || affectedNode.ModifiedNode || affectedNode.DeletedNode;
56
+ return node.LedgerEntryType === "Sponsorship";
57
+ });
58
+ if (affectedNodes.length !== 1) {
59
+ return undefined;
60
+ }
61
+ const normalizedNode = (0, utils_1.normalizeNode)(affectedNodes[0]);
62
+ return summarizeSponsorship(normalizedNode);
63
+ }
@@ -33,6 +33,8 @@ const MPTOKEN_TYPES = [
33
33
  "MPTokenAuthorize",
34
34
  "MPTokenIssuanceSet",
35
35
  "MPTokenIssuanceDestroy",
36
+ "ConfidentialMPTConvert",
37
+ "ConfidentialMPTClawback",
36
38
  "Payment",
37
39
  "Clawback",
38
40
  "EscrowFinish",
@@ -75,6 +77,7 @@ function parseOutcome(tx, nativeCurrency, definitions) {
75
77
  mptokenChanges: getMPTokenChanges(tx, nativeCurrency || (0, client_1.getNativeCurrency)()),
76
78
  credentialChanges: getCredentialChanges(tx, nativeCurrency || (0, client_1.getNativeCurrency)()),
77
79
  delegateChanges: getDelegateChanges(tx, nativeCurrency || (0, client_1.getNativeCurrency)()),
80
+ sponsorshipChanges: getSponsorshipChanges(tx, nativeCurrency || (0, client_1.getNativeCurrency)()),
78
81
  remarksChanges: getRemarksChanges(tx, nativeCurrency || (0, client_1.getNativeCurrency)()),
79
82
  cronChanges: getCronChanges(tx, nativeCurrency || (0, client_1.getNativeCurrency)()),
80
83
  unlReportChanges: getUNLReportChanges(tx, nativeCurrency || (0, client_1.getNativeCurrency)()),
@@ -244,6 +247,12 @@ function getDelegateChanges(tx, nativeCurrency) {
244
247
  }
245
248
  return (0, index_1.parseDelegateChanges)(tx.meta);
246
249
  }
250
+ function getSponsorshipChanges(tx, nativeCurrency) {
251
+ if (nativeCurrency !== common_1.MAINNET_NATIVE_CURRENCY) {
252
+ return undefined;
253
+ }
254
+ return (0, index_1.parseSponsorshipChanges)(tx.meta);
255
+ }
247
256
  function getRemarksChanges(tx, nativeCurrency) {
248
257
  if (nativeCurrency !== common_1.XAHAU_NATIVE_CURRENCY) {
249
258
  return undefined;
@@ -0,0 +1,3 @@
1
+ import { FormattedConfidentialMPTClawbackSpecification } from "../../types/mptokens";
2
+ declare function parseConfidentialMPTClawback(tx: any, nativeCurrency?: string): FormattedConfidentialMPTClawbackSpecification;
3
+ export default parseConfidentialMPTClawback;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
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
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ const assert = __importStar(require("assert"));
37
+ const common_1 = require("../../common");
38
+ const tx_global_flags_1 = require("../ledger/tx-global-flags");
39
+ const memos_1 = require("../ledger/memos");
40
+ const signers_1 = require("../ledger/signers");
41
+ const regular_key_1 = require("../ledger/regular-key");
42
+ const delegate_1 = require("../ledger/delegate");
43
+ const source_1 = require("../ledger/source");
44
+ function parseConfidentialMPTClawback(tx, nativeCurrency) {
45
+ assert.ok(tx.TransactionType === "ConfidentialMPTClawback");
46
+ return (0, common_1.removeUndefined)({
47
+ signers: (0, signers_1.parseSigners)(tx),
48
+ signer: (0, regular_key_1.parseSignerRegularKey)(tx),
49
+ delegate: (0, delegate_1.parseDelegate)(tx),
50
+ source: (0, source_1.parseSource)(tx),
51
+ holder: tx.Holder,
52
+ amount: {
53
+ value: tx.MPTAmount,
54
+ mpt_issuance_id: tx.MPTokenIssuanceID,
55
+ },
56
+ zkProof: tx.ZKProof,
57
+ flags: (0, common_1.emptyObjectToUndefined)((0, tx_global_flags_1.parseTxGlobalFlags)(tx.Flags, { nativeCurrency })),
58
+ memos: (0, memos_1.parseMemos)(tx),
59
+ });
60
+ }
61
+ exports.default = parseConfidentialMPTClawback;
@@ -0,0 +1,3 @@
1
+ import { FormattedConfidentialMPTConvertSpecification } from "../../types/mptokens";
2
+ declare function parseConfidentialMPTConvert(tx: any, nativeCurrency?: string): FormattedConfidentialMPTConvertSpecification;
3
+ export default parseConfidentialMPTConvert;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
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
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ const assert = __importStar(require("assert"));
37
+ const common_1 = require("../../common");
38
+ const tx_global_flags_1 = require("../ledger/tx-global-flags");
39
+ const memos_1 = require("../ledger/memos");
40
+ const signers_1 = require("../ledger/signers");
41
+ const regular_key_1 = require("../ledger/regular-key");
42
+ const delegate_1 = require("../ledger/delegate");
43
+ const source_1 = require("../ledger/source");
44
+ function parseConfidentialMPTConvert(tx, nativeCurrency) {
45
+ assert.ok(tx.TransactionType === "ConfidentialMPTConvert");
46
+ return (0, common_1.removeUndefined)({
47
+ signers: (0, signers_1.parseSigners)(tx),
48
+ signer: (0, regular_key_1.parseSignerRegularKey)(tx),
49
+ delegate: (0, delegate_1.parseDelegate)(tx),
50
+ source: (0, source_1.parseSource)(tx),
51
+ holderEncryptedAmount: tx.HolderEncryptedAmount,
52
+ holderEncryptionKey: tx.HolderEncryptionKey,
53
+ issuerEncryptedAmount: tx.IssuerEncryptedAmount,
54
+ amount: {
55
+ value: tx.MPTAmount,
56
+ mpt_issuance_id: tx.MPTokenIssuanceID,
57
+ },
58
+ zkProof: tx.ZKProof,
59
+ flags: (0, common_1.emptyObjectToUndefined)((0, tx_global_flags_1.parseTxGlobalFlags)(tx.Flags, { nativeCurrency })),
60
+ memos: (0, memos_1.parseMemos)(tx),
61
+ });
62
+ }
63
+ exports.default = parseConfidentialMPTConvert;
@@ -0,0 +1,3 @@
1
+ import { FormattedSponsorshipSetSpecification } from "../../types/sponsorship";
2
+ declare function parseSponsorshipSet(tx: any, nativeCurrency?: string): FormattedSponsorshipSetSpecification;
3
+ export default parseSponsorshipSet;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
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
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ const assert = __importStar(require("assert"));
40
+ const common_1 = require("../../common");
41
+ const amount_1 = __importDefault(require("../ledger/amount"));
42
+ const emit_details_1 = require("../ledger/emit_details");
43
+ const tx_sponsorship_set_flags_1 = __importDefault(require("../ledger/tx-sponsorship-set-flags"));
44
+ const memos_1 = require("../ledger/memos");
45
+ const signers_1 = require("../ledger/signers");
46
+ const regular_key_1 = require("../ledger/regular-key");
47
+ const delegate_1 = require("../ledger/delegate");
48
+ const source_1 = require("../ledger/source");
49
+ const destination_1 = require("../ledger/destination");
50
+ function parseSponsorshipSet(tx, nativeCurrency) {
51
+ assert.ok(tx.TransactionType === "SponsorshipSet");
52
+ return (0, common_1.removeUndefined)({
53
+ signers: (0, signers_1.parseSigners)(tx),
54
+ signer: (0, regular_key_1.parseSignerRegularKey)(tx),
55
+ delegate: (0, delegate_1.parseDelegate)(tx),
56
+ source: (0, source_1.parseSource)(tx),
57
+ counterpartySponsor: (0, destination_1.parseAddress)(tx, "CounterpartySponsor"),
58
+ feeAmountDelta: (0, amount_1.default)(tx.FeeAmountDelta),
59
+ maxFee: (0, amount_1.default)(tx.MaxFee),
60
+ remainingOwnerCountDelta: tx.RemainingOwnerCountDelta,
61
+ sponsee: (0, destination_1.parseAddress)(tx, "Sponsee"),
62
+ emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
63
+ flags: (0, tx_sponsorship_set_flags_1.default)(tx.Flags, { nativeCurrency }),
64
+ memos: (0, memos_1.parseMemos)(tx),
65
+ });
66
+ }
67
+ exports.default = parseSponsorshipSet;
@@ -77,6 +77,8 @@ import parseMPTokenIssuanceCreate from "./specification/mptoken-issuance-create"
77
77
  import parseMPTokenAuthorize from "./specification/mptoken-authorize";
78
78
  import parseMPTokenIssuanceSet from "./specification/mptoken-issuance-set";
79
79
  import parseMPTokenIssuanceDestroy from "./specification/mptoken-issuance-destroy";
80
+ import parseConfidentialMPTConvert from "./specification/confidential-mpt-convert";
81
+ import parseConfidentialMPTClawback from "./specification/confidential-mpt-clawback";
80
82
  import parseDelegateSet from "./specification/delegate-set";
81
83
  import parseSetRemarks from "./specification/set-remarks";
82
84
  import parseCredentialCreate from "./specification/credential-create";
@@ -87,6 +89,7 @@ import parseGenesisMint from "./specification/genesis-mint";
87
89
  import parseBatch from "./specification/batch";
88
90
  import parseCron from "./specification/cron";
89
91
  import parseCronSet from "./specification/cron-set";
92
+ import parseSponsorshipSet from "./specification/sponsorship-set";
90
93
  import parseAmendment from "./specification/amendment";
91
94
  import parseFeeUpdate from "./specification/fee-update";
92
95
  import parseUNLModify from "./specification/unl-modify";
@@ -140,6 +143,8 @@ export declare const parserTypeFunc: {
140
143
  MPTokenAuthorize: typeof parseMPTokenAuthorize;
141
144
  MPTokenIssuanceSet: typeof parseMPTokenIssuanceSet;
142
145
  MPTokenIssuanceDestroy: typeof parseMPTokenIssuanceDestroy;
146
+ ConfidentialMPTConvert: typeof parseConfidentialMPTConvert;
147
+ ConfidentialMPTClawback: typeof parseConfidentialMPTClawback;
143
148
  CredentialCreate: typeof parseCredentialCreate;
144
149
  CredentialAccept: typeof parseCredentialAccept;
145
150
  CredentialDelete: typeof parseCredentialDelete;
@@ -150,6 +155,7 @@ export declare const parserTypeFunc: {
150
155
  Batch: typeof parseBatch;
151
156
  Cron: typeof parseCron;
152
157
  CronSet: typeof parseCronSet;
158
+ SponsorshipSet: typeof parseSponsorshipSet;
153
159
  amendment: typeof parseAmendment;
154
160
  feeUpdate: typeof parseFeeUpdate;
155
161
  UNLModify: typeof parseUNLModify;
@@ -58,6 +58,8 @@ const mptoken_issuance_create_1 = __importDefault(require("./specification/mptok
58
58
  const mptoken_authorize_1 = __importDefault(require("./specification/mptoken-authorize"));
59
59
  const mptoken_issuance_set_1 = __importDefault(require("./specification/mptoken-issuance-set"));
60
60
  const mptoken_issuance_destroy_1 = __importDefault(require("./specification/mptoken-issuance-destroy"));
61
+ const confidential_mpt_convert_1 = __importDefault(require("./specification/confidential-mpt-convert"));
62
+ const confidential_mpt_clawback_1 = __importDefault(require("./specification/confidential-mpt-clawback"));
61
63
  const delegate_set_1 = __importDefault(require("./specification/delegate-set"));
62
64
  const set_remarks_1 = __importDefault(require("./specification/set-remarks"));
63
65
  const credential_create_1 = __importDefault(require("./specification/credential-create"));
@@ -68,6 +70,7 @@ const genesis_mint_1 = __importDefault(require("./specification/genesis-mint"));
68
70
  const batch_1 = __importDefault(require("./specification/batch"));
69
71
  const cron_1 = __importDefault(require("./specification/cron"));
70
72
  const cron_set_1 = __importDefault(require("./specification/cron-set"));
73
+ const sponsorship_set_1 = __importDefault(require("./specification/sponsorship-set"));
71
74
  const amendment_1 = __importDefault(require("./specification/amendment"));
72
75
  const fee_update_1 = __importDefault(require("./specification/fee-update"));
73
76
  const unl_modify_1 = __importDefault(require("./specification/unl-modify"));
@@ -122,6 +125,8 @@ const transactionTypeToType = {
122
125
  MPTokenAuthorize: "MPTokenAuthorize",
123
126
  MPTokenIssuanceSet: "MPTokenIssuanceSet",
124
127
  MPTokenIssuanceDestroy: "MPTokenIssuanceDestroy",
128
+ ConfidentialMPTConvert: "ConfidentialMPTConvert",
129
+ ConfidentialMPTClawback: "ConfidentialMPTClawback",
125
130
  CredentialCreate: "CredentialCreate",
126
131
  CredentialAccept: "CredentialAccept",
127
132
  CredentialDelete: "CredentialDelete",
@@ -132,6 +137,7 @@ const transactionTypeToType = {
132
137
  Batch: "Batch",
133
138
  Cron: "Cron",
134
139
  CronSet: "CronSet",
140
+ SponsorshipSet: "SponsorshipSet",
135
141
  EnableAmendment: "amendment",
136
142
  SetFee: "feeUpdate",
137
143
  UNLModify: "UNLModify",
@@ -188,6 +194,8 @@ exports.parserTypeFunc = {
188
194
  MPTokenAuthorize: mptoken_authorize_1.default,
189
195
  MPTokenIssuanceSet: mptoken_issuance_set_1.default,
190
196
  MPTokenIssuanceDestroy: mptoken_issuance_destroy_1.default,
197
+ ConfidentialMPTConvert: confidential_mpt_convert_1.default,
198
+ ConfidentialMPTClawback: confidential_mpt_clawback_1.default,
191
199
  CredentialCreate: credential_create_1.default,
192
200
  CredentialAccept: credential_accept_1.default,
193
201
  CredentialDelete: credential_delete_1.default,
@@ -198,6 +206,7 @@ exports.parserTypeFunc = {
198
206
  Batch: batch_1.default,
199
207
  Cron: cron_1.default,
200
208
  CronSet: cron_set_1.default,
209
+ SponsorshipSet: sponsorship_set_1.default,
201
210
  amendment: amendment_1.default,
202
211
  feeUpdate: fee_update_1.default,
203
212
  UNLModify: unl_modify_1.default,
@@ -1,6 +1,7 @@
1
1
  import { MPTokenIssuanceCreateFlags, MPTokenIssuanceSetFlags, MPTokenAuthorizeFlags } from "xrpl";
2
2
  import { FormattedBaseSpecification } from "./specification";
3
3
  import { TxGlobalFlagsKeysInterface } from "./global";
4
+ import { Amount } from "./amounts";
4
5
  export declare const MPTokenIssuanceFlagsKeys: {
5
6
  locked: number;
6
7
  canLock: MPTokenIssuanceCreateFlags;
@@ -74,6 +75,18 @@ export type FormattedMPTokenIssuanceSetSpecification = {
74
75
  holder?: string;
75
76
  mptIssuanceID?: string;
76
77
  } & FormattedBaseSpecification;
78
+ export type FormattedConfidentialMPTConvertSpecification = {
79
+ holderEncryptedAmount?: string;
80
+ holderEncryptionKey?: string;
81
+ issuerEncryptedAmount?: string;
82
+ amount?: Amount;
83
+ mptIssuanceID?: string;
84
+ zkProof?: string;
85
+ } & FormattedBaseSpecification;
86
+ export type FormattedConfidentialMPTClawbackSpecification = {
87
+ holder?: string;
88
+ zkProof?: string;
89
+ } & FormattedBaseSpecification;
77
90
  export declare const MPTokenFlagsKeys: {
78
91
  locked: number;
79
92
  authorized: number;
@@ -0,0 +1,34 @@
1
+ import { FormattedBaseSpecification } from "./specification";
2
+ import { FormattedAmount } from "./amounts";
3
+ import { FormattedDestinationAddress } from "./account";
4
+ import { TxGlobalFlagsKeysInterface } from "./global";
5
+ export declare enum SponsorshipSetFlags {
6
+ tfSponsorshipSetRequireSignForFee = 65536,
7
+ tfSponsorshipClearRequireSignForFee = 131072,
8
+ tfSponsorshipSetRequireSignForReserve = 262144,
9
+ tfSponsorshipClearRequireSignForReserve = 524288,
10
+ tfDeleteObject = 1048576
11
+ }
12
+ export declare const SponsorshipSetFlagsKeys: {
13
+ setRequireSignForFee: SponsorshipSetFlags;
14
+ clearRequireSignForFee: SponsorshipSetFlags;
15
+ setRequireSignForReserve: SponsorshipSetFlags;
16
+ clearRequireSignForReserve: SponsorshipSetFlags;
17
+ deleteObject: SponsorshipSetFlags;
18
+ };
19
+ export declare function getSponsorshipSetFlagsKeys(nativeCurrency?: string): Record<string, number>;
20
+ export interface SponsorshipSetFlagsKeysInterface extends TxGlobalFlagsKeysInterface {
21
+ setRequireSignForFee: boolean;
22
+ clearRequireSignForFee: boolean;
23
+ setRequireSignForReserve: boolean;
24
+ clearRequireSignForReserve: boolean;
25
+ deleteObject: boolean;
26
+ }
27
+ export type FormattedSponsorshipSetSpecification = {
28
+ CounterpartySponsor?: FormattedDestinationAddress;
29
+ feeAmountDelta?: FormattedAmount;
30
+ maxFee?: FormattedAmount;
31
+ remainingOwnerCountDelta?: number;
32
+ Sponsee?: FormattedDestinationAddress;
33
+ flags: SponsorshipSetFlagsKeysInterface;
34
+ } & FormattedBaseSpecification;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SponsorshipSetFlagsKeys = exports.SponsorshipSetFlags = void 0;
4
+ exports.getSponsorshipSetFlagsKeys = getSponsorshipSetFlagsKeys;
5
+ const global_1 = require("./global");
6
+ const common_1 = require("../common");
7
+ var SponsorshipSetFlags;
8
+ (function (SponsorshipSetFlags) {
9
+ SponsorshipSetFlags[SponsorshipSetFlags["tfSponsorshipSetRequireSignForFee"] = 65536] = "tfSponsorshipSetRequireSignForFee";
10
+ SponsorshipSetFlags[SponsorshipSetFlags["tfSponsorshipClearRequireSignForFee"] = 131072] = "tfSponsorshipClearRequireSignForFee";
11
+ SponsorshipSetFlags[SponsorshipSetFlags["tfSponsorshipSetRequireSignForReserve"] = 262144] = "tfSponsorshipSetRequireSignForReserve";
12
+ SponsorshipSetFlags[SponsorshipSetFlags["tfSponsorshipClearRequireSignForReserve"] = 524288] = "tfSponsorshipClearRequireSignForReserve";
13
+ SponsorshipSetFlags[SponsorshipSetFlags["tfDeleteObject"] = 1048576] = "tfDeleteObject";
14
+ })(SponsorshipSetFlags || (exports.SponsorshipSetFlags = SponsorshipSetFlags = {}));
15
+ exports.SponsorshipSetFlagsKeys = {
16
+ setRequireSignForFee: SponsorshipSetFlags.tfSponsorshipSetRequireSignForFee,
17
+ clearRequireSignForFee: SponsorshipSetFlags.tfSponsorshipClearRequireSignForFee,
18
+ setRequireSignForReserve: SponsorshipSetFlags.tfSponsorshipSetRequireSignForReserve,
19
+ clearRequireSignForReserve: SponsorshipSetFlags.tfSponsorshipClearRequireSignForReserve,
20
+ deleteObject: SponsorshipSetFlags.tfDeleteObject,
21
+ };
22
+ const nativeCurrencySponsorshipSetFlags = {};
23
+ function getSponsorshipSetFlagsKeys(nativeCurrency) {
24
+ if (!nativeCurrency) {
25
+ nativeCurrency = common_1.MAINNET_NATIVE_CURRENCY;
26
+ }
27
+ if (!nativeCurrencySponsorshipSetFlags[nativeCurrency]) {
28
+ nativeCurrencySponsorshipSetFlags[nativeCurrency] = {
29
+ ...(0, global_1.getTxGlobalFlagsKeys)(nativeCurrency),
30
+ ...exports.SponsorshipSetFlagsKeys,
31
+ };
32
+ }
33
+ return nativeCurrencySponsorshipSetFlags[nativeCurrency];
34
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bithomp/xrpl-api",
3
- "version": "3.8.3",
3
+ "version": "3.8.8",
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",
@@ -42,7 +42,7 @@
42
42
  "format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
43
43
  "lint": "eslint",
44
44
  "prepare": "npm run build",
45
- "-prepublishOnly": "npm test && npm run lint",
45
+ "prepublishOnly": "npm test && npm run lint",
46
46
  "preversion": "npm run lint",
47
47
  "version": "npm run format && git add -A src",
48
48
  "postversion": "git push && git push --tags"
@@ -52,14 +52,14 @@
52
52
  ],
53
53
  "dependencies": {
54
54
  "@noble/ed25519": "^3.1.0",
55
- "@noble/hashes": "^2.2.0",
55
+ "@noble/hashes": "^2.3.0",
56
56
  "@noble/secp256k1": "^3.1.0",
57
- "axios": "^1.18.1",
57
+ "axios": "^1.19.0",
58
58
  "base-x": "^5.0.1",
59
59
  "bignumber.js": "^11.1.5",
60
60
  "lodash": "^4.18.1",
61
61
  "ripple-address-codec": "5.0.1",
62
- "ripple-binary-codec": "2.8.0",
62
+ "ripple-binary-codec": "2.9.0",
63
63
  "ripple-keypairs": "3.0.0",
64
64
  "xrpl": "5.0.0"
65
65
  },
@@ -67,23 +67,23 @@
67
67
  "@eslint/eslintrc": "^3.3.6",
68
68
  "@types/chai": "^5.2.3",
69
69
  "@types/chai-as-promised": "^8.0.2",
70
- "@types/lodash": "^4.17.24",
70
+ "@types/lodash": "^4.17.25",
71
71
  "@types/mocha": "^10.0.10",
72
72
  "@types/nconf": "^0.10.7",
73
- "@types/node": "^25.9.5",
74
- "@typescript-eslint/eslint-plugin": "^8.64.0",
75
- "@typescript-eslint/parser": "^8.64.0",
73
+ "@types/node": "^26.2.0",
74
+ "@typescript-eslint/eslint-plugin": "^8.67.0",
75
+ "@typescript-eslint/parser": "^8.67.0",
76
76
  "chai": "^6.2.2",
77
77
  "chai-as-promised": "^8.0.2",
78
78
  "eslint": "^9.39.5",
79
79
  "eslint-config-prettier": "^10.1.8",
80
80
  "eslint-plugin-chai-friendly": "^1.2.1",
81
81
  "eslint-plugin-import": "^2.32.0",
82
- "eslint-plugin-n": "^18.2.2",
82
+ "eslint-plugin-n": "^18.3.0",
83
83
  "eslint-plugin-promise": "^7.3.0",
84
- "mocha": "^11.7.6",
84
+ "mocha": "^11.8.0",
85
85
  "nconf": "^0.13.0",
86
- "ts-jest": "^29.4.11",
86
+ "ts-jest": "^29.4.12",
87
87
  "ts-node": "^10.9.2",
88
88
  "typescript": "^6.0.3"
89
89
  }