carbon-js-sdk 0.9.0 → 0.9.1-beta1

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.
Files changed (125) hide show
  1. package/lib/CarbonSDK.d.ts +10 -6
  2. package/lib/CarbonSDK.js +26 -27
  3. package/lib/clients/GasFee.d.ts +6 -6
  4. package/lib/clients/GasFee.js +10 -17
  5. package/lib/codec/Switcheo/carbon/ccm/ccm.d.ts +3 -3
  6. package/lib/codec/Switcheo/carbon/liquidation/liquidation.d.ts +3 -3
  7. package/lib/codec/Switcheo/carbon/marketstats/params.d.ts +3 -3
  8. package/lib/codec/alliance/alliance.d.ts +5 -5
  9. package/lib/codec/alliance/delegations.d.ts +8 -8
  10. package/lib/codec/alliance/events.d.ts +6 -6
  11. package/lib/codec/alliance/genesis.d.ts +7 -7
  12. package/lib/codec/alliance/gov.d.ts +5 -5
  13. package/lib/codec/alliance/params.d.ts +4 -4
  14. package/lib/codec/alliance/query.d.ts +24 -24
  15. package/lib/codec/alliance/tx.d.ts +10 -10
  16. package/lib/codec/book/book.d.ts +2 -14
  17. package/lib/codec/book/book.js +13 -80
  18. package/lib/codec/book/query.d.ts +1 -48
  19. package/lib/codec/book/query.js +1 -224
  20. package/lib/codec/broker/amm.d.ts +7 -35
  21. package/lib/codec/broker/amm.js +6 -181
  22. package/lib/codec/broker/event.d.ts +0 -13
  23. package/lib/codec/broker/event.js +1 -89
  24. package/lib/codec/broker/genesis.d.ts +2 -3
  25. package/lib/codec/broker/genesis.js +11 -26
  26. package/lib/codec/cdp/event.d.ts +7 -14
  27. package/lib/codec/cdp/event.js +81 -163
  28. package/lib/codec/cdp/params.d.ts +4 -2
  29. package/lib/codec/cdp/params.js +30 -20
  30. package/lib/codec/cdp/query.d.ts +1 -22
  31. package/lib/codec/cdp/query.js +17 -104
  32. package/lib/codec/cdp/tx.d.ts +18 -40
  33. package/lib/codec/cdp/tx.js +31 -115
  34. package/lib/codec/coin/token.d.ts +0 -1
  35. package/lib/codec/coin/token.js +0 -19
  36. package/lib/codec/cosmos/app/module/v1alpha1/module.d.ts +3 -3
  37. package/lib/codec/ibc/applications/interchain_accounts/v1/genesis.d.ts +7 -7
  38. package/lib/codec/ibc/lightclients/localhost/v1/localhost.d.ts +3 -3
  39. package/lib/codec/ibc/lightclients/solomachine/v1/solomachine.d.ts +18 -18
  40. package/lib/codec/inflation/inflation.d.ts +2 -6
  41. package/lib/codec/inflation/inflation.js +25 -80
  42. package/lib/codec/liquiditypool/event.d.ts +1 -40
  43. package/lib/codec/liquiditypool/event.js +1 -294
  44. package/lib/codec/liquiditypool/genesis.d.ts +5 -4
  45. package/lib/codec/liquiditypool/genesis.js +49 -34
  46. package/lib/codec/liquiditypool/query.d.ts +51 -2
  47. package/lib/codec/liquiditypool/query.js +265 -18
  48. package/lib/codec/liquiditypool/reward.d.ts +21 -21
  49. package/lib/codec/liquiditypool/reward.js +111 -97
  50. package/lib/codec/oracle/query.d.ts +34 -37
  51. package/lib/codec/oracle/query.js +31 -37
  52. package/lib/codec/position/position.d.ts +0 -2
  53. package/lib/codec/position/position.js +0 -34
  54. package/lib/codec/proofs.d.ts +15 -15
  55. package/lib/codec/subaccount/genesis.d.ts +1 -5
  56. package/lib/codec/subaccount/genesis.js +2 -48
  57. package/lib/codec/subaccount/query.d.ts +21 -135
  58. package/lib/codec/subaccount/query.js +47 -617
  59. package/lib/codec/subaccount/subaccount.d.ts +3 -29
  60. package/lib/codec/subaccount/subaccount.js +31 -234
  61. package/lib/codec/subaccount/tx.d.ts +1 -7
  62. package/lib/codec/subaccount/tx.js +16 -101
  63. package/lib/constant/generic.d.ts +2 -0
  64. package/lib/constant/generic.js +4 -1
  65. package/lib/modules/feemarket.d.ts +1 -1
  66. package/lib/modules/feemarket.js +2 -2
  67. package/lib/provider/account/EthLedgerAccount/EthLedgerAccount.js +1 -1
  68. package/lib/provider/account/EthLedgerAccount/index.js +5 -1
  69. package/lib/provider/keplr/KeplrAccount.js +1 -1
  70. package/lib/provider/leap/LeapAccount.js +1 -1
  71. package/lib/wallet/CarbonWallet.d.ts +7 -8
  72. package/lib/wallet/CarbonWallet.js +44 -47
  73. package/package.json +1 -1
  74. package/lib/codec/Switcheo/carbon/bridge/bridge.d.ts +0 -108
  75. package/lib/codec/Switcheo/carbon/bridge/bridge.js +0 -632
  76. package/lib/codec/Switcheo/carbon/bridge/event.d.ts +0 -187
  77. package/lib/codec/Switcheo/carbon/bridge/event.js +0 -1172
  78. package/lib/codec/Switcheo/carbon/bridge/genesis.d.ts +0 -20
  79. package/lib/codec/Switcheo/carbon/bridge/genesis.js +0 -63
  80. package/lib/codec/Switcheo/carbon/bridge/params.d.ts +0 -28
  81. package/lib/codec/Switcheo/carbon/bridge/params.js +0 -81
  82. package/lib/codec/Switcheo/carbon/bridge/query.d.ts +0 -177
  83. package/lib/codec/Switcheo/carbon/bridge/query.js +0 -639
  84. package/lib/codec/Switcheo/carbon/bridge/tx.d.ts +0 -528
  85. package/lib/codec/Switcheo/carbon/bridge/tx.js +0 -2558
  86. package/lib/codec/broker/incoming_pool_swap.d.ts +0 -23
  87. package/lib/codec/broker/incoming_pool_swap.js +0 -136
  88. package/lib/codec/crisis/genesis.d.ts +0 -18
  89. package/lib/codec/crisis/genesis.js +0 -46
  90. package/lib/codec/crisis/query.d.ts +0 -43
  91. package/lib/codec/crisis/query.js +0 -103
  92. package/lib/codec/crisis/tx.d.ts +0 -12
  93. package/lib/codec/crisis/tx.js +0 -20
  94. package/lib/codec/market/legacy.d.ts +0 -62
  95. package/lib/codec/market/legacy.js +0 -630
  96. package/lib/codec/query/pagination.d.ts +0 -29
  97. package/lib/codec/query/pagination.js +0 -126
  98. package/lib/constant/amino.d.ts +0 -0
  99. package/lib/constant/amino.js +0 -1
  100. package/lib/constant/chainConfig.d.ts +0 -26
  101. package/lib/constant/chainConfig.js +0 -154
  102. package/lib/constant/eip6963Provider.d.ts +0 -26
  103. package/lib/constant/eip6963Provider.js +0 -31
  104. package/lib/constant/signless.d.ts +0 -2
  105. package/lib/constant/signless.js +0 -5
  106. package/lib/modules/signless.d.ts +0 -24
  107. package/lib/modules/signless.js +0 -108
  108. package/lib/modules/vault.d.ts +0 -56
  109. package/lib/modules/vault.js +0 -128
  110. package/lib/provider/amino/types/signless.d.ts +0 -12
  111. package/lib/provider/amino/types/signless.js +0 -193
  112. package/lib/provider/eip6963Provider/Eip6963Provider.d.ts +0 -8
  113. package/lib/provider/eip6963Provider/Eip6963Provider.js +0 -23
  114. package/lib/provider/eip6963Provider/index.d.ts +0 -1
  115. package/lib/provider/eip6963Provider/index.js +0 -8
  116. package/lib/provider/rainbowKit/RainbowKitAccount.d.ts +0 -40
  117. package/lib/provider/rainbowKit/RainbowKitAccount.js +0 -322
  118. package/lib/provider/rainbowKit/index.d.ts +0 -1
  119. package/lib/provider/rainbowKit/index.js +0 -8
  120. package/lib/provider/station/StationAccount.d.ts +0 -28
  121. package/lib/provider/station/StationAccount.js +0 -168
  122. package/lib/provider/station/index.d.ts +0 -2
  123. package/lib/provider/station/index.js +0 -10
  124. package/lib/util/signless.d.ts +0 -11
  125. package/lib/util/signless.js +0 -92
