@injectivelabs/sdk-ts 1.0.338 → 1.0.340

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
  };
@@ -28,392 +19,358 @@ class ChainGrpcStakingApi extends BaseGrpcConsumer_1.default {
28
19
  super(...arguments);
29
20
  this.module = types_1.ChainModule.Staking;
30
21
  }
31
- fetchModuleParams() {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- const request = new query_pb_1.QueryParamsRequest();
34
- try {
35
- const response = yield this.request(request, query_pb_service_1.Query.Params);
36
- return transformers_1.ChainGrpcStakingTransformer.moduleParamsResponseToModuleParams(response);
37
- }
38
- catch (e) {
39
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
40
- throw e;
41
- }
42
- throw new exceptions_1.GrpcUnaryRequestException(e, {
43
- code: exceptions_1.UnspecifiedErrorCode,
44
- contextModule: this.module,
45
- });
46
- }
47
- });
22
+ async fetchModuleParams() {
23
+ const request = new query_pb_1.QueryParamsRequest();
24
+ try {
25
+ const response = await this.request(request, query_pb_service_1.Query.Params);
26
+ return transformers_1.ChainGrpcStakingTransformer.moduleParamsResponseToModuleParams(response);
27
+ }
28
+ catch (e) {
29
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
30
+ throw e;
31
+ }
32
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
33
+ code: exceptions_1.UnspecifiedErrorCode,
34
+ contextModule: this.module,
35
+ });
36
+ }
48
37
  }
49
- fetchPool() {
50
- return __awaiter(this, void 0, void 0, function* () {
51
- const request = new query_pb_1.QueryPoolRequest();
52
- try {
53
- const response = yield this.request(request, query_pb_service_1.Query.Pool);
54
- return transformers_1.ChainGrpcStakingTransformer.poolResponseToPool(response);
55
- }
56
- catch (e) {
57
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
58
- throw e;
59
- }
60
- throw new exceptions_1.GrpcUnaryRequestException(e, {
61
- code: exceptions_1.UnspecifiedErrorCode,
62
- contextModule: this.module,
63
- });
64
- }
65
- });
38
+ async fetchPool() {
39
+ const request = new query_pb_1.QueryPoolRequest();
40
+ try {
41
+ const response = await this.request(request, query_pb_service_1.Query.Pool);
42
+ return transformers_1.ChainGrpcStakingTransformer.poolResponseToPool(response);
43
+ }
44
+ catch (e) {
45
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
46
+ throw e;
47
+ }
48
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
49
+ code: exceptions_1.UnspecifiedErrorCode,
50
+ contextModule: this.module,
51
+ });
52
+ }
66
53
  }
67
- fetchValidators() {
68
- return __awaiter(this, void 0, void 0, function* () {
69
- const request = new query_pb_1.QueryValidatorsRequest();
70
- try {
71
- const response = yield this.request(request, query_pb_service_1.Query.Validators);
72
- return transformers_1.ChainGrpcStakingTransformer.validatorsResponseToValidators(response);
73
- }
74
- catch (e) {
75
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
76
- throw e;
77
- }
78
- throw new exceptions_1.GrpcUnaryRequestException(e, {
79
- code: exceptions_1.UnspecifiedErrorCode,
80
- contextModule: this.module,
81
- });
82
- }
83
- });
54
+ async fetchValidators() {
55
+ const request = new query_pb_1.QueryValidatorsRequest();
56
+ try {
57
+ const response = await this.request(request, query_pb_service_1.Query.Validators);
58
+ return transformers_1.ChainGrpcStakingTransformer.validatorsResponseToValidators(response);
59
+ }
60
+ catch (e) {
61
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
62
+ throw e;
63
+ }
64
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
65
+ code: exceptions_1.UnspecifiedErrorCode,
66
+ contextModule: this.module,
67
+ });
68
+ }
84
69
  }
