@myx-trade/sdk 0.1.147 → 0.1.149

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.
package/dist/index.d.mts CHANGED
@@ -1368,11 +1368,80 @@ declare class Utils {
1368
1368
  transferKlineResolutionToInterval(resolution: KlineResolution): HttpKlineIntervalEnum;
1369
1369
  getErrorMessage(error: any, fallbackErrorMessage?: string): Promise<any>;
1370
1370
  checkSeamlessGas(userAddress: string): Promise<boolean>;
1371
- getPoolInfo({ chainId, poolId, marketPrice }: {
1371
+ getLiquidityInfo({ chainId, poolId, marketPrice }: {
1372
1372
  chainId: number;
1373
1373
  poolId: string;
1374
1374
  marketPrice: string;
1375
- }): Promise<void>;
1375
+ }): Promise<{
1376
+ code: number;
1377
+ data: [[string, bigint, bigint, bigint] & {
1378
+ poolToken: string;
1379
+ exchangeRate: bigint;
1380
+ poolTokenPrice: bigint;
1381
+ poolTokenSupply: bigint;
1382
+ }, [string, bigint, bigint, bigint] & {
1383
+ poolToken: string;
1384
+ exchangeRate: bigint;
1385
+ poolTokenPrice: bigint;
1386
+ poolTokenSupply: bigint;
1387
+ }, [bigint, bigint, bigint, bigint] & {
1388
+ baseTotalAmount: bigint;
1389
+ baseReservedAmount: bigint;
1390
+ quoteTotalAmount: bigint;
1391
+ quoteReservedAmount: bigint;
1392
+ }, [bigint, bigint, bigint] & {
1393
+ nextFundingRate: bigint;
1394
+ lastFundingFeeTracker: bigint;
1395
+ nextEpochTime: bigint;
1396
+ }, [bigint, bigint, bigint, bigint] & {
1397
+ tracker: bigint;
1398
+ longSize: bigint;
1399
+ shortSize: bigint;
1400
+ poolEntryPrice: bigint;
1401
+ }, [bigint, bigint] & {
1402
+ windowCaps: bigint;
1403
+ openInterest: bigint;
1404
+ }] & {
1405
+ basePool: [string, bigint, bigint, bigint] & {
1406
+ poolToken: string;
1407
+ exchangeRate: bigint;
1408
+ poolTokenPrice: bigint;
1409
+ poolTokenSupply: bigint;
1410
+ };
1411
+ quotePool: [string, bigint, bigint, bigint] & {
1412
+ poolToken: string;
1413
+ exchangeRate: bigint;
1414
+ poolTokenPrice: bigint;
1415
+ poolTokenSupply: bigint;
1416
+ };
1417
+ reserveInfo: [bigint, bigint, bigint, bigint] & {
1418
+ baseTotalAmount: bigint;
1419
+ baseReservedAmount: bigint;
1420
+ quoteTotalAmount: bigint;
1421
+ quoteReservedAmount: bigint;
1422
+ };
1423
+ fundingInfo: [bigint, bigint, bigint] & {
1424
+ nextFundingRate: bigint;
1425
+ lastFundingFeeTracker: bigint;
1426
+ nextEpochTime: bigint;
1427
+ };
1428
+ oi: [bigint, bigint, bigint, bigint] & {
1429
+ tracker: bigint;
1430
+ longSize: bigint;
1431
+ shortSize: bigint;
1432
+ poolEntryPrice: bigint;
1433
+ };
1434
+ liquidityInfo: [bigint, bigint] & {
1435
+ windowCaps: bigint;
1436
+ openInterest: bigint;
1437
+ };
1438
+ };
1439
+ message?: undefined;
1440
+ } | {
1441
+ code: number;
1442
+ message: any;
1443
+ data?: undefined;
1444
+ }>;
1376
1445
  }
1377
1446
 