@@ -1,8 +1,9 @@
1
1
  /// <reference types="node" />
2
- import { Network, Network as _Network, NetworkConfig } from "./constant";
2
+ import { Network, NetworkConfig, Network as _Network } from "./constant";
3
3
  import { Tendermint37Client } from "@cosmjs/tendermint-rpc";
4
4
  import * as clients from "./clients";
5
5
  import { CarbonQueryClient, ETHClient, HydrogenClient, InsightsQueryClient, NEOClient, TokenClient, ZILClient } from "./clients";
6
+ import GasFee from "./clients/GasFee";
6
7
  import GrpcQueryClient from "./clients/GrpcQueryClient";
7
8
  import N3Client from "./clients/N3Client";
8
9
  import { AdminModule, AllianceModule, BankModule, BrokerModule, CDPModule, CoinModule, ERC20Module, EvmMergeModule, EvmModule, FeeModule, GovModule, IBCModule, LeverageModule, LiquidityPoolModule, MarketModule, OracleModule, OrderModule, PerpspoolModule, PositionModule, ProfileModule, SubAccountModule, XChainModule } from "./modules";
@@ -10,10 +11,9 @@ import { GrantModule } from "./modules/grant";
10
11
  import { StakingModule } from "./modules/staking";
11
12
  import { CosmosLedger, Keplr, LeapExtended } from "./provider";
12
13
  import { MetaMask } from "./provider/metamask/MetaMask";
13
- import { CarbonWallet, CarbonWalletGenericOpts, CarbonSigner, MetaMaskWalletOpts } from "./wallet";
14
- import GasFee from "./clients/GasFee";
15
- export { CarbonSigner, CarbonSignerTypes, CarbonWallet, CarbonWalletGenericOpts, CarbonWalletInitOpts } from "./wallet";
14
+ import { CarbonSigner, CarbonWallet, CarbonWalletGenericOpts, MetaMaskWalletOpts } from "./wallet";
16
15
  export { CarbonTx } from "./util";
