@myx-trade/sdk 0.1.16 → 0.1.17
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 +4 -9
- package/dist/index.d.ts +4 -9
- package/dist/index.js +2 -10
- package/dist/index.mjs +2 -9
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -597,7 +597,7 @@ interface HistoryOrderItem {
|
|
|
597
597
|
realizedPnl: string;
|
|
598
598
|
baseSymbol: string;
|
|
599
599
|
quoteSymbol: string;
|
|
600
|
-
|
|
600
|
+
userLeverage: number;
|
|
601
601
|
}
|
|
602
602
|
/**
|
|
603
603
|
* Get history orders
|
|
@@ -622,7 +622,7 @@ interface PositionHistoryItem {
|
|
|
622
622
|
realizedPnl: string;
|
|
623
623
|
baseSymbol: string;
|
|
624
624
|
quoteSymbol: string;
|
|
625
|
-
|
|
625
|
+
userLeverage: number;
|
|
626
626
|
}
|
|
627
627
|
declare const getPositionHistory: ({ accessToken, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<PositionHistoryItem[]>>;
|
|
628
628
|
/**
|
|
@@ -643,15 +643,11 @@ interface TradeFlowItem {
|
|
|
643
643
|
txTime: number;
|
|
644
644
|
baseSymbol: string;
|
|
645
645
|
quoteSymbol: string;
|
|
646
|
-
|
|
646
|
+
userLeverage: number;
|
|
647
647
|
}
|
|
648
648
|
declare const getTradeFlow: ({ accessToken, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<TradeFlowItem[]>>;
|
|
649
649
|
|
|
650
650
|
declare const baseUrl = "https://api-test.myx.cash";
|
|
651
|
-
/**
|
|
652
|
-
* Get pools
|
|
653
|
-
*/
|
|
654
|
-
declare const getPools: () => Promise<MarketPoolResponse>;
|
|
655
651
|
declare const getOraclePrice: (chainId: ChainId, poolIds?: string[]) => Promise<PriceResponse>;
|
|
656
652
|
interface LevelConfig {
|
|
657
653
|
fundingFeeRate1: number;
|
|
@@ -1280,7 +1276,6 @@ declare class Markets {
|
|
|
1280
1276
|
private utils;
|
|
1281
1277
|
constructor(configManager: ConfigManager, utils: Utils);
|
|
1282
1278
|
getMarkets(): Promise<never[]>;
|
|
1283
|
-
listPools(): Promise<MarketPool[]>;
|
|
1284
1279
|
getPoolLevelConfig(poolId: string): Promise<PoolLevelConfig>;
|
|
1285
1280
|
/**
|
|
1286
1281
|
* kline start
|
|
@@ -1529,4 +1524,4 @@ declare class MyxClient {
|
|
|
1529
1524
|
constructor(options: MyxClientConfig);
|
|
1530
1525
|
}
|
|
1531
1526
|
|
|
1532
|
-
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, type DashboardType, Direction, DirectionEnum, ErrorCode, ExecTypeEnum, type FavoritesListItem, type FavoritesListParams, type FavoritesTimeInterval, type FavoritesType, type GetBaseDetailParams, type GetHistoryOrdersParams, type GetKlineDataParams, type GetMarketDetailParams, type GetPoolLevelConfigParams, type GetTickerDataParams, type HistoryOrderItem, HttpKlineIntervalEnum, type KlineDataItemType, type KlineDataResponse, type KlineResolution, type LevelConfig, Market, MarketCapType, type MarketDetailResponse, type MarketInfo, type MarketInfoMap, 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 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, type TradeFlowItem, type TradingResult, TriggerType, TriggerTypeEnum, type UpdateOrderTpSlParams, addFavorite, approve, index$2 as base, baseUrl, bigintAmountSlipperCalculator, bigintTradingGasPriceWithRatio, bigintTradingGasToRatioCalculator, getAllTickers, getAllowanceApproved, getBalanceOf, getBaseDetail, getFavoritesList, getHistoryOrders, getKlineData, getKlineLatestBar, getMarketDetail, getOraclePrice, getOrders, getPoolDetail, getPoolLevelConfig, getPoolOpenOrders,
|
|
1527
|
+
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, type DashboardType, Direction, DirectionEnum, ErrorCode, ExecTypeEnum, type FavoritesListItem, type FavoritesListParams, type FavoritesTimeInterval, type FavoritesType, type GetBaseDetailParams, type GetHistoryOrdersParams, type GetKlineDataParams, type GetMarketDetailParams, type GetPoolLevelConfigParams, type GetTickerDataParams, type HistoryOrderItem, HttpKlineIntervalEnum, type KlineDataItemType, type KlineDataResponse, type KlineResolution, type LevelConfig, Market, MarketCapType, type MarketDetailResponse, type MarketInfo, type MarketInfoMap, 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 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, type TradeFlowItem, type TradingResult, TriggerType, TriggerTypeEnum, type UpdateOrderTpSlParams, addFavorite, approve, index$2 as base, baseUrl, bigintAmountSlipperCalculator, bigintTradingGasPriceWithRatio, bigintTradingGasToRatioCalculator, getAllTickers, getAllowanceApproved, getBalanceOf, getBaseDetail, getFavoritesList, getHistoryOrders, getKlineData, getKlineLatestBar, getMarketDetail, getOraclePrice, getOrders, getPoolDetail, getPoolLevelConfig, getPoolOpenOrders, 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
|
@@ -597,7 +597,7 @@ interface HistoryOrderItem {
|
|
|
597
597
|
realizedPnl: string;
|
|
598
598
|
baseSymbol: string;
|
|
599
599
|
quoteSymbol: string;
|
|
600
|
-
|
|
600
|
+
userLeverage: number;
|
|
601
601
|
}
|
|
602
602
|
/**
|
|
603
603
|
* Get history orders
|
|
@@ -622,7 +622,7 @@ interface PositionHistoryItem {
|
|
|
622
622
|
realizedPnl: string;
|
|
623
623
|
baseSymbol: string;
|
|
624
624
|
quoteSymbol: string;
|
|
625
|
-
|
|
625
|
+
userLeverage: number;
|
|
626
626
|
}
|
|
627
627
|
declare const getPositionHistory: ({ accessToken, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<PositionHistoryItem[]>>;
|
|
628
628
|
/**
|
|
@@ -643,15 +643,11 @@ interface TradeFlowItem {
|
|
|
643
643
|
txTime: number;
|
|
644
644
|
baseSymbol: string;
|
|
645
645
|
quoteSymbol: string;
|
|
646
|
-
|
|
646
|
+
userLeverage: number;
|
|
647
647
|
}
|
|
648
648
|
declare const getTradeFlow: ({ accessToken, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<TradeFlowItem[]>>;
|
|
649
649
|
|
|
650
650
|
declare const baseUrl = "https://api-test.myx.cash";
|
|
651
|
-
/**
|
|
652
|
-
* Get pools
|
|
653
|
-
*/
|
|
654
|
-
declare const getPools: () => Promise<MarketPoolResponse>;
|
|
655
651
|
declare const getOraclePrice: (chainId: ChainId, poolIds?: string[]) => Promise<PriceResponse>;
|
|
656
652
|
interface LevelConfig {
|
|
657
653
|
fundingFeeRate1: number;
|
|
@@ -1280,7 +1276,6 @@ declare class Markets {
|
|
|
1280
1276
|
private utils;
|
|
1281
1277
|
constructor(configManager: ConfigManager, utils: Utils);
|
|
1282
1278
|
getMarkets(): Promise<never[]>;
|
|
1283
|
-
listPools(): Promise<MarketPool[]>;
|
|
1284
1279
|
getPoolLevelConfig(poolId: string): Promise<PoolLevelConfig>;
|
|
1285
1280
|
/**
|
|
1286
1281
|
* kline start
|
|
@@ -1529,4 +1524,4 @@ declare class MyxClient {
|
|
|
1529
1524
|
constructor(options: MyxClientConfig);
|
|
1530
1525
|
}
|
|
1531
1526
|
|
|
1532
|
-
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, type DashboardType, Direction, DirectionEnum, ErrorCode, ExecTypeEnum, type FavoritesListItem, type FavoritesListParams, type FavoritesTimeInterval, type FavoritesType, type GetBaseDetailParams, type GetHistoryOrdersParams, type GetKlineDataParams, type GetMarketDetailParams, type GetPoolLevelConfigParams, type GetTickerDataParams, type HistoryOrderItem, HttpKlineIntervalEnum, type KlineDataItemType, type KlineDataResponse, type KlineResolution, type LevelConfig, Market, MarketCapType, type MarketDetailResponse, type MarketInfo, type MarketInfoMap, 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 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, type TradeFlowItem, type TradingResult, TriggerType, TriggerTypeEnum, type UpdateOrderTpSlParams, addFavorite, approve, index$2 as base, baseUrl, bigintAmountSlipperCalculator, bigintTradingGasPriceWithRatio, bigintTradingGasToRatioCalculator, getAllTickers, getAllowanceApproved, getBalanceOf, getBaseDetail, getFavoritesList, getHistoryOrders, getKlineData, getKlineLatestBar, getMarketDetail, getOraclePrice, getOrders, getPoolDetail, getPoolLevelConfig, getPoolOpenOrders,
|
|
1527
|
+
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, type DashboardType, Direction, DirectionEnum, ErrorCode, ExecTypeEnum, type FavoritesListItem, type FavoritesListParams, type FavoritesTimeInterval, type FavoritesType, type GetBaseDetailParams, type GetHistoryOrdersParams, type GetKlineDataParams, type GetMarketDetailParams, type GetPoolLevelConfigParams, type GetTickerDataParams, type HistoryOrderItem, HttpKlineIntervalEnum, type KlineDataItemType, type KlineDataResponse, type KlineResolution, type LevelConfig, Market, MarketCapType, type MarketDetailResponse, type MarketInfo, type MarketInfoMap, 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 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, type TradeFlowItem, type TradingResult, TriggerType, TriggerTypeEnum, type UpdateOrderTpSlParams, addFavorite, approve, index$2 as base, baseUrl, bigintAmountSlipperCalculator, bigintTradingGasPriceWithRatio, bigintTradingGasToRatioCalculator, getAllTickers, getAllowanceApproved, getBalanceOf, getBaseDetail, getFavoritesList, getHistoryOrders, getKlineData, getKlineLatestBar, getMarketDetail, getOraclePrice, getOrders, getPoolDetail, getPoolLevelConfig, getPoolOpenOrders, getPositionHistory, getPositions, getPriceData, getPricesData, getTickerData, getTokenInfo, getTradeFlow, index as market, index$3 as pool, index$1 as quote, removeFavorite, searchMarket, searchMarketAuth };
|
package/dist/index.js
CHANGED
|
@@ -77,7 +77,6 @@ __export(index_exports, {
|
|
|
77
77
|
getPoolDetail: () => getPoolDetail,
|
|
78
78
|
getPoolLevelConfig: () => getPoolLevelConfig,
|
|
79
79
|
getPoolOpenOrders: () => getPoolOpenOrders,
|
|
80
|
-
getPools: () => getPools,
|
|
81
80
|
getPositionHistory: () => getPositionHistory,
|
|
82
81
|
getPositions: () => getPositions,
|
|
83
82
|
getPriceData: () => getPriceData,
|
|
@@ -1827,7 +1826,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
|
|
|
1827
1826
|
// package.json
|
|
1828
1827
|
var package_default = {
|
|
1829
1828
|
name: "@myx-trade/sdk",
|
|
1830
|
-
version: "0.1.
|
|
1829
|
+
version: "0.1.17",
|
|
1831
1830
|
private: false,
|
|
1832
1831
|
publishConfig: {
|
|
1833
1832
|
access: "public"
|
|
@@ -9819,9 +9818,6 @@ var getTradeFlow = async ({
|
|
|
9819
9818
|
|
|
9820
9819
|
// src/api/index.ts
|
|
9821
9820
|
var baseUrl = "https://api-test.myx.cash";
|
|
9822
|
-
var getPools = async () => {
|
|
9823
|
-
return http.get(`${baseUrl}/v2/mx-scan/market/list`);
|
|
9824
|
-
};
|
|
9825
9821
|
var getOraclePrice = async (chainId2, poolIds = []) => {
|
|
9826
9822
|
if (!!poolIds.length) {
|
|
9827
9823
|
return http.get(`${baseUrl}/openapi/gateway/quote/price/oracles`, {
|
|
@@ -9844,7 +9840,7 @@ var getPoolLevelConfig = async ({
|
|
|
9844
9840
|
};
|
|
9845
9841
|
var getPoolDetail = async (chainId2, poolId) => {
|
|
9846
9842
|
return await http.get(
|
|
9847
|
-
`${baseUrl}/
|
|
9843
|
+
`${baseUrl}/openapi/gateway/scan/market/detail?chainId=${chainId2}&poolId=${poolId}`
|
|
9848
9844
|
);
|
|
9849
9845
|
};
|
|
9850
9846
|
var getPositions = async (accessToken, chainId2) => {
|
|
@@ -12074,9 +12070,6 @@ var Markets = class {
|
|
|
12074
12070
|
getMarkets() {
|
|
12075
12071
|
return Promise.resolve([]);
|
|
12076
12072
|
}
|
|
12077
|
-
async listPools() {
|
|
12078
|
-
return (await getPools()).data;
|
|
12079
|
-
}
|
|
12080
12073
|
async getPoolLevelConfig(poolId) {
|
|
12081
12074
|
const config = this.configManager.getConfig();
|
|
12082
12075
|
return (await getPoolLevelConfig({
|
|
@@ -18233,7 +18226,6 @@ var MyxClient = class {
|
|
|
18233
18226
|
getPoolDetail,
|
|
18234
18227
|
getPoolLevelConfig,
|
|
18235
18228
|
getPoolOpenOrders,
|
|
18236
|
-
getPools,
|
|
18237
18229
|
getPositionHistory,
|
|
18238
18230
|
getPositions,
|
|
18239
18231
|
getPriceData,
|
package/dist/index.mjs
CHANGED
|
@@ -1741,7 +1741,7 @@ var RotationProvider = class extends BaseProvider {
|
|
|
1741
1741
|
// package.json
|
|
1742
1742
|
var package_default = {
|
|
1743
1743
|
name: "@myx-trade/sdk",
|
|
1744
|
-
version: "0.1.
|
|
1744
|
+
version: "0.1.17",
|
|
1745
1745
|
private: false,
|
|
1746
1746
|
publishConfig: {
|
|
1747
1747
|
access: "public"
|
|
@@ -9733,9 +9733,6 @@ var getTradeFlow = async ({
|
|
|
9733
9733
|
|
|
9734
9734
|
// src/api/index.ts
|
|
9735
9735
|
var baseUrl = "https://api-test.myx.cash";
|
|
9736
|
-
var getPools = async () => {
|
|
9737
|
-
return http.get(`${baseUrl}/v2/mx-scan/market/list`);
|
|
9738
|
-
};
|
|
9739
9736
|
var getOraclePrice = async (chainId2, poolIds = []) => {
|
|
9740
9737
|
if (!!poolIds.length) {
|
|
9741
9738
|
return http.get(`${baseUrl}/openapi/gateway/quote/price/oracles`, {
|
|
@@ -9758,7 +9755,7 @@ var getPoolLevelConfig = async ({
|
|
|
9758
9755
|
};
|
|
9759
9756
|
var getPoolDetail = async (chainId2, poolId) => {
|
|
9760
9757
|
return await http.get(
|
|
9761
|
-
`${baseUrl}/
|
|
9758
|
+
`${baseUrl}/openapi/gateway/scan/market/detail?chainId=${chainId2}&poolId=${poolId}`
|
|
9762
9759
|
);
|
|
9763
9760
|
};
|
|
9764
9761
|
var getPositions = async (accessToken, chainId2) => {
|
|
@@ -11988,9 +11985,6 @@ var Markets = class {
|
|
|
11988
11985
|
getMarkets() {
|
|
11989
11986
|
return Promise.resolve([]);
|
|
11990
11987
|
}
|
|
11991
|
-
async listPools() {
|
|
11992
|
-
return (await getPools()).data;
|
|
11993
|
-
}
|
|
11994
11988
|
async getPoolLevelConfig(poolId) {
|
|
11995
11989
|
const config = this.configManager.getConfig();
|
|
11996
11990
|
return (await getPoolLevelConfig({
|
|
@@ -18146,7 +18140,6 @@ export {
|
|
|
18146
18140
|
getPoolDetail,
|
|
18147
18141
|
getPoolLevelConfig,
|
|
18148
18142
|
getPoolOpenOrders,
|
|
18149
|
-
getPools,
|
|
18150
18143
|
getPositionHistory,
|
|
18151
18144
|
getPositions,
|
|
18152
18145
|
getPriceData,
|