@injectivelabs/sdk-ts 1.0.338 → 1.0.339

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 (215) hide show
  1. package/dist/client/chain/grpc/ChainGrpcAuctionApi.js +42 -57
  2. package/dist/client/chain/grpc/ChainGrpcAuctionApi.js.map +1 -1
  3. package/dist/client/chain/grpc/ChainGrpcAuthApi.js +38 -53
  4. package/dist/client/chain/grpc/ChainGrpcAuthApi.js.map +1 -1
  5. package/dist/client/chain/grpc/ChainGrpcBankApi.js +63 -80
  6. package/dist/client/chain/grpc/ChainGrpcBankApi.js.map +1 -1
  7. package/dist/client/chain/grpc/ChainGrpcDistributionApi.js +68 -87
  8. package/dist/client/chain/grpc/ChainGrpcDistributionApi.js.map +1 -1
  9. package/dist/client/chain/grpc/ChainGrpcExchangeApi.js +142 -169
  10. package/dist/client/chain/grpc/ChainGrpcExchangeApi.js.map +1 -1
  11. package/dist/client/chain/grpc/ChainGrpcGovApi.js +110 -131
  12. package/dist/client/chain/grpc/ChainGrpcGovApi.js.map +1 -1
  13. package/dist/client/chain/grpc/ChainGrpcIbcApi.js +29 -42
  14. package/dist/client/chain/grpc/ChainGrpcIbcApi.js.map +1 -1
  15. package/dist/client/chain/grpc/ChainGrpcInsuranceFundApi.js +75 -94
  16. package/dist/client/chain/grpc/ChainGrpcInsuranceFundApi.js.map +1 -1
  17. package/dist/client/chain/grpc/ChainGrpcMintApi.js +46 -61
  18. package/dist/client/chain/grpc/ChainGrpcMintApi.js.map +1 -1
  19. package/dist/client/chain/grpc/ChainGrpcOracleApi.js +14 -25
  20. package/dist/client/chain/grpc/ChainGrpcOracleApi.js.map +1 -1
  21. package/dist/client/chain/grpc/ChainGrpcPeggyApi.js +14 -25
  22. package/dist/client/chain/grpc/ChainGrpcPeggyApi.js.map +1 -1
  23. package/dist/client/chain/grpc/ChainGrpcStakingApi.js +336 -379
  24. package/dist/client/chain/grpc/ChainGrpcStakingApi.js.map +1 -1
  25. package/dist/client/chain/grpc/ChainGrpcWasmApi.js +149 -174
  26. package/dist/client/chain/grpc/ChainGrpcWasmApi.js.map +1 -1
  27. package/dist/client/chain/grpc/ChainGrpcWasmXApi.js +28 -41
  28. package/dist/client/chain/grpc/ChainGrpcWasmXApi.js.map +1 -1
  29. package/dist/client/chain/rest/ChainRestAuthApi.js +30 -43
  30. package/dist/client/chain/rest/ChainRestAuthApi.js.map +1 -1
  31. package/dist/client/chain/rest/ChainRestBankApi.js +35 -48
  32. package/dist/client/chain/rest/ChainRestBankApi.js.map +1 -1
  33. package/dist/client/chain/rest/ChainRestTendermintApi.js +29 -42
  34. package/dist/client/chain/rest/ChainRestTendermintApi.js.map +1 -1
  35. package/dist/client/chain/types/index.js +1 -1
  36. package/dist/client/chain/types/index.js.map +1 -1
  37. package/dist/client/gql/client.js +25 -38
  38. package/dist/client/gql/client.js.map +1 -1
  39. package/dist/client/indexer/grpc/IndexerGrpcAccountApi.js +157 -182
  40. package/dist/client/indexer/grpc/IndexerGrpcAccountApi.js.map +1 -1
  41. package/dist/client/indexer/grpc/IndexerGrpcAuctionApi.js +32 -45
  42. package/dist/client/indexer/grpc/IndexerGrpcAuctionApi.js.map +1 -1
  43. package/dist/client/indexer/grpc/IndexerGrpcDerivativesApi.js +435 -472
  44. package/dist/client/indexer/grpc/IndexerGrpcDerivativesApi.js.map +1 -1
  45. package/dist/client/indexer/grpc/IndexerGrpcExplorerApi.js +236 -265
  46. package/dist/client/indexer/grpc/IndexerGrpcExplorerApi.js.map +1 -1
  47. package/dist/client/indexer/grpc/IndexerGrpcInsuranceFundApi.js +35 -48
  48. package/dist/client/indexer/grpc/IndexerGrpcInsuranceFundApi.js.map +1 -1
  49. package/dist/client/indexer/grpc/IndexerGrpcMetaApi.js +42 -57
  50. package/dist/client/indexer/grpc/IndexerGrpcMetaApi.js.map +1 -1
  51. package/dist/client/indexer/grpc/IndexerGrpcNinjaApi.js +182 -207
  52. package/dist/client/indexer/grpc/IndexerGrpcNinjaApi.js.map +1 -1
  53. package/dist/client/indexer/grpc/IndexerGrpcOracleApi.js +58 -73
  54. package/dist/client/indexer/grpc/IndexerGrpcOracleApi.js.map +1 -1
  55. package/dist/client/indexer/grpc/IndexerGrpcSpotApi.js +289 -316
  56. package/dist/client/indexer/grpc/IndexerGrpcSpotApi.js.map +1 -1
  57. package/dist/client/indexer/grpc/IndexerGrpcTransactionApi.js +193 -214
  58. package/dist/client/indexer/grpc/IndexerGrpcTransactionApi.js.map +1 -1
  59. package/dist/client/indexer/rest/IndexerRestDerivativesChronosApi.js +33 -46
  60. package/dist/client/indexer/rest/IndexerRestDerivativesChronosApi.js.map +1 -1
  61. package/dist/client/indexer/rest/IndexerRestExplorerApi.js +283 -322
  62. package/dist/client/indexer/rest/IndexerRestExplorerApi.js.map +1 -1
  63. package/dist/client/indexer/rest/IndexerRestLeaderboardChronosApi.js +16 -27
  64. package/dist/client/indexer/rest/IndexerRestLeaderboardChronosApi.js.map +1 -1
  65. package/dist/client/indexer/rest/IndexerRestMarketChronosApi.js +26 -37
  66. package/dist/client/indexer/rest/IndexerRestMarketChronosApi.js.map +1 -1
  67. package/dist/client/indexer/rest/IndexerRestSpotChronosApi.js +33 -46
  68. package/dist/client/indexer/rest/IndexerRestSpotChronosApi.js.map +1 -1
  69. package/dist/client/indexer/transformers/IndexerGrpcDerivativeTransformer.js +13 -1
  70. package/dist/client/indexer/transformers/IndexerGrpcDerivativeTransformer.js.map +1 -1
  71. package/dist/client/indexer/transformers/IndexerGrpcExplorerTransformer.js +1 -1
  72. package/dist/client/indexer/transformers/IndexerGrpcExplorerTransformer.js.map +1 -1
  73. package/dist/client/indexer/transformers/IndexerGrpcSpotTransformer.js +12 -1
  74. package/dist/client/indexer/transformers/IndexerGrpcSpotTransformer.js.map +1 -1
  75. package/dist/client/indexer/transformers/IndexerRestExplorerTransformer.js +6 -2
  76. package/dist/client/indexer/transformers/IndexerRestExplorerTransformer.js.map +1 -1
  77. package/dist/client/indexer/types/index.js +1 -1
  78. package/dist/client/indexer/types/index.js.map +1 -1
  79. package/dist/client/wasm/supernova/transformer.js +20 -2
  80. package/dist/client/wasm/supernova/transformer.js.map +1 -1
  81. package/dist/core/accounts/PrivateKey.js +46 -67
  82. package/dist/core/accounts/PrivateKey.js.map +1 -1
  83. package/dist/core/accounts/signers/OfflineAminoSigner.js +28 -43
  84. package/dist/core/accounts/signers/OfflineAminoSigner.js.map +1 -1
  85. package/dist/core/accounts/signers/OfflineDirectSigner.js +28 -43
  86. package/dist/core/accounts/signers/OfflineDirectSigner.js.map +1 -1
  87. package/dist/core/modules/MsgBase.js +1 -12
  88. package/dist/core/modules/MsgBase.js.map +1 -1
  89. package/dist/core/modules/auction/msgs/MsgBid.js +13 -15
  90. package/dist/core/modules/auction/msgs/MsgBid.js.map +1 -1
  91. package/dist/core/modules/authz/msgs/MsgExec.js +13 -15
  92. package/dist/core/modules/authz/msgs/MsgExec.js.map +1 -1
  93. package/dist/core/modules/authz/msgs/MsgGrant.js +22 -17
  94. package/dist/core/modules/authz/msgs/MsgGrant.js.map +1 -1
  95. package/dist/core/modules/authz/msgs/MsgRevoke.js +13 -15
  96. package/dist/core/modules/authz/msgs/MsgRevoke.js.map +1 -1
  97. package/dist/core/modules/bank/msgs/MsgSend.js +18 -17
  98. package/dist/core/modules/bank/msgs/MsgSend.js.map +1 -1
  99. package/dist/core/modules/distribution/msgs/MsgWithdrawDelegatorReward.js +13 -15
  100. package/dist/core/modules/distribution/msgs/MsgWithdrawDelegatorReward.js.map +1 -1
  101. package/dist/core/modules/distribution/msgs/MsgWithdrawValidatorCommission.js +13 -15
  102. package/dist/core/modules/distribution/msgs/MsgWithdrawValidatorCommission.js.map +1 -1
  103. package/dist/core/modules/exchange/msgs/MsgBatchCancelBinaryOptionsOrders.js +16 -18
  104. package/dist/core/modules/exchange/msgs/MsgBatchCancelBinaryOptionsOrders.js.map +1 -1
  105. package/dist/core/modules/exchange/msgs/MsgBatchCancelDerivativeOrders.js +16 -18
  106. package/dist/core/modules/exchange/msgs/MsgBatchCancelDerivativeOrders.js.map +1 -1
  107. package/dist/core/modules/exchange/msgs/MsgBatchCancelSpotOrders.js +16 -18
  108. package/dist/core/modules/exchange/msgs/MsgBatchCancelSpotOrders.js.map +1 -1
  109. package/dist/core/modules/exchange/msgs/MsgBatchUpdateOrders.js +33 -18
  110. package/dist/core/modules/exchange/msgs/MsgBatchUpdateOrders.js.map +1 -1
  111. package/dist/core/modules/exchange/msgs/MsgCancelBinaryOptionsOrder.js +13 -15
  112. package/dist/core/modules/exchange/msgs/MsgCancelBinaryOptionsOrder.js.map +1 -1
  113. package/dist/core/modules/exchange/msgs/MsgCancelDerivativeOrder.js +13 -15
  114. package/dist/core/modules/exchange/msgs/MsgCancelDerivativeOrder.js.map +1 -1
  115. package/dist/core/modules/exchange/msgs/MsgCancelSpotOrder.js +13 -15
  116. package/dist/core/modules/exchange/msgs/MsgCancelSpotOrder.js.map +1 -1
  117. package/dist/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.js +20 -16
  118. package/dist/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.js.map +1 -1
  119. package/dist/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.js +20 -16
  120. package/dist/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.js.map +1 -1
  121. package/dist/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.js +20 -16
  122. package/dist/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.js.map +1 -1
  123. package/dist/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.js +20 -16
  124. package/dist/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.js.map +1 -1
  125. package/dist/core/modules/exchange/msgs/MsgCreateSpotLimitOrder.js +19 -16
  126. package/dist/core/modules/exchange/msgs/MsgCreateSpotLimitOrder.js.map +1 -1
  127. package/dist/core/modules/exchange/msgs/MsgCreateSpotMarketOrder.js +19 -16
  128. package/dist/core/modules/exchange/msgs/MsgCreateSpotMarketOrder.js.map +1 -1
  129. package/dist/core/modules/exchange/msgs/MsgDeposit.js +13 -15
  130. package/dist/core/modules/exchange/msgs/MsgDeposit.js.map +1 -1
  131. package/dist/core/modules/exchange/msgs/MsgExternalTransfer.js +13 -15
  132. package/dist/core/modules/exchange/msgs/MsgExternalTransfer.js.map +1 -1
  133. package/dist/core/modules/exchange/msgs/MsgIncreasePositionMargin.js +17 -16
  134. package/dist/core/modules/exchange/msgs/MsgIncreasePositionMargin.js.map +1 -1
  135. package/dist/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunch.js +23 -16
  136. package/dist/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunch.js.map +1 -1
  137. package/dist/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.js +21 -16
  138. package/dist/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.js.map +1 -1
  139. package/dist/core/modules/exchange/msgs/MsgMultiExecute.js +12 -3
  140. package/dist/core/modules/exchange/msgs/MsgMultiExecute.js.map +1 -1
  141. package/dist/core/modules/exchange/msgs/MsgReclaimLockedFunds.js +13 -15
  142. package/dist/core/modules/exchange/msgs/MsgReclaimLockedFunds.js.map +1 -1
  143. package/dist/core/modules/exchange/msgs/MsgTransferAndExecute.js +20 -5
  144. package/dist/core/modules/exchange/msgs/MsgTransferAndExecute.js.map +1 -1
  145. package/dist/core/modules/exchange/msgs/MsgWithdraw.js +13 -15
  146. package/dist/core/modules/exchange/msgs/MsgWithdraw.js.map +1 -1
  147. package/dist/core/modules/exchange/utils/classes/OrderHashManager.js +28 -43
  148. package/dist/core/modules/exchange/utils/classes/OrderHashManager.js.map +1 -1
  149. package/dist/core/modules/gov/msgs/MsgDeposit.js +18 -17
  150. package/dist/core/modules/gov/msgs/MsgDeposit.js.map +1 -1
  151. package/dist/core/modules/gov/msgs/MsgSubmitProposalExpiryFuturesMarketLaunch.js +32 -7
  152. package/dist/core/modules/gov/msgs/MsgSubmitProposalExpiryFuturesMarketLaunch.js.map +1 -1
  153. package/dist/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunch.js +32 -7
  154. package/dist/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunch.js.map +1 -1
  155. package/dist/core/modules/gov/msgs/MsgSubmitProposalSpotMarketLaunch.js +32 -7
  156. package/dist/core/modules/gov/msgs/MsgSubmitProposalSpotMarketLaunch.js.map +1 -1
  157. package/dist/core/modules/gov/msgs/MsgSubmitProposalSpotMarketParamUpdate.js +32 -7
  158. package/dist/core/modules/gov/msgs/MsgSubmitProposalSpotMarketParamUpdate.js.map +1 -1
  159. package/dist/core/modules/gov/msgs/MsgSubmitTextProposal.js +32 -7
  160. package/dist/core/modules/gov/msgs/MsgSubmitTextProposal.js.map +1 -1
  161. package/dist/core/modules/gov/msgs/MsgVote.js +13 -15
  162. package/dist/core/modules/gov/msgs/MsgVote.js.map +1 -1
  163. package/dist/core/modules/ibc/msgs/MsgTransfer.js +13 -15
  164. package/dist/core/modules/ibc/msgs/MsgTransfer.js.map +1 -1
  165. package/dist/core/modules/insurance/msgs/MsgCreateInsuranceFund.js +13 -15
  166. package/dist/core/modules/insurance/msgs/MsgCreateInsuranceFund.js.map +1 -1
  167. package/dist/core/modules/insurance/msgs/MsgRequestRedemption.js +13 -15
  168. package/dist/core/modules/insurance/msgs/MsgRequestRedemption.js.map +1 -1
  169. package/dist/core/modules/insurance/msgs/MsgUnderwrite.js +13 -15
  170. package/dist/core/modules/insurance/msgs/MsgUnderwrite.js.map +1 -1
  171. package/dist/core/modules/peggy/msgs/MsgSendToEth.js +13 -15
  172. package/dist/core/modules/peggy/msgs/MsgSendToEth.js.map +1 -1
  173. package/dist/core/modules/staking/msgs/MsgBeginRedelegate.js +13 -15
  174. package/dist/core/modules/staking/msgs/MsgBeginRedelegate.js.map +1 -1
  175. package/dist/core/modules/staking/msgs/MsgDelegate.js +13 -15
  176. package/dist/core/modules/staking/msgs/MsgDelegate.js.map +1 -1
  177. package/dist/core/modules/staking/msgs/MsgEditValidator.js +13 -15
  178. package/dist/core/modules/staking/msgs/MsgEditValidator.js.map +1 -1
  179. package/dist/core/modules/staking/msgs/MsgUndelegate.js +13 -15
  180. package/dist/core/modules/staking/msgs/MsgUndelegate.js.map +1 -1
  181. package/dist/core/modules/tx/api/TxGrpcApi.js +120 -130
  182. package/dist/core/modules/tx/api/TxGrpcApi.js.map +1 -1
  183. package/dist/core/modules/tx/api/TxRestApi.js +163 -181
  184. package/dist/core/modules/tx/api/TxRestApi.js.map +1 -1
  185. package/dist/core/modules/tx/broadcaster/MsgBroadcasterWithPk.js +84 -84
  186. package/dist/core/modules/tx/broadcaster/MsgBroadcasterWithPk.js.map +1 -1
  187. package/dist/core/modules/tx/eip712/eip712.js +14 -2
  188. package/dist/core/modules/tx/eip712/eip712.js.map +1 -1
  189. package/dist/core/modules/tx/eip712/maps.js +24 -6
  190. package/dist/core/modules/tx/eip712/maps.js.map +1 -1
  191. package/dist/core/modules/tx/tx.js +34 -24
  192. package/dist/core/modules/tx/tx.js.map +1 -1
  193. package/dist/core/modules/wasm/exec-args/ExecArgInitiateTransfer.js +9 -2
  194. package/dist/core/modules/wasm/exec-args/ExecArgInitiateTransfer.js.map +1 -1
  195. package/dist/core/modules/wasm/exec-args/ExecArgUpdateSpotVaultConfig.js +19 -1
  196. package/dist/core/modules/wasm/exec-args/ExecArgUpdateSpotVaultConfig.js.map +1 -1
  197. package/dist/core/modules/wasm/msgs/MsgExecuteContract.js +18 -16
  198. package/dist/core/modules/wasm/msgs/MsgExecuteContract.js.map +1 -1
  199. package/dist/core/modules/wasm/msgs/MsgInstantiateContract.js +16 -16
  200. package/dist/core/modules/wasm/msgs/MsgInstantiateContract.js.map +1 -1
  201. package/dist/core/modules/wasm/msgs/MsgMigrateContract.js +17 -16
  202. package/dist/core/modules/wasm/msgs/MsgMigrateContract.js.map +1 -1
  203. package/dist/core/modules/wasm/msgs/MsgPrivilegedExecuteContract.js +16 -16
  204. package/dist/core/modules/wasm/msgs/MsgPrivilegedExecuteContract.js.map +1 -1
  205. package/dist/core/modules/wasm/msgs/MsgStoreCode.js +16 -16
  206. package/dist/core/modules/wasm/msgs/MsgStoreCode.js.map +1 -1
  207. package/dist/core/stargate/StargateClient.js +17 -28
  208. package/dist/core/stargate/StargateClient.js.map +1 -1
  209. package/dist/utils/classes/Denom/Denom.js +104 -130
  210. package/dist/utils/classes/Denom/Denom.js.map +1 -1
  211. package/dist/utils/classes/Denom/DenomClient.js +10 -2
  212. package/dist/utils/classes/Denom/DenomClient.js.map +1 -1
  213. package/dist/utils/pagination.js +5 -1
  214. package/dist/utils/pagination.js.map +1 -1
  215. package/package.json +7 -7
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
@@ -27,174 +18,156 @@ class ChainGrpcExchangeApi extends BaseGrpcConsumer_1.default {
27
18
  super(...arguments);
28
19
  this.module = types_1.ChainModule.Exchange;
29
20
  }
