@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
  };
@@ -27,321 +18,303 @@ class IndexerGrpcSpotApi extends BaseGrpcConsumer_1.default {
27
18
  super(...arguments);
28
19
  this.module = types_1.IndexerModule.Spot;
29
20
  }
30
- fetchMarkets(params) {
31
- return __awaiter(this, void 0, void 0, function* () {
32
- const { baseDenom, marketStatus, quoteDenom } = params || {};
33
- const request = new injective_spot_exchange_rpc_pb_1.MarketsRequest();
34
- if (baseDenom) {
35
- request.setBaseDenom(baseDenom);
36
- }
37
- if (marketStatus) {
38
- request.setMarketStatus(marketStatus);
39
- }
40
- if (quoteDenom) {
41
- request.setQuoteDenom(quoteDenom);
42
- }
43
- try {
44
- const response = yield this.request(request, injective_spot_exchange_rpc_pb_service_1.InjectiveSpotExchangeRPC.Markets);
45
- return transformers_1.IndexerGrpcSpotTransformer.marketsResponseToMarkets(response);
46
- }
47
- catch (e) {
48
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
49
- throw e;
50
- }
51
- throw new exceptions_1.GrpcUnaryRequestException(e, {
52
- code: exceptions_1.UnspecifiedErrorCode,
53
- contextModule: this.module,
54
- });
55
- }
56
- });
21
+ async fetchMarkets(params) {
22
+ const { baseDenom, marketStatus, quoteDenom } = params || {};
23
+ const request = new injective_spot_exchange_rpc_pb_1.MarketsRequest();
24
+ if (baseDenom) {
25
+ request.setBaseDenom(baseDenom);
26
+ }
27
+ if (marketStatus) {
28
+ request.setMarketStatus(marketStatus);
29
+ }
30
+ if (quoteDenom) {
31
+ request.setQuoteDenom(quoteDenom);
32
+ }
33
+ try {
34
+ const response = await this.request(request, injective_spot_exchange_rpc_pb_service_1.InjectiveSpotExchangeRPC.Markets);
35
+ return transformers_1.IndexerGrpcSpotTransformer.marketsResponseToMarkets(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: this.module,
44
+ });
45
+ }
57
46
  }
58
- fetchMarket(marketId) {
59
- return __awaiter(this, void 0, void 0, function* () {
60
- const request = new injective_spot_exchange_rpc_pb_1.MarketRequest();
61
- request.setMarketId(marketId);
62
- try {
63
- const response = yield this.request(request, injective_spot_exchange_rpc_pb_service_1.InjectiveSpotExchangeRPC.Market);
64
- return transformers_1.IndexerGrpcSpotTransformer.marketResponseToMarket(response);
65
- }
66
- catch (e) {
67
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
68
- throw e;
69
- }
70
- throw new exceptions_1.GrpcUnaryRequestException(e, {
71
- code: exceptions_1.UnspecifiedErrorCode,
72
- contextModule: this.module,
73
- });
74
- }
75
- });
47
+ async fetchMarket(marketId) {
48
+ const request = new injective_spot_exchange_rpc_pb_1.MarketRequest();
49
+ request.setMarketId(marketId);
50
+ try {
51
+ const response = await this.request(request, injective_spot_exchange_rpc_pb_service_1.InjectiveSpotExchangeRPC.Market);
52
+ return transformers_1.IndexerGrpcSpotTransformer.marketResponseToMarket(response);
53
+ }
54
+ catch (e) {
55
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
56
+ throw e;
57
+ }
58
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
59
+ code: exceptions_1.UnspecifiedErrorCode,
60
+ contextModule: this.module,
61
+ });
62
+ }
76
63
  }
77
- fetchOrderbook(marketId) {
78
- return __awaiter(this, void 0, void 0, function* () {
79
- const request = new injective_spot_exchange_rpc_pb_1.OrderbookRequest();
80
- request.setMarketId(marketId);
81
- try {
82
- const response = yield this.request(request, injective_spot_exchange_rpc_pb_service_1.InjectiveSpotExchangeRPC.Orderbook);
83
- return transformers_1.IndexerGrpcSpotTransformer.orderbookResponseToOrderbook(response);
84
- }
85
- catch (e) {
86
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
87
- throw e;
88
- }
89
- throw new exceptions_1.GrpcUnaryRequestException(e, {
90
- code: exceptions_1.UnspecifiedErrorCode,
91
- contextModule: this.module,
92
- });
93
- }
94
- });
64
+ async fetchOrderbook(marketId) {
65
+ const request = new injective_spot_exchange_rpc_pb_1.OrderbookRequest();
66
+ request.setMarketId(marketId);
67
+ try {
68
+ const response = await this.request(request, injective_spot_exchange_rpc_pb_service_1.InjectiveSpotExchangeRPC.Orderbook);
69
+ return transformers_1.IndexerGrpcSpotTransformer.orderbookResponseToOrderbook(response);
70
+ }
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
+ }
95
80
  }
