@myx-trade/sdk 0.1.212 → 0.1.215
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 +16 -25
- package/dist/index.d.ts +16 -25
- package/dist/index.js +9 -3
- package/dist/index.mjs +9 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import * as ethers from 'ethers';
|
|
|
2
2
|
import { AddressLike, Signer, ethers as ethers$1 } from 'ethers';
|
|
3
3
|
export { formatUnits, parseUnits } from 'ethers';
|
|
4
4
|
import { Options, Event } from 'reconnecting-websocket';
|
|
5
|
-
import { WalletClient } from 'viem';
|
|
5
|
+
import { Address as Address$1, WalletClient } from 'viem';
|
|
6
6
|
|
|
7
7
|
declare enum ChainId {
|
|
8
8
|
LINEA_SEPOLIA = 59141,
|
|
@@ -223,7 +223,7 @@ interface UpdateOrderTpSlParams {
|
|
|
223
223
|
interface ObjectType<T> {
|
|
224
224
|
[key: string]: T;
|
|
225
225
|
}
|
|
226
|
-
type Address
|
|
226
|
+
type Address = `0x${string}`;
|
|
227
227
|
type NetWorkFee = {
|
|
228
228
|
paymentType: number;
|
|
229
229
|
volScale: number;
|
|
@@ -415,7 +415,7 @@ interface SearchResultContractItem {
|
|
|
415
415
|
poolId: string;
|
|
416
416
|
baseQuoteSymbol: string;
|
|
417
417
|
symbolName: string;
|
|
418
|
-
baseToken: Address
|
|
418
|
+
baseToken: Address;
|
|
419
419
|
tokenIcon: string;
|
|
420
420
|
type: MarketType;
|
|
421
421
|
capType: MarketCapType;
|
|
@@ -435,7 +435,7 @@ interface SearchResultCookItem {
|
|
|
435
435
|
poolId: string;
|
|
436
436
|
mBaseQuoteSymbol: string;
|
|
437
437
|
symbolName: string;
|
|
438
|
-
baseToken: Address
|
|
438
|
+
baseToken: Address;
|
|
439
439
|
tokenIcon: string;
|
|
440
440
|
type: MarketType;
|
|
441
441
|
state: MarketPoolState;
|
|
@@ -450,7 +450,7 @@ interface SearchResultEarnItem {
|
|
|
450
450
|
poolId: string;
|
|
451
451
|
mQuoteBaseSymbol: string;
|
|
452
452
|
symbolName: string;
|
|
453
|
-
baseToken: Address
|
|
453
|
+
baseToken: Address;
|
|
454
454
|
tokenIcon: string;
|
|
455
455
|
type: MarketType;
|
|
456
456
|
state: MarketPoolState;
|
|
@@ -480,7 +480,7 @@ interface FavoritesListItem {
|
|
|
480
480
|
symbolName: string;
|
|
481
481
|
tokenIcon: string;
|
|
482
482
|
capType: MarketCapType;
|
|
483
|
-
baseToken: Address
|
|
483
|
+
baseToken: Address;
|
|
484
484
|
basePrice: string;
|
|
485
485
|
priceChange: string;
|
|
486
486
|
volume: string;
|
|
@@ -507,7 +507,7 @@ interface BaseDetailResponse {
|
|
|
507
507
|
lpPriceChange: string;
|
|
508
508
|
chainId: number;
|
|
509
509
|
tokenCreateTime: number;
|
|
510
|
-
baseToken: Address
|
|
510
|
+
baseToken: Address;
|
|
511
511
|
marketId: string;
|
|
512
512
|
basePrice: string;
|
|
513
513
|
tvl: string;
|
|
@@ -524,10 +524,10 @@ interface MarketDetailResponse {
|
|
|
524
524
|
quoteSymbol: string;
|
|
525
525
|
baseDecimals: number;
|
|
526
526
|
quoteDecimals: number;
|
|
527
|
-
baseToken: Address
|
|
528
|
-
quoteToken: Address
|
|
529
|
-
basePoolToken: Address
|
|
530
|
-
quotePoolToken: Address
|
|
527
|
+
baseToken: Address;
|
|
528
|
+
quoteToken: Address;
|
|
529
|
+
basePoolToken: Address;
|
|
530
|
+
quotePoolToken: Address;
|
|
531
531
|
oracleType: OracleType;
|
|
532
532
|
feedId: string;
|
|
533
533
|
activeTime: number;
|
|
@@ -550,17 +550,6 @@ interface MarketInfo {
|
|
|
550
550
|
decimals: number;
|
|
551
551
|
}
|
|
552
552
|
|
|
553
|
-
declare class Address {
|
|
554
|
-
private _addr;
|
|
555
|
-
static ZERO_ADDRESS: Address;
|
|
556
|
-
constructor(addr?: string);
|
|
557
|
-
toString(): string;
|
|
558
|
-
format(): string;
|
|
559
|
-
unmaskFormat(): string;
|
|
560
|
-
static from(addr?: string): Address;
|
|
561
|
-
isEqualTo(otherAddress?: string | Address): boolean;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
553
|
interface GetHistoryOrdersParams {
|
|
565
554
|
limit?: number;
|
|
566
555
|
chainId?: number;
|
|
@@ -636,7 +625,7 @@ interface HistoryOrderItem {
|
|
|
636
625
|
orderStatus: OrderStatusEnum;
|
|
637
626
|
execType: ExecTypeEnum;
|
|
638
627
|
slippagePct: number;
|
|
639
|
-
executionFeeToken: Address;
|
|
628
|
+
executionFeeToken: Address$1;
|
|
640
629
|
executionFeeAmount: string;
|
|
641
630
|
tradingFee: string;
|
|
642
631
|
fundingFee: string;
|
|
@@ -692,12 +681,13 @@ declare enum TradeFlowAccountTypeEnum {
|
|
|
692
681
|
interface TradeFlowItem {
|
|
693
682
|
chainId: number;
|
|
694
683
|
orderId: number;
|
|
695
|
-
user: Address;
|
|
684
|
+
user: Address$1;
|
|
696
685
|
poolId: string;
|
|
697
686
|
fundingFee: string;
|
|
698
687
|
tradingFee: string;
|
|
699
688
|
charge: string;
|
|
700
689
|
collateralAmount: string;
|
|
690
|
+
collateralBase: string;
|
|
701
691
|
txHash: string;
|
|
702
692
|
txTime: number;
|
|
703
693
|
type: TradeFlowTypeEnum;
|
|
@@ -710,6 +700,7 @@ interface TradeFlowItem {
|
|
|
710
700
|
referrerRebate: string;
|
|
711
701
|
referralRebate: string;
|
|
712
702
|
rebateClaimedAmount: string;
|
|
703
|
+
token?: Address$1;
|
|
713
704
|
}
|
|
714
705
|
|
|
715
706
|
type ForwarderTxParams = {
|
|
@@ -2003,4 +1994,4 @@ declare class MyxClient {
|
|
|
2003
1994
|
getAccessToken(): Promise<string | null>;
|
|
2004
1995
|
}
|
|
2005
1996
|
|
|
2006
|
-
export { type AccessTokenRequest, type AccessTokenResponse$1 as AccessTokenResponse, type AccessTokenType, type AddFavoriteParams, type Address
|
|
1997
|
+
export { type AccessTokenRequest, type AccessTokenResponse$1 as AccessTokenResponse, type AccessTokenType, type AddFavoriteParams, type 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as ethers from 'ethers';
|
|
|
2
2
|
import { AddressLike, Signer, ethers as ethers$1 } from 'ethers';
|
|
3
3
|
export { formatUnits, parseUnits } from 'ethers';
|
|
4
4
|
import { Options, Event } from 'reconnecting-websocket';
|
|
5
|
-
import { WalletClient } from 'viem';
|
|
5
|
+
import { Address as Address$1, WalletClient } from 'viem';
|
|
6
6
|
|
|
7
7
|
declare enum ChainId {
|
|
8
8
|
LINEA_SEPOLIA = 59141,
|
|
@@ -223,7 +223,7 @@ interface UpdateOrderTpSlParams {
|
|
|
223
223
|
interface ObjectType<T> {
|
|
224
224
|
[key: string]: T;
|
|
225
225
|
}
|
|
226
|
-
type Address
|
|
226
|
+
type Address = `0x${string}`;
|
|
227
227
|
type NetWorkFee = {
|
|
228
228
|
paymentType: number;
|
|
229
229
|
volScale: number;
|
|
@@ -415,7 +415,7 @@ interface SearchResultContractItem {
|
|
|
415
415
|
poolId: string;
|
|
416
416
|
baseQuoteSymbol: string;
|
|
417
417
|
symbolName: string;
|
|
418
|
-
baseToken: Address
|
|
418
|
+
baseToken: Address;
|
|
419
419
|
tokenIcon: string;
|
|
420
420
|
type: MarketType;
|
|
421
421
|
capType: MarketCapType;
|
|
@@ -435,7 +435,7 @@ interface SearchResultCookItem {
|
|
|
435
435
|
poolId: string;
|
|
436
436
|
mBaseQuoteSymbol: string;
|
|
437
437
|
symbolName: string;
|
|
438
|
-
baseToken: Address
|
|
438
|
+
baseToken: Address;
|
|
439
439
|
tokenIcon: string;
|
|
440
440
|
type: MarketType;
|
|
441
441
|
state: MarketPoolState;
|
|
@@ -450,7 +450,7 @@ interface SearchResultEarnItem {
|
|
|
450
450
|
poolId: string;
|
|
451
451
|
mQuoteBaseSymbol: string;
|
|
452
452
|
symbolName: string;
|
|
453
|
-
baseToken: Address
|
|
453
|
+
baseToken: Address;
|
|
454
454
|
tokenIcon: string;
|
|
455
455
|
type: MarketType;
|
|
456
456
|
state: MarketPoolState;
|
|
@@ -480,7 +480,7 @@ interface FavoritesListItem {
|
|
|
480
480
|
symbolName: string;
|
|
481
481
|
tokenIcon: string;
|
|
482
482
|
capType: MarketCapType;
|
|
483
|
-
baseToken: Address
|
|
483
|
+
baseToken: Address;
|
|
484
484
|
basePrice: string;
|
|
485
485
|
priceChange: string;
|
|
486
486
|
volume: string;
|
|
@@ -507,7 +507,7 @@ interface BaseDetailResponse {
|
|
|
507
507
|
lpPriceChange: string;
|
|
508
508
|
chainId: number;
|
|
509
509
|
tokenCreateTime: number;
|
|
510
|
-
baseToken: Address
|
|
510
|
+
baseToken: Address;
|
|
511
511
|
marketId: string;
|
|
512
512
|
basePrice: string;
|
|
513
513
|
tvl: string;
|
|
@@ -524,10 +524,10 @@ interface MarketDetailResponse {
|
|
|
524
524
|
quoteSymbol: string;
|
|
525
525
|
baseDecimals: number;
|
|
526
526
|
quoteDecimals: number;
|
|
527
|
-
baseToken: Address
|
|
528
|
-
quoteToken: Address
|
|
529
|
-
basePoolToken: Address
|
|
530
|
-
quotePoolToken: Address
|
|
527
|
+
baseToken: Address;
|
|
528
|
+
quoteToken: Address;
|
|
529
|
+
basePoolToken: Address;
|
|
530
|
+
quotePoolToken: Address;
|
|
531
531
|
oracleType: OracleType;
|
|
532
532
|
feedId: string;
|
|
533
533
|
activeTime: number;
|
|
@@ -550,17 +550,6 @@ interface MarketInfo {
|
|
|
550
550
|
decimals: number;
|
|
551
551
|
}
|
|
552
552
|
|
|
553
|
-
declare class Address {
|
|
554
|
-
private _addr;
|
|
555
|
-
static ZERO_ADDRESS: Address;
|
|
556
|
-
constructor(addr?: string);
|
|
557
|
-
toString(): string;
|
|
558
|
-
format(): string;
|
|
559
|
-
unmaskFormat(): string;
|
|
560
|
-
static from(addr?: string): Address;
|
|
561
|
-
isEqualTo(otherAddress?: string | Address): boolean;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
553
|
interface GetHistoryOrdersParams {
|
|
565
554
|
limit?: number;
|
|
566
555
|
chainId?: number;
|
|
@@ -636,7 +625,7 @@ interface HistoryOrderItem {
|
|
|
636
625
|
orderStatus: OrderStatusEnum;
|
|
637
626
|
execType: ExecTypeEnum;
|
|
638
627
|
slippagePct: number;
|
|
639
|
-
executionFeeToken: Address;
|
|
628
|
+
executionFeeToken: Address$1;
|
|
640
629
|
executionFeeAmount: string;
|
|
641
630
|
tradingFee: string;
|
|
642
631
|
fundingFee: string;
|
|
@@ -692,12 +681,13 @@ declare enum TradeFlowAccountTypeEnum {
|
|
|
692
681
|
interface TradeFlowItem {
|
|
693
682
|
chainId: number;
|
|
694
683
|
orderId: number;
|
|
695
|
-
user: Address;
|
|
684
|
+
user: Address$1;
|
|
696
685
|
poolId: string;
|
|
697
686
|
fundingFee: string;
|
|
698
687
|
tradingFee: string;
|
|
699
688
|
charge: string;
|
|
700
689
|
collateralAmount: string;
|
|
690
|
+
collateralBase: string;
|
|
701
691
|
txHash: string;
|
|
702
692
|
txTime: number;
|
|
703
693
|
type: TradeFlowTypeEnum;
|
|
@@ -710,6 +700,7 @@ interface TradeFlowItem {
|
|
|
710
700
|
referrerRebate: string;
|
|
711
701
|
referralRebate: string;
|
|
712
702
|
rebateClaimedAmount: string;
|
|
703
|
+
token?: Address$1;
|
|
713
704
|
}
|
|
714
705
|
|
|
715
706
|
type ForwarderTxParams = {
|
|
@@ -2003,4 +1994,4 @@ declare class MyxClient {
|
|
|
2003
1994
|
getAccessToken(): Promise<string | null>;
|
|
2004
1995
|
}
|
|
2005
1996
|
|
|
2006
|
-
export { type AccessTokenRequest, type AccessTokenResponse$1 as AccessTokenResponse, type AccessTokenType, type AddFavoriteParams, type Address
|
|
1997
|
+
export { type AccessTokenRequest, type AccessTokenResponse$1 as AccessTokenResponse, type AccessTokenType, type AddFavoriteParams, type 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 };
|
package/dist/index.js
CHANGED
|
@@ -1807,7 +1807,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
|
|
|
1807
1807
|
// package.json
|
|
1808
1808
|
var package_default = {
|
|
1809
1809
|
name: "@myx-trade/sdk",
|
|
1810
|
-
version: "0.1.
|
|
1810
|
+
version: "0.1.215",
|
|
1811
1811
|
private: false,
|
|
1812
1812
|
publishConfig: {
|
|
1813
1813
|
access: "public"
|
|
@@ -20291,8 +20291,14 @@ var Utils = class {
|
|
|
20291
20291
|
if (error?.code === "ACTION_REJECTED" || error?.code === 4001 || error?.info?.error?.code === 4001 || typeof error?.message === "string" && (error.message.toLowerCase().includes("user rejected") || error.message.toLowerCase().includes("denied"))) {
|
|
20292
20292
|
return "User Rejected";
|
|
20293
20293
|
}
|
|
20294
|
-
|
|
20295
|
-
|
|
20294
|
+
let errorData = error?.data;
|
|
20295
|
+
if (!errorData && error?.message && typeof error.message === "string") {
|
|
20296
|
+
const dataMatch = error.message.match(/data=["'](0x[0-9a-fA-F]+)["']/i);
|
|
20297
|
+
if (dataMatch && dataMatch[1]) {
|
|
20298
|
+
errorData = dataMatch[1];
|
|
20299
|
+
}
|
|
20300
|
+
}
|
|
20301
|
+
if (errorData) {
|
|
20296
20302
|
const selector = typeof errorData === "string" && errorData.startsWith("0x") ? errorData.slice(0, 10).toLowerCase() : null;
|
|
20297
20303
|
if (selector) {
|
|
20298
20304
|
const errorKey = Object.keys(customErrorMapping).find(
|
package/dist/index.mjs
CHANGED
|
@@ -1731,7 +1731,7 @@ var RotationProvider = class extends BaseProvider {
|
|
|
1731
1731
|
// package.json
|
|
1732
1732
|
var package_default = {
|
|
1733
1733
|
name: "@myx-trade/sdk",
|
|
1734
|
-
version: "0.1.
|
|
1734
|
+
version: "0.1.215",
|
|
1735
1735
|
private: false,
|
|
1736
1736
|
publishConfig: {
|
|
1737
1737
|
access: "public"
|
|
@@ -20215,8 +20215,14 @@ var Utils = class {
|
|
|
20215
20215
|
if (error?.code === "ACTION_REJECTED" || error?.code === 4001 || error?.info?.error?.code === 4001 || typeof error?.message === "string" && (error.message.toLowerCase().includes("user rejected") || error.message.toLowerCase().includes("denied"))) {
|
|
20216
20216
|
return "User Rejected";
|
|
20217
20217
|
}
|
|
20218
|
-
|
|
20219
|
-
|
|
20218
|
+
let errorData = error?.data;
|
|
20219
|
+
if (!errorData && error?.message && typeof error.message === "string") {
|
|
20220
|
+
const dataMatch = error.message.match(/data=["'](0x[0-9a-fA-F]+)["']/i);
|
|
20221
|
+
if (dataMatch && dataMatch[1]) {
|
|
20222
|
+
errorData = dataMatch[1];
|
|
20223
|
+
}
|
|
20224
|
+
}
|
|
20225
|
+
if (errorData) {
|
|
20220
20226
|
const selector = typeof errorData === "string" && errorData.startsWith("0x") ? errorData.slice(0, 10).toLowerCase() : null;
|
|
20221
20227
|
if (selector) {
|
|
20222
20228
|
const errorKey = Object.keys(customErrorMapping).find(
|