@reyaxyz/api-sdk 0.140.4 → 0.140.6

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.
@@ -75,6 +75,17 @@ var LpClient = /** @class */ (function (_super) {
75
75
  });
76
76
  });
77
77
  };
78
+ LpClient.prototype.getLpPoolDataRPC = function (params) {
79
+ return __awaiter(this, void 0, void 0, function () {
80
+ var uri;
81
+ return __generator(this, function (_a) {
82
+ uri = "/api/lp-pools/".concat(params.id, "/data-rpc");
83
+ return [2 /*return*/, this.get(uri, {
84
+ address: params.address,
85
+ })];
86
+ });
87
+ });
88
+ };
78
89
  LpClient.prototype.getLpPoolTransactionHistory = function (params) {
79
90
  return __awaiter(this, void 0, void 0, function () {
80
91
  var uri;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["clients/modules/lp/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,0CAKyB;AACzB;IAAsC,4BAAU;IAAhD;;IA2FA,CAAC;IA1FO,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;wBACnB,OAAO,EAAE,MAAM,CAAC,OAAO;qBACxB,CAAC,EAAC;;;KACJ;IAEK,iCAA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CAAC;gBAC5D,sBAAO,IAAI,CAAC,IAAI,CACd,GAAG,EACH,EAAE,EACF;wBACE,OAAO,EAAE,MAAM,CAAC,eAAe;wBAC/B,cAAc,EAAE,MAAM,CAAC,aAAa;wBACpC,eAAe,EAAE,MAAM,CAAC,aAAa;wBACrC,MAAM,EAAE,MAAM,CAAC,MAAM;qBACtB,CACF,EAAC;;;KACH;IAEK,+CAA4B,GAAlC,UACE,MAA0C;;;;gBAEpC,GAAG,GAAG,+CAA+C,CAAC;gBAC5D,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;wBACnB,cAAc,EAAE,MAAM,CAAC,aAAa;qBACrC,CAAC,EAAC;;;KACJ;IACH,eAAC;AAAD,CAAC,AA3FD,CAAsC,mBAAU,GA2F/C","sourcesContent":["import {\n GetLpPoolParams,\n GetLpPositionsParams,\n GetLpPoolResult,\n GetLpPoolsResult,\n GetLpPoolTransactionHistoryParams,\n GetLpPoolTransactionHistoryResult,\n GetLpPositionsResult,\n GetLpPoolWithdrawBalanceParams,\n GetLpPoolWithdrawBalanceResult,\n GetLpPoolBalanceChartDataParams,\n GetLpPoolPerformanceChartDataParams,\n getLpPoolDepthChartSimulationDataParams,\n PushBridgeTransactionParams,\n PushBridgeTransactionResult,\n GetPendingBridgeTransactionsParams,\n GetPendingBridgeTransactionsResult,\n} from './types';\nimport {\n GetLpPoolBalanceChartDataResult,\n GetLpPoolPerformanceChartDataResult,\n RestClient,\n GetLpPoolDepthChartSimulationDataResult,\n} from '@reyaxyz/common';\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 address: params.address,\n });\n }\n\n async getLpPositions(\n params: GetLpPositionsParams,\n ): Promise<GetLpPositionsResult> {\n const uri = `/api/lp-pools/${params.id}/positions`;\n return this.get(uri, {\n address: params.address,\n });\n }\n\n async getLpPoolWithdrawBalance(\n params: GetLpPoolWithdrawBalanceParams,\n ): Promise<GetLpPoolWithdrawBalanceResult> {\n const uri = `/api/lp-pools/${params.id}/withdraw-balance`;\n return this.get(uri, {\n address: params.address,\n });\n }\n\n async getLpPoolBalanceChartData(\n params: GetLpPoolBalanceChartDataParams,\n ): Promise<GetLpPoolBalanceChartDataResult> {\n const uri = `/api/lp-pools/${params.poolId}/balance-chart-data`;\n return this.get(uri, {\n timeframeMs: params.filters.timeframeMs,\n granularity: params.filters.granularity,\n });\n }\n\n async getLpPoolPerformanceChartData(\n params: GetLpPoolPerformanceChartDataParams,\n ): Promise<GetLpPoolPerformanceChartDataResult> {\n const uri = `/api/lp-pools/${params.poolId}/performance-chart-data`;\n return this.get(uri, {\n timeframeMs: params.filters.timeframeMs,\n granularity: params.filters.granularity,\n address: params.address,\n });\n }\n\n async getLpPoolDepthChartSimulationData(\n params: getLpPoolDepthChartSimulationDataParams,\n ): Promise<GetLpPoolDepthChartSimulationDataResult> {\n const uri = `/api/lp-pools/${params.marketId}/depth-simulation-data`;\n return this.get(uri);\n }\n\n async pushBridgeTransaction(\n params: PushBridgeTransactionParams,\n ): Promise<PushBridgeTransactionResult> {\n const uri = `/api/lp-pools/push-pending-transaction/bridge`;\n return this.post(\n uri,\n {},\n {\n tx_hash: params.transactionHash,\n wallet_address: params.walletAddress,\n source_chain_id: params.sourceChainId,\n amount: params.amount,\n },\n );\n }\n\n async getPendingBridgeTransactions(\n params: GetPendingBridgeTransactionsParams,\n ): Promise<GetPendingBridgeTransactionsResult> {\n const uri = `/api/lp-pools/get-pending-transactions/bridge`;\n return this.get(uri, {\n wallet_address: params.walletAddress,\n });\n }\n}\n"]}
1
+ {"version":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AAG,+CAA+C,CAAC;gBAC5D,sBAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;wBACnB,cAAc,EAAE,MAAM,CAAC,aAAa;qBACrC,CAAC,EAAC;;;KACJ;IACH,eAAC;AAAD,CAAC,AApGD,CAAsC,mBAAU,GAoG/C","sourcesContent":["import {\n GetLpPoolParams,\n GetLpPositionsParams,\n GetLpPoolResult,\n GetLpPoolsResult,\n GetLpPoolTransactionHistoryParams,\n GetLpPoolTransactionHistoryResult,\n GetLpPositionsResult,\n GetLpPoolWithdrawBalanceParams,\n GetLpPoolWithdrawBalanceResult,\n GetLpPoolBalanceChartDataParams,\n GetLpPoolPerformanceChartDataParams,\n getLpPoolDepthChartSimulationDataParams,\n PushBridgeTransactionParams,\n PushBridgeTransactionResult,\n GetPendingBridgeTransactionsParams,\n GetPendingBridgeTransactionsResult,\n GetLpPoolDataRPCParams,\n} from './types';\nimport {\n GetLpPoolBalanceChartDataResult,\n GetLpPoolPerformanceChartDataResult,\n RestClient,\n GetLpPoolDepthChartSimulationDataResult,\n GetLpPoolPositionRPCResponse,\n} from '@reyaxyz/common';\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 getLpPoolDataRPC(\n params: GetLpPoolDataRPCParams,\n ): Promise<GetLpPoolPositionRPCResponse> {\n const uri = `/api/lp-pools/${params.id}/data-rpc`;\n return this.get(uri, {\n address: params.address,\n });\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 address: params.address,\n });\n }\n\n async getLpPositions(\n params: GetLpPositionsParams,\n ): Promise<GetLpPositionsResult> {\n const uri = `/api/lp-pools/${params.id}/positions`;\n return this.get(uri, {\n address: params.address,\n });\n }\n\n async getLpPoolWithdrawBalance(\n params: GetLpPoolWithdrawBalanceParams,\n ): Promise<GetLpPoolWithdrawBalanceResult> {\n const uri = `/api/lp-pools/${params.id}/withdraw-balance`;\n return this.get(uri, {\n address: params.address,\n });\n }\n\n async getLpPoolBalanceChartData(\n params: GetLpPoolBalanceChartDataParams,\n ): Promise<GetLpPoolBalanceChartDataResult> {\n const uri = `/api/lp-pools/${params.poolId}/balance-chart-data`;\n return this.get(uri, {\n timeframeMs: params.filters.timeframeMs,\n granularity: params.filters.granularity,\n });\n }\n\n async getLpPoolPerformanceChartData(\n params: GetLpPoolPerformanceChartDataParams,\n ): Promise<GetLpPoolPerformanceChartDataResult> {\n const uri = `/api/lp-pools/${params.poolId}/performance-chart-data`;\n return this.get(uri, {\n timeframeMs: params.filters.timeframeMs,\n granularity: params.filters.granularity,\n address: params.address,\n });\n }\n\n async getLpPoolDepthChartSimulationData(\n params: getLpPoolDepthChartSimulationDataParams,\n ): Promise<GetLpPoolDepthChartSimulationDataResult> {\n const uri = `/api/lp-pools/${params.marketId}/depth-simulation-data`;\n return this.get(uri);\n }\n\n async pushBridgeTransaction(\n params: PushBridgeTransactionParams,\n ): Promise<PushBridgeTransactionResult> {\n const uri = `/api/lp-pools/push-pending-transaction/bridge`;\n return this.post(\n uri,\n {},\n {\n tx_hash: params.transactionHash,\n wallet_address: params.walletAddress,\n source_chain_id: params.sourceChainId,\n amount: params.amount,\n },\n );\n }\n\n async getPendingBridgeTransactions(\n params: GetPendingBridgeTransactionsParams,\n ): Promise<GetPendingBridgeTransactionsResult> {\n const uri = `/api/lp-pools/get-pending-transactions/bridge`;\n return this.get(uri, {\n wallet_address: params.walletAddress,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/lp/types.ts"],"names":[],"mappings":";;;AAmDA,IAAY,sBAOX;AAPD,WAAY,sBAAsB;IAChC,mFAAsB,CAAA;IACtB,iFAAyB,CAAA;IACzB,gFAA6B,CAAA;IAC7B,mFAAkC,CAAA;IAClC,sFAAoC,CAAA;IACpC,qFAAoC,CAAA;AACtC,CAAC,EAPW,sBAAsB,sCAAtB,sBAAsB,QAOjC","sourcesContent":["import {\n LpPoolEntity,\n LpPositionEntity,\n LpTransactionHistoryEntity,\n LpBalanceGranularity,\n LpWithdrawBalanceEntity,\n MarketEntity,\n MoneyInOutChainId,\n ReyaChainId,\n} from '@reyaxyz/common';\n\nimport { SocketBridgeTransactionPoolStatus } from '@reyaxyz/common';\n\nexport type GetLpPoolsResult = LpPoolEntity[];\n\nexport type GetLpPoolResult = LpPoolEntity;\n\nexport type GetLpPoolParams = {\n id: LpPoolEntity['id'];\n};\n\nexport type GetLpPoolTransactionHistoryResult = LpTransactionHistoryEntity[];\n\nexport type GetLpPositionsParams = {\n id: LpPoolEntity['id'];\n address: string; // wallet address\n};\n\nexport type GetLpPositionsResult = LpPositionEntity[];\n\nexport type GetLpPoolWithdrawBalanceParams = {\n id: LpPoolEntity['id'];\n address: string; // wallet address\n};\n\nexport type GetLpPoolWithdrawBalanceResult = LpWithdrawBalanceEntity;\n\nexport type GetLpPoolTransactionHistoryParams = {\n id: LpPoolEntity['id'];\n address: string; // wallet address\n limit?: number;\n};\n\nexport type GetLpPoolBalanceChartDataParams = {\n poolId: LpPoolEntity['id'];\n filters: {\n timeframeMs: number;\n granularity: LpBalanceGranularity;\n };\n};\n\nexport enum PerformanceGranularity {\n ONE_MINUTE = 60 * 1000,\n ONE_HOUR = 60 * 60 * 1000,\n ONE_DAY = 24 * 60 * 60 * 1000,\n ONE_WEEK = 7 * 24 * 60 * 60 * 1000,\n ONE_MONTH = 30 * 24 * 60 * 60 * 1000,\n ONE_YEAR = 365 * 24 * 60 * 60 * 1000,\n}\n\nexport type GetLpPoolPerformanceChartDataParams = {\n poolId: LpPoolEntity['id'];\n address: string; // wallet address\n filters: {\n timeframeMs: number;\n granularity: PerformanceGranularity;\n };\n};\n\nexport type getLpPoolDepthChartSimulationDataParams = {\n marketId: MarketEntity['id'];\n};\n\nexport type PushBridgeTransactionParams = {\n transactionHash: string;\n walletAddress: string;\n sourceChainId: MoneyInOutChainId | ReyaChainId;\n amount: number; // amount from bridge input\n};\n\nexport type BridgeTransactionPool = {\n sourceTxHash: string;\n sourceTxExplorerLink: string;\n destinationTxHash?: string;\n destinationTxExplorerLink?: string;\n sourceChainId: MoneyInOutChainId | ReyaChainId;\n destinationChainId: MoneyInOutChainId | ReyaChainId;\n walletAddress: string;\n status: SocketBridgeTransactionPoolStatus;\n amount: number;\n};\n\nexport type PushBridgeTransactionResult = BridgeTransactionPool;\n\nexport type GetPendingBridgeTransactionsParams = {\n walletAddress: string;\n};\n\nexport type GetPendingBridgeTransactionsResult = BridgeTransactionPool[];\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"/","sources":["clients/modules/lp/types.ts"],"names":[],"mappings":";;;AAoDA,IAAY,sBAOX;AAPD,WAAY,sBAAsB;IAChC,mFAAsB,CAAA;IACtB,iFAAyB,CAAA;IACzB,gFAA6B,CAAA;IAC7B,mFAAkC,CAAA;IAClC,sFAAoC,CAAA;IACpC,qFAAoC,CAAA;AACtC,CAAC,EAPW,sBAAsB,sCAAtB,sBAAsB,QAOjC","sourcesContent":["import {\n LpPoolEntity,\n LpPositionEntity,\n LpTransactionHistoryEntity,\n LpBalanceGranularity,\n LpWithdrawBalanceEntity,\n MarketEntity,\n MoneyInOutChainId,\n ReyaChainId,\n Address,\n} from '@reyaxyz/common';\n\nimport { SocketBridgeTransactionPoolStatus } from '@reyaxyz/common';\n\nexport type GetLpPoolsResult = LpPoolEntity[];\n\nexport type GetLpPoolResult = LpPoolEntity;\n\nexport type GetLpPoolParams = {\n id: LpPoolEntity['id'];\n};\n\nexport type GetLpPoolTransactionHistoryResult = LpTransactionHistoryEntity[];\n\nexport type GetLpPositionsParams = {\n id: LpPoolEntity['id'];\n address: string; // wallet address\n};\n\nexport type GetLpPositionsResult = LpPositionEntity[];\n\nexport type GetLpPoolWithdrawBalanceParams = {\n id: LpPoolEntity['id'];\n address: string; // wallet address\n};\n\nexport type GetLpPoolWithdrawBalanceResult = LpWithdrawBalanceEntity;\n\nexport type GetLpPoolTransactionHistoryParams = {\n id: LpPoolEntity['id'];\n address: string; // wallet address\n limit?: number;\n};\n\nexport type GetLpPoolBalanceChartDataParams = {\n poolId: LpPoolEntity['id'];\n filters: {\n timeframeMs: number;\n granularity: LpBalanceGranularity;\n };\n};\n\nexport enum PerformanceGranularity {\n ONE_MINUTE = 60 * 1000,\n ONE_HOUR = 60 * 60 * 1000,\n ONE_DAY = 24 * 60 * 60 * 1000,\n ONE_WEEK = 7 * 24 * 60 * 60 * 1000,\n ONE_MONTH = 30 * 24 * 60 * 60 * 1000,\n ONE_YEAR = 365 * 24 * 60 * 60 * 1000,\n}\n\nexport type GetLpPoolPerformanceChartDataParams = {\n poolId: LpPoolEntity['id'];\n address: string; // wallet address\n filters: {\n timeframeMs: number;\n granularity: PerformanceGranularity;\n };\n};\n\nexport type getLpPoolDepthChartSimulationDataParams = {\n marketId: MarketEntity['id'];\n};\n\nexport type PushBridgeTransactionParams = {\n transactionHash: string;\n walletAddress: string;\n sourceChainId: MoneyInOutChainId | ReyaChainId;\n amount: number; // amount from bridge input\n};\n\nexport type BridgeTransactionPool = {\n sourceTxHash: string;\n sourceTxExplorerLink: string;\n destinationTxHash?: string;\n destinationTxExplorerLink?: string;\n sourceChainId: MoneyInOutChainId | ReyaChainId;\n destinationChainId: MoneyInOutChainId | ReyaChainId;\n walletAddress: string;\n status: SocketBridgeTransactionPoolStatus;\n amount: number;\n};\n\nexport type PushBridgeTransactionResult = BridgeTransactionPool;\n\nexport type GetPendingBridgeTransactionsParams = {\n walletAddress: string;\n};\n\nexport type GetPendingBridgeTransactionsResult = BridgeTransactionPool[];\n\nexport type GetLpPoolDataRPCParams = {\n id: LpPoolEntity['id'];\n address: Address;\n};\n"]}
@@ -1,8 +1,9 @@
1
- import { GetLpPoolParams, GetLpPositionsParams, GetLpPoolResult, GetLpPoolsResult, GetLpPoolTransactionHistoryParams, GetLpPoolTransactionHistoryResult, GetLpPositionsResult, GetLpPoolWithdrawBalanceParams, GetLpPoolWithdrawBalanceResult, GetLpPoolBalanceChartDataParams, GetLpPoolPerformanceChartDataParams, getLpPoolDepthChartSimulationDataParams, PushBridgeTransactionParams, PushBridgeTransactionResult, GetPendingBridgeTransactionsParams, GetPendingBridgeTransactionsResult } from './types';
2
- import { GetLpPoolBalanceChartDataResult, GetLpPoolPerformanceChartDataResult, RestClient, GetLpPoolDepthChartSimulationDataResult } from '@reyaxyz/common';
1
+ import { GetLpPoolParams, GetLpPositionsParams, GetLpPoolResult, GetLpPoolsResult, GetLpPoolTransactionHistoryParams, GetLpPoolTransactionHistoryResult, GetLpPositionsResult, GetLpPoolWithdrawBalanceParams, GetLpPoolWithdrawBalanceResult, GetLpPoolBalanceChartDataParams, GetLpPoolPerformanceChartDataParams, getLpPoolDepthChartSimulationDataParams, PushBridgeTransactionParams, PushBridgeTransactionResult, GetPendingBridgeTransactionsParams, GetPendingBridgeTransactionsResult, GetLpPoolDataRPCParams } from './types';
2
+ import { GetLpPoolBalanceChartDataResult, GetLpPoolPerformanceChartDataResult, RestClient, GetLpPoolDepthChartSimulationDataResult, GetLpPoolPositionRPCResponse } from '@reyaxyz/common';
3
3
  export default class LpClient extends RestClient {
4
4
  getLpPools(): Promise<GetLpPoolsResult>;
5
5
  getLpPool(params: GetLpPoolParams): Promise<GetLpPoolResult>;
6
+ getLpPoolDataRPC(params: GetLpPoolDataRPCParams): Promise<GetLpPoolPositionRPCResponse>;
6
7
  getLpPoolTransactionHistory(params: GetLpPoolTransactionHistoryParams): Promise<GetLpPoolTransactionHistoryResult>;
7
8
  getLpPositions(params: GetLpPositionsParams): Promise<GetLpPositionsResult>;
8
9
  getLpPoolWithdrawBalance(params: GetLpPoolWithdrawBalanceParams): Promise<GetLpPoolWithdraw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,CAChC,MAAM,EAAE,kCAAkC,GACzC,OAAO,CAAC,kCAAkC,CAAC;CAM/C"}
@@ -1,4 +1,4 @@
1
- import { LpPoolEntity, LpPositionEntity, LpTransactionHistoryEntity, LpBalanceGranularity, LpWithdrawBalanceEntity, MarketEntity, MoneyInOutChainId, ReyaChainId } from '@reyaxyz/common';
1
+ import { LpPoolEntity, LpPositionEntity, LpTransactionHistoryEntity, LpBalanceGranularity, LpWithdrawBalanceEntity, MarketEntity, MoneyInOutChainId, ReyaChainId, Address } from '@reyaxyz/common';
2
2
  import { SocketBridgeTransactionPoolStatus } from '@reyaxyz/common';
3
3
  export type GetLpPoolsResult = LpPoolEntity[];
4
4
  export type GetLpPoolResult = LpPoolEntity;
@@ -69,4 +69,8 @@ export type GetPendingBridgeTransactionsParams = {
69
69
  walletAddress: string;
70
70
  };
71
71
  export type GetPendingBridgeTransactionsResult = BridgeTransactionPool[];
72
+ export type GetLpPoolDataRPCParams = {
73
+ id: LpPoolEntity['id'];
74
+ address: Address;
75
+ };
72
76
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"/","sources":["clients/modules/lp/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,0BAA0B,EAC1B,oBAAoB,EACpB,uBAAuB,EACvB,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AAEpE,MAAM,MAAM,gBAAgB,GAAG,YAAY,EAAE,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,0BAA0B,EAAE,CAAC;AAE7E,MAAM,MAAM,oBAAoB,GAAG;IACj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C;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,aAAa,EAAE,iBAAiB,GAAG,WAAW,CAAC;IAC/C,kBAAkB,EAAE,iBAAiB,GAAG,WAAW,CAAC;IACpD,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,iCAAiC,CAAC;IAC1C,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,qBAAqB,CAAC;AAEhE,MAAM,MAAM,kCAAkC,GAAG;IAC/C,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG,qBAAqB,EAAE,CAAC;AAEzE,MAAM,MAAM,sBAAsB,GAAG;IACnC,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reyaxyz/api-sdk",
3
- "version": "0.140.4",
3
+ "version": "0.140.6",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -33,7 +33,7 @@
33
33
  "generate:coverage-badges": "npx istanbul-badges-readme --silent"
34
34
  },
35
35
  "dependencies": {
36
- "@reyaxyz/common": "0.218.0",
36
+ "@reyaxyz/common": "0.219.1",
37
37
  "@simplewebauthn/types": "^10.0.0",
38
38
  "axios": "^1.6.2",
39
39
  "bignumber.js": "^9.1.2",
@@ -42,7 +42,7 @@
42
42
  "ws": "^8.16.0"
43
43
  },
44
44
  "packageManager": "pnpm@8.3.1",
45
- "gitHead": "858d8d73cf364c5af5e1b463987a49ac99b3a7e6",
45
+ "gitHead": "99814d72817b591981995fc9acf781db0bd99d9f",
46
46
  "devDependencies": {
47
47
  "@types/ws": "8.5.10"
48
48
  }
@@ -15,12 +15,14 @@ import {
15
15
  PushBridgeTransactionResult,
16
16
  GetPendingBridgeTransactionsParams,
17
17
  GetPendingBridgeTransactionsResult,
18
+ GetLpPoolDataRPCParams,
18
19
  } from './types';
19
20
  import {
20
21
  GetLpPoolBalanceChartDataResult,
21
22
  GetLpPoolPerformanceChartDataResult,
22
23
  RestClient,
23
24
  GetLpPoolDepthChartSimulationDataResult,
25
+ GetLpPoolPositionRPCResponse,
24
26
  } from '@reyaxyz/common';
25
27
  export default class LpClient extends RestClient {
26
28
  async getLpPools(): Promise<GetLpPoolsResult> {
@@ -33,6 +35,15 @@ export default class LpClient extends RestClient {
33
35
  return this.get(uri);
34
36
  }
35
37
 
38
+ async getLpPoolDataRPC(
39
+ params: GetLpPoolDataRPCParams,
40
+ ): Promise<GetLpPoolPositionRPCResponse> {
41
+ const uri = `/api/lp-pools/${params.id}/data-rpc`;
42
+ return this.get(uri, {
43
+ address: params.address,
44
+ });
45
+ }
46
+
36
47
  async getLpPoolTransactionHistory(
37
48
  params: GetLpPoolTransactionHistoryParams,
38
49
  ): Promise<GetLpPoolTransactionHistoryResult> {
@@ -7,6 +7,7 @@ import {
7
7
  MarketEntity,
8
8
  MoneyInOutChainId,
9
9
  ReyaChainId,
10
+ Address,
10
11
  } from '@reyaxyz/common';
11
12
 
12
13
  import { SocketBridgeTransactionPoolStatus } from '@reyaxyz/common';
@@ -97,3 +98,8 @@ export type GetPendingBridgeTransactionsParams = {
97
98
  };
98
99
 
99
100
  export type GetPendingBridgeTransactionsResult = BridgeTransactionPool[];
101
+
102
+ export type GetLpPoolDataRPCParams = {
103
+ id: LpPoolEntity['id'];
104
+ address: Address;
105
+ };