30
- fetchModuleParams() {
31
- return __awaiter(this, void 0, void 0, function* () {
32
- const request = new query_pb_1.QueryExchangeParamsRequest();
33
- try {
34
- const response = yield this.request(request, query_pb_service_1.Query.QueryExchangeParams);
35
- return transformers_1.ChainGrpcExchangeTransformer.moduleParamsResponseToParams(response);
36
- }
37
- catch (e) {
38
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
39
- throw e;
40
- }
41
- throw new exceptions_1.GrpcUnaryRequestException(e, {
42
- code: exceptions_1.UnspecifiedErrorCode,
43
- contextModule: types_1.ChainModule.Exchange,
44
- });
45
- }
46
- });
21
+ async fetchModuleParams() {
22
+ const request = new query_pb_1.QueryExchangeParamsRequest();
23
+ try {
24
+ const response = await this.request(request, query_pb_service_1.Query.QueryExchangeParams);
25
+ return transformers_1.ChainGrpcExchangeTransformer.moduleParamsResponseToParams(response);
26
+ }
27
+ catch (e) {
28
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
29
+ throw e;
30
+ }
31
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
32
+ code: exceptions_1.UnspecifiedErrorCode,
33
+ contextModule: types_1.ChainModule.Exchange,
34
+ });
35
+ }
47
36
  }
