@myx-trade/sdk 0.1.188 → 0.1.190
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 +49 -31
- package/dist/index.d.ts +49 -31
- package/dist/index.js +356 -148
- package/dist/index.mjs +354 -146
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -562,6 +562,7 @@ interface GetHistoryOrdersParams {
|
|
|
562
562
|
limit?: number;
|
|
563
563
|
chainId?: number;
|
|
564
564
|
poolId?: string;
|
|
565
|
+
isProd?: boolean;
|
|
565
566
|
}
|
|
566
567
|
declare enum OrderTypeEnum {
|
|
567
568
|
Market = 0,
|
|
@@ -646,7 +647,7 @@ interface HistoryOrderItem {
|
|
|
646
647
|
/**
|
|
647
648
|
* Get history orders
|
|
648
649
|
*/
|
|
649
|
-
declare const getHistoryOrders: ({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<HistoryOrderItem[]>>;
|
|
650
|
+
declare const getHistoryOrders: ({ accessToken, address, isProd, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<HistoryOrderItem[]>>;
|
|
650
651
|
/**
|
|
651
652
|
* Get position history
|
|
652
653
|
*/
|
|
@@ -682,7 +683,7 @@ interface PositionHistoryItem {
|
|
|
682
683
|
closeType: CloseTypeEnum;
|
|
683
684
|
avgClosePrice: string;
|
|
684
685
|
}
|
|
685
|
-
declare const getPositionHistory: ({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<PositionHistoryItem[]>>;
|
|
686
|
+
declare const getPositionHistory: ({ accessToken, address, isProd, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<PositionHistoryItem[]>>;
|
|
686
687
|
/**
|
|
687
688
|
* Get Trade Flow
|
|
688
689
|
*/
|
|
@@ -713,7 +714,7 @@ interface TradeFlowItem {
|
|
|
713
714
|
referralRebate: string;
|
|
714
715
|
rebateClaimedAmount: string;
|
|
715
716
|
}
|
|
716
|
-
declare const getTradeFlow: ({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<TradeFlowItem[]>>;
|
|
717
|
+
declare const getTradeFlow: ({ accessToken, address, isProd, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<TradeFlowItem[]>>;
|
|
717
718
|
|
|
718
719
|
type ForwarderTxParams = {
|
|
719
720
|
from: string;
|
|
@@ -725,7 +726,7 @@ type ForwarderTxParams = {
|
|
|
725
726
|
deadline: number;
|
|
726
727
|
signature: string;
|
|
727
728
|
};
|
|
728
|
-
declare const forwarderTxApi: (params: ForwarderTxParams, chainId: number) => Promise<ApiResponse<any>>;
|
|
729
|
+
declare const forwarderTxApi: (params: ForwarderTxParams, chainId: number, isProd?: boolean) => Promise<ApiResponse<any>>;
|
|
729
730
|
type FetchForwarderGetParams = {
|
|
730
731
|
requestId: string;
|
|
731
732
|
};
|
|
@@ -741,9 +742,11 @@ type FetchForwarderGetResponseData = {
|
|
|
741
742
|
reason: string;
|
|
742
743
|
};
|
|
743
744
|
type FetchForwarderGetResponse = BaseResponse<FetchForwarderGetResponseData>;
|
|
744
|
-
declare const fetchForwarderGetApi: (params: FetchForwarderGetParams) => Promise<FetchForwarderGetResponse>;
|
|
745
|
+
declare const fetchForwarderGetApi: (params: FetchForwarderGetParams, isProd?: boolean) => Promise<FetchForwarderGetResponse>;
|
|
745
746
|
|
|
746
|
-
declare const getPoolList: (
|
|
747
|
+
declare const getPoolList: ({ isProd, }: {
|
|
748
|
+
isProd?: boolean;
|
|
749
|
+
}) => Promise<ApiResponse<any[]>>;
|
|
747
750
|
interface PoolSymbolAllResponse {
|
|
748
751
|
chainId: number;
|
|
749
752
|
marketId: string;
|
|
@@ -752,11 +755,13 @@ interface PoolSymbolAllResponse {
|
|
|
752
755
|
quoteSymbol: string;
|
|
753
756
|
baseTokenIcon: string;
|
|
754
757
|
}
|
|
755
|
-
declare const getPoolSymbolAll: (
|
|
758
|
+
declare const getPoolSymbolAll: ({ isProd, }: {
|
|
759
|
+
isProd?: boolean;
|
|
760
|
+
}) => Promise<ApiResponse<PoolSymbolAllResponse[]>>;
|
|
756
761
|
|
|
757
|
-
declare const
|
|
758
|
-
declare const
|
|
759
|
-
declare const getOraclePrice: (chainId: ChainId, poolIds?: string[]) => Promise<PriceResponse>;
|
|
762
|
+
declare const getBaseUrlByEnv: (isProd: boolean) => "https://api.myx.finance" | "https://api-test.myx.cash";
|
|
763
|
+
declare const getForwardUrlByEnv: (isProd: boolean) => "https://api.myx.finance/v2/agent" | "https://api-test.myx.cash/v2/agent";
|
|
764
|
+
declare const getOraclePrice: (chainId: ChainId, poolIds?: string[], isProd?: boolean) => Promise<PriceResponse>;
|
|
760
765
|
interface LevelConfig {
|
|
761
766
|
fundingFeeRate1: number;
|
|
762
767
|
fundingFeeRate1Max: number;
|
|
@@ -779,15 +784,16 @@ interface PoolLevelConfig {
|
|
|
779
784
|
interface GetPoolLevelConfigParams {
|
|
780
785
|
poolId: string;
|
|
781
786
|
chainId: ChainId;
|
|
787
|
+
isProd?: boolean;
|
|
782
788
|
}
|
|
783
789
|
/**
|
|
784
790
|
* Get Pool Level Config
|
|
785
791
|
*/
|
|
786
|
-
declare const getPoolLevelConfig: ({ poolId, chainId, }: GetPoolLevelConfigParams) => Promise<ApiResponse<PoolLevelConfig>>;
|
|
787
|
-
declare const getPoolDetail: (chainId: number, poolId: string) => Promise<PoolResponse>;
|
|
788
|
-
declare const getPositions: (accessToken: string, address: string) => Promise<PositionResponse>;
|
|
789
|
-
declare const getOrders: (accessToken: string, address: string) => Promise<PositionResponse>;
|
|
790
|
-
declare const getPoolOpenOrders: (accessToken: string, address: string, chainId: ChainId) => Promise<PoolOpenOrdersResponse>;
|
|
792
|
+
declare const getPoolLevelConfig: ({ poolId, chainId, isProd }: GetPoolLevelConfigParams) => Promise<ApiResponse<PoolLevelConfig>>;
|
|
793
|
+
declare const getPoolDetail: (chainId: number, poolId: string, isProd?: boolean) => Promise<PoolResponse>;
|
|
794
|
+
declare const getPositions: (accessToken: string, address: string, isProd?: boolean) => Promise<PositionResponse>;
|
|
795
|
+
declare const getOrders: (accessToken: string, address: string, isProd?: boolean) => Promise<PositionResponse>;
|
|
796
|
+
declare const getPoolOpenOrders: (accessToken: string, address: string, chainId: ChainId, isProd?: boolean) => Promise<PoolOpenOrdersResponse>;
|
|
791
797
|
/**
|
|
792
798
|
* Get Kline Data
|
|
793
799
|
*/
|
|
@@ -797,18 +803,22 @@ interface GetKlineDataParams {
|
|
|
797
803
|
endTime: number;
|
|
798
804
|
limit: number;
|
|
799
805
|
interval: HttpKlineIntervalEnum;
|
|
806
|
+
isProd?: boolean;
|
|
800
807
|
}
|
|
801
|
-
declare const getKlineData: ({ chainId, poolId, endTime, limit, interval, }: GetKlineDataParams) => Promise<ApiResponse<KlineDataItemType[]>>;
|
|
808
|
+
declare const getKlineData: ({ chainId, poolId, endTime, limit, interval, isProd }: GetKlineDataParams) => Promise<ApiResponse<KlineDataItemType[]>>;
|
|
802
809
|
/**
|
|
803
810
|
* Get Kline Latest Bar
|
|
804
811
|
*/
|
|
805
|
-
declare const getKlineLatestBar: (params: Pick<GetKlineDataParams, "chainId" | "poolId" | "interval"
|
|
812
|
+
declare const getKlineLatestBar: (params: Pick<GetKlineDataParams, "chainId" | "poolId" | "interval">, isProd?: boolean) => Promise<ApiResponse<KlineDataItemType>>;
|
|
806
813
|
interface GetTickerDataParams {
|
|
807
814
|
chainId: ChainId;
|
|
808
815
|
poolIds: string[];
|
|
816
|
+
isProd?: boolean;
|
|
809
817
|
}
|
|
810
|
-
declare const getTickerData: ({ chainId, poolIds, }: GetTickerDataParams) => Promise<ApiResponse<TickerDataItem[]>>;
|
|
811
|
-
declare const getAllTickers: (
|
|
818
|
+
declare const getTickerData: ({ chainId, poolIds, isProd }: GetTickerDataParams) => Promise<ApiResponse<TickerDataItem[]>>;
|
|
819
|
+
declare const getAllTickers: ({ isProd }: {
|
|
820
|
+
isProd?: boolean;
|
|
821
|
+
}) => Promise<ApiResponse<TickerDataItem[]>>;
|
|
812
822
|
/**
|
|
813
823
|
* search
|
|
814
824
|
*/
|
|
@@ -817,22 +827,25 @@ interface SearchMarketParams {
|
|
|
817
827
|
searchType?: SearchTypeEnum;
|
|
818
828
|
type?: SearchSecondTypeEnum;
|
|
819
829
|
searchKey?: string;
|
|
830
|
+
isProd?: boolean;
|
|
820
831
|
}
|
|
821
|
-
declare const searchMarketAuth: ({ accessToken, address, ...params }: SearchMarketParams & AccessTokenRequest) => Promise<ApiResponse<SearchResultResponse>>;
|
|
822
|
-
declare const searchMarket: ({ ...params }: SearchMarketParams) => Promise<ApiResponse<SearchResultResponse>>;
|
|
832
|
+
declare const searchMarketAuth: ({ accessToken, address, isProd, ...params }: SearchMarketParams & AccessTokenRequest) => Promise<ApiResponse<SearchResultResponse>>;
|
|
833
|
+
declare const searchMarket: ({ isProd, ...params }: SearchMarketParams) => Promise<ApiResponse<SearchResultResponse>>;
|
|
823
834
|
/**
|
|
824
835
|
* favorite
|
|
825
836
|
*/
|
|
826
837
|
interface AddFavoriteParams {
|
|
827
838
|
poolId: string;
|
|
828
839
|
chainId: ChainId;
|
|
840
|
+
isProd?: boolean;
|
|
829
841
|
}
|
|
830
|
-
declare const addFavorite: ({ accessToken, address, ...params }: AddFavoriteParams & AccessTokenRequest) => Promise<ApiResponse<null>>;
|
|
842
|
+
declare const addFavorite: ({ accessToken, address, isProd, ...params }: AddFavoriteParams & AccessTokenRequest) => Promise<ApiResponse<null>>;
|
|
831
843
|
interface RemoveFavoriteParams {
|
|
832
844
|
poolId: string;
|
|
833
845
|
chainId: ChainId;
|
|
846
|
+
isProd?: boolean;
|
|
834
847
|
}
|
|
835
|
-
declare const removeFavorite: ({ accessToken, address, ...params }: RemoveFavoriteParams & AccessTokenRequest) => Promise<ApiResponse<null>>;
|
|
848
|
+
declare const removeFavorite: ({ accessToken, address, isProd, ...params }: RemoveFavoriteParams & AccessTokenRequest) => Promise<ApiResponse<null>>;
|
|
836
849
|
/**
|
|
837
850
|
* Favorites List
|
|
838
851
|
*/
|
|
@@ -844,19 +857,24 @@ interface FavoritesListParams {
|
|
|
844
857
|
limit?: number;
|
|
845
858
|
timeInterval?: FavoritesTimeInterval;
|
|
846
859
|
chainId: ChainId | 0;
|
|
860
|
+
isProd?: boolean;
|
|
847
861
|
}
|
|
848
|
-
declare const getFavoritesList: ({ accessToken, address, ...params }: FavoritesListParams & AccessTokenRequest) => Promise<ApiResponse<FavoritesListItem[]>>;
|
|
862
|
+
declare const getFavoritesList: ({ accessToken, address, isProd, ...params }: FavoritesListParams & AccessTokenRequest) => Promise<ApiResponse<FavoritesListItem[]>>;
|
|
849
863
|
interface GetBaseDetailParams {
|
|
850
864
|
chainId: ChainId;
|
|
851
865
|
poolId: string;
|
|
866
|
+
isProd?: boolean;
|
|
852
867
|
}
|
|
853
|
-
declare const getBaseDetail: (params: GetBaseDetailParams) => Promise<ApiResponse<BaseDetailResponse>>;
|
|
868
|
+
declare const getBaseDetail: ({ isProd, ...params }: GetBaseDetailParams & AccessTokenRequest) => Promise<ApiResponse<BaseDetailResponse>>;
|
|
854
869
|
interface GetMarketDetailParams {
|
|
855
870
|
chainId: number;
|
|
856
871
|
poolId: string;
|
|
872
|
+
isProd?: boolean;
|
|
857
873
|
}
|
|
858
|
-
declare const getMarketDetail: (params: GetMarketDetailParams) => Promise<ApiResponse<MarketDetailResponse>>;
|
|
859
|
-
declare const getMarketList: (
|
|
874
|
+
declare const getMarketDetail: ({ isProd, ...params }: GetMarketDetailParams & AccessTokenRequest) => Promise<ApiResponse<MarketDetailResponse>>;
|
|
875
|
+
declare const getMarketList: ({ isProd, }: {
|
|
876
|
+
isProd?: boolean;
|
|
877
|
+
}) => Promise<ApiResponse<MarketInfo[]>>;
|
|
860
878
|
|
|
861
879
|
declare const getPoolInfo: (chainId: ChainId, poolId: string) => Promise<MarketPool | undefined>;
|
|
862
880
|
|
|
@@ -988,7 +1006,7 @@ declare const getPricesData: (chainId: ChainId, poolIds: string[]) => Promise<{
|
|
|
988
1006
|
oracleType: OracleType;
|
|
989
1007
|
vaa: string;
|
|
990
1008
|
}[] | undefined>;
|
|
991
|
-
declare const getPriceData: (chainId: ChainId, poolId: string) => Promise<{
|
|
1009
|
+
declare const getPriceData: (chainId: ChainId, poolId: string, isProd: boolean) => Promise<{
|
|
992
1010
|
poolId: string;
|
|
993
1011
|
price: string;
|
|
994
1012
|
value: bigint;
|
|
@@ -1364,7 +1382,7 @@ declare class Utils {
|
|
|
1364
1382
|
code: number;
|
|
1365
1383
|
message: any;
|
|
1366
1384
|
}>;
|
|
1367
|
-
getUserTradingFeeRate(assetClass: number): Promise<{
|
|
1385
|
+
getUserTradingFeeRate(assetClass: number, riskTier: number): Promise<{
|
|
1368
1386
|
code: number;
|
|
1369
1387
|
data: {
|
|
1370
1388
|
takerFeeRate: any;
|
|
@@ -1379,7 +1397,7 @@ declare class Utils {
|
|
|
1379
1397
|
data?: undefined;
|
|
1380
1398
|
}>;
|
|
1381
1399
|
getNetworkFee(quoteAddress: string, chainId: number): Promise<any>;
|
|
1382
|
-
getOraclePrice(poolId: string): Promise<{
|
|
1400
|
+
getOraclePrice(poolId: string, chainId: number): Promise<{
|
|
1383
1401
|
poolId: string;
|
|
1384
1402
|
price: string;
|
|
1385
1403
|
value: bigint;
|
|
@@ -1962,4 +1980,4 @@ declare class MyxClient {
|
|
|
1962
1980
|
getAccessToken(): Promise<string | null>;
|
|
1963
1981
|
}
|
|
1964
1982
|
|
|
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, 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,
|
|
1983
|
+
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, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -562,6 +562,7 @@ interface GetHistoryOrdersParams {
|
|
|
562
562
|
limit?: number;
|
|
563
563
|
chainId?: number;
|
|
564
564
|
poolId?: string;
|
|
565
|
+
isProd?: boolean;
|
|
565
566
|
}
|
|
566
567
|
declare enum OrderTypeEnum {
|
|
567
568
|
Market = 0,
|
|
@@ -646,7 +647,7 @@ interface HistoryOrderItem {
|
|
|
646
647
|
/**
|
|
647
648
|
* Get history orders
|
|
648
649
|
*/
|
|
649
|
-
declare const getHistoryOrders: ({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<HistoryOrderItem[]>>;
|
|
650
|
+
declare const getHistoryOrders: ({ accessToken, address, isProd, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<HistoryOrderItem[]>>;
|
|
650
651
|
/**
|
|
651
652
|
* Get position history
|
|
652
653
|
*/
|
|
@@ -682,7 +683,7 @@ interface PositionHistoryItem {
|
|
|
682
683
|
closeType: CloseTypeEnum;
|
|
683
684
|
avgClosePrice: string;
|
|
684
685
|
}
|
|
685
|
-
declare const getPositionHistory: ({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<PositionHistoryItem[]>>;
|
|
686
|
+
declare const getPositionHistory: ({ accessToken, address, isProd, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<PositionHistoryItem[]>>;
|
|
686
687
|
/**
|
|
687
688
|
* Get Trade Flow
|
|
688
689
|
*/
|
|
@@ -713,7 +714,7 @@ interface TradeFlowItem {
|
|
|
713
714
|
referralRebate: string;
|
|
714
715
|
rebateClaimedAmount: string;
|
|
715
716
|
}
|
|
716
|
-
declare const getTradeFlow: ({ accessToken, address, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<TradeFlowItem[]>>;
|
|
717
|
+
declare const getTradeFlow: ({ accessToken, address, isProd, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<TradeFlowItem[]>>;
|
|
717
718
|
|
|
718
719
|
type ForwarderTxParams = {
|
|
719
720
|
from: string;
|
|
@@ -725,7 +726,7 @@ type ForwarderTxParams = {
|
|
|
725
726
|
deadline: number;
|
|
726
727
|
signature: string;
|
|
727
728
|
};
|
|
728
|
-
declare const forwarderTxApi: (params: ForwarderTxParams, chainId: number) => Promise<ApiResponse<any>>;
|
|
729
|
+
declare const forwarderTxApi: (params: ForwarderTxParams, chainId: number, isProd?: boolean) => Promise<ApiResponse<any>>;
|
|
729
730
|
type FetchForwarderGetParams = {
|
|
730
731
|
requestId: string;
|
|
731
732
|
};
|
|
@@ -741,9 +742,11 @@ type FetchForwarderGetResponseData = {
|
|
|
741
742
|
reason: string;
|
|
742
743
|
};
|
|
743
744
|
type FetchForwarderGetResponse = BaseResponse<FetchForwarderGetResponseData>;
|
|
744
|
-
declare const fetchForwarderGetApi: (params: FetchForwarderGetParams) => Promise<FetchForwarderGetResponse>;
|
|
745
|
+
declare const fetchForwarderGetApi: (params: FetchForwarderGetParams, isProd?: boolean) => Promise<FetchForwarderGetResponse>;
|
|
745
746
|
|
|
746
|
-
declare const getPoolList: (
|
|
747
|
+
declare const getPoolList: ({ isProd, }: {
|
|
748
|
+
isProd?: boolean;
|
|
749
|
+
}) => Promise<ApiResponse<any[]>>;
|
|
747
750
|
interface PoolSymbolAllResponse {
|
|
748
751
|
chainId: number;
|
|
749
752
|
marketId: string;
|
|
@@ -752,11 +755,13 @@ interface PoolSymbolAllResponse {
|
|
|
752
755
|
quoteSymbol: string;
|
|
753
756
|
baseTokenIcon: string;
|
|
754
757
|
}
|
|
755
|
-
declare const getPoolSymbolAll: (
|
|
758
|
+
declare const getPoolSymbolAll: ({ isProd, }: {
|
|
759
|
+
isProd?: boolean;
|
|
760
|
+
}) => Promise<ApiResponse<PoolSymbolAllResponse[]>>;
|
|
756
761
|
|
|
757
|
-
declare const
|
|
758
|
-
declare const
|
|
759
|
-
declare const getOraclePrice: (chainId: ChainId, poolIds?: string[]) => Promise<PriceResponse>;
|
|
762
|
+
declare const getBaseUrlByEnv: (isProd: boolean) => "https://api.myx.finance" | "https://api-test.myx.cash";
|
|
763
|
+
declare const getForwardUrlByEnv: (isProd: boolean) => "https://api.myx.finance/v2/agent" | "https://api-test.myx.cash/v2/agent";
|
|
764
|
+
declare const getOraclePrice: (chainId: ChainId, poolIds?: string[], isProd?: boolean) => Promise<PriceResponse>;
|
|
760
765
|
interface LevelConfig {
|
|
761
766
|
fundingFeeRate1: number;
|
|
762
767
|
fundingFeeRate1Max: number;
|
|
@@ -779,15 +784,16 @@ interface PoolLevelConfig {
|
|
|
779
784
|
interface GetPoolLevelConfigParams {
|
|
780
785
|
poolId: string;
|
|
781
786
|
chainId: ChainId;
|
|
787
|
+
isProd?: boolean;
|
|
782
788
|
}
|
|
783
789
|
/**
|
|
784
790
|
* Get Pool Level Config
|
|
785
791
|
*/
|
|
786
|
-
declare const getPoolLevelConfig: ({ poolId, chainId, }: GetPoolLevelConfigParams) => Promise<ApiResponse<PoolLevelConfig>>;
|
|
787
|
-
declare const getPoolDetail: (chainId: number, poolId: string) => Promise<PoolResponse>;
|
|
788
|
-
declare const getPositions: (accessToken: string, address: string) => Promise<PositionResponse>;
|
|
789
|
-
declare const getOrders: (accessToken: string, address: string) => Promise<PositionResponse>;
|
|
790
|
-
declare const getPoolOpenOrders: (accessToken: string, address: string, chainId: ChainId) => Promise<PoolOpenOrdersResponse>;
|
|
792
|
+
declare const getPoolLevelConfig: ({ poolId, chainId, isProd }: GetPoolLevelConfigParams) => Promise<ApiResponse<PoolLevelConfig>>;
|
|
793
|
+
declare const getPoolDetail: (chainId: number, poolId: string, isProd?: boolean) => Promise<PoolResponse>;
|
|
794
|
+
declare const getPositions: (accessToken: string, address: string, isProd?: boolean) => Promise<PositionResponse>;
|
|
795
|
+
declare const getOrders: (accessToken: string, address: string, isProd?: boolean) => Promise<PositionResponse>;
|
|
796
|
+
declare const getPoolOpenOrders: (accessToken: string, address: string, chainId: ChainId, isProd?: boolean) => Promise<PoolOpenOrdersResponse>;
|
|
791
797
|
/**
|
|
792
798
|
* Get Kline Data
|
|
793
799
|
*/
|
|
@@ -797,18 +803,22 @@ interface GetKlineDataParams {
|
|
|
797
803
|
endTime: number;
|
|
798
804
|
limit: number;
|
|
799
805
|
interval: HttpKlineIntervalEnum;
|
|
806
|
+
isProd?: boolean;
|
|
800
807
|
}
|
|
801
|
-
declare const getKlineData: ({ chainId, poolId, endTime, limit, interval, }: GetKlineDataParams) => Promise<ApiResponse<KlineDataItemType[]>>;
|
|
808
|
+
declare const getKlineData: ({ chainId, poolId, endTime, limit, interval, isProd }: GetKlineDataParams) => Promise<ApiResponse<KlineDataItemType[]>>;
|
|
802
809
|
/**
|
|
803
810
|
* Get Kline Latest Bar
|
|
804
811
|
*/
|
|
805
|
-
declare const getKlineLatestBar: (params: Pick<GetKlineDataParams, "chainId" | "poolId" | "interval"
|
|
812
|
+
declare const getKlineLatestBar: (params: Pick<GetKlineDataParams, "chainId" | "poolId" | "interval">, isProd?: boolean) => Promise<ApiResponse<KlineDataItemType>>;
|
|
806
813
|
interface GetTickerDataParams {
|
|
807
814
|
chainId: ChainId;
|
|
808
815
|
poolIds: string[];
|
|
816
|
+
isProd?: boolean;
|
|
809
817
|
}
|
|
810
|
-
declare const getTickerData: ({ chainId, poolIds, }: GetTickerDataParams) => Promise<ApiResponse<TickerDataItem[]>>;
|
|
811
|
-
declare const getAllTickers: (
|
|
818
|
+
declare const getTickerData: ({ chainId, poolIds, isProd }: GetTickerDataParams) => Promise<ApiResponse<TickerDataItem[]>>;
|
|
819
|
+
declare const getAllTickers: ({ isProd }: {
|
|
820
|
+
isProd?: boolean;
|
|
821
|
+
}) => Promise<ApiResponse<TickerDataItem[]>>;
|
|
812
822
|
/**
|
|
813
823
|
* search
|
|
814
824
|
*/
|
|
@@ -817,22 +827,25 @@ interface SearchMarketParams {
|
|
|
817
827
|
searchType?: SearchTypeEnum;
|
|
818
828
|
type?: SearchSecondTypeEnum;
|
|
819
829
|
searchKey?: string;
|
|
830
|
+
isProd?: boolean;
|
|
820
831
|
}
|
|
821
|
-
declare const searchMarketAuth: ({ accessToken, address, ...params }: SearchMarketParams & AccessTokenRequest) => Promise<ApiResponse<SearchResultResponse>>;
|
|
822
|
-
declare const searchMarket: ({ ...params }: SearchMarketParams) => Promise<ApiResponse<SearchResultResponse>>;
|
|
832
|
+
declare const searchMarketAuth: ({ accessToken, address, isProd, ...params }: SearchMarketParams & AccessTokenRequest) => Promise<ApiResponse<SearchResultResponse>>;
|
|
833
|
+
declare const searchMarket: ({ isProd, ...params }: SearchMarketParams) => Promise<ApiResponse<SearchResultResponse>>;
|
|
823
834
|
/**
|
|
824
835
|
* favorite
|
|
825
836
|
*/
|
|
826
837
|
interface AddFavoriteParams {
|
|
827
838
|
poolId: string;
|
|
828
839
|
chainId: ChainId;
|
|
840
|
+
isProd?: boolean;
|
|
829
841
|
}
|
|
830
|
-
declare const addFavorite: ({ accessToken, address, ...params }: AddFavoriteParams & AccessTokenRequest) => Promise<ApiResponse<null>>;
|
|
842
|
+
declare const addFavorite: ({ accessToken, address, isProd, ...params }: AddFavoriteParams & AccessTokenRequest) => Promise<ApiResponse<null>>;
|
|
831
843
|
interface RemoveFavoriteParams {
|
|
832
844
|
poolId: string;
|
|
833
845
|
chainId: ChainId;
|
|
846
|
+
isProd?: boolean;
|
|
834
847
|
}
|
|
835
|
-
declare const removeFavorite: ({ accessToken, address, ...params }: RemoveFavoriteParams & AccessTokenRequest) => Promise<ApiResponse<null>>;
|
|
848
|
+
declare const removeFavorite: ({ accessToken, address, isProd, ...params }: RemoveFavoriteParams & AccessTokenRequest) => Promise<ApiResponse<null>>;
|
|
836
849
|
/**
|
|
837
850
|
* Favorites List
|
|
838
851
|
*/
|
|
@@ -844,19 +857,24 @@ interface FavoritesListParams {
|
|
|
844
857
|
limit?: number;
|
|
845
858
|
timeInterval?: FavoritesTimeInterval;
|
|
846
859
|
chainId: ChainId | 0;
|
|
860
|
+
isProd?: boolean;
|
|
847
861
|
}
|
|
848
|
-
declare const getFavoritesList: ({ accessToken, address, ...params }: FavoritesListParams & AccessTokenRequest) => Promise<ApiResponse<FavoritesListItem[]>>;
|
|
862
|
+
declare const getFavoritesList: ({ accessToken, address, isProd, ...params }: FavoritesListParams & AccessTokenRequest) => Promise<ApiResponse<FavoritesListItem[]>>;
|
|
849
863
|
interface GetBaseDetailParams {
|
|
850
864
|
chainId: ChainId;
|
|
851
865
|
poolId: string;
|
|
866
|
+
isProd?: boolean;
|
|
852
867
|
}
|
|
853
|
-
declare const getBaseDetail: (params: GetBaseDetailParams) => Promise<ApiResponse<BaseDetailResponse>>;
|
|
868
|
+
declare const getBaseDetail: ({ isProd, ...params }: GetBaseDetailParams & AccessTokenRequest) => Promise<ApiResponse<BaseDetailResponse>>;
|
|
854
869
|
interface GetMarketDetailParams {
|
|
855
870
|
chainId: number;
|
|
856
871
|
poolId: string;
|
|
872
|
+
isProd?: boolean;
|
|
857
873
|
}
|
|
858
|
-
declare const getMarketDetail: (params: GetMarketDetailParams) => Promise<ApiResponse<MarketDetailResponse>>;
|
|
859
|
-
declare const getMarketList: (
|
|
874
|
+
declare const getMarketDetail: ({ isProd, ...params }: GetMarketDetailParams & AccessTokenRequest) => Promise<ApiResponse<MarketDetailResponse>>;
|
|
875
|
+
declare const getMarketList: ({ isProd, }: {
|
|
876
|
+
isProd?: boolean;
|
|
877
|
+
}) => Promise<ApiResponse<MarketInfo[]>>;
|
|
860
878
|
|
|
861
879
|
declare const getPoolInfo: (chainId: ChainId, poolId: string) => Promise<MarketPool | undefined>;
|
|
862
880
|
|
|
@@ -988,7 +1006,7 @@ declare const getPricesData: (chainId: ChainId, poolIds: string[]) => Promise<{
|
|
|
988
1006
|
oracleType: OracleType;
|
|
989
1007
|
vaa: string;
|
|
990
1008
|
}[] | undefined>;
|
|
991
|
-
declare const getPriceData: (chainId: ChainId, poolId: string) => Promise<{
|
|
1009
|
+
declare const getPriceData: (chainId: ChainId, poolId: string, isProd: boolean) => Promise<{
|
|
992
1010
|
poolId: string;
|
|
993
1011
|
price: string;
|
|
994
1012
|
value: bigint;
|
|
@@ -1364,7 +1382,7 @@ declare class Utils {
|
|
|
1364
1382
|
code: number;
|
|
1365
1383
|
message: any;
|
|
1366
1384
|
}>;
|
|
1367
|
-
getUserTradingFeeRate(assetClass: number): Promise<{
|
|
1385
|
+
getUserTradingFeeRate(assetClass: number, riskTier: number): Promise<{
|
|
1368
1386
|
code: number;
|
|
1369
1387
|
data: {
|
|
1370
1388
|
takerFeeRate: any;
|
|
@@ -1379,7 +1397,7 @@ declare class Utils {
|
|
|
1379
1397
|
data?: undefined;
|
|
1380
1398
|
}>;
|
|
1381
1399
|
getNetworkFee(quoteAddress: string, chainId: number): Promise<any>;
|
|
1382
|
-
getOraclePrice(poolId: string): Promise<{
|
|
1400
|
+
getOraclePrice(poolId: string, chainId: number): Promise<{
|
|
1383
1401
|
poolId: string;
|
|
1384
1402
|
price: string;
|
|
1385
1403
|
value: bigint;
|
|
@@ -1962,4 +1980,4 @@ declare class MyxClient {
|
|
|
1962
1980
|
getAccessToken(): Promise<string | null>;
|
|
1963
1981
|
}
|
|
1964
1982
|
|
|
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, 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,
|
|
1983
|
+
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, 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 };
|