@cityofzion/bs-ethereum 3.1.1 → 3.1.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.
@@ -147,7 +147,7 @@ class MoralisBDSEthereum extends RpcBDSEthereum_1.RpcBDSEthereum {
147
147
  to,
148
148
  toUrl,
149
149
  tokenType: 'erc-20',
150
- tokenUrl: this._service.explorerService.buildContractUrl(contractHash),
150
+ tokenUrl: this._service.explorerService.buildContractUrl(token.hash),
151
151
  token,
152
152
  });
153
153
  }
@@ -219,8 +219,13 @@ class MoralisBDSEthereum extends RpcBDSEthereum_1.RpcBDSEthereum {
219
219
  return;
220
220
  const fromUrl = this._service.explorerService.buildAddressUrl(transfer.from_address);
221
221
  const toUrl = this._service.explorerService.buildAddressUrl(transfer.to_address);
222
- const tokenHash = transfer.address;
223
222
  const tokenDecimals = transfer.token_decimals;
223
+ const token = this._service.tokenService.normalizeToken({
224
+ decimals: Number(tokenDecimals),
225
+ hash: transfer.address,
226
+ name: transfer.token_name,
227
+ symbol: transfer.token_symbol,
228
+ });
224
229
  events.push({
225
230
  eventType: 'token',
226
231
  amount: blockchain_service_1.BSBigNumberHelper.format(blockchain_service_1.BSBigNumberHelper.fromDecimals(transfer.value, tokenDecimals), {
@@ -232,13 +237,8 @@ class MoralisBDSEthereum extends RpcBDSEthereum_1.RpcBDSEthereum {
232
237
  to: transfer.to_address,
233
238
  toUrl,
234
239
  tokenType: 'erc-20',
235
- tokenUrl: this._service.explorerService.buildContractUrl(tokenHash),
236
- token: this._service.tokenService.normalizeToken({
237
- decimals: Number(tokenDecimals),
238
- hash: tokenHash,
239
- name: transfer.token_name,
240
- symbol: transfer.token_symbol,
241
- }),
240
+ tokenUrl: this._service.explorerService.buildContractUrl(token.hash),
241
+ token,
242
242
  });
243
243
  });
244
244
  const nftPromises = item.nft_transfers.map(async (transfer) => {
@@ -26,7 +26,7 @@ class BlockscoutESEthereum {
26
26
  return this.getTransactionTemplateUrl()?.replace('{txId}', this._service.tokenService.normalizeHash(transactionId));
27
27
  }
28
28
  buildContractUrl(contractHash) {
29
- if (!__classPrivateFieldGet(this, _BlockscoutESEthereum_instances, "m", _BlockscoutESEthereum_validateValueLength).call(this, contractHash, 1))
29
+ if (!__classPrivateFieldGet(this, _BlockscoutESEthereum_instances, "m", _BlockscoutESEthereum_validateValueLength).call(this, contractHash))
30
30
  return undefined;
31
31
  return this.getContractTemplateUrl()?.replace('{hash}', this._service.tokenService.normalizeHash(contractHash));
32
32
  }
@@ -90,7 +90,7 @@ class MoralisFullTransactionsDataServiceEthereum {
90
90
  to,
91
91
  toUrl,
92
92
  tokenType: isErc20 ? 'erc-20' : 'generic',
93
- tokenUrl: __classPrivateFieldGet(this, _MoralisFullTransactionsDataServiceEthereum_service, "f").explorerService.buildContractUrl(contractHash),
93
+ tokenUrl: token ? __classPrivateFieldGet(this, _MoralisFullTransactionsDataServiceEthereum_service, "f").explorerService.buildContractUrl(token.hash) : undefined,
94
94
  token,
95
95
  });
96
96
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-ethereum",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "repository": "https://github.com/CityOfZion/blockchain-services",
5
5
  "license": "GPL-3.0-only",
6
6
  "author": "Coz",
@@ -19,7 +19,7 @@
19
19
  "@ledgerhq/hw-app-eth": "~7.3.0",
20
20
  "axios": "~1.13.5",
21
21
  "ethers": "5.8.0",
22
- "@cityofzion/blockchain-service": "3.1.1"
22
+ "@cityofzion/blockchain-service": "3.1.2"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@ledgerhq/hw-transport": "~6.32.0",