85
- fetchValidator(address) {
86
- return __awaiter(this, void 0, void 0, function* () {
87
- const request = new query_pb_1.QueryValidatorRequest();
88
- request.setValidatorAddr(address);
89
- try {
90
- const response = yield this.request(request, query_pb_service_1.Query.Validator);
91
- return transformers_1.ChainGrpcStakingTransformer.validatorResponseToValidator(response);
92
- }
93
- catch (e) {
94
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
95
- throw e;
96
- }
97
- throw new exceptions_1.GrpcUnaryRequestException(e, {
98
- code: exceptions_1.UnspecifiedErrorCode,
99
- contextModule: this.module,
100
- });
101
- }
102
- });
70
+ async fetchValidator(address) {
71
+ const request = new query_pb_1.QueryValidatorRequest();
72
+ request.setValidatorAddr(address);
73
+ try {
74
+ const response = await this.request(request, query_pb_service_1.Query.Validator);
75
+ return transformers_1.ChainGrpcStakingTransformer.validatorResponseToValidator(response);
76
+ }
77
+ catch (e) {
78
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
79
+ throw e;
80
+ }
81
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
82
+ code: exceptions_1.UnspecifiedErrorCode,
83
+ contextModule: this.module,
84
+ });
85
+ }
103
86
  }
104
- fetchValidatorDelegations({ validatorAddress, pagination, }) {
105
- return __awaiter(this, void 0, void 0, function* () {
106
- const request = new query_pb_1.QueryValidatorDelegationsRequest();
107
- request.setValidatorAddr(validatorAddress);
108
- const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
109
- if (paginationForRequest) {
110
- request.setPagination(paginationForRequest);
111
- }
112
- try {
113
- const response = yield this.request(request, query_pb_service_1.Query.ValidatorDelegations);
114
- return transformers_1.ChainGrpcStakingTransformer.delegationsResponseToDelegations(response);
115
- }
116
- catch (e) {
117
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
118
- throw e;
119
- }
120
- throw new exceptions_1.GrpcUnaryRequestException(e, {
121
- code: exceptions_1.UnspecifiedErrorCode,
122
- contextModule: this.module,
123
- });
124
- }
125
- });
87
+ async fetchValidatorDelegations({ validatorAddress, pagination, }) {
88
+ const request = new query_pb_1.QueryValidatorDelegationsRequest();
89
+ request.setValidatorAddr(validatorAddress);
90
+ const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
91
+ if (paginationForRequest) {
92
+ request.setPagination(paginationForRequest);
93
+ }
94
+ try {
95
+ const response = await this.request(request, query_pb_service_1.Query.ValidatorDelegations);
96
+ return transformers_1.ChainGrpcStakingTransformer.delegationsResponseToDelegations(response);
97
+ }
98
+ catch (e) {
99
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
100
+ throw e;
101
+ }
102
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
103
+ code: exceptions_1.UnspecifiedErrorCode,
104
+ contextModule: this.module,
105
+ });
106
+ }
126
107
  }
127
- fetchValidatorDelegationsNoThrow({ validatorAddress, pagination, }) {
128
- return __awaiter(this, void 0, void 0, function* () {
129
- const request = new query_pb_1.QueryValidatorDelegationsRequest();
130
- request.setValidatorAddr(validatorAddress);
131
- const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
132
- if (paginationForRequest) {
133
- request.setPagination(paginationForRequest);
134
- }
135
- try {
136
- const response = yield this.request(request, query_pb_service_1.Query.ValidatorDelegations);
137
- return transformers_1.ChainGrpcStakingTransformer.delegationsResponseToDelegations(response);
138
- }
139
- catch (e) {
140
- if (e.message.includes('does not exist')) {
141
- return { delegations: [], pagination: { total: 0, next: '' } };
142
- }
143
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
144
- throw e;
145
- }
146
- throw new exceptions_1.GrpcUnaryRequestException(e, {
147
- code: exceptions_1.UnspecifiedErrorCode,
148
- contextModule: this.module,
149
- });
150
- }
151
- });
108
+ async fetchValidatorDelegationsNoThrow({ validatorAddress, pagination, }) {
109
+ const request = new query_pb_1.QueryValidatorDelegationsRequest();
110
+ request.setValidatorAddr(validatorAddress);
111
+ const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
112
+ if (paginationForRequest) {
113
+ request.setPagination(paginationForRequest);
114
+ }
115
+ try {
116
+ const response = await this.request(request, query_pb_service_1.Query.ValidatorDelegations);
117
+ return transformers_1.ChainGrpcStakingTransformer.delegationsResponseToDelegations(response);
118
+ }
119
+ catch (e) {
120
+ if (e.message.includes('does not exist')) {
121
+ return { delegations: [], pagination: { total: 0, next: '' } };
122
+ }
123
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
124
+ throw e;
125
+ }
126
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
127
+ code: exceptions_1.UnspecifiedErrorCode,
128
+ contextModule: this.module,
129
+ });
130
+ }
152
131
  }