48
- fetchModuleState() {
49
- return __awaiter(this, void 0, void 0, function* () {
50
- const request = new query_pb_1.QueryModuleStateRequest();
51
- try {
52
- const response = yield this.request(request, query_pb_service_1.Query.ExchangeModuleState);
53
- return response.getState().toObject(); /* TODO */
54
- }
55
- catch (e) {
56
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
57
- throw e;
58
- }
59
- throw new exceptions_1.GrpcUnaryRequestException(e, {
60
- code: exceptions_1.UnspecifiedErrorCode,
61
- contextModule: types_1.ChainModule.Exchange,
62
- });
63
- }
64
- });
37
+ async fetchModuleState() {
38
+ const request = new query_pb_1.QueryModuleStateRequest();
39
+ try {
40
+ const response = await this.request(request, query_pb_service_1.Query.ExchangeModuleState);
41
+ return response.getState().toObject(); /* TODO */
42
+ }
43
+ catch (e) {
44
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
45
+ throw e;
46
+ }
47
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
48
+ code: exceptions_1.UnspecifiedErrorCode,
49
+ contextModule: types_1.ChainModule.Exchange,
50
+ });
51
+ }
65
52
  }
66
- fetchFeeDiscountSchedule() {
67
- return __awaiter(this, void 0, void 0, function* () {
68
- const request = new query_pb_1.QueryFeeDiscountScheduleRequest();
69
- try {
70
- const response = yield this.request(request, query_pb_service_1.Query.FeeDiscountSchedule);
71
- return transformers_1.ChainGrpcExchangeTransformer.feeDiscountScheduleResponseToFeeDiscountSchedule(response);
72
- }
73
- catch (e) {
74
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
75
- throw e;
76
- }
77
- throw new exceptions_1.GrpcUnaryRequestException(e, {
78
- code: exceptions_1.UnspecifiedErrorCode,
79
- contextModule: types_1.ChainModule.Exchange,
80
- });
81
- }
82
- });
53
+ async fetchFeeDiscountSchedule() {
54
+ const request = new query_pb_1.QueryFeeDiscountScheduleRequest();
55
+ try {
56
+ const response = await this.request(request, query_pb_service_1.Query.FeeDiscountSchedule);
57
+ return transformers_1.ChainGrpcExchangeTransformer.feeDiscountScheduleResponseToFeeDiscountSchedule(response);
58
+ }
59
+ catch (e) {
60
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
61
+ throw e;
62
+ }
63
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
64
+ code: exceptions_1.UnspecifiedErrorCode,
65
+ contextModule: types_1.ChainModule.Exchange,
66
+ });
67
+ }
83
68
  }