96
- fetchOrders(params) {
97
- return __awaiter(this, void 0, void 0, function* () {
98
- const { marketId, marketIds, subaccountId, orderSide, pagination } = params || {};
99
- const request = new injective_spot_exchange_rpc_pb_1.OrdersRequest();
100
- if (marketId) {
101
- request.setMarketId(marketId);
102
- }
103
- if (marketIds) {
104
- request.setMarketIdsList(marketIds);
105
- }
106
- if (subaccountId) {
107
- request.setSubaccountId(subaccountId);
108
- }
109
- if (orderSide) {
110
- request.setOrderSide(orderSide);
111
- }
112
- /*
113
- if (isConditional !== undefined) {
114
- request.setIsConditional(isConditional)
115
- }
116
- */
117
- if (pagination) {
118
- if (pagination.skip !== undefined) {
119
- request.setSkip(pagination.skip);
120
- }
121
- if (pagination.limit !== undefined) {
122
- request.setLimit(pagination.limit);
123
- }
124
- if (pagination.endTime !== undefined) {
125
- request.setEndTime(pagination.endTime);
126
- }
127
- }
128
- try {
129
- const response = yield this.request(request, injective_spot_exchange_rpc_pb_service_1.InjectiveSpotExchangeRPC.Orders);
130
- return transformers_1.IndexerGrpcSpotTransformer.ordersResponseToOrders(response);
131
- }
132
- catch (e) {
133
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
134
- throw e;
135
- }
136
- throw new exceptions_1.GrpcUnaryRequestException(e, {
137
- code: exceptions_1.UnspecifiedErrorCode,
138
- contextModule: this.module,
139
- });
140
- }
141
- });
81
+ async fetchOrders(params) {
82
+ const { marketId, marketIds, subaccountId, orderSide, pagination } = params || {};
83
+ const request = new injective_spot_exchange_rpc_pb_1.OrdersRequest();
84
+ if (marketId) {
85
+ request.setMarketId(marketId);
86
+ }
87
+ if (marketIds) {
88
+ request.setMarketIdsList(marketIds);
89
+ }
90
+ if (subaccountId) {
91
+ request.setSubaccountId(subaccountId);
92
+ }
93
+ if (orderSide) {
94
+ request.setOrderSide(orderSide);
95
+ }
96
+ /*
97
+ if (isConditional !== undefined) {
98
+ request.setIsConditional(isConditional)
99
+ }
100
+ */
101
+ if (pagination) {
102
+ if (pagination.skip !== undefined) {
103
+ request.setSkip(pagination.skip);
104
+ }
105
+ if (pagination.limit !== undefined) {
106
+ request.setLimit(pagination.limit);
107
+ }
108
+ if (pagination.endTime !== undefined) {
109
+ request.setEndTime(pagination.endTime);
110
+ }
111
+ }
112
+ try {
113
+ const response = await this.request(request, injective_spot_exchange_rpc_pb_service_1.InjectiveSpotExchangeRPC.Orders);
114
+ return transformers_1.IndexerGrpcSpotTransformer.ordersResponseToOrders(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
+ }
142
125
  }
143
- fetchOrderHistory(params) {
144
- return __awaiter(this, void 0, void 0, function* () {
145
- const { subaccountId, marketId, orderTypes, executionTypes, direction, state, pagination, } = params || {};
146
- const request = new injective_spot_exchange_rpc_pb_1.OrdersHistoryRequest();
147
- if (subaccountId) {
148
- request.setSubaccountId(subaccountId);
149
- }
150
- if (marketId) {
151
- request.setMarketId(marketId);
152
- }
153
- if (orderTypes) {
154
- request.setOrderTypesList(orderTypes);
155
- }
156
- if (executionTypes) {
157
- request.setExecutionTypesList(executionTypes);
158
- }
159
- if (direction) {
160
- request.setDirection(direction);
161
- }
162
- if (state) {
163
- request.setState(state);
164
- }
165
- /*
166
- if (isConditional !== undefined) {
167
- request.setIsConditional(isConditional)
168
- }
169
- */
170
- if (pagination) {
171
- if (pagination.skip !== undefined) {
172
- request.setSkip(pagination.skip);
173
- }
174
- if (pagination.limit !== undefined) {
175
- request.setLimit(pagination.limit);
176
- }
177
- if (pagination.endTime !== undefined) {
178
- request.setEndTime(pagination.endTime);
179
- }
180
- }
181
- try {
182
- const response = yield this.request(request, injective_spot_exchange_rpc_pb_service_1.InjectiveSpotExchangeRPC.OrdersHistory);
183
- return transformers_1.IndexerGrpcSpotTransformer.orderHistoryResponseToOrderHistory(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
- }
194
- });
126
+ async fetchOrderHistory(params) {
127
+ const { subaccountId, marketId, orderTypes, executionTypes, direction, state, pagination, } = params || {};
128
+ const request = new injective_spot_exchange_rpc_pb_1.OrdersHistoryRequest();
129
+ if (subaccountId) {
130
+ request.setSubaccountId(subaccountId);
131
+ }
132
+ if (marketId) {
133
+ request.setMarketId(marketId);
134
+ }
135
+ if (orderTypes) {
136
+ request.setOrderTypesList(orderTypes);
137
+ }
138
+ if (executionTypes) {
139
+ request.setExecutionTypesList(executionTypes);
140
+ }
141
+ if (direction) {
142
+ request.setDirection(direction);
143
+ }
144
+ if (state) {
145
+ request.setState(state);
146
+ }
147
+ /*
148
+ if (isConditional !== undefined) {
149
+ request.setIsConditional(isConditional)
150
+ }
151
+ */
152
+ if (pagination) {
153
+ if (pagination.skip !== undefined) {
154
+ request.setSkip(pagination.skip);
155
+ }
156
+ if (pagination.limit !== undefined) {
157
+ request.setLimit(pagination.limit);
158
+ }
159
+ if (pagination.endTime !== undefined) {
160
+ request.setEndTime(pagination.endTime);
161
+ }
162
+ }
163
+ try {
164
+ const response = await this.request(request, injective_spot_exchange_rpc_pb_service_1.InjectiveSpotExchangeRPC.OrdersHistory);
165
+ return transformers_1.IndexerGrpcSpotTransformer.orderHistoryResponseToOrderHistory(response);
166
+ }
167
+ catch (e) {
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
+ }
195
176
  }
196
- fetchTrades(params) {
197
- return __awaiter(this, void 0, void 0, function* () {
198
- const { marketId, pagination, subaccountId, executionTypes, executionSide, startTime, endTime, direction, marketIds, } = params || {};
199
- const request = new injective_spot_exchange_rpc_pb_1.TradesRequest();
200
- if (marketId) {
201
- request.setMarketId(marketId);
202
- }
203
- if (marketIds) {
204
- request.setMarketIdsList(marketIds);
205
- }
206
- else {
207
- request.setMarketIdsList([]);
208
- }
209
- if (subaccountId) {
210
- request.setSubaccountId(subaccountId);
211
- }
212
- if (executionTypes) {
213
- request.setExecutionTypesList(executionTypes);
214
- }
215
- if (executionSide) {
216
- request.setExecutionSide(executionSide);
217
- }
218
- if (direction) {
219
- request.setDirection(direction);
220
- }
221
- if (startTime) {
222
- request.setStartTime(startTime);
223
- }
224
- if (endTime) {
225
- request.setEndTime(endTime);
226
- }
227
- if (pagination) {
228
- if (pagination.skip !== undefined) {
229
- request.setSkip(pagination.skip);
230
- }
231
- if (pagination.limit !== undefined) {
232
- request.setLimit(pagination.limit);
233
- }
234
- if (pagination.endTime !== undefined) {
235
- request.setEndTime(pagination.endTime);
236
- }
237
- }
238
- try {
239
- const response = yield this.request(request, injective_spot_exchange_rpc_pb_service_1.InjectiveSpotExchangeRPC.Trades);
240
- return transformers_1.IndexerGrpcSpotTransformer.tradesResponseToTrades(response);
241
- }
242
- catch (e) {
243
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
244
- throw e;
245
- }
246
- throw new exceptions_1.GrpcUnaryRequestException(e, {
247
- code: exceptions_1.UnspecifiedErrorCode,
248
- contextModule: this.module,
249
- });
250
- }
251
- });
177
+ async fetchTrades(params) {
178
+ const { marketId, pagination, subaccountId, executionTypes, executionSide, startTime, endTime, direction, marketIds, } = params || {};
179
+ const request = new injective_spot_exchange_rpc_pb_1.TradesRequest();
180
+ if (marketId) {
181
+ request.setMarketId(marketId);
182
+ }
183
+ if (marketIds) {
184
+ request.setMarketIdsList(marketIds);
185
+ }
186
+ else {
187
+ request.setMarketIdsList([]);
188
+ }
189
+ if (subaccountId) {
190
+ request.setSubaccountId(subaccountId);
191
+ }
192
+ if (executionTypes) {
193
+ request.setExecutionTypesList(executionTypes);
194
+ }
195
+ if (executionSide) {
196
+ request.setExecutionSide(executionSide);
197
+ }
198
+ if (direction) {
199
+ request.setDirection(direction);
200
+ }
201
+ if (startTime) {
202
+ request.setStartTime(startTime);
203
+ }
204
+ if (endTime) {
205
+ request.setEndTime(endTime);
206
+ }
207
+ if (pagination) {
208
+ if (pagination.skip !== undefined) {
209
+ request.setSkip(pagination.skip);
210
+ }
211
+ if (pagination.limit !== undefined) {
212
+ request.setLimit(pagination.limit);
213
+ }
214
+ if (pagination.endTime !== undefined) {
215
+ request.setEndTime(pagination.endTime);
216
+ }
217
+ }
218
+ try {
219
+ const response = await this.request(request, injective_spot_exchange_rpc_pb_service_1.InjectiveSpotExchangeRPC.Trades);
220
+ return transformers_1.IndexerGrpcSpotTransformer.tradesResponseToTrades(response);
221
+ }
222
+ catch (e) {
223
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
224
+ throw e;
225
+ }
226
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
227
+ code: exceptions_1.UnspecifiedErrorCode,
228
+ contextModule: this.module,
229
+ });
230
+ }
252
231
  }
