@bithomp/xrpl-api 3.7.30 → 3.7.31

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.
@@ -68,24 +68,25 @@ function parseChangeAmount(node, type) {
68
68
  return lodash_1.default.assign({}, finalAmount, { value: value });
69
69
  }
70
70
  function parseOrderChange(node) {
71
- const flags = (0, offer_flags_1.default)(node.finalFields.Flags);
72
71
  const takerPays = parseChangeAmount(node, "TakerPays");
73
72
  const takerGets = parseChangeAmount(node, "TakerGets");
73
+ const fields = Object.keys(node.finalFields).length > 0 ? node.finalFields : node.newFields;
74
+ const flags = (0, offer_flags_1.default)(fields.Flags);
74
75
  const orderChange = (0, common_1.removeUndefined)({
75
76
  flags,
76
77
  takerGets,
77
78
  takerPays,
78
- sequence: (node.finalFields.Sequence || node.newFields.Sequence),
79
+ sequence: fields.Sequence,
79
80
  status: parseOrderStatus(node),
80
81
  makerExchangeRate: getQuality(node),
81
82
  expirationTime: getExpirationTime(node),
82
- domainID: node.finalFields.Domain,
83
+ domainID: fields.DomainID,
83
84
  direction: (node.finalFields.Flags & xrpl_1.LedgerEntry.OfferFlags.lsfSell) === 0 ? "buy" : "sell",
84
85
  quantity: flags.sell === true ? takerGets : takerPays,
85
86
  totalPrice: flags.sell === true ? takerPays : takerGets,
86
87
  });
87
88
  Object.defineProperty(orderChange, "account", {
88
- value: node.finalFields.Account || node.newFields.Account,
89
+ value: fields.Account,
89
90
  });
90
91
  return orderChange;
91
92
  }
@@ -64,6 +64,7 @@ function parseOfferCreate(tx, nativeCurrency) {
64
64
  takerGets,
65
65
  takerPays,
66
66
  expirationTime: (0, utils_1.parseTimestamp)(tx.Expiration),
67
+ domainID: tx.DomainID,
67
68
  emittedDetails: (0, emit_details_1.parseEmittedDetails)(tx),
68
69
  memos: (0, memos_1.parseMemos)(tx),
69
70
  direction: (tx.Flags & xrpl_1.OfferCreateFlags.tfSell) === 0 ? "buy" : "sell",
@@ -36,6 +36,7 @@ export type FormattedOfferCreateSpecification = {
36
36
  takerPays: IssuedCurrencyAmount;
37
37
  expirationTime?: string;
38
38
  orderToReplace?: number;
39
+ domainID?: string;
39
40
  direction: string;
40
41
  immediateOrCancel?: boolean;
41
42
  fillOrKill?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bithomp/xrpl-api",
3
- "version": "3.7.30",
3
+ "version": "3.7.31",
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",
@@ -71,8 +71,8 @@
71
71
  "@types/mocha": "^10.0.10",
72
72
  "@types/nconf": "^0.10.7",
73
73
  "@types/node": "^25.2.3",
74
- "@typescript-eslint/eslint-plugin": "^8.55.0",
75
- "@typescript-eslint/parser": "^8.55.0",
74
+ "@typescript-eslint/eslint-plugin": "^8.56.0",
75
+ "@typescript-eslint/parser": "^8.56.0",
76
76
  "chai": "^6.2.2",
77
77
  "chai-as-promised": "^8.0.2",
78
78
  "eslint": "^9.39.2",