1378
1447
  declare class Markets {
package/dist/index.d.ts CHANGED
@@ -1368,11 +1368,80 @@ declare class Utils {
1368
1368
  transferKlineResolutionToInterval(resolution: KlineResolution): HttpKlineIntervalEnum;
1369
1369
  getErrorMessage(error: any, fallbackErrorMessage?: string): Promise<any>;
1370
1370
  checkSeamlessGas(userAddress: string): Promise<boolean>;
1371
- getPoolInfo({ chainId, poolId, marketPrice }: {
1371
+ getLiquidityInfo({ chainId, poolId, marketPrice }: {
1372
1372
  chainId: number;
1373
1373
  poolId: string;
1374
1374
  marketPrice: string;
1375
- }): Promise<void>;
1375
+ }): Promise<{
1376
+ code: number;
1377
+ data: [[string, bigint, bigint, bigint] & {
1378
+ poolToken: string;
1379
+ exchangeRate: bigint;
1380
+ poolTokenPrice: bigint;
1381
+ poolTokenSupply: bigint;
1382
+ }, [string, bigint, bigint, bigint] & {
1383
+ poolToken: string;
1384
+ exchangeRate: bigint;
1385
+ poolTokenPrice: bigint;
1386
+ poolTokenSupply: bigint;
1387
+ }, [bigint, bigint, bigint, bigint] & {
1388
+ baseTotalAmount: bigint;
1389
+ baseReservedAmount: bigint;
1390
+ quoteTotalAmount: bigint;
1391
+ quoteReservedAmount: bigint;
1392
+ }, [bigint, bigint, bigint] & {
1393
+ nextFundingRate: bigint;
1394
+ lastFundingFeeTracker: bigint;
1395
+ nextEpochTime: bigint;
1396
+ }, [bigint, bigint, bigint, bigint] & {
1397
+ tracker: bigint;
1398
+ longSize: bigint;
1399
+ shortSize: bigint;
1400
+ poolEntryPrice: bigint;
1401
+ }, [bigint, bigint] & {
1402
+ windowCaps: bigint;
1403
+ openInterest: bigint;
1404
+ }] & {
1405
+ basePool: [string, bigint, bigint, bigint] & {
1406
+ poolToken: string;
1407
+ exchangeRate: bigint;
1408
+ poolTokenPrice: bigint;
1409
+ poolTokenSupply: bigint;
1410
+ };
1411
+ quotePool: [string, bigint, bigint, bigint] & {
1412
+ poolToken: string;
1413
+ exchangeRate: bigint;
1414
+ poolTokenPrice: bigint;
1415
+ poolTokenSupply: bigint;
1416
+ };
1417
+ reserveInfo: [bigint, bigint, bigint, bigint] & {
1418
+ baseTotalAmount: bigint;
1419
+ baseReservedAmount: bigint;
1420
+ quoteTotalAmount: bigint;
1421
+ quoteReservedAmount: bigint;
1422
+ };
1423
+ fundingInfo: [bigint, bigint, bigint] & {
1424
+ nextFundingRate: bigint;
1425
+ lastFundingFeeTracker: bigint;
1426
+ nextEpochTime: bigint;
1427
+ };
1428
+ oi: [bigint, bigint, bigint, bigint] & {
1429
+ tracker: bigint;
1430
+ longSize: bigint;
1431
+ shortSize: bigint;
1432
+ poolEntryPrice: bigint;
1433
+ };
1434
+ liquidityInfo: [bigint, bigint] & {
1435
+ windowCaps: bigint;
1436
+ openInterest: bigint;
1437
+ };
1438
+ };
1439
+ message?: undefined;
1440
+ } | {
1441
+ code: number;
1442
+ message: any;
1443
+ data?: undefined;
1444
+ }>;
1376
1445
  }
1377
1446
 
1378
1447
  declare class Markets {
package/dist/index.js CHANGED
@@ -1821,7 +1821,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
1821
1821
  // package.json
1822
1822
  var package_default = {
1823
1823
  name: "@myx-trade/sdk",
1824
- version: "0.1.147",
1824
+ version: "0.1.149",
1825
1825
  private: false,
1826
1826
  publishConfig: {
1827
1827
  access: "public"
@@ -20284,13 +20284,26 @@ var Utils = class {
20284
20284
  }
20285
20285
  return true;
20286
20286
  }
20287
- async getPoolInfo({
20287
+ async getLiquidityInfo({
20288
20288
  chainId,
20289
20289
  poolId,
20290
20290
  marketPrice
20291
20291
  }) {
20292
- const dataProviderContract = await getDataProviderContract(chainId);
20293
- const poolInfo = await dataProviderContract.getPoolInfo(poolId, marketPrice);
20292
+ try {
20293
+ const dataProviderContract = await getDataProviderContract(chainId);
20294
+ const poolInfo = await dataProviderContract.getPoolInfo(poolId, marketPrice);
20295
+ return {
20296
+ code: 0,
20297
+ data: poolInfo
20298
+ };
20299
+ } catch (error) {
20300
+ this.logger.error("Error getting pool info:", error);
20301
+ return {
20302
+ code: -1,
20303
+ // @ts-ignore
20304
+ message: error?.message
20305
+ };
20306
+ }
20294
20307
  }
20295
20308
  };
20296
20309
 
package/dist/index.mjs CHANGED
@@ -1731,7 +1731,7 @@ var RotationProvider = class extends BaseProvider {
1731
1731
  // package.json
1732
1732
  var package_default = {
1733
1733
  name: "@myx-trade/sdk",
1734
- version: "0.1.147",
1734
+ version: "0.1.149",
1735
1735
  private: false,
1736
1736
  publishConfig: {
1737
1737
  access: "public"
@@ -20194,13 +20194,26 @@ var Utils = class {
20194
20194
  }
20195
20195
  return true;
20196
20196
  }
20197
- async getPoolInfo({
20197
+ async getLiquidityInfo({
20198
20198
  chainId,
20199
20199
  poolId,
20200
20200
  marketPrice
20201
20201
  }) {
20202
- const dataProviderContract = await getDataProviderContract(chainId);
20203
- const poolInfo = await dataProviderContract.getPoolInfo(poolId, marketPrice);
20202
+ try {
20203
+ const dataProviderContract = await getDataProviderContract(chainId);
20204
+ const poolInfo = await dataProviderContract.getPoolInfo(poolId, marketPrice);
20205
+ return {
20206
+ code: 0,
20207
+ data: poolInfo
20208
+ };
20209
+ } catch (error) {
20210
+ this.logger.error("Error getting pool info:", error);
20211
+ return {
20212
+ code: -1,
20213
+ // @ts-ignore
20214
+ message: error?.message
20215
+ };
20216
+ }
20204
20217
  }
20205
20218
  };
20206
20219
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myx-trade/sdk",
3
- "version": "0.1.147",
3
+ "version": "0.1.149",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"