@myx-trade/sdk 0.1.192 → 0.1.194

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.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { AddressLike, Signer, ethers } from 'ethers';
1
+ import * as ethers from 'ethers';
2
+ import { AddressLike, Signer, ethers as ethers$1 } from 'ethers';
2
3
  export { formatUnits, parseUnits } from 'ethers';
3
4
  import { Options, Event } from 'reconnecting-websocket';
4
5
  import { WalletClient } from 'viem';
@@ -48,49 +49,49 @@ interface CancelTpSLParams {
48
49
  orderId: string;
49
50
  }
50
51
 
51
- declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<any>;
52
+ declare const createPool: ({ chainId, baseToken, marketId }: CreatePoolRequest) => Promise<string | undefined>;
52
53
 
53
- declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<any>;
54
- declare const getMarketPools: (chainId: ChainId) => Promise<any>;
54
+ declare const getMarketPoolId: ({ chainId, baseToken, marketId, }: CreatePoolRequest) => Promise<string | undefined>;
55
+ declare const getMarketPools: (chainId: ChainId) => Promise<string[]>;
55
56
  declare const getPoolInfo$1: (chainId: ChainId, poolId: string, marketPrice?: bigint) => Promise<{
56
57
  quotePool: {
57
- poolToken: any;
58
- exchangeRate: any;
59
- poolTokenPrice: any;
60
- poolTokenSupply: any;
58
+ poolToken: string;
59
+ exchangeRate: bigint;
60
+ poolTokenPrice: bigint;
61
+ poolTokenSupply: bigint;
61
62
  };
62
63
  basePool: {
63
- poolToken: any;
64
- exchangeRate: any;
65
- poolTokenPrice: any;
66
- poolTokenSupply: any;
64
+ poolToken: string;
65
+ exchangeRate: bigint;
66
+ poolTokenPrice: bigint;
67
+ poolTokenSupply: bigint;
67
68
  };
68
69
  reserveInfo: {
69
- baseTotalAmount: any;
70
- baseReservedAmount: any;
71
- quoteTotalAmount: any;
72
- quoteReservedAmount: any;
70
+ baseTotalAmount: bigint;
71
+ baseReservedAmount: bigint;
72
+ quoteTotalAmount: bigint;
73
+ quoteReservedAmount: bigint;
73
74
  };
74
75
  fundingInfo: {
75
- nextFundingRate: any;
76
- lastFundingFeeTracker: any;
77
- nextEpochTime: any;
76
+ nextFundingRate: bigint;
77
+ lastFundingFeeTracker: bigint;
78
+ nextEpochTime: bigint;
78
79
  };
79
80
  ioTracker: {
80
- tracker: any;
81
- longSize: any;
82
- shortSize: any;
83
- poolEntryPrice: any;
81
+ tracker: bigint;
82
+ longSize: bigint;
83
+ shortSize: bigint;
84
+ poolEntryPrice: bigint;
84
85
  };
85
86
  }>;
86
87
 
87
- declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<any>;
88
+ declare const getUserGenesisShare: (chainId: ChainId, tokenAddress: string, account: string) => Promise<bigint>;
88
89
 
