carbon-js-sdk 0.7.2 → 0.7.3

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.
@@ -1,5 +1,6 @@
1
1
  import { NetworkConfig } from "../constant";
2
2
  import { Insights } from "../index";
3
+ import { InsightsQueryResponse } from "../insights";
3
4
  import { APIUtils } from "../util";
4
5
  declare class InsightsQueryClient {
5
6
  readonly apiManager: APIUtils.APIManager<typeof Insights.InsightsEndpoints>;
@@ -18,6 +19,7 @@ declare class InsightsQueryClient {
18
19
  PoolHistory(query: Insights.QueryGetPoolHistoryRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolHistoryResponse>>;
19
20
  PoolVolume(req: Insights.QueryGetPoolVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolVolumeResponse>>;
20
21
  PoolsVolume(req?: Insights.QueryGetPoolsVolumeRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolsVolumeResponse>>;
22
+ UserRewardsClaimHistory(req: Insights.QueryGetUserRewardsClaimHistoryRequest): Promise<InsightsQueryResponse<Insights.QueryGetUserRewardsClaimHistoryResponse>>;
21
23
  CompetitionList(req?: Insights.QueryGetCompetitionListRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetCompetitionListResponse>>;
22
24
  /**
23
25
  * endpoint for legacy Demex Trading volume Competition (circa. 2021-2022). Keeping this here as endpoint has not been removed.
@@ -166,6 +166,14 @@ class InsightsQueryClient {
166
166
  return response.data;
167
167
  });
168
168
  }
169
+ UserRewardsClaimHistory(req) {
170
+ return __awaiter(this, void 0, void 0, function* () {
171
+ const routeParams = { address: req.address };
172
+ const request = this.apiManager.path("user/pool/rewards", routeParams, req);
173
+ const response = yield request.get();
174
+ return response.data;
175
+ });
176
+ }
169
177
  CompetitionList(req = {}) {
170
178
  return __awaiter(this, void 0, void 0, function* () {
171
179
  const request = this.apiManager.path("competition/list", {}, req);
@@ -14,6 +14,7 @@ export declare const InsightsEndpoints: {
14
14
  "pools/volume": string;
15
15
  "pools/liquidity": string;
16
16
  "pool/history": string;
17
+ "user/pool/rewards": string;
17
18
  "market/volume": string;
18
19
  "node/list": string;
19
20
  "balance/total": string;
@@ -19,6 +19,7 @@ exports.InsightsEndpoints = {
19
19
  "pools/volume": "/pool/volume",
20
20
  "pools/liquidity": "/pool/liquidity",
21
21
  "pool/history": "/pool/history",
22
+ "user/pool/rewards": "/user/:address/pool/rewards",
22
23
  //market
23
24
  "market/volume": "/market/volume",
24
25
  // Node api
@@ -92,3 +92,23 @@ export interface QueryGetPoolHistoryResponse {
92
92
  entries: PositionHistoryEntry[];
93
93
  meta: PageMeta;
94
94
  }
95
+ export interface QueryGetUserRewardsClaimHistoryRequest extends QueryByPageRequest {
96
+ address: string;
97
+ }
98
+ export interface TokenAmounts {
99
+ denom: string;
100
+ amount: number;
101
+ amountValue: number;
102
+ }
103
+ export interface ClaimTransactionEntry {
104
+ address: string;
105
+ poolId: number;
106
+ height: number;
107
+ timestamp: string;
108
+ hash?: string;
109
+ tokens: TokenAmounts[];
110
+ }
111
+ export interface QueryGetUserRewardsClaimHistoryResponse {
112
+ entries: ClaimTransactionEntry[];
113
+ meta: PageMeta;
114
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-js-sdk",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "TypeScript SDK for Carbon blockchain",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",