@myx-trade/sdk 0.1.267-beta.7 → 0.1.267-beta.71

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
@@ -82,12 +82,16 @@ declare const getPoolInfo$1: (chainId: ChainId, poolId: string, marketPrice?: bi
82
82
  exchangeRate: bigint;
83
83
  poolTokenPrice: bigint;
84
84
  poolTokenSupply: bigint;
85
+ totalDebt: bigint;
86
+ baseCollateral: bigint;
85
87
  };
86
88
  basePool: {
87
89
  poolToken: string;
88
90
  exchangeRate: bigint;
89
91
  poolTokenPrice: bigint;
90
92
  poolTokenSupply: bigint;
93
+ totalDebt: bigint;
94
+ baseCollateral: bigint;
91
95
  };
92
96
  reserveInfo: {
93
97
  baseTotalAmount: bigint;
@@ -106,6 +110,10 @@ declare const getPoolInfo$1: (chainId: ChainId, poolId: string, marketPrice?: bi
106
110
  shortSize: bigint;
107
111
  poolEntryPrice: bigint;
108
112
  };
113
+ liquidityInfo: {
114
+ windowCaps: bigint;
115
+ openInterest: bigint;
116
+ };
109
117
  }>;
110
118
 
111
119
  declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<bigint>;
@@ -617,7 +625,8 @@ declare enum DirectionEnum {
617
625
  declare enum OrderStatusEnum {
618
626
  Cancelled = 1,
619
627
  Expired = 2,
620
- Successful = 9
628
+ Successful = 9,
629
+ PartialFilled = 8
621
630
  }
622
631
  declare enum ExecTypeEnum {
623
632
  Market = 1,// market order
@@ -921,9 +930,17 @@ declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<ethe
921
930
 
922
931
  declare const deposit$1: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
923
932
 
933
+ declare const withdrawableLpAmount$1: (params: {
934
+ chainId: ChainId;
935
+ poolId: string;
936
+ price?: bigint;
937
+ }) => Promise<bigint>;
924
938
  declare const withdraw$1: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
925
939
 
926
- declare const getRewards$1: (params: RewardsParams) => Promise<bigint | undefined>;
940
+ declare const getRewards$1: (params: RewardsParams) => Promise<{
941
+ rebates: bigint;
942
+ genesisRebates: bigint;
943
+ } | undefined>;
927
944
 
928
945
  declare const previewUserWithdrawData: ({ chainId, account, poolId, amount }: PreviewWithdrawDataParams) => Promise<{
929
946
  baseAmountOut: bigint;
@@ -936,11 +953,16 @@ declare const index$2_claimBasePoolRebate: typeof claimBasePoolRebate;
936
953
  declare const index$2_claimBasePoolRebates: typeof claimBasePoolRebates;
937
954
  declare const index$2_previewUserWithdrawData: typeof previewUserWithdrawData;
938
955
  declare namespace index$2 {
939
- export { index$2_claimBasePoolRebate as claimBasePoolRebate, index$2_claimBasePoolRebates as claimBasePoolRebates, deposit$1 as deposit, getLpPrice$1 as getLpPrice, getRewards$1 as getRewards, index$2_previewUserWithdrawData as previewUserWithdrawData, withdraw$1 as withdraw };
956
+ export { index$2_claimBasePoolRebate as claimBasePoolRebate, index$2_claimBasePoolRebates as claimBasePoolRebates, deposit$1 as deposit, getLpPrice$1 as getLpPrice, getRewards$1 as getRewards, index$2_previewUserWithdrawData as previewUserWithdrawData, withdraw$1 as withdraw, withdrawableLpAmount$1 as withdrawableLpAmount };
940
957
  }
941
958
 
942
959
  declare const deposit: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
943
960
 
961
+ declare const withdrawableLpAmount: (params: {
962
+ chainId: ChainId;
963
+ poolId: string;
964
+ price?: bigint;
965
+ }) => Promise<bigint>;
944
966
  declare const withdraw: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
945
967
 
946
968
  declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<ethers.ContractTransactionResponse | null>;
@@ -959,16 +981,16 @@ declare const index$1_getLpPrice: typeof getLpPrice;
959
981
  declare const index$1_getRewards: typeof getRewards;
960
982
  declare const index$1_transfer: typeof transfer;
961
983
  declare const index$1_withdraw: typeof withdraw;
984
+ declare const index$1_withdrawableLpAmount: typeof withdrawableLpAmount;
962
985
  declare namespace index$1 {
963
- export { index$1_claimQuotePoolRebate as claimQuotePoolRebate, index$1_claimQuotePoolRebates as claimQuotePoolRebates, index$1_deposit as deposit, index$1_getLpPrice as getLpPrice, index$1_getRewards as getRewards, index$1_transfer as transfer, index$1_withdraw as withdraw };
986
+ export { index$1_claimQuotePoolRebate as claimQuotePoolRebate, index$1_claimQuotePoolRebates as claimQuotePoolRebates, index$1_deposit as deposit, index$1_getLpPrice as getLpPrice, index$1_getRewards as getRewards, index$1_transfer as transfer, index$1_withdraw as withdraw, index$1_withdrawableLpAmount as withdrawableLpAmount };
964
987
  }
965
988
 
966
- declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint] & {
989
+ declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint] & {
967
990
  quoteToken: string;
968
991
  baseReserveRatio: bigint;
969
992
  quoteReserveRatio: bigint;
970
993
  oracleFeeUsd: bigint;
971
- oracleRefundFeeUsd: bigint;
972
994
  poolPrimeThreshold: bigint;
973
995
  executionFee: bigint;
974
996
  maxExecutionFee: bigint;
@@ -1255,15 +1277,20 @@ declare class ConfigManager {
1255
1277
  auth(params: Pick<MyxClientConfig, "signer" | "getAccessToken">): void;
1256
1278
  private validateConfig;
1257
1279
  /**
1258
- * 获取有效的 accessToken,自动处理获取和刷新
1280
+ * 获取当前存储的 accessToken(不会自动刷新)
1281
+ * @returns Promise<string | null> 当前的 accessToken 或 null
1282
+ */
1283
+ getAccessToken(): Promise<string | null>;
1284
+ /**
1285
+ * 主动刷新 accessToken(需要前端明确调用)
1259
1286
  * @param forceRefresh 是否强制刷新
1260
- * @returns Promise<string | null> 有效的 accessToken 或 null
1287
+ * @returns Promise<string | null> 刷新后的 accessToken 或 null
1261
1288
  */
1262
1289
  private _getAccessTokenQueue;
1263
1290
  private _isGettingAccessToken;
1264
- getAccessToken(forceRefresh?: boolean): Promise<string | null>;
1291
+ refreshAccessToken(forceRefresh?: boolean): Promise<string | null>;
1265
1292
  private _processAccessTokenQueue;
1266
- private _getAccessToken;
1293
+ private _refreshAccessToken;
1267
1294
  /**
1268
1295
  * 设置 accessToken 和过期时间
1269
1296
  * @param token accessToken
@@ -1405,7 +1432,6 @@ declare class Utils {
1405
1432
  }>;
1406
1433
  buildUpdatePriceParams(poolId: string, chainId: number): Promise<{
1407
1434
  poolId: string;
1408
- referencePrice: bigint;
1409
1435
  oracleUpdateData: string;
1410
1436
  publishTime: number;
1411
1437
  oracleType: OracleType;
@@ -1421,16 +1447,20 @@ declare class Utils {
1421
1447
  marketPrice: string;
1422
1448
  }): Promise<{
1423
1449
  code: number;
1424
- data: [[string, bigint, bigint, bigint] & {
1450
+ data: [[string, bigint, bigint, bigint, bigint, bigint] & {
1425
1451
  poolToken: string;
1426
1452
  exchangeRate: bigint;
1427
1453
  poolTokenPrice: bigint;
1428
1454
  poolTokenSupply: bigint;
1429
- }, [string, bigint, bigint, bigint] & {
1455
+ totalDebt: bigint;
1456
+ baseCollateral: bigint;
1457
+ }, [string, bigint, bigint, bigint, bigint, bigint] & {
1430
1458
  poolToken: string;
1431
1459
  exchangeRate: bigint;
1432
1460
  poolTokenPrice: bigint;
1433
1461
  poolTokenSupply: bigint;
1462
+ totalDebt: bigint;
1463
+ baseCollateral: bigint;
1434
1464
  }, [bigint, bigint, bigint, bigint] & {
1435
1465
  baseTotalAmount: bigint;
1436
1466
  baseReservedAmount: bigint;
@@ -1449,17 +1479,21 @@ declare class Utils {
1449
1479
  windowCaps: bigint;
1450
1480
  openInterest: bigint;
1451
1481
  }] & {
1452
- basePool: [string, bigint, bigint, bigint] & {
1482
+ basePool: [string, bigint, bigint, bigint, bigint, bigint] & {
1453
1483
  poolToken: string;
1454
1484
  exchangeRate: bigint;
1455
1485
  poolTokenPrice: bigint;
1456
1486
  poolTokenSupply: bigint;
1487
+ totalDebt: bigint;
1488
+ baseCollateral: bigint;
1457
1489
  };
1458
- quotePool: [string, bigint, bigint, bigint] & {
1490
+ quotePool: [string, bigint, bigint, bigint, bigint, bigint] & {
1459
1491
  poolToken: string;
1460
1492
  exchangeRate: bigint;
1461
1493
  poolTokenPrice: bigint;
1462
1494
  poolTokenSupply: bigint;
1495
+ totalDebt: bigint;
1496
+ baseCollateral: bigint;
1463
1497
  };
1464
1498
  reserveInfo: [bigint, bigint, bigint, bigint] & {
1465
1499
  baseTotalAmount: bigint;
@@ -1512,7 +1546,9 @@ declare enum AppealReconsiderationType {
1512
1546
  Failed = 4,
1513
1547
  PlatformRuling = 6,
1514
1548
  PlatformRevoked = 7,
1515
- ReconsiderationVoting = 8
1549
+ ReconsiderationVoting = 8,
1550
+ AppealRevert = 9,
1551
+ NotAppealFailed = 10
1516
1552
  }
1517
1553
  declare enum AppealStage {
1518
1554
  UnderReview = 1,
@@ -1550,6 +1586,7 @@ interface AppealListItem {
1550
1586
  claimStatus: AppealClaimStatusEnum;
1551
1587
  baseAmount?: string;
1552
1588
  quoteAmount?: string;
1589
+ successVoteCount: number;
1553
1590
  }
1554
1591
  interface GetAppealDetailParams {
1555
1592
  caseId: number;
@@ -1603,6 +1640,7 @@ interface AppealDetail {
1603
1640
  claimStatus: AppealClaimStatusEnum;
1604
1641
  baseAmount?: string;
1605
1642
  quoteAmount?: string;
1643
+ successVoteCount: number;
1606
1644
  }
1607
1645
  interface AppealUploadEvidenceParams {
1608
1646
  caseId: number;
@@ -1634,7 +1672,11 @@ interface AppealReconsiderationListItem {
1634
1672
  publicNoticeEndTime: number;
1635
1673
  updateTime: number;
1636
1674
  appealCaseId?: number;
1637
- aappealBondClaimTime?: number;
1675
+ appealBondClaimTime?: number;
1676
+ successVoteCount: number;
1677
+ appealSuccessVoteCount?: number;
1678
+ appealTotalVoteCount?: number;
1679
+ appealVotedCount?: number;
1638
1680
  }
1639
1681
  interface GetAppealReconsiderationDetailParams {
1640
1682
  caseId: number;
@@ -1668,6 +1710,11 @@ interface AppealReconsiderationDetail {
1668
1710
  appealStage: AppealStage;
1669
1711
  appealBondState: AppealClaimStatusEnum;
1670
1712
  appealBondClaimTime?: number;
1713
+ txHash: string;
1714
+ appealStartTime: number;
1715
+ appealEndTime: number;
1716
+ appealSuccessVoteCount?: number;
1717
+ successVoteCount: number;
1671
1718
  }
1672
1719
  interface AppealReimbursementParams {
1673
1720
  before?: number;
@@ -1689,6 +1736,7 @@ interface AppealReimbursementItem {
1689
1736
  claimTime: number;
1690
1737
  expireTime: number;
1691
1738
  createTime: number;
1739
+ proof: string;
1692
1740
  }
1693
1741
  interface GetAppealNodeVoteListParams {
1694
1742
  before?: number;
@@ -1839,6 +1887,9 @@ declare class Api extends Request {
1839
1887
  getPedingVoteCount(): Promise<ApiResponse<number>>;
1840
1888
  getMyAppealCount(): Promise<ApiResponse<number>>;
1841
1889
  getWarmholeSign(params: GetWarmholeSignParams): Promise<ApiResponse<GetWarmholeSignResponse>>;
1890
+ getDisputeTotalCount(): Promise<ApiResponse<number>>;
1891
+ getAppealTotalCount(): Promise<ApiResponse<number>>;
1892
+ getReimbursementTotalCount(): Promise<ApiResponse<number>>;
1842
1893
  /**
1843
1894
  * appeal module end ------>
1844
1895
  */
@@ -2310,7 +2361,7 @@ declare class Order {
2310
2361
  message: any;
2311
2362
  data?: undefined;
2312
2363
  }>;
2313
- updateOrderTpSl(params: UpdateOrderParams, quoteAddress: string, chainId: number, address: string, marketId: string): Promise<{
2364
+ updateOrderTpSl(params: UpdateOrderParams, quoteAddress: string, chainId: number, address: string, marketId: string, isTpSlOrder?: boolean): Promise<{
2314
2365
  code: number;
2315
2366
  message: string;
2316
2367
  data: ApiResponse<any>;
@@ -2628,9 +2679,8 @@ interface BrokerInterface extends Interface {
2628
2679
  {
2629
2680
  poolId: BytesLike;
2630
2681
  oracleType: BigNumberish;
2631
- referencePrice: BigNumberish;
2632
- oracleUpdateData: BytesLike;
2633
2682
  publishTime: BigNumberish;
2683
+ oracleUpdateData: BytesLike;
2634
2684
  }[],
2635
2685
  {
2636
2686
  token: AddressLike;
@@ -3263,9 +3313,8 @@ interface Broker extends BaseContract {
3263
3313
  prices: {
3264
3314
  poolId: BytesLike;
3265
3315
  oracleType: BigNumberish;
3266
- referencePrice: BigNumberish;
3267
- oracleUpdateData: BytesLike;
3268
3316
  publishTime: BigNumberish;
3317
+ oracleUpdateData: BytesLike;
3269
3318
  }[],
3270
3319
  depositParams: {
3271
3320
  token: AddressLike;
@@ -3691,9 +3740,8 @@ interface Broker extends BaseContract {
3691
3740
  prices: {
3692
3741
  poolId: BytesLike;
3693
3742
  oracleType: BigNumberish;
3694
- referencePrice: BigNumberish;
3695
- oracleUpdateData: BytesLike;
3696
3743
  publishTime: BigNumberish;
3744
+ oracleUpdateData: BytesLike;
3697
3745
  }[],
3698
3746
  depositParams: {
3699
3747
  token: AddressLike;
@@ -3840,7 +3888,7 @@ declare class Appeal extends BaseMyxClient {
3840
3888
  * @param merkleProof - the merkle proof
3841
3889
  * @returns the transaction receipt
3842
3890
  */
3843
- claimReimbursement(caseId: number, baseAmount: number, quoteAmount: number, merkleProof: BytesLike[]): Promise<ethers.ContractTransactionReceipt | null>;
3891
+ claimReimbursement(caseId: number, baseAmount: string, quoteAmount: string, merkleProof: BytesLike[]): Promise<ethers.ContractTransactionReceipt | null>;
3844
3892
  /**
3845
3893
  * get dispute configuration
3846
3894
  */
@@ -3884,6 +3932,9 @@ declare class Appeal extends BaseMyxClient {
3884
3932
  getPedingVoteCount(): Promise<ApiResponse<number>>;
3885
3933
  getMyAppealCount(): Promise<ApiResponse<number>>;
3886
3934
  getWarmholeSign(params: GetWarmholeSignParams): Promise<ApiResponse<GetWarmholeSignResponse>>;
3935
+ getDisputeTotalCount(): Promise<ApiResponse<number>>;
3936
+ getAppealTotalCount(): Promise<ApiResponse<number>>;
3937
+ getReimbursementTotalCount(): Promise<ApiResponse<number>>;
3887
3938
  }
3888
3939
 
3889
3940
  declare class Referrals extends BaseMyxClient {
@@ -3925,9 +3976,14 @@ declare class MyxClient {
3925
3976
  */
3926
3977
  close(): void;
3927
3978
  /**
3928
- * get access token
3979
+ * 获取当前存储的 access token(不会自动刷新)
3929
3980
  */
3930
3981
  getAccessToken(): Promise<string | null>;
3982
+ /**
3983
+ * 主动刷新 access token(需要前端明确调用)
3984
+ * @param forceRefresh 是否强制刷新
3985
+ */
3986
+ refreshAccessToken(forceRefresh?: boolean): Promise<string | null>;
3931
3987
  }
3932
3988
 
3933
3989
  export { type AccessTokenRequest, type AccessTokenResponse$1 as AccessTokenResponse, type AccessTokenType, type AddFavoriteParams, type Address, type ApiResponse, AppealCaseTypeEnum, AppealClaimStatusEnum, type AppealDetail, type AppealListItem, AppealNodeStateEnum, type AppealNodeVoteItem, type AppealNodeVoteListItem, AppealNodeVotedStateEnum, type AppealReconsiderationDetail, type AppealReconsiderationItem, type AppealReconsiderationListItem, AppealReconsiderationType, type AppealReimbursementItem, type AppealReimbursementParams, AppealStage, AppealType, type AppealUploadEvidenceParams, type AppealVoteItem, type BaseDetailResponse, type BaseResponse, COMMON_LP_AMOUNT_DECIMALS, COMMON_PRICE_DECIMALS, ChainId, type ChainIdRequest, CloseTypeEnum, type DashboardType, Direction, DirectionEnum, ErrorCode, ExecTypeEnum, type FavoritesListItem, type FavoritesListParams, type FavoritesTimeInterval, type FavoritesType, type FetchForwarderGetParams, type FetchForwarderGetResponse, type FetchForwarderGetResponseData, ForwarderGetStatus, type ForwarderTxParams, type GetAppealDetailParams, type GetAppealListParams, type GetAppealNodeVoteListParams, type GetAppealReconsiderationDetailParams, type GetAppealReconsiderationListParams, type GetAppealVoteNodeDetailParams, type GetBaseDetailParams, type GetHistoryOrdersParams, type GetIsVoteNodeParams, type GetKlineDataParams, type GetMarketDetailParams, type GetPoolLevelConfigParams, type GetTickerDataParams, type GetWarmholeSignParams, type GetWarmholeSignResponse, type GuardianSignatureItem, type HistoryOrderItem, type HttpEnvParams, HttpKlineIntervalEnum, IsVoteNodeEnum, type KlineDataItemType, type KlineDataResponse, type KlineResolution, type LevelConfig, MarketCapType, type MarketDetailResponse, type MarketInfo, type MarketPool, type MarketPoolResponse, MarketPoolState, MarketType, MxSDK, MyxClient, type MyxClientConfig, type MyxSubscriptionOptions, type NetWorkFee, NodeTypeEnum, type ObjectType, type OnKlineCallback, type OnOrderCallback, type OnPositionCallback, type OnTickersAllCallback, type OnTickersCallback, OperationEnum, OperationType, OracleType, type Order$1 as Order, OrderStatus, OrderStatusEnum, OrderType, OrderTypeEnum, type PlaceOrderParams, type PoolLevelConfig, type PoolOpenOrder, type PoolOpenOrdersResponse, type PoolResponse, type PoolSymbolAllResponse, type Position$1 as Position, type PositionHistoryItem, type PositionResponse, type PositionTpSlOrderParams, type PositionType, type PostVoteResponse, type PostVoteSignatureParams, type PriceResponse, type PriceType, type RemoveFavoriteParams, type SearchMarketParams, type SearchResultContractItem, type SearchResultCookItem, type SearchResultEarnItem, type SearchResultResponse, SearchSecondTypeEnum, SearchTypeEnum, type StatDashBoardResponse, type TickerDataItem, type TickersDataResponse, TimeInForce, TradeFlowAccountTypeEnum, type TradeFlowItem, TradeFlowTypeEnum, type TradingResult, TriggerType, TriggerTypeEnum, type UpdateOrderTpSlParams, VoteTypeEnum, approve, index$2 as base, bigintAmountSlipperCalculator, bigintTradingGasPriceWithRatio, bigintTradingGasToRatioCalculator, getAllowanceApproved, getBalanceOf, getBaseDetail, getBaseUrlByEnv, getMarketDetail, getMarketList, getOraclePrice, getPoolDetail, getPoolList, getPoolOpenOrders, getPriceData, getPricesData, getTickerData, getTokenInfo, index as market, index$3 as pool, index$1 as quote };
package/dist/index.d.ts CHANGED
@@ -82,12 +82,16 @@ declare const getPoolInfo$1: (chainId: ChainId, poolId: string, marketPrice?: bi
82
82
  exchangeRate: bigint;
83
83
  poolTokenPrice: bigint;
84
84
  poolTokenSupply: bigint;
85
+ totalDebt: bigint;
86
+ baseCollateral: bigint;
85
87
  };
86
88
  basePool: {
87
89
  poolToken: string;
88
90
  exchangeRate: bigint;
89
91
  poolTokenPrice: bigint;
90
92
  poolTokenSupply: bigint;
93
+ totalDebt: bigint;
94
+ baseCollateral: bigint;
91
95
  };
92
96
  reserveInfo: {
93
97
  baseTotalAmount: bigint;
@@ -106,6 +110,10 @@ declare const getPoolInfo$1: (chainId: ChainId, poolId: string, marketPrice?: bi
106
110
  shortSize: bigint;
107
111
  poolEntryPrice: bigint;
108
112
  };
113
+ liquidityInfo: {
114
+ windowCaps: bigint;
115
+ openInterest: bigint;
116
+ };
109
117
  }>;
110
118
 
111
119
  declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<bigint>;
@@ -617,7 +625,8 @@ declare enum DirectionEnum {
617
625
  declare enum OrderStatusEnum {
618
626
  Cancelled = 1,
619
627
  Expired = 2,
620
- Successful = 9
628
+ Successful = 9,
629
+ PartialFilled = 8
621
630
  }
622
631
  declare enum ExecTypeEnum {
623
632
  Market = 1,// market order
@@ -921,9 +930,17 @@ declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<ethe
921
930
 
922
931
  declare const deposit$1: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
923
932
 
933
+ declare const withdrawableLpAmount$1: (params: {
934
+ chainId: ChainId;
935
+ poolId: string;
936
+ price?: bigint;
937
+ }) => Promise<bigint>;
924
938
  declare const withdraw$1: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
925
939
 
926
- declare const getRewards$1: (params: RewardsParams) => Promise<bigint | undefined>;
940
+ declare const getRewards$1: (params: RewardsParams) => Promise<{
941
+ rebates: bigint;
942
+ genesisRebates: bigint;
943
+ } | undefined>;
927
944
 
928
945
  declare const previewUserWithdrawData: ({ chainId, account, poolId, amount }: PreviewWithdrawDataParams) => Promise<{
929
946
  baseAmountOut: bigint;
@@ -936,11 +953,16 @@ declare const index$2_claimBasePoolRebate: typeof claimBasePoolRebate;
936
953
  declare const index$2_claimBasePoolRebates: typeof claimBasePoolRebates;
937
954
  declare const index$2_previewUserWithdrawData: typeof previewUserWithdrawData;
938
955
  declare namespace index$2 {
939
- export { index$2_claimBasePoolRebate as claimBasePoolRebate, index$2_claimBasePoolRebates as claimBasePoolRebates, deposit$1 as deposit, getLpPrice$1 as getLpPrice, getRewards$1 as getRewards, index$2_previewUserWithdrawData as previewUserWithdrawData, withdraw$1 as withdraw };
956
+ export { index$2_claimBasePoolRebate as claimBasePoolRebate, index$2_claimBasePoolRebates as claimBasePoolRebates, deposit$1 as deposit, getLpPrice$1 as getLpPrice, getRewards$1 as getRewards, index$2_previewUserWithdrawData as previewUserWithdrawData, withdraw$1 as withdraw, withdrawableLpAmount$1 as withdrawableLpAmount };
940
957
  }
941
958
 
942
959
  declare const deposit: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
943
960
 
961
+ declare const withdrawableLpAmount: (params: {
962
+ chainId: ChainId;
963
+ poolId: string;
964
+ price?: bigint;
965
+ }) => Promise<bigint>;
944
966
  declare const withdraw: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
945
967
 
946
968
  declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<ethers.ContractTransactionResponse | null>;
@@ -959,16 +981,16 @@ declare const index$1_getLpPrice: typeof getLpPrice;
959
981
  declare const index$1_getRewards: typeof getRewards;
960
982
  declare const index$1_transfer: typeof transfer;
961
983
  declare const index$1_withdraw: typeof withdraw;
984
+ declare const index$1_withdrawableLpAmount: typeof withdrawableLpAmount;
962
985
  declare namespace index$1 {
963
- export { index$1_claimQuotePoolRebate as claimQuotePoolRebate, index$1_claimQuotePoolRebates as claimQuotePoolRebates, index$1_deposit as deposit, index$1_getLpPrice as getLpPrice, index$1_getRewards as getRewards, index$1_transfer as transfer, index$1_withdraw as withdraw };
986
+ export { index$1_claimQuotePoolRebate as claimQuotePoolRebate, index$1_claimQuotePoolRebates as claimQuotePoolRebates, index$1_deposit as deposit, index$1_getLpPrice as getLpPrice, index$1_getRewards as getRewards, index$1_transfer as transfer, index$1_withdraw as withdraw, index$1_withdrawableLpAmount as withdrawableLpAmount };
964
987
  }
965
988
 
966
- declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint] & {
989
+ declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint] & {
967
990
  quoteToken: string;
968
991
  baseReserveRatio: bigint;
969
992
  quoteReserveRatio: bigint;
970
993
  oracleFeeUsd: bigint;
971
- oracleRefundFeeUsd: bigint;
972
994
  poolPrimeThreshold: bigint;
973
995
  executionFee: bigint;
974
996
  maxExecutionFee: bigint;
@@ -1255,15 +1277,20 @@ declare class ConfigManager {
1255
1277
  auth(params: Pick<MyxClientConfig, "signer" | "getAccessToken">): void;
1256
1278
  private validateConfig;
1257
1279
  /**
1258
- * 获取有效的 accessToken,自动处理获取和刷新
1280
+ * 获取当前存储的 accessToken(不会自动刷新)
1281
+ * @returns Promise<string | null> 当前的 accessToken 或 null
1282
+ */
1283
+ getAccessToken(): Promise<string | null>;
1284
+ /**
1285
+ * 主动刷新 accessToken(需要前端明确调用)
1259
1286
  * @param forceRefresh 是否强制刷新
1260
- * @returns Promise<string | null> 有效的 accessToken 或 null
1287
+ * @returns Promise<string | null> 刷新后的 accessToken 或 null
1261
1288
  */
1262
1289
  private _getAccessTokenQueue;
1263
1290
  private _isGettingAccessToken;
1264
- getAccessToken(forceRefresh?: boolean): Promise<string | null>;
1291
+ refreshAccessToken(forceRefresh?: boolean): Promise<string | null>;
1265
1292
  private _processAccessTokenQueue;
1266
- private _getAccessToken;
1293
+ private _refreshAccessToken;
1267
1294
  /**
1268
1295
  * 设置 accessToken 和过期时间
1269
1296
  * @param token accessToken
@@ -1405,7 +1432,6 @@ declare class Utils {
1405
1432
  }>;
1406
1433
  buildUpdatePriceParams(poolId: string, chainId: number): Promise<{
1407
1434
  poolId: string;
1408
- referencePrice: bigint;
1409
1435
  oracleUpdateData: string;
1410
1436
  publishTime: number;
1411
1437
  oracleType: OracleType;
@@ -1421,16 +1447,20 @@ declare class Utils {
1421
1447
  marketPrice: string;
1422
1448
  }): Promise<{
1423
1449
  code: number;
1424
- data: [[string, bigint, bigint, bigint] & {
1450
+ data: [[string, bigint, bigint, bigint, bigint, bigint] & {
1425
1451
  poolToken: string;
1426
1452
  exchangeRate: bigint;
1427
1453
  poolTokenPrice: bigint;
1428
1454
  poolTokenSupply: bigint;
1429
- }, [string, bigint, bigint, bigint] & {
1455
+ totalDebt: bigint;
1456
+ baseCollateral: bigint;
1457
+ }, [string, bigint, bigint, bigint, bigint, bigint] & {
1430
1458
  poolToken: string;
1431
1459
  exchangeRate: bigint;
1432
1460
  poolTokenPrice: bigint;
1433
1461
  poolTokenSupply: bigint;
1462
+ totalDebt: bigint;
1463
+ baseCollateral: bigint;
1434
1464
  }, [bigint, bigint, bigint, bigint] & {
1435
1465
  baseTotalAmount: bigint;
1436
1466
  baseReservedAmount: bigint;
@@ -1449,17 +1479,21 @@ declare class Utils {
1449
1479
  windowCaps: bigint;
1450
1480
  openInterest: bigint;
1451
1481
  }] & {
1452
- basePool: [string, bigint, bigint, bigint] & {
1482
+ basePool: [string, bigint, bigint, bigint, bigint, bigint] & {
1453
1483
  poolToken: string;
1454
1484
  exchangeRate: bigint;
1455
1485
  poolTokenPrice: bigint;
1456
1486
  poolTokenSupply: bigint;
1487
+ totalDebt: bigint;
1488
+ baseCollateral: bigint;
1457
1489
  };
1458
- quotePool: [string, bigint, bigint, bigint] & {
1490
+ quotePool: [string, bigint, bigint, bigint, bigint, bigint] & {
1459
1491
  poolToken: string;
1460
1492
  exchangeRate: bigint;
1461
1493
  poolTokenPrice: bigint;
1462
1494
  poolTokenSupply: bigint;
1495
+ totalDebt: bigint;
1496
+ baseCollateral: bigint;
1463
1497
  };
1464
1498
  reserveInfo: [bigint, bigint, bigint, bigint] & {
1465
1499
  baseTotalAmount: bigint;
@@ -1512,7 +1546,9 @@ declare enum AppealReconsiderationType {
1512
1546
  Failed = 4,
1513
1547
  PlatformRuling = 6,
1514
1548
  PlatformRevoked = 7,
1515
- ReconsiderationVoting = 8
1549
+ ReconsiderationVoting = 8,
1550
+ AppealRevert = 9,
1551
+ NotAppealFailed = 10
1516
1552
  }
1517
1553
  declare enum AppealStage {
1518
1554
  UnderReview = 1,
@@ -1550,6 +1586,7 @@ interface AppealListItem {
1550
1586
  claimStatus: AppealClaimStatusEnum;
1551
1587
  baseAmount?: string;
1552
1588
  quoteAmount?: string;
1589
+ successVoteCount: number;
1553
1590
  }
1554
1591
  interface GetAppealDetailParams {
1555
1592
  caseId: number;
@@ -1603,6 +1640,7 @@ interface AppealDetail {
1603
1640
  claimStatus: AppealClaimStatusEnum;
1604
1641
  baseAmount?: string;
1605
1642
  quoteAmount?: string;
1643
+ successVoteCount: number;
1606
1644
  }
1607
1645
  interface AppealUploadEvidenceParams {
1608
1646
  caseId: number;
@@ -1634,7 +1672,11 @@ interface AppealReconsiderationListItem {
1634
1672
  publicNoticeEndTime: number;
1635
1673
  updateTime: number;
1636
1674
  appealCaseId?: number;
1637
- aappealBondClaimTime?: number;
1675
+ appealBondClaimTime?: number;
1676
+ successVoteCount: number;
1677
+ appealSuccessVoteCount?: number;
1678
+ appealTotalVoteCount?: number;
1679
+ appealVotedCount?: number;
1638
1680
  }
1639
1681
  interface GetAppealReconsiderationDetailParams {
1640
1682
  caseId: number;
@@ -1668,6 +1710,11 @@ interface AppealReconsiderationDetail {
1668
1710
  appealStage: AppealStage;
1669
1711
  appealBondState: AppealClaimStatusEnum;
1670
1712
  appealBondClaimTime?: number;
1713
+ txHash: string;
1714
+ appealStartTime: number;
1715
+ appealEndTime: number;
1716
+ appealSuccessVoteCount?: number;
1717
+ successVoteCount: number;
1671
1718
  }
1672
1719
  interface AppealReimbursementParams {
1673
1720
  before?: number;
@@ -1689,6 +1736,7 @@ interface AppealReimbursementItem {
1689
1736
  claimTime: number;
1690
1737
  expireTime: number;
1691
1738
  createTime: number;
1739
+ proof: string;
1692
1740
  }
1693
1741
  interface GetAppealNodeVoteListParams {
1694
1742
  before?: number;
@@ -1839,6 +1887,9 @@ declare class Api extends Request {
1839
1887
  getPedingVoteCount(): Promise<ApiResponse<number>>;
1840
1888
  getMyAppealCount(): Promise<ApiResponse<number>>;
1841
1889
  getWarmholeSign(params: GetWarmholeSignParams): Promise<ApiResponse<GetWarmholeSignResponse>>;
1890
+ getDisputeTotalCount(): Promise<ApiResponse<number>>;
1891
+ getAppealTotalCount(): Promise<ApiResponse<number>>;
1892
+ getReimbursementTotalCount(): Promise<ApiResponse<number>>;
1842
1893
  /**
1843
1894
  * appeal module end ------>
1844
1895
  */
@@ -2310,7 +2361,7 @@ declare class Order {
2310
2361
  message: any;
2311
2362
  data?: undefined;
2312
2363
  }>;
2313
- updateOrderTpSl(params: UpdateOrderParams, quoteAddress: string, chainId: number, address: string, marketId: string): Promise<{
2364
+ updateOrderTpSl(params: UpdateOrderParams, quoteAddress: string, chainId: number, address: string, marketId: string, isTpSlOrder?: boolean): Promise<{
2314
2365
  code: number;
2315
2366
  message: string;
2316
2367
  data: ApiResponse<any>;
@@ -2628,9 +2679,8 @@ interface BrokerInterface extends Interface {
2628
2679
  {
2629
2680
  poolId: BytesLike;
2630
2681
  oracleType: BigNumberish;
2631
- referencePrice: BigNumberish;
2632
- oracleUpdateData: BytesLike;
2633
2682
  publishTime: BigNumberish;
2683
+ oracleUpdateData: BytesLike;
2634
2684
  }[],
2635
2685
  {
2636
2686
  token: AddressLike;
@@ -3263,9 +3313,8 @@ interface Broker extends BaseContract {
3263
3313
  prices: {
3264
3314
  poolId: BytesLike;
3265
3315
  oracleType: BigNumberish;
3266
- referencePrice: BigNumberish;
3267
- oracleUpdateData: BytesLike;
3268
3316
  publishTime: BigNumberish;
3317
+ oracleUpdateData: BytesLike;
3269
3318
  }[],
3270
3319
  depositParams: {
3271
3320
  token: AddressLike;
@@ -3691,9 +3740,8 @@ interface Broker extends BaseContract {
3691
3740
  prices: {
3692
3741
  poolId: BytesLike;
3693
3742
  oracleType: BigNumberish;
3694
- referencePrice: BigNumberish;
3695
- oracleUpdateData: BytesLike;
3696
3743
  publishTime: BigNumberish;
3744
+ oracleUpdateData: BytesLike;
3697
3745
  }[],
3698
3746
  depositParams: {
3699
3747
  token: AddressLike;
@@ -3840,7 +3888,7 @@ declare class Appeal extends BaseMyxClient {
3840
3888
  * @param merkleProof - the merkle proof
3841
3889
  * @returns the transaction receipt
3842
3890
  */
3843
- claimReimbursement(caseId: number, baseAmount: number, quoteAmount: number, merkleProof: BytesLike[]): Promise<ethers.ContractTransactionReceipt | null>;
3891
+ claimReimbursement(caseId: number, baseAmount: string, quoteAmount: string, merkleProof: BytesLike[]): Promise<ethers.ContractTransactionReceipt | null>;
3844
3892
  /**
3845
3893
  * get dispute configuration
3846
3894
  */
@@ -3884,6 +3932,9 @@ declare class Appeal extends BaseMyxClient {
3884
3932
  getPedingVoteCount(): Promise<ApiResponse<number>>;
3885
3933
  getMyAppealCount(): Promise<ApiResponse<number>>;
3886
3934
  getWarmholeSign(params: GetWarmholeSignParams): Promise<ApiResponse<GetWarmholeSignResponse>>;
3935
+ getDisputeTotalCount(): Promise<ApiResponse<number>>;
3936
+ getAppealTotalCount(): Promise<ApiResponse<number>>;
3937
+ getReimbursementTotalCount(): Promise<ApiResponse<number>>;
3887
3938
  }
3888
3939
 
3889
3940
  declare class Referrals extends BaseMyxClient {
@@ -3925,9 +3976,14 @@ declare class MyxClient {
3925
3976
  */
3926
3977
  close(): void;
3927
3978
  /**
3928
- * get access token
3979
+ * 获取当前存储的 access token(不会自动刷新)
3929
3980
  */
3930
3981
  getAccessToken(): Promise<string | null>;
3982
+ /**
3983
+ * 主动刷新 access token(需要前端明确调用)
3984
+ * @param forceRefresh 是否强制刷新
3985
+ */
3986
+ refreshAccessToken(forceRefresh?: boolean): Promise<string | null>;
3931
3987
  }
3932
3988
 
3933
3989
  export { type AccessTokenRequest, type AccessTokenResponse$1 as AccessTokenResponse, type AccessTokenType, type AddFavoriteParams, type Address, type ApiResponse, AppealCaseTypeEnum, AppealClaimStatusEnum, type AppealDetail, type AppealListItem, AppealNodeStateEnum, type AppealNodeVoteItem, type AppealNodeVoteListItem, AppealNodeVotedStateEnum, type AppealReconsiderationDetail, type AppealReconsiderationItem, type AppealReconsiderationListItem, AppealReconsiderationType, type AppealReimbursementItem, type AppealReimbursementParams, AppealStage, AppealType, type AppealUploadEvidenceParams, type AppealVoteItem, type BaseDetailResponse, type BaseResponse, COMMON_LP_AMOUNT_DECIMALS, COMMON_PRICE_DECIMALS, ChainId, type ChainIdRequest, CloseTypeEnum, type DashboardType, Direction, DirectionEnum, ErrorCode, ExecTypeEnum, type FavoritesListItem, type FavoritesListParams, type FavoritesTimeInterval, type FavoritesType, type FetchForwarderGetParams, type FetchForwarderGetResponse, type FetchForwarderGetResponseData, ForwarderGetStatus, type ForwarderTxParams, type GetAppealDetailParams, type GetAppealListParams, type GetAppealNodeVoteListParams, type GetAppealReconsiderationDetailParams, type GetAppealReconsiderationListParams, type GetAppealVoteNodeDetailParams, type GetBaseDetailParams, type GetHistoryOrdersParams, type GetIsVoteNodeParams, type GetKlineDataParams, type GetMarketDetailParams, type GetPoolLevelConfigParams, type GetTickerDataParams, type GetWarmholeSignParams, type GetWarmholeSignResponse, type GuardianSignatureItem, type HistoryOrderItem, type HttpEnvParams, HttpKlineIntervalEnum, IsVoteNodeEnum, type KlineDataItemType, type KlineDataResponse, type KlineResolution, type LevelConfig, MarketCapType, type MarketDetailResponse, type MarketInfo, type MarketPool, type MarketPoolResponse, MarketPoolState, MarketType, MxSDK, MyxClient, type MyxClientConfig, type MyxSubscriptionOptions, type NetWorkFee, NodeTypeEnum, type ObjectType, type OnKlineCallback, type OnOrderCallback, type OnPositionCallback, type OnTickersAllCallback, type OnTickersCallback, OperationEnum, OperationType, OracleType, type Order$1 as Order, OrderStatus, OrderStatusEnum, OrderType, OrderTypeEnum, type PlaceOrderParams, type PoolLevelConfig, type PoolOpenOrder, type PoolOpenOrdersResponse, type PoolResponse, type PoolSymbolAllResponse, type Position$1 as Position, type PositionHistoryItem, type PositionResponse, type PositionTpSlOrderParams, type PositionType, type PostVoteResponse, type PostVoteSignatureParams, type PriceResponse, type PriceType, type RemoveFavoriteParams, type SearchMarketParams, type SearchResultContractItem, type SearchResultCookItem, type SearchResultEarnItem, type SearchResultResponse, SearchSecondTypeEnum, SearchTypeEnum, type StatDashBoardResponse, type TickerDataItem, type TickersDataResponse, TimeInForce, TradeFlowAccountTypeEnum, type TradeFlowItem, TradeFlowTypeEnum, type TradingResult, TriggerType, TriggerTypeEnum, type UpdateOrderTpSlParams, VoteTypeEnum, approve, index$2 as base, bigintAmountSlipperCalculator, bigintTradingGasPriceWithRatio, bigintTradingGasToRatioCalculator, getAllowanceApproved, getBalanceOf, getBaseDetail, getBaseUrlByEnv, getMarketDetail, getMarketList, getOraclePrice, getPoolDetail, getPoolList, getPoolOpenOrders, getPriceData, getPricesData, getTickerData, getTokenInfo, index as market, index$3 as pool, index$1 as quote };