@cityofzion/bs-ethereum 2.12.0 → 2.12.2

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.
@@ -61,7 +61,8 @@ class DoraBDSEthereum extends RpcBDSEthereum_1.RpcBDSEthereum {
61
61
  const txTemplateUrl = __classPrivateFieldGet(this, _DoraBDSEthereum_explorerService, "f").getTxTemplateUrl();
62
62
  const nftTemplateUrl = __classPrivateFieldGet(this, _DoraBDSEthereum_explorerService, "f").getNftTemplateUrl();
63
63
  const contractTemplateUrl = __classPrivateFieldGet(this, _DoraBDSEthereum_explorerService, "f").getContractTemplateUrl();
64
- const itemPromises = items.map((item) => __awaiter(this, void 0, void 0, function* () {
64
+ const itemPromises = items.map((_c) => __awaiter(this, void 0, void 0, function* () {
65
+ var { networkFeeAmount, systemFeeAmount } = _c, item = __rest(_c, ["networkFeeAmount", "systemFeeAmount"]);
65
66
  const txId = item.transactionID;
66
67
  const newItem = {
67
68
  txId,
@@ -70,18 +71,22 @@ class DoraBDSEthereum extends RpcBDSEthereum_1.RpcBDSEthereum {
70
71
  date: item.date,
71
72
  invocationCount: item.invocationCount,
72
73
  notificationCount: item.notificationCount,
73
- networkFeeAmount: (0, blockchain_service_1.formatNumber)(item.networkFeeAmount, nativeToken.decimals),
74
- systemFeeAmount: (0, blockchain_service_1.formatNumber)(item.systemFeeAmount, nativeToken.decimals),
74
+ networkFeeAmount: networkFeeAmount
75
+ ? blockchain_service_1.BSNumberHelper.formatNumber(networkFeeAmount, { decimals: nativeToken.decimals })
76
+ : undefined,
77
+ systemFeeAmount: systemFeeAmount
78
+ ? blockchain_service_1.BSNumberHelper.formatNumber(systemFeeAmount, { decimals: nativeToken.decimals })
79
+ : undefined,
75
80
  events: [],
76
81
  };
77
82
  const eventPromises = item.events.map((event) => __awaiter(this, void 0, void 0, function* () {
78
- var _c, _d, _e, _f, _g, _h;
83
+ var _d, _e, _f, _g, _h, _j;
79
84
  let nftEvent;
80
85
  let assetEvent;
81
86
  const { methodName, tokenID: tokenId, contractHash: hash } = event;
82
- const from = (_c = event.from) !== null && _c !== void 0 ? _c : undefined;
83
- const to = (_d = event.to) !== null && _d !== void 0 ? _d : undefined;
84
- const standard = (_g = (_f = (_e = event.supportedStandards) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.toLowerCase()) !== null && _g !== void 0 ? _g : '';
87
+ const from = (_d = event.from) !== null && _d !== void 0 ? _d : undefined;
88
+ const to = (_e = event.to) !== null && _e !== void 0 ? _e : undefined;
89
+ const standard = (_h = (_g = (_f = event.supportedStandards) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.toLowerCase()) !== null && _h !== void 0 ? _h : '';
85
90
  const isErc1155 = __classPrivateFieldGet(this, _DoraBDSEthereum_supportedErc1155Standards, "f").includes(standard);
86
91
  const isErc721 = __classPrivateFieldGet(this, _DoraBDSEthereum_supportedErc721Standards, "f").includes(standard);
87
92
  const isErc20 = __classPrivateFieldGet(this, _DoraBDSEthereum_supportedErc20Standards, "f").includes(standard);
@@ -94,7 +99,7 @@ class DoraBDSEthereum extends RpcBDSEthereum_1.RpcBDSEthereum {
94
99
  const nftUrl = hash ? nftTemplateUrl === null || nftTemplateUrl === void 0 ? void 0 : nftTemplateUrl.replace('{hash}', hash).replace('{tokenId}', tokenId) : undefined;
95
100
  nftEvent = {
96
101
  eventType: 'nft',
97
- amount: '0',
102
+ amount: undefined,
98
103
  methodName,
99
104
  from,
100
105
  fromUrl,
@@ -112,10 +117,12 @@ class DoraBDSEthereum extends RpcBDSEthereum_1.RpcBDSEthereum {
112
117
  }
113
118
  else {
114
119
  const [token] = yield blockchain_service_1.BSPromisesHelper.tryCatch(() => this.getTokenInfo(hash));
115
- const amount = (0, blockchain_service_1.formatNumber)(event.amount, (_h = token === null || token === void 0 ? void 0 : token.decimals) !== null && _h !== void 0 ? _h : event.tokenDecimals);
120
+ const { amount } = event;
116
121
  assetEvent = {
117
122
  eventType: 'token',
118
- amount,
123
+ amount: amount
124
+ ? blockchain_service_1.BSNumberHelper.formatNumber(amount, { decimals: (_j = token === null || token === void 0 ? void 0 : token.decimals) !== null && _j !== void 0 ? _j : event.tokenDecimals })
125
+ : undefined,
119
126
  methodName,
120
127
  from,
121
128
  fromUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-ethereum",
3
- "version": "2.12.0",
3
+ "version": "2.12.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": "https://github.com/CityOfZion/blockchain-services",
@@ -20,9 +20,9 @@
20
20
  "@ledgerhq/hw-app-eth": "~6.35.7",
21
21
  "@ethersproject/abstract-signer": "~5.7.0",
22
22
  "@ethersproject/properties": "~5.7.0",
23
- "@cityofzion/dora-ts": "0.5.0",
23
+ "@cityofzion/dora-ts": "0.5.1",
24
24
  "date-fns": "~4.1.0",
25
- "@cityofzion/blockchain-service": "1.18.0"
25
+ "@cityofzion/blockchain-service": "1.18.2"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@ledgerhq/hw-transport-node-hid": "~6.28.5",