carbon-js-sdk 0.3.59 → 0.4.1

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 (193) hide show
  1. package/lib/clients/CarbonQueryClient.js +2 -2
  2. package/lib/clients/ETHClient.js +15 -15
  3. package/lib/clients/HydrogenClient.js +1 -1
  4. package/lib/clients/NEOClient.js +7 -7
  5. package/lib/clients/TokenClient.js +1 -1
  6. package/lib/clients/ZILClient.js +17 -17
  7. package/lib/codec/bank/query.d.ts +1 -1
  8. package/lib/codec/bank/query.js +1 -1
  9. package/lib/codec/broker/query.d.ts +1 -4
  10. package/lib/codec/broker/query.js +4 -47
  11. package/lib/codec/cdp/event.d.ts +2 -0
  12. package/lib/codec/cdp/event.js +16 -1
  13. package/lib/codec/cdp/genesis.d.ts +3 -1
  14. package/lib/codec/cdp/genesis.js +21 -0
  15. package/lib/codec/cdp/params.d.ts +6 -0
  16. package/lib/codec/cdp/params.js +41 -1
  17. package/lib/codec/cdp/query.d.ts +23 -0
  18. package/lib/codec/cdp/query.js +92 -1
  19. package/lib/codec/{crisis/genesis.d.ts → cdp/stablecoin_interest_info.d.ts} +10 -9
  20. package/lib/codec/cdp/stablecoin_interest_info.js +99 -0
  21. package/lib/codec/cdp/tx.d.ts +20 -20
  22. package/lib/codec/cdp/tx.js +43 -43
  23. package/lib/codec/cosmos/auth/v1beta1/export.d.ts +1 -1
  24. package/lib/codec/cosmos/auth/v1beta1/export.js +13 -1
  25. package/lib/codec/cosmos/auth/v1beta1/query.d.ts +213 -0
  26. package/lib/codec/cosmos/auth/v1beta1/query.js +602 -1
  27. package/lib/codec/cosmos/authz/v1beta1/authz.d.ts +17 -2
  28. package/lib/codec/cosmos/authz/v1beta1/authz.js +50 -1
  29. package/lib/codec/cosmos/authz/v1beta1/query.d.ts +2 -2
  30. package/lib/codec/cosmos/bank/v1beta1/bank.d.ts +14 -1
  31. package/lib/codec/cosmos/bank/v1beta1/bank.js +25 -1
  32. package/lib/codec/cosmos/bank/v1beta1/export.d.ts +1 -1
  33. package/lib/codec/cosmos/bank/v1beta1/export.js +4 -1
  34. package/lib/codec/cosmos/bank/v1beta1/query.d.ts +73 -1
  35. package/lib/codec/cosmos/bank/v1beta1/query.js +200 -1
  36. package/lib/codec/cosmos/base/abci/v1beta1/abci.d.ts +24 -1
  37. package/lib/codec/cosmos/base/abci/v1beta1/abci.js +34 -4
  38. package/lib/codec/cosmos/base/query/v1beta1/pagination.d.ts +2 -1
  39. package/lib/codec/cosmos/base/snapshots/v1beta1/snapshot.d.ts +58 -5
  40. package/lib/codec/cosmos/base/snapshots/v1beta1/snapshot.js +145 -1
  41. package/lib/codec/cosmos/base/store/v1beta1/listening.d.ts +32 -0
  42. package/lib/codec/cosmos/base/store/v1beta1/listening.js +213 -1
  43. package/lib/codec/cosmos/base/store/v1beta1/snapshot.d.ts +45 -0
  44. package/lib/codec/cosmos/base/store/v1beta1/snapshot.js +246 -0
  45. package/lib/codec/cosmos/base/tendermint/v1beta1/query.d.ts +129 -9
  46. package/lib/codec/cosmos/base/tendermint/v1beta1/query.js +457 -7
  47. package/lib/codec/cosmos/distribution/v1beta1/tx.d.ts +12 -8
  48. package/lib/codec/cosmos/distribution/v1beta1/tx.js +42 -8
  49. package/lib/codec/cosmos/feegrant/v1beta1/feegrant.d.ts +5 -5
  50. package/lib/codec/cosmos/feegrant/v1beta1/query.d.ts +12 -3
  51. package/lib/codec/cosmos/feegrant/v1beta1/tx.d.ts +1 -1
  52. package/lib/codec/cosmos/gov/v1beta1/gov.d.ts +6 -1
  53. package/lib/codec/cosmos/gov/v1beta1/gov.js +1 -1
  54. package/lib/codec/cosmos/gov/v1beta1/query.d.ts +1 -1
  55. package/lib/codec/cosmos/gov/v1beta1/query.js +2 -2
  56. package/lib/codec/cosmos/gov/v1beta1/tx.js +2 -2
  57. package/lib/codec/cosmos/params/v1beta1/export.d.ts +1 -1
  58. package/lib/codec/cosmos/params/v1beta1/export.js +4 -1
  59. package/lib/codec/cosmos/params/v1beta1/query.d.ts +55 -0
  60. package/lib/codec/cosmos/params/v1beta1/query.js +149 -1
  61. package/lib/codec/cosmos/staking/v1beta1/export.d.ts +1 -1
  62. package/lib/codec/cosmos/staking/v1beta1/export.js +3 -1
  63. package/lib/codec/cosmos/staking/v1beta1/query.d.ts +3 -3
  64. package/lib/codec/cosmos/staking/v1beta1/staking.d.ts +7 -1
  65. package/lib/codec/cosmos/staking/v1beta1/staking.js +16 -1
  66. package/lib/codec/cosmos/staking/v1beta1/tx.d.ts +42 -0
  67. package/lib/codec/cosmos/staking/v1beta1/tx.js +134 -1
  68. package/lib/codec/cosmos/tx/signing/v1beta1/signing.d.ts +23 -5
  69. package/lib/codec/cosmos/tx/signing/v1beta1/signing.js +28 -5
  70. package/lib/codec/cosmos/tx/v1beta1/export.d.ts +1 -1
  71. package/lib/codec/cosmos/tx/v1beta1/export.js +4 -1
  72. package/lib/codec/cosmos/tx/v1beta1/service.d.ts +21 -2
  73. package/lib/codec/cosmos/tx/v1beta1/service.js +55 -2
  74. package/lib/codec/cosmos/tx/v1beta1/tx.d.ts +101 -0
  75. package/lib/codec/cosmos/tx/v1beta1/tx.js +298 -3
  76. package/lib/codec/cosmos/upgrade/v1beta1/query.d.ts +36 -0
  77. package/lib/codec/cosmos/upgrade/v1beta1/query.js +84 -1
  78. package/lib/codec/cosmos/upgrade/v1beta1/upgrade.d.ts +8 -0
  79. package/lib/codec/cosmos/vesting/v1beta1/export.d.ts +1 -1
  80. package/lib/codec/cosmos/vesting/v1beta1/export.js +5 -1
  81. package/lib/codec/cosmos/vesting/v1beta1/tx.d.ts +83 -0
  82. package/lib/codec/cosmos/vesting/v1beta1/tx.js +251 -1
  83. package/lib/codec/google/protobuf/any.d.ts +8 -5
  84. package/lib/codec/ibc/applications/interchain_accounts/controller/export.d.ts +1 -0
  85. package/lib/codec/ibc/applications/interchain_accounts/controller/export.js +6 -1
  86. package/lib/codec/ibc/applications/interchain_accounts/v1/export.d.ts +0 -1
  87. package/lib/codec/ibc/applications/interchain_accounts/v1/export.js +1 -6
  88. package/lib/codec/ibc/core/channel/v1/channel.d.ts +20 -0
  89. package/lib/codec/ibc/core/channel/v1/channel.js +78 -1
  90. package/lib/codec/ibc/core/channel/v1/export.d.ts +1 -1
  91. package/lib/codec/ibc/core/channel/v1/export.js +3 -2
  92. package/lib/codec/ibc/core/channel/v1/tx.d.ts +3 -2
  93. package/lib/codec/ibc/core/client/v1/query.d.ts +1 -1
  94. package/lib/codec/ibc/core/connection/v1/export.d.ts +1 -1
  95. package/lib/codec/ibc/core/connection/v1/export.js +3 -1
  96. package/lib/codec/ibc/core/connection/v1/query.d.ts +26 -1
  97. package/lib/codec/ibc/core/connection/v1/query.js +87 -1
  98. package/lib/codec/ibc/core/connection/v1/tx.d.ts +3 -2
  99. package/lib/codec/index.d.ts +88 -15
  100. package/lib/codec/index.js +858 -701
  101. package/lib/codec/liquidation/query.d.ts +3 -2
  102. package/lib/codec/liquidation/query.js +39 -32
  103. package/lib/codec/misc/query.d.ts +1 -1
  104. package/lib/codec/misc/query.js +1 -1
  105. package/lib/codec/oracle/event.d.ts +1 -0
  106. package/lib/codec/oracle/event.js +15 -1
  107. package/lib/codec/order/query.d.ts +1 -1
  108. package/lib/codec/order/query.js +1 -1
  109. package/lib/codec/position/query.d.ts +1 -2
  110. package/lib/codec/position/query.js +3 -16
  111. package/lib/codec/proofs.d.ts +1 -0
  112. package/lib/codec/proofs.js +6 -0
  113. package/lib/codec/tendermint/abci/types.d.ts +8 -0
  114. package/lib/codec/tendermint/abci/types.js +45 -1
  115. package/lib/constant/generic.js +1 -1
  116. package/lib/modules/admin.d.ts +0 -1
  117. package/lib/modules/admin.js +0 -13
  118. package/lib/modules/cdp.js +43 -43
  119. package/lib/modules/cosmwasm.js +1 -1
  120. package/lib/modules/gov.js +12 -12
  121. package/lib/modules/liquiditypool.d.ts +0 -2
  122. package/lib/modules/liquiditypool.js +1 -34
  123. package/lib/provider/account/EthLedgerAccount/EthLedgerAccount.js +1 -1
  124. package/lib/provider/account/NeoLedgerAccount/N3Ledger/ErrorCode.js +1 -1
  125. package/lib/provider/account/NeoLedgerAccount/N3Ledger/main.js +8 -8
  126. package/lib/provider/account/NeoLedgerAccount/NeoLedgerAccount.js +3 -3
  127. package/lib/provider/account/NeoLedgerAccount/NeonLedger.js +1 -1
  128. package/lib/provider/amino/types/admin.js +27 -28
  129. package/lib/provider/amino/types/bank.js +1 -1
  130. package/lib/provider/amino/types/broker.js +1 -1
  131. package/lib/provider/amino/types/cdp.js +22 -22
  132. package/lib/provider/amino/types/coin.js +4 -4
  133. package/lib/provider/amino/types/gov.js +4 -4
  134. package/lib/provider/amino/types/ibc.js +1 -1
  135. package/lib/provider/amino/types/leverage.js +1 -1
  136. package/lib/provider/amino/types/liquidityPool.js +7 -7
  137. package/lib/provider/amino/types/market.js +1 -1
  138. package/lib/provider/amino/types/oracle.js +1 -1
  139. package/lib/provider/amino/types/order.js +4 -4
  140. package/lib/provider/amino/types/position.js +1 -1
  141. package/lib/provider/amino/types/profile.js +1 -1
  142. package/lib/provider/amino/types/staking.js +4 -4
  143. package/lib/provider/amino/types/subaccount.js +3 -3
  144. package/lib/provider/amino/utils.js +11 -11
  145. package/lib/provider/ledger/ledger.js +2 -2
  146. package/lib/provider/metamask/MetaMask.js +1 -1
  147. package/lib/provider/o3/O3Wallet.js +2 -2
  148. package/lib/util/address.js +13 -13
  149. package/lib/util/api.js +4 -4
  150. package/lib/util/fetch.js +1 -1
  151. package/lib/util/generic.js +3 -3
  152. package/lib/util/number.js +5 -5
  153. package/lib/util/tx.d.ts +80 -10
  154. package/lib/wallet/CarbonSigner.js +2 -2
  155. package/lib/wallet/CarbonSigningClient.js +8 -8
  156. package/lib/wallet/CarbonWallet.js +6 -6
  157. package/lib/websocket/connector.js +3 -3
  158. package/lib/websocket/models.d.ts +19 -22
  159. package/lib/websocket/types.d.ts +2 -0
  160. package/package.json +1 -1
  161. package/lib/codec/cosmos/app/v1alpha1/export.d.ts +0 -3
  162. package/lib/codec/cosmos/app/v1alpha1/export.js +0 -13
  163. package/lib/codec/cosmos/authz/v1beta1/export.d.ts +0 -4
  164. package/lib/codec/cosmos/authz/v1beta1/export.js +0 -25
  165. package/lib/codec/cosmos/capability/v1beta1/export.d.ts +0 -2
  166. package/lib/codec/cosmos/capability/v1beta1/export.js +0 -9
  167. package/lib/codec/cosmos/crisis/v1beta1/export.d.ts +0 -1
  168. package/lib/codec/cosmos/crisis/v1beta1/export.js +0 -6
  169. package/lib/codec/cosmos/evidence/v1beta1/export.d.ts +0 -3
  170. package/lib/codec/cosmos/evidence/v1beta1/export.js +0 -13
  171. package/lib/codec/cosmos/feegrant/v1beta1/export.d.ts +0 -3
  172. package/lib/codec/cosmos/feegrant/v1beta1/export.js +0 -20
  173. package/lib/codec/cosmos/gov/v1/export.d.ts +0 -3
  174. package/lib/codec/cosmos/gov/v1/export.js +0 -46
  175. package/lib/codec/cosmos/group/v1/export.d.ts +0 -4
  176. package/lib/codec/cosmos/group/v1/export.js +0 -94
  177. package/lib/codec/cosmos/nft/v1beta1/export.d.ts +0 -5
  178. package/lib/codec/cosmos/nft/v1beta1/export.js +0 -30
  179. package/lib/codec/cosmos/orm/v1/export.d.ts +0 -1
  180. package/lib/codec/cosmos/orm/v1/export.js +0 -8
  181. package/lib/codec/cosmos/orm/v1alpha1/export.d.ts +0 -1
  182. package/lib/codec/cosmos/orm/v1alpha1/export.js +0 -9
  183. package/lib/codec/cosmos/upgrade/v1beta1/export.d.ts +0 -3
  184. package/lib/codec/cosmos/upgrade/v1beta1/export.js +0 -24
  185. package/lib/codec/crisis/genesis.js +0 -46
  186. package/lib/codec/crisis/query.d.ts +0 -43
  187. package/lib/codec/crisis/query.js +0 -103
  188. package/lib/codec/crisis/tx.d.ts +0 -12
  189. package/lib/codec/crisis/tx.js +0 -20
  190. package/lib/codec/ibc/applications/fee/v1/export.d.ts +0 -6
  191. package/lib/codec/ibc/applications/fee/v1/export.js +0 -47
  192. package/lib/codec/liquiditypool/legacy.d.ts +0 -18
  193. package/lib/codec/liquiditypool/legacy.js +0 -64
