@reyaxyz/api-sdk 0.14.0 → 0.16.0

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.
@@ -19,6 +19,7 @@ var constants_1 = require("./helpers/constants");
19
19
  var markets_1 = __importDefault(require("./modules/markets"));
20
20
  var account_1 = __importDefault(require("./modules/account"));
21
21
  var trade_simulation_1 = __importDefault(require("./modules/trade.simulation"));
22
+ var lp_1 = __importDefault(require("./modules/lp"));
22
23
  /**
23
24
  * @description Client for API
24
25
  */
@@ -28,6 +29,7 @@ var ApiClient = /** @class */ (function () {
28
29
  ApiClient.config = __assign(__assign({}, ApiClient.config), config);
29
30
  this._markets = new markets_1.default(this.apiEndpoint);
30
31
  this._account = new account_1.default(this.apiEndpoint);
32
+ this._lp = new lp_1.default(this.apiEndpoint);
31
33
  this._trade_simulation = new trade_simulation_1.default();
32
34
  }
33
35
  ApiClient.configure = function (config) {
@@ -88,6 +90,23 @@ var ApiClient = /** @class */ (function () {
88
90
  enumerable: false,
89
91
  configurable: true
90
92
  });
93
+ Object.defineProperty(ApiClient, "lp", {
94
+ /**
95
+ * Gets the current instance of the LpClient from the ApiClient.
96
+ *
97
+ * This static getter allows access to the LpClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the LpClient directly, bypassing the need to manually access the internal `_lp` property of the ApiClient instance.
98
+ *
99
+ * @returns {LpClient} The LpClient instance currently held by the ApiClient.
100
+ * @example
101
+ * // Assuming ApiClient and LpClient are properly set up
102
+ * const lpClient = ApiClient.lp;
103
+ */
104
+ get: function () {
105
+ return ApiClient.getInstance()._lp;
106
+ },
107
+ enumerable: false,
108
+ configurable: true
109
+ });
91
110
  ApiClient.config = {
92
111
  production: true, // default value
93
112
  timeout: constants_1.API_TIMEOUT, // default value, e.g., 5000 milliseconds
@@ -1 +1 @@
1
- {"version":3,"file":"api-client.js","sourceRoot":"/","sources":["clients/api-client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA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,GAAkB;QACrC,UAAU,EAAE,IAAI,EAAE,gBAAgB;QAClC,OAAO,EAAE,uBAAW,EAAE,yCAAyC;KAChE,CAAC;IAmEJ,gBAAC;CAAA,AAxED,IAwEC;AAxEY,8BAAS","sourcesContent":["import {\n ServiceConfig,\n API_TIMEOUT,\n API_TESTNET,\n API_PRODUCTION,\n} from './helpers/constants';\nimport MarketsClient from './modules/markets';\nimport AccountClient from './modules/account';\nimport TradeSimulationClient from './modules/trade.simulation';\n\n/**\n * @description Client for API\n */\nexport class ApiClient {\n private static instance: ApiClient;\n private static config: ServiceConfig = {\n production: true, // default value\n timeout: API_TIMEOUT, // default value, e.g., 5000 milliseconds\n };\n private readonly apiEndpoint: string;\n private readonly _markets: MarketsClient;\n private readonly _account: AccountClient;\n private readonly _trade_simulation: TradeSimulationClient;\n\n private constructor(config: ServiceConfig) {\n this.apiEndpoint = config.production ? API_PRODUCTION : API_TESTNET;\n ApiClient.config = { ...ApiClient.config, ...config };\n this._markets = new MarketsClient(this.apiEndpoint);\n this._account = new AccountClient(this.apiEndpoint);\n this._trade_simulation = new TradeSimulationClient();\n }\n\n public static configure(config: ServiceConfig): void {\n ApiClient.config = config;\n ApiClient.instance = new ApiClient(config);\n }\n\n private static getInstance(): ApiClient {\n if (!ApiClient.instance) {\n throw new Error(\n 'ApiClient is not configured. Please configure it before using.',\n );\n }\n return ApiClient.instance;\n }\n\n /**\n * Provides access to the MarketsClient instance.\n * This getter allows for interacting with market-related API functionalities.\n *\n * @returns {MarketsClient} An instance of MarketsClient for market-related operations.\n * @memberof ApiClient\n */\n public static get markets(): MarketsClient {\n return ApiClient.getInstance()._markets;\n }\n\n /**\n * Provides access to the AccountClient instance.\n * This getter allows for interacting with account-related API functionalities.\n *\n * @returns {AccountClient} An instance of AccountClient for account-related operations.\n * @memberof ApiClient\n */\n public static get account(): AccountClient {\n return ApiClient.getInstance()._account;\n }\n\n /**\n * Provides access to the TradeSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_trade_simulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {TradeSimulationClient} An instance of TradeSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the trade simulation client from the ApiClient\n * const tradeSimulationClient = ApiClient.tradeSimulation;\n */\n\n public static get tradeSimulation(): TradeSimulationClient {\n return ApiClient.getInstance()._trade_simulation;\n }\n}\n"]}
1
+ {"version":3,"file":"api-client.js","sourceRoot":"/","sources":["clients/api-client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iDAK6B;AAC7B,8DAA8C;AAC9C,8DAA8C;AAC9C,gFAA+D;AAC/D,oDAAoC;AAEpC;;GAEG;AACH;IAYE,mBAAoB,MAAqB;QACvC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,0BAAc,CAAC,CAAC,CAAC,uBAAW,CAAC;QACpE,SAAS,CAAC,MAAM,yBAAQ,SAAS,CAAC,MAAM,GAAK,MAAM,CAAE,CAAC;QACtD,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACpD,IAAI,CAAC,QAAQ,GAAG,IAAI,iBAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACpD,IAAI,CAAC,GAAG,GAAG,IAAI,YAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC1C,IAAI,CAAC,iBAAiB,GAAG,IAAI,0BAAqB,EAAE,CAAC;IACvD,CAAC;IAEa,mBAAS,GAAvB,UAAwB,MAAqB;QAC3C,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC;QAC1B,SAAS,CAAC,QAAQ,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IAEc,qBAAW,GAA1B;QACE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CACb,gEAAgE,CACjE,CAAC;QACJ,CAAC;QACD,OAAO,SAAS,CAAC,QAAQ,CAAC;IAC5B,CAAC;IASD,sBAAkB,oBAAO;QAPzB;;;;;;WAMG;aACH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;QAC1C,CAAC;;;OAAA;IASD,sBAAkB,oBAAO;QAPzB;;;;;;WAMG;aACH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC;QAC1C,CAAC;;;OAAA;IAgBD,sBAAkB,4BAAe;QAdjC;;;;;;;;;;;;WAYG;aAEH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,iBAAiB,CAAC;QACnD,CAAC;;;OAAA;IAYD,sBAAkB,eAAE;QAVpB;;;;;;;;;WASG;aACH;YACE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC;QACrC,CAAC;;;OAAA;IArFc,gBAAM,GAAkB;QACrC,UAAU,EAAE,IAAI,EAAE,gBAAgB;QAClC,OAAO,EAAE,uBAAW,EAAE,yCAAyC;KAChE,CAAC;IAmFJ,gBAAC;CAAA,AAxFD,IAwFC;AAxFY,8BAAS","sourcesContent":["import {\n ServiceConfig,\n API_TIMEOUT,\n API_TESTNET,\n API_PRODUCTION,\n} from './helpers/constants';\nimport MarketsClient from './modules/markets';\nimport AccountClient from './modules/account';\nimport TradeSimulationClient from './modules/trade.simulation';\nimport LpClient from './modules/lp';\n\n/**\n * @description Client for API\n */\nexport class ApiClient {\n private static instance: ApiClient;\n private static config: ServiceConfig = {\n production: true, // default value\n timeout: API_TIMEOUT, // default value, e.g., 5000 milliseconds\n };\n private readonly apiEndpoint: string;\n private readonly _markets: MarketsClient;\n private readonly _account: AccountClient;\n private readonly _lp: LpClient;\n private readonly _trade_simulation: TradeSimulationClient;\n\n private constructor(config: ServiceConfig) {\n this.apiEndpoint = config.production ? API_PRODUCTION : API_TESTNET;\n ApiClient.config = { ...ApiClient.config, ...config };\n this._markets = new MarketsClient(this.apiEndpoint);\n this._account = new AccountClient(this.apiEndpoint);\n this._lp = new LpClient(this.apiEndpoint);\n this._trade_simulation = new TradeSimulationClient();\n }\n\n public static configure(config: ServiceConfig): void {\n ApiClient.config = config;\n ApiClient.instance = new ApiClient(config);\n }\n\n private static getInstance(): ApiClient {\n if (!ApiClient.instance) {\n throw new Error(\n 'ApiClient is not configured. Please configure it before using.',\n );\n }\n return ApiClient.instance;\n }\n\n /**\n * Provides access to the MarketsClient instance.\n * This getter allows for interacting with market-related API functionalities.\n *\n * @returns {MarketsClient} An instance of MarketsClient for market-related operations.\n * @memberof ApiClient\n */\n public static get markets(): MarketsClient {\n return ApiClient.getInstance()._markets;\n }\n\n /**\n * Provides access to the AccountClient instance.\n * This getter allows for interacting with account-related API functionalities.\n *\n * @returns {AccountClient} An instance of AccountClient for account-related operations.\n * @memberof ApiClient\n */\n public static get account(): AccountClient {\n return ApiClient.getInstance()._account;\n }\n\n /**\n * Provides access to the TradeSimulationClient instance.\n * This getter allows for interacting with trade simulation functionalities.\n * It ensures a singleton pattern by fetching the instance from the ApiClient's\n * private `_trade_simulation` property, ensuring that trade simulation operations\n * use a consistent client configuration and state.\n *\n * @returns {TradeSimulationClient} An instance of TradeSimulationClient for trade simulation operations.\n * @memberof ApiClient\n * @example\n * // Access the trade simulation client from the ApiClient\n * const tradeSimulationClient = ApiClient.tradeSimulation;\n */\n\n public static get tradeSimulation(): TradeSimulationClient {\n return ApiClient.getInstance()._trade_simulation;\n }\n\n /**\n * Gets the current instance of the LpClient from the ApiClient.\n *\n * This static getter allows access to the LpClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the LpClient directly, bypassing the need to manually access the internal `_lp` property of the ApiClient instance.\n *\n * @returns {LpClient} The LpClient instance currently held by the ApiClient.\n * @example\n * // Assuming ApiClient and LpClient are properly set up\n * const lpClient = ApiClient.lp;\n */\n public static get lp(): LpClient {\n return ApiClient.getInstance()._lp;\n }\n}\n"]}
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ var __importDefault = (this && this.__importDefault) || function (mod) {
54
+ return (mod && mod.__esModule) ? mod : { "default": mod };
55
+ };
56
+ Object.defineProperty(exports, "__esModule", { value: true });
57
+ var rest_1 = __importDefault(require("./rest"));
58
+ var LpClient = /** @class */ (function (_super) {
59
+ __extends(LpClient, _super);
60
+ function LpClient() {
61
+ return _super !== null && _super.apply(this, arguments) || this;
62
+ }
63
+ LpClient.prototype.getLpPools = function () {
64
+ return __awaiter(this, void 0, void 0, function () {
65
+ var uri;
66
+ return __generator(this, function (_a) {
67
+ uri = '/api/lp-pools';
68
+ return [2 /*return*/, this.get(uri)];
69
+ });
70
+ });
71
+ };
72
+ LpClient.prototype.getLpPool = function (params) {
73
+ return __awaiter(this, void 0, void 0, function () {
74
+ var uri;
75
+ return __generator(this, function (_a) {
76
+ uri = "/api/lp-pools/".concat(params.id);
77
+ return [2 /*return*/, this.get(uri)];
78
+ });
79
+ });
80
+ };
81
+ LpClient.prototype.getLpPoolTransactionHistory = function (params) {
82
+ return __awaiter(this, void 0, void 0, function () {
83
+ var uri;
84
+ return __generator(this, function (_a) {
85
+ uri = "/api/lp-pools/".concat(params.id, "/transaction-history");
86
+ return [2 /*return*/, this.get(uri, {
87
+ limit: params.limit,
88
+ })];
89
+ });
90
+ });
91
+ };
92
+ LpClient.prototype.getLpPositions = function (params) {
93
+ return __awaiter(this, void 0, void 0, function () {
94
+ var uri;
95
+ return __generator(this, function (_a) {
96
+ uri = "/api/lp-pools/".concat(params.id, "/positions");
97
+ return [2 /*return*/, this.get(uri)];
98
+ });
99
+ });
100
+ };
101
+ return LpClient;
102
+ }(rest_1.default));
103
+ exports.default = LpClient;
104
+ //# sourceMappingURL=lp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lp.js","sourceRoot":"/","sources":["clients/modules/lp.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,gDAAgC;AAEhC;IAAsC,4BAAU;IAAhD;;IA0BA,CAAC;IAzBO,6BAAU,GAAhB;;;;gBACQ,GAAG,GAAG,eAAe,CAAC;gBAC5B,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAC;;;KACtB;IAEK,4BAAS,GAAf,UAAgB,MAAuB;;;;gBAC/B,GAAG,GAAG,wBAAiB,MAAM,CAAC,EAAE,CAAE,CAAC;gBACzC,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAC;;;KACtB;IAEK,8CAA2B,GAAjC,UACE,MAAyC;;;;gBAEnC,GAAG,GAAG,wBAAiB,MAAM,CAAC,EAAE,yBAAsB,CAAC;gBAC7D,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;wBACnB,KAAK,EAAE,MAAM,CAAC,KAAK;qBACpB,CAAC,EAAC;;;KACJ;IAEK,iCAAc,GAApB,UACE,MAA+B;;;;gBAEzB,GAAG,GAAG,wBAAiB,MAAM,CAAC,EAAE,eAAY,CAAC;gBACnD,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAC;;;KACtB;IACH,eAAC;AAAD,CAAC,AA1BD,CAAsC,cAAU,GA0B/C","sourcesContent":["import {\n GetLpPoolParams,\n GetLpPoolPositionParams,\n GetLpPoolResult,\n GetLpPoolsResult,\n GetLpPoolTransactionHistoryParams,\n GetLpPoolTransactionHistoryResult,\n GetLpPositionsResult,\n} from '../types';\nimport RestClient from './rest';\n\nexport default class LpClient extends RestClient {\n async getLpPools(): Promise<GetLpPoolsResult> {\n const uri = '/api/lp-pools';\n return this.get(uri);\n }\n\n async getLpPool(params: GetLpPoolParams): Promise<GetLpPoolResult> {\n const uri = `/api/lp-pools/${params.id}`;\n return this.get(uri);\n }\n\n async getLpPoolTransactionHistory(\n params: GetLpPoolTransactionHistoryParams,\n ): Promise<GetLpPoolTransactionHistoryResult> {\n const uri = `/api/lp-pools/${params.id}/transaction-history`;\n return this.get(uri, {\n limit: params.limit,\n });\n }\n\n async getLpPositions(\n params: GetLpPoolPositionParams,\n ): Promise<GetLpPositionsResult> {\n const uri = `/api/lp-pools/${params.id}/positions`;\n return this.get(uri);\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CandlesResolution = void 0;
3
+ exports.SupportedChainId = exports.CandlesResolution = void 0;
4
4
  var CandlesResolution;
5
5
  (function (CandlesResolution) {
6
6
  CandlesResolution["ONE_MINUTE"] = "1MIN";
@@ -11,4 +11,10 @@ var CandlesResolution;
11
11
  CandlesResolution["FOUR_HOURS"] = "4HOURS";
12
12
  CandlesResolution["ONE_DAY"] = "1DAY";
13
13
  })(CandlesResolution || (exports.CandlesResolution = CandlesResolution = {}));
14
+ // ---- LP ----
15
+ var SupportedChainId;
16
+ (function (SupportedChainId) {
17
+ SupportedChainId[SupportedChainId["mainnet"] = 1] = "mainnet";
18
+ SupportedChainId[SupportedChainId["polygonMumbai"] = 80001] = "polygonMumbai";
19
+ })(SupportedChainId || (exports.SupportedChainId = SupportedChainId = {}));
14
20
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/types.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAQX;AARD,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,2CAAsB,CAAA;IACtB,+CAA0B,CAAA;IAC1B,8CAAyB,CAAA;IACzB,uCAAkB,CAAA;IAClB,0CAAqB,CAAA;IACrB,qCAAgB,CAAA;AAClB,CAAC,EARW,iBAAiB,iCAAjB,iBAAiB,QAQ5B","sourcesContent":["export enum CandlesResolution {\n ONE_MINUTE = '1MIN',\n FIVE_MINUTES = '5MINS',\n FIFTEEN_MINUTES = '15MINS',\n THIRTY_MINUTES = '30MINS',\n ONE_HOUR = '1HOUR',\n FOUR_HOURS = '4HOURS',\n ONE_DAY = '1DAY',\n}\n\n// -- Candles --\nexport interface Candle {\n startedAt: string;\n ticker: string;\n resolution: CandlesResolution;\n low: string;\n high: string;\n open: string;\n close: string;\n baseTokenVolume: string;\n usdVolume: string;\n trades: number;\n startingOpenInterest: string;\n id: string;\n}\n\nexport interface MarketCandlesResponse {\n candles: Candle[];\n}\n\n// -- Markets --\n\nexport type MarketOrderInfo = {\n counterpartyAccountIds: number[];\n exchangeId: number;\n};\n\nexport type MarketEntity = {\n id: number;\n ticker: string;\n underlyingAsset: string;\n quoteToken: string;\n markPrice: number;\n isActive: boolean;\n maxLeverage: number;\n volume24H: number;\n priceChange24H: number;\n priceChange24HPercentage: number;\n openInterest: number;\n fundingRate: number;\n description: string;\n orderInfo: MarketOrderInfo;\n tickSizeDecimals: number;\n};\n\nexport type GetMarketsResult = MarketEntity[];\n\nexport type GetMarketResult = MarketEntity;\n\nexport type GetMarketParams = {\n id: MarketEntity['id'];\n};\n\nexport type GetCandlesParams = {\n marketId: MarketEntity['id'];\n resolution: CandlesResolution;\n fromISO?: string | null;\n toISO?: string | null;\n limit?: number | null;\n};\n\n// -- Account --\n\nexport type Status = 'OPEN' | 'CLOSED' | 'LIQUIDATED' | 'FILLED';\nexport type Side = 'LONG' | 'SHORT';\n\nexport type GetMarginAccountsParams = {\n address: string;\n limit?: number;\n};\n\nexport type GetMarginAccountParams = {\n address: string;\n marginAccountId: MarginAccountEntity['id'];\n};\n\nexport type GetPositionsForMarginAccountParams = {\n address: string;\n marginAccountId: MarginAccountEntity['id'];\n limit?: number;\n};\n\nexport type MarginAccountEntity = {\n id: number;\n name: string;\n marginRatioHealth: 'danger' | 'healthy' | 'warning';\n marginRatioPercentage: number;\n totalBalance: number;\n totalBalanceUnderlyingAsset: string;\n collaterals: {\n token: string;\n percentage: number;\n balance: number;\n balanceRUSD: number;\n }[];\n};\n\nexport type GetMarginAccountsResult = MarginAccountEntity[];\nexport type GetMarginAccountResult = MarginAccountEntity;\n\nexport type PositionEntity = {\n id: number;\n side: Side;\n size: number;\n base: number;\n price: number;\n markPrice: number;\n orderStatus: Status;\n realisedPnl?: number | null;\n unrealisedPnl?: number | null;\n liquidationPrice: number;\n fundingRate: number;\n market: MarketEntity;\n date: Date;\n};\n\nexport type GetPositionsForMarginAccountResult = {\n positions: PositionEntity[];\n totalUnrealizedPNL: number;\n};\n\n// --- Trading History ----\n\nexport type GetMarketTradingHistoryParams = {\n marketId: number;\n limit?: number;\n};\n\nexport type TradingHistoryEntity = {\n id: number;\n price: number;\n priceUnderlyingToken: string;\n size: number;\n sizeUnderlyingToken: string;\n timestampMillisecondsUTC: number;\n};\n\nexport type GetTradingHistoryResult = TradingHistoryEntity[];\n\n// --- Position History ---\n\nexport type GetPositionsHistoryForMarginAccountParams = {\n address: string;\n marginAccountId: MarginAccountEntity['id'];\n limit?: number;\n};\n\nexport type OrderType = 'market';\n\nexport type PositionHistoryType =\n | 'long-trade'\n | 'short-trade'\n | 'long-liquidation'\n | 'short-liquidation';\n\nexport type PositionHistoryEntity = {\n id: number;\n action: PositionHistoryType;\n orderType: OrderType;\n size: number;\n executionPrice: number;\n realisedPnl?: number | null;\n fees: number;\n timestamp: number;\n market: MarketEntity;\n};\n\nexport type GetPositionsHistoryForMarginAccountResult = PositionHistoryEntity[];\n\n// -- Max Order Size --\n\nexport type GetMaxOrderSizeAvailableParams = {\n marketId: MarketEntity['id'];\n marginAccountId: MarginAccountEntity['id'];\n direction: 'long' | 'short';\n};\n\nexport type GetMaxOrderSizeAvailableResult = number;\n\n// --- Trade Simulation ----\n\nexport type SimulateTradeEntity = {\n liquidationPrice: number;\n fees: number;\n estimatedPrice: number;\n estimatedSlippage: number;\n imr: number;\n impliedLeverage: number;\n marginRatio: MarginAccountEntity['marginRatioPercentage'];\n marginRatioHealth: MarginAccountEntity['marginRatioHealth'];\n};\n\nexport type TradeSimulationLoadDataParams = {\n market_id: MarketEntity['id'];\n marginAccountId: MarginAccountEntity['id'];\n};\n\nexport type TradeSimulationSimulateParams = {\n amount: number; // position size, + for long | - for short\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/types.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAQX;AARD,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,2CAAsB,CAAA;IACtB,+CAA0B,CAAA;IAC1B,8CAAyB,CAAA;IACzB,uCAAkB,CAAA;IAClB,0CAAqB,CAAA;IACrB,qCAAgB,CAAA;AAClB,CAAC,EARW,iBAAiB,iCAAjB,iBAAiB,QAQ5B;AA2MD,eAAe;AAEf,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,6DAAW,CAAA;IACX,6EAAqB,CAAA;AACvB,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B","sourcesContent":["export enum CandlesResolution {\n ONE_MINUTE = '1MIN',\n FIVE_MINUTES = '5MINS',\n FIFTEEN_MINUTES = '15MINS',\n THIRTY_MINUTES = '30MINS',\n ONE_HOUR = '1HOUR',\n FOUR_HOURS = '4HOURS',\n ONE_DAY = '1DAY',\n}\n\n// -- Candles --\nexport interface Candle {\n startedAt: string;\n ticker: string;\n resolution: CandlesResolution;\n low: string;\n high: string;\n open: string;\n close: string;\n baseTokenVolume: string;\n usdVolume: string;\n trades: number;\n startingOpenInterest: string;\n id: string;\n}\n\nexport interface MarketCandlesResponse {\n candles: Candle[];\n}\n\n// -- Markets --\n\nexport type MarketOrderInfo = {\n counterpartyAccountIds: number[];\n exchangeId: number;\n};\n\nexport type MarketEntity = {\n id: number;\n ticker: string;\n underlyingAsset: string;\n quoteToken: string;\n markPrice: number;\n isActive: boolean;\n maxLeverage: number;\n volume24H: number;\n priceChange24H: number;\n priceChange24HPercentage: number;\n openInterest: number;\n fundingRate: number;\n description: string;\n orderInfo: MarketOrderInfo;\n tickSizeDecimals: number;\n};\n\nexport type GetMarketsResult = MarketEntity[];\n\nexport type GetMarketResult = MarketEntity;\n\nexport type GetMarketParams = {\n id: MarketEntity['id'];\n};\n\nexport type GetCandlesParams = {\n marketId: MarketEntity['id'];\n resolution: CandlesResolution;\n fromISO?: string | null;\n toISO?: string | null;\n limit?: number | null;\n};\n\n// -- Account --\n\nexport type Status = 'OPEN' | 'CLOSED' | 'LIQUIDATED' | 'FILLED';\nexport type Side = 'LONG' | 'SHORT';\n\nexport type GetMarginAccountsParams = {\n address: string;\n limit?: number;\n};\n\nexport type GetMarginAccountParams = {\n address: string;\n marginAccountId: MarginAccountEntity['id'];\n};\n\nexport type GetPositionsForMarginAccountParams = {\n address: string;\n marginAccountId: MarginAccountEntity['id'];\n limit?: number;\n};\n\nexport type MarginAccountEntity = {\n id: number;\n name: string;\n marginRatioHealth: 'danger' | 'healthy' | 'warning';\n marginRatioPercentage: number;\n totalBalance: number;\n totalBalanceUnderlyingAsset: string;\n collaterals: {\n token: string;\n percentage: number;\n balance: number;\n balanceRUSD: number;\n }[];\n};\n\nexport type GetMarginAccountsResult = MarginAccountEntity[];\nexport type GetMarginAccountResult = MarginAccountEntity;\n\nexport type PositionEntity = {\n id: number;\n side: Side;\n size: number;\n base: number;\n price: number;\n markPrice: number;\n orderStatus: Status;\n realisedPnl?: number | null;\n unrealisedPnl?: number | null;\n liquidationPrice: number;\n fundingRate: number;\n market: MarketEntity;\n date: Date;\n};\n\nexport type GetPositionsForMarginAccountResult = {\n positions: PositionEntity[];\n totalUnrealizedPNL: number;\n};\n\n// --- Trading History ----\n\nexport type GetMarketTradingHistoryParams = {\n marketId: number;\n limit?: number;\n};\n\nexport type TradingHistoryEntity = {\n id: number;\n price: number;\n priceUnderlyingToken: string;\n size: number;\n sizeUnderlyingToken: string;\n timestampMillisecondsUTC: number;\n};\n\nexport type GetTradingHistoryResult = TradingHistoryEntity[];\n\n// --- Position History ---\n\nexport type GetPositionsHistoryForMarginAccountParams = {\n address: string;\n marginAccountId: MarginAccountEntity['id'];\n limit?: number;\n};\n\nexport type OrderType = 'market';\n\nexport type PositionHistoryType =\n | 'long-trade'\n | 'short-trade'\n | 'long-liquidation'\n | 'short-liquidation';\n\nexport type PositionHistoryEntity = {\n id: number;\n action: PositionHistoryType;\n orderType: OrderType;\n size: number;\n executionPrice: number;\n realisedPnl?: number | null;\n fees: number;\n timestamp: number;\n market: MarketEntity;\n};\n\nexport type GetPositionsHistoryForMarginAccountResult = PositionHistoryEntity[];\n\n// -- Max Order Size --\n\nexport type GetMaxOrderSizeAvailableParams = {\n marketId: MarketEntity['id'];\n marginAccountId: MarginAccountEntity['id'];\n direction: 'long' | 'short';\n};\n\nexport type GetMaxOrderSizeAvailableResult = number;\n\n// --- Trade Simulation ----\n\nexport type SimulateTradeEntity = {\n liquidationPrice: number;\n fees: number;\n estimatedPrice: number;\n estimatedSlippage: number;\n imr: number;\n impliedLeverage: number;\n marginRatio: MarginAccountEntity['marginRatioPercentage'];\n marginRatioHealth: MarginAccountEntity['marginRatioHealth'];\n};\n\nexport type TradeSimulationLoadDataParams = {\n market_id: MarketEntity['id'];\n marginAccountId: MarginAccountEntity['id'];\n};\n\nexport type TradeSimulationSimulateParams = {\n amount: number; // position size, + for long | - for short\n};\n\n// ---- LP ----\n\nexport enum SupportedChainId {\n mainnet = 1,\n polygonMumbai = 80001,\n}\n\nexport type LpPoolEntity = {\n id: number;\n name: string;\n description: string;\n currentAPY: number;\n balanceSupplied?: number | null;\n balanceChange24H: number;\n tokenAddress: string;\n token: string;\n allowedChainsForLiquidity: number[];\n chainId: SupportedChainId;\n};\n\nexport type GetLpPoolsResult = LpPoolEntity[];\n\nexport type GetLpPoolResult = LpPoolEntity;\n\nexport type GetLpPoolParams = {\n id: LpPoolEntity['id'];\n};\n\nexport type TransactionHistoryType = 'deposit' | 'withdrawal';\n\nexport type LpTransactionHistoryEntity = {\n id: number;\n type: TransactionHistoryType;\n token: string;\n amount: number;\n transactionHash: string;\n timestamp: number;\n};\n\nexport type GetLpPoolTransactionHistoryParams = {\n id: LpPoolEntity['id'];\n limit?: number;\n};\n\nexport type GetLpPoolTransactionHistoryResult = LpTransactionHistoryEntity[];\n\nexport type GetLpPoolPositionParams = {\n id: LpPoolEntity['id'];\n};\n\nexport type LpPositionEntity = {\n id: number;\n deposited: number;\n currentBalance: number;\n pnl: number;\n fundingRate: number;\n};\n\nexport type GetLpPositionsResult = LpPositionEntity[];\n"]}
@@ -2,6 +2,7 @@ import { ServiceConfig } from './helpers/constants';
2
2
  import MarketsClient from './modules/markets';
3
3
  import AccountClient from './modules/account';
4
4
  import TradeSimulationClient from './modules/trade.simulation';
5
+ import LpClient from './modules/lp';
5
6
  /**
6
7
  * @description Client for API
7
8
  */
@@ -11,6 +12,7 @@ export declare class ApiClient {
11
12
  private readonly apiEndpoint;
12
13
  private readonly _markets;
13
14
  private readonly _account;
15
+ private readonly _lp;
14
16
  private readonly _trade_simulation;
15
17
  private constructor();
16
18
  static configure(config: ServiceConfig): void;
@@ -45,5 +47,16 @@ export declare class ApiClient {
45
47
  * const tradeSimulationClient = ApiClient.tradeSimulation;
46
48
  */
47
49
  static get tradeSimulation(): TradeSimulationClient;
50
+ /**
51
+ * Gets the current instance of the LpClient from the ApiClient.
52
+ *
53
+ * This static getter allows access to the LpClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the LpClient directly, bypassing the need to manually access the internal `_lp` property of the ApiClient instance.
54
+ *
55
+ * @returns {LpClient} The LpClient instance currently held by the ApiClient.
56
+ * @example
57
+ * // Assuming ApiClient and LpClient are properly set up
58
+ * const lpClient = ApiClient.lp;
59
+ */
60
+ static get lp(): LpClient;
48
61
  }
49
62
  //# sourceMappingURL=api-client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-client.d.ts","sourceRoot":"/","sources":["clients/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAId,MAAM,qBAAqB,CAAC;AAC7B,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAE/D;;GAEG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAY;IACnC,OAAO,CAAC,MAAM,CAAC,MAAM,CAGnB;IACF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;IACzC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;IACzC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAwB;IAE1D,OAAO;WAQO,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAKpD,OAAO,CAAC,MAAM,CAAC,WAAW;IAS1B;;;;;;OAMG;IACH,WAAkB,OAAO,IAAI,aAAa,CAEzC;IAED;;;;;;OAMG;IACH,WAAkB,OAAO,IAAI,aAAa,CAEzC;IAED;;;;;;;;;;;;OAYG;IAEH,WAAkB,eAAe,IAAI,qBAAqB,CAEzD;CACF"}
1
+ {"version":3,"file":"api-client.d.ts","sourceRoot":"/","sources":["clients/api-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAId,MAAM,qBAAqB,CAAC;AAC7B,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAC/D,OAAO,QAAQ,MAAM,cAAc,CAAC;AAEpC;;GAEG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAY;IACnC,OAAO,CAAC,MAAM,CAAC,MAAM,CAGnB;IACF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;IACzC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;IACzC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAW;IAC/B,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAwB;IAE1D,OAAO;WASO,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAKpD,OAAO,CAAC,MAAM,CAAC,WAAW;IAS1B;;;;;;OAMG;IACH,WAAkB,OAAO,IAAI,aAAa,CAEzC;IAED;;;;;;OAMG;IACH,WAAkB,OAAO,IAAI,aAAa,CAEzC;IAED;;;;;;;;;;;;OAYG;IAEH,WAAkB,eAAe,IAAI,qBAAqB,CAEzD;IAED;;;;;;;;;OASG;IACH,WAAkB,EAAE,IAAI,QAAQ,CAE/B;CACF"}
@@ -0,0 +1,9 @@
1
+ import { GetLpPoolParams, GetLpPoolPositionParams, GetLpPoolResult, GetLpPoolsResult, GetLpPoolTransactionHistoryParams, GetLpPoolTransactionHistoryResult, GetLpPositionsResult } from '../types';
2
+ import RestClient from './rest';
3
+ export default class LpClient extends RestClient {
4
+ getLpPools(): Promise<GetLpPoolsResult>;
5
+ getLpPool(params: GetLpPoolParams): Promise<GetLpPoolResult>;
6
+ getLpPoolTransactionHistory(params: GetLpPoolTransactionHistoryParams): Promise<GetLpPoolTransactionHistoryResult>;
7
+ getLpPositions(params: GetLpPoolPositionParams): Promise<GetLpPositionsResult>;
8
+ }
9
+ //# sourceMappingURL=lp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lp.d.ts","sourceRoot":"/","sources":["clients/modules/lp.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,iCAAiC,EACjC,iCAAiC,EACjC,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAClB,OAAO,UAAU,MAAM,QAAQ,CAAC;AAEhC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,UAAU;IACxC,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAKvC,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAK5D,2BAA2B,CAC/B,MAAM,EAAE,iCAAiC,GACxC,OAAO,CAAC,iCAAiC,CAAC;IAOvC,cAAc,CAClB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,oBAAoB,CAAC;CAIjC"}
@@ -162,4 +162,50 @@ export type TradeSimulationLoadDataParams = {
162
162
  export type TradeSimulationSimulateParams = {
163
163
  amount: number;
164
164
  };
165
+ export declare enum SupportedChainId {
166
+ mainnet = 1,
167
+ polygonMumbai = 80001
168
+ }
169
+ export type LpPoolEntity = {
170
+ id: number;
171
+ name: string;
172
+ description: string;
173
+ currentAPY: number;
174
+ balanceSupplied?: number | null;
175
+ balanceChange24H: number;
176
+ tokenAddress: string;
177
+ token: string;
178
+ allowedChainsForLiquidity: number[];
179
+ chainId: SupportedChainId;
180
+ };
181
+ export type GetLpPoolsResult = LpPoolEntity[];
182
+ export type GetLpPoolResult = LpPoolEntity;
183
+ export type GetLpPoolParams = {
184
+ id: LpPoolEntity['id'];
185
+ };
186
+ export type TransactionHistoryType = 'deposit' | 'withdrawal';
187
+ export type LpTransactionHistoryEntity = {
188
+ id: number;
189
+ type: TransactionHistoryType;
190
+ token: string;
191
+ amount: number;
192
+ transactionHash: string;
193
+ timestamp: number;
194
+ };
195
+ export type GetLpPoolTransactionHistoryParams = {
196
+ id: LpPoolEntity['id'];
197
+ limit?: number;
198
+ };
199
+ export type GetLpPoolTransactionHistoryResult = LpTransactionHistoryEntity[];
200
+ export type GetLpPoolPositionParams = {
201
+ id: LpPoolEntity['id'];
202
+ };
203
+ export type LpPositionEntity = {
204
+ id: number;
205
+ deposited: number;
206
+ currentBalance: number;
207
+ pnl: number;
208
+ fundingRate: number;
209
+ };
210
+ export type GetLpPositionsResult = LpPositionEntity[];
165
211
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/types.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,UAAU,SAAS;IACnB,YAAY,UAAU;IACtB,eAAe,WAAW;IAC1B,cAAc,WAAW;IACzB,QAAQ,UAAU;IAClB,UAAU,WAAW;IACrB,OAAO,SAAS;CACjB;AAGD,MAAM,WAAW,MAAM;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,iBAAiB,CAAC;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,oBAAoB,EAAE,MAAM,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAID,MAAM,MAAM,eAAe,GAAG;IAC5B,sBAAsB,EAAE,MAAM,EAAE,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;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package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reyaxyz/api-sdk",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -36,5 +36,5 @@
36
36
  "axios": "^1.6.2"
37
37
  },
38
38
  "packageManager": "pnpm@8.10.4",
39
- "gitHead": "4d95847e468540e2377e3c45f67f8635f1143a08"
39
+ "gitHead": "fb592bf063d10ba67212ece1f4864129c333c992"
40
40
  }
@@ -7,6 +7,7 @@ import {
7
7
  import MarketsClient from './modules/markets';
8
8
  import AccountClient from './modules/account';
9
9
  import TradeSimulationClient from './modules/trade.simulation';
10
+ import LpClient from './modules/lp';
10
11
 
11
12
  /**
12
13
  * @description Client for API
@@ -20,6 +21,7 @@ export class ApiClient {
20
21
  private readonly apiEndpoint: string;
21
22
  private readonly _markets: MarketsClient;
22
23
  private readonly _account: AccountClient;
24
+ private readonly _lp: LpClient;
23
25
  private readonly _trade_simulation: TradeSimulationClient;
24
26
 
25
27
  private constructor(config: ServiceConfig) {
@@ -27,6 +29,7 @@ export class ApiClient {
27
29
  ApiClient.config = { ...ApiClient.config, ...config };
28
30
  this._markets = new MarketsClient(this.apiEndpoint);
29
31
  this._account = new AccountClient(this.apiEndpoint);
32
+ this._lp = new LpClient(this.apiEndpoint);
30
33
  this._trade_simulation = new TradeSimulationClient();
31
34
  }
32
35
 
@@ -83,4 +86,18 @@ export class ApiClient {
83
86
  public static get tradeSimulation(): TradeSimulationClient {
84
87
  return ApiClient.getInstance()._trade_simulation;
85
88
  }
89
+
90
+ /**
91
+ * Gets the current instance of the LpClient from the ApiClient.
92
+ *
93
+ * This static getter allows access to the LpClient instance managed within the ApiClient's singleton instance. It is a convenience method for retrieving the LpClient directly, bypassing the need to manually access the internal `_lp` property of the ApiClient instance.
94
+ *
95
+ * @returns {LpClient} The LpClient instance currently held by the ApiClient.
96
+ * @example
97
+ * // Assuming ApiClient and LpClient are properly set up
98
+ * const lpClient = ApiClient.lp;
99
+ */
100
+ public static get lp(): LpClient {
101
+ return ApiClient.getInstance()._lp;
102
+ }
86
103
  }
@@ -0,0 +1,38 @@
1
+ import {
2
+ GetLpPoolParams,
3
+ GetLpPoolPositionParams,
4
+ GetLpPoolResult,
5
+ GetLpPoolsResult,
6
+ GetLpPoolTransactionHistoryParams,
7
+ GetLpPoolTransactionHistoryResult,
8
+ GetLpPositionsResult,
9
+ } from '../types';
10
+ import RestClient from './rest';
11
+
12
+ export default class LpClient extends RestClient {
13
+ async getLpPools(): Promise<GetLpPoolsResult> {
14
+ const uri = '/api/lp-pools';
15
+ return this.get(uri);
16
+ }
17
+
18
+ async getLpPool(params: GetLpPoolParams): Promise<GetLpPoolResult> {
19
+ const uri = `/api/lp-pools/${params.id}`;
20
+ return this.get(uri);
21
+ }
22
+
23
+ async getLpPoolTransactionHistory(
24
+ params: GetLpPoolTransactionHistoryParams,
25
+ ): Promise<GetLpPoolTransactionHistoryResult> {
26
+ const uri = `/api/lp-pools/${params.id}/transaction-history`;
27
+ return this.get(uri, {
28
+ limit: params.limit,
29
+ });
30
+ }
31
+
32
+ async getLpPositions(
33
+ params: GetLpPoolPositionParams,
34
+ ): Promise<GetLpPositionsResult> {
35
+ const uri = `/api/lp-pools/${params.id}/positions`;
36
+ return this.get(uri);
37
+ }
38
+ }
@@ -208,3 +208,63 @@ export type TradeSimulationLoadDataParams = {
208
208
  export type TradeSimulationSimulateParams = {
209
209
  amount: number; // position size, + for long | - for short
210
210
  };
211
+
212
+ // ---- LP ----
213
+
214
+ export enum SupportedChainId {
215
+ mainnet = 1,
216
+ polygonMumbai = 80001,
217
+ }
218
+
219
+ export type LpPoolEntity = {
220
+ id: number;
221
+ name: string;
222
+ description: string;
223
+ currentAPY: number;
224
+ balanceSupplied?: number | null;
225
+ balanceChange24H: number;
226
+ tokenAddress: string;
227
+ token: string;
228
+ allowedChainsForLiquidity: number[];
229
+ chainId: SupportedChainId;
230
+ };
231
+
232
+ export type GetLpPoolsResult = LpPoolEntity[];
233
+
234
+ export type GetLpPoolResult = LpPoolEntity;
235
+
236
+ export type GetLpPoolParams = {
237
+ id: LpPoolEntity['id'];
238
+ };
239
+
240
+ export type TransactionHistoryType = 'deposit' | 'withdrawal';
241
+
242
+ export type LpTransactionHistoryEntity = {
243
+ id: number;
244
+ type: TransactionHistoryType;
245
+ token: string;
246
+ amount: number;
247
+ transactionHash: string;
248
+ timestamp: number;
249
+ };
250
+
251
+ export type GetLpPoolTransactionHistoryParams = {
252
+ id: LpPoolEntity['id'];
253
+ limit?: number;
254
+ };
255
+
256
+ export type GetLpPoolTransactionHistoryResult = LpTransactionHistoryEntity[];
257
+
258
+ export type GetLpPoolPositionParams = {
259
+ id: LpPoolEntity['id'];
260
+ };
261
+
262
+ export type LpPositionEntity = {
263
+ id: number;
264
+ deposited: number;
265
+ currentBalance: number;
266
+ pnl: number;
267
+ fundingRate: number;
268
+ };
269
+
270
+ export type GetLpPositionsResult = LpPositionEntity[];