153
- fetchValidatorUnbondingDelegations({ validatorAddress, pagination, }) {
154
- return __awaiter(this, void 0, void 0, function* () {
155
- const request = new query_pb_1.QueryValidatorUnbondingDelegationsRequest();
156
- request.setValidatorAddr(validatorAddress);
157
- const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
158
- if (paginationForRequest) {
159
- request.setPagination(paginationForRequest);
160
- }
161
- try {
162
- const response = yield this.request(request, query_pb_service_1.Query.ValidatorUnbondingDelegations);
163
- return transformers_1.ChainGrpcStakingTransformer.unBondingDelegationsResponseToUnBondingDelegations(response);
164
- }
165
- catch (e) {
166
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
167
- throw e;
168
- }
169
- throw new exceptions_1.GrpcUnaryRequestException(e, {
170
- code: exceptions_1.UnspecifiedErrorCode,
171
- contextModule: this.module,
172
- });
173
- }
174
- });
132
+ async fetchValidatorUnbondingDelegations({ validatorAddress, pagination, }) {
133
+ const request = new query_pb_1.QueryValidatorUnbondingDelegationsRequest();
134
+ request.setValidatorAddr(validatorAddress);
135
+ const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
136
+ if (paginationForRequest) {
137
+ request.setPagination(paginationForRequest);
138
+ }
139
+ try {
140
+ const response = await this.request(request, query_pb_service_1.Query.ValidatorUnbondingDelegations);
141
+ return transformers_1.ChainGrpcStakingTransformer.unBondingDelegationsResponseToUnBondingDelegations(response);
142
+ }
143
+ catch (e) {
144
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
145
+ throw e;
146
+ }
147
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
148
+ code: exceptions_1.UnspecifiedErrorCode,
149
+ contextModule: this.module,
150
+ });
151
+ }
175
152
  }
176
- fetchValidatorUnbondingDelegationsNoThrow({ validatorAddress, pagination, }) {
177
- return __awaiter(this, void 0, void 0, function* () {
178
- const request = new query_pb_1.QueryValidatorUnbondingDelegationsRequest();
179
- request.setValidatorAddr(validatorAddress);
180
- const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
181
- if (paginationForRequest) {
182
- request.setPagination(paginationForRequest);
183
- }
184
- try {
185
- const response = yield this.request(request, query_pb_service_1.Query.ValidatorUnbondingDelegations);
186
- return transformers_1.ChainGrpcStakingTransformer.unBondingDelegationsResponseToUnBondingDelegations(response);
187
- }
188
- catch (e) {
189
- if (e.message.includes('does not exist')) {
190
- return { unbondingDelegations: [], pagination: { total: 0, next: '' } };
191
- }
192
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
193
- throw e;
194
- }
195
- throw new exceptions_1.GrpcUnaryRequestException(e, {
196
- code: exceptions_1.UnspecifiedErrorCode,
197
- contextModule: this.module,
198
- });
199
- }
200
- });
153
+ async fetchValidatorUnbondingDelegationsNoThrow({ validatorAddress, pagination, }) {
154
+ const request = new query_pb_1.QueryValidatorUnbondingDelegationsRequest();
155
+ request.setValidatorAddr(validatorAddress);
156
+ const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
157
+ if (paginationForRequest) {
158
+ request.setPagination(paginationForRequest);
159
+ }
160
+ try {
161
+ const response = await this.request(request, query_pb_service_1.Query.ValidatorUnbondingDelegations);
162
+ return transformers_1.ChainGrpcStakingTransformer.unBondingDelegationsResponseToUnBondingDelegations(response);
163
+ }
164
+ catch (e) {
165
+ if (e.message.includes('does not exist')) {
166
+ return { unbondingDelegations: [], pagination: { total: 0, next: '' } };
167
+ }
168
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
169
+ throw e;
170
+ }
171
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
172
+ code: exceptions_1.UnspecifiedErrorCode,
173
+ contextModule: this.module,
174
+ });
175
+ }
201
176
  }