16
+ export { CarbonSigner, CarbonSignerTypes, CarbonWallet, CarbonWalletGenericOpts, CarbonWalletInitOpts } from "./wallet";
17
17
  export * as Carbon from "./codec/carbon-models";
18
18
  export interface CarbonSDKOpts {
19
19
  network: Network;
@@ -44,6 +44,10 @@ export interface CarbonSDKInitOpts {
44
44
  */
45
45
  useTmAbciQuery?: boolean;
46
46
  }
47
+ export interface OverrideConfig {
48
+ chainId: string;
49
+ evmChainId: string;
50
+ }
47
51
  /**
48
52
  * Carbon SDK
49
53
  *
@@ -60,6 +64,7 @@ declare class CarbonSDK {
60
64
  insights: InsightsQueryClient;
61
65
  hydrogen: HydrogenClient;
62
66
  wallet?: CarbonWallet;
67
+ gasFee?: GasFee;
63
68
  network: Network;
64
69
  configOverride: Partial<NetworkConfig>;
65
70
  networkConfig: NetworkConfig;
@@ -99,7 +104,6 @@ declare class CarbonSDK {
99
104
  n3: N3Client;
100
105
  chainId: string;
101
106
  evmChainId: string;
102
- gasFee: GasFee;
103
107
  constructor(opts: CarbonSDKOpts);
104
108
  static instance(opts?: CarbonSDKInitOpts): Promise<CarbonSDK>;
105
109
  static instanceWithWallet(wallet: CarbonWallet, sdkOpts?: CarbonSDKInitOpts): Promise<ConnectedCarbonSDK>;
@@ -112,7 +116,7 @@ declare class CarbonSDK {
112
116
  static instanceWithMetamask(metamask: MetaMask, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts, metamaskWalletOpts?: MetaMaskWalletOpts): Promise<ConnectedCarbonSDK>;
113
117
  static instanceViewOnly(bech32Address: string, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
114
118
  initialize(): Promise<CarbonSDK>;
115
- private getGasFee;
119
+ getGasFee(): Promise<GasFee>;
116
120
  clone(): CarbonSDK;
117
121
  generateOpts(): CarbonSDKOpts;
118
122
  connect(wallet: CarbonWallet): Promise<ConnectedCarbonSDK>;
package/lib/CarbonSDK.js CHANGED
@@ -31,13 +31,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
31
31
  return (mod && mod.__esModule) ? mod : { "default": mod };
32
32
  };
33
33
  Object.defineProperty(exports, "__esModule", { value: true });
34
- exports.ConnectedCarbonSDK = exports.Carbon = exports.CarbonTx = exports.CarbonWallet = exports.CarbonSignerTypes = void 0;
34
+ exports.ConnectedCarbonSDK = exports.Carbon = exports.CarbonWallet = exports.CarbonSignerTypes = exports.CarbonTx = void 0;
35
35
  const constant_1 = require("./constant");
36
36
  const util_1 = require("./util");
37
37
  const tendermint_rpc_1 = require("@cosmjs/tendermint-rpc");
38
38
  const grpc_web_node_http_transport_1 = require("@improbable-eng/grpc-web-node-http-transport");
39
39
  const clients = __importStar(require("./clients"));
40
40
  const clients_1 = require("./clients");
41
+ const GasFee_1 = __importDefault(require("./clients/GasFee"));
41
42
  const GrpcQueryClient_1 = __importDefault(require("./clients/GrpcQueryClient"));
42
43
  const N3Client_1 = __importDefault(require("./clients/N3Client"));
43
44
  const modules_1 = require("./modules");
@@ -45,17 +46,14 @@ const grant_1 = require("./modules/grant");
45
46
  const staking_1 = require("./modules/staking");
46
47
  const provider_1 = require("./provider");
47
48
  const blockchain_1 = require("./util/blockchain");
48
- const wallet_1 = require("./wallet");
49
49
  const number_1 = require("./util/number");
50
- const GasFee_1 = __importDefault(require("./clients/GasFee"));
51
- const pagination_1 = require("cosmjs-types/cosmos/base/query/v1beta1/pagination");
50
+ const wallet_1 = require("./wallet");
51
+ var util_2 = require("./util");
52
+ Object.defineProperty(exports, "CarbonTx", { enumerable: true, get: function () { return util_2.CarbonTx; } });
52
53
  var wallet_2 = require("./wallet");
53
54
  Object.defineProperty(exports, "CarbonSignerTypes", { enumerable: true, get: function () { return wallet_2.CarbonSignerTypes; } });
54
55
  Object.defineProperty(exports, "CarbonWallet", { enumerable: true, get: function () { return wallet_2.CarbonWallet; } });
55
- var util_2 = require("./util");
56
- Object.defineProperty(exports, "CarbonTx", { enumerable: true, get: function () { return util_2.CarbonTx; } });
57
56
  exports.Carbon = __importStar(require("./codec/carbon-models"));
58
- const long_1 = __importDefault(require("long"));
59
57
  const DEFAULT_SDK_INIT_OPTS = {
60
58
  network: constant_1.DEFAULT_NETWORK,
61
59
  };
@@ -66,22 +64,22 @@ const DEFAULT_SDK_INIT_OPTS = {
66
64
  */
67
65
  class CarbonSDK {
68
66
  constructor(opts) {
69
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
67
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
70
68
  this.network = (_a = opts.network) !== null && _a !== void 0 ? _a : constant_1.DEFAULT_NETWORK;
71
69
  this.configOverride = (_b = opts.config) !== null && _b !== void 0 ? _b : {};
72
70
  this.networkConfig = util_1.GenericUtils.overrideConfig(constant_1.NetworkConfigs[this.network], this.configOverride);
73
71
  this.useTmAbciQuery = (_c = opts.useTmAbciQuery) !== null && _c !== void 0 ? _c : false;
74
- this.gasFee = (_d = opts.gasFee) !== null && _d !== void 0 ? _d : GasFee_1.default.instance();
72
+ this.gasFee = opts.gasFee;
75
73
  this.tmClient = opts.tmClient;
76
74
  this.wallet = opts.wallet;
77
- this.chainId = (_f = (_e = opts.chainId) !== null && _e !== void 0 ? _e : constant_1.CarbonChainIDs[this.network]) !== null && _f !== void 0 ? _f : constant_1.CarbonChainIDs[constant_1.Network.MainNet];
78
- this.evmChainId = (_h = (_g = opts.evmChainId) !== null && _g !== void 0 ? _g : constant_1.CarbonEvmChainIDs[this.network]) !== null && _h !== void 0 ? _h : constant_1.CarbonEvmChainIDs[constant_1.Network.MainNet];
75
+ this.chainId = (_e = (_d = opts.chainId) !== null && _d !== void 0 ? _d : constant_1.CarbonChainIDs[this.network]) !== null && _e !== void 0 ? _e : constant_1.CarbonChainIDs[constant_1.Network.MainNet];
76
+ this.evmChainId = (_g = (_f = opts.evmChainId) !== null && _f !== void 0 ? _f : constant_1.CarbonEvmChainIDs[this.network]) !== null && _g !== void 0 ? _g : constant_1.CarbonEvmChainIDs[constant_1.Network.MainNet];
79
77
  let carbonQueryClient;
80
78
  if (!opts.query) {
81
79
  let grpcClient;
82
80
  if (opts.useTmAbciQuery !== true && this.networkConfig.grpcUrl) {
83
81
  const transport = typeof window === "undefined" ? grpc_web_node_http_transport_1.NodeHttpTransport() : undefined;
84
- grpcClient = (_j = opts.grpcQueryClient) !== null && _j !== void 0 ? _j : new GrpcQueryClient_1.default(this.networkConfig.grpcWebUrl, {
82
+ grpcClient = (_h = opts.grpcQueryClient) !== null && _h !== void 0 ? _h : new GrpcQueryClient_1.default(this.networkConfig.grpcWebUrl, {
85
83
  transport,
86
84
  });
87
85
  }
@@ -90,10 +88,10 @@ class CarbonSDK {
90
88
  grpcClient,
91
89
  });
92
90
  }
93
- this.query = ((_k = opts.query) !== null && _k !== void 0 ? _k : carbonQueryClient);
94
- this.insights = (_l = opts.insights) !== null && _l !== void 0 ? _l : new clients_1.InsightsQueryClient(this.networkConfig);
95
- this.token = (_m = opts.token) !== null && _m !== void 0 ? _m : clients_1.TokenClient.instance(this.query, this);
96
- this.hydrogen = (_o = opts.hydrogen) !== null && _o !== void 0 ? _o : new clients_1.HydrogenClient(this.networkConfig, this.token);
91
+ this.query = ((_j = opts.query) !== null && _j !== void 0 ? _j : carbonQueryClient);
92
+ this.insights = (_k = opts.insights) !== null && _k !== void 0 ? _k : new clients_1.InsightsQueryClient(this.networkConfig);
93
+ this.token = (_l = opts.token) !== null && _l !== void 0 ? _l : clients_1.TokenClient.instance(this.query, this);
94
+ this.hydrogen = (_m = opts.hydrogen) !== null && _m !== void 0 ? _m : new clients_1.HydrogenClient(this.networkConfig, this.token);
97
95
  this.admin = new modules_1.AdminModule(this);
98
96
  this.alliance = new modules_1.AllianceModule(this);
99
97
  this.order = new modules_1.OrderModule(this);
@@ -255,27 +253,24 @@ class CarbonSDK {
255
253
  }
256
254
  getGasFee() {
257
255
  return __awaiter(this, void 0, void 0, function* () {
256
+ if (this.gasFee)
257
+ return this.gasFee;
258
258
  const queryClient = this.query;
259
259
  const { msgGasCosts } = yield queryClient.fee.MsgGasCostAll({
260
- pagination: pagination_1.PageRequest.fromPartial({
261
- limit: new long_1.default(10000),
262
- }),
260
+ pagination: constant_1.PAGINATE_10K,
263
261
  });
264
262
  const txGasCosts = msgGasCosts.reduce((result, item) => {
265
263
  result[item.msgType] = number_1.bnOrZero(item.gasCost);
266
264
  return result;
267
265
  }, {});
268
266
  const { minGasPrices } = yield queryClient.fee.MinGasPriceAll({
269
- pagination: pagination_1.PageRequest.fromPartial({
270
- limit: new long_1.default(10000),
271
- }),
267
+ pagination: constant_1.PAGINATE_10K,
272
268
  });
273
269
  const txGasPrices = minGasPrices.reduce((result, item) => {
274
270
  result[item.denom] = number_1.bnOrZero(item.gasPrice).shiftedBy(-18); // sdk.Dec shifting
275
271
  return result;
276
272
  }, {});
277
- const fees = new GasFee_1.default(txGasCosts, txGasPrices);
278
- return fees;
273
+ return new GasFee_1.default(txGasCosts, txGasPrices);
279
274
  });
280
275
  }
281
276
  clone() {
@@ -302,8 +297,12 @@ class CarbonSDK {
302
297
  if (!wallet.initialized) {
303
298
  try {
304
299
  // Perform initialize function as per normal, but add try-catch statement to check err message
305
- const fees = yield this.getGasFee();
306
- yield wallet.initialize(this.query, fees);
300
+ const overrideConfig = {
301
+ chainId: this.chainId,
302
+ evmChainId: this.evmChainId,
303
+ };
304
+ const gasFee = yield this.getGasFee();
305
+ yield wallet.initialize(this.query, gasFee, overrideConfig);
307
306
  }
308
307
  catch (err) {
309
308
  const errorTyped = err;
@@ -320,7 +319,7 @@ class CarbonSDK {
320
319
  }
321
320
  disconnect() {
322
321
  var _a;
323
- if ((_a = this.wallet) === null || _a === void 0 ? void 0 : _a.isSigner(wallet_1.CarbonSignerTypes.Ledger)) {
322
+ if ((_a = this.wallet) === null || _a === void 0 ? void 0 : _a.isLedgerSigner()) {
324
323
  this.wallet.signer.ledger.disconnect();
325
324
  }
326
325
  const opts = this.generateOpts();
@@ -1,12 +1,12 @@
1
1
  import { SimpleMap } from "../util/type";
2
2
  import BigNumber from "bignumber.js";
3
3
  declare class GasFee {
4
- readonly txGasCosts?: SimpleMap<BigNumber>;
5
- readonly txGasPrices?: SimpleMap<BigNumber>;
6
- constructor(txGasCosts: SimpleMap<BigNumber>, txGasPrices: SimpleMap<BigNumber>);
7
- static instance(txGasCosts?: SimpleMap<BigNumber>, txGasPrices?: SimpleMap<BigNumber>): GasFee;
8
- getFee(msgTypeUrl: string, denom?: string): BigNumber;
9
- getGasPrice(denom: string): BigNumber;
4
+ readonly txGasCosts: SimpleMap<BigNumber>;
5
+ readonly txGasPrices: SimpleMap<BigNumber>;
6
+ readonly defaultFeeDenom: string;
7
+ constructor(txGasCosts: SimpleMap<BigNumber>, txGasPrices: SimpleMap<BigNumber>, defaultFeeDenom?: string);
8
+ getFee(msgTypeUrl: string, denom?: string): BigNumber | null;
9
+ getGasPrice(denom: string): BigNumber | null;
10
10
  getGasCost(msgTypeUrl: string): BigNumber;
11
11
  }
12
12
  export default GasFee;
@@ -1,38 +1,31 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const constant_1 = require("../constant");
3
4
  const number_1 = require("../util/number");
4
5
  const tx_1 = require("../util/tx");
5
- const constant_1 = require("../constant");
6
6
  class GasFee {
7
- constructor(txGasCosts, txGasPrices) {
7
+ constructor(txGasCosts, txGasPrices, defaultFeeDenom = constant_1.DEFAULT_FEE_DENOM) {
8
8
  this.txGasCosts = txGasCosts;
9
9
  this.txGasPrices = txGasPrices;
10
- }
11
- static instance(txGasCosts = {}, txGasPrices = {}) {
12
- return new GasFee(txGasCosts, txGasPrices);
10
+ this.defaultFeeDenom = defaultFeeDenom;
13
11
  }
14
12
  getFee(msgTypeUrl, denom = constant_1.DEFAULT_FEE_DENOM) {
15
13
  const minGasPrice = this.getGasPrice(denom);
14
+ if (!minGasPrice)
15
+ return null;
16
16
  const msgGasCost = this.getGasCost(msgTypeUrl);
17
17
  return msgGasCost.times(minGasPrice);
18
18
  }
19
19
  getGasPrice(denom) {
20
- var _a;
21
- if (!this.txGasPrices) {
22
- console.warn("tx gas prices not initialized");
23
- }
24
- const gasPrice = (_a = this.txGasPrices) === null || _a === void 0 ? void 0 : _a[denom];
20
+ const gasPrice = this.txGasPrices[denom];
25
21
  if (!gasPrice) {
26
- console.warn("denom not supported for paying gas");
22
+ console.warn("denom not supported for paying gas", denom);
27
23
  }
28
- return gasPrice !== null && gasPrice !== void 0 ? gasPrice : number_1.BN_ZERO;
24
+ return gasPrice !== null && gasPrice !== void 0 ? gasPrice : null;
29
25
  }
30
26
  getGasCost(msgTypeUrl) {
31
- var _a, _b, _c, _d;
32
- if (!this.txGasCosts) {
33
- console.warn("tx gas costs not initialized");
34
- }
35
- return (_d = (_b = (_a = this.txGasCosts) === null || _a === void 0 ? void 0 : _a[msgTypeUrl]) !== null && _b !== void 0 ? _b : (_c = this.txGasCosts) === null || _c === void 0 ? void 0 : _c[tx_1.TxGasCostTypeDefaultKey]) !== null && _d !== void 0 ? _d : number_1.BN_ZERO;
27
+ var _a, _b;
28
+ return (_b = (_a = this.txGasCosts[msgTypeUrl]) !== null && _a !== void 0 ? _a : this.txGasCosts[tx_1.TxGasCostTypeDefaultKey]) !== null && _b !== void 0 ? _b : number_1.BN_ZERO;
36
29
  }
37
30
  }
38
31
  exports.default = GasFee;
@@ -7,13 +7,13 @@ export interface Params {
7
7
  }
8
8
  export declare const Params: {
9
9
  encode(message: Params, writer?: _m0.Writer): _m0.Writer;
10
- decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Params;
10
+ decode(input: _m0.Reader | Uint8Array, length?: number): Params;
11
11
  fromJSON(object: any): Params;
12
12
  toJSON(message: Params): unknown;
13
13
  fromPartial(object: DeepPartial<Params>): Params;
14
14
  };
15
- declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
16
- export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
15
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
16
+ export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
17
17
  [K in keyof T]?: DeepPartial<T[K]>;
18
18
  } : Partial<T>;
19
19
  export {};
@@ -5,13 +5,13 @@ export interface Params {
5
5
  }
6
6
  export declare const Params: {
7
7
  encode(_: Params, writer?: _m0.Writer): _m0.Writer;
8
- decode(input: _m0.Reader | Uint8Array, length?: number): Params;
8
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Params;
9
9
  fromJSON(_: any): Params;
10
10
  toJSON(_: Params): unknown;
11
11
  fromPartial(_: DeepPartial<Params>): Params;
12
12
  };
13
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
14
- export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
13
+ declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
14
+ export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
15
15
  [K in keyof T]?: DeepPartial<T[K]>;
16
16
  } : Partial<T>;
17
17
  export {};
@@ -6,13 +6,13 @@ export interface Params {
6
6
  }
7
7
  export declare const Params: {
8
8
  encode(_: Params, writer?: _m0.Writer): _m0.Writer;
9
- decode(input: _m0.Reader | Uint8Array, length?: number): Params;
9
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Params;
10
10
  fromJSON(_: any): Params;
11
11
  toJSON(_: Params): unknown;
12
12
  fromPartial(_: DeepPartial<Params>): Params;
13
13
  };
14
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
15
- export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
14
+ declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
15
+ export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
16
16
  [K in keyof T]?: DeepPartial<T[K]>;
17
17
  } : Partial<T>;
18
18
  export {};
@@ -39,27 +39,27 @@ export interface RewardWeightChangeSnapshot {
39
39
  }
40
40
  export declare const RewardWeightRange: {
41
41
  encode(message: RewardWeightRange, writer?: _m0.Writer): _m0.Writer;
42
- decode(input: _m0.Reader | Uint8Array, length?: number): RewardWeightRange;
42
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RewardWeightRange;
43
43
  fromJSON(object: any): RewardWeightRange;
44
44
  toJSON(message: RewardWeightRange): unknown;
45
45
  fromPartial(object: DeepPartial<RewardWeightRange>): RewardWeightRange;
46
46
  };
47
47
  export declare const AllianceAsset: {
48
48
  encode(message: AllianceAsset, writer?: _m0.Writer): _m0.Writer;
49
- decode(input: _m0.Reader | Uint8Array, length?: number): AllianceAsset;
49
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): AllianceAsset;
50
50
  fromJSON(object: any): AllianceAsset;
51
51
  toJSON(message: AllianceAsset): unknown;
52
52
  fromPartial(object: DeepPartial<AllianceAsset>): AllianceAsset;
53
53
  };
54
54
  export declare const RewardWeightChangeSnapshot: {
55
55
  encode(message: RewardWeightChangeSnapshot, writer?: _m0.Writer): _m0.Writer;
56
- decode(input: _m0.Reader | Uint8Array, length?: number): RewardWeightChangeSnapshot;
56
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RewardWeightChangeSnapshot;
57
57
  fromJSON(object: any): RewardWeightChangeSnapshot;
58
58
  toJSON(message: RewardWeightChangeSnapshot): unknown;
59
59
  fromPartial(object: DeepPartial<RewardWeightChangeSnapshot>): RewardWeightChangeSnapshot;
60
60
  };
61
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
62
- export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
61
+ declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
62
+ export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
63
63
  [K in keyof T]?: DeepPartial<T[K]>;
64
64
  } : Partial<T>;
65
65
  export {};
@@ -39,48 +39,48 @@ export interface AllianceValidatorInfo {
39
39
  }
40
40
  export declare const Delegation: {
41
41
  encode(message: Delegation, writer?: _m0.Writer): _m0.Writer;
42
- decode(input: _m0.Reader | Uint8Array, length?: number): Delegation;
42
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Delegation;
43
43
  fromJSON(object: any): Delegation;
44
44
  toJSON(message: Delegation): unknown;
45
45
  fromPartial(object: DeepPartial<Delegation>): Delegation;
46
46
  };
47
47
  export declare const Redelegation: {
48
48
  encode(message: Redelegation, writer?: _m0.Writer): _m0.Writer;
49
- decode(input: _m0.Reader | Uint8Array, length?: number): Redelegation;
49
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Redelegation;
50
50
  fromJSON(object: any): Redelegation;
51
51
  toJSON(message: Redelegation): unknown;
52
52
  fromPartial(object: DeepPartial<Redelegation>): Redelegation;
53
53
  };
54
54
  export declare const QueuedRedelegation: {
55
55
  encode(message: QueuedRedelegation, writer?: _m0.Writer): _m0.Writer;
56
- decode(input: _m0.Reader | Uint8Array, length?: number): QueuedRedelegation;
56
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueuedRedelegation;
57
57
  fromJSON(object: any): QueuedRedelegation;
58
58
  toJSON(message: QueuedRedelegation): unknown;
59
59
  fromPartial(object: DeepPartial<QueuedRedelegation>): QueuedRedelegation;
60
60
  };
61
61
  export declare const Undelegation: {
62
62
  encode(message: Undelegation, writer?: _m0.Writer): _m0.Writer;
63
- decode(input: _m0.Reader | Uint8Array, length?: number): Undelegation;
63
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Undelegation;
64
64
  fromJSON(object: any): Undelegation;
65
65
  toJSON(message: Undelegation): unknown;
66
66
  fromPartial(object: DeepPartial<Undelegation>): Undelegation;
67
67
  };
68
68
  export declare const QueuedUndelegation: {
69
69
  encode(message: QueuedUndelegation, writer?: _m0.Writer): _m0.Writer;
70
- decode(input: _m0.Reader | Uint8Array, length?: number): QueuedUndelegation;
70
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): QueuedUndelegation;
71
71
  fromJSON(object: any): QueuedUndelegation;
72
72
  toJSON(message: QueuedUndelegation): unknown;
73
73
  fromPartial(object: DeepPartial<QueuedUndelegation>): QueuedUndelegation;
74
74
  };
75
75
  export declare const AllianceValidatorInfo: {
76
76
  encode(message: AllianceValidatorInfo, writer?: _m0.Writer): _m0.Writer;
77
- decode(input: _m0.Reader | Uint8Array, length?: number): AllianceValidatorInfo;
77
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): AllianceValidatorInfo;
78
78
  fromJSON(object: any): AllianceValidatorInfo;
79
79
  toJSON(message: AllianceValidatorInfo): unknown;
80
80
  fromPartial(object: DeepPartial<AllianceValidatorInfo>): AllianceValidatorInfo;
81
81
  };
82
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
83
- export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
82
+ declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
83
+ export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
84
84
  [K in keyof T]?: DeepPartial<T[K]>;
85
85
  } : Partial<T>;
86
86
  export {};
@@ -28,34 +28,34 @@ export interface ClaimAllianceRewardsEvent {
28
28
  }
29
29
  export declare const DelegateAllianceEvent: {
30
30
  encode(message: DelegateAllianceEvent, writer?: _m0.Writer): _m0.Writer;
31
- decode(input: _m0.Reader | Uint8Array, length?: number): DelegateAllianceEvent;
31
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DelegateAllianceEvent;
32
32
  fromJSON(object: any): DelegateAllianceEvent;
33
33
  toJSON(message: DelegateAllianceEvent): unknown;
34
34
  fromPartial(object: DeepPartial<DelegateAllianceEvent>): DelegateAllianceEvent;
35
35
  };
36
36
  export declare const UndelegateAllianceEvent: {
37
37
  encode(message: UndelegateAllianceEvent, writer?: _m0.Writer): _m0.Writer;
38
- decode(input: _m0.Reader | Uint8Array, length?: number): UndelegateAllianceEvent;
38
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): UndelegateAllianceEvent;
39
39
  fromJSON(object: any): UndelegateAllianceEvent;
40
40
  toJSON(message: UndelegateAllianceEvent): unknown;
41
41
  fromPartial(object: DeepPartial<UndelegateAllianceEvent>): UndelegateAllianceEvent;
42
42
  };
43
43
  export declare const RedelegateAllianceEvent: {
44
44
  encode(message: RedelegateAllianceEvent, writer?: _m0.Writer): _m0.Writer;
45
- decode(input: _m0.Reader | Uint8Array, length?: number): RedelegateAllianceEvent;
45
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RedelegateAllianceEvent;
46
46
  fromJSON(object: any): RedelegateAllianceEvent;
47
47
  toJSON(message: RedelegateAllianceEvent): unknown;
48
48
  fromPartial(object: DeepPartial<RedelegateAllianceEvent>): RedelegateAllianceEvent;
49
49
  };
50
50
  export declare const ClaimAllianceRewardsEvent: {
51
51
  encode(message: ClaimAllianceRewardsEvent, writer?: _m0.Writer): _m0.Writer;
52
- decode(input: _m0.Reader | Uint8Array, length?: number): ClaimAllianceRewardsEvent;
52
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ClaimAllianceRewardsEvent;
53
53
  fromJSON(object: any): ClaimAllianceRewardsEvent;
54
54
  toJSON(message: ClaimAllianceRewardsEvent): unknown;
55
55
  fromPartial(object: DeepPartial<ClaimAllianceRewardsEvent>): ClaimAllianceRewardsEvent;
56
56
  };
57
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
58
- export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
57
+ declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
58
+ export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
59
59
  [K in keyof T]?: DeepPartial<T[K]>;
60
60
  } : Partial<T>;
61
61
  export {};
@@ -34,41 +34,41 @@ export interface GenesisState {
34
34
  }
35
35
  export declare const ValidatorInfoState: {
36
36
  encode(message: ValidatorInfoState, writer?: _m0.Writer): _m0.Writer;
37
- decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorInfoState;
37
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): ValidatorInfoState;
38
38
  fromJSON(object: any): ValidatorInfoState;
39
39
  toJSON(message: ValidatorInfoState): unknown;
40
40
  fromPartial(object: DeepPartial<ValidatorInfoState>): ValidatorInfoState;
41
41
  };