89
- declare const addTpSl: (params: AddTpSLParams) => Promise<any>;
90
+ declare const addTpSl: (params: AddTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
90
91
 
91
- declare const cancelTpSl: (params: CancelTpSLParams) => Promise<any>;
92
+ declare const cancelTpSl: (params: CancelTpSLParams) => Promise<ethers.ContractTransactionReceipt | null>;
92
93
 
93
- declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<any>;
94
+ declare const reprime: (chainId: ChainId, poolId: string, marketId: string) => Promise<ethers.ContractTransactionReceipt | null>;
94
95
 
95
96
  /**
96
97
  * Trading related types and enums
@@ -645,10 +646,6 @@ interface HistoryOrderItem {
645
646
  userLeverage: number;
646
647
  cancelReason?: string;
647
648
  }
648
- /**
649
- * Get history orders
650
- */
651
- declare const getHistoryOrders: ({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest, envParams: HttpEnvParams) => Promise<ApiResponse<HistoryOrderItem[]>>;
652
649
  /**
653
650
  * Get position history
654
651
  */
@@ -684,7 +681,6 @@ interface PositionHistoryItem {
684
681
  closeType: CloseTypeEnum;
685
682
  avgClosePrice: string;
686
683
  }
687
- declare const getPositionHistory: ({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest, envParams: HttpEnvParams) => Promise<ApiResponse<PositionHistoryItem[]>>;
688
684
  /**
689
685
  * Get Trade Flow
690
686
  */
@@ -715,7 +711,6 @@ interface TradeFlowItem {
715
711
  referralRebate: string;
716
712
  rebateClaimedAmount: string;
717
713
  }
718
- declare const getTradeFlow: ({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest, envParams: HttpEnvParams) => Promise<ApiResponse<TradeFlowItem[]>>;
719
714
 
720
715
  type ForwarderTxParams = {
721
716
  from: string;
@@ -727,7 +722,6 @@ type ForwarderTxParams = {
727
722
  deadline: number;
728
723
  signature: string;
729
724
  };
730
- declare const forwarderTxApi: (params: ForwarderTxParams, chainId: number, isProd?: boolean) => Promise<ApiResponse<any>>;
731
725
  type FetchForwarderGetParams = {
732
726
  requestId: string;
733
727
  };
@@ -743,11 +737,8 @@ type FetchForwarderGetResponseData = {
743
737
  reason: string;
744
738
  };
745
739
  type FetchForwarderGetResponse = BaseResponse<FetchForwarderGetResponseData>;
746
- declare const fetchForwarderGetApi: (params: FetchForwarderGetParams, isProd?: boolean) => Promise<FetchForwarderGetResponse>;
747
740
 
748
- declare const getPoolList: ({ isProd, }: {
749
- isProd?: boolean;
750
- }) => Promise<ApiResponse<any[]>>;
741
+ declare const getPoolList: () => Promise<ApiResponse<any[]>>;
751
742
  interface PoolSymbolAllResponse {
752
743
  chainId: number;
753
744
  marketId: string;
@@ -756,13 +747,10 @@ interface PoolSymbolAllResponse {
756
747
  quoteSymbol: string;
757
748
  baseTokenIcon: string;
758
749
  }
759
- declare const getPoolSymbolAll: ({ isProd, }: {
760
- isProd?: boolean;
761
- }) => Promise<ApiResponse<PoolSymbolAllResponse[]>>;
762
750
 
763
- declare const getBaseUrlByEnv: (isProd: boolean) => "https://api.myx.finance" | "https://api-test.myx.cash";
764
- declare const getForwardUrlByEnv: (isProd: boolean) => "https://api.myx.finance/v2/agent" | "https://api-test.myx.cash/v2/agent";
765
- declare const getOraclePrice: (chainId: ChainId, poolIds?: string[], isProd?: boolean) => Promise<PriceResponse>;
751
+ declare const getBaseUrlByEnv: (isProd?: boolean) => "https://api.myx.finance" | "https://api-test.myx.cash";
752
+ declare const getForwardUrlByEnv: (isProd?: boolean) => string;
753
+ declare const getOraclePrice: (chainId: ChainId, poolIds?: string[]) => Promise<PriceResponse>;
766
754
  interface LevelConfig {
767
755
  fundingFeeRate1: number;
768
756
  fundingFeeRate1Max: number;
@@ -790,11 +778,8 @@ interface GetPoolLevelConfigParams {
790
778
  /**
791
779
  * Get Pool Level Config
792
780
  */
793
- declare const getPoolLevelConfig: ({ poolId, chainId, isProd, }: GetPoolLevelConfigParams) => Promise<ApiResponse<PoolLevelConfig>>;
794
781
  declare const getPoolDetail: (chainId: number, poolId: string, isProd?: boolean) => Promise<PoolResponse>;
795
- declare const getPositions: (accessToken: string, address: string, isProd?: boolean) => Promise<PositionResponse>;
796
- declare const getOrders: (accessToken: string, address: string, isProd?: boolean) => Promise<PositionResponse>;
797
- declare const getPoolOpenOrders: (accessToken: string, address: string, chainId: ChainId, isProd?: boolean) => Promise<PoolOpenOrdersResponse>;
782
+ declare const getPoolOpenOrders: (accessToken: string, address: string, chainId: ChainId) => Promise<PoolOpenOrdersResponse>;
798
783
  /**
799
784
  * Get Kline Data
800
785
  */
@@ -805,17 +790,14 @@ interface GetKlineDataParams {
805
790
  limit: number;
806
791
  interval: HttpKlineIntervalEnum;
807
792
  }
808
- declare const getKlineData: ({ chainId, poolId, endTime, limit, interval }: GetKlineDataParams, envParams: HttpEnvParams) => Promise<ApiResponse<KlineDataItemType[]>>;
809
793
  /**
810
794
  * Get Kline Latest Bar
811
795
  */
812
- declare const getKlineLatestBar: (params: Pick<GetKlineDataParams, "chainId" | "poolId" | "interval">, envParams: HttpEnvParams) => Promise<ApiResponse<KlineDataItemType>>;
813
796
  interface GetTickerDataParams {
814
797
  chainId: ChainId;
815
798
  poolIds: string[];
816
799
  }
817
800
  declare const getTickerData: ({ chainId, poolIds }: GetTickerDataParams, envParams: HttpEnvParams) => Promise<ApiResponse<TickerDataItem[]>>;
818
- declare const getAllTickers: (envParams: HttpEnvParams) => Promise<ApiResponse<TickerDataItem[]>>;
819
801
  /**
820
802
  * search
821
803
  */
@@ -825,8 +807,6 @@ interface SearchMarketParams {
825
807
  type?: SearchSecondTypeEnum;
826
808
  searchKey?: string;
827
809
  }
828
- declare const searchMarketAuth: ({ accessToken, address, ...params }: SearchMarketParams & AccessTokenRequest, envParams: HttpEnvParams) => Promise<ApiResponse<SearchResultResponse>>;
829
- declare const searchMarket: ({ ...params }: SearchMarketParams, envParams: HttpEnvParams) => Promise<ApiResponse<SearchResultResponse>>;
830
810
  /**
831
811
  * favorite
832
812
  */
@@ -834,12 +814,10 @@ interface AddFavoriteParams {
834
814
  poolId: string;
835
815
  chainId: ChainId;
836
816
  }
837
- declare const addFavorite: ({ accessToken, address, ...params }: AddFavoriteParams & AccessTokenRequest, envParams: HttpEnvParams) => Promise<ApiResponse<null>>;
838
817
  interface RemoveFavoriteParams {
839
818
  poolId: string;
840
819
  chainId: ChainId;
841
820
  }
842
- declare const removeFavorite: ({ accessToken, address, ...params }: RemoveFavoriteParams & AccessTokenRequest, envParams: HttpEnvParams) => Promise<ApiResponse<null>>;
843
821
  /**
844
822
  * Favorites List
845
823
  */
@@ -852,18 +830,17 @@ interface FavoritesListParams {
852
830
  timeInterval?: FavoritesTimeInterval;
853
831
  chainId: ChainId | 0;
854
832
  }
855
- declare const getFavoritesList: ({ accessToken, address, ...params }: FavoritesListParams & AccessTokenRequest, envParams: HttpEnvParams) => Promise<ApiResponse<FavoritesListItem[]>>;
856
833
  interface GetBaseDetailParams {
857
834
  chainId: ChainId;
858
835
  poolId: string;
859
836
  }
860
- declare const getBaseDetail: ({ ...params }: GetBaseDetailParams, envParams: HttpEnvParams) => Promise<ApiResponse<BaseDetailResponse>>;
837
+ declare const getBaseDetail: ({ ...params }: GetBaseDetailParams) => Promise<ApiResponse<BaseDetailResponse>>;
861
838
  interface GetMarketDetailParams {
862
839
  chainId: number;
863
840
  poolId: string;
864
841
  }
865
- declare const getMarketDetail: ({ ...params }: GetMarketDetailParams, envParams: HttpEnvParams) => Promise<ApiResponse<MarketDetailResponse>>;
866
- declare const getMarketList: (envParams: HttpEnvParams) => Promise<ApiResponse<MarketInfo[]>>;
842
+ declare const getMarketDetail: ({ ...params }: GetMarketDetailParams) => Promise<ApiResponse<MarketDetailResponse>>;
843
+ declare const getMarketList: () => Promise<ApiResponse<MarketInfo[]>>;
867
844
 
868
845
  declare const getPoolInfo: (chainId: ChainId, poolId: string) => Promise<MarketPool | undefined>;
869
846
 
@@ -923,21 +900,21 @@ interface PreviewWithdrawDataParams {
923
900
  amount: string | number;
924
901
  }
925
902
 
926
- declare const claimBasePoolRebate: (params: ClaimParams) => Promise<any>;
927
- declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
903
+ declare const claimBasePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
904
+ declare const claimBasePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
928
905
 
929
- declare const deposit$1: (params: Deposit) => Promise<any>;
906
+ declare const deposit$1: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
930
907
 
931
- declare const withdraw$1: (params: WithdrawParams) => Promise<any>;
908
+ declare const withdraw$1: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
932
909
 
933
- declare const getRewards$1: (params: RewardsParams) => Promise<any>;
910
+ declare const getRewards$1: (params: RewardsParams) => Promise<bigint | undefined>;
934
911
 
935
912
  declare const previewUserWithdrawData: ({ chainId, account, poolId, amount }: PreviewWithdrawDataParams) => Promise<{
936
- baseAmountOut: any;
937
- rebateAmount: any;
913
+ baseAmountOut: bigint;
914
+ rebateAmount: bigint;
938
915
  } | undefined>;
939
916
 
940
- declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<any>;
917
+ declare const getLpPrice$1: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
941
918
 
942
919
  declare const index$2_claimBasePoolRebate: typeof claimBasePoolRebate;
943
920
  declare const index$2_claimBasePoolRebates: typeof claimBasePoolRebates;
@@ -946,18 +923,18 @@ declare namespace index$2 {
946
923
  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 };
947
924
  }
948
925
 
949
- declare const deposit: (params: Deposit) => Promise<any>;
926
+ declare const deposit: (params: Deposit) => Promise<ethers.ContractTransactionResponse | undefined>;
950
927
 
951
- declare const withdraw: (params: WithdrawParams) => Promise<any>;
928
+ declare const withdraw: (params: WithdrawParams) => Promise<ethers.ContractTransactionReceipt | null | undefined>;
952
929
 
953
- declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<any>;
930
+ declare const transfer: (chainId: ChainId, fromPoolId: string, toPoolId: string, amount: number) => Promise<ethers.ContractTransactionResponse | null>;
954
931
 
955
- declare const getRewards: (params: RewardsParams) => Promise<any>;
932
+ declare const getRewards: (params: RewardsParams) => Promise<bigint | undefined>;
956
933
 
957
- declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<any>;
958
- declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<any>;
934
+ declare const claimQuotePoolRebate: (params: ClaimParams) => Promise<ethers.ContractTransactionResponse | undefined>;
935
+ declare const claimQuotePoolRebates: (params: ClaimRebatesParams) => Promise<ethers.ContractTransactionResponse | undefined>;
959
936
 
960
- declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<any>;
937
+ declare const getLpPrice: (chainId: ChainId, poolId: string) => Promise<bigint | undefined>;
961
938
 
962
939
  declare const index$1_claimQuotePoolRebate: typeof claimQuotePoolRebate;
963
940
  declare const index$1_claimQuotePoolRebates: typeof claimQuotePoolRebates;
@@ -970,9 +947,16 @@ declare namespace index$1 {
970
947
  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 };
971
948
  }
972
949
 
973
- declare const getMarket: (chainId: ChainId, marketId: string) => Promise<any>;
950
+ declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, bigint, bigint, bigint, bigint, bigint] & {
951
+ quoteToken: string;
952
+ baseReserveRatio: bigint;
953
+ quoteReserveRatio: bigint;
954
+ oracleFeeUsd: bigint;
955
+ oracleRefundFeeUsd: bigint;
956
+ poolPrimeThreshold: bigint;
957
+ }) | undefined>;
974
958
 
975
- declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<any>;
959
+ declare const getOracleFee: (chainId: ChainId, marketId: string) => Promise<bigint | undefined>;
976
960
 
977
961
  declare const index_getMarket: typeof getMarket;
978
962
  declare const index_getOracleFee: typeof getOracleFee;
@@ -988,7 +972,7 @@ declare const getPricesData: (chainId: ChainId, poolIds: string[]) => Promise<{
988
972
  oracleType: OracleType;
989
973
  vaa: string;
990
974
  }[] | undefined>;
991
- declare const getPriceData: (chainId: ChainId, poolId: string, isProd: boolean) => Promise<{
975
+ declare const getPriceData: (chainId: ChainId, poolId: string) => Promise<{
992
976
  poolId: string;
993
977
  price: string;
994
978
  value: bigint;
@@ -1015,9 +999,9 @@ declare const bigintAmountSlipperCalculator: (amount: bigint, slipper?: Number)
1015
999
  declare const getTokenInfo: (chainId: number, tokenAddress: string, account?: string) => Promise<{
1016
1000
  balance?: number | undefined;
1017
1001
  address: string;
1018
- name: any;
1019
- symbol: any;
1020
- decimals: any;
1002
+ name: string;
1003
+ symbol: string;
1004
+ decimals: bigint;
1021
1005
  icon: string;
1022
1006
  totalSupply: number;
1023
1007
  }>;
@@ -1231,7 +1215,7 @@ interface MyxClientConfig {
1231
1215
  signer?: Signer;
1232
1216
  seamlessAccount?: {
1233
1217
  masterAddress: string;
1234
- wallet: ethers.Wallet | null;
1218
+ wallet: ethers$1.Wallet | null;
1235
1219
  authorized: boolean;
1236
1220
  };
1237
1221
  walletClient?: WalletClient;
@@ -1251,7 +1235,7 @@ declare class ConfigManager {
1251
1235
  clear(): void;
1252
1236
  startSeamlessMode(open: boolean): MyxClientConfig;
1253
1237
  updateSeamlessWallet({ wallet, authorized, masterAddress }: {
1254
- wallet?: ethers.Wallet;
1238
+ wallet?: ethers$1.Wallet;
1255
1239
  authorized?: boolean;
1256
1240
  masterAddress?: string;
1257
1241
  }): void;
@@ -1359,7 +1343,7 @@ declare class Utils {
1359
1343
  quoteAddress: string;
1360
1344
  amount?: string;
1361
1345
  spenderAddress?: string;
1362
- signer?: ethers.Signer;
1346
+ signer?: ethers$1.Signer;
1363
1347
  }): Promise<{
1364
1348
  code: number;
1365
1349
  message: any;
@@ -1402,7 +1386,68 @@ declare class Utils {
1402
1386
  marketPrice: string;
1403
1387
  }): Promise<{
1404
1388
  code: number;
1405
- data: any;
1389
+ data: [[string, bigint, bigint, bigint] & {
1390
+ poolToken: string;
1391
+ exchangeRate: bigint;
1392
+ poolTokenPrice: bigint;
1393
+ poolTokenSupply: bigint;
1394
+ }, [string, bigint, bigint, bigint] & {
1395
+ poolToken: string;
1396
+ exchangeRate: bigint;
1397
+ poolTokenPrice: bigint;
1398
+ poolTokenSupply: bigint;
1399
+ }, [bigint, bigint, bigint, bigint] & {
1400
+ baseTotalAmount: bigint;
1401
+ baseReservedAmount: bigint;
1402
+ quoteTotalAmount: bigint;
1403
+ quoteReservedAmount: bigint;
1404
+ }, [bigint, bigint, bigint] & {
1405
+ nextFundingRate: bigint;
1406
+ lastFundingFeeTracker: bigint;
1407
+ nextEpochTime: bigint;
1408
+ }, [bigint, bigint, bigint, bigint] & {
1409
+ tracker: bigint;
1410
+ longSize: bigint;
1411
+ shortSize: bigint;
1412
+ poolEntryPrice: bigint;
1413
+ }, [bigint, bigint] & {
1414
+ windowCaps: bigint;
1415
+ openInterest: bigint;
1416
+ }] & {
1417
+ basePool: [string, bigint, bigint, bigint] & {
1418
+ poolToken: string;
1419
+ exchangeRate: bigint;
1420
+ poolTokenPrice: bigint;
1421
+ poolTokenSupply: bigint;
1422
+ };
1423
+ quotePool: [string, bigint, bigint, bigint] & {
1424
+ poolToken: string;
1425
+ exchangeRate: bigint;
1426
+ poolTokenPrice: bigint;
1427
+ poolTokenSupply: bigint;
1428
+ };
1429
+ reserveInfo: [bigint, bigint, bigint, bigint] & {
1430
+ baseTotalAmount: bigint;
1431
+ baseReservedAmount: bigint;
1432
+ quoteTotalAmount: bigint;
1433
+ quoteReservedAmount: bigint;
1434
+ };
1435
+ fundingInfo: [bigint, bigint, bigint] & {
1436
+ nextFundingRate: bigint;
1437
+ lastFundingFeeTracker: bigint;
1438
+ nextEpochTime: bigint;
1439
+ };
1440
+ oi: [bigint, bigint, bigint, bigint] & {
1441
+ tracker: bigint;
1442
+ longSize: bigint;
1443
+ shortSize: bigint;
1444
+ poolEntryPrice: bigint;
1445
+ };
1446
+ liquidityInfo: [bigint, bigint] & {
1447
+ windowCaps: bigint;
1448
+ openInterest: bigint;
1449
+ };
1450
+ };
1406
1451
  message?: undefined;
1407
1452
  } | {
1408
1453
  code: number;
@@ -1411,12 +1456,45 @@ declare class Utils {
1411
1456
  }>;
1412
1457
  }
1413
1458
 
1459
+ declare class Api {
1460
+ private configManager;
1461
+ private logger;
1462
+ constructor(configManager: ConfigManager, logger: Logger);
1463
+ getHost(): "https://api.myx.finance" | "https://api-test.myx.cash";
1464
+ getTradeFlow({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest): Promise<ApiResponse<TradeFlowItem[]>>;
1465
+ getPoolSymbolAll(): Promise<ApiResponse<PoolSymbolAllResponse[]>>;
1466
+ fetchForwarderGetApi(params: FetchForwarderGetParams): Promise<FetchForwarderGetResponse>;
1467
+ getPoolList(): Promise<ApiResponse<any[]>>;
1468
+ forwarderTxApi(params: ForwarderTxParams, chainId: number): Promise<ApiResponse<any>>;
1469
+ getOraclePrice(chainId: ChainId, poolIds?: string[]): Promise<Record<string, any>>;
1470
+ getPoolDetail(chainId: number, poolId: string): Promise<PoolResponse>;
1471
+ getPoolLevelConfig({ poolId, chainId, }: GetPoolLevelConfigParams): Promise<ApiResponse<PoolLevelConfig>>;
1472
+ getPositions(accessToken: string, address: string): Promise<PositionResponse>;
1473
+ getOrders(accessToken: string, address: string): Promise<PositionResponse>;
1474
+ getPoolOpenOrders(accessToken: string, address: string, chainId: ChainId): Promise<PoolOpenOrdersResponse>;
1475
+ getKlineData({ chainId, poolId, endTime, limit, interval }: GetKlineDataParams): Promise<ApiResponse<KlineDataItemType[]>>;
1476
+ getKlineLatestBar(params: Pick<GetKlineDataParams, "chainId" | "poolId" | "interval">): Promise<ApiResponse<KlineDataItemType>>;
1477
+ getTickerData({ chainId, poolIds }: GetTickerDataParams): Promise<ApiResponse<TickerDataItem[]>>;
1478
+ getAllTickers(): Promise<ApiResponse<TickerDataItem[]>>;
1479
+ searchMarketAuth({ accessToken, address, ...params }: SearchMarketParams & AccessTokenRequest): Promise<ApiResponse<SearchResultResponse>>;
1480
+ searchMarket({ ...params }: SearchMarketParams): Promise<ApiResponse<SearchResultResponse>>;
1481
+ addFavorite({ accessToken, address, ...params }: AddFavoriteParams & AccessTokenRequest): Promise<ApiResponse<null>>;
1482
+ removeFavorite({ accessToken, address, ...params }: RemoveFavoriteParams & AccessTokenRequest): Promise<ApiResponse<null>>;
1483
+ getFavoritesList({ accessToken, address, ...params }: FavoritesListParams & AccessTokenRequest): Promise<ApiResponse<FavoritesListItem[]>>;
1484
+ getBaseDetail({ ...params }: GetBaseDetailParams): Promise<ApiResponse<BaseDetailResponse>>;
1485
+ getMarketDetail({ ...params }: GetMarketDetailParams): Promise<ApiResponse<MarketDetailResponse>>;
1486
+ getHistoryOrders({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest): Promise<ApiResponse<HistoryOrderItem[]>>;
1487
+ getPositionHistory({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest): Promise<ApiResponse<PositionHistoryItem[]>>;
1488
+ getMarketList(): Promise<ApiResponse<MarketInfo[]>>;
1489
+ }
1490
+
1414
1491
  declare class Markets {
1415
1492
  private configManager;
1416
1493
  private utils;
1417
- constructor(configManager: ConfigManager, utils: Utils);
1494
+ private api;
1495
+ constructor(configManager: ConfigManager, utils: Utils, api: Api);
1418
1496
  getMarkets(): Promise<never[]>;
1419
- getPoolLevelConfig(poolId: string): Promise<PoolLevelConfig>;
1497
+ getPoolLevelConfig(poolId: string, chainId: number): Promise<PoolLevelConfig>;
1420
1498
  /**
1421
1499
  * kline start
1422
1500
  */
@@ -1480,24 +1558,6 @@ declare class Account {
1480
1558
  code: number;
1481
1559
  data: any;
1482
1560
  }>;
1483
- /**
1484
- * get tradable amount
1485
- */
1486
- getTradableAmount({ poolId, chainId, address }: {
1487
- poolId: string;
1488
- chainId: number;
1489
- address: string;
1490
- }): Promise<{
1491
- code: number;
1492
- data: {
1493
- profitIsReleased: any;
1494
- freeAmount: any;
1495
- tradeableProfit: any;
1496
- };
1497
- } | {
1498
- code: number;
1499
- data?: undefined;
1500
- }>;
1501
1561
  getAvailableMarginBalance({ poolId, chainId, address }: {
1502
1562
  poolId: string;
1503
1563
  chainId: number;
@@ -1559,10 +1619,11 @@ declare class Seamless {
1559
1619
  private logger;
1560
1620
  private utils;
1561
1621
  private account;
1562
- constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account);
1563
- onCheckRelayer(account: string, relayer: string, chainId: number): Promise<any>;
1622
+ private api;
1623
+ constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account, api: Api);
1624
+ onCheckRelayer(account: string, relayer: string, chainId: number): Promise<boolean>;
1564
1625
  getUSDPermitParams(deadline: number, chainId: number): Promise<{
1565
- token: string | ethers.Addressable;
1626
+ token: string | ethers$1.Addressable;
1566
1627
  owner: string;
1567
1628
  spender: string;
1568
1629
  value: bigint;
@@ -1579,7 +1640,7 @@ declare class Seamless {
1579
1640
  deadline: number;
1580
1641
  data: string;
1581
1642
  nonce: string;
1582
- }, chainId: number, provider?: ethers.Signer): Promise<ApiResponse<any>>;
1643
+ }, chainId: number, provider?: ethers$1.Signer): Promise<ApiResponse<any>>;
1583
1644
  authorizeSeamlessAccount({ approve, seamlessAddress, chainId }: {
1584
1645
  approve: boolean;
1585
1646
  seamlessAddress: string;
@@ -1601,7 +1662,7 @@ declare class Seamless {
1601
1662
  data: {
1602
1663
  masterAddress: string;
1603
1664
  seamlessAccount: string;
1604
- authorized: any;
1665
+ authorized: boolean;
1605
1666
  };
1606
1667
  }>;
1607
1668
  exportSeamlessPrivateKey({ password, apiKey }: {
@@ -1620,9 +1681,9 @@ declare class Seamless {
1620
1681
  }): Promise<{
1621
1682
  code: number;
1622
1683
  data: {
1623
- masterAddress: any;
1684
+ masterAddress: string;
1624
1685
  seamlessAccount: string;
1625
- authorized: any;
1686
+ authorized: boolean;
1626
1687
  apiKey: string;
1627
1688
  };
1628
1689
  }>;
@@ -1642,7 +1703,7 @@ declare class Seamless {
1642
1703
  data: {
1643
1704
  masterAddress: string;
1644
1705
  seamlessAccount: string;
1645
- authorized: any;
1706
+ authorized: boolean;
1646
1707
  apiKey: string;
1647
1708
  };
1648
1709
  message?: undefined;
@@ -1659,7 +1720,8 @@ declare class Position {
1659
1720
  private utils;
1660
1721
  private seamless;
1661
1722
  private account;
1662
- constructor(configManager: ConfigManager, logger: Logger, utils: Utils, seamless: Seamless, account: Account);
1723
+ private api;
1724
+ constructor(configManager: ConfigManager, logger: Logger, utils: Utils, seamless: Seamless, account: Account, api: Api);
1663
1725
  listPositions(address: string): Promise<{
1664
1726
  code: number;
1665
1727
  message: string;
@@ -1720,7 +1782,8 @@ declare class Order {
1720
1782
  private utils;
1721
1783
  private seamless;
1722
1784
  private account;
1723
- constructor(configManager: ConfigManager, logger: Logger, utils: Utils, seamless: Seamless, account: Account);
1785
+ private api;
1786
+ constructor(configManager: ConfigManager, logger: Logger, utils: Utils, seamless: Seamless, account: Account, api: Api);
1724
1787
  createIncreaseOrder(params: PlaceOrderParams, tradingFee: string): Promise<{
1725
1788
  code: number;
1726
1789
  message: string;
@@ -1730,14 +1793,13 @@ declare class Order {
1730
1793
  message: string;
1731
1794
  data: {
1732
1795
  success: boolean;
1733
- orderId: string | null;
1734
- transactionHash: any;
1735
- blockNumber: any;
1736
- gasUsed: any;
1796
+ transactionHash: string;
1797
+ blockNumber: number | undefined;
1798
+ gasUsed: string | undefined;
1737
1799
  status: string;
1738
1800
  confirmations: number;
1739
1801
  timestamp: number;
1740
- receipt: any;
1802
+ receipt: ethers$1.ContractTransactionReceipt | null;
1741
1803
  };
1742
1804
  } | {
1743
1805
  code: number;
@@ -1758,14 +1820,14 @@ declare class Order {
1758
1820
  } | {
1759
1821
  code: number;
1760
1822
  message: string;
1761
- data: string | null;
1762
- transactionHash: any;
1763
- blockNumber: any;
1764
- gasUsed: any;
1823
+ transactionHash: string;
1824
+ blockNumber: number | undefined;
1825
+ gasUsed: string | undefined;
1765
1826
  status: string;
1766
1827
  confirmations: number;
1767
1828
  timestamp: number;
1768
- receipt: any;
1829
+ receipt: ethers$1.ContractTransactionReceipt | null;
1830
+ data?: undefined;
1769
1831
  } | {
1770
1832
  code: number;
1771
1833
  message: any;
@@ -1787,14 +1849,13 @@ declare class Order {
1787
1849
  message: string;
1788
1850
  data: {
1789
1851
  success: boolean;
1790
- orderId: string | null;
1791
- transactionHash: any;
1792
- blockNumber: any;
1793
- gasUsed: any;
1852
+ transactionHash: string;
1853
+ blockNumber: number | undefined;
1854
+ gasUsed: string | undefined;
1794
1855
  status: string;
1795
1856
  confirmations: number;
1796
1857
  timestamp: number;
1797
- receipt: any;
1858
+ receipt: ethers$1.ContractTransactionReceipt | null;
1798
1859
  };
1799
1860
  } | {
1800
1861
  code: number;
@@ -1810,14 +1871,13 @@ declare class Order {
1810
1871
  message: string;
1811
1872
  data: {
1812
1873
  success: boolean;
1813
- orderId: string | null;
1814
- transactionHash: any;
1815
- blockNumber: any;
1816
- gasUsed: any;
1874
+ transactionHash: string;
1875
+ blockNumber: number | undefined;
1876
+ gasUsed: string | undefined;
1817
1877
  status: string;
1818
1878
  confirmations: number;
1819
1879
  timestamp: number;
1820
- receipt: any;
1880
+ receipt: ethers$1.ContractTransactionReceipt | null;
1821
1881
  };
1822
1882
  } | {
1823
1883
  code: number;
@@ -1843,7 +1903,7 @@ declare class Order {
1843
1903
  }>;
1844
1904
  updateOrderTpSl(params: UpdateOrderParams, quoteAddress: string, chainId: number): Promise<{
1845
1905
  code: number;
1846
- data: any;
1906
+ data: ethers$1.ContractTransactionReceipt | null;
1847
1907
  message: string;
1848
1908
  } | {
1849
1909
  code: number;
@@ -1881,6 +1941,7 @@ declare class MyxClient {
1881
1941
  utils: Utils;
1882
1942
  account: Account;
1883
1943
  seamless: Seamless;
1944
+ api: Api;
1884
1945
  /**
1885
1946
  * 获取配置管理器(用于访问 accessToken 相关方法)
1886
1947
  */
@@ -1901,4 +1962,4 @@ declare class MyxClient {
1901
1962
  getAccessToken(): Promise<string | null>;
1902
1963
  }
1903
1964
 
1904
- export { type AccessTokenRequest, type AccessTokenResponse$1 as AccessTokenResponse, type AccessTokenType, type AddFavoriteParams, type Address$1 as Address, type ApiResponse, 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 GetBaseDetailParams, type GetHistoryOrdersParams, type GetKlineDataParams, type GetMarketDetailParams, type GetPoolLevelConfigParams, type GetTickerDataParams, type HistoryOrderItem, type HttpEnvParams, HttpKlineIntervalEnum, type KlineDataItemType, type KlineDataResponse, type KlineResolution, type LevelConfig, MarketCapType, type MarketDetailResponse, type MarketInfo, type MarketPool, type MarketPoolResponse, MarketPoolState, MarketType, MyxClient, type MyxClientConfig, type MyxSubscriptionOptions, type NetWorkFee, 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 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, addFavorite, approve, index$2 as base, bigintAmountSlipperCalculator, bigintTradingGasPriceWithRatio, bigintTradingGasToRatioCalculator, fetchForwarderGetApi, forwarderTxApi, getAllTickers, getAllowanceApproved, getBalanceOf, getBaseDetail, getBaseUrlByEnv, getFavoritesList, getForwardUrlByEnv, getHistoryOrders, getKlineData, getKlineLatestBar, getMarketDetail, getMarketList, getOraclePrice, getOrders, getPoolDetail, getPoolLevelConfig, getPoolList, getPoolOpenOrders, getPoolSymbolAll, getPositionHistory, getPositions, getPriceData, getPricesData, getTickerData, getTokenInfo, getTradeFlow, index as market, index$3 as pool, index$1 as quote, removeFavorite, searchMarket, searchMarketAuth };
1965
+ export { type AccessTokenRequest, type AccessTokenResponse$1 as AccessTokenResponse, type AccessTokenType, type AddFavoriteParams, type Address$1 as Address, type ApiResponse, 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 GetBaseDetailParams, type GetHistoryOrdersParams, type GetKlineDataParams, type GetMarketDetailParams, type GetPoolLevelConfigParams, type GetTickerDataParams, type HistoryOrderItem, type HttpEnvParams, HttpKlineIntervalEnum, type KlineDataItemType, type KlineDataResponse, type KlineResolution, type LevelConfig, MarketCapType, type MarketDetailResponse, type MarketInfo, type MarketPool, type MarketPoolResponse, MarketPoolState, MarketType, MyxClient, type MyxClientConfig, type MyxSubscriptionOptions, type NetWorkFee, 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 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, approve, index$2 as base, bigintAmountSlipperCalculator, bigintTradingGasPriceWithRatio, bigintTradingGasToRatioCalculator, getAllowanceApproved, getBalanceOf, getBaseDetail, getBaseUrlByEnv, getForwardUrlByEnv, getMarketDetail, getMarketList, getOraclePrice, getPoolDetail, getPoolList, getPoolOpenOrders, getPriceData, getPricesData, getTickerData, getTokenInfo, index as market, index$3 as pool, index$1 as quote };