202
- fetchDelegation({ injectiveAddress, validatorAddress, }) {
203
- return __awaiter(this, void 0, void 0, function* () {
204
- const request = new query_pb_1.QueryDelegationRequest();
205
- request.setDelegatorAddr(injectiveAddress);
206
- request.setValidatorAddr(validatorAddress);
207
- try {
208
- const response = yield this.request(request, query_pb_service_1.Query.Delegation);
209
- return transformers_1.ChainGrpcStakingTransformer.delegationResponseToDelegation(response);
210
- }
211
- catch (e) {
212
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
213
- throw e;
214
- }
215
- throw new exceptions_1.GrpcUnaryRequestException(e, {
216
- code: exceptions_1.UnspecifiedErrorCode,
217
- contextModule: this.module,
218
- });
219
- }
220
- });
177
+ async fetchDelegation({ injectiveAddress, validatorAddress, }) {
178
+ const request = new query_pb_1.QueryDelegationRequest();
179
+ request.setDelegatorAddr(injectiveAddress);
180
+ request.setValidatorAddr(validatorAddress);
181
+ try {
182
+ const response = await this.request(request, query_pb_service_1.Query.Delegation);
183
+ return transformers_1.ChainGrpcStakingTransformer.delegationResponseToDelegation(response);
184
+ }
185
+ catch (e) {
186
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
187
+ throw e;
188
+ }
189
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
190
+ code: exceptions_1.UnspecifiedErrorCode,
191
+ contextModule: this.module,
192
+ });
193
+ }
221
194
  }
222
- fetchDelegations({ injectiveAddress, pagination, }) {
223
- return __awaiter(this, void 0, void 0, function* () {
224
- const request = new query_pb_1.QueryDelegatorDelegationsRequest();
225
- request.setDelegatorAddr(injectiveAddress);
226
- const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
227
- if (paginationForRequest) {
228
- request.setPagination(paginationForRequest);
229
- }
230
- try {
231
- const response = yield this.request(request, query_pb_service_1.Query.DelegatorDelegations);
232
- return transformers_1.ChainGrpcStakingTransformer.delegationsResponseToDelegations(response);
233
- }
234
- catch (e) {
235
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
236
- throw e;
237
- }
238
- throw new exceptions_1.GrpcUnaryRequestException(e, {
239
- code: exceptions_1.UnspecifiedErrorCode,
240
- contextModule: this.module,
241
- });
242
- }
243
- });
195
+ async fetchDelegations({ injectiveAddress, pagination, }) {
196
+ const request = new query_pb_1.QueryDelegatorDelegationsRequest();
197
+ request.setDelegatorAddr(injectiveAddress);
198
+ const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
199
+ if (paginationForRequest) {
200
+ request.setPagination(paginationForRequest);
201
+ }
202
+ try {
203
+ const response = await this.request(request, query_pb_service_1.Query.DelegatorDelegations);
204
+ return transformers_1.ChainGrpcStakingTransformer.delegationsResponseToDelegations(response);
205
+ }
206
+ catch (e) {
207
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
208
+ throw e;
209
+ }
210
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
211
+ code: exceptions_1.UnspecifiedErrorCode,
212
+ contextModule: this.module,
213
+ });
214
+ }
244
215
  }