42
42
  export declare const RedelegationState: {
43
43
  encode(message: RedelegationState, writer?: _m0.Writer): _m0.Writer;
44
- decode(input: _m0.Reader | Uint8Array, length?: number): RedelegationState;
44
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RedelegationState;
45
45
  fromJSON(object: any): RedelegationState;
46
46
  toJSON(message: RedelegationState): unknown;
47
47
  fromPartial(object: DeepPartial<RedelegationState>): RedelegationState;
48
48
  };
49
49
  export declare const UndelegationState: {
50
50
  encode(message: UndelegationState, writer?: _m0.Writer): _m0.Writer;
51
- decode(input: _m0.Reader | Uint8Array, length?: number): UndelegationState;
51
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): UndelegationState;
52
52
  fromJSON(object: any): UndelegationState;
53
53
  toJSON(message: UndelegationState): unknown;
54
54
  fromPartial(object: DeepPartial<UndelegationState>): UndelegationState;
55
55
  };
56
56
  export declare const RewardWeightChangeSnapshotState: {
57
57
  encode(message: RewardWeightChangeSnapshotState, writer?: _m0.Writer): _m0.Writer;
58
- decode(input: _m0.Reader | Uint8Array, length?: number): RewardWeightChangeSnapshotState;
58
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RewardWeightChangeSnapshotState;
59
59
  fromJSON(object: any): RewardWeightChangeSnapshotState;
60
60
  toJSON(message: RewardWeightChangeSnapshotState): unknown;
61
61
  fromPartial(object: DeepPartial<RewardWeightChangeSnapshotState>): RewardWeightChangeSnapshotState;
62
62
  };
