@owney/sdk 0.3.4 → 0.3.5

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.
package/dist/index.cjs CHANGED
@@ -269,6 +269,8 @@ function mapHistory(raw, chainId) {
269
269
  }
270
270
  ];
271
271
  }
272
+ const rawAmount = entry?.positions?.[0]?.amount;
273
+ const hasAmount = typeof rawAmount === "string" && rawAmount !== "" && rawAmount !== "0x" && rawAmount !== "0x0" && rawAmount !== "0";
272
274
  return {
273
275
  agent: "zyfai",
274
276
  action: (entry.action ? actionMap[entry.action] : void 0) ?? entry.action,
@@ -280,9 +282,7 @@ function mapHistory(raw, chainId) {
280
282
  txHashes: entry.transactionHash ? [entry.transactionHash] : [],
281
283
  chainId: entry.chainId,
282
284
  tokenSymbol: entry?.positions?.[0]?.token_symbol,
283
- amount: String(
284
- hexToDecimal(entry?.positions?.[0]?.amount || "0x")
285
- )
285
+ amount: hasAmount ? String(hexToDecimal(rawAmount)) : void 0
286
286
  }
287
287
  ],
288
288
  rebalanceLog
package/dist/index.js CHANGED
@@ -239,6 +239,8 @@ function mapHistory(raw, chainId) {
239
239
  }
240
240
  ];
241
241
  }
242
+ const rawAmount = entry?.positions?.[0]?.amount;
243
+ const hasAmount = typeof rawAmount === "string" && rawAmount !== "" && rawAmount !== "0x" && rawAmount !== "0x0" && rawAmount !== "0";
242
244
  return {
243
245
  agent: "zyfai",
244
246
  action: (entry.action ? actionMap[entry.action] : void 0) ?? entry.action,
@@ -250,9 +252,7 @@ function mapHistory(raw, chainId) {
250
252
  txHashes: entry.transactionHash ? [entry.transactionHash] : [],
251
253
  chainId: entry.chainId,
252
254
  tokenSymbol: entry?.positions?.[0]?.token_symbol,
253
- amount: String(
254
- hexToDecimal(entry?.positions?.[0]?.amount || "0x")
255
- )
255
+ amount: hasAmount ? String(hexToDecimal(rawAmount)) : void 0
256
256
  }
257
257
  ],
258
258
  rebalanceLog
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owney/sdk",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",