@cityofzion/bs-neo-legacy 1.13.1 → 1.13.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.
@@ -120,7 +120,7 @@ class BSNeoLegacy {
120
120
  const concatIntents = [...intents, ...(tipIntent ? [tipIntent] : [])];
121
121
  for (const intent of concatIntents) {
122
122
  const normalizeTokenHash = this.tokenService.normalizeHash(intent.tokenHash);
123
- const nativeAsset = this.NATIVE_ASSETS.find(this.tokenService.predicateByHash(normalizeTokenHash));
123
+ const nativeAsset = this.NATIVE_ASSETS.find(token => this.tokenService.predicateByHash(normalizeTokenHash, token));
124
124
  if (nativeAsset) {
125
125
  nativeIntents.push(...neon_js_1.api.makeIntent({ [nativeAsset.symbol]: Number(intent.amount) }, intent.receiverAddress));
126
126
  continue;
@@ -231,8 +231,8 @@ class BSNeoLegacy {
231
231
  return response;
232
232
  }
233
233
  calculateNeoLegacyMigrationAmounts(balance) {
234
- const gasBalance = balance.find(({ token }) => this.tokenService.predicateByHash(BSNeoLegacyConstants_1.BSNeoLegacyConstants.GAS_ASSET)(token));
235
- const neoBalance = balance.find(({ token }) => this.tokenService.predicateByHash(BSNeoLegacyConstants_1.BSNeoLegacyConstants.NEO_ASSET)(token));
234
+ const gasBalance = balance.find(({ token }) => this.tokenService.predicateByHash(BSNeoLegacyConstants_1.BSNeoLegacyConstants.GAS_ASSET, token));
235
+ const neoBalance = balance.find(({ token }) => this.tokenService.predicateByHash(BSNeoLegacyConstants_1.BSNeoLegacyConstants.NEO_ASSET, token));
236
236
  let hasEnoughGasBalance = false;
237
237
  let hasEnoughNeoBalance = false;
238
238
  if (gasBalance) {
@@ -22,8 +22,8 @@ BSNeoLegacyConstants.EXTRA_TOKENS_BY_NETWORK_ID = {
22
22
  mainnet: __classPrivateFieldGet(_a, _a, "f", _BSNeoLegacyConstants_tokenService).normalizeToken(mainnet_json_1.default),
23
23
  };
24
24
  BSNeoLegacyConstants.NATIVE_ASSETS = __classPrivateFieldGet(_a, _a, "f", _BSNeoLegacyConstants_tokenService).normalizeToken(native_json_1.default);
25
- BSNeoLegacyConstants.GAS_ASSET = _a.NATIVE_ASSETS.find(__classPrivateFieldGet(_a, _a, "f", _BSNeoLegacyConstants_tokenService).predicateBySymbol('GAS'));
26
- BSNeoLegacyConstants.NEO_ASSET = _a.NATIVE_ASSETS.find(__classPrivateFieldGet(_a, _a, "f", _BSNeoLegacyConstants_tokenService).predicateBySymbol('NEO'));
25
+ BSNeoLegacyConstants.GAS_ASSET = _a.NATIVE_ASSETS.find(token => __classPrivateFieldGet(_a, _a, "f", _BSNeoLegacyConstants_tokenService).predicateBySymbol('GAS', token));
26
+ BSNeoLegacyConstants.NEO_ASSET = _a.NATIVE_ASSETS.find(token => __classPrivateFieldGet(_a, _a, "f", _BSNeoLegacyConstants_tokenService).predicateBySymbol('NEO', token));
27
27
  BSNeoLegacyConstants.RPC_LIST_BY_NETWORK_ID = {
28
28
  mainnet: [
29
29
  'https://mainnet1.neo2.coz.io:443',
@@ -225,7 +225,7 @@ class DoraBDSNeoLegacy {
225
225
  if (cachedToken) {
226
226
  return cachedToken;
227
227
  }
228
- let token = __classPrivateFieldGet(this, _DoraBDSNeoLegacy_tokens, "f").find(__classPrivateFieldGet(this, _DoraBDSNeoLegacy_tokenService, "f").predicateByHash(tokenHash));
228
+ let token = __classPrivateFieldGet(this, _DoraBDSNeoLegacy_tokens, "f").find(currentToken => __classPrivateFieldGet(this, _DoraBDSNeoLegacy_tokenService, "f").predicateByHash(tokenHash, currentToken));
229
229
  if (!token) {
230
230
  const data = yield dora_ts_1.api.NeoLegacyREST.asset(tokenHash, __classPrivateFieldGet(this, _DoraBDSNeoLegacy_network, "f").id);
231
231
  if (!data || 'error' in data)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cityofzion/bs-neo-legacy",
3
- "version": "1.13.1",
3
+ "version": "1.13.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "Coz",
@@ -14,7 +14,7 @@
14
14
  "@ledgerhq/hw-transport": "~6.31.8",
15
15
  "axios": "~1.8.2",
16
16
  "date-fns": "~4.1.0",
17
- "@cityofzion/blockchain-service": "1.21.0",
17
+ "@cityofzion/blockchain-service": "1.21.1",
18
18
  "@cityofzion/bs-asteroid-sdk": "0.9.1"
19
19
  },
20
20
  "devDependencies": {