84
- fetchFeeDiscountAccountInfo(injectiveAddress) {
85
- return __awaiter(this, void 0, void 0, function* () {
86
- const request = new query_pb_1.QueryFeeDiscountAccountInfoRequest();
87
- request.setAccount(injectiveAddress);
88
- try {
89
- const response = yield this.request(request, query_pb_service_1.Query.FeeDiscountAccountInfo);
90
- return transformers_1.ChainGrpcExchangeTransformer.feeDiscountAccountInfoResponseToFeeDiscountAccountInfo(response);
91
- }
92
- catch (e) {
93
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
94
- throw e;
95
- }
96
- throw new exceptions_1.GrpcUnaryRequestException(e, {
97
- code: exceptions_1.UnspecifiedErrorCode,
98
- contextModule: types_1.ChainModule.Exchange,
99
- });
100
- }
101
- });
69
+ async fetchFeeDiscountAccountInfo(injectiveAddress) {
70
+ const request = new query_pb_1.QueryFeeDiscountAccountInfoRequest();
71
+ request.setAccount(injectiveAddress);
72
+ try {
73
+ const response = await this.request(request, query_pb_service_1.Query.FeeDiscountAccountInfo);
74
+ return transformers_1.ChainGrpcExchangeTransformer.feeDiscountAccountInfoResponseToFeeDiscountAccountInfo(response);
75
+ }
76
+ catch (e) {
77
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
78
+ throw e;
79
+ }
80
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
81
+ code: exceptions_1.UnspecifiedErrorCode,
82
+ contextModule: types_1.ChainModule.Exchange,
83
+ });
84
+ }
102
85
  }
