carbon-js-sdk 0.8.6 → 0.8.7

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.
@@ -34,6 +34,8 @@ declare class InsightsQueryClient {
34
34
  LeagueCompetitionLeaderboard(req: Insights.QueryGetLeagueCompetitionLeaderboardRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetLeagueCompetitionLeaderboardResponse>>;
35
35
  PoolsLiquidity(req?: Insights.QueryGetPoolsLiquidityRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolsLiquidityResponse>>;
36
36
  MarketsVolume(req?: Insights.QueryGetMarketVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetMarketVolumeResponse>>;
37
+ CarbonCreditsRewards(req: Insights.QueryCarbonCreditsRewardsRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryCarbonCreditsRewardsResponse>>;
38
+ PnlLeaderboard(req: Insights.QueryPnlLeaderboardRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryPnlLeaderboardResponse>>;
37
39
  Nodes(req?: Insights.QueryGetNodesRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetNodesResponse>>;
38
40
  BalanceTotal(req: Insights.QueryGetTotalBalanceRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetTotalBalanceResponse>>;
39
41
  BalanceList(req: Insights.QueryGetBalanceListRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetBalanceListResponse>>;
@@ -255,6 +255,29 @@ class InsightsQueryClient {
255
255
  return response.data;
256
256
  });
257
257
  }
258
+ CarbonCreditsRewards(req) {
259
+ return __awaiter(this, void 0, void 0, function* () {
260
+ const routeParams = { epoch: req.epoch, unixStart: req.unixStart };
261
+ const request = this.apiManager.path('reward/epoch', routeParams, {});
262
+ const response = yield request.get();
263
+ return response.data;
264
+ });
265
+ }
266
+ PnlLeaderboard(req) {
267
+ var _a, _b;
268
+ return __awaiter(this, void 0, void 0, function* () {
269
+ const routeParams = { unixStart: req.unixStart, unixEnd: req.unixEnd };
270
+ const queryParams = {
271
+ limit: (_a = req.limit) !== null && _a !== void 0 ? _a : 100,
272
+ market: (_b = req.market) !== null && _b !== void 0 ? _b : '',
273
+ offset: 0,
274
+ sort: 'DESC',
275
+ };
276
+ const request = this.apiManager.path('reward/leaderboard', routeParams, queryParams);
277
+ const response = yield request.get();
278
+ return response.data;
279
+ });
280
+ }
258
281
  // Node api
259
282
  Nodes(req = {}) {
260
283
  return __awaiter(this, void 0, void 0, function* () {
@@ -42,6 +42,8 @@ export declare const InsightsEndpoints: {
42
42
  "info/oracles_price": string;
43
43
  "alliances/stake": string;
44
44
  "alliances/rewards": string;
45
+ "reward/epoch": string;
46
+ "reward/leaderboard": string;
45
47
  };
46
48
  export type Interval = "millisecond" | "second" | "minute" | "hour" | "day" | "week" | "month" | "quarter";
47
49
  export interface QueryByTimeRequest {
@@ -58,4 +58,6 @@ exports.InsightsEndpoints = {
58
58
  // Alliances api
59
59
  "alliances/stake": "/alliances/stake",
60
60
  "alliances/rewards": "/alliances/rewards",
61
+ "reward/epoch": "/reward/epoch/:epoch/:blockheight",
62
+ "reward/leaderboard": "/reward/:unixStart/:unixEnd/leaderboard",
61
63
  };
@@ -1,4 +1,4 @@
1
- import { TimeMeta, PageMeta } from "./common";
1
+ import { PageMeta, TimeMeta } from "./common";
2
2
  export interface CompetitionItem {
3
3
  id: string;
4
4
  competitionId: string;
@@ -94,6 +94,18 @@ export interface LeaderboardLeagueEntry {
94
94
  derPoints: string;
95
95
  freqFactor: string;
96
96
  }
97
+ export interface PersistenceTraders {
98
+ address: string;
99
+ points: string;
100
+ rank: string;
101
+ volume: string;
102
+ }
103
+ export interface PersistenceRewardsEntry {
104
+ totalPoints: string;
105
+ epochStart: string;
106
+ epochEnd: string;
107
+ traders: PersistenceTraders[];
108
+ }
97
109
  export interface QueryGetPNLCompetitionLeaderboardResponse {
98
110
  entries: PNLLeaderboardEntry[];
99
111
  meta: TimeMeta;
@@ -115,3 +127,32 @@ export interface QueryGetLotteryCompetitionLeaderboardRequest {
115
127
  export interface QueryGetLeagueCompetitionLeaderboardRequest {
116
128
  competitionId: string;
117
129
  }
130
+ export interface QueryCarbonCreditsRewardsRequest {
131
+ epoch: number;
132
+ unixStart: number;
133
+ }
134
+ export interface QueryCarbonCreditsRewardsResponse {
135
+ result: PersistenceRewardsEntry;
136
+ }
137
+ export interface QueryPnlLeaderboardRequest {
138
+ unixStart: number;
139
+ unixEnd: number;
140
+ limit?: number;
141
+ market?: string;
142
+ }
143
+ export interface QueryPnlLeaderboardResponse {
144
+ result: {
145
+ entries: {
146
+ rows: PersistencePnl[];
147
+ };
148
+ };
149
+ }
150
+ export interface PersistencePnl {
151
+ rank: string;
152
+ address: string;
153
+ realizedPnl: string;
154
+ unrealizedPnl: string;
155
+ totalPnl: string;
156
+ profitPercent: string;
157
+ totalMargin: string;
158
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-js-sdk",
3
- "version": "0.8.6",
3
+ "version": "0.8.7",
4
4
  "description": "TypeScript SDK for Carbon blockchain",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",