245
- fetchDelegationsNoThrow({ injectiveAddress, pagination, }) {
246
- return __awaiter(this, void 0, void 0, function* () {
247
- const request = new query_pb_1.QueryDelegatorDelegationsRequest();
248
- request.setDelegatorAddr(injectiveAddress);
249
- const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
250
- if (paginationForRequest) {
251
- request.setPagination(paginationForRequest);
252
- }
253
- try {
254
- const response = yield this.request(request, query_pb_service_1.Query.DelegatorDelegations);
255
- return transformers_1.ChainGrpcStakingTransformer.delegationsResponseToDelegations(response);
256
- }
257
- catch (e) {
258
- if (e.message.includes('does not exist')) {
259
- return { delegations: [], pagination: { total: 0, next: '' } };
260
- }
261
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
262
- throw e;
263
- }
264
- throw new exceptions_1.GrpcUnaryRequestException(e, {
265
- code: exceptions_1.UnspecifiedErrorCode,
266
- contextModule: this.module,
267
- });
268
- }
269
- });
216
+ async fetchDelegationsNoThrow({ injectiveAddress, pagination, }) {
217
+ const request = new query_pb_1.QueryDelegatorDelegationsRequest();
218
+ request.setDelegatorAddr(injectiveAddress);
219
+ const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
220
+ if (paginationForRequest) {
221
+ request.setPagination(paginationForRequest);
222
+ }
223
+ try {
224
+ const response = await this.request(request, query_pb_service_1.Query.DelegatorDelegations);
225
+ return transformers_1.ChainGrpcStakingTransformer.delegationsResponseToDelegations(response);
226
+ }
227
+ catch (e) {
228
+ if (e.message.includes('does not exist')) {
229
+ return { delegations: [], pagination: { total: 0, next: '' } };
230
+ }
231
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
232
+ throw e;
233
+ }
234
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
235
+ code: exceptions_1.UnspecifiedErrorCode,
236
+ contextModule: this.module,
237
+ });
238
+ }
270
239
  }
271
- fetchDelegators({ validatorAddress, pagination, }) {
272
- return __awaiter(this, void 0, void 0, function* () {
273
- const request = new query_pb_1.QueryValidatorDelegationsRequest();
274
- request.setValidatorAddr(validatorAddress);
275
- const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
276
- if (paginationForRequest) {
277
- request.setPagination(paginationForRequest);
278
- }
279
- try {
280
- const response = yield this.request(request, query_pb_service_1.Query.ValidatorDelegations);
281
- return transformers_1.ChainGrpcStakingTransformer.delegationsResponseToDelegations(response);
282
- }
283
- catch (e) {
284
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
285
- throw e;
286
- }
287
- throw new exceptions_1.GrpcUnaryRequestException(e, {
288
- code: exceptions_1.UnspecifiedErrorCode,
289
- contextModule: this.module,
290
- });
291
- }
292
- });
240
+ async fetchDelegators({ validatorAddress, pagination, }) {
241
+ const request = new query_pb_1.QueryValidatorDelegationsRequest();
242
+ request.setValidatorAddr(validatorAddress);
243
+ const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
244
+ if (paginationForRequest) {
245
+ request.setPagination(paginationForRequest);
246
+ }
247
+ try {
248
+ const response = await this.request(request, query_pb_service_1.Query.ValidatorDelegations);
249
+ return transformers_1.ChainGrpcStakingTransformer.delegationsResponseToDelegations(response);
250
+ }
251
+ catch (e) {
252
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
253
+ throw e;
254
+ }
255
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
256
+ code: exceptions_1.UnspecifiedErrorCode,
257
+ contextModule: this.module,
258
+ });
259
+ }
293
260
  }
294
- fetchDelegatorsNoThrow({ validatorAddress, pagination, }) {
295
- return __awaiter(this, void 0, void 0, function* () {
296
- const request = new query_pb_1.QueryValidatorDelegationsRequest();
297
- request.setValidatorAddr(validatorAddress);
298
- const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
299
- if (paginationForRequest) {
300
- request.setPagination(paginationForRequest);
301
- }
302
- try {
303
- const response = yield this.request(request, query_pb_service_1.Query.ValidatorDelegations);
304
- return transformers_1.ChainGrpcStakingTransformer.delegationsResponseToDelegations(response);
305
- }
306
- catch (e) {
307
- if (e.message.includes('does not exist')) {
308
- return { delegations: [], pagination: { total: 0, next: '' } };
309
- }
310
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
311
- throw e;
312
- }
313
- throw new exceptions_1.GrpcUnaryRequestException(e, {
314
- code: exceptions_1.UnspecifiedErrorCode,
315
- contextModule: this.module,
316
- });
317
- }
318
- });
261
+ async fetchDelegatorsNoThrow({ validatorAddress, pagination, }) {
262
+ const request = new query_pb_1.QueryValidatorDelegationsRequest();
263
+ request.setValidatorAddr(validatorAddress);
264
+ const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
265
+ if (paginationForRequest) {
266
+ request.setPagination(paginationForRequest);
267
+ }
268
+ try {
269
+ const response = await this.request(request, query_pb_service_1.Query.ValidatorDelegations);
270
+ return transformers_1.ChainGrpcStakingTransformer.delegationsResponseToDelegations(response);
271
+ }
272
+ catch (e) {
273
+ if (e.message.includes('does not exist')) {
274
+ return { delegations: [], pagination: { total: 0, next: '' } };
275
+ }
276
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
277
+ throw e;
278
+ }
279
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
280
+ code: exceptions_1.UnspecifiedErrorCode,
281
+ contextModule: this.module,
282
+ });
283
+ }
319
284
  }
