@keplr-wallet/hooks 0.11.45 → 0.11.46

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.
@@ -3,6 +3,7 @@ import { ChainGetter, IQueriesStore } from "@keplr-wallet/stores";
3
3
  import { AppCurrency } from "@keplr-wallet/types";
4
4
  export declare class IBCAmountConfig extends AmountConfig {
5
5
  protected readonly queriesStore: IQueriesStore;
6
+ protected readonly initialChainId: string;
6
7
  constructor(chainGetter: ChainGetter, queriesStore: IQueriesStore, initialChainId: string, sender: string, feeConfig: IFeeConfig | undefined);
7
8
  get sendableCurrencies(): AppCurrency[];
8
9
  }
@@ -15,11 +15,19 @@ class IBCAmountConfig extends tx_1.AmountConfig {
15
15
  constructor(chainGetter, queriesStore, initialChainId, sender, feeConfig) {
16
16
  super(chainGetter, queriesStore, initialChainId, sender, feeConfig);
17
17
  this.queriesStore = queriesStore;
18
+ this.initialChainId = initialChainId;
18
19
  mobx_1.makeObservable(this);
19
20
  }
20
21
  get sendableCurrencies() {
21
- // Only native currencies can be sent by IBC transfer.
22
- return super.sendableCurrencies.filter((cur) => new common_1.DenomHelper(cur.coinMinimalDenom).type === "native");
22
+ // Only native currencies and Evmos ERC-20's can be sent by IBC transfer.
23
+ return super.sendableCurrencies.filter((cur) => {
24
+ var _a;
25
+ const type = new common_1.DenomHelper(cur.coinMinimalDenom).type;
26
+ const isEvmosERC20 = (_a = this.chainGetter
27
+ .getChain(this.initialChainId)
28
+ .features) === null || _a === void 0 ? void 0 : _a.includes("evmos-erc20");
29
+ return type === "native" || isEvmosERC20;
30
+ });
23
31
  }
24
32
  }
25
33
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"amount.js","sourceRoot":"","sources":["../../src/ibc/amount.ts"],"names":[],"mappings":";;;;;;;;;AAAA,8BAAiD;AAGjD,+BAAgD;AAChD,iDAAmD;AACnD,iCAAiC;AAEjC,MAAa,eAAgB,SAAQ,iBAAY;IAC/C,YACE,WAA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D,iBAAY,GAAZ,YAAY,CAAe;QAC3B,mBAAc,GAAd,cAAc,CAAQ;QAMzC,qBAAc,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAGD,IAAI,kBAAkB;QACpB,yEAAyE;QACzE,OAAO,KAAK,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE;;YAC7C,MAAM,IAAI,GAAG,IAAI,oBAAW,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC;YACxD,MAAM,YAAY,SAAG,IAAI,CAAC,WAAW;iBAClC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC;iBAC7B,QAAQ,0CAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;YAErC,OAAO,IAAI,KAAK,QAAQ,IAAI,YAAY,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAXC;IADC,eAAQ;yDAWR;AAxBH,0CAyBC;AAEM,MAAM,kBAAkB,GAAG,CAChC,WAAwB,EACxB,YAA2B,EAC3B,OAAe,EACf,MAAc,EACd,EAAE;IACF,MAAM,CAAC,QAAQ,CAAC,GAAG,gBAAQ,CACzB,GAAG,EAAE,CACH,IAAI,eAAe,CAAC,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAC7E,CAAC;IACF,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAE3B,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAdW,QAAA,kBAAkB,sBAc7B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keplr-wallet/hooks",
3
- "version": "0.11.45",
3
+ "version": "0.11.46",
4
4
  "main": "build/index.js",
5
5
  "author": "chainapsis",
6
6
  "license": "Apache-2.0",
@@ -21,16 +21,16 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@ethersproject/address": "^5.6.0",
24
- "@keplr-wallet/background": "0.11.45",
25
- "@keplr-wallet/common": "0.11.45",
26
- "@keplr-wallet/cosmos": "0.11.45",
27
- "@keplr-wallet/crypto": "0.11.45",
28
- "@keplr-wallet/popup": "0.11.45",
29
- "@keplr-wallet/proto-types": "0.11.45",
30
- "@keplr-wallet/stores": "0.11.45",
31
- "@keplr-wallet/stores-etc": "0.11.45",
32
- "@keplr-wallet/types": "0.11.45",
33
- "@keplr-wallet/unit": "0.11.45",
24
+ "@keplr-wallet/background": "0.11.46",
25
+ "@keplr-wallet/common": "0.11.46",
26
+ "@keplr-wallet/cosmos": "0.11.46",
27
+ "@keplr-wallet/crypto": "0.11.46",
28
+ "@keplr-wallet/popup": "0.11.46",
29
+ "@keplr-wallet/proto-types": "0.11.46",
30
+ "@keplr-wallet/stores": "0.11.46",
31
+ "@keplr-wallet/stores-etc": "0.11.46",
32
+ "@keplr-wallet/types": "0.11.46",
33
+ "@keplr-wallet/unit": "0.11.46",
34
34
  "axios": "^0.27.2",
35
35
  "buffer": "^6.0.3",
36
36
  "long": "^4.0.0",
@@ -40,5 +40,5 @@
40
40
  "react-router": "^5.1.2",
41
41
  "utility-types": "^3.10.0"
42
42
  },
43
- "gitHead": "671429d8037aaa6133708ad93c1eba526f37009e"
43
+ "gitHead": "77b91ddbb031fb1c539f22b0f9b0988919322ecc"
44
44
  }
package/src/ibc/amount.ts CHANGED
@@ -9,7 +9,7 @@ export class IBCAmountConfig extends AmountConfig {
9
9
  constructor(
10
10
  chainGetter: ChainGetter,
11
11
  protected readonly queriesStore: IQueriesStore,
12
- initialChainId: string,
12
+ protected readonly initialChainId: string,
13
13
  sender: string,
14
14
  feeConfig: IFeeConfig | undefined
15
15
  ) {
@@ -20,10 +20,15 @@ export class IBCAmountConfig extends AmountConfig {
20
20
 
21
21
  @computed
22
22
  get sendableCurrencies(): AppCurrency[] {
23
- // Only native currencies can be sent by IBC transfer.
24
- return super.sendableCurrencies.filter(
25
- (cur) => new DenomHelper(cur.coinMinimalDenom).type === "native"
26
- );
23
+ // Only native currencies and Evmos ERC-20's can be sent by IBC transfer.
24
+ return super.sendableCurrencies.filter((cur) => {
25
+ const type = new DenomHelper(cur.coinMinimalDenom).type;
26
+ const isEvmosERC20 = this.chainGetter
27
+ .getChain(this.initialChainId)
28
+ .features?.includes("evmos-erc20");
29
+
30
+ return type === "native" || isEvmosERC20;
31
+ });
27
32
  }
28
33
  }
29
34