103
- fetchTradingRewardsCampaign() {
104
- return __awaiter(this, void 0, void 0, function* () {
105
- const request = new query_pb_1.QueryTradeRewardCampaignRequest();
106
- try {
107
- const response = yield this.request(request, query_pb_service_1.Query.TradeRewardCampaign);
108
- return transformers_1.ChainGrpcExchangeTransformer.tradingRewardsCampaignResponseToTradingRewardsCampaign(response);
109
- }
110
- catch (e) {
111
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
112
- throw e;
113
- }
114
- throw new exceptions_1.GrpcUnaryRequestException(e, {
115
- code: exceptions_1.UnspecifiedErrorCode,
116
- contextModule: types_1.ChainModule.Exchange,
117
- });
118
- }
119
- });
86
+ async fetchTradingRewardsCampaign() {
87
+ const request = new query_pb_1.QueryTradeRewardCampaignRequest();
88
+ try {
89
+ const response = await this.request(request, query_pb_service_1.Query.TradeRewardCampaign);
90
+ return transformers_1.ChainGrpcExchangeTransformer.tradingRewardsCampaignResponseToTradingRewardsCampaign(response);
91
+ }
92
+ catch (e) {
93
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
94
+ throw e;
95
+ }
96
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
97
+ code: exceptions_1.UnspecifiedErrorCode,
98
+ contextModule: types_1.ChainModule.Exchange,
99
+ });
100
+ }
120
101
  }
121
- fetchTradeRewardPoints(injectiveAddresses) {
122
- return __awaiter(this, void 0, void 0, function* () {
123
- const request = new query_pb_1.QueryTradeRewardPointsRequest();
124
- request.setAccountsList(injectiveAddresses);
125
- try {
126
- const response = yield this.request(request, query_pb_service_1.Query.TradeRewardPoints);
127
- return response.getAccountTradeRewardPointsList();
128
- }
129
- catch (e) {
130
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
131
- throw e;
132
- }
133
- throw new exceptions_1.GrpcUnaryRequestException(e, {
134
- code: exceptions_1.UnspecifiedErrorCode,
135
- contextModule: types_1.ChainModule.Exchange,
136
- });
137
- }
138
- });
102
+ async fetchTradeRewardPoints(injectiveAddresses) {
103
+ const request = new query_pb_1.QueryTradeRewardPointsRequest();
104
+ request.setAccountsList(injectiveAddresses);
105
+ try {
106
+ const response = await this.request(request, query_pb_service_1.Query.TradeRewardPoints);
107
+ return response.getAccountTradeRewardPointsList();
108
+ }
109
+ catch (e) {
110
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
111
+ throw e;
112
+ }
113
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
114
+ code: exceptions_1.UnspecifiedErrorCode,
115
+ contextModule: types_1.ChainModule.Exchange,
116
+ });
117
+ }
139
118
  }