253
- fetchSubaccountOrdersList(params) {
254
- return __awaiter(this, void 0, void 0, function* () {
255
- const { subaccountId, marketId, pagination } = params || {};
256
- const request = new injective_spot_exchange_rpc_pb_1.SubaccountOrdersListRequest();
257
- if (subaccountId) {
258
- request.setSubaccountId(subaccountId);
259
- }
260
- if (marketId) {
261
- request.setMarketId(marketId);
262
- }
263
- if (pagination) {
264
- if (pagination.skip !== undefined) {
265
- request.setSkip(pagination.skip);
266
- }
267
- if (pagination.limit !== undefined) {
268
- request.setLimit(pagination.limit);
269
- }
270
- }
271
- try {
272
- const response = yield this.request(request, injective_spot_exchange_rpc_pb_service_1.InjectiveSpotExchangeRPC.SubaccountOrdersList);
273
- return transformers_1.IndexerGrpcSpotTransformer.ordersResponseToOrders(response);
274
- }
275
- catch (e) {
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
- }
284
- });
232
+ async fetchSubaccountOrdersList(params) {
233
+ const { subaccountId, marketId, pagination } = params || {};
234
+ const request = new injective_spot_exchange_rpc_pb_1.SubaccountOrdersListRequest();
235
+ if (subaccountId) {
236
+ request.setSubaccountId(subaccountId);
237
+ }
238
+ if (marketId) {
239
+ request.setMarketId(marketId);
240
+ }
241
+ if (pagination) {
242
+ if (pagination.skip !== undefined) {
243
+ request.setSkip(pagination.skip);
244
+ }
245
+ if (pagination.limit !== undefined) {
246
+ request.setLimit(pagination.limit);
247
+ }
248
+ }
249
+ try {
250
+ const response = await this.request(request, injective_spot_exchange_rpc_pb_service_1.InjectiveSpotExchangeRPC.SubaccountOrdersList);
251
+ return transformers_1.IndexerGrpcSpotTransformer.ordersResponseToOrders(response);
252
+ }
253
+ catch (e) {
254
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
255
+ throw e;
256
+ }
257
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
258
+ code: exceptions_1.UnspecifiedErrorCode,
259
+ contextModule: this.module,
260
+ });
261
+ }
285
262
  }