@@ -47,7 +47,7 @@ class CarbonQueryClient {
47
47
  constructor(tmClient) {
48
48
  this.tmClient = tmClient;
49
49
  this.baseClient = new stargate_1.QueryClient(this.tmClient);
50
- const rpcClient = (0, stargate_1.createProtobufRpcClient)(this.baseClient);
50
+ const rpcClient = stargate_1.createProtobufRpcClient(this.baseClient);
51
51
  this.chain = BlockchainClient_1.default.connectWithTm(this.tmClient);
52
52
  this.adl = new query_1.QueryClientImpl(rpcClient);
53
53
  this.book = new query_2.QueryClientImpl(rpcClient);
@@ -91,7 +91,7 @@ class CarbonQueryClient {
91
91
  };
92
92
  }
93
93
  getProtobufRpcClient() {
94
- return (0, stargate_1.createProtobufRpcClient)(this.baseClient);
94
+ return stargate_1.createProtobufRpcClient(this.baseClient);
95
95
  }
96
96
  }
97
97
  exports.default = CarbonQueryClient;
@@ -39,13 +39,13 @@ class ETHClient {
39
39
  return __awaiter(this, void 0, void 0, function* () {
40
40
  const tokenQueryResults = yield api.token.getAllTokens();
41
41
  const lockProxyAddress = this.getLockProxyAddress().toLowerCase();
42
- const tokens = tokenQueryResults.filter((token) => (0, blockchain_1.blockchainForChainId)(token.chainId.toNumber(), api.network) == this.blockchain &&
42
+ const tokens = tokenQueryResults.filter((token) => blockchain_1.blockchainForChainId(token.chainId.toNumber(), api.network) == this.blockchain &&
43
43
  token.tokenAddress.length == 40 &&
44
- token.bridgeAddress.toLowerCase() == (0, generic_1.stripHexPrefix)(lockProxyAddress) &&
44
+ token.bridgeAddress.toLowerCase() == generic_1.stripHexPrefix(lockProxyAddress) &&
45
45
  (!whitelistDenoms || whitelistDenoms.includes(token.denom)) &&
46
- this.verifyChecksum((0, generic_1.appendHexPrefix)(token.tokenAddress)));
46
+ this.verifyChecksum(generic_1.appendHexPrefix(token.tokenAddress)));
47
47
  const assetIds = tokens.map((token) => {
48
- return this.verifyChecksum((0, generic_1.appendHexPrefix)(token.tokenAddress));
48
+ return this.verifyChecksum(generic_1.appendHexPrefix(token.tokenAddress));
49
49
  });
50
50
  const provider = this.getProvider();
51
51
  const contractAddress = this.getBalanceReaderAddress();
@@ -96,14 +96,14 @@ class ETHClient {
96
96
  }
97
97
  const carbonNetwork = networkConfig.network;
98
98
  const fromTokenId = fromToken.id;
99
- const fromTokenAddress = (0, generic_1.appendHexPrefix)(fromToken.tokenAddress);
99
+ const fromTokenAddress = generic_1.appendHexPrefix(fromToken.tokenAddress);
100
100
  const toTokenDenom = toToken.denom;
101
101
  const recoveryAddressHex = ethers_1.ethers.utils.hexlify(util_1.AddressUtils.SWTHAddress.getAddressBytes(recoveryAddress, carbonNetwork));
102
102
  const fromAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(fromTokenId));
103
103
  const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(toTokenDenom));
104
104
  const nonce = yield rpcProvider.getTransactionCount(fromAddress);
105
105
  const contract = new ethers_1.ethers.Contract(this.getBridgeEntranceAddr(), eth_1.ABIs.bridgeEntrance, rpcProvider);
106
- const feeAddress = (0, generic_1.appendHexPrefix)(networkConfig.feeAddress);
106
+ const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
107
107
  const tokenCreator = fromToken.creator;
108
108
  const targetAddressBytes = util_1.AddressUtils.SWTHAddress.getAddressBytes(tokenCreator, carbonNetwork);
109
109
  const targetProxyHash = ethers_1.ethers.utils.hexlify(targetAddressBytes);
@@ -138,9 +138,9 @@ class ETHClient {
138
138
  throw new Error("Minimum gas required: 150,000");
139
139
  }
140
140
  const networkConfig = this.getNetworkConfig();
141
- const assetId = (0, generic_1.appendHexPrefix)(token.tokenAddress);
142
- const targetProxyHash = (0, generic_1.appendHexPrefix)(this.getTargetProxyHash(token));
143
- const feeAddress = (0, generic_1.appendHexPrefix)(networkConfig.feeAddress);
141
+ const assetId = generic_1.appendHexPrefix(token.tokenAddress);
142
+ const targetProxyHash = generic_1.appendHexPrefix(this.getTargetProxyHash(token));
143
+ const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
144
144
  const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(token.id));