140
- fetchPendingTradeRewardPoints(injectiveAddresses, timestamp) {
141
- return __awaiter(this, void 0, void 0, function* () {
142
- const request = new query_pb_1.QueryTradeRewardPointsRequest();
143
- request.setAccountsList(injectiveAddresses);
144
- if (timestamp) {
145
- request.setPendingPoolTimestamp(timestamp);
146
- }
147
- try {
148
- const response = yield this.request(request, query_pb_service_1.Query.PendingTradeRewardPoints);
149
- return response.getAccountTradeRewardPointsList();
150
- }
151
- catch (e) {
152
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
153
- throw e;
154
- }
155
- throw new exceptions_1.GrpcUnaryRequestException(e, {
156
- code: exceptions_1.UnspecifiedErrorCode,
157
- contextModule: types_1.ChainModule.Exchange,
158
- });
159
- }
160
- });
119
+ async fetchPendingTradeRewardPoints(injectiveAddresses, timestamp) {
120
+ const request = new query_pb_1.QueryTradeRewardPointsRequest();
121
+ request.setAccountsList(injectiveAddresses);
122
+ if (timestamp) {
123
+ request.setPendingPoolTimestamp(timestamp);
124
+ }
125
+ try {
126
+ const response = await this.request(request, query_pb_service_1.Query.PendingTradeRewardPoints);
127
+ return response.getAccountTradeRewardPointsList();
128
+ }
129
+ catch (e) {
130
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
131
+ throw e;
132
+ }
133
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
134
+ code: exceptions_1.UnspecifiedErrorCode,
135
+ contextModule: types_1.ChainModule.Exchange,
136
+ });
137
+ }
161
138
  }
162
- fetchPositions() {
163
- return __awaiter(this, void 0, void 0, function* () {
164
- const request = new query_pb_1.QueryPositionsRequest();
165
- try {
166
- const response = yield this.request(request, query_pb_service_1.Query.Positions);
167
- return transformers_1.ChainGrpcExchangeTransformer.positionsResponseToPositions(response);
168
- }
169
- catch (e) {
170
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
171
- throw e;
172
- }
173
- throw new exceptions_1.GrpcUnaryRequestException(e, {
174
- code: exceptions_1.UnspecifiedErrorCode,
175
- contextModule: types_1.ChainModule.Exchange,
176
- });
177
- }
178
- });
139
+ async fetchPositions() {
140
+ const request = new query_pb_1.QueryPositionsRequest();
141
+ try {
142
+ const response = await this.request(request, query_pb_service_1.Query.Positions);
143
+ return transformers_1.ChainGrpcExchangeTransformer.positionsResponseToPositions(response);
144
+ }
145
+ catch (e) {
146
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
147
+ throw e;
148
+ }
149
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
150
+ code: exceptions_1.UnspecifiedErrorCode,
151
+ contextModule: types_1.ChainModule.Exchange,
152
+ });
153
+ }
179
154
  }
180
- fetchSubaccountTradeNonce(subaccountId) {
181
- return __awaiter(this, void 0, void 0, function* () {
182
- const request = new query_pb_1.QuerySubaccountTradeNonceRequest();
183
- request.setSubaccountId(subaccountId);
184
- try {
185
- const response = yield this.request(request, query_pb_service_1.Query.SubaccountTradeNonce);
186
- return response.toObject();
187
- }
188
- catch (e) {
189
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
190
- throw e;
191
- }
192
- throw new exceptions_1.GrpcUnaryRequestException(e, {
193
- code: exceptions_1.UnspecifiedErrorCode,
194
- contextModule: types_1.ChainModule.Exchange,
195
- });
196
- }
197
- });
155
+ async fetchSubaccountTradeNonce(subaccountId) {
156
+ const request = new query_pb_1.QuerySubaccountTradeNonceRequest();
157
+ request.setSubaccountId(subaccountId);
158
+ try {
159
+ const response = await this.request(request, query_pb_service_1.Query.SubaccountTradeNonce);
160
+ return response.toObject();
161
+ }
162
+ catch (e) {
163
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
164
+ throw e;
165
+ }
166
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
167
+ code: exceptions_1.UnspecifiedErrorCode,
168
+ contextModule: types_1.ChainModule.Exchange,
169
+ });
170
+ }
198
171
  }
199
172
  }
200
173
  exports.ChainGrpcExchangeApi = ChainGrpcExchangeApi;