286
- fetchSubaccountTradesList(params) {
287
- return __awaiter(this, void 0, void 0, function* () {
288
- const { subaccountId, marketId, direction, executionType, pagination } = params || {};
289
- const request = new injective_spot_exchange_rpc_pb_1.SubaccountTradesListRequest();
290
- if (subaccountId) {
291
- request.setSubaccountId(subaccountId);
292
- }
293
- if (marketId) {
294
- request.setMarketId(marketId);
295
- }
296
- if (direction) {
297
- request.setDirection(direction);
298
- }
299
- if (executionType) {
300
- request.setExecutionType(executionType);
301
- }
302
- if (pagination) {
303
- if (pagination.skip !== undefined) {
304
- request.setSkip(pagination.skip);
305
- }
306
- if (pagination.limit !== undefined) {
307
- request.setLimit(pagination.limit);
308
- }
309
- }
310
- try {
311
- const response = yield this.request(request, injective_spot_exchange_rpc_pb_service_1.InjectiveSpotExchangeRPC.SubaccountTradesList);
312
- return transformers_1.IndexerGrpcSpotTransformer.subaccountTradesListResponseToTradesList(response);
313
- }
314
- catch (e) {
315
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
316
- throw e;
317
- }
318
- throw new exceptions_1.GrpcUnaryRequestException(e, {
319
- code: exceptions_1.UnspecifiedErrorCode,
320
- contextModule: this.module,
321
- });
322
- }
323
- });
263
+ async fetchSubaccountTradesList(params) {
264
+ const { subaccountId, marketId, direction, executionType, pagination } = params || {};
265
+ const request = new injective_spot_exchange_rpc_pb_1.SubaccountTradesListRequest();
266
+ if (subaccountId) {
267
+ request.setSubaccountId(subaccountId);
268
+ }
269
+ if (marketId) {
270
+ request.setMarketId(marketId);
271
+ }
272
+ if (direction) {
273
+ request.setDirection(direction);
274
+ }
275
+ if (executionType) {
276
+ request.setExecutionType(executionType);
277
+ }
278
+ if (pagination) {
279
+ if (pagination.skip !== undefined) {
280
+ request.setSkip(pagination.skip);
281
+ }
282
+ if (pagination.limit !== undefined) {
283
+ request.setLimit(pagination.limit);
284
+ }
285
+ }
286
+ try {
287
+ const response = await this.request(request, injective_spot_exchange_rpc_pb_service_1.InjectiveSpotExchangeRPC.SubaccountTradesList);
288
+ return transformers_1.IndexerGrpcSpotTransformer.subaccountTradesListResponseToTradesList(response);
289
+ }
290
+ catch (e) {
291
+ if (e instanceof exceptions_1.GrpcUnaryRequestException) {
292
+ throw e;
293
+ }
294
+ throw new exceptions_1.GrpcUnaryRequestException(e, {
295
+ code: exceptions_1.UnspecifiedErrorCode,
296
+ contextModule: this.module,
297
+ });
298
+ }
324
299
  }