63
63
  export declare const GenesisState: {
64
64
  encode(message: GenesisState, writer?: _m0.Writer): _m0.Writer;
65
- decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState;
65
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): GenesisState;
66
66
  fromJSON(object: any): GenesisState;
67
67
  toJSON(message: GenesisState): unknown;
68
68
  fromPartial(object: DeepPartial<GenesisState>): GenesisState;
69
69
  };
70
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
71
- export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
70
+ declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
71
+ export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
72
72
  [K in keyof T]?: DeepPartial<T[K]>;
73
73
  } : Partial<T>;
74
74
  export {};
@@ -52,27 +52,27 @@ export interface MsgDeleteAllianceProposal {
52
52
  }
53
53
  export declare const MsgCreateAllianceProposal: {
54
54
  encode(message: MsgCreateAllianceProposal, writer?: _m0.Writer): _m0.Writer;
55
- decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateAllianceProposal;
55
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgCreateAllianceProposal;
56
56
  fromJSON(object: any): MsgCreateAllianceProposal;
57
57
  toJSON(message: MsgCreateAllianceProposal): unknown;
58
58
  fromPartial(object: DeepPartial<MsgCreateAllianceProposal>): MsgCreateAllianceProposal;
59
59
  };
60
60
  export declare const MsgUpdateAllianceProposal: {
61
61
  encode(message: MsgUpdateAllianceProposal, writer?: _m0.Writer): _m0.Writer;
62
- decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateAllianceProposal;
62
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgUpdateAllianceProposal;
63
63
  fromJSON(object: any): MsgUpdateAllianceProposal;
64
64
  toJSON(message: MsgUpdateAllianceProposal): unknown;
65
65
  fromPartial(object: DeepPartial<MsgUpdateAllianceProposal>): MsgUpdateAllianceProposal;
66
66
  };