@@ -1 +1 @@
1
- {"version":3,"file":"ChainGrpcExchangeApi.js","sourceRoot":"","sources":["../../../../src/client/chain/grpc/ChainGrpcExchangeApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2GAA6G;AAC7G,2FAiBqE;AACrE,8EAAiD;AACjD,kDAA8D;AAC9D,oCAAsC;AACtC,0DAGkC;AAElC;;GAEG;AACH,MAAa,oBAAqB,SAAQ,0BAAY;IAAtD;;QACY,WAAM,GAAW,mBAAW,CAAC,QAAQ,CAAA;IAmOjD,CAAC;IAjOO,iBAAiB;;YACrB,MAAM,OAAO,GAAG,IAAI,qCAA0B,EAAE,CAAA;YAEhD,IAAI;gBACF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAIjC,OAAO,EAAE,wBAAa,CAAC,mBAAmB,CAAC,CAAA;gBAE7C,OAAO,2CAA4B,CAAC,4BAA4B,CAAC,QAAQ,CAAC,CAAA;aAC3E;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,CAAC,CAAA;SACH;IACH,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,MAAM,OAAO,GAAG,IAAI,gCAAqB,EAAE,CAAA;QAE3C,IAAI;YACF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAIjC,OAAO,EAAE,wBAAa,CAAC,SAAS,CAAC,CAAA;YAEnC,OAAO,2CAA4B,CAAC,4BAA4B,CAAC,QAAQ,CAAC,CAAA;SAC3E;QAAC,OAAO,CAAM,EAAE;YACf,IAAI,CAAC,YAAY,sCAAyB,EAAE;gBAC1C,MAAM,CAAC,CAAA;aACR;YAED,MAAM,IAAI,sCAAyB,CAAC,CAAU,EAAE;gBAC9C,IAAI,EAAE,iCAAoB;gBAC1B,aAAa,EAAE,mBAAW,CAAC,QAAQ;aACpC,CAAC,CAAA;SACH;IACH,CAAC;IAED,KAAK,CAAC,yBAAyB,CAAC,YAAoB;QAClD,MAAM,OAAO,GAAG,IAAI,2CAAgC,EAAE,CAAA;QAEtD,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAA;QAErC,IAAI;YACF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAIjC,OAAO,EAAE,wBAAa,CAAC,oBAAoB,CAAC,CAAA;YAE9C,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAA;SAC3B;QAAC,OAAO,CAAM,EAAE;YACf,IAAI,CAAC,YAAY,sCAAyB,EAAE;gBAC1C,MAAM,CAAC,CAAA;aACR;YAED,MAAM,IAAI,sCAAyB,CAAC,CAAU,EAAE;gBAC9C,IAAI,EAAE,iCAAoB;gBAC1B,aAAa,EAAE,mBAAW,CAAC,QAAQ;aACpC,CAAC,CAAA;SACH;IACH,CAAC;CACF;AApOD,oDAoOC"}
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
@@ -28,140 +19,128 @@ class ChainGrpcGovApi extends BaseGrpcConsumer_1.default {
28
19
  super(...arguments);
29
20
  this.module = types_1.ChainModule.Gov;
30
21
  }
31
- fetchModuleParams() {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- const paramTypes = ['voting', 'deposit', 'tallying'];
34
- const requests = paramTypes.map((type) => {
35
- const request = new query_pb_1.QueryParamsRequest();
36
- request.setParamsType(type);
37
- return request;
22
+ async fetchModuleParams() {
23
+ const paramTypes = ['voting', 'deposit', 'tallying'];
24
+ const requests = paramTypes.map((type) => {
25
+ const request = new query_pb_1.QueryParamsRequest();
26
+ request.setParamsType(type);
27
+ return request;
28
+ });
29
+ try {
30
+ const responses = await Promise.all(requests.map((request) => this.request(request, query_pb_service_1.Query.Params)));
31
+ const [votingParams, depositParams, tallyParams] = responses;
32
+ return ChainGrpcGovTransformer_1.ChainGrpcGovTransformer.moduleParamsResponseToModuleParamsByType({
33
+ votingParams: votingParams.getVotingParams(),
34
+ tallyParams: tallyParams.getTallyParams(),
35
+ depositParams: depositParams.getDepositParams(),
38
36
  });
39
- try {
40
- const responses = yield Promise.all(requests.map((request) => this.request(request, query_pb_service_1.Query.Params)));
41
- const [votingParams, depositParams, tallyParams] = responses;
42
- return ChainGrpcGovTransformer_1.ChainGrpcGovTransformer.moduleParamsResponseToModuleParamsByType({
43
- votingParams: votingParams.getVotingParams(),
44
- tallyParams: tallyParams.getTallyParams(),
45
- depositParams: depositParams.getDepositParams(),
46
- });
47
- }
48
- catch (e) {
49
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
50
- throw e;
51
- }
52
- throw new exceptions_1.GrpcUnaryRequestException(e, {
53
- code: exceptions_1.UnspecifiedErrorCode,
54
- contextModule: this.module,
55
- });
37
+ }
38
+ catch (e) {
39
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
40
+ throw e;
56
41
  }
57
- });
42
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
43
+ code: exceptions_1.UnspecifiedErrorCode,
44
+ contextModule: this.module,
45
+ });
46
+ }
58
47
  }
59
- fetchProposals({ status, pagination, }) {
60
- return __awaiter(this, void 0, void 0, function* () {
61
- const request = new query_pb_1.QueryProposalsRequest();
62
- request.setProposalStatus(status);
63
- const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
64
- if (paginationForRequest) {
65
- request.setPagination(paginationForRequest);
66
- }
67
- try {
68
- const response = yield this.request(request, query_pb_service_1.Query.Proposals);
69
- return ChainGrpcGovTransformer_1.ChainGrpcGovTransformer.proposalsResponseToProposals(response);
48
+ async fetchProposals({ status, pagination, }) {
49
+ const request = new query_pb_1.QueryProposalsRequest();
50
+ request.setProposalStatus(status);
51
+ const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
52
+ if (paginationForRequest) {
53
+ request.setPagination(paginationForRequest);
54
+ }
55
+ try {
56
+ const response = await this.request(request, query_pb_service_1.Query.Proposals);
57
+ return ChainGrpcGovTransformer_1.ChainGrpcGovTransformer.proposalsResponseToProposals(response);
58
+ }
59
+ catch (e) {
60
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
61
+ throw e;
70
62
  }
71
- catch (e) {
72
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
73
- throw e;
74
- }
75
- throw new exceptions_1.GrpcUnaryRequestException(e, {
76
- code: exceptions_1.UnspecifiedErrorCode,
77
- contextModule: this.module,
78
- });
79
- }
80
- });
63
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
64
+ code: exceptions_1.UnspecifiedErrorCode,
65
+ contextModule: this.module,
66
+ });
67
+ }
81
68
  }
