carbon-js-sdk 0.7.2-beta.1 → 0.7.2
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/lib/clients/CarbonQueryClient.d.ts +2 -0
- package/lib/clients/CarbonQueryClient.js +71 -69
- package/lib/clients/InsightsQueryClient.d.ts +7 -0
- package/lib/clients/InsightsQueryClient.js +14 -0
- package/lib/insights/common.d.ts +1 -0
- package/lib/insights/common.js +1 -0
- package/lib/insights/competition.d.ts +15 -0
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ import { ServiceClientImpl as CosmosTmClient } from "../codec/cosmos/base/tender
|
|
|
10
10
|
import { QueryClientImpl as DistributionQueryClient } from "../codec/cosmos/distribution/v1beta1/query";
|
|
11
11
|
import { QueryClientImpl as EvidenceQueryClient } from "../codec/cosmos/evidence/v1beta1/query";
|
|
12
12
|
import { QueryClientImpl as GovQueryClient } from "../codec/cosmos/gov/v1beta1/query";
|
|
13
|
+
import { QueryClientImpl as GroupQueryClient } from "../codec/cosmos/group/v1/query";
|
|
13
14
|
import { QueryClientImpl as MintQueryClient } from "../codec/cosmos/mint/v1beta1/query";
|
|
14
15
|
import { QueryClientImpl as ParamsQueryClient } from "../codec/cosmos/params/v1beta1/query";
|
|
15
16
|
import { QueryClientImpl as SlashingQueryClient } from "../codec/cosmos/slashing/v1beta1/query";
|
|
@@ -92,6 +93,7 @@ declare class CarbonQueryClient {
|
|
|
92
93
|
distribution: DistributionQueryClient;
|
|
93
94
|
evidence: EvidenceQueryClient;
|
|
94
95
|
gov: GovQueryClient;
|
|
96
|
+
group: GroupQueryClient;
|
|
95
97
|
mint: MintQueryClient;
|
|
96
98
|
params: ParamsQueryClient;
|
|
97
99
|
slashing: SlashingQueryClient;
|
|
@@ -15,40 +15,41 @@ const query_9 = require("../codec/cosmos/base/tendermint/v1beta1/query");
|
|
|
15
15
|
const query_10 = require("../codec/cosmos/distribution/v1beta1/query");
|
|
16
16
|
const query_11 = require("../codec/cosmos/evidence/v1beta1/query");
|
|
17
17
|
const query_12 = require("../codec/cosmos/gov/v1beta1/query");
|
|
18
|
-
const query_13 = require("../codec/cosmos/
|
|
19
|
-
const query_14 = require("../codec/cosmos/
|
|
20
|
-
const query_15 = require("../codec/cosmos/
|
|
21
|
-
const query_16 = require("../codec/cosmos/
|
|
22
|
-
const query_17 = require("../codec/cosmos/
|
|
23
|
-
const query_18 = require("../codec/
|
|
24
|
-
const query_19 = require("../codec/
|
|
25
|
-
const query_20 = require("../codec/
|
|
26
|
-
const query_21 = require("../codec/
|
|
27
|
-
const query_22 = require("../codec/
|
|
28
|
-
const query_23 = require("../codec/
|
|
29
|
-
const query_24 = require("../codec/
|
|
30
|
-
const query_25 = require("../codec/ibc/applications/interchain_accounts/
|
|
31
|
-
const query_26 = require("../codec/ibc/applications/
|
|
32
|
-
const query_27 = require("../codec/ibc/
|
|
33
|
-
const query_28 = require("../codec/ibc/core/
|
|
34
|
-
const query_29 = require("../codec/ibc/core/
|
|
35
|
-
const query_30 = require("../codec/
|
|
36
|
-
const query_31 = require("../codec/
|
|
37
|
-
const query_32 = require("../codec/
|
|
38
|
-
const query_33 = require("../codec/
|
|
39
|
-
const query_34 = require("../codec/
|
|
40
|
-
const query_35 = require("../codec/
|
|
41
|
-
const query_36 = require("../codec/
|
|
42
|
-
const query_37 = require("../codec/
|
|
43
|
-
const query_38 = require("../codec/
|
|
44
|
-
const query_39 = require("../codec/
|
|
45
|
-
const query_40 = require("../codec/
|
|
46
|
-
const query_41 = require("../codec/
|
|
47
|
-
const query_42 = require("../codec/
|
|
48
|
-
const query_43 = require("../codec/
|
|
49
|
-
const query_44 = require("../codec/
|
|
50
|
-
const query_45 = require("../codec/
|
|
51
|
-
const query_46 = require("../codec/
|
|
18
|
+
const query_13 = require("../codec/cosmos/group/v1/query");
|
|
19
|
+
const query_14 = require("../codec/cosmos/mint/v1beta1/query");
|
|
20
|
+
const query_15 = require("../codec/cosmos/params/v1beta1/query");
|
|
21
|
+
const query_16 = require("../codec/cosmos/slashing/v1beta1/query");
|
|
22
|
+
const query_17 = require("../codec/cosmos/staking/v1beta1/query");
|
|
23
|
+
const query_18 = require("../codec/cosmos/upgrade/v1beta1/query");
|
|
24
|
+
const query_19 = require("../codec/ethermint/evm/v1/query");
|
|
25
|
+
const query_20 = require("../codec/evmmerge/query");
|
|
26
|
+
const query_21 = require("../codec/evmbank/query");
|
|
27
|
+
const query_22 = require("../codec/ethermint/feemarket/v1/query");
|
|
28
|
+
const query_23 = require("../codec/fee/query");
|
|
29
|
+
const query_24 = require("../codec/headersync/query");
|
|
30
|
+
const query_25 = require("../codec/ibc/applications/interchain_accounts/controller/v1/query");
|
|
31
|
+
const query_26 = require("../codec/ibc/applications/interchain_accounts/host/v1/query");
|
|
32
|
+
const query_27 = require("../codec/ibc/applications/transfer/v1/query");
|
|
33
|
+
const query_28 = require("../codec/ibc/core/client/v1/query");
|
|
34
|
+
const query_29 = require("../codec/ibc/core/connection/v1/query");
|
|
35
|
+
const query_30 = require("../codec/ibc/core/channel/v1/query");
|
|
36
|
+
const query_31 = require("../codec/inflation/query");
|
|
37
|
+
const query_32 = require("../codec/insurance/query");
|
|
38
|
+
const query_33 = require("../codec/leverage/query");
|
|
39
|
+
const query_34 = require("../codec/liquidation/query");
|
|
40
|
+
const query_35 = require("../codec/liquiditypool/query");
|
|
41
|
+
const query_36 = require("../codec/market/query");
|
|
42
|
+
const query_37 = require("../codec/marketstats/query");
|
|
43
|
+
const query_38 = require("../codec/misc/query");
|
|
44
|
+
const query_39 = require("../codec/oracle/query");
|
|
45
|
+
const query_40 = require("../codec/order/query");
|
|
46
|
+
const query_41 = require("../codec/position/query");
|
|
47
|
+
const query_42 = require("../codec/pricing/query");
|
|
48
|
+
const query_43 = require("../codec/profile/query");
|
|
49
|
+
const query_44 = require("../codec/subaccount/query");
|
|
50
|
+
const query_45 = require("../codec/alliance/query");
|
|
51
|
+
const query_46 = require("../codec/perpspool/query");
|
|
52
|
+
const query_47 = require("../codec/erc20/query");
|
|
52
53
|
const stargate_1 = require("@cosmjs/stargate");
|
|
53
54
|
const BlockchainClient_1 = __importDefault(require("./BlockchainClient"));
|
|
54
55
|
class CarbonQueryClient {
|
|
@@ -57,55 +58,56 @@ class CarbonQueryClient {
|
|
|
57
58
|
const rpcClient = (_a = opts.grpcClient) !== null && _a !== void 0 ? _a : (0, stargate_1.createProtobufRpcClient)(new stargate_1.QueryClient(opts.tmClient));
|
|
58
59
|
this.chain = BlockchainClient_1.default.connectWithTm(opts.tmClient);
|
|
59
60
|
this.adl = new query_1.QueryClientImpl(rpcClient);
|
|
60
|
-
this.alliance = new
|
|
61
|
+
this.alliance = new query_45.QueryClientImpl(rpcClient);
|
|
61
62
|
this.book = new query_2.QueryClientImpl(rpcClient);
|
|
62
63
|
this.broker = new query_3.QueryClientImpl(rpcClient);
|
|
63
64
|
this.coin = new query_5.QueryClientImpl(rpcClient);
|
|
64
65
|
this.cdp = new query_4.QueryClientImpl(rpcClient);
|
|
65
|
-
this.fee = new
|
|
66
|
-
this.inflation = new
|
|
67
|
-
this.insurance = new
|
|
68
|
-
this.leverage = new
|
|
69
|
-
this.liquidation = new
|
|
70
|
-
this.liquiditypool = new
|
|
71
|
-
this.market = new
|
|
72
|
-
this.marketstats = new
|
|
73
|
-
this.misc = new
|
|
74
|
-
this.oracle = new
|
|
75
|
-
this.order = new
|
|
76
|
-
this.position = new
|
|
77
|
-
this.pricing = new
|
|
78
|
-
this.profile = new
|
|
79
|
-
this.subaccount = new
|
|
80
|
-
this.headersync = new
|
|
81
|
-
this.evmmerge = new
|
|
82
|
-
this.evmbank = new
|
|
83
|
-
this.perpspool = new
|
|
66
|
+
this.fee = new query_23.QueryClientImpl(rpcClient);
|
|
67
|
+
this.inflation = new query_31.QueryClientImpl(rpcClient);
|
|
68
|
+
this.insurance = new query_32.QueryClientImpl(rpcClient);
|
|
69
|
+
this.leverage = new query_33.QueryClientImpl(rpcClient);
|
|
70
|
+
this.liquidation = new query_34.QueryClientImpl(rpcClient);
|
|
71
|
+
this.liquiditypool = new query_35.QueryClientImpl(rpcClient);
|
|
72
|
+
this.market = new query_36.QueryClientImpl(rpcClient);
|
|
73
|
+
this.marketstats = new query_37.QueryClientImpl(rpcClient);
|
|
74
|
+
this.misc = new query_38.QueryClientImpl(rpcClient);
|
|
75
|
+
this.oracle = new query_39.QueryClientImpl(rpcClient);
|
|
76
|
+
this.order = new query_40.QueryClientImpl(rpcClient);
|
|
77
|
+
this.position = new query_41.QueryClientImpl(rpcClient);
|
|
78
|
+
this.pricing = new query_42.QueryClientImpl(rpcClient);
|
|
79
|
+
this.profile = new query_43.QueryClientImpl(rpcClient);
|
|
80
|
+
this.subaccount = new query_44.QueryClientImpl(rpcClient);
|
|
81
|
+
this.headersync = new query_24.QueryClientImpl(rpcClient);
|
|
82
|
+
this.evmmerge = new query_20.QueryClientImpl(rpcClient);
|
|
83
|
+
this.evmbank = new query_21.QueryClientImpl(rpcClient);
|
|
84
|
+
this.perpspool = new query_46.QueryClientImpl(rpcClient);
|
|
84
85
|
this.auth = new query_6.QueryClientImpl(rpcClient);
|
|
85
86
|
this.bank = new query_7.QueryClientImpl(rpcClient);
|
|
86
87
|
this.nativeBank = new query_8.QueryClientImpl(rpcClient);
|
|
87
88
|
this.distribution = new query_10.QueryClientImpl(rpcClient);
|
|
88
89
|
this.evidence = new query_11.QueryClientImpl(rpcClient);
|
|
90
|
+
this.group = new query_13.QueryClientImpl(rpcClient);
|
|
89
91
|
this.gov = new query_12.QueryClientImpl(rpcClient);
|
|
90
|
-
this.mint = new
|
|
91
|
-
this.params = new
|
|
92
|
-
this.slashing = new
|
|
93
|
-
this.staking = new
|
|
94
|
-
this.upgrade = new
|
|
92
|
+
this.mint = new query_14.QueryClientImpl(rpcClient);
|
|
93
|
+
this.params = new query_15.QueryClientImpl(rpcClient);
|
|
94
|
+
this.slashing = new query_16.QueryClientImpl(rpcClient);
|
|
95
|
+
this.staking = new query_17.QueryClientImpl(rpcClient);
|
|
96
|
+
this.upgrade = new query_18.QueryClientImpl(rpcClient);
|
|
95
97
|
this.cosmosTm = new query_9.ServiceClientImpl(rpcClient);
|
|
96
|
-
this.alliance = new
|
|
97
|
-
this.erc20 = new
|
|
98
|
+
this.alliance = new query_45.QueryClientImpl(rpcClient);
|
|
99
|
+
this.erc20 = new query_47.QueryClientImpl(rpcClient);
|
|
98
100
|
this.ibc = {
|
|
99
|
-
controller: new
|
|
100
|
-
host: new
|
|
101
|
-
transfer: new
|
|
102
|
-
client: new
|
|
103
|
-
connection: new
|
|
104
|
-
channel: new
|
|
101
|
+
controller: new query_25.QueryClientImpl(rpcClient),
|
|
102
|
+
host: new query_26.QueryClientImpl(rpcClient),
|
|
103
|
+
transfer: new query_27.QueryClientImpl(rpcClient),
|
|
104
|
+
client: new query_28.QueryClientImpl(rpcClient),
|
|
105
|
+
connection: new query_29.QueryClientImpl(rpcClient),
|
|
106
|
+
channel: new query_30.QueryClientImpl(rpcClient),
|
|
105
107
|
};
|
|
106
108
|
this.ethermint = {
|
|
107
|
-
evm: new
|
|
108
|
-
feeMarket: new
|
|
109
|
+
evm: new query_19.QueryClientImpl(rpcClient),
|
|
110
|
+
feeMarket: new query_22.QueryClientImpl(rpcClient),
|
|
109
111
|
};
|
|
110
112
|
}
|
|
111
113
|
}
|
|
@@ -19,7 +19,14 @@ declare class InsightsQueryClient {
|
|
|
19
19
|
PoolVolume(req: Insights.QueryGetPoolVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolVolumeResponse>>;
|
|
20
20
|
PoolsVolume(req?: Insights.QueryGetPoolsVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolsVolumeResponse>>;
|
|
21
21
|
CompetitionList(req?: Insights.QueryGetCompetitionListRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetCompetitionListResponse>>;
|
|
22
|
+
/**
|
|
23
|
+
* endpoint for legacy Demex Trading volume Competition (circa. 2021-2022). Keeping this here as endpoint has not been removed.
|
|
24
|
+
*/
|
|
22
25
|
VolumeCompetitionLeaderboard(req: Insights.QueryGetVolumeCompetitionLeaderboardRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetVolumeCompetitionLeaderboardResponse>>;
|
|
26
|
+
/**
|
|
27
|
+
* endpoint for Perps Trading Competition on Demex (14 Nov 2023 - 28 Nov 2023).
|
|
28
|
+
*/
|
|
29
|
+
PerpsTradingCompetitionVolume(req: Insights.QueryGetPerpsCompTradingVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPerpsCompTradingVolumeResponse>>;
|
|
23
30
|
PNLCompetitionLeaderboard(req: Insights.QueryGetPNLCompetitionLeaderboardRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPNLCompetitionLeaderboardResponse>>;
|
|
24
31
|
LotteryCompetitionLeaderboard(req: Insights.QueryGetLotteryCompetitionLeaderboardRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetLotteryCompetitionLeaderboardResponse>>;
|
|
25
32
|
LeagueCompetitionLeaderboard(req: Insights.QueryGetLeagueCompetitionLeaderboardRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetLeagueCompetitionLeaderboardResponse>>;
|
|
@@ -173,6 +173,9 @@ class InsightsQueryClient {
|
|
|
173
173
|
return response.data;
|
|
174
174
|
});
|
|
175
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* endpoint for legacy Demex Trading volume Competition (circa. 2021-2022). Keeping this here as endpoint has not been removed.
|
|
178
|
+
*/
|
|
176
179
|
VolumeCompetitionLeaderboard(req) {
|
|
177
180
|
return __awaiter(this, void 0, void 0, function* () {
|
|
178
181
|
const queryParams = Object.assign(Object.assign(Object.assign({ competitionId: req.competitionId }, (req.from && { from: req.from })), (req.until && { until: req.until })), (req.market && { market: req.market }));
|
|
@@ -181,6 +184,17 @@ class InsightsQueryClient {
|
|
|
181
184
|
return response.data;
|
|
182
185
|
});
|
|
183
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* endpoint for Perps Trading Competition on Demex (14 Nov 2023 - 28 Nov 2023).
|
|
189
|
+
*/
|
|
190
|
+
PerpsTradingCompetitionVolume(req) {
|
|
191
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
192
|
+
const queryParams = Object.assign({ competitionId: req.competitionId }, (req.address && { address: req.address }));
|
|
193
|
+
const request = this.apiManager.path("competition/leaderboardvolume", {}, queryParams);
|
|
194
|
+
const response = yield request.get();
|
|
195
|
+
return response.data;
|
|
196
|
+
});
|
|
197
|
+
}
|
|
184
198
|
PNLCompetitionLeaderboard(req) {
|
|
185
199
|
return __awaiter(this, void 0, void 0, function* () {
|
|
186
200
|
const queryParams = Object.assign({ competitionId: req.competitionId }, (req.market && { market: req.market }));
|
package/lib/insights/common.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export declare const InsightsEndpoints: {
|
|
|
32
32
|
"competition/leaderboardpnl": string;
|
|
33
33
|
"competition/leaderboardlottery": string;
|
|
34
34
|
"competition/leaderboardleague": string;
|
|
35
|
+
"competition/leaderboardvolume": string;
|
|
35
36
|
"info/denom_gecko_map": string;
|
|
36
37
|
"market/funding": string;
|
|
37
38
|
"proposal/votes": string;
|
package/lib/insights/common.js
CHANGED
|
@@ -42,6 +42,7 @@ exports.InsightsEndpoints = {
|
|
|
42
42
|
"competition/leaderboardpnl": "/competition/leaderboardpnl",
|
|
43
43
|
"competition/leaderboardlottery": "/competition/leaderboardlottery",
|
|
44
44
|
"competition/leaderboardleague": "/competition/leaderboardleague",
|
|
45
|
+
"competition/leaderboardvolume": "/competition/leaderboardvolume",
|
|
45
46
|
//Coin Gecko Tokens api
|
|
46
47
|
"info/denom_gecko_map": "/info/denom_gecko_map",
|
|
47
48
|
//funding
|
|
@@ -37,6 +37,21 @@ export interface QueryGetVolumeCompetitionLeaderboardRequest {
|
|
|
37
37
|
from?: string;
|
|
38
38
|
until?: string;
|
|
39
39
|
}
|
|
40
|
+
export interface PerpsCompTradingVolumeEntry {
|
|
41
|
+
address: string;
|
|
42
|
+
volume: string;
|
|
43
|
+
rank: string;
|
|
44
|
+
tier: string;
|
|
45
|
+
username: string | null;
|
|
46
|
+
twitter: string | null;
|
|
47
|
+
}
|
|
48
|
+
export interface QueryGetPerpsCompTradingVolumeResponse {
|
|
49
|
+
entries: PerpsCompTradingVolumeEntry[];
|
|
50
|
+
}
|
|
51
|
+
export interface QueryGetPerpsCompTradingVolumeRequest {
|
|
52
|
+
competitionId: string;
|
|
53
|
+
address?: string;
|
|
54
|
+
}
|
|
40
55
|
export interface PNLLeaderboardEntry {
|
|
41
56
|
competitionId: string;
|
|
42
57
|
address: string;
|