325
- fetchOrderbooks(marketIds) {
326
- return __awaiter(this, void 0, void 0, function* () {
327
- const request = new injective_spot_exchange_rpc_pb_1.OrderbooksRequest();
328
- if (marketIds.length > 0) {
329
- request.setMarketIdsList(marketIds);
330
- }
331
- try {
332
- const response = yield this.request(request, injective_spot_exchange_rpc_pb_service_1.InjectiveSpotExchangeRPC.Orderbooks);
333
- return transformers_1.IndexerGrpcSpotTransformer.orderbooksResponseToOrderbooks(response);
334
- }
335
- catch (e) {
336
- if (e instanceof exceptions_1.GrpcUnaryRequestException) {
337
- throw e;
338
- }
339
- throw new exceptions_1.GrpcUnaryRequestException(e, {
340
- code: exceptions_1.UnspecifiedErrorCode,
341
- contextModule: this.module,
342
- });
343
- }
344
- });
300
+ async fetchOrderbooks(marketIds) {
301
+ const request = new injective_spot_exchange_rpc_pb_1.OrderbooksRequest();
302
+ if (marketIds.length > 0) {
303
+ request.setMarketIdsList(marketIds);
304
+ }
305
+ try {
306
+ const response = await this.request(request, injective_spot_exchange_rpc_pb_service_1.InjectiveSpotExchangeRPC.Orderbooks);
307
+ return transformers_1.IndexerGrpcSpotTransformer.orderbooksResponseToOrderbooks(response);
308
+ }
309
+ catch (e) {
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
+ }
345
318
  }
346
319
  }
347
320
  exports.IndexerGrpcSpotApi = IndexerGrpcSpotApi;