82
- fetchProposal(proposalId) {
83
- return __awaiter(this, void 0, void 0, function* () {
84
- const request = new query_pb_1.QueryProposalRequest();
85
- request.setProposalId(proposalId);
86
- try {
87
- const response = yield this.request(request, query_pb_service_1.Query.Proposal);
88
- return ChainGrpcGovTransformer_1.ChainGrpcGovTransformer.proposalResponseToProposal(response);
69
+ async fetchProposal(proposalId) {
70
+ const request = new query_pb_1.QueryProposalRequest();
71
+ request.setProposalId(proposalId);
72
+ try {
73
+ const response = await this.request(request, query_pb_service_1.Query.Proposal);
74
+ return ChainGrpcGovTransformer_1.ChainGrpcGovTransformer.proposalResponseToProposal(response);
75
+ }
76
+ catch (e) {
77
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
78
+ throw e;
89
79
  }
90
- catch (e) {
91
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
92
- throw e;
93
- }
94
- throw new exceptions_1.GrpcUnaryRequestException(e, {
95
- code: exceptions_1.UnspecifiedErrorCode,
96
- contextModule: this.module,
97
- });
98
- }
99
- });
80
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
81
+ code: exceptions_1.UnspecifiedErrorCode,
82
+ contextModule: this.module,
83
+ });
84
+ }
100
85
  }
101
- fetchProposalDeposits({ proposalId, pagination, }) {
102
- return __awaiter(this, void 0, void 0, function* () {
103
- const request = new query_pb_1.QueryDepositsRequest();
104
- request.setProposalId(proposalId);
105
- const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
106
- if (paginationForRequest) {
107
- request.setPagination(paginationForRequest);
86
+ async fetchProposalDeposits({ proposalId, pagination, }) {
87
+ const request = new query_pb_1.QueryDepositsRequest();
88
+ request.setProposalId(proposalId);
89
+ const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
90
+ if (paginationForRequest) {
91
+ request.setPagination(paginationForRequest);
92
+ }
93
+ try {
94
+ const response = await this.request(request, query_pb_service_1.Query.Deposits);
95
+ return ChainGrpcGovTransformer_1.ChainGrpcGovTransformer.depositsResponseToDeposits(response);
96
+ }
97
+ catch (e) {
98
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
99
+ throw e;
108
100
  }
109
- try {
110
- const response = yield this.request(request, query_pb_service_1.Query.Deposits);
111
- return ChainGrpcGovTransformer_1.ChainGrpcGovTransformer.depositsResponseToDeposits(response);
112
- }
113
- catch (e) {
114
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
115
- throw e;
116
- }
117
- throw new exceptions_1.GrpcUnaryRequestException(e, {
118
- code: exceptions_1.UnspecifiedErrorCode,
119
- contextModule: this.module,
120
- });
121
- }
122
- });
101
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
102
+ code: exceptions_1.UnspecifiedErrorCode,
103
+ contextModule: this.module,
104
+ });
105
+ }
123
106
  }
124
- fetchProposalVotes({ proposalId, pagination, }) {
125
- return __awaiter(this, void 0, void 0, function* () {
126
- const request = new query_pb_1.QueryVotesRequest();
127
- request.setProposalId(proposalId);
128
- const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
129
- if (paginationForRequest) {
130
- request.setPagination(paginationForRequest);
131
- }
132
- try {
133
- const response = yield this.request(request, query_pb_service_1.Query.Votes);
134
- return ChainGrpcGovTransformer_1.ChainGrpcGovTransformer.votesResponseToVotes(response);
135
- }
136
- catch (e) {
137
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
138
- throw e;
139
- }
140
- throw new exceptions_1.GrpcUnaryRequestException(e, {
141
- code: exceptions_1.UnspecifiedErrorCode,
142
- contextModule: this.module,
143
- });
107
+ async fetchProposalVotes({ proposalId, pagination, }) {
108
+ const request = new query_pb_1.QueryVotesRequest();
109
+ request.setProposalId(proposalId);
110
+ const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
111
+ if (paginationForRequest) {
112
+ request.setPagination(paginationForRequest);
113
+ }
114
+ try {
115
+ const response = await this.request(request, query_pb_service_1.Query.Votes);
116
+ return ChainGrpcGovTransformer_1.ChainGrpcGovTransformer.votesResponseToVotes(response);
117
+ }
118
+ catch (e) {
119
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
120
+ throw e;
144
121
  }
145
- });
122
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
123
+ code: exceptions_1.UnspecifiedErrorCode,
124
+ contextModule: this.module,
125
+ });
126
+ }
146
127
  }
147
- fetchProposalTally(proposalId) {
148
- return __awaiter(this, void 0, void 0, function* () {
149
- const request = new query_pb_1.QueryTallyResultRequest();
150
- request.setProposalId(proposalId);
151
- try {
152
- const response = yield this.request(request, query_pb_service_1.Query.TallyResult);
153
- return ChainGrpcGovTransformer_1.ChainGrpcGovTransformer.tallyResultResponseToTallyResult(response);
154
- }
155
- catch (e) {
156
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
157
- throw e;
158
- }
159
- throw new exceptions_1.GrpcUnaryRequestException(e, {
160
- code: exceptions_1.UnspecifiedErrorCode,
161
- contextModule: this.module,
162
- });
128
+ async fetchProposalTally(proposalId) {
129
+ const request = new query_pb_1.QueryTallyResultRequest();
130
+ request.setProposalId(proposalId);
131
+ try {
132
+ const response = await this.request(request, query_pb_service_1.Query.TallyResult);
133
+ return ChainGrpcGovTransformer_1.ChainGrpcGovTransformer.tallyResultResponseToTallyResult(response);
134
+ }
135
+ catch (e) {
136
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
137
+ throw e;
163
138
  }
164
- });
139
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
140
+ code: exceptions_1.UnspecifiedErrorCode,
141
+ contextModule: this.module,
142
+ });
143
+ }
165
144
  }
166
145
  }
167
146
  exports.ChainGrpcGovApi = ChainGrpcGovApi;