@keplr-wallet/stores-ibc 0.12.205 → 0.12.207

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.
@@ -145,7 +145,42 @@ class IBCCurrencyRegistrar {
145
145
  const paths = denomTrace.paths;
146
146
  // The previous chain id from current path.
147
147
  let chainIdBefore = chainId;
148
- for (const path of paths) {
148
+ for (let i = 0; i < paths.length; i++) {
149
+ const path = paths[i];
150
+ const isLast = i === paths.length - 1;
151
+ if (
152
+ // 현재 ethereum ibc의 경우 ethereum까지 타고 들어가서 nested하게 처리할 방법은 없다.
153
+ // 마지막 path일 경우만 처리한다.
154
+ isLast &&
155
+ this.chainStore.getChain(chainIdBefore).hasFeature("ibc-v2") &&
156
+ denomTrace.denom.startsWith("0x")) {
157
+ const clientState = this.queriesStore
158
+ .get(chainIdBefore)
159
+ .cosmos.queryIBCClientStateV2.getClientState(path.channelId);
160
+ if (clientState.isFetching) {
161
+ isFetching = true;
162
+ }
163
+ if (clientState.clientChainId &&
164
+ !Number.isNaN(parseInt(clientState.clientChainId))) {
165
+ if (this.chainStore.hasChain(`eip155:${clientState.clientChainId}`)) {
166
+ const ethereumChainId = `eip155:${clientState.clientChainId}`;
167
+ // TODO: counterparty channel id를 구해야할듯한데
168
+ // https://github.com/cosmos/ibc-go/blob/a8b4af9c757f5235a965718597f73f039c4a5708/proto/ibc/core/client/v2/query.proto#L15
169
+ // 이것으로 추정되지만 현재 cosmos testnet에서 해당 쿼리가 501 not implemented로 반환되기 때문에 일단 패스...
170
+ path.clientChainId = ethereumChainId;
171
+ chainIdBefore = ethereumChainId;
172
+ originChainInfo = this.chainStore.getChain(ethereumChainId);
173
+ if (!counterpartyChainInfo) {
174
+ counterpartyChainInfo =
175
+ this.chainStore.getChain(ethereumChainId);
176
+ }
177
+ }
178
+ else {
179
+ originChainInfo = undefined;
180
+ }
181
+ break;
182
+ }
183
+ }
149
184
  const clientState = this.queriesStore
150
185
  .get(chainIdBefore)
151
186
  .cosmos.queryIBCClientState.getClientState(path.portId, path.channelId);
@@ -189,164 +224,220 @@ class IBCCurrencyRegistrar {
189
224
  }
190
225
  }
191
226
  if (originChainInfo && denomTrace) {
192
- const isCW20Currency = denomTrace.denom.split(/^(cw20):(\w+)$/).length === 4;
193
- const isERC20Currency = denomTrace.denom.split(/^(erc20)\/(\w+)$/).length === 4;
194
- switch (true) {
195
- case isCW20Currency:
196
- const isSecret20Currency = (_a = originChainInfo.features) === null || _a === void 0 ? void 0 : _a.includes("secretwasm");
197
- if (!isSecret20Currency) {
198
- let isFetching = false;
199
- // If the origin currency is ics20-cw20.
200
- let cw20Currency = originChainInfo.currencies.find((cur) => denomTrace && cur.coinMinimalDenom.startsWith(denomTrace.denom));
201
- if (!cw20Currency &&
227
+ // 경우 ethereum 계열이기 때문에 다르게 처리해야한다.
228
+ if (this.chainStore.isEvmOnlyChain(originChainInfo.chainId)) {
229
+ // 유저가 Add Token을 통해서 추가했을 경우
230
+ const currency = originChainInfo.currencies.find((cur) => {
231
+ return cur.coinMinimalDenom === `erc20:${denomTrace.denom}`;
232
+ });
233
+ const originQueries = this.queriesStore.get(originChainInfo.chainId);
234
+ if (currency) {
235
+ return {
236
+ value: {
237
+ coinDecimals: currency.coinDecimals,
238
+ coinGeckoId: currency.coinGeckoId,
239
+ coinImageUrl: currency.coinImageUrl,
240
+ coinMinimalDenom: denomHelper.denom,
241
+ coinDenom: this.coinDenomGenerator(denomTrace, originChainInfo, counterpartyChainInfo, currency),
242
+ paths: denomTrace.paths,
243
+ originChainId: originChainInfo.chainId,
244
+ originCurrency: currency,
245
+ },
246
+ done: true,
247
+ };
248
+ }
249
+ else if (originQueries.ethereum) {
250
+ const queryCoingecko = originQueries.ethereum.queryEthereumCoingeckoTokenInfo.getQueryContract(denomTrace.denom);
251
+ if (queryCoingecko &&
252
+ queryCoingecko.symbol != null &&
253
+ queryCoingecko.decimals != null) {
254
+ const erc20Currency = {
255
+ type: "erc20",
256
+ coinMinimalDenom: `erc20:${denomTrace.denom}`,
257
+ contractAddress: denomTrace.denom,
258
+ coinDenom: queryCoingecko.symbol,
259
+ coinDecimals: queryCoingecko.decimals,
260
+ coinGeckoId: queryCoingecko.coingeckoId,
261
+ coinImageUrl: queryCoingecko.logoURI,
262
+ };
263
+ return {
264
+ value: {
265
+ coinDecimals: erc20Currency.coinDecimals,
266
+ coinGeckoId: erc20Currency.coinGeckoId,
267
+ coinImageUrl: erc20Currency.coinImageUrl,
268
+ coinMinimalDenom: denomHelper.denom,
269
+ coinDenom: this.coinDenomGenerator(denomTrace, originChainInfo, counterpartyChainInfo, erc20Currency),
270
+ paths: denomTrace.paths,
271
+ originChainId: originChainInfo.chainId,
272
+ originCurrency: erc20Currency,
273
+ },
274
+ done: fromCache && !queryCoingecko.isFetching,
275
+ };
276
+ }
277
+ }
278
+ }
279
+ else {
280
+ const isCW20Currency = denomTrace.denom.split(/^(cw20):(\w+)$/).length === 4;
281
+ const isERC20Currency = denomTrace.denom.split(/^(erc20)\/(\w+)$/).length === 4;
282
+ switch (true) {
283
+ case isCW20Currency:
284
+ const isSecret20Currency = (_a = originChainInfo.features) === null || _a === void 0 ? void 0 : _a.includes("secretwasm");
285
+ if (!isSecret20Currency) {
286
+ let isFetching = false;
287
+ // If the origin currency is ics20-cw20.
288
+ let cw20Currency = originChainInfo.currencies.find((cur) => denomTrace &&
289
+ cur.coinMinimalDenom.startsWith(denomTrace.denom));
290
+ if (!cw20Currency &&
291
+ this.chainStore.hasChain(originChainInfo.chainId)) {
292
+ const originQueries = this.queriesStore.get(originChainInfo.chainId);
293
+ if (originQueries.cosmwasm) {
294
+ const contractAddress = denomTrace.denom.replace("cw20:", "");
295
+ const contractInfo = originQueries.cosmwasm.querycw20ContractInfo.getQueryContract(contractAddress);
296
+ isFetching = contractInfo.isFetching;
297
+ if (contractInfo.response) {
298
+ cw20Currency = {
299
+ type: "cw20",
300
+ contractAddress,
301
+ coinDecimals: contractInfo.response.data.decimals,
302
+ coinDenom: contractInfo.response.data.symbol,
303
+ coinMinimalDenom: `cw20:${contractAddress}:${contractInfo.response.data.name}`,
304
+ };
305
+ }
306
+ }
307
+ }
308
+ if (cw20Currency) {
309
+ return {
310
+ value: {
311
+ coinDecimals: cw20Currency.coinDecimals,
312
+ coinGeckoId: cw20Currency.coinGeckoId,
313
+ coinImageUrl: cw20Currency.coinImageUrl,
314
+ coinMinimalDenom: denomHelper.denom,
315
+ coinDenom: this.coinDenomGenerator(denomTrace, originChainInfo, counterpartyChainInfo, cw20Currency),
316
+ paths: denomTrace.paths,
317
+ originChainId: originChainInfo.chainId,
318
+ originCurrency: cw20Currency,
319
+ },
320
+ done: fromCache && !isFetching,
321
+ };
322
+ }
323
+ }
324
+ else {
325
+ let isSecret20Fetching = false;
326
+ // If the origin currency is ics20-cw20.
327
+ let secret20Currency = originChainInfo.currencies.find((cur) => denomTrace &&
328
+ cur.coinMinimalDenom.startsWith(denomTrace.denom));
329
+ if (!secret20Currency &&
330
+ this.chainStore.hasChain(originChainInfo.chainId)) {
331
+ const originQueries = this.queriesStore.get(originChainInfo.chainId);
332
+ if (originQueries.secret) {
333
+ const contractAddress = denomTrace.denom.replace("cw20:", "");
334
+ const contractInfo = originQueries.secret.querySecret20ContractInfo.getQueryContract(contractAddress);
335
+ isSecret20Fetching = contractInfo.isFetching;
336
+ if (contractInfo.response) {
337
+ secret20Currency = {
338
+ type: "secret20",
339
+ contractAddress,
340
+ coinDecimals: contractInfo.response.data.token_info.decimals,
341
+ coinDenom: contractInfo.response.data.token_info.symbol,
342
+ coinMinimalDenom: `secret20:${contractAddress}:${contractInfo.response.data.token_info.name}`,
343
+ };
344
+ }
345
+ }
346
+ }
347
+ if (secret20Currency) {
348
+ return {
349
+ value: {
350
+ coinDecimals: secret20Currency.coinDecimals,
351
+ coinGeckoId: secret20Currency.coinGeckoId,
352
+ coinImageUrl: secret20Currency.coinImageUrl,
353
+ coinMinimalDenom: denomHelper.denom,
354
+ coinDenom: this.coinDenomGenerator(denomTrace, originChainInfo, counterpartyChainInfo, secret20Currency),
355
+ paths: denomTrace.paths,
356
+ originChainId: originChainInfo.chainId,
357
+ originCurrency: secret20Currency,
358
+ },
359
+ done: fromCache && !isSecret20Fetching,
360
+ };
361
+ }
362
+ }
363
+ break;
364
+ case isERC20Currency:
365
+ let isERC20Fetching = false;
366
+ // If the origin currency is ics20-erc20.
367
+ let erc20Currency = originChainInfo.currencies.find((cur) => denomTrace && cur.coinMinimalDenom.startsWith(denomTrace.denom));
368
+ if (!erc20Currency &&
202
369
  this.chainStore.hasChain(originChainInfo.chainId)) {
203
370
  const originQueries = this.queriesStore.get(originChainInfo.chainId);
204
- if (originQueries.cosmwasm) {
205
- const contractAddress = denomTrace.denom.replace("cw20:", "");
206
- const contractInfo = originQueries.cosmwasm.querycw20ContractInfo.getQueryContract(contractAddress);
207
- isFetching = contractInfo.isFetching;
208
- if (contractInfo.response) {
209
- cw20Currency = {
210
- type: "cw20",
371
+ if (originQueries.ethereum) {
372
+ const contractAddress = denomTrace.denom.replace("erc20/", "");
373
+ const contractInfo = originQueries.ethereum.queryEthereumERC20ContractInfo.getQueryContract(contractAddress);
374
+ isERC20Fetching = contractInfo.isFetching;
375
+ if (contractInfo.tokenInfo) {
376
+ erc20Currency = {
377
+ type: "erc20",
211
378
  contractAddress,
212
- coinDecimals: contractInfo.response.data.decimals,
213
- coinDenom: contractInfo.response.data.symbol,
214
- coinMinimalDenom: `cw20:${contractAddress}:${contractInfo.response.data.name}`,
379
+ coinDecimals: contractInfo.tokenInfo.decimals,
380
+ coinDenom: contractInfo.tokenInfo.symbol,
381
+ coinMinimalDenom: `erc20:${contractAddress}`,
215
382
  };
216
383
  }
217
384
  }
218
385
  }
219
- if (cw20Currency) {
386
+ if (erc20Currency) {
220
387
  return {
221
388
  value: {
222
- coinDecimals: cw20Currency.coinDecimals,
223
- coinGeckoId: cw20Currency.coinGeckoId,
224
- coinImageUrl: cw20Currency.coinImageUrl,
389
+ coinDecimals: erc20Currency.coinDecimals,
390
+ coinGeckoId: erc20Currency.coinGeckoId,
391
+ coinImageUrl: erc20Currency.coinImageUrl,
225
392
  coinMinimalDenom: denomHelper.denom,
226
- coinDenom: this.coinDenomGenerator(denomTrace, originChainInfo, counterpartyChainInfo, cw20Currency),
393
+ coinDenom: this.coinDenomGenerator(denomTrace, originChainInfo, counterpartyChainInfo, erc20Currency),
227
394
  paths: denomTrace.paths,
228
395
  originChainId: originChainInfo.chainId,
229
- originCurrency: cw20Currency,
396
+ originCurrency: erc20Currency,
230
397
  },
231
- done: fromCache && !isFetching,
398
+ done: fromCache && !isERC20Fetching,
232
399
  };
233
400
  }
234
- }
235
- else {
236
- let isSecret20Fetching = false;
237
- // If the origin currency is ics20-cw20.
238
- let secret20Currency = originChainInfo.currencies.find((cur) => denomTrace && cur.coinMinimalDenom.startsWith(denomTrace.denom));
239
- if (!secret20Currency &&
240
- this.chainStore.hasChain(originChainInfo.chainId)) {
241
- const originQueries = this.queriesStore.get(originChainInfo.chainId);
242
- if (originQueries.secret) {
243
- const contractAddress = denomTrace.denom.replace("cw20:", "");
244
- const contractInfo = originQueries.secret.querySecret20ContractInfo.getQueryContract(contractAddress);
245
- isSecret20Fetching = contractInfo.isFetching;
246
- if (contractInfo.response) {
247
- secret20Currency = {
248
- type: "secret20",
249
- contractAddress,
250
- coinDecimals: contractInfo.response.data.token_info.decimals,
251
- coinDenom: contractInfo.response.data.token_info.symbol,
252
- coinMinimalDenom: `secret20:${contractAddress}:${contractInfo.response.data.token_info.name}`,
253
- };
254
- }
255
- }
256
- }
257
- if (secret20Currency) {
401
+ break;
402
+ default:
403
+ const currency = originChainInfo.findCurrency(denomTrace.denom);
404
+ if (currency && !("paths" in currency)) {
258
405
  return {
259
406
  value: {
260
- coinDecimals: secret20Currency.coinDecimals,
261
- coinGeckoId: secret20Currency.coinGeckoId,
262
- coinImageUrl: secret20Currency.coinImageUrl,
407
+ coinDecimals: currency.coinDecimals,
408
+ coinGeckoId: currency.coinGeckoId,
409
+ coinImageUrl: currency.coinImageUrl,
263
410
  coinMinimalDenom: denomHelper.denom,
264
- coinDenom: this.coinDenomGenerator(denomTrace, originChainInfo, counterpartyChainInfo, secret20Currency),
411
+ coinDenom: this.coinDenomGenerator(denomTrace, originChainInfo, counterpartyChainInfo, currency),
265
412
  paths: denomTrace.paths,
266
413
  originChainId: originChainInfo.chainId,
267
- originCurrency: secret20Currency,
414
+ originCurrency: currency,
268
415
  },
269
- done: fromCache && !isSecret20Fetching,
416
+ done: (() => {
417
+ if (originChainInfo.isCurrencyRegistrationInProgress(currency.coinMinimalDenom)) {
418
+ return false;
419
+ }
420
+ return fromCache;
421
+ })(),
270
422
  };
271
423
  }
272
- }
273
- break;
274
- case isERC20Currency:
275
- let isERC20Fetching = false;
276
- // If the origin currency is ics20-erc20.
277
- let erc20Currency = originChainInfo.currencies.find((cur) => denomTrace && cur.coinMinimalDenom.startsWith(denomTrace.denom));
278
- if (!erc20Currency &&
279
- this.chainStore.hasChain(originChainInfo.chainId)) {
280
- const originQueries = this.queriesStore.get(originChainInfo.chainId);
281
- if (originQueries.ethereum) {
282
- const contractAddress = denomTrace.denom.replace("erc20/", "");
283
- const contractInfo = originQueries.ethereum.queryEthereumERC20ContractInfo.getQueryContract(contractAddress);
284
- isERC20Fetching = contractInfo.isFetching;
285
- if (contractInfo.tokenInfo) {
286
- erc20Currency = {
287
- type: "erc20",
288
- contractAddress,
289
- coinDecimals: contractInfo.tokenInfo.decimals,
290
- coinDenom: contractInfo.tokenInfo.symbol,
291
- coinMinimalDenom: `erc20:${contractAddress}`,
292
- };
293
- }
294
- }
295
- }
296
- if (erc20Currency) {
297
- return {
298
- value: {
299
- coinDecimals: erc20Currency.coinDecimals,
300
- coinGeckoId: erc20Currency.coinGeckoId,
301
- coinImageUrl: erc20Currency.coinImageUrl,
302
- coinMinimalDenom: denomHelper.denom,
303
- coinDenom: this.coinDenomGenerator(denomTrace, originChainInfo, counterpartyChainInfo, erc20Currency),
304
- paths: denomTrace.paths,
305
- originChainId: originChainInfo.chainId,
306
- originCurrency: erc20Currency,
307
- },
308
- done: fromCache && !isERC20Fetching,
309
- };
310
- }
311
- break;
312
- default:
313
- const currency = originChainInfo.findCurrency(denomTrace.denom);
314
- if (currency && !("paths" in currency)) {
315
- return {
316
- value: {
317
- coinDecimals: currency.coinDecimals,
318
- coinGeckoId: currency.coinGeckoId,
319
- coinImageUrl: currency.coinImageUrl,
320
- coinMinimalDenom: denomHelper.denom,
321
- coinDenom: this.coinDenomGenerator(denomTrace, originChainInfo, counterpartyChainInfo, currency),
322
- paths: denomTrace.paths,
323
- originChainId: originChainInfo.chainId,
324
- originCurrency: currency,
325
- },
326
- done: (() => {
327
- if (originChainInfo.isCurrencyRegistrationInProgress(currency.coinMinimalDenom)) {
328
- return false;
329
- }
330
- return fromCache;
331
- })(),
332
- };
333
- }
334
- break;
424
+ break;
425
+ }
426
+ // In this case, just show the raw currency.
427
+ // But, it is possible to know the currency from query later.
428
+ // So, let them to be observed.
429
+ return {
430
+ value: {
431
+ coinDecimals: 0,
432
+ coinMinimalDenom: denomHelper.denom,
433
+ coinDenom: this.coinDenomGenerator(denomTrace, originChainInfo, counterpartyChainInfo, undefined),
434
+ paths: denomTrace.paths,
435
+ originChainId: undefined,
436
+ originCurrency: undefined,
437
+ },
438
+ done: false,
439
+ };
335
440
  }
336
- // In this case, just show the raw currency.
337
- // But, it is possible to know the currency from query later.
338
- // So, let them to be observed.
339
- return {
340
- value: {
341
- coinDecimals: 0,
342
- coinMinimalDenom: denomHelper.denom,
343
- coinDenom: this.coinDenomGenerator(denomTrace, originChainInfo, counterpartyChainInfo, undefined),
344
- paths: denomTrace.paths,
345
- originChainId: undefined,
346
- originCurrency: undefined,
347
- },
348
- done: false,
349
- };
350
441
  }
351
442
  return {
352
443
  value: undefined,
@@ -1 +1 @@
1
- {"version":3,"file":"currency-registrar.js","sourceRoot":"","sources":["../src/currency-registrar.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,+BAOc;AAUd,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sBAAa,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,UAAU,IAAI,cAAc,EAAE,EAC9D,IAAI,CACL,CAAC;IACJ,CAAC;CACF;AAvlBW;IADT,iBAAU,CAAC,OAAO;kEACwD;AAGpE;IADN,iBAAU;2DACkB;AA0kBnB;IADT,aAAM;gEAUN;AA5nBH,oDA6nBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keplr-wallet/stores-ibc",
3
- "version": "0.12.205",
3
+ "version": "0.12.207",
4
4
  "main": "build/index.js",
5
5
  "author": "chainapsis",
6
6
  "license": "Apache-2.0",
@@ -16,15 +16,15 @@
16
16
  "lint-fix": "eslint --fix \"src/**/*\" && prettier --write \"src/**/*\""
17
17
  },
18
18
  "dependencies": {
19
- "@keplr-wallet/common": "0.12.205",
20
- "@keplr-wallet/cosmos": "0.12.205",
21
- "@keplr-wallet/stores": "0.12.205",
22
- "@keplr-wallet/stores-eth": "0.12.205",
23
- "@keplr-wallet/types": "0.12.205"
19
+ "@keplr-wallet/common": "0.12.207",
20
+ "@keplr-wallet/cosmos": "0.12.207",
21
+ "@keplr-wallet/stores": "0.12.207",
22
+ "@keplr-wallet/stores-eth": "0.12.207",
23
+ "@keplr-wallet/types": "0.12.207"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "mobx": "^6",
27
27
  "mobx-utils": "^6"
28
28
  },
29
- "gitHead": "e96722f815c0d02b3573ef35a9bc9edaa34c5570"
29
+ "gitHead": "0d9a2b1a0185fcd65e37929bf749226c7e954ecc"
30
30
  }
@@ -6,7 +6,7 @@ import {
6
6
  runInAction,
7
7
  toJS,
8
8
  } from "mobx";
9
- import { AppCurrency, ChainInfo } from "@keplr-wallet/types";
9
+ import { AppCurrency, ChainInfo, ERC20Currency } from "@keplr-wallet/types";
10
10
  import {
11
11
  IChainInfoImpl,
12
12
  ChainStore,
@@ -257,7 +257,50 @@ export class IBCCurrencyRegistrar {
257
257
  const paths = denomTrace.paths;
258
258
  // The previous chain id from current path.
259
259
  let chainIdBefore = chainId;
260
- for (const path of paths) {
260
+ for (let i = 0; i < paths.length; i++) {
261
+ const path = paths[i];
262
+ const isLast = i === paths.length - 1;
263
+ if (
264
+ // 현재 ethereum ibc의 경우 ethereum까지 타고 들어가서 nested하게 처리할 방법은 없다.
265
+ // 마지막 path일 경우만 처리한다.
266
+ isLast &&
267
+ this.chainStore.getChain(chainIdBefore).hasFeature("ibc-v2") &&
268
+ denomTrace.denom.startsWith("0x")
269
+ ) {
270
+ const clientState = this.queriesStore
271
+ .get(chainIdBefore)
272
+ .cosmos.queryIBCClientStateV2.getClientState(path.channelId);
273
+ if (clientState.isFetching) {
274
+ isFetching = true;
275
+ }
276
+ if (
277
+ clientState.clientChainId &&
278
+ !Number.isNaN(parseInt(clientState.clientChainId))
279
+ ) {
280
+ if (
281
+ this.chainStore.hasChain(`eip155:${clientState.clientChainId}`)
282
+ ) {
283
+ const ethereumChainId = `eip155:${clientState.clientChainId}`;
284
+
285
+ // TODO: counterparty channel id를 구해야할듯한데
286
+ // https://github.com/cosmos/ibc-go/blob/a8b4af9c757f5235a965718597f73f039c4a5708/proto/ibc/core/client/v2/query.proto#L15
287
+ // 이것으로 추정되지만 현재 cosmos testnet에서 해당 쿼리가 501 not implemented로 반환되기 때문에 일단 패스...
288
+
289
+ path.clientChainId = ethereumChainId;
290
+
291
+ chainIdBefore = ethereumChainId;
292
+ originChainInfo = this.chainStore.getChain(ethereumChainId);
293
+ if (!counterpartyChainInfo) {
294
+ counterpartyChainInfo =
295
+ this.chainStore.getChain(ethereumChainId);
296
+ }
297
+ } else {
298
+ originChainInfo = undefined;
299
+ }
300
+ break;
301
+ }
302
+ }
303
+
261
304
  const clientState = this.queriesStore
262
305
  .get(chainIdBefore)
263
306
  .cosmos.queryIBCClientState.getClientState(
@@ -315,233 +358,302 @@ export class IBCCurrencyRegistrar {
315
358
  }
316
359
 
317
360
  if (originChainInfo && denomTrace) {
318
- const isCW20Currency =
319
- denomTrace.denom.split(/^(cw20):(\w+)$/).length === 4;
320
- const isERC20Currency =
321
- denomTrace.denom.split(/^(erc20)\/(\w+)$/).length === 4;
322
- switch (true) {
323
- case isCW20Currency:
324
- const isSecret20Currency =
325
- originChainInfo.features?.includes("secretwasm");
326
-
327
- if (!isSecret20Currency) {
328
- let isFetching = false;
329
- // If the origin currency is ics20-cw20.
330
- let cw20Currency = originChainInfo.currencies.find(
361
+ // 경우 ethereum 계열이기 때문에 다르게 처리해야한다.
362
+ if (this.chainStore.isEvmOnlyChain(originChainInfo.chainId)) {
363
+ // 유저가 Add Token을 통해서 추가했을 경우
364
+ const currency = originChainInfo.currencies.find((cur) => {
365
+ return cur.coinMinimalDenom === `erc20:${denomTrace!.denom}`;
366
+ });
367
+ const originQueries = this.queriesStore.get(originChainInfo.chainId);
368
+ if (currency) {
369
+ return {
370
+ value: {
371
+ coinDecimals: currency.coinDecimals,
372
+ coinGeckoId: currency.coinGeckoId,
373
+ coinImageUrl: currency.coinImageUrl,
374
+ coinMinimalDenom: denomHelper.denom,
375
+ coinDenom: this.coinDenomGenerator(
376
+ denomTrace,
377
+ originChainInfo,
378
+ counterpartyChainInfo,
379
+ currency
380
+ ),
381
+ paths: denomTrace.paths,
382
+ originChainId: originChainInfo.chainId,
383
+ originCurrency: currency,
384
+ },
385
+ done: true,
386
+ };
387
+ } else if (originQueries.ethereum) {
388
+ const queryCoingecko =
389
+ originQueries.ethereum.queryEthereumCoingeckoTokenInfo.getQueryContract(
390
+ denomTrace.denom
391
+ );
392
+ if (
393
+ queryCoingecko &&
394
+ queryCoingecko.symbol != null &&
395
+ queryCoingecko.decimals != null
396
+ ) {
397
+ const erc20Currency: ERC20Currency = {
398
+ type: "erc20",
399
+ coinMinimalDenom: `erc20:${denomTrace!.denom}`,
400
+ contractAddress: denomTrace.denom,
401
+ coinDenom: queryCoingecko.symbol,
402
+ coinDecimals: queryCoingecko.decimals,
403
+ coinGeckoId: queryCoingecko.coingeckoId,
404
+ coinImageUrl: queryCoingecko.logoURI,
405
+ };
406
+ return {
407
+ value: {
408
+ coinDecimals: erc20Currency.coinDecimals,
409
+ coinGeckoId: erc20Currency.coinGeckoId,
410
+ coinImageUrl: erc20Currency.coinImageUrl,
411
+ coinMinimalDenom: denomHelper.denom,
412
+ coinDenom: this.coinDenomGenerator(
413
+ denomTrace,
414
+ originChainInfo,
415
+ counterpartyChainInfo,
416
+ erc20Currency
417
+ ),
418
+ paths: denomTrace.paths,
419
+ originChainId: originChainInfo.chainId,
420
+ originCurrency: erc20Currency,
421
+ },
422
+ done: fromCache && !queryCoingecko.isFetching,
423
+ };
424
+ }
425
+ }
426
+ } else {
427
+ const isCW20Currency =
428
+ denomTrace.denom.split(/^(cw20):(\w+)$/).length === 4;
429
+ const isERC20Currency =
430
+ denomTrace.denom.split(/^(erc20)\/(\w+)$/).length === 4;
431
+ switch (true) {
432
+ case isCW20Currency:
433
+ const isSecret20Currency =
434
+ originChainInfo.features?.includes("secretwasm");
435
+
436
+ if (!isSecret20Currency) {
437
+ let isFetching = false;
438
+ // If the origin currency is ics20-cw20.
439
+ let cw20Currency = originChainInfo.currencies.find(
440
+ (cur) =>
441
+ denomTrace &&
442
+ cur.coinMinimalDenom.startsWith(denomTrace.denom)
443
+ );
444
+ if (
445
+ !cw20Currency &&
446
+ this.chainStore.hasChain(originChainInfo.chainId)
447
+ ) {
448
+ const originQueries = this.queriesStore.get(
449
+ originChainInfo.chainId
450
+ );
451
+ if (originQueries.cosmwasm) {
452
+ const contractAddress = denomTrace.denom.replace("cw20:", "");
453
+ const contractInfo =
454
+ originQueries.cosmwasm.querycw20ContractInfo.getQueryContract(
455
+ contractAddress
456
+ );
457
+ isFetching = contractInfo.isFetching;
458
+ if (contractInfo.response) {
459
+ cw20Currency = {
460
+ type: "cw20",
461
+ contractAddress,
462
+ coinDecimals: contractInfo.response.data.decimals,
463
+ coinDenom: contractInfo.response.data.symbol,
464
+ coinMinimalDenom: `cw20:${contractAddress}:${contractInfo.response.data.name}`,
465
+ };
466
+ }
467
+ }
468
+ }
469
+
470
+ if (cw20Currency) {
471
+ return {
472
+ value: {
473
+ coinDecimals: cw20Currency.coinDecimals,
474
+ coinGeckoId: cw20Currency.coinGeckoId,
475
+ coinImageUrl: cw20Currency.coinImageUrl,
476
+ coinMinimalDenom: denomHelper.denom,
477
+ coinDenom: this.coinDenomGenerator(
478
+ denomTrace,
479
+ originChainInfo,
480
+ counterpartyChainInfo,
481
+ cw20Currency
482
+ ),
483
+ paths: denomTrace.paths,
484
+ originChainId: originChainInfo.chainId,
485
+ originCurrency: cw20Currency,
486
+ },
487
+ done: fromCache && !isFetching,
488
+ };
489
+ }
490
+ } else {
491
+ let isSecret20Fetching = false;
492
+ // If the origin currency is ics20-cw20.
493
+ let secret20Currency = originChainInfo.currencies.find(
494
+ (cur) =>
495
+ denomTrace &&
496
+ cur.coinMinimalDenom.startsWith(denomTrace.denom)
497
+ );
498
+ if (
499
+ !secret20Currency &&
500
+ this.chainStore.hasChain(originChainInfo.chainId)
501
+ ) {
502
+ const originQueries = this.queriesStore.get(
503
+ originChainInfo.chainId
504
+ );
505
+ if (originQueries.secret) {
506
+ const contractAddress = denomTrace.denom.replace("cw20:", "");
507
+ const contractInfo =
508
+ originQueries.secret.querySecret20ContractInfo.getQueryContract(
509
+ contractAddress
510
+ );
511
+ isSecret20Fetching = contractInfo.isFetching;
512
+ if (contractInfo.response) {
513
+ secret20Currency = {
514
+ type: "secret20",
515
+ contractAddress,
516
+ coinDecimals:
517
+ contractInfo.response.data.token_info.decimals,
518
+ coinDenom: contractInfo.response.data.token_info.symbol,
519
+ coinMinimalDenom: `secret20:${contractAddress}:${contractInfo.response.data.token_info.name}`,
520
+ };
521
+ }
522
+ }
523
+ }
524
+
525
+ if (secret20Currency) {
526
+ return {
527
+ value: {
528
+ coinDecimals: secret20Currency.coinDecimals,
529
+ coinGeckoId: secret20Currency.coinGeckoId,
530
+ coinImageUrl: secret20Currency.coinImageUrl,
531
+ coinMinimalDenom: denomHelper.denom,
532
+ coinDenom: this.coinDenomGenerator(
533
+ denomTrace,
534
+ originChainInfo,
535
+ counterpartyChainInfo,
536
+ secret20Currency
537
+ ),
538
+ paths: denomTrace.paths,
539
+ originChainId: originChainInfo.chainId,
540
+ originCurrency: secret20Currency,
541
+ },
542
+ done: fromCache && !isSecret20Fetching,
543
+ };
544
+ }
545
+ }
546
+ break;
547
+ case isERC20Currency:
548
+ let isERC20Fetching = false;
549
+ // If the origin currency is ics20-erc20.
550
+ let erc20Currency = originChainInfo.currencies.find(
331
551
  (cur) =>
332
552
  denomTrace && cur.coinMinimalDenom.startsWith(denomTrace.denom)
333
553
  );
334
554
  if (
335
- !cw20Currency &&
555
+ !erc20Currency &&
336
556
  this.chainStore.hasChain(originChainInfo.chainId)
337
557
  ) {
338
558
  const originQueries = this.queriesStore.get(
339
559
  originChainInfo.chainId
340
560
  );
341
- if (originQueries.cosmwasm) {
342
- const contractAddress = denomTrace.denom.replace("cw20:", "");
561
+ if (originQueries.ethereum) {
562
+ const contractAddress = denomTrace.denom.replace("erc20/", "");
343
563
  const contractInfo =
344
- originQueries.cosmwasm.querycw20ContractInfo.getQueryContract(
564
+ originQueries.ethereum.queryEthereumERC20ContractInfo.getQueryContract(
345
565
  contractAddress
346
566
  );
347
- isFetching = contractInfo.isFetching;
348
- if (contractInfo.response) {
349
- cw20Currency = {
350
- type: "cw20",
567
+ isERC20Fetching = contractInfo.isFetching;
568
+ if (contractInfo.tokenInfo) {
569
+ erc20Currency = {
570
+ type: "erc20",
351
571
  contractAddress,
352
- coinDecimals: contractInfo.response.data.decimals,
353
- coinDenom: contractInfo.response.data.symbol,
354
- coinMinimalDenom: `cw20:${contractAddress}:${contractInfo.response.data.name}`,
572
+ coinDecimals: contractInfo.tokenInfo.decimals,
573
+ coinDenom: contractInfo.tokenInfo.symbol,
574
+ coinMinimalDenom: `erc20:${contractAddress}`,
355
575
  };
356
576
  }
357
577
  }
358
578
  }
359
579
 
360
- if (cw20Currency) {
580
+ if (erc20Currency) {
361
581
  return {
362
582
  value: {
363
- coinDecimals: cw20Currency.coinDecimals,
364
- coinGeckoId: cw20Currency.coinGeckoId,
365
- coinImageUrl: cw20Currency.coinImageUrl,
583
+ coinDecimals: erc20Currency.coinDecimals,
584
+ coinGeckoId: erc20Currency.coinGeckoId,
585
+ coinImageUrl: erc20Currency.coinImageUrl,
366
586
  coinMinimalDenom: denomHelper.denom,
367
587
  coinDenom: this.coinDenomGenerator(
368
588
  denomTrace,
369
589
  originChainInfo,
370
590
  counterpartyChainInfo,
371
- cw20Currency
591
+ erc20Currency
372
592
  ),
373
593
  paths: denomTrace.paths,
374
594
  originChainId: originChainInfo.chainId,
375
- originCurrency: cw20Currency,
595
+ originCurrency: erc20Currency,
376
596
  },
377
- done: fromCache && !isFetching,
597
+ done: fromCache && !isERC20Fetching,
378
598
  };
379
599
  }
380
- } else {
381
- let isSecret20Fetching = false;
382
- // If the origin currency is ics20-cw20.
383
- let secret20Currency = originChainInfo.currencies.find(
384
- (cur) =>
385
- denomTrace && cur.coinMinimalDenom.startsWith(denomTrace.denom)
386
- );
387
- if (
388
- !secret20Currency &&
389
- this.chainStore.hasChain(originChainInfo.chainId)
390
- ) {
391
- const originQueries = this.queriesStore.get(
392
- originChainInfo.chainId
393
- );
394
- if (originQueries.secret) {
395
- const contractAddress = denomTrace.denom.replace("cw20:", "");
396
- const contractInfo =
397
- originQueries.secret.querySecret20ContractInfo.getQueryContract(
398
- contractAddress
399
- );
400
- isSecret20Fetching = contractInfo.isFetching;
401
- if (contractInfo.response) {
402
- secret20Currency = {
403
- type: "secret20",
404
- contractAddress,
405
- coinDecimals:
406
- contractInfo.response.data.token_info.decimals,
407
- coinDenom: contractInfo.response.data.token_info.symbol,
408
- coinMinimalDenom: `secret20:${contractAddress}:${contractInfo.response.data.token_info.name}`,
409
- };
410
- }
411
- }
412
- }
600
+ break;
601
+ default:
602
+ const currency = originChainInfo.findCurrency(denomTrace.denom);
413
603
 
414
- if (secret20Currency) {
604
+ if (currency && !("paths" in currency)) {
415
605
  return {
416
606
  value: {
417
- coinDecimals: secret20Currency.coinDecimals,
418
- coinGeckoId: secret20Currency.coinGeckoId,
419
- coinImageUrl: secret20Currency.coinImageUrl,
607
+ coinDecimals: currency.coinDecimals,
608
+ coinGeckoId: currency.coinGeckoId,
609
+ coinImageUrl: currency.coinImageUrl,
420
610
  coinMinimalDenom: denomHelper.denom,
421
611
  coinDenom: this.coinDenomGenerator(
422
612
  denomTrace,
423
613
  originChainInfo,
424
614
  counterpartyChainInfo,
425
- secret20Currency
615
+ currency
426
616
  ),
427
617
  paths: denomTrace.paths,
428
618
  originChainId: originChainInfo.chainId,
429
- originCurrency: secret20Currency,
619
+ originCurrency: currency,
430
620
  },
431
- done: fromCache && !isSecret20Fetching,
621
+ done: (() => {
622
+ if (
623
+ originChainInfo.isCurrencyRegistrationInProgress(
624
+ currency.coinMinimalDenom
625
+ )
626
+ ) {
627
+ return false;
628
+ }
629
+
630
+ return fromCache;
631
+ })(),
432
632
  };
433
633
  }
434
- }
435
- break;
436
- case isERC20Currency:
437
- let isERC20Fetching = false;
438
- // If the origin currency is ics20-erc20.
439
- let erc20Currency = originChainInfo.currencies.find(
440
- (cur) =>
441
- denomTrace && cur.coinMinimalDenom.startsWith(denomTrace.denom)
442
- );
443
- if (
444
- !erc20Currency &&
445
- this.chainStore.hasChain(originChainInfo.chainId)
446
- ) {
447
- const originQueries = this.queriesStore.get(
448
- originChainInfo.chainId
449
- );
450
- if (originQueries.ethereum) {
451
- const contractAddress = denomTrace.denom.replace("erc20/", "");
452
- const contractInfo =
453
- originQueries.ethereum.queryEthereumERC20ContractInfo.getQueryContract(
454
- contractAddress
455
- );
456
- isERC20Fetching = contractInfo.isFetching;
457
- if (contractInfo.tokenInfo) {
458
- erc20Currency = {
459
- type: "erc20",
460
- contractAddress,
461
- coinDecimals: contractInfo.tokenInfo.decimals,
462
- coinDenom: contractInfo.tokenInfo.symbol,
463
- coinMinimalDenom: `erc20:${contractAddress}`,
464
- };
465
- }
466
- }
467
- }
468
-
469
- if (erc20Currency) {
470
- return {
471
- value: {
472
- coinDecimals: erc20Currency.coinDecimals,
473
- coinGeckoId: erc20Currency.coinGeckoId,
474
- coinImageUrl: erc20Currency.coinImageUrl,
475
- coinMinimalDenom: denomHelper.denom,
476
- coinDenom: this.coinDenomGenerator(
477
- denomTrace,
478
- originChainInfo,
479
- counterpartyChainInfo,
480
- erc20Currency
481
- ),
482
- paths: denomTrace.paths,
483
- originChainId: originChainInfo.chainId,
484
- originCurrency: erc20Currency,
485
- },
486
- done: fromCache && !isERC20Fetching,
487
- };
488
- }
489
- break;
490
- default:
491
- const currency = originChainInfo.findCurrency(denomTrace.denom);
492
-
493
- if (currency && !("paths" in currency)) {
494
- return {
495
- value: {
496
- coinDecimals: currency.coinDecimals,
497
- coinGeckoId: currency.coinGeckoId,
498
- coinImageUrl: currency.coinImageUrl,
499
- coinMinimalDenom: denomHelper.denom,
500
- coinDenom: this.coinDenomGenerator(
501
- denomTrace,
502
- originChainInfo,
503
- counterpartyChainInfo,
504
- currency
505
- ),
506
- paths: denomTrace.paths,
507
- originChainId: originChainInfo.chainId,
508
- originCurrency: currency,
509
- },
510
- done: (() => {
511
- if (
512
- originChainInfo.isCurrencyRegistrationInProgress(
513
- currency.coinMinimalDenom
514
- )
515
- ) {
516
- return false;
517
- }
634
+ break;
635
+ }
518
636
 
519
- return fromCache;
520
- })(),
521
- };
522
- }
523
- break;
637
+ // In this case, just show the raw currency.
638
+ // But, it is possible to know the currency from query later.
639
+ // So, let them to be observed.
640
+ return {
641
+ value: {
642
+ coinDecimals: 0,
643
+ coinMinimalDenom: denomHelper.denom,
644
+ coinDenom: this.coinDenomGenerator(
645
+ denomTrace,
646
+ originChainInfo,
647
+ counterpartyChainInfo,
648
+ undefined
649
+ ),
650
+ paths: denomTrace.paths,
651
+ originChainId: undefined,
652
+ originCurrency: undefined,
653
+ },
654
+ done: false,
655
+ };
524
656
  }
525
-
526
- // In this case, just show the raw currency.
527
- // But, it is possible to know the currency from query later.
528
- // So, let them to be observed.
529
- return {
530
- value: {
531
- coinDecimals: 0,
532
- coinMinimalDenom: denomHelper.denom,
533
- coinDenom: this.coinDenomGenerator(
534
- denomTrace,
535
- originChainInfo,
536
- counterpartyChainInfo,
537
- undefined
538
- ),
539
- paths: denomTrace.paths,
540
- originChainId: undefined,
541
- originCurrency: undefined,
542
- },
543
- done: false,
544
- };
545
657
  }
546
658
 
547
659
  return {