145
145
  const swthAddress = ethers_1.ethers.utils.hexlify(address);
146
146
  const contractAddress = this.getLockProxyAddress();
@@ -191,16 +191,16 @@ class ETHClient {
191
191
  return "insufficient balance";
192
192
  }
193
193
  const networkConfig = this.getNetworkConfig();
194
- const assetId = (0, generic_1.appendHexPrefix)(tokenWithExternalBalances.tokenAddress);
195
- const targetProxyHash = (0, generic_1.appendHexPrefix)(this.getTargetProxyHash(tokenWithExternalBalances));
196
- const feeAddress = (0, generic_1.appendHexPrefix)(networkConfig.feeAddress);
194
+ const assetId = generic_1.appendHexPrefix(tokenWithExternalBalances.tokenAddress);
195
+ const targetProxyHash = generic_1.appendHexPrefix(this.getTargetProxyHash(tokenWithExternalBalances));
196
+ const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
197
197
  const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(tokenWithExternalBalances.id));
198
198
  const nonce = Math.floor(Math.random() * 1000000000); // random nonce to prevent replay attacks
199
199
  const message = ethers_1.ethers.utils.solidityKeccak256(["string", "address", "bytes", "bytes", "bytes", "uint256", "uint256", "uint256"], ["sendTokens", assetId, targetProxyHash, toAssetHash, feeAddress, amount, feeAmount, nonce]);
