@injectivelabs/sdk-ts 1.0.337 → 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.
- package/dist/client/chain/grpc/ChainGrpcAuctionApi.js +42 -57
- package/dist/client/chain/grpc/ChainGrpcAuctionApi.js.map +1 -1
- package/dist/client/chain/grpc/ChainGrpcAuthApi.js +38 -53
- package/dist/client/chain/grpc/ChainGrpcAuthApi.js.map +1 -1
- package/dist/client/chain/grpc/ChainGrpcBankApi.js +63 -80
- package/dist/client/chain/grpc/ChainGrpcBankApi.js.map +1 -1
- package/dist/client/chain/grpc/ChainGrpcDistributionApi.js +68 -87
- package/dist/client/chain/grpc/ChainGrpcDistributionApi.js.map +1 -1
- package/dist/client/chain/grpc/ChainGrpcExchangeApi.js +142 -169
- package/dist/client/chain/grpc/ChainGrpcExchangeApi.js.map +1 -1
- package/dist/client/chain/grpc/ChainGrpcGovApi.js +110 -131
- package/dist/client/chain/grpc/ChainGrpcGovApi.js.map +1 -1
- package/dist/client/chain/grpc/ChainGrpcIbcApi.js +29 -42
- package/dist/client/chain/grpc/ChainGrpcIbcApi.js.map +1 -1
- package/dist/client/chain/grpc/ChainGrpcInsuranceFundApi.js +75 -94
- package/dist/client/chain/grpc/ChainGrpcInsuranceFundApi.js.map +1 -1
- package/dist/client/chain/grpc/ChainGrpcMintApi.js +46 -61
- package/dist/client/chain/grpc/ChainGrpcMintApi.js.map +1 -1
- package/dist/client/chain/grpc/ChainGrpcOracleApi.js +14 -25
- package/dist/client/chain/grpc/ChainGrpcOracleApi.js.map +1 -1
- package/dist/client/chain/grpc/ChainGrpcPeggyApi.js +14 -25
- package/dist/client/chain/grpc/ChainGrpcPeggyApi.js.map +1 -1
- package/dist/client/chain/grpc/ChainGrpcStakingApi.js +336 -379
- package/dist/client/chain/grpc/ChainGrpcStakingApi.js.map +1 -1
- package/dist/client/chain/grpc/ChainGrpcWasmApi.js +149 -174
- package/dist/client/chain/grpc/ChainGrpcWasmApi.js.map +1 -1
- package/dist/client/chain/grpc/ChainGrpcWasmXApi.js +28 -41
- package/dist/client/chain/grpc/ChainGrpcWasmXApi.js.map +1 -1
- package/dist/client/chain/rest/ChainRestAuthApi.js +30 -43
- package/dist/client/chain/rest/ChainRestAuthApi.js.map +1 -1
- package/dist/client/chain/rest/ChainRestBankApi.js +35 -48
- package/dist/client/chain/rest/ChainRestBankApi.js.map +1 -1
- package/dist/client/chain/rest/ChainRestTendermintApi.js +29 -42
- package/dist/client/chain/rest/ChainRestTendermintApi.js.map +1 -1
- package/dist/client/chain/types/index.js +1 -1
- package/dist/client/chain/types/index.js.map +1 -1
- package/dist/client/gql/client.js +25 -38
- package/dist/client/gql/client.js.map +1 -1
- package/dist/client/indexer/grpc/IndexerGrpcAccountApi.js +157 -182
- package/dist/client/indexer/grpc/IndexerGrpcAccountApi.js.map +1 -1
- package/dist/client/indexer/grpc/IndexerGrpcAuctionApi.js +32 -45
- package/dist/client/indexer/grpc/IndexerGrpcAuctionApi.js.map +1 -1
- package/dist/client/indexer/grpc/IndexerGrpcDerivativesApi.js +435 -472
- package/dist/client/indexer/grpc/IndexerGrpcDerivativesApi.js.map +1 -1
- package/dist/client/indexer/grpc/IndexerGrpcExplorerApi.js +236 -265
- package/dist/client/indexer/grpc/IndexerGrpcExplorerApi.js.map +1 -1
- package/dist/client/indexer/grpc/IndexerGrpcInsuranceFundApi.js +35 -48
- package/dist/client/indexer/grpc/IndexerGrpcInsuranceFundApi.js.map +1 -1
- package/dist/client/indexer/grpc/IndexerGrpcMetaApi.js +42 -57
- package/dist/client/indexer/grpc/IndexerGrpcMetaApi.js.map +1 -1
- package/dist/client/indexer/grpc/IndexerGrpcNinjaApi.js +182 -207
- package/dist/client/indexer/grpc/IndexerGrpcNinjaApi.js.map +1 -1
- package/dist/client/indexer/grpc/IndexerGrpcOracleApi.js +58 -73
- package/dist/client/indexer/grpc/IndexerGrpcOracleApi.js.map +1 -1
- package/dist/client/indexer/grpc/IndexerGrpcSpotApi.js +289 -316
- package/dist/client/indexer/grpc/IndexerGrpcSpotApi.js.map +1 -1
- package/dist/client/indexer/grpc/IndexerGrpcTransactionApi.js +193 -214
- package/dist/client/indexer/grpc/IndexerGrpcTransactionApi.js.map +1 -1
- package/dist/client/indexer/rest/IndexerRestDerivativesChronosApi.js +33 -46
- package/dist/client/indexer/rest/IndexerRestDerivativesChronosApi.js.map +1 -1
- package/dist/client/indexer/rest/IndexerRestExplorerApi.js +283 -322
- package/dist/client/indexer/rest/IndexerRestExplorerApi.js.map +1 -1
- package/dist/client/indexer/rest/IndexerRestLeaderboardChronosApi.js +16 -27
- package/dist/client/indexer/rest/IndexerRestLeaderboardChronosApi.js.map +1 -1
- package/dist/client/indexer/rest/IndexerRestMarketChronosApi.js +26 -37
- package/dist/client/indexer/rest/IndexerRestMarketChronosApi.js.map +1 -1
- package/dist/client/indexer/rest/IndexerRestSpotChronosApi.js +33 -46
- package/dist/client/indexer/rest/IndexerRestSpotChronosApi.js.map +1 -1
- package/dist/client/indexer/transformers/IndexerGrpcDerivativeTransformer.js +13 -1
- package/dist/client/indexer/transformers/IndexerGrpcDerivativeTransformer.js.map +1 -1
- package/dist/client/indexer/transformers/IndexerGrpcExplorerTransformer.js +1 -1
- package/dist/client/indexer/transformers/IndexerGrpcExplorerTransformer.js.map +1 -1
- package/dist/client/indexer/transformers/IndexerGrpcSpotTransformer.js +12 -1
- package/dist/client/indexer/transformers/IndexerGrpcSpotTransformer.js.map +1 -1
- package/dist/client/indexer/transformers/IndexerRestExplorerTransformer.js +6 -2
- package/dist/client/indexer/transformers/IndexerRestExplorerTransformer.js.map +1 -1
- package/dist/client/indexer/types/index.js +1 -1
- package/dist/client/indexer/types/index.js.map +1 -1
- package/dist/client/wasm/supernova/transformer.js +20 -2
- package/dist/client/wasm/supernova/transformer.js.map +1 -1
- package/dist/core/accounts/PrivateKey.js +46 -67
- package/dist/core/accounts/PrivateKey.js.map +1 -1
- package/dist/core/accounts/signers/OfflineAminoSigner.js +28 -43
- package/dist/core/accounts/signers/OfflineAminoSigner.js.map +1 -1
- package/dist/core/accounts/signers/OfflineDirectSigner.js +28 -43
- package/dist/core/accounts/signers/OfflineDirectSigner.js.map +1 -1
- package/dist/core/modules/MsgBase.js +1 -12
- package/dist/core/modules/MsgBase.js.map +1 -1
- package/dist/core/modules/auction/msgs/MsgBid.js +13 -15
- package/dist/core/modules/auction/msgs/MsgBid.js.map +1 -1
- package/dist/core/modules/authz/msgs/MsgExec.js +13 -15
- package/dist/core/modules/authz/msgs/MsgExec.js.map +1 -1
- package/dist/core/modules/authz/msgs/MsgGrant.js +22 -17
- package/dist/core/modules/authz/msgs/MsgGrant.js.map +1 -1
- package/dist/core/modules/authz/msgs/MsgRevoke.js +13 -15
- package/dist/core/modules/authz/msgs/MsgRevoke.js.map +1 -1
- package/dist/core/modules/bank/msgs/MsgSend.js +18 -17
- package/dist/core/modules/bank/msgs/MsgSend.js.map +1 -1
- package/dist/core/modules/distribution/msgs/MsgWithdrawDelegatorReward.js +13 -15
- package/dist/core/modules/distribution/msgs/MsgWithdrawDelegatorReward.js.map +1 -1
- package/dist/core/modules/distribution/msgs/MsgWithdrawValidatorCommission.js +13 -15
- package/dist/core/modules/distribution/msgs/MsgWithdrawValidatorCommission.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgBatchCancelBinaryOptionsOrders.js +16 -18
- package/dist/core/modules/exchange/msgs/MsgBatchCancelBinaryOptionsOrders.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgBatchCancelDerivativeOrders.js +16 -18
- package/dist/core/modules/exchange/msgs/MsgBatchCancelDerivativeOrders.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgBatchCancelSpotOrders.js +16 -18
- package/dist/core/modules/exchange/msgs/MsgBatchCancelSpotOrders.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgBatchUpdateOrders.js +33 -18
- package/dist/core/modules/exchange/msgs/MsgBatchUpdateOrders.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgCancelBinaryOptionsOrder.js +13 -15
- package/dist/core/modules/exchange/msgs/MsgCancelBinaryOptionsOrder.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgCancelDerivativeOrder.js +13 -15
- package/dist/core/modules/exchange/msgs/MsgCancelDerivativeOrder.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgCancelSpotOrder.js +13 -15
- package/dist/core/modules/exchange/msgs/MsgCancelSpotOrder.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.js +20 -16
- package/dist/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.js +20 -16
- package/dist/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.js +20 -16
- package/dist/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.js +20 -16
- package/dist/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgCreateSpotLimitOrder.js +19 -16
- package/dist/core/modules/exchange/msgs/MsgCreateSpotLimitOrder.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgCreateSpotMarketOrder.js +19 -16
- package/dist/core/modules/exchange/msgs/MsgCreateSpotMarketOrder.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgDeposit.js +13 -15
- package/dist/core/modules/exchange/msgs/MsgDeposit.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgExternalTransfer.js +13 -15
- package/dist/core/modules/exchange/msgs/MsgExternalTransfer.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgIncreasePositionMargin.js +17 -16
- package/dist/core/modules/exchange/msgs/MsgIncreasePositionMargin.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunch.js +23 -16
- package/dist/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunch.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.js +21 -16
- package/dist/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgMultiExecute.js +12 -3
- package/dist/core/modules/exchange/msgs/MsgMultiExecute.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgReclaimLockedFunds.js +13 -15
- package/dist/core/modules/exchange/msgs/MsgReclaimLockedFunds.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgTransferAndExecute.js +20 -5
- package/dist/core/modules/exchange/msgs/MsgTransferAndExecute.js.map +1 -1
- package/dist/core/modules/exchange/msgs/MsgWithdraw.js +13 -15
- package/dist/core/modules/exchange/msgs/MsgWithdraw.js.map +1 -1
- package/dist/core/modules/exchange/utils/classes/OrderHashManager.js +28 -43
- package/dist/core/modules/exchange/utils/classes/OrderHashManager.js.map +1 -1
- package/dist/core/modules/gov/msgs/MsgDeposit.js +18 -17
- package/dist/core/modules/gov/msgs/MsgDeposit.js.map +1 -1
- package/dist/core/modules/gov/msgs/MsgSubmitProposalExpiryFuturesMarketLaunch.js +32 -7
- package/dist/core/modules/gov/msgs/MsgSubmitProposalExpiryFuturesMarketLaunch.js.map +1 -1
- package/dist/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunch.js +32 -7
- package/dist/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunch.js.map +1 -1
- package/dist/core/modules/gov/msgs/MsgSubmitProposalSpotMarketLaunch.js +32 -7
- package/dist/core/modules/gov/msgs/MsgSubmitProposalSpotMarketLaunch.js.map +1 -1
- package/dist/core/modules/gov/msgs/MsgSubmitProposalSpotMarketParamUpdate.js +32 -7
- package/dist/core/modules/gov/msgs/MsgSubmitProposalSpotMarketParamUpdate.js.map +1 -1
- package/dist/core/modules/gov/msgs/MsgSubmitTextProposal.js +32 -7
- package/dist/core/modules/gov/msgs/MsgSubmitTextProposal.js.map +1 -1
- package/dist/core/modules/gov/msgs/MsgVote.js +13 -15
- package/dist/core/modules/gov/msgs/MsgVote.js.map +1 -1
- package/dist/core/modules/ibc/msgs/MsgTransfer.js +13 -15
- package/dist/core/modules/ibc/msgs/MsgTransfer.js.map +1 -1
- package/dist/core/modules/insurance/msgs/MsgCreateInsuranceFund.js +13 -15
- package/dist/core/modules/insurance/msgs/MsgCreateInsuranceFund.js.map +1 -1
- package/dist/core/modules/insurance/msgs/MsgRequestRedemption.js +13 -15
- package/dist/core/modules/insurance/msgs/MsgRequestRedemption.js.map +1 -1
- package/dist/core/modules/insurance/msgs/MsgUnderwrite.js +13 -15
- package/dist/core/modules/insurance/msgs/MsgUnderwrite.js.map +1 -1
- package/dist/core/modules/peggy/msgs/MsgSendToEth.js +13 -15
- package/dist/core/modules/peggy/msgs/MsgSendToEth.js.map +1 -1
- package/dist/core/modules/staking/msgs/MsgBeginRedelegate.js +13 -15
- package/dist/core/modules/staking/msgs/MsgBeginRedelegate.js.map +1 -1
- package/dist/core/modules/staking/msgs/MsgDelegate.js +13 -15
- package/dist/core/modules/staking/msgs/MsgDelegate.js.map +1 -1
- package/dist/core/modules/staking/msgs/MsgEditValidator.js +13 -15
- package/dist/core/modules/staking/msgs/MsgEditValidator.js.map +1 -1
- package/dist/core/modules/staking/msgs/MsgUndelegate.js +13 -15
- package/dist/core/modules/staking/msgs/MsgUndelegate.js.map +1 -1
- package/dist/core/modules/tx/api/TxGrpcApi.js +120 -130
- package/dist/core/modules/tx/api/TxGrpcApi.js.map +1 -1
- package/dist/core/modules/tx/api/TxRestApi.js +163 -181
- package/dist/core/modules/tx/api/TxRestApi.js.map +1 -1
- package/dist/core/modules/tx/broadcaster/MsgBroadcasterWithPk.js +84 -84
- package/dist/core/modules/tx/broadcaster/MsgBroadcasterWithPk.js.map +1 -1
- package/dist/core/modules/tx/eip712/eip712.js +14 -2
- package/dist/core/modules/tx/eip712/eip712.js.map +1 -1
- package/dist/core/modules/tx/eip712/maps.js +24 -6
- package/dist/core/modules/tx/eip712/maps.js.map +1 -1
- package/dist/core/modules/tx/tx.js +34 -24
- package/dist/core/modules/tx/tx.js.map +1 -1
- package/dist/core/modules/wasm/exec-args/ExecArgInitiateTransfer.js +9 -2
- package/dist/core/modules/wasm/exec-args/ExecArgInitiateTransfer.js.map +1 -1
- package/dist/core/modules/wasm/exec-args/ExecArgUpdateSpotVaultConfig.js +19 -1
- package/dist/core/modules/wasm/exec-args/ExecArgUpdateSpotVaultConfig.js.map +1 -1
- package/dist/core/modules/wasm/msgs/MsgExecuteContract.js +18 -16
- package/dist/core/modules/wasm/msgs/MsgExecuteContract.js.map +1 -1
- package/dist/core/modules/wasm/msgs/MsgInstantiateContract.js +16 -16
- package/dist/core/modules/wasm/msgs/MsgInstantiateContract.js.map +1 -1
- package/dist/core/modules/wasm/msgs/MsgMigrateContract.js +17 -16
- package/dist/core/modules/wasm/msgs/MsgMigrateContract.js.map +1 -1
- package/dist/core/modules/wasm/msgs/MsgPrivilegedExecuteContract.js +16 -16
- package/dist/core/modules/wasm/msgs/MsgPrivilegedExecuteContract.js.map +1 -1
- package/dist/core/modules/wasm/msgs/MsgStoreCode.js +16 -16
- package/dist/core/modules/wasm/msgs/MsgStoreCode.js.map +1 -1
- package/dist/core/stargate/StargateClient.js +17 -28
- package/dist/core/stargate/StargateClient.js.map +1 -1
- package/dist/utils/classes/Denom/Denom.js +104 -130
- package/dist/utils/classes/Denom/Denom.js.map +1 -1
- package/dist/utils/classes/Denom/DenomClient.js +10 -2
- package/dist/utils/classes/Denom/DenomClient.js.map +1 -1
- package/dist/utils/pagination.js +5 -1
- package/dist/utils/pagination.js.map +1 -1
- 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,352 +18,322 @@ class IndexerRestExplorerApi extends BaseRestConsumer_1.default {
|
|
|
27
18
|
? endpoint
|
|
28
19
|
: `${endpoint}/${explorerEndpointSuffix}`);
|
|
29
20
|
}
|
|
30
|
-
fetchBlock(blockHashHeight) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
throw e;
|
|
39
|
-
}
|
|
40
|
-
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
41
|
-
code: exceptions_1.UnspecifiedErrorCode,
|
|
42
|
-
contextModule: types_1.IndexerModule.Explorer,
|
|
43
|
-
});
|
|
21
|
+
async fetchBlock(blockHashHeight) {
|
|
22
|
+
try {
|
|
23
|
+
const response = (await this.get(`blocks/${blockHashHeight}`));
|
|
24
|
+
return transformers_1.IndexerRestExplorerTransformer.blockWithTxToBlockWithTx(response.data.data);
|
|
25
|
+
}
|
|
26
|
+
catch (e) {
|
|
27
|
+
if (e instanceof exceptions_1.HttpRequestException) {
|
|
28
|
+
throw e;
|
|
44
29
|
}
|
|
45
|
-
|
|
30
|
+
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
31
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
32
|
+
contextModule: types_1.IndexerModule.Explorer,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
46
35
|
}
|
|
47
|
-
fetchBlocks(params) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
36
|
+
async fetchBlocks(params) {
|
|
37
|
+
try {
|
|
38
|
+
const { before, limit } = params || { limit: 12 };
|
|
39
|
+
const response = (await this.get('blocks', {
|
|
40
|
+
before,
|
|
41
|
+
limit,
|
|
42
|
+
}));
|
|
43
|
+
const { paging, data } = response.data;
|
|
44
|
+
return {
|
|
45
|
+
paging,
|
|
46
|
+
blocks: transformers_1.IndexerRestExplorerTransformer.blocksToBlocks(data),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
if (e instanceof exceptions_1.HttpRequestException) {
|
|
51
|
+
throw e;
|
|
60
52
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
code: exceptions_1.UnspecifiedErrorCode,
|
|
67
|
-
contextModule: types_1.IndexerModule.Explorer,
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
});
|
|
53
|
+
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
54
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
55
|
+
contextModule: types_1.IndexerModule.Explorer,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
71
58
|
}
|
|
72
|
-
fetchBlocksWithTx(params) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
throw e;
|
|
91
|
-
}
|
|
92
|
-
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
93
|
-
code: exceptions_1.UnspecifiedErrorCode,
|
|
94
|
-
contextModule: types_1.IndexerModule.Explorer,
|
|
95
|
-
});
|
|
59
|
+
async fetchBlocksWithTx(params) {
|
|
60
|
+
try {
|
|
61
|
+
const { before, limit } = params || { limit: 12 };
|
|
62
|
+
const response = (await this.get('blocks', {
|
|
63
|
+
before,
|
|
64
|
+
limit,
|
|
65
|
+
}));
|
|
66
|
+
const { paging, data } = response.data;
|
|
67
|
+
return {
|
|
68
|
+
paging,
|
|
69
|
+
blocks: data
|
|
70
|
+
? transformers_1.IndexerRestExplorerTransformer.blocksWithTxsToBlocksWithTxs(data)
|
|
71
|
+
: [],
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
if (e instanceof exceptions_1.HttpRequestException) {
|
|
76
|
+
throw e;
|
|
96
77
|
}
|
|
97
|
-
|
|
78
|
+
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
79
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
80
|
+
contextModule: types_1.IndexerModule.Explorer,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
98
83
|
}
|
|
99
|
-
fetchTransactions(params) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
84
|
+
async fetchTransactions(params) {
|
|
85
|
+
try {
|
|
86
|
+
const { from_number, limit, to_number } = params || { limit: 12 };
|
|
87
|
+
const response = (await this.get('txs', {
|
|
88
|
+
from_number,
|
|
89
|
+
limit,
|
|
90
|
+
to_number,
|
|
91
|
+
}));
|
|
92
|
+
const { paging, data } = response.data;
|
|
93
|
+
return {
|
|
94
|
+
paging,
|
|
95
|
+
transactions: data
|
|
96
|
+
? transformers_1.IndexerRestExplorerTransformer.transactionsToTransactions(data)
|
|
97
|
+
: [],
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
catch (e) {
|
|
101
|
+
if (e instanceof exceptions_1.HttpRequestException) {
|
|
102
|
+
throw e;
|
|
115
103
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
code: exceptions_1.UnspecifiedErrorCode,
|
|
122
|
-
contextModule: types_1.IndexerModule.Explorer,
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
});
|
|
104
|
+
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
105
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
106
|
+
contextModule: types_1.IndexerModule.Explorer,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
126
109
|
}
|
|
127
|
-
fetchAccountTransactions({ account, params, }) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
throw e;
|
|
148
|
-
}
|
|
149
|
-
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
150
|
-
code: exceptions_1.UnspecifiedErrorCode,
|
|
151
|
-
contextModule: types_1.IndexerModule.Explorer,
|
|
152
|
-
});
|
|
110
|
+
async fetchAccountTransactions({ account, params, }) {
|
|
111
|
+
try {
|
|
112
|
+
const { from_number, limit, skip, to_number } = params || { limit: 12 };
|
|
113
|
+
const response = (await this.get(`accountTxs/${account}`, {
|
|
114
|
+
from_number,
|
|
115
|
+
limit,
|
|
116
|
+
skip,
|
|
117
|
+
to_number,
|
|
118
|
+
}));
|
|
119
|
+
const { paging, data } = response.data;
|
|
120
|
+
return {
|
|
121
|
+
paging,
|
|
122
|
+
transactions: data
|
|
123
|
+
? transformers_1.IndexerRestExplorerTransformer.transactionsToTransactions(data)
|
|
124
|
+
: [],
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
catch (e) {
|
|
128
|
+
if (e instanceof exceptions_1.HttpRequestException) {
|
|
129
|
+
throw e;
|
|
153
130
|
}
|
|
154
|
-
|
|
131
|
+
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
132
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
133
|
+
contextModule: types_1.IndexerModule.Explorer,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
155
136
|
}
|
|
156
|
-
fetchTransaction(hash) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
throw e;
|
|
165
|
-
}
|
|
166
|
-
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
167
|
-
code: exceptions_1.UnspecifiedErrorCode,
|
|
168
|
-
contextModule: types_1.IndexerModule.Explorer,
|
|
169
|
-
});
|
|
137
|
+
async fetchTransaction(hash) {
|
|
138
|
+
try {
|
|
139
|
+
const response = (await this.get(`txs/${hash}`));
|
|
140
|
+
return transformers_1.IndexerRestExplorerTransformer.transactionToTransaction(response.data.data);
|
|
141
|
+
}
|
|
142
|
+
catch (e) {
|
|
143
|
+
if (e instanceof exceptions_1.HttpRequestException) {
|
|
144
|
+
throw e;
|
|
170
145
|
}
|
|
171
|
-
|
|
146
|
+
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
147
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
148
|
+
contextModule: types_1.IndexerModule.Explorer,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
172
151
|
}
|
|
173
|
-
fetchValidators() {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
return [];
|
|
179
|
-
}
|
|
180
|
-
return transformers_1.IndexerRestExplorerTransformer.validatorExplorerToValidator(response.data.data);
|
|
152
|
+
async fetchValidators() {
|
|
153
|
+
try {
|
|
154
|
+
const response = (await this.get(`validators`));
|
|
155
|
+
if (!response.data || !response.data.data) {
|
|
156
|
+
return [];
|
|
181
157
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
throw
|
|
187
|
-
code: exceptions_1.UnspecifiedErrorCode,
|
|
188
|
-
contextModule: types_1.IndexerModule.Explorer,
|
|
189
|
-
});
|
|
158
|
+
return transformers_1.IndexerRestExplorerTransformer.validatorExplorerToValidator(response.data.data);
|
|
159
|
+
}
|
|
160
|
+
catch (e) {
|
|
161
|
+
if (e instanceof exceptions_1.HttpRequestException) {
|
|
162
|
+
throw e;
|
|
190
163
|
}
|
|
191
|
-
|
|
164
|
+
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
165
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
166
|
+
contextModule: types_1.IndexerModule.Explorer,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
192
169
|
}
|
|
193
|
-
fetchValidatorUptime(validatorConsensusAddress) {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
return [];
|
|
199
|
-
}
|
|
200
|
-
return transformers_1.IndexerRestExplorerTransformer.validatorUptimeToExplorerValidatorUptime(response.data.data);
|
|
170
|
+
async fetchValidatorUptime(validatorConsensusAddress) {
|
|
171
|
+
try {
|
|
172
|
+
const response = (await this.get(`validator_uptime/${validatorConsensusAddress}`));
|
|
173
|
+
if (!response.data || !response.data.data) {
|
|
174
|
+
return [];
|
|
201
175
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
throw
|
|
207
|
-
code: exceptions_1.UnspecifiedErrorCode,
|
|
208
|
-
contextModule: types_1.IndexerModule.Explorer,
|
|
209
|
-
});
|
|
176
|
+
return transformers_1.IndexerRestExplorerTransformer.validatorUptimeToExplorerValidatorUptime(response.data.data);
|
|
177
|
+
}
|
|
178
|
+
catch (e) {
|
|
179
|
+
if (e instanceof exceptions_1.HttpRequestException) {
|
|
180
|
+
throw e;
|
|
210
181
|
}
|
|
211
|
-
|
|
182
|
+
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
183
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
184
|
+
contextModule: types_1.IndexerModule.Explorer,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
212
187
|
}
|
|
213
|
-
fetchContract(contractAddress) {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
188
|
+
async fetchContract(contractAddress) {
|
|
189
|
+
try {
|
|
190
|
+
const response = (await this.get(`/wasm/contracts/${contractAddress}`));
|
|
191
|
+
return transformers_1.IndexerRestExplorerTransformer.contractToExplorerContract(response.data);
|
|
192
|
+
}
|
|
193
|
+
catch (e) {
|
|
194
|
+
if (e instanceof exceptions_1.HttpRequestException) {
|
|
195
|
+
throw e;
|
|
218
196
|
}
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
code: exceptions_1.UnspecifiedErrorCode,
|
|
225
|
-
contextModule: types_1.IndexerModule.Explorer,
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
});
|
|
197
|
+
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
198
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
199
|
+
contextModule: types_1.IndexerModule.Explorer,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
229
202
|
}
|
|
230
|
-
fetchContracts(params) {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
throw e;
|
|
251
|
-
}
|
|
252
|
-
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
253
|
-
code: exceptions_1.UnspecifiedErrorCode,
|
|
254
|
-
contextModule: types_1.IndexerModule.Explorer,
|
|
255
|
-
});
|
|
203
|
+
async fetchContracts(params) {
|
|
204
|
+
try {
|
|
205
|
+
const { assets_only, from_number, limit, skip } = params || { limit: 12 };
|
|
206
|
+
const response = (await this.get('/wasm/contracts', {
|
|
207
|
+
assets_only,
|
|
208
|
+
from_number,
|
|
209
|
+
limit,
|
|
210
|
+
skip,
|
|
211
|
+
}));
|
|
212
|
+
const { paging, data } = response.data;
|
|
213
|
+
return {
|
|
214
|
+
paging,
|
|
215
|
+
contracts: data
|
|
216
|
+
? data.map(transformers_1.IndexerRestExplorerTransformer.contractToExplorerContract)
|
|
217
|
+
: [],
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
catch (e) {
|
|
221
|
+
if (e instanceof exceptions_1.HttpRequestException) {
|
|
222
|
+
throw e;
|
|
256
223
|
}
|
|
257
|
-
|
|
224
|
+
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
225
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
226
|
+
contextModule: types_1.IndexerModule.Explorer,
|
|
227
|
+
});
|
|
228
|
+
}
|
|
258
229
|
}
|
|
259
|
-
fetchContractTransactions({ contractAddress, params, }) {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
throw e;
|
|
280
|
-
}
|
|
281
|
-
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
282
|
-
code: exceptions_1.UnspecifiedErrorCode,
|
|
283
|
-
contextModule: types_1.IndexerModule.Explorer,
|
|
284
|
-
});
|
|
230
|
+
async fetchContractTransactions({ contractAddress, params, }) {
|
|
231
|
+
try {
|
|
232
|
+
const { from_number, limit, skip, to_number } = params || { limit: 12 };
|
|
233
|
+
const response = (await this.get(`/contractTxs/${contractAddress}`, {
|
|
234
|
+
from_number,
|
|
235
|
+
limit,
|
|
236
|
+
skip,
|
|
237
|
+
to_number,
|
|
238
|
+
}));
|
|
239
|
+
const { paging, data } = response.data;
|
|
240
|
+
return {
|
|
241
|
+
paging,
|
|
242
|
+
transactions: data
|
|
243
|
+
? data.map(transformers_1.IndexerRestExplorerTransformer.contractTransactionToExplorerContractTransaction)
|
|
244
|
+
: [],
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
catch (e) {
|
|
248
|
+
if (e instanceof exceptions_1.HttpRequestException) {
|
|
249
|
+
throw e;
|
|
285
250
|
}
|
|
286
|
-
|
|
251
|
+
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
252
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
253
|
+
contextModule: types_1.IndexerModule.Explorer,
|
|
254
|
+
});
|
|
255
|
+
}
|
|
287
256
|
}
|
|
288
|
-
fetchWasmCode(codeId) {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
257
|
+
async fetchWasmCode(codeId) {
|
|
258
|
+
try {
|
|
259
|
+
const response = (await this.get(`/wasm/codes/${codeId}`));
|
|
260
|
+
return transformers_1.IndexerRestExplorerTransformer.wasmCodeToExplorerWasmCode(response.data);
|
|
261
|
+
}
|
|
262
|
+
catch (e) {
|
|
263
|
+
if (e instanceof exceptions_1.HttpRequestException) {
|
|
264
|
+
throw e;
|
|
293
265
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
code: exceptions_1.UnspecifiedErrorCode,
|
|
300
|
-
contextModule: types_1.IndexerModule.Explorer,
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
});
|
|
266
|
+
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
267
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
268
|
+
contextModule: types_1.IndexerModule.Explorer,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
304
271
|
}
|
|
305
|
-
fetchWasmCodes(params) {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
throw e;
|
|
325
|
-
}
|
|
326
|
-
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
327
|
-
code: exceptions_1.UnspecifiedErrorCode,
|
|
328
|
-
contextModule: types_1.IndexerModule.Explorer,
|
|
329
|
-
});
|
|
272
|
+
async fetchWasmCodes(params) {
|
|
273
|
+
try {
|
|
274
|
+
const { from_number, limit, to_number } = params || { limit: 12 };
|
|
275
|
+
const response = (await this.get('/wasm/codes', {
|
|
276
|
+
from_number,
|
|
277
|
+
limit,
|
|
278
|
+
to_number,
|
|
279
|
+
}));
|
|
280
|
+
const { paging, data } = response.data;
|
|
281
|
+
return {
|
|
282
|
+
paging,
|
|
283
|
+
wasmCodes: data
|
|
284
|
+
? data.map(transformers_1.IndexerRestExplorerTransformer.wasmCodeToExplorerWasmCode)
|
|
285
|
+
: [],
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
catch (e) {
|
|
289
|
+
if (e instanceof exceptions_1.HttpRequestException) {
|
|
290
|
+
throw e;
|
|
330
291
|
}
|
|
331
|
-
|
|
292
|
+
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
293
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
294
|
+
contextModule: types_1.IndexerModule.Explorer,
|
|
295
|
+
});
|
|
296
|
+
}
|
|
332
297
|
}
|
|
333
|
-
fetchCW20Balances(address) {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
return [];
|
|
339
|
-
}
|
|
340
|
-
return response.data.map(transformers_1.IndexerRestExplorerTransformer.CW20BalanceToExplorerCW20Balance);
|
|
298
|
+
async fetchCW20Balances(address) {
|
|
299
|
+
try {
|
|
300
|
+
const response = (await this.get(`/wasm/${address}/cw20-balance`));
|
|
301
|
+
if (response.data.length === 0) {
|
|
302
|
+
return [];
|
|
341
303
|
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
throw
|
|
347
|
-
code: exceptions_1.UnspecifiedErrorCode,
|
|
348
|
-
contextModule: types_1.IndexerModule.Explorer,
|
|
349
|
-
});
|
|
304
|
+
return response.data.map(transformers_1.IndexerRestExplorerTransformer.CW20BalanceToExplorerCW20Balance);
|
|
305
|
+
}
|
|
306
|
+
catch (e) {
|
|
307
|
+
if (e instanceof exceptions_1.HttpRequestException) {
|
|
308
|
+
throw e;
|
|
350
309
|
}
|
|
351
|
-
|
|
310
|
+
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
311
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
312
|
+
contextModule: types_1.IndexerModule.Explorer,
|
|
313
|
+
});
|
|
314
|
+
}
|
|
352
315
|
}
|
|
353
|
-
fetchCW20BalancesNoThrow(address) {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
316
|
+
async fetchCW20BalancesNoThrow(address) {
|
|
317
|
+
try {
|
|
318
|
+
const response = (await this.get(`/wasm/${address}/cw20-balance`));
|
|
319
|
+
if (response.data.length === 0) {
|
|
320
|
+
return [];
|
|
321
|
+
}
|
|
322
|
+
return response.data.map(transformers_1.IndexerRestExplorerTransformer.CW20BalanceToExplorerCW20Balance);
|
|
323
|
+
}
|
|
324
|
+
catch (e) {
|
|
325
|
+
const error = e;
|
|
326
|
+
if (error.message.includes(404) || error.message.includes(500)) {
|
|
327
|
+
return [];
|
|
361
328
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
if (error.message.includes(404) || error.message.includes(500)) {
|
|
365
|
-
return [];
|
|
366
|
-
}
|
|
367
|
-
if (e instanceof exceptions_1.HttpRequestException) {
|
|
368
|
-
throw e;
|
|
369
|
-
}
|
|
370
|
-
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
371
|
-
code: exceptions_1.UnspecifiedErrorCode,
|
|
372
|
-
contextModule: types_1.IndexerModule.Explorer,
|
|
373
|
-
});
|
|
329
|
+
if (e instanceof exceptions_1.HttpRequestException) {
|
|
330
|
+
throw e;
|
|
374
331
|
}
|
|
375
|
-
|
|
332
|
+
throw new exceptions_1.HttpRequestException(new Error(e.message), {
|
|
333
|
+
code: exceptions_1.UnspecifiedErrorCode,
|
|
334
|
+
contextModule: types_1.IndexerModule.Explorer,
|
|
335
|
+
});
|
|
336
|
+
}
|
|
376
337
|
}
|
|
377
338
|
}
|
|
378
339
|
exports.IndexerRestExplorerApi = IndexerRestExplorerApi;
|