@keplr-wallet/stores 0.12.104 → 0.12.105

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.
@@ -0,0 +1,12 @@
1
+ import { ObservableChainQuery } from "../../chain-query";
2
+ import { GasPrices } from "./types";
3
+ import { QuerySharedContext } from "../../../common";
4
+ import { ChainGetter } from "../../../chain";
5
+ import { Dec } from "@keplr-wallet/unit";
6
+ export declare class ObservableQueryFeeMarketGasPrices extends ObservableChainQuery<GasPrices> {
7
+ constructor(sharedContext: QuerySharedContext, chainId: string, chainGetter: ChainGetter);
8
+ get gasPrices(): {
9
+ denom: string;
10
+ amount: Dec;
11
+ }[];
12
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ObservableQueryFeeMarketGasPrices = void 0;
4
+ const chain_query_1 = require("../../chain-query");
5
+ const mobx_1 = require("mobx");
6
+ const unit_1 = require("@keplr-wallet/unit");
7
+ class ObservableQueryFeeMarketGasPrices extends chain_query_1.ObservableChainQuery {
8
+ constructor(sharedContext, chainId, chainGetter) {
9
+ super(sharedContext, chainId, chainGetter, "/feemarket/v1/gas_prices");
10
+ (0, mobx_1.makeObservable)(this);
11
+ }
12
+ get gasPrices() {
13
+ if (!this.response || !this.response.data.prices) {
14
+ return [];
15
+ }
16
+ return this.response.data.prices.map((price) => {
17
+ return {
18
+ denom: price.denom,
19
+ amount: new unit_1.Dec(price.amount),
20
+ };
21
+ });
22
+ }
23
+ }
24
+ exports.ObservableQueryFeeMarketGasPrices = ObservableQueryFeeMarketGasPrices;
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/query/cosmos/feemarket/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyD;AAIzD,+BAAsC;AACtC,6CAAyC;AAEzC,MAAa,iCAAkC,SAAQ,kCAA+B;IACpF,YACE,aAAiC,EACjC,OAAe,EACf,WAAwB;QAExB,KAAK,CAAC,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,0BAA0B,CAAC,CAAC;QAEvE,IAAA,qBAAc,EAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAED,IAAI,SAAS;QAIX,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE;YAChD,OAAO,EAAE,CAAC;SACX;QAED,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YAC7C,OAAO;gBACL,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,MAAM,EAAE,IAAI,UAAG,CAAC,KAAK,CAAC,MAAM,CAAC;aAC9B,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA1BD,8EA0BC"}
@@ -0,0 +1,6 @@
1
+ export interface GasPrices {
2
+ prices: {
3
+ denom: string;
4
+ amount: string;
5
+ }[];
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/query/cosmos/feemarket/types.ts"],"names":[],"mappings":""}
@@ -9,6 +9,7 @@ import { ObservableQueryDistributionParams } from "./distribution";
9
9
  import { ObservableQueryRPCStatus } from "./status";
10
10
  import { ObservableQueryAuthZGranter } from "./authz";
11
11
  import { QuerySharedContext } from "../../common";
12
+ import { ObservableQueryFeeMarketGasPrices } from "./feemarket";
12
13
  export interface CosmosQueries {
13
14
  cosmos: CosmosQueriesImpl;
14
15
  }
@@ -30,5 +31,6 @@ export declare class CosmosQueriesImpl {
30
31
  readonly queryIBCChannel: DeepReadonly<ObservableQueryIBCChannel>;
31
32
  readonly queryIBCDenomTrace: DeepReadonly<ObservableQueryDenomTrace>;
32
33
  readonly queryAuthZGranter: DeepReadonly<ObservableQueryAuthZGranter>;
34
+ readonly queryFeeMarketGasPrices: DeepReadonly<ObservableQueryFeeMarketGasPrices>;
33
35
  constructor(base: QueriesSetBase, sharedContext: QuerySharedContext, chainId: string, chainGetter: ChainGetter);
34
36
  }
@@ -8,6 +8,7 @@ const balance_1 = require("./balance");
8
8
  const distribution_1 = require("./distribution");
9
9
  const status_1 = require("./status");
10
10
  const authz_1 = require("./authz");
11
+ const feemarket_1 = require("./feemarket");
11
12
  exports.CosmosQueries = {
12
13
  use() {
13
14
  return (queriesSetBase, sharedContext, chainId, chainGetter) => {
@@ -34,6 +35,7 @@ class CosmosQueriesImpl {
34
35
  this.queryIBCChannel = new ibc_1.ObservableQueryIBCChannel(sharedContext, chainId, chainGetter);
35
36
  this.queryIBCDenomTrace = new ibc_1.ObservableQueryDenomTrace(sharedContext, chainId, chainGetter);
36
37
  this.queryAuthZGranter = new authz_1.ObservableQueryAuthZGranter(sharedContext, chainId, chainGetter);
38
+ this.queryFeeMarketGasPrices = new feemarket_1.ObservableQueryFeeMarketGasPrices(sharedContext, chainId, chainGetter);
37
39
  }
38
40
  }
39
41
  exports.CosmosQueriesImpl = CosmosQueriesImpl;
@@ -1 +1 @@
1
- {"version":3,"file":"queries.js","sourceRoot":"","sources":["../../../src/query/cosmos/queries.ts"],"names":[],"mappings":";;;AAEA,uCAAmD;AACnD,uCAOmB;AACnB,+BAIe;AACf,uCAGmB;AAEnB,iDAAmE;AACnE,qCAAoD;AACpD,mCAAsD;AAOzC,QAAA,aAAa,GAAG;IAC3B,GAAG;QAMD,OAAO,CACL,cAA8B,EAC9B,aAAiC,EACjC,OAAe,EACf,WAAwB,EACxB,EAAE;YACF,OAAO;gBACL,MAAM,EAAE,IAAI,iBAAiB,CAC3B,cAAc,EACd,aAAa,EACb,OAAO,EACP,WAAW,CACZ;aACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,MAAa,iBAA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CACZ,CAAC;QACF,IAAI,CAAC,kBAAkB,GAAG,IAAI,+BAAyB,CACrD,aAAa,EACb,OAAO,EACP,WAAW,CACZ,CAAC;QACF,IAAI,CAAC,iBAAiB,GAAG,IAAI,mCAA2B,CACtD,aAAa,EACb,OAAO,EACP,WAAW,CACZ,CAAC;IACJ,CAAC;CACF;AAxGD,8CAwGC"}
1
+ {"version":3,"file":"queries.js","sourceRoot":"","sources":["../../../src/query/cosmos/queries.ts"],"names":[],"mappings":";;;AAEA,uCAAmD;AACnD,uCAOmB;AACnB,+BAIe;AACf,uCAGmB;AAEnB,iDAAmE;AACnE,qCAAoD;AACpD,mCAAsD;AAEtD,2CAAgE;AAMnD,QAAA,aAAa,GAAG;IAC3B,GAAG;QAMD,OAAO,CACL,cAA8B,EAC9B,aAAiC,EACjC,OAAe,EACf,WAAwB,EACxB,EAAE;YACF,OAAO;gBACL,MAAM,EAAE,IAAI,iBAAiB,CAC3B,cAAc,EACd,aAAa,EACb,OAAO,EACP,WAAW,CACZ;aACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,MAAa,iBAAiB;IAqB5B,YACE,IAAoB,EACpB,aAAiC,EACjC,OAAe,EACf,WAAwB;QAExB,IAAI,CAAC,cAAc,GAAG,IAAI,iCAAwB,CAChD,aAAa,EACb,OAAO,EACP,WAAW,CACZ,CAAC;QAEF,IAAI,CAAC,aAAa,CAAC,kBAAkB,CACnC,IAAI,8CAAoC,CAAC,aAAa,CAAC,CACxD,CAAC;QAEF,IAAI,CAAC,YAAY,GAAG,IAAI,gCAAsB,CAC5C,aAAa,EACb,OAAO,EACP,WAAW,CACZ,CAAC;QACF,IAAI,CAAC,sBAAsB,GAAG,IAAI,0CAAgC,CAChE,aAAa,EACb,OAAO,EACP,WAAW,CACZ,CAAC;QACF,IAAI,CAAC,SAAS,GAAG,IAAI,oCAA0B,CAC7C,aAAa,EACb,OAAO,EACP,WAAW,CACZ,CAAC;QACF,IAAI,CAAC,kBAAkB,GAAG,IAAI,sCAA4B,CACxD,aAAa,EACb,OAAO,EACP,WAAW,CACZ,CAAC;QAEF,IAAI,CAAC,uBAAuB,GAAG,IAAI,gDAAiC,CAClE,aAAa,EACb,OAAO,EACP,WAAW,CACZ,CAAC;QAEF,IAAI,CAAC,YAAY,GAAG,IAAI,gCAAsB,CAC5C,aAAa,EACb,OAAO,EACP,WAAW,CACZ,CAAC;QACF,IAAI,CAAC,gBAAgB,GAAG,IAAI,oCAA0B,CACpD,aAAa,EACb,OAAO,EACP,WAAW,CACZ,CAAC;QACF,IAAI,CAAC,yBAAyB,GAAG,IAAI,6CAAmC,CACtE,aAAa,EACb,OAAO,EACP,WAAW,CACZ,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,IAAI,mCAAyB,CAClD,aAAa,EACb,OAAO,EACP,WAAW,CACZ,CAAC;QAEF,IAAI,CAAC,mBAAmB,GAAG,IAAI,mCAA6B,CAC1D,aAAa,EACb,OAAO,EACP,WAAW,CACZ,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,IAAI,+BAAyB,CAClD,aAAa,EACb,OAAO,EACP,WAAW,CACZ,CAAC;QACF,IAAI,CAAC,kBAAkB,GAAG,IAAI,+BAAyB,CACrD,aAAa,EACb,OAAO,EACP,WAAW,CACZ,CAAC;QACF,IAAI,CAAC,iBAAiB,GAAG,IAAI,mCAA2B,CACtD,aAAa,EACb,OAAO,EACP,WAAW,CACZ,CAAC;QAEF,IAAI,CAAC,uBAAuB,GAAG,IAAI,6CAAiC,CAClE,aAAa,EACb,OAAO,EACP,WAAW,CACZ,CAAC;IACJ,CAAC;CACF;AAhHD,8CAgHC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keplr-wallet/stores",
3
- "version": "0.12.104",
3
+ "version": "0.12.105",
4
4
  "main": "build/index.js",
5
5
  "author": "chainapsis",
6
6
  "license": "Apache-2.0",
@@ -16,17 +16,17 @@
16
16
  "lint-fix": "eslint --fix \"src/**/*\" && prettier --write \"src/**/*\""
17
17
  },
18
18
  "devDependencies": {
19
- "@keplr-wallet/provider-mock": "0.12.104"
19
+ "@keplr-wallet/provider-mock": "0.12.105"
20
20
  },
21
21
  "dependencies": {
22
- "@keplr-wallet/common": "0.12.104",
23
- "@keplr-wallet/cosmos": "0.12.104",
24
- "@keplr-wallet/crypto": "0.12.104",
25
- "@keplr-wallet/mobx-utils": "0.12.104",
26
- "@keplr-wallet/proto-types": "0.12.104",
27
- "@keplr-wallet/simple-fetch": "0.12.104",
28
- "@keplr-wallet/types": "0.12.104",
29
- "@keplr-wallet/unit": "0.12.104",
22
+ "@keplr-wallet/common": "0.12.105",
23
+ "@keplr-wallet/cosmos": "0.12.105",
24
+ "@keplr-wallet/crypto": "0.12.105",
25
+ "@keplr-wallet/mobx-utils": "0.12.105",
26
+ "@keplr-wallet/proto-types": "0.12.105",
27
+ "@keplr-wallet/simple-fetch": "0.12.105",
28
+ "@keplr-wallet/types": "0.12.105",
29
+ "@keplr-wallet/unit": "0.12.105",
30
30
  "buffer": "^6.0.3",
31
31
  "deepmerge": "^4.2.2",
32
32
  "eventemitter3": "^4.0.7",
@@ -38,5 +38,5 @@
38
38
  "mobx": "^6",
39
39
  "mobx-utils": "^6"
40
40
  },
41
- "gitHead": "e6f5b1bec9bc28084a75f2d899686fa391dbdf7f"
41
+ "gitHead": "98f41147cdc01a7a0fab0f082ec7ddf1fe1500ba"
42
42
  }
@@ -0,0 +1,34 @@
1
+ import { ObservableChainQuery } from "../../chain-query";
2
+ import { GasPrices } from "./types";
3
+ import { QuerySharedContext } from "../../../common";
4
+ import { ChainGetter } from "../../../chain";
5
+ import { makeObservable } from "mobx";
6
+ import { Dec } from "@keplr-wallet/unit";
7
+
8
+ export class ObservableQueryFeeMarketGasPrices extends ObservableChainQuery<GasPrices> {
9
+ constructor(
10
+ sharedContext: QuerySharedContext,
11
+ chainId: string,
12
+ chainGetter: ChainGetter
13
+ ) {
14
+ super(sharedContext, chainId, chainGetter, "/feemarket/v1/gas_prices");
15
+
16
+ makeObservable(this);
17
+ }
18
+
19
+ get gasPrices(): {
20
+ denom: string;
21
+ amount: Dec;
22
+ }[] {
23
+ if (!this.response || !this.response.data.prices) {
24
+ return [];
25
+ }
26
+
27
+ return this.response.data.prices.map((price) => {
28
+ return {
29
+ denom: price.denom,
30
+ amount: new Dec(price.amount),
31
+ };
32
+ });
33
+ }
34
+ }
@@ -0,0 +1,6 @@
1
+ export interface GasPrices {
2
+ prices: {
3
+ denom: string;
4
+ amount: string;
5
+ }[];
6
+ }
@@ -23,6 +23,7 @@ import { ObservableQueryDistributionParams } from "./distribution";
23
23
  import { ObservableQueryRPCStatus } from "./status";
24
24
  import { ObservableQueryAuthZGranter } from "./authz";
25
25
  import { QuerySharedContext } from "../../common";
26
+ import { ObservableQueryFeeMarketGasPrices } from "./feemarket";
26
27
 
27
28
  export interface CosmosQueries {
28
29
  cosmos: CosmosQueriesImpl;
@@ -72,6 +73,8 @@ export class CosmosQueriesImpl {
72
73
 
73
74
  public readonly queryAuthZGranter: DeepReadonly<ObservableQueryAuthZGranter>;
74
75
 
76
+ public readonly queryFeeMarketGasPrices: DeepReadonly<ObservableQueryFeeMarketGasPrices>;
77
+
75
78
  constructor(
76
79
  base: QueriesSetBase,
77
80
  sharedContext: QuerySharedContext,
@@ -156,5 +159,11 @@ export class CosmosQueriesImpl {
156
159
  chainId,
157
160
  chainGetter
158
161
  );
162
+
163
+ this.queryFeeMarketGasPrices = new ObservableQueryFeeMarketGasPrices(
164
+ sharedContext,
165
+ chainId,
166
+ chainGetter
167
+ );
159
168
  }
160
169
  }