200
200
  // logger("sendDeposit message", message)
201
201
  let signatureResult;
202
202
  const { address, signature } = yield getSignatureCallback(message);
203
- const signatureBytes = ethers_1.ethers.utils.arrayify((0, generic_1.appendHexPrefix)(signature));
203
+ const signatureBytes = ethers_1.ethers.utils.arrayify(generic_1.appendHexPrefix(signature));
204
204
  const rsv = ethers_1.ethers.utils.splitSignature(signatureBytes);
205
205
  // logger("sign result", address, signature)
206
206
  signatureResult = {
@@ -239,7 +239,7 @@ class ETHClient {
239
239
  if (!feeInfo.deposit_fee) {
240
240
  throw new Error("unsupported token");
241
241
  }
242
- if ((0, blockchain_1.blockchainForChainId)(token.chainId.toNumber(), this.configProvider.getConfig().network) !== this.blockchain) {
242
+ if (blockchain_1.blockchainForChainId(token.chainId.toNumber(), this.configProvider.getConfig().network) !== this.blockchain) {
243
243
  throw new Error("unsupported token");
244
244
  }
245
245
  let feeAmount = ethers_1.ethers.BigNumber.from(feeInfo.deposit_fee);
@@ -305,7 +305,7 @@ class ETHClient {
305
305
  getTargetProxyHash(token) {
306
306
  const networkConfig = this.getNetworkConfig();
307
307
  const addressBytes = address_1.SWTHAddress.getAddressBytes(token.creator, networkConfig.network);
308
- const addressHex = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(addressBytes));
308
+ const addressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
309
309
  return addressHex;
310
310
  }
311
311
  getProvider() {
@@ -29,7 +29,7 @@ exports.HydrogenEndpoints = {
29
29
  const formatDateField = (value) => {
30
30
  if (typeof value !== "string")
31
31
  return null;
32
- return (0, dayjs_1.default)(value);
32
+ return dayjs_1.default(value);
33
33
  };
34
34
  // temporary function to parse okt/okc blockchain
35
35
  // to remove when automatic deposit/withdraw feature is deployed
@@ -64,13 +64,13 @@ class NEOClient {
64
64
  return __awaiter(this, void 0, void 0, function* () {
65
65
  const tokenQueryResults = yield sdk.token.getAllTokens();
66
66
  const account = new Neon.wallet.Account(address);
67
- const tokens = tokenQueryResults.filter((token) => (0, blockchain_1.blockchainForChainId)(token.chainId.toNumber(), sdk.network) == this.blockchain &&
67
+ const tokens = tokenQueryResults.filter((token) => blockchain_1.blockchainForChainId(token.chainId.toNumber(), sdk.network) == this.blockchain &&
68
68
  token.tokenAddress.length == 40 &&
69
69
  token.bridgeAddress.length == 40);
70
70
  const client = new Neon.rpc.RPCClient(url, "2.5.2"); // TODO: should we change the RPC version??
71
71
  // NOTE: fetching of tokens is chunked in sets of 15 as we may hit
72
72
  // the gas limit on the RPC node and error out otherwise
73
- const promises = (0, lodash_1.chunk)(tokens, 75).map((partition) => __awaiter(this, void 0, void 0, function* () {
73
+ const promises = lodash_1.chunk(tokens, 75).map((partition) => __awaiter(this, void 0, void 0, function* () {
74
74
  var _a, _b, _c;
75
75
  let acc = {};
76
76
  for (const token of partition) {
@@ -112,8 +112,8 @@ class NEOClient {
112
112
  const targetProxyHash = this.getTargetProxyHash(token);
113
113
  const toAssetHash = Neon.u.str2hexstring(token.id);
114
114
  const addressBytes = address_1.SWTHAddress.getAddressBytes(swthAddress, networkConfig.network);
115
- const toAddress = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(addressBytes));
116
- const zeroAddressHex = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(constant_1.ZeroAddress));
115
+ const toAddress = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
116
+ const zeroAddressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(constant_1.ZeroAddress));
117
117
  const amount = ethers_1.ethers.BigNumber.from(token.externalBalance);
118
118
  const feeAmount = ethers_1.ethers.BigNumber.from(feeAmountInput !== null && feeAmountInput !== void 0 ? feeAmountInput : "100000000");
119
119
  const feeAddress = feeAmount.isZero() ? zeroAddressHex : networkConfig.feeAddress;
@@ -160,7 +160,7 @@ class NEOClient {
160
160
  const fromAddress = util_1.AddressUtils.NEOAddress.publicKeyToAddress(publicKeyOutput.publicKey);
161
161
  const targetProxyHash = this.getTargetProxyHash(token);
162
162
  const toAssetHash = Neon.u.str2hexstring(token.id);
163
- const toAddress = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(address));
163
+ const toAddress = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(address));
164
164
  const nonce = Math.floor(Math.random() * 1000000);
165
165
  if (amount.lt(feeAmount)) {
166
166
  throw new Error("Invalid amount");
@@ -196,7 +196,7 @@ class NEOClient {
196
196
  const fromAddress = ledger.scriptHash;
197
197
  const targetProxyHash = this.getTargetProxyHash(token);
198
198
  const toAssetHash = Neon.u.str2hexstring(token.id);
199
- const toAddress = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(address));
199
+ const toAddress = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(address));
200
200
  const feeAddress = networkConfig.feeAddress;
201
201
  const nonce = Math.floor(Math.random() * 1000000);
202
202
  if (amount.lt(feeAmount)) {
@@ -316,7 +316,7 @@ class NEOClient {
316
316
  getTargetProxyHash(token) {
317
317
  const networkConfig = this.getNetworkConfig();
318
318
  const addressBytes = address_1.SWTHAddress.getAddressBytes(token.creator, networkConfig.network);
319
- const addressHex = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(addressBytes));
319
+ const addressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
320
320
  return addressHex;
321
321
  }
322
322
  getNetworkConfig() {
@@ -459,7 +459,7 @@ class TokenClient {
459
459
  processTokenPrices(tokenPrices) {
460
460
  return tokenPrices.reduce((prevPrices, price) => {
461
461
  const newPrev = prevPrices;
462
- newPrev[price.denom] = (0, number_1.bnOrZero)(price.twap).shiftedBy(-constant_1.decTypeDecimals);
462
+ newPrev[price.denom] = number_1.bnOrZero(price.twap).shiftedBy(-constant_1.decTypeDecimals);
463
463
  return newPrev;
464
464
  }, {});
465
465
  }
@@ -72,12 +72,12 @@ class ZILClient {
72
72
  getExternalBalances(sdk, address, whitelistDenoms) {
73
73
  return __awaiter(this, void 0, void 0, function* () {
74
74
  const tokenQueryResults = yield sdk.token.getAllTokens();
75
- const tokens = tokenQueryResults.filter((token) => (0, blockchain_1.blockchainForChainId)(token.chainId.toNumber(), sdk.network) == this.blockchain &&
75
+ const tokens = tokenQueryResults.filter((token) => blockchain_1.blockchainForChainId(token.chainId.toNumber(), sdk.network) == this.blockchain &&
76
76
  token.tokenAddress.length == 40 &&
77
77
  (!whitelistDenoms || whitelistDenoms.includes(token.denom)));
78
78
  const requests = tokens.map((token) => token.tokenAddress === zeroAddress
79
- ? (0, exports.balanceBatchRequest)(address.replace(/^0x/i, ""))
80
- : (0, exports.tokenBalanceBatchRequest)(token.tokenAddress, address));
79
+ ? exports.balanceBatchRequest(address.replace(/^0x/i, ""))
80
+ : exports.tokenBalanceBatchRequest(token.tokenAddress, address));
81
81
  const response = yield fetch(this.getProviderUrl(), {
82
82
  method: "post",
83
83
  headers: { "content-type": "application/json" },
@@ -102,7 +102,7 @@ class ZILClient {
102
102
  // if (!isValidAddress) {
103
103
  // throw new Error("invalid address")
104
104
  // }
105
- return (0, zilliqa_1.fromBech32Address)(bech32Address).toLowerCase().substr(2);
105
+ return zilliqa_1.fromBech32Address(bech32Address).toLowerCase().substr(2);
106
106
  });
107
107
  }
108
108
  // see examplesV2/zil_client.ts on how to confirm the transactions
@@ -148,7 +148,7 @@ class ZILClient {
148
148
  zilliqa = new zilliqa_1.Zilliqa(this.getProviderUrl());
149
149
  }
150
150
  const deployedContract = (this.walletProvider || zilliqa).contracts.at(contractAddress);
151
- const balanceAndNonceResp = yield zilliqa.blockchain.getBalance((0, generic_1.stripHexPrefix)(zilAddress));
151
+ const balanceAndNonceResp = yield zilliqa.blockchain.getBalance(generic_1.stripHexPrefix(zilAddress));
152
152
  if (balanceAndNonceResp.error !== undefined) {
153
153
  throw new Error(balanceAndNonceResp.error.message);
154
154
  }
@@ -166,7 +166,7 @@ class ZILClient {
166
166
  vname: "spender",
167
167
  type: "ByStr20",
168
168
  // TODO: Check if bridgeAddress corresponds to carbon token lock_proxy_hash
169
- value: spenderAddress !== null && spenderAddress !== void 0 ? spenderAddress : (0, generic_1.appendHexPrefix)(token.bridgeAddress),
169
+ value: spenderAddress !== null && spenderAddress !== void 0 ? spenderAddress : generic_1.appendHexPrefix(token.bridgeAddress),
170
170
  },
171
171
  {
172
172
  vname: "amount",
@@ -184,7 +184,7 @@ class ZILClient {
184
184
  }
185
185
  checkAllowanceZRC2(token, owner, spender) {
186
186
  return __awaiter(this, void 0, void 0, function* () {
187
- const contractAddress = (0, generic_1.appendHexPrefix)(token.tokenAddress);
187
+ const contractAddress = generic_1.appendHexPrefix(token.tokenAddress);
188
188
  const zilliqa = new zilliqa_1.Zilliqa(this.getProviderUrl());
189
189
  const resp = yield zilliqa.blockchain.getSmartContractSubState(contractAddress, "allowances", [owner, spender]);
190
190
  if (resp.error !== undefined) {
@@ -206,13 +206,13 @@ class ZILClient {
206
206
  }
207
207
  const carbonNetwork = networkConfig.network;
208
208
  const fromTokenId = fromToken.id;
209
- const fromTokenAddr = (0, generic_1.appendHexPrefix)(fromToken.tokenAddress);
209
+ const fromTokenAddr = generic_1.appendHexPrefix(fromToken.tokenAddress);
210
210
  const toTokenDenom = toToken.denom;
211
- const targetProxyHash = (0, generic_1.appendHexPrefix)(this.getTargetProxyHash(fromToken));
211
+ const targetProxyHash = generic_1.appendHexPrefix(this.getTargetProxyHash(fromToken));
212
212
  const recoveryAddressHex = ethers_1.ethers.utils.hexlify(index_1.AddressUtils.SWTHAddress.getAddressBytes(recoveryAddress, carbonNetwork));
213
213
  const fromAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(fromTokenId));
214
214
  const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(toTokenDenom));
215
- const feeAddress = (0, generic_1.appendHexPrefix)(networkConfig.feeAddress);
215
+ const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
216
216
  const contractAddress = this.getBridgeEntranceAddr();
217
217
  let zilliqa;
218
218
  if (typeof signer === "string") {
@@ -227,7 +227,7 @@ class ZILClient {
227
227
  zilliqa = new zilliqa_1.Zilliqa(this.getProviderUrl());
228
228
  }
229
229
  const deployedContract = (this.walletProvider || zilliqa).contracts.at(contractAddress);
230
- const balanceAndNonceResp = yield zilliqa.blockchain.getBalance((0, generic_1.stripHexPrefix)(fromAddress));
230
+ const balanceAndNonceResp = yield zilliqa.blockchain.getBalance(generic_1.stripHexPrefix(fromAddress));
231
231
  if (balanceAndNonceResp.error !== undefined) {
232
232
  throw new Error(balanceAndNonceResp.error.message);
233
233
  }
@@ -304,13 +304,13 @@ class ZILClient {
304
304
  return __awaiter(this, void 0, void 0, function* () {
305
305
  const { address, amount, token, gasPrice, gasLimit, zilAddress, signer } = params;
306
306
  const networkConfig = this.getNetworkConfig();
307
- const assetId = (0, generic_1.appendHexPrefix)(token.tokenAddress);
308
- const targetProxyHash = (0, generic_1.appendHexPrefix)(this.getTargetProxyHash(token));
309
- const feeAddress = (0, generic_1.appendHexPrefix)(networkConfig.feeAddress);
307
+ const assetId = generic_1.appendHexPrefix(token.tokenAddress);
308
+ const targetProxyHash = generic_1.appendHexPrefix(this.getTargetProxyHash(token));
309
+ const feeAddress = generic_1.appendHexPrefix(networkConfig.feeAddress);
310
310
  const toAssetHash = ethers_1.ethers.utils.hexlify(ethers_1.ethers.utils.toUtf8Bytes(token.id));
311
311
  const swthAddress = ethers_1.ethers.utils.hexlify(address);
312
312
  // TODO: Check if bridgeAddress corresponds to carbon token lock_proxy_hash
313
- const contractAddress = (0, generic_1.appendHexPrefix)(token.bridgeAddress);
313
+ const contractAddress = generic_1.appendHexPrefix(token.bridgeAddress);
314
314
  let zilliqa;
315
315
  if (typeof signer === "string") {
316
316
  zilliqa = new zilliqa_1.Zilliqa(this.getProviderUrl());
@@ -324,7 +324,7 @@ class ZILClient {
324
324
  zilliqa = new zilliqa_1.Zilliqa(this.getProviderUrl());
325
325
  }
326
326
  const deployedContract = (this.walletProvider || zilliqa).contracts.at(contractAddress);
327
- const balanceAndNonceResp = yield zilliqa.blockchain.getBalance((0, generic_1.stripHexPrefix)(zilAddress));
327
+ const balanceAndNonceResp = yield zilliqa.blockchain.getBalance(generic_1.stripHexPrefix(zilAddress));
328
328
  if (balanceAndNonceResp.error !== undefined) {
329
329
  throw new Error(balanceAndNonceResp.error.message);
330
330
  }
@@ -409,7 +409,7 @@ class ZILClient {
409
409
  getTargetProxyHash(token) {
410
410
  const networkConfig = this.getNetworkConfig();
411
411
  const addressBytes = address_1.SWTHAddress.getAddressBytes(token.creator, networkConfig.network);
412
- const addressHex = (0, generic_1.stripHexPrefix)(ethers_1.ethers.utils.hexlify(addressBytes));
412
+ const addressHex = generic_1.stripHexPrefix(ethers_1.ethers.utils.hexlify(addressBytes));
413
413
  return addressHex;
414
414
  }
415
415
  getNetworkConfig() {
@@ -1,6 +1,6 @@
1
1
  import Long from "long";
2
2
  import _m0 from "protobufjs/minimal";
3
- import { PageRequest, PageResponse } from "../query/pagination";
3
+ import { PageRequest, PageResponse } from "../cosmos/base/query/v1beta1/pagination";
4
4
  export declare const protobufPackage = "Switcheo.carbon.bank";
5
5
  export interface InternalTransfer {
6
6
  sender: string;
@@ -7,7 +7,7 @@ exports.QueryClientImpl = exports.QueryInternalTransfersResponse = exports.Query
7
7
  /* eslint-disable */
8
8
  const long_1 = __importDefault(require("long"));
9
9
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
- const pagination_1 = require("../query/pagination");
10
+ const pagination_1 = require("../cosmos/base/query/v1beta1/pagination");
11
11
  exports.protobufPackage = "Switcheo.carbon.bank";
12
12
  const baseInternalTransfer = {
13
13
  sender: "",
@@ -1,6 +1,6 @@
1
1
  import Long from "long";
2
2
  import _m0 from "protobufjs/minimal";
3
- import { PageRequest, PageResponse } from "../query/pagination";
3
+ import { PageRequest, PageResponse } from "../cosmos/base/query/v1beta1/pagination";
4
4
  import { MinMaxBoundary } from "./pagination";
5
5
  import { Candlestick } from "./candlestick";
6
6
  import { TradeEvent } from "./event";
@@ -17,10 +17,8 @@ export interface QueryCandlesticksResponse {
17
17
  export interface QueryTradesRequest {
18
18
  address: string;
19
19
  market: string;
20
- limit: Long;
21
20
  beforeId: Long;
22
21
  afterId: Long;
23
- orderBy: string;
24
22
  orderId: string;
25
23
  afterBlock: Long;
26
24
  beforeBlock: Long;
@@ -35,7 +33,6 @@ export interface QueryTradesForPositionRequest {
35
33
  address: string;
36
34
  market: string;
37
35
  openedBlockHeight: Long;
38
- orderBy: string;
39
36
  pagination?: PageRequest;
40
37
  }
41
38
  export interface QueryTradesForPositionResponse {
@@ -7,7 +7,7 @@ exports.QueryClientImpl = exports.QueryTradesForPositionResponse = exports.Query
7
7
  /* eslint-disable */
8
8
  const long_1 = __importDefault(require("long"));
9
9
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
- const pagination_1 = require("../query/pagination");
10
+ const pagination_1 = require("../cosmos/base/query/v1beta1/pagination");
11
11
  const pagination_2 = require("./pagination");
12
12
  const candlestick_1 = require("./candlestick");
13
13
  const event_1 = require("./event");
@@ -162,10 +162,8 @@ exports.QueryCandlesticksResponse = {
162
162
  const baseQueryTradesRequest = {
163
163
  address: "",
164
164
  market: "",
165
- limit: long_1.default.UZERO,
166
165
  beforeId: long_1.default.UZERO,
167
166
  afterId: long_1.default.UZERO,
168
- orderBy: "",
169
167
  orderId: "",
170
168
  afterBlock: long_1.default.UZERO,
171
169
  beforeBlock: long_1.default.UZERO,
@@ -178,18 +176,12 @@ exports.QueryTradesRequest = {
178
176
  if (message.market !== "") {
179
177
  writer.uint32(18).string(message.market);
180
178
  }
181
- if (!message.limit.isZero()) {
182
- writer.uint32(24).uint64(message.limit);
183
- }
184
179
  if (!message.beforeId.isZero()) {
185
180
  writer.uint32(32).uint64(message.beforeId);
186
181
  }
187
182
  if (!message.afterId.isZero()) {
188
183
  writer.uint32(40).uint64(message.afterId);
189
184
  }
190
- if (message.orderBy !== "") {
191
- writer.uint32(50).string(message.orderBy);
192
- }
193
185
  if (message.orderId !== "") {
194
186
  writer.uint32(58).string(message.orderId);
195
187
  }
@@ -217,18 +209,12 @@ exports.QueryTradesRequest = {
217
209
  case 2:
218
210
  message.market = reader.string();
219
211
  break;
220
- case 3:
221
- message.limit = reader.uint64();
222
- break;
223
212
  case 4:
224
213
  message.beforeId = reader.uint64();
225
214
  break;
226
215
  case 5:
227
216
  message.afterId = reader.uint64();
228
217
  break;
229
- case 6:
230
- message.orderBy = reader.string();
231
- break;
232
218
  case 7:
233
219
  message.orderId = reader.string();
234
220
  break;
@@ -258,10 +244,6 @@ exports.QueryTradesRequest = {
258
244
  object.market !== undefined && object.market !== null
259
245
  ? String(object.market)
260
246
  : "";
261
- message.limit =
262
- object.limit !== undefined && object.limit !== null
263
- ? long_1.default.fromString(object.limit)
264
- : long_1.default.UZERO;
265
247
  message.beforeId =
266
248
  object.beforeId !== undefined && object.beforeId !== null
267
249
  ? long_1.default.fromString(object.beforeId)
@@ -270,10 +252,6 @@ exports.QueryTradesRequest = {
270
252
  object.afterId !== undefined && object.afterId !== null
271
253
  ? long_1.default.fromString(object.afterId)
272
254
  : long_1.default.UZERO;
273
- message.orderBy =
274
- object.orderBy !== undefined && object.orderBy !== null
275
- ? String(object.orderBy)
276
- : "";
277
255
  message.orderId =
278
256
  object.orderId !== undefined && object.orderId !== null
279
257
  ? String(object.orderId)
@@ -296,13 +274,10 @@ exports.QueryTradesRequest = {
296
274
  const obj = {};
297
275
  message.address !== undefined && (obj.address = message.address);
298
276
  message.market !== undefined && (obj.market = message.market);
299
- message.limit !== undefined &&
300
- (obj.limit = (message.limit || long_1.default.UZERO).toString());
301
277
  message.beforeId !== undefined &&
302
278
  (obj.beforeId = (message.beforeId || long_1.default.UZERO).toString());
303
279
  message.afterId !== undefined &&
304
280
  (obj.afterId = (message.afterId || long_1.default.UZERO).toString());
305
- message.orderBy !== undefined && (obj.orderBy = message.orderBy);
306
281
  message.orderId !== undefined && (obj.orderId = message.orderId);
307
282
  message.afterBlock !== undefined &&
308
283
  (obj.afterBlock = (message.afterBlock || long_1.default.UZERO).toString());
@@ -315,14 +290,10 @@ exports.QueryTradesRequest = {
315
290
  return obj;
316
291
  },
317
292
  fromPartial(object) {
318
- var _a, _b, _c, _d;
293
+ var _a, _b, _c;
319
294
  const message = Object.assign({}, baseQueryTradesRequest);
320
295
  message.address = (_a = object.address) !== null && _a !== void 0 ? _a : "";
321
296
  message.market = (_b = object.market) !== null && _b !== void 0 ? _b : "";
322
- message.limit =
323
- object.limit !== undefined && object.limit !== null
324
- ? long_1.default.fromValue(object.limit)
325
- : long_1.default.UZERO;
326
297
  message.beforeId =
327
298
  object.beforeId !== undefined && object.beforeId !== null
328
299
  ? long_1.default.fromValue(object.beforeId)
@@ -331,8 +302,7 @@ exports.QueryTradesRequest = {
331
302
  object.afterId !== undefined && object.afterId !== null
332
303
  ? long_1.default.fromValue(object.afterId)
333
304
  : long_1.default.UZERO;
334
- message.orderBy = (_c = object.orderBy) !== null && _c !== void 0 ? _c : "";
335
- message.orderId = (_d = object.orderId) !== null && _d !== void 0 ? _d : "";
305
+ message.orderId = (_c = object.orderId) !== null && _c !== void 0 ? _c : "";
336
306
  message.afterBlock =
337
307
  object.afterBlock !== undefined && object.afterBlock !== null
338
308
  ? long_1.default.fromValue(object.afterBlock)
@@ -437,7 +407,6 @@ const baseQueryTradesForPositionRequest = {
437
407
  address: "",
438
408
  market: "",
439
409
  openedBlockHeight: long_1.default.UZERO,
440
- orderBy: "",
441
410
  };
442
411
  exports.QueryTradesForPositionRequest = {
443
412
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -450,9 +419,6 @@ exports.QueryTradesForPositionRequest = {
450
419
  if (!message.openedBlockHeight.isZero()) {
451
420
  writer.uint32(24).uint64(message.openedBlockHeight);
452
421
  }
453
- if (message.orderBy !== "") {
454
- writer.uint32(34).string(message.orderBy);
455
- }
456
422
  if (message.pagination !== undefined) {
457
423
  pagination_1.PageRequest.encode(message.pagination, writer.uint32(42).fork()).ldelim();
458
424
  }
@@ -474,9 +440,6 @@ exports.QueryTradesForPositionRequest = {
474
440
  case 3:
475
441
  message.openedBlockHeight = reader.uint64();
476
442
  break;
477
- case 4:
478
- message.orderBy = reader.string();
479
- break;
480
443
  case 5:
481
444
  message.pagination = pagination_1.PageRequest.decode(reader, reader.uint32());
482
445
  break;
@@ -502,10 +465,6 @@ exports.QueryTradesForPositionRequest = {
502
465
  object.openedBlockHeight !== null
503
466
  ? long_1.default.fromString(object.openedBlockHeight)
504
467
  : long_1.default.UZERO;
505
- message.orderBy =
506
- object.orderBy !== undefined && object.orderBy !== null
507
- ? String(object.orderBy)
508
- : "";
509
468
  message.pagination =
510
469
  object.pagination !== undefined && object.pagination !== null
511
470
  ? pagination_1.PageRequest.fromJSON(object.pagination)
@@ -518,7 +477,6 @@ exports.QueryTradesForPositionRequest = {
518
477
  message.market !== undefined && (obj.market = message.market);
519
478
  message.openedBlockHeight !== undefined &&
520
479
  (obj.openedBlockHeight = (message.openedBlockHeight || long_1.default.UZERO).toString());
521
- message.orderBy !== undefined && (obj.orderBy = message.orderBy);
522
480
  message.pagination !== undefined &&
523
481
  (obj.pagination = message.pagination
524
482
  ? pagination_1.PageRequest.toJSON(message.pagination)
@@ -526,7 +484,7 @@ exports.QueryTradesForPositionRequest = {
526
484
  return obj;
527
485
  },
528
486
  fromPartial(object) {
529
- var _a, _b, _c;
487
+ var _a, _b;
530
488
  const message = Object.assign({}, baseQueryTradesForPositionRequest);
531
489
  message.address = (_a = object.address) !== null && _a !== void 0 ? _a : "";
532
490
  message.market = (_b = object.market) !== null && _b !== void 0 ? _b : "";
@@ -535,7 +493,6 @@ exports.QueryTradesForPositionRequest = {
535
493
  object.openedBlockHeight !== null
536
494
  ? long_1.default.fromValue(object.openedBlockHeight)
537
495
  : long_1.default.UZERO;
538
- message.orderBy = (_c = object.orderBy) !== null && _c !== void 0 ? _c : "";
539
496
  message.pagination =
540
497
  object.pagination !== undefined && object.pagination !== null
541
498
  ? pagination_1.PageRequest.fromPartial(object.pagination)
@@ -35,8 +35,10 @@ export interface SetLiquidationFeeEvent {
35
35
  type: string;
36
36
  }
37
37
  export interface SetStablecoinInterestRateEvent {
38
+ /** Deprecated for stablecoin_interest_rate_dec */
38
39
  stablecoinInterestRate: string;
39
40
  type: string;
41
+ stablecoinInterestRateDec: string;
40
42
  }
41
43
  export interface SetStablecoinMintCapEvent {
42
44
  stablecoinMintCap: string;
@@ -453,6 +453,7 @@ exports.SetLiquidationFeeEvent = {
453
453
  const baseSetStablecoinInterestRateEvent = {
454
454
  stablecoinInterestRate: "",
455
455
  type: "",
456
+ stablecoinInterestRateDec: "",
456
457
  };
457
458
  exports.SetStablecoinInterestRateEvent = {
458
459
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -462,6 +463,9 @@ exports.SetStablecoinInterestRateEvent = {
462
463
  if (message.type !== "") {
463
464
  writer.uint32(18).string(message.type);
464
465
  }
466
+ if (message.stablecoinInterestRateDec !== "") {
467
+ writer.uint32(26).string(message.stablecoinInterestRateDec);
468
+ }
465
469
  return writer;
466
470
  },
467
471
  decode(input, length) {
@@ -477,6 +481,9 @@ exports.SetStablecoinInterestRateEvent = {
477
481
  case 2:
478
482
  message.type = reader.string();
479
483
  break;
484
+ case 3:
485
+ message.stablecoinInterestRateDec = reader.string();
486
+ break;
480
487
  default:
481
488
  reader.skipType(tag & 7);
482
489
  break;
@@ -495,6 +502,11 @@ exports.SetStablecoinInterestRateEvent = {
495
502
  object.type !== undefined && object.type !== null
496
503
  ? String(object.type)
497
504
  : "";
505
+ message.stablecoinInterestRateDec =
506
+ object.stablecoinInterestRateDec !== undefined &&
507
+ object.stablecoinInterestRateDec !== null
508
+ ? String(object.stablecoinInterestRateDec)
509
+ : "";
498
510
  return message;
499
511
  },
500
512
  toJSON(message) {
@@ -502,13 +514,16 @@ exports.SetStablecoinInterestRateEvent = {
502
514
  message.stablecoinInterestRate !== undefined &&
503
515
  (obj.stablecoinInterestRate = message.stablecoinInterestRate);
504
516
  message.type !== undefined && (obj.type = message.type);
517
+ message.stablecoinInterestRateDec !== undefined &&
518
+ (obj.stablecoinInterestRateDec = message.stablecoinInterestRateDec);
505
519
  return obj;
506
520
  },
507
521
  fromPartial(object) {
508
- var _a, _b;
522
+ var _a, _b, _c;
509
523
  const message = Object.assign({}, baseSetStablecoinInterestRateEvent);
510
524
  message.stablecoinInterestRate = (_a = object.stablecoinInterestRate) !== null && _a !== void 0 ? _a : "";
511
525
  message.type = (_b = object.type) !== null && _b !== void 0 ? _b : "";
526
+ message.stablecoinInterestRateDec = (_c = object.stablecoinInterestRateDec) !== null && _c !== void 0 ? _c : "";
512
527
  return message;
513
528
  },
514
529
  };
@@ -2,6 +2,7 @@ import Long from "long";
2
2
  import _m0 from "protobufjs/minimal";
3
3
  import { Params } from "./params";
4
4
  import { StablecoinDebtInfo } from "./stablecoin_debt_info";
5
+ import { StablecoinInterestInfo } from "./stablecoin_interest_info";
5
6
  import { RateStrategyParams } from "./rate_strategy_params";
6
7
  import { AssetParams } from "./asset_params";
7
8
  import { DebtInfo } from "./debt_info";
@@ -31,10 +32,11 @@ export interface GenesisState {
31
32
  accountToStablecoinInitialCumulativeInterestMultiplier: {
32
33
  [key: string]: Uint8Array;
33
34
  };
34
- /** this line is used by starport scaffolding # genesis/proto/state */
35
35
  accountToRewardDebt: {
36
36
  [key: string]: Uint8Array;
37
37
  };
38
+ /** this line is used by starport scaffolding # genesis/proto/state */
39
+ stablecoinInterestInfo?: StablecoinInterestInfo;
38
40
  }
39
41
  export interface GenesisState_AccountToCollateralizedEntry {
40
42
  key: string;