carbon-js-sdk 0.11.6 → 0.11.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.
@@ -18,6 +18,8 @@ declare class InsightsQueryClient {
18
18
  UserPnl(req: Insights.QueryGetUserPnlPathParams, query: Insights.QueryGetUserPnlGraphQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetUserPnlResponse>>;
19
19
  UserBalanceGraph(req: Insights.QueryGetUserBalanceGraphPathParams, query: Insights.QueryGetUserBalanceGraphQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetUserBalanceGraphResponse>>;
20
20
  UserPnlGraph(req: Insights.QueryGetUserPnlGraphPathParams, query: Insights.QueryGetUserPnlGraphQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetUserPnlGraphResponse>>;
21
+ UserFundings(req: Insights.QueryGetUserFundingsPathParams, query: Insights.QueryGetUserFundingsQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetUserFundingsResponse>>;
22
+ UserFundingBreakdown(req: Insights.QueryGetFundingBreakdownChartPathParams, query: Insights.QueryGetFundingBreakdownChartQueryParams): Promise<Insights.InsightsQueryResponse<Insights.QueryGetFundingBreakdownChartResponse>>;
21
23
  Pools(req?: Insights.QueryGetPoolsRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolsResponse>>;
22
24
  PoolHistory(query: Insights.QueryGetPoolHistoryRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPoolHistoryResponse>>;
23
25
  PerpPoolHistory(query: Insights.QueryGetPerpPoolHistoryRequest): Promise<Insights.InsightsQueryResponse<Insights.QueryGetPerpPoolHistoryResponse>>;
@@ -140,6 +140,20 @@ class InsightsQueryClient {
140
140
  return response.data;
141
141
  });
142
142
  }
143
+ UserFundings(req, query) {
144
+ return __awaiter(this, void 0, void 0, function* () {
145
+ const request = this.apiManager.path("user/fundings", req, query);
146
+ const response = yield request.get();
147
+ return response.data;
148
+ });
149
+ }
150
+ UserFundingBreakdown(req, query) {
151
+ return __awaiter(this, void 0, void 0, function* () {
152
+ const request = this.apiManager.path("user/funding/breakdown", req, query);
153
+ const response = yield request.get();
154
+ return response.data;
155
+ });
156
+ }
143
157
  // Pool api
144
158
  Pools(req = {}) {
145
159
  return __awaiter(this, void 0, void 0, function* () {
@@ -12,6 +12,8 @@ export declare const InsightsEndpoints: {
12
12
  "user/pnl": string;
13
13
  "user/balance/graph": string;
14
14
  "user/pnl/graph": string;
15
+ "user/fundings": string;
16
+ "user/funding/breakdown": string;
15
17
  "user/connected/wallet": string;
16
18
  "pool/list": string;
17
19
  "pool/volume": string;
@@ -74,6 +76,10 @@ export interface TimeMeta {
74
76
  until: string;
75
77
  interval: Interval;
76
78
  }
79
+ export interface NoIntervalTimeMeta {
80
+ from: string;
81
+ until: string;
82
+ }
77
83
  export interface ParsedTimeMeta {
78
84
  from: Dayjs;
79
85
  until: Dayjs;
@@ -16,6 +16,8 @@ exports.InsightsEndpoints = {
16
16
  "user/pnl": "/user/:address/pnl",
17
17
  "user/balance/graph": "/user/:address/balance/graph",
18
18
  "user/pnl/graph": "/user/:address/pnl/graph",
19
+ "user/fundings": "/user/:address/fundings",
20
+ "user/funding/breakdown": "/user/:address/funding/breakdown",
19
21
  "user/connected/wallet": "/user/connected/wallet",
20
22
  // Pool api
21
23
  "pool/list": "/pool/list",
@@ -1,5 +1,5 @@
1
1
  import { Dayjs } from "dayjs";
2
- import { ParsedTimeMeta, QueryByTimeRequest, TimeMeta } from "./common";
2
+ import { ParsedTimeMeta, QueryByTimeRequest, TimeMeta, NoIntervalTimeMeta } from "./common";
3
3
  import BigNumber from "bignumber.js";
4
4
  export interface ActiveAccounts {
5
5
  date: string;
@@ -50,6 +50,15 @@ export interface RawUserPnlGraphCoordinate {
50
50
  pnl: string;
51
51
  cumulativePnl: string;
52
52
  }
53
+ export interface RawUserFundings {
54
+ time: string;
55
+ market: string;
56
+ amount: string;
57
+ }
58
+ export interface RawFundingBreakdown {
59
+ market: string;
60
+ amount: string;
61
+ }
53
62
  export interface QueryGetUserProfileRequest {
54
63
  username?: string;
55
64
  address?: string;
@@ -111,6 +120,25 @@ export interface QueryGetUserPnlGraphResponse {
111
120
  entries: RawUserPnlGraphCoordinate[];
112
121
  meta: TimeMeta;
113
122
  }
123
+ export interface QueryGetUserFundingsPathParams {
124
+ address: string;
125
+ }
126
+ export interface QueryGetUserFundingsQueryParams extends QueryByTimeRequest {
127
+ }
128
+ export interface QueryGetUserFundingsResponse {
129
+ entries: RawUserFundings[];
130
+ meta: NoIntervalTimeMeta;
131
+ }
132
+ export interface QueryGetFundingBreakdownChartPathParams {
133
+ address: string;
134
+ }
135
+ export interface QueryGetFundingBreakdownChartQueryParams extends QueryByTimeRequest {
136
+ }
137
+ export interface QueryGetFundingBreakdownChartResponse {
138
+ paid: RawFundingBreakdown[];
139
+ received: RawFundingBreakdown[];
140
+ meta: NoIntervalTimeMeta;
141
+ }
114
142
  export interface ConnectedWalletParams {
115
143
  address: string;
116
144
  walletType: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-js-sdk",
3
- "version": "0.11.6",
3
+ "version": "0.11.7",
4
4
  "description": "TypeScript SDK for Carbon blockchain",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",