67
67
  export declare const MsgDeleteAllianceProposal: {
68
68
  encode(message: MsgDeleteAllianceProposal, writer?: _m0.Writer): _m0.Writer;
69
- decode(input: _m0.Reader | Uint8Array, length?: number): MsgDeleteAllianceProposal;
69
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): MsgDeleteAllianceProposal;
70
70
  fromJSON(object: any): MsgDeleteAllianceProposal;
71
71
  toJSON(message: MsgDeleteAllianceProposal): unknown;
72
72
  fromPartial(object: DeepPartial<MsgDeleteAllianceProposal>): MsgDeleteAllianceProposal;
73
73
  };
74
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
75
- export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
74
+ declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
75
+ export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
76
76
  [K in keyof T]?: DeepPartial<T[K]>;
77
77
  } : Partial<T>;
78
78
  export {};
@@ -15,20 +15,20 @@ export interface RewardHistory {
15
15
  }
16
16
  export declare const Params: {
17
17
  encode(message: Params, writer?: _m0.Writer): _m0.Writer;
18
- decode(input: _m0.Reader | Uint8Array, length?: number): Params;
18
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): Params;
19
19
  fromJSON(object: any): Params;
20
20
  toJSON(message: Params): unknown;
21
21
  fromPartial(object: DeepPartial<Params>): Params;
22
22
  };
23
23
  export declare const RewardHistory: {
24
24
  encode(message: RewardHistory, writer?: _m0.Writer): _m0.Writer;
25
- decode(input: _m0.Reader | Uint8Array, length?: number): RewardHistory;
25
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): RewardHistory;
26
26
  fromJSON(object: any): RewardHistory;
27
27
  toJSON(message: RewardHistory): unknown;
28
28
  fromPartial(object: DeepPartial<RewardHistory>): RewardHistory;
29
29
  };
30
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
31
- export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
30
+ declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
31
+ export declare type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
32
32
  [K in keyof T]?: DeepPartial<T[K]>;
33
33
  } : Partial<T>;
34
34
  export {};