carbon-js-sdk 0.5.7 → 0.5.8-beta.1
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/InsightsQueryClient.d.ts +3 -0
- package/lib/clients/InsightsQueryClient.js +21 -0
- package/lib/insights/alliances.d.ts +39 -0
- package/lib/insights/alliances.js +2 -0
- package/lib/insights/common.d.ts +3 -0
- package/lib/insights/common.js +4 -0
- package/lib/insights/index.d.ts +1 -0
- package/lib/insights/index.js +1 -0
- package/lib/insights/position.d.ts +18 -1
- package/package.json +1 -1
|
@@ -34,10 +34,13 @@ declare class InsightsQueryClient {
|
|
|
34
34
|
LiquidationAndADL(query: Insights.GetLiquidationAndADLQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetLiquidationAndADLResponse>>;
|
|
35
35
|
PositionsView(req: Insights.GetPositionsViewPathParams, query: Insights.GetPositionsViewQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPositionsViewResponse>>;
|
|
36
36
|
Leaderboard(req: Insights.GetLeaderboardPathParams, query: Insights.GetLeaderboardQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetLeaderboardResponse>>;
|
|
37
|
+
PositionStats(req: Insights.GetPositionStatsPathParams, query: Insights.GetPositionStatsQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPositionStatsResponse>>;
|
|
37
38
|
DenomToGeckoIdMap(): Promise<Insights.InsightsQueryResponse<Insights.QueryDenomToGeckoIdMap>>;
|
|
38
39
|
FundingHistory(query: Insights.QueryGetFundingRateRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetFundingRateResponse>>;
|
|
39
40
|
ProposalVotes(req: Insights.GetProposalVotesPathParams, query: Insights.GetProposalVotesQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetProposalVotesResponse>>;
|
|
40
41
|
Delegations(req: Insights.GetDelegationsPathParams, query: Insights.GetDelegationsQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetDelegationsResponse>>;
|
|
41
42
|
OraclePrices(req?: Insights.QueryGetOraclesPriceRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetOraclesPriceResponse>>;
|
|
43
|
+
AlliancesStake(req?: Insights.QueryGetAlliancesStakeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetAlliancesStakeResponse>>;
|
|
44
|
+
AlliancesRewards(req?: Insights.QueryGetAlliancesRewardsRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetAlliancesRewardsResponse>>;
|
|
42
45
|
}
|
|
43
46
|
export default InsightsQueryClient;
|
|
@@ -313,6 +313,13 @@ class InsightsQueryClient {
|
|
|
313
313
|
return response.data;
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
|
+
PositionStats(req, query) {
|
|
317
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
318
|
+
const request = this.apiManager.path("position/stats", req, query);
|
|
319
|
+
const response = yield request.get();
|
|
320
|
+
return response.data;
|
|
321
|
+
});
|
|
322
|
+
}
|
|
316
323
|
//Coin Gecko Tokens
|
|
317
324
|
DenomToGeckoIdMap() {
|
|
318
325
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -354,5 +361,19 @@ class InsightsQueryClient {
|
|
|
354
361
|
return response.data;
|
|
355
362
|
});
|
|
356
363
|
}
|
|
364
|
+
AlliancesStake(req = {}) {
|
|
365
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
366
|
+
const request = this.apiManager.path("alliances/stake", {}, req);
|
|
367
|
+
const response = yield request.get();
|
|
368
|
+
return response.data;
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
AlliancesRewards(req = {}) {
|
|
372
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
373
|
+
const request = this.apiManager.path("alliances/rewards", {}, req);
|
|
374
|
+
const response = yield request.get();
|
|
375
|
+
return response.data;
|
|
376
|
+
});
|
|
377
|
+
}
|
|
357
378
|
}
|
|
358
379
|
exports.default = InsightsQueryClient;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { QueryByTimeRequest, TimeMeta } from "./common";
|
|
2
|
+
export interface AlliancesStake {
|
|
3
|
+
date: string;
|
|
4
|
+
stakedValue: string;
|
|
5
|
+
totalStakedValue: string;
|
|
6
|
+
tokens: {
|
|
7
|
+
denom: string;
|
|
8
|
+
staked: number;
|
|
9
|
+
totalStaked: number;
|
|
10
|
+
stakedValue: number;
|
|
11
|
+
totalStakedValue: number;
|
|
12
|
+
height: number;
|
|
13
|
+
}[];
|
|
14
|
+
}
|
|
15
|
+
export interface QueryGetAlliancesStakeRequest extends QueryByTimeRequest {
|
|
16
|
+
}
|
|
17
|
+
export interface QueryGetAlliancesStakeResponse {
|
|
18
|
+
entries: AlliancesStake[];
|
|
19
|
+
meta: TimeMeta;
|
|
20
|
+
}
|
|
21
|
+
export interface AlliancesRewards {
|
|
22
|
+
date: string;
|
|
23
|
+
rewardsValue: string;
|
|
24
|
+
totalRewardsValue: string;
|
|
25
|
+
tokens: {
|
|
26
|
+
denom: string;
|
|
27
|
+
rewards: number;
|
|
28
|
+
totalRewards: number;
|
|
29
|
+
rewardsValue: number;
|
|
30
|
+
totalRewardsValue: number;
|
|
31
|
+
height: number;
|
|
32
|
+
}[];
|
|
33
|
+
}
|
|
34
|
+
export interface QueryGetAlliancesRewardsRequest extends QueryByTimeRequest {
|
|
35
|
+
}
|
|
36
|
+
export interface QueryGetAlliancesRewardsResponse {
|
|
37
|
+
entries: AlliancesRewards[];
|
|
38
|
+
meta: TimeMeta;
|
|
39
|
+
}
|
package/lib/insights/common.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export declare const InsightsEndpoints: {
|
|
|
23
23
|
"position/view": string;
|
|
24
24
|
"position/liquidation": string;
|
|
25
25
|
"position/liquidation/engine": string;
|
|
26
|
+
"position/stats": string;
|
|
26
27
|
"competition/list": string;
|
|
27
28
|
"competition/leaderboard": string;
|
|
28
29
|
"competition/leaderboardpnl": string;
|
|
@@ -33,6 +34,8 @@ export declare const InsightsEndpoints: {
|
|
|
33
34
|
"proposal/votes": string;
|
|
34
35
|
"delegations/delegator": string;
|
|
35
36
|
"info/oracles_price": string;
|
|
37
|
+
"alliances/stake": string;
|
|
38
|
+
"alliances/rewards": string;
|
|
36
39
|
};
|
|
37
40
|
export declare type Interval = "millisecond" | "second" | "minute" | "hour" | "day" | "week" | "month" | "quarter";
|
|
38
41
|
export interface QueryByTimeRequest {
|
package/lib/insights/common.js
CHANGED
|
@@ -33,6 +33,7 @@ exports.InsightsEndpoints = {
|
|
|
33
33
|
"position/view": "/position/view/:view",
|
|
34
34
|
"position/liquidation": "/position/liquidation",
|
|
35
35
|
"position/liquidation/engine": "/position/liquidation/engine",
|
|
36
|
+
"position/stats": "/position/stats/:address",
|
|
36
37
|
// Competition api
|
|
37
38
|
"competition/list": "/competition/list",
|
|
38
39
|
"competition/leaderboard": "/competition/leaderboard",
|
|
@@ -49,4 +50,7 @@ exports.InsightsEndpoints = {
|
|
|
49
50
|
"delegations/delegator": "/delegations/:delegator",
|
|
50
51
|
// Oracles api
|
|
51
52
|
"info/oracles_price": "/info/oracles_price",
|
|
53
|
+
// Alliances api
|
|
54
|
+
"alliances/stake": "/alliances/stake",
|
|
55
|
+
"alliances/rewards": "/alliances/rewards",
|
|
52
56
|
};
|
package/lib/insights/index.d.ts
CHANGED
package/lib/insights/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Entries, PageMeta, QueryByPageRequest } from "./common";
|
|
1
|
+
import { Entries, PageMeta, QueryByPageRequest, QueryByTimeRequest, TimeMeta } from "./common";
|
|
2
2
|
export interface IndivPnl {
|
|
3
3
|
address: string;
|
|
4
4
|
realizedPnl: string;
|
|
@@ -83,3 +83,20 @@ export interface QueryGetPositionsViewResponse {
|
|
|
83
83
|
entries: GetPositionsViewEntry[];
|
|
84
84
|
meta: PageMeta;
|
|
85
85
|
}
|
|
86
|
+
export interface GetPositionStatsPathParams {
|
|
87
|
+
address: string;
|
|
88
|
+
}
|
|
89
|
+
export interface GetPositionStatsQueryParams extends QueryByTimeRequest {
|
|
90
|
+
}
|
|
91
|
+
export interface GetPositionStatsEntry {
|
|
92
|
+
time: string;
|
|
93
|
+
realizedPnl: string;
|
|
94
|
+
makerRebate: string;
|
|
95
|
+
takerFee: number;
|
|
96
|
+
fundingRate: string;
|
|
97
|
+
cumulative: string;
|
|
98
|
+
}
|
|
99
|
+
export interface QueryGetPositionStatsResponse {
|
|
100
|
+
entries: GetPositionStatsEntry[];
|
|
101
|
+
meta: TimeMeta;
|
|
102
|
+
}
|