320
- fetchUnbondingDelegations({ injectiveAddress, pagination, }) {
321
- return __awaiter(this, void 0, void 0, function* () {
322
- const request = new query_pb_1.QueryDelegatorUnbondingDelegationsRequest();
323
- request.setDelegatorAddr(injectiveAddress);
324
- const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
325
- if (paginationForRequest) {
326
- request.setPagination(paginationForRequest);
327
- }
328
- try {
329
- const response = yield this.request(request, query_pb_service_1.Query.DelegatorUnbondingDelegations);
330
- return transformers_1.ChainGrpcStakingTransformer.unBondingDelegationsResponseToUnBondingDelegations(response);
331
- }
332
- catch (e) {
333
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
334
- throw e;
335
- }
336
- throw new exceptions_1.GrpcUnaryRequestException(e, {
337
- code: exceptions_1.UnspecifiedErrorCode,
338
- contextModule: this.module,
339
- });
340
- }
341
- });
285
+ async fetchUnbondingDelegations({ injectiveAddress, pagination, }) {
286
+ const request = new query_pb_1.QueryDelegatorUnbondingDelegationsRequest();
287
+ request.setDelegatorAddr(injectiveAddress);
288
+ const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
289
+ if (paginationForRequest) {
290
+ request.setPagination(paginationForRequest);
291
+ }
292
+ try {
293
+ const response = await this.request(request, query_pb_service_1.Query.DelegatorUnbondingDelegations);
294
+ return transformers_1.ChainGrpcStakingTransformer.unBondingDelegationsResponseToUnBondingDelegations(response);
295
+ }
296
+ catch (e) {
297
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
298
+ throw e;
299
+ }
300
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
301
+ code: exceptions_1.UnspecifiedErrorCode,
302
+ contextModule: this.module,
303
+ });
304
+ }
342
305
  }
343
- fetchUnbondingDelegationsNoThrow({ injectiveAddress, pagination, }) {
344
- return __awaiter(this, void 0, void 0, function* () {
345
- const request = new query_pb_1.QueryDelegatorUnbondingDelegationsRequest();
346
- request.setDelegatorAddr(injectiveAddress);
347
- const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
348
- if (paginationForRequest) {
349
- request.setPagination(paginationForRequest);
350
- }
351
- try {
352
- const response = yield this.request(request, query_pb_service_1.Query.DelegatorUnbondingDelegations);
353
- return transformers_1.ChainGrpcStakingTransformer.unBondingDelegationsResponseToUnBondingDelegations(response);
354
- }
355
- catch (e) {
356
- if (e.message.includes('does not exist')) {
357
- return { unbondingDelegations: [], pagination: { total: 0, next: '' } };
358
- }
359
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
360
- throw e;
361
- }
362
- throw new exceptions_1.GrpcUnaryRequestException(e, {
363
- code: exceptions_1.UnspecifiedErrorCode,
364
- contextModule: this.module,
365
- });
366
- }
367
- });
306
+ async fetchUnbondingDelegationsNoThrow({ injectiveAddress, pagination, }) {
307
+ const request = new query_pb_1.QueryDelegatorUnbondingDelegationsRequest();
308
+ request.setDelegatorAddr(injectiveAddress);
309
+ const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
310
+ if (paginationForRequest) {
311
+ request.setPagination(paginationForRequest);
312
+ }
313
+ try {
314
+ const response = await this.request(request, query_pb_service_1.Query.DelegatorUnbondingDelegations);
315
+ return transformers_1.ChainGrpcStakingTransformer.unBondingDelegationsResponseToUnBondingDelegations(response);
316
+ }
317
+ catch (e) {
318
+ if (e.message.includes('does not exist')) {
319
+ return { unbondingDelegations: [], pagination: { total: 0, next: '' } };
320
+ }
321
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
322
+ throw e;
323
+ }
324
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
325
+ code: exceptions_1.UnspecifiedErrorCode,
326
+ contextModule: this.module,
327
+ });
328
+ }
368
329
  }
369
- fetchReDelegations({ injectiveAddress, pagination, }) {
370
- return __awaiter(this, void 0, void 0, function* () {
371
- const request = new query_pb_1.QueryRedelegationsRequest();
372
- request.setDelegatorAddr(injectiveAddress);
373
- const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
374
- if (paginationForRequest) {
375
- request.setPagination(paginationForRequest);
376
- }
377
- try {
378
- const response = yield this.request(request, query_pb_service_1.Query.Redelegations);
379
- return transformers_1.ChainGrpcStakingTransformer.reDelegationsResponseToReDelegations(response);
380
- }
381
- catch (e) {
382
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
383
- throw e;
384
- }
385
- throw new exceptions_1.GrpcUnaryRequestException(e, {
386
- code: exceptions_1.UnspecifiedErrorCode,
387
- contextModule: this.module,
388
- });
389
- }
390
- });
330
+ async fetchReDelegations({ injectiveAddress, pagination, }) {
331
+ const request = new query_pb_1.QueryRedelegationsRequest();
332
+ request.setDelegatorAddr(injectiveAddress);
333
+ const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
334
+ if (paginationForRequest) {
335
+ request.setPagination(paginationForRequest);
336
+ }
337
+ try {
338
+ const response = await this.request(request, query_pb_service_1.Query.Redelegations);
339
+ return transformers_1.ChainGrpcStakingTransformer.reDelegationsResponseToReDelegations(response);
340
+ }
341
+ catch (e) {
342
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
343
+ throw e;
344
+ }
345
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
346
+ code: exceptions_1.UnspecifiedErrorCode,
347
+ contextModule: this.module,
348
+ });
349
+ }
391
350
  }
392
- fetchReDelegationsNoThrow({ injectiveAddress, pagination, }) {
393
- return __awaiter(this, void 0, void 0, function* () {
394
- const request = new query_pb_1.QueryRedelegationsRequest();
395
- request.setDelegatorAddr(injectiveAddress);
396
- const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
397
- if (paginationForRequest) {
398
- request.setPagination(paginationForRequest);
399
- }
400
- try {
401
- const response = yield this.request(request, query_pb_service_1.Query.Redelegations);
402
- return transformers_1.ChainGrpcStakingTransformer.reDelegationsResponseToReDelegations(response);
403
- }
404
- catch (e) {
405
- if (e.message.includes('does not exist')) {
406
- return { redelegations: [], pagination: { total: 0, next: '' } };
407
- }
408
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
409
- throw e;
410
- }
411
- throw new exceptions_1.GrpcUnaryRequestException(e, {
412
- code: exceptions_1.UnspecifiedErrorCode,
413
- contextModule: this.module,
414
- });
415
- }
416
- });
351
+ async fetchReDelegationsNoThrow({ injectiveAddress, pagination, }) {
352
+ const request = new query_pb_1.QueryRedelegationsRequest();
353
+ request.setDelegatorAddr(injectiveAddress);
354
+ const paginationForRequest = (0, pagination_1.paginationRequestFromPagination)(pagination);
355
+ if (paginationForRequest) {
356
+ request.setPagination(paginationForRequest);
357
+ }
358
+ try {
359
+ const response = await this.request(request, query_pb_service_1.Query.Redelegations);
360
+ return transformers_1.ChainGrpcStakingTransformer.reDelegationsResponseToReDelegations(response);
361
+ }
362
+ catch (e) {
363
+ if (e.message.includes('does not exist')) {
364
+ return { redelegations: [], pagination: { total: 0, next: '' } };
365
+ }
366
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
367
+ throw e;
368
+ }
369
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
370
+ code: exceptions_1.UnspecifiedErrorCode,
371
+ contextModule: this.module,
372
+ });
373
+ }
417
374
  }
418
375
  }
419
376
  exports.ChainGrpcStakingApi = ChainGrpcStakingApi;