@metamask-previews/perps-controller 15.1.0-preview-6b7c25c → 15.1.0-preview-00a181c
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/CHANGELOG.md +14 -0
- package/dist/PerpsController-method-action-types.cjs.map +1 -1
- package/dist/PerpsController-method-action-types.d.cts +20 -1
- package/dist/PerpsController-method-action-types.d.cts.map +1 -1
- package/dist/PerpsController-method-action-types.d.mts +20 -1
- package/dist/PerpsController-method-action-types.d.mts.map +1 -1
- package/dist/PerpsController-method-action-types.mjs.map +1 -1
- package/dist/PerpsController.cjs +65 -154
- package/dist/PerpsController.cjs.map +1 -1
- package/dist/PerpsController.d.cts +37 -43
- package/dist/PerpsController.d.cts.map +1 -1
- package/dist/PerpsController.d.mts +37 -43
- package/dist/PerpsController.d.mts.map +1 -1
- package/dist/PerpsController.mjs +64 -151
- package/dist/PerpsController.mjs.map +1 -1
- package/dist/aggregation/SubscriptionMultiplexer.cjs +1 -1
- package/dist/aggregation/SubscriptionMultiplexer.cjs.map +1 -1
- package/dist/aggregation/SubscriptionMultiplexer.d.cts +1 -1
- package/dist/aggregation/SubscriptionMultiplexer.d.mts +1 -1
- package/dist/aggregation/SubscriptionMultiplexer.mjs +1 -1
- package/dist/aggregation/SubscriptionMultiplexer.mjs.map +1 -1
- package/dist/constants/index.cjs +0 -1
- package/dist/constants/index.cjs.map +1 -1
- package/dist/constants/index.d.cts +0 -1
- package/dist/constants/index.d.cts.map +1 -1
- package/dist/constants/index.d.mts +0 -1
- package/dist/constants/index.d.mts.map +1 -1
- package/dist/constants/index.mjs +0 -1
- package/dist/constants/index.mjs.map +1 -1
- package/dist/constants/perpsConfig.cjs +4 -9
- package/dist/constants/perpsConfig.cjs.map +1 -1
- package/dist/constants/perpsConfig.d.cts +3 -5
- package/dist/constants/perpsConfig.d.cts.map +1 -1
- package/dist/constants/perpsConfig.d.mts +3 -5
- package/dist/constants/perpsConfig.d.mts.map +1 -1
- package/dist/constants/perpsConfig.mjs +4 -9
- package/dist/constants/perpsConfig.mjs.map +1 -1
- package/dist/index.cjs +146 -175
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +0 -1
- package/dist/index.mjs.map +1 -1
- package/dist/providers/AggregatedPerpsProvider.cjs +8 -2
- package/dist/providers/AggregatedPerpsProvider.cjs.map +1 -1
- package/dist/providers/AggregatedPerpsProvider.d.cts +3 -2
- package/dist/providers/AggregatedPerpsProvider.d.cts.map +1 -1
- package/dist/providers/AggregatedPerpsProvider.d.mts +3 -2
- package/dist/providers/AggregatedPerpsProvider.d.mts.map +1 -1
- package/dist/providers/AggregatedPerpsProvider.mjs +8 -2
- package/dist/providers/AggregatedPerpsProvider.mjs.map +1 -1
- package/dist/providers/HyperLiquidProvider.cjs +118 -22
- package/dist/providers/HyperLiquidProvider.cjs.map +1 -1
- package/dist/providers/HyperLiquidProvider.d.cts +31 -0
- package/dist/providers/HyperLiquidProvider.d.cts.map +1 -1
- package/dist/providers/HyperLiquidProvider.d.mts +31 -0
- package/dist/providers/HyperLiquidProvider.d.mts.map +1 -1
- package/dist/providers/HyperLiquidProvider.mjs +118 -22
- package/dist/providers/HyperLiquidProvider.mjs.map +1 -1
- package/dist/providers/LighterProvider.cjs +1 -1
- package/dist/providers/LighterProvider.cjs.map +1 -1
- package/dist/providers/LighterProvider.mjs +1 -1
- package/dist/providers/LighterProvider.mjs.map +1 -1
- package/dist/routing/ProviderRouter.cjs +1 -1
- package/dist/routing/ProviderRouter.cjs.map +1 -1
- package/dist/routing/ProviderRouter.d.cts +1 -1
- package/dist/routing/ProviderRouter.d.mts +1 -1
- package/dist/routing/ProviderRouter.mjs +1 -1
- package/dist/routing/ProviderRouter.mjs.map +1 -1
- package/dist/services/HyperLiquidClientService.cjs.map +1 -1
- package/dist/services/HyperLiquidClientService.d.cts +26 -16
- package/dist/services/HyperLiquidClientService.d.cts.map +1 -1
- package/dist/services/HyperLiquidClientService.d.mts +26 -16
- package/dist/services/HyperLiquidClientService.d.mts.map +1 -1
- package/dist/services/HyperLiquidClientService.mjs.map +1 -1
- package/dist/services/HyperLiquidWalletService.cjs +80 -30
- package/dist/services/HyperLiquidWalletService.cjs.map +1 -1
- package/dist/services/HyperLiquidWalletService.d.cts +48 -22
- package/dist/services/HyperLiquidWalletService.d.cts.map +1 -1
- package/dist/services/HyperLiquidWalletService.d.mts +48 -22
- package/dist/services/HyperLiquidWalletService.d.mts.map +1 -1
- package/dist/services/HyperLiquidWalletService.mjs +80 -30
- package/dist/services/HyperLiquidWalletService.mjs.map +1 -1
- package/dist/services/LighterWalletService.cjs +1 -1
- package/dist/services/LighterWalletService.cjs.map +1 -1
- package/dist/services/LighterWalletService.d.cts +1 -1
- package/dist/services/LighterWalletService.d.mts +1 -1
- package/dist/services/LighterWalletService.mjs +1 -1
- package/dist/services/LighterWalletService.mjs.map +1 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +10 -16
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +10 -16
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs.map +1 -1
- package/dist/utils/lighterAdapter.cjs +1 -2
- package/dist/utils/lighterAdapter.cjs.map +1 -1
- package/dist/utils/lighterAdapter.d.cts +1 -2
- package/dist/utils/lighterAdapter.d.cts.map +1 -1
- package/dist/utils/lighterAdapter.d.mts +1 -2
- package/dist/utils/lighterAdapter.d.mts.map +1 -1
- package/dist/utils/lighterAdapter.mjs +1 -2
- package/dist/utils/lighterAdapter.mjs.map +1 -1
- package/package.json +2 -8
- package/dist/constants/myxConfig.cjs +0 -253
- package/dist/constants/myxConfig.cjs.map +0 -1
- package/dist/constants/myxConfig.d.cts +0 -145
- package/dist/constants/myxConfig.d.cts.map +0 -1
- package/dist/constants/myxConfig.d.mts +0 -145
- package/dist/constants/myxConfig.d.mts.map +0 -1
- package/dist/constants/myxConfig.mjs +0 -243
- package/dist/constants/myxConfig.mjs.map +0 -1
- package/dist/types/myx-types.cjs +0 -41
- package/dist/types/myx-types.cjs.map +0 -1
- package/dist/types/myx-types.d.cts +0 -94
- package/dist/types/myx-types.d.cts.map +0 -1
- package/dist/types/myx-types.d.mts +0 -94
- package/dist/types/myx-types.d.mts.map +0 -1
- package/dist/types/myx-types.mjs +0 -26
- package/dist/types/myx-types.mjs.map +0 -1
- package/dist/utils/myxAdapter.cjs +0 -569
- package/dist/utils/myxAdapter.cjs.map +0 -1
- package/dist/utils/myxAdapter.d.cts +0 -168
- package/dist/utils/myxAdapter.d.cts.map +0 -1
- package/dist/utils/myxAdapter.d.mts +0 -168
- package/dist/utils/myxAdapter.d.mts.map +0 -1
- package/dist/utils/myxAdapter.mjs +0 -548
- package/dist/utils/myxAdapter.mjs.map +0 -1
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MYX Protocol Configuration Constants
|
|
3
|
-
*
|
|
4
|
-
* Configuration for market display, price fetching, and trading.
|
|
5
|
-
* Based on MYX SDK patterns.
|
|
6
|
-
*/
|
|
7
|
-
import { BigNumber } from "bignumber.js";
|
|
8
|
-
// ============================================================================
|
|
9
|
-
// Network Constants
|
|
10
|
-
// ============================================================================
|
|
11
|
-
/**
|
|
12
|
-
* MYX Chain IDs
|
|
13
|
-
* Mainnet: BNB Chain (56)
|
|
14
|
-
* Testnet: Linea Sepolia (59141) — primary testnet chain with most active pools.
|
|
15
|
-
* The testnet API also has one pool on Arbitrum Sepolia (421614) but it has no
|
|
16
|
-
* ticker data, so Linea Sepolia is the effective testnet chain.
|
|
17
|
-
*/
|
|
18
|
-
export const MYX_MAINNET_CHAIN_ID = '56';
|
|
19
|
-
export const MYX_TESTNET_CHAIN_ID = '59141';
|
|
20
|
-
export const MYX_MAINNET_CAIP_CHAIN_ID = `eip155:${MYX_MAINNET_CHAIN_ID}`;
|
|
21
|
-
export const MYX_TESTNET_CAIP_CHAIN_ID = `eip155:${MYX_TESTNET_CHAIN_ID}`;
|
|
22
|
-
/**
|
|
23
|
-
* Get numeric chain ID for MYX network
|
|
24
|
-
*
|
|
25
|
-
* @param network - The MYX network environment (mainnet or testnet).
|
|
26
|
-
* @returns The numeric chain ID for the specified network.
|
|
27
|
-
*/
|
|
28
|
-
export function getMYXChainId(network) {
|
|
29
|
-
return network === 'testnet'
|
|
30
|
-
? parseInt(MYX_TESTNET_CHAIN_ID, 10)
|
|
31
|
-
: parseInt(MYX_MAINNET_CHAIN_ID, 10);
|
|
32
|
-
}
|
|
33
|
-
// ============================================================================
|
|
34
|
-
// API Endpoints
|
|
35
|
-
// ============================================================================
|
|
36
|
-
/**
|
|
37
|
-
* MYX REST and WebSocket endpoints
|
|
38
|
-
*/
|
|
39
|
-
export const MYX_ENDPOINTS = {
|
|
40
|
-
mainnet: {
|
|
41
|
-
http: 'https://api.myx.finance',
|
|
42
|
-
ws: 'wss://oapi.myx.finance/ws',
|
|
43
|
-
},
|
|
44
|
-
testnet: {
|
|
45
|
-
http: 'https://api-test.myx.cash',
|
|
46
|
-
ws: 'wss://oapi-test.myx.cash/ws',
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Get HTTP endpoint for network
|
|
51
|
-
*
|
|
52
|
-
* @param network - The MYX network environment (mainnet or testnet).
|
|
53
|
-
* @returns The HTTP API endpoint URL for the specified network.
|
|
54
|
-
*/
|
|
55
|
-
export function getMYXHttpEndpoint(network) {
|
|
56
|
-
return MYX_ENDPOINTS[network].http;
|
|
57
|
-
}
|
|
58
|
-
// ============================================================================
|
|
59
|
-
// Decimal Constants
|
|
60
|
-
// ============================================================================
|
|
61
|
-
/**
|
|
62
|
-
* MYX API returns prices as normal floating-point strings (e.g. "64854.76").
|
|
63
|
-
* No decimal scaling is needed for prices from the REST/WS API.
|
|
64
|
-
*
|
|
65
|
-
* Note: The SDK's internal contract layer uses 30 decimals, but the API
|
|
66
|
-
* endpoints (tickers, candles, order history) return human-readable values.
|
|
67
|
-
*/
|
|
68
|
-
export const MYX_PRICE_DECIMALS = 0;
|
|
69
|
-
/**
|
|
70
|
-
* MYX uses 18 decimals for position sizes
|
|
71
|
-
*/
|
|
72
|
-
export const MYX_SIZE_DECIMALS = 18;
|
|
73
|
-
/**
|
|
74
|
-
* MYX uses 18 decimals for collateral amounts (USDT on BNB)
|
|
75
|
-
*/
|
|
76
|
-
export const MYX_COLLATERAL_DECIMALS = 18;
|
|
77
|
-
// ============================================================================
|
|
78
|
-
// Token Addresses
|
|
79
|
-
// ============================================================================
|
|
80
|
-
/**
|
|
81
|
-
* Collateral token address — testnet (USDC on Linea Sepolia)
|
|
82
|
-
* From SDK: LINEA_SEPOLIA.USDC
|
|
83
|
-
*/
|
|
84
|
-
export const MYX_COLLATERAL_TOKEN_TESTNET = '0xD984fd34f91F92DA0586e1bE82E262fF27DC431b';
|
|
85
|
-
/**
|
|
86
|
-
* Collateral token address — mainnet (BUSD on BNB, per pool quoteToken)
|
|
87
|
-
* Note: individual pools may use different quote tokens
|
|
88
|
-
*/
|
|
89
|
-
export const MYX_COLLATERAL_TOKEN_MAINNET = '0x8bfc51e1928e91e47c6734983ac018b2fc0adf4e';
|
|
90
|
-
/** @deprecated Use MYX_COLLATERAL_TOKEN_TESTNET */
|
|
91
|
-
export const USDT_BNB_TESTNET = MYX_COLLATERAL_TOKEN_TESTNET;
|
|
92
|
-
/** @deprecated Use MYX_COLLATERAL_TOKEN_MAINNET */
|
|
93
|
-
export const USDT_BNB_MAINNET = MYX_COLLATERAL_TOKEN_MAINNET;
|
|
94
|
-
/**
|
|
95
|
-
* Collateral token configuration by network
|
|
96
|
-
*/
|
|
97
|
-
export const MYX_ASSET_CONFIGS = {
|
|
98
|
-
USDT: {
|
|
99
|
-
mainnet: {
|
|
100
|
-
chainId: MYX_MAINNET_CAIP_CHAIN_ID,
|
|
101
|
-
tokenAddress: MYX_COLLATERAL_TOKEN_MAINNET,
|
|
102
|
-
},
|
|
103
|
-
testnet: {
|
|
104
|
-
chainId: MYX_TESTNET_CAIP_CHAIN_ID,
|
|
105
|
-
tokenAddress: MYX_COLLATERAL_TOKEN_TESTNET,
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
};
|
|
109
|
-
// ============================================================================
|
|
110
|
-
// Decimal Conversion Helpers
|
|
111
|
-
// ============================================================================
|
|
112
|
-
/**
|
|
113
|
-
* Convert MYX API price string to standard number.
|
|
114
|
-
*
|
|
115
|
-
* MYX API returns normal floating-point price strings (e.g. "64854.76"),
|
|
116
|
-
* NOT 30-decimal scaled integers. This is a simple parseFloat.
|
|
117
|
-
*
|
|
118
|
-
* @param myxPrice - Price string from MYX API (e.g. "64854.760266796727")
|
|
119
|
-
* @returns Standard decimal number
|
|
120
|
-
*/
|
|
121
|
-
export function fromMYXPrice(myxPrice) {
|
|
122
|
-
if (!myxPrice || myxPrice === '0') {
|
|
123
|
-
return 0;
|
|
124
|
-
}
|
|
125
|
-
const parsed = parseFloat(myxPrice);
|
|
126
|
-
return isNaN(parsed) ? 0 : parsed;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Convert standard number to MYX API price string.
|
|
130
|
-
*
|
|
131
|
-
* MYX API uses normal floating-point strings, so this is a simple toString.
|
|
132
|
-
*
|
|
133
|
-
* @param price - Standard decimal number
|
|
134
|
-
* @returns Price string for MYX API
|
|
135
|
-
*/
|
|
136
|
-
export function toMYXPrice(price) {
|
|
137
|
-
const parsed = typeof price === 'string' ? parseFloat(price) : price;
|
|
138
|
-
return isNaN(parsed) ? '0' : parsed.toString();
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Convert MYX SDK size (18 decimals) to standard number
|
|
142
|
-
*
|
|
143
|
-
* @param myxSize - Size string in 18-decimal format from SDK
|
|
144
|
-
* @returns Standard decimal number
|
|
145
|
-
*/
|
|
146
|
-
export function fromMYXSize(myxSize) {
|
|
147
|
-
if (!myxSize || myxSize === '0') {
|
|
148
|
-
return 0;
|
|
149
|
-
}
|
|
150
|
-
try {
|
|
151
|
-
const bn = new BigNumber(myxSize);
|
|
152
|
-
if (bn.isNaN()) {
|
|
153
|
-
return 0;
|
|
154
|
-
}
|
|
155
|
-
const divisor = new BigNumber(10).pow(MYX_SIZE_DECIMALS);
|
|
156
|
-
return bn.dividedBy(divisor).toNumber();
|
|
157
|
-
}
|
|
158
|
-
catch {
|
|
159
|
-
return 0;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Convert standard number to MYX SDK size format (18 decimals)
|
|
164
|
-
*
|
|
165
|
-
* @param size - Standard decimal number
|
|
166
|
-
* @returns Size string in 18-decimal format for SDK
|
|
167
|
-
*/
|
|
168
|
-
export function toMYXSize(size) {
|
|
169
|
-
try {
|
|
170
|
-
const bn = new BigNumber(size);
|
|
171
|
-
if (bn.isNaN()) {
|
|
172
|
-
return '0';
|
|
173
|
-
}
|
|
174
|
-
const multiplier = new BigNumber(10).pow(MYX_SIZE_DECIMALS);
|
|
175
|
-
return bn.multipliedBy(multiplier).toFixed(0);
|
|
176
|
-
}
|
|
177
|
-
catch {
|
|
178
|
-
return '0';
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Convert MYX SDK collateral (18 decimals) to standard number
|
|
183
|
-
*
|
|
184
|
-
* @param myxCollateral - Collateral string in 18-decimal format from SDK
|
|
185
|
-
* @returns Standard decimal number
|
|
186
|
-
*/
|
|
187
|
-
export function fromMYXCollateral(myxCollateral) {
|
|
188
|
-
if (!myxCollateral || myxCollateral === '0') {
|
|
189
|
-
return 0;
|
|
190
|
-
}
|
|
191
|
-
try {
|
|
192
|
-
const bn = new BigNumber(myxCollateral);
|
|
193
|
-
if (bn.isNaN()) {
|
|
194
|
-
return 0;
|
|
195
|
-
}
|
|
196
|
-
const divisor = new BigNumber(10).pow(MYX_COLLATERAL_DECIMALS);
|
|
197
|
-
return bn.dividedBy(divisor).toNumber();
|
|
198
|
-
}
|
|
199
|
-
catch {
|
|
200
|
-
return 0;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
// ============================================================================
|
|
204
|
-
// REST API Configuration
|
|
205
|
-
// ============================================================================
|
|
206
|
-
/**
|
|
207
|
-
* Price polling interval in milliseconds
|
|
208
|
-
* Using 5 seconds as a fallback for unreliable WebSocket
|
|
209
|
-
*/
|
|
210
|
-
export const MYX_PRICE_POLLING_INTERVAL_MS = 5000;
|
|
211
|
-
/**
|
|
212
|
-
* HTTP request timeout in milliseconds
|
|
213
|
-
*/
|
|
214
|
-
export const MYX_HTTP_TIMEOUT_MS = 10000;
|
|
215
|
-
/**
|
|
216
|
-
* Maximum retries for failed API requests
|
|
217
|
-
*/
|
|
218
|
-
export const MYX_MAX_RETRIES = 3;
|
|
219
|
-
/**
|
|
220
|
-
* Default slippage in basis points for MYX orders (1% — matches SDK default)
|
|
221
|
-
*/
|
|
222
|
-
export const MYX_DEFAULT_SLIPPAGE_BPS = 100;
|
|
223
|
-
/**
|
|
224
|
-
* Maximum leverage supported by MYX (most markets)
|
|
225
|
-
*/
|
|
226
|
-
export const MYX_MAX_LEVERAGE = 100;
|
|
227
|
-
/**
|
|
228
|
-
* Minimum order size in USD
|
|
229
|
-
*/
|
|
230
|
-
export const MYX_MINIMUM_ORDER_SIZE_USD = 10;
|
|
231
|
-
/**
|
|
232
|
-
* MYX fee rates (placeholder — will be replaced with per-market rates)
|
|
233
|
-
*/
|
|
234
|
-
export const MYX_FEE_RATE = 0.0005; // 0.05% total fee rate
|
|
235
|
-
export const MYX_PROTOCOL_FEE_RATE = 0.0005; // Protocol taker fee
|
|
236
|
-
/**
|
|
237
|
-
* USDT execution fee token address per network (used for order execution fees)
|
|
238
|
-
*/
|
|
239
|
-
export const MYX_EXECUTION_FEE_TOKEN = {
|
|
240
|
-
testnet: MYX_COLLATERAL_TOKEN_TESTNET,
|
|
241
|
-
mainnet: MYX_COLLATERAL_TOKEN_MAINNET,
|
|
242
|
-
};
|
|
243
|
-
//# sourceMappingURL=myxConfig.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"myxConfig.mjs","sourceRoot":"","sources":["../../src/constants/myxConfig.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,SAAS,EAAE,qBAAqB;AAQzC,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAa,CAAC;AAClD,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAgB,CAAC;AACrD,MAAM,CAAC,MAAM,yBAAyB,GACpC,UAAU,oBAAoB,EAAiB,CAAC;AAClD,MAAM,CAAC,MAAM,yBAAyB,GACpC,UAAU,oBAAoB,EAAiB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,OAAmB;IAC/C,OAAO,OAAO,KAAK,SAAS;QAC1B,CAAC,CAAC,QAAQ,CAAC,oBAAoB,EAAE,EAAE,CAAC;QACpC,CAAC,CAAC,QAAQ,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;AACzC,CAAC;AAED,+EAA+E;AAC/E,gBAAgB;AAChB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAiB;IACzC,OAAO,EAAE;QACP,IAAI,EAAE,yBAAyB;QAC/B,EAAE,EAAE,2BAA2B;KAChC;IACD,OAAO,EAAE;QACP,IAAI,EAAE,2BAA2B;QACjC,EAAE,EAAE,6BAA6B;KAClC;CACF,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAmB;IACpD,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC;AACrC,CAAC;AAED,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC;AA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C,OAAO,CAAC,CAAC;IACX,CAAC;IAED,IAAI,CAAC;QACH,MAAM,EAAE,GAAG,IAAI,SAAS,CAAC,aAAa,CAAC,CAAC;QACxC,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC;YACf,OAAO,CAAC,CAAC;QACX,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,SAAS,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QAC/D,OAAO,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC;AAED,+EAA+E;AAC/E,yBAAyB;AACzB,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,CAAC;AAElD;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC;AAEjC;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAE5C;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAEpC;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,CAAC,uBAAuB;AAC3D,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,CAAC,qBAAqB;AAElE;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA+B;IACjE,OAAO,EAAE,4BAA4B;IACrC,OAAO,EAAE,4BAA4B;CACtC,CAAC","sourcesContent":["/**\n * MYX Protocol Configuration Constants\n *\n * Configuration for market display, price fetching, and trading.\n * Based on MYX SDK patterns.\n */\n\nimport type { CaipChainId } from '@metamask/utils';\nimport { BigNumber } from 'bignumber.js';\n\nimport type {\n MYXNetwork,\n MYXEndpoints,\n MYXAssetConfigs,\n} from '../types/myx-types.js';\n\n// ============================================================================\n// Network Constants\n// ============================================================================\n\n/**\n * MYX Chain IDs\n * Mainnet: BNB Chain (56)\n * Testnet: Linea Sepolia (59141) — primary testnet chain with most active pools.\n * The testnet API also has one pool on Arbitrum Sepolia (421614) but it has no\n * ticker data, so Linea Sepolia is the effective testnet chain.\n */\nexport const MYX_MAINNET_CHAIN_ID = '56' as const;\nexport const MYX_TESTNET_CHAIN_ID = '59141' as const;\nexport const MYX_MAINNET_CAIP_CHAIN_ID =\n `eip155:${MYX_MAINNET_CHAIN_ID}` as CaipChainId;\nexport const MYX_TESTNET_CAIP_CHAIN_ID =\n `eip155:${MYX_TESTNET_CHAIN_ID}` as CaipChainId;\n\n/**\n * Get numeric chain ID for MYX network\n *\n * @param network - The MYX network environment (mainnet or testnet).\n * @returns The numeric chain ID for the specified network.\n */\nexport function getMYXChainId(network: MYXNetwork): number {\n return network === 'testnet'\n ? parseInt(MYX_TESTNET_CHAIN_ID, 10)\n : parseInt(MYX_MAINNET_CHAIN_ID, 10);\n}\n\n// ============================================================================\n// API Endpoints\n// ============================================================================\n\n/**\n * MYX REST and WebSocket endpoints\n */\nexport const MYX_ENDPOINTS: MYXEndpoints = {\n mainnet: {\n http: 'https://api.myx.finance',\n ws: 'wss://oapi.myx.finance/ws',\n },\n testnet: {\n http: 'https://api-test.myx.cash',\n ws: 'wss://oapi-test.myx.cash/ws',\n },\n};\n\n/**\n * Get HTTP endpoint for network\n *\n * @param network - The MYX network environment (mainnet or testnet).\n * @returns The HTTP API endpoint URL for the specified network.\n */\nexport function getMYXHttpEndpoint(network: MYXNetwork): string {\n return MYX_ENDPOINTS[network].http;\n}\n\n// ============================================================================\n// Decimal Constants\n// ============================================================================\n\n/**\n * MYX API returns prices as normal floating-point strings (e.g. \"64854.76\").\n * No decimal scaling is needed for prices from the REST/WS API.\n *\n * Note: The SDK's internal contract layer uses 30 decimals, but the API\n * endpoints (tickers, candles, order history) return human-readable values.\n */\nexport const MYX_PRICE_DECIMALS = 0;\n\n/**\n * MYX uses 18 decimals for position sizes\n */\nexport const MYX_SIZE_DECIMALS = 18;\n\n/**\n * MYX uses 18 decimals for collateral amounts (USDT on BNB)\n */\nexport const MYX_COLLATERAL_DECIMALS = 18;\n\n// ============================================================================\n// Token Addresses\n// ============================================================================\n\n/**\n * Collateral token address — testnet (USDC on Linea Sepolia)\n * From SDK: LINEA_SEPOLIA.USDC\n */\nexport const MYX_COLLATERAL_TOKEN_TESTNET =\n '0xD984fd34f91F92DA0586e1bE82E262fF27DC431b' as const;\n\n/**\n * Collateral token address — mainnet (BUSD on BNB, per pool quoteToken)\n * Note: individual pools may use different quote tokens\n */\nexport const MYX_COLLATERAL_TOKEN_MAINNET =\n '0x8bfc51e1928e91e47c6734983ac018b2fc0adf4e' as const;\n\n/** @deprecated Use MYX_COLLATERAL_TOKEN_TESTNET */\nexport const USDT_BNB_TESTNET = MYX_COLLATERAL_TOKEN_TESTNET;\n/** @deprecated Use MYX_COLLATERAL_TOKEN_MAINNET */\nexport const USDT_BNB_MAINNET = MYX_COLLATERAL_TOKEN_MAINNET;\n\n/**\n * Collateral token configuration by network\n */\nexport const MYX_ASSET_CONFIGS: MYXAssetConfigs = {\n USDT: {\n mainnet: {\n chainId: MYX_MAINNET_CAIP_CHAIN_ID,\n tokenAddress: MYX_COLLATERAL_TOKEN_MAINNET,\n },\n testnet: {\n chainId: MYX_TESTNET_CAIP_CHAIN_ID,\n tokenAddress: MYX_COLLATERAL_TOKEN_TESTNET,\n },\n },\n};\n\n// ============================================================================\n// Decimal Conversion Helpers\n// ============================================================================\n\n/**\n * Convert MYX API price string to standard number.\n *\n * MYX API returns normal floating-point price strings (e.g. \"64854.76\"),\n * NOT 30-decimal scaled integers. This is a simple parseFloat.\n *\n * @param myxPrice - Price string from MYX API (e.g. \"64854.760266796727\")\n * @returns Standard decimal number\n */\nexport function fromMYXPrice(myxPrice: string): number {\n if (!myxPrice || myxPrice === '0') {\n return 0;\n }\n\n const parsed = parseFloat(myxPrice);\n return isNaN(parsed) ? 0 : parsed;\n}\n\n/**\n * Convert standard number to MYX API price string.\n *\n * MYX API uses normal floating-point strings, so this is a simple toString.\n *\n * @param price - Standard decimal number\n * @returns Price string for MYX API\n */\nexport function toMYXPrice(price: number | string): string {\n const parsed = typeof price === 'string' ? parseFloat(price) : price;\n return isNaN(parsed) ? '0' : parsed.toString();\n}\n\n/**\n * Convert MYX SDK size (18 decimals) to standard number\n *\n * @param myxSize - Size string in 18-decimal format from SDK\n * @returns Standard decimal number\n */\nexport function fromMYXSize(myxSize: string): number {\n if (!myxSize || myxSize === '0') {\n return 0;\n }\n\n try {\n const bn = new BigNumber(myxSize);\n if (bn.isNaN()) {\n return 0;\n }\n const divisor = new BigNumber(10).pow(MYX_SIZE_DECIMALS);\n return bn.dividedBy(divisor).toNumber();\n } catch {\n return 0;\n }\n}\n\n/**\n * Convert standard number to MYX SDK size format (18 decimals)\n *\n * @param size - Standard decimal number\n * @returns Size string in 18-decimal format for SDK\n */\nexport function toMYXSize(size: number | string): string {\n try {\n const bn = new BigNumber(size);\n if (bn.isNaN()) {\n return '0';\n }\n const multiplier = new BigNumber(10).pow(MYX_SIZE_DECIMALS);\n return bn.multipliedBy(multiplier).toFixed(0);\n } catch {\n return '0';\n }\n}\n\n/**\n * Convert MYX SDK collateral (18 decimals) to standard number\n *\n * @param myxCollateral - Collateral string in 18-decimal format from SDK\n * @returns Standard decimal number\n */\nexport function fromMYXCollateral(myxCollateral: string): number {\n if (!myxCollateral || myxCollateral === '0') {\n return 0;\n }\n\n try {\n const bn = new BigNumber(myxCollateral);\n if (bn.isNaN()) {\n return 0;\n }\n const divisor = new BigNumber(10).pow(MYX_COLLATERAL_DECIMALS);\n return bn.dividedBy(divisor).toNumber();\n } catch {\n return 0;\n }\n}\n\n// ============================================================================\n// REST API Configuration\n// ============================================================================\n\n/**\n * Price polling interval in milliseconds\n * Using 5 seconds as a fallback for unreliable WebSocket\n */\nexport const MYX_PRICE_POLLING_INTERVAL_MS = 5000;\n\n/**\n * HTTP request timeout in milliseconds\n */\nexport const MYX_HTTP_TIMEOUT_MS = 10000;\n\n/**\n * Maximum retries for failed API requests\n */\nexport const MYX_MAX_RETRIES = 3;\n\n/**\n * Default slippage in basis points for MYX orders (1% — matches SDK default)\n */\nexport const MYX_DEFAULT_SLIPPAGE_BPS = 100;\n\n/**\n * Maximum leverage supported by MYX (most markets)\n */\nexport const MYX_MAX_LEVERAGE = 100;\n\n/**\n * Minimum order size in USD\n */\nexport const MYX_MINIMUM_ORDER_SIZE_USD = 10;\n\n/**\n * MYX fee rates (placeholder — will be replaced with per-market rates)\n */\nexport const MYX_FEE_RATE = 0.0005; // 0.05% total fee rate\nexport const MYX_PROTOCOL_FEE_RATE = 0.0005; // Protocol taker fee\n\n/**\n * USDT execution fee token address per network (used for order execution fees)\n */\nexport const MYX_EXECUTION_FEE_TOKEN: Record<MYXNetwork, string> = {\n testnet: MYX_COLLATERAL_TOKEN_TESTNET,\n mainnet: MYX_COLLATERAL_TOKEN_MAINNET,\n};\n"]}
|
package/dist/types/myx-types.cjs
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* MYX Protocol Type Definitions
|
|
4
|
-
*
|
|
5
|
-
* SDK types re-exported with MYX prefix for consistency.
|
|
6
|
-
* Includes types for market display, positions, orders, and trading.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.MYX_HL_OVERLAPPING_MARKETS = exports.MYXTradeFlowTypeEnum = exports.MYXExecTypeEnum = exports.MYXOrderStatusEnum = exports.MYXOperationEnum = exports.MYXOrderTypeEnum = exports.MYXDirectionEnum = exports.MYXTimeInForce = exports.MYXOrderStatus = exports.MYXTriggerType = exports.MYXOperationType = exports.MYXOrderType = exports.MYXDirection = void 0;
|
|
10
|
-
// SDK enums (re-exported as types since they're const objects in the SDK)
|
|
11
|
-
var sdk_1 = require("@myx-trade/sdk");
|
|
12
|
-
Object.defineProperty(exports, "MYXDirection", { enumerable: true, get: function () { return sdk_1.Direction; } });
|
|
13
|
-
Object.defineProperty(exports, "MYXOrderType", { enumerable: true, get: function () { return sdk_1.OrderType; } });
|
|
14
|
-
Object.defineProperty(exports, "MYXOperationType", { enumerable: true, get: function () { return sdk_1.OperationType; } });
|
|
15
|
-
Object.defineProperty(exports, "MYXTriggerType", { enumerable: true, get: function () { return sdk_1.TriggerType; } });
|
|
16
|
-
Object.defineProperty(exports, "MYXOrderStatus", { enumerable: true, get: function () { return sdk_1.OrderStatus; } });
|
|
17
|
-
Object.defineProperty(exports, "MYXTimeInForce", { enumerable: true, get: function () { return sdk_1.TimeInForce; } });
|
|
18
|
-
// History enums
|
|
19
|
-
var sdk_2 = require("@myx-trade/sdk");
|
|
20
|
-
Object.defineProperty(exports, "MYXDirectionEnum", { enumerable: true, get: function () { return sdk_2.DirectionEnum; } });
|
|
21
|
-
Object.defineProperty(exports, "MYXOrderTypeEnum", { enumerable: true, get: function () { return sdk_2.OrderTypeEnum; } });
|
|
22
|
-
Object.defineProperty(exports, "MYXOperationEnum", { enumerable: true, get: function () { return sdk_2.OperationEnum; } });
|
|
23
|
-
Object.defineProperty(exports, "MYXOrderStatusEnum", { enumerable: true, get: function () { return sdk_2.OrderStatusEnum; } });
|
|
24
|
-
Object.defineProperty(exports, "MYXExecTypeEnum", { enumerable: true, get: function () { return sdk_2.ExecTypeEnum; } });
|
|
25
|
-
Object.defineProperty(exports, "MYXTradeFlowTypeEnum", { enumerable: true, get: function () { return sdk_2.TradeFlowTypeEnum; } });
|
|
26
|
-
// ============================================================================
|
|
27
|
-
// Market Overlap Configuration
|
|
28
|
-
// ============================================================================
|
|
29
|
-
/**
|
|
30
|
-
* Markets that overlap with HyperLiquid
|
|
31
|
-
* These are excluded from MYX display in v1.0 to avoid confusion
|
|
32
|
-
* In Stage 7, we'll implement market collision handling
|
|
33
|
-
*/
|
|
34
|
-
exports.MYX_HL_OVERLAPPING_MARKETS = [
|
|
35
|
-
'BTC',
|
|
36
|
-
'ETH',
|
|
37
|
-
'BNB',
|
|
38
|
-
'PUMP',
|
|
39
|
-
'WLFI',
|
|
40
|
-
];
|
|
41
|
-
//# sourceMappingURL=myx-types.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"myx-types.cjs","sourceRoot":"","sources":["../../src/types/myx-types.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAiCH,0EAA0E;AAC1E,sCAOwB;AANtB,mGAAA,SAAS,OAAgB;AACzB,mGAAA,SAAS,OAAgB;AACzB,uGAAA,aAAa,OAAoB;AACjC,qGAAA,WAAW,OAAkB;AAC7B,qGAAA,WAAW,OAAkB;AAC7B,qGAAA,WAAW,OAAkB;AAG/B,gBAAgB;AAChB,sCAOwB;AANtB,uGAAA,aAAa,OAAoB;AACjC,uGAAA,aAAa,OAAoB;AACjC,uGAAA,aAAa,OAAoB;AACjC,yGAAA,eAAe,OAAsB;AACrC,sGAAA,YAAY,OAAmB;AAC/B,2GAAA,iBAAiB,OAAwB;AAqD3C,+EAA+E;AAC/E,+BAA+B;AAC/B,+EAA+E;AAE/E;;;;GAIG;AACU,QAAA,0BAA0B,GAAG;IACxC,KAAK;IACL,KAAK;IACL,KAAK;IACL,MAAM;IACN,MAAM;CACE,CAAC","sourcesContent":["/**\n * MYX Protocol Type Definitions\n *\n * SDK types re-exported with MYX prefix for consistency.\n * Includes types for market display, positions, orders, and trading.\n */\n\nimport type { CaipChainId } from '@metamask/utils';\n\n// ============================================================================\n// Re-export SDK Types with MYX prefix for consistency\n// ============================================================================\n\nexport type { PoolSymbolAllResponse as MYXPoolSymbol } from '@myx-trade/sdk';\nexport type { TickerDataItem as MYXTicker } from '@myx-trade/sdk';\n\n// Position & order types from SDK\nexport type { PositionType as MYXPositionType } from '@myx-trade/sdk';\nexport type { HistoryOrderItem as MYXHistoryOrderItem } from '@myx-trade/sdk';\nexport type { PositionHistoryItem as MYXPositionHistoryItem } from '@myx-trade/sdk';\nexport type { TradeFlowItem as MYXTradeFlowItem } from '@myx-trade/sdk';\nexport type { KlineDataItemType as MYXKlineData } from '@myx-trade/sdk';\n// KlineData is declared but not exported by @myx-trade/sdk — define locally.\n// Property names match the SDK's wire format (single-char keys).\nexport type MYXKlineWsData = {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n E: number; // Timestamp\n // eslint-disable-next-line @typescript-eslint/naming-convention\n T: string; // Turnover\n c: string; // Close price\n h: string; // High price\n l: string; // Low price\n o: string; // Open price\n t: number; // Timestamp\n v: string; // Volume\n};\nexport type { KlineDataResponse as MYXKlineDataResponse } from '@myx-trade/sdk';\n\n// SDK enums (re-exported as types since they're const objects in the SDK)\nexport {\n Direction as MYXDirection,\n OrderType as MYXOrderType,\n OperationType as MYXOperationType,\n TriggerType as MYXTriggerType,\n OrderStatus as MYXOrderStatus,\n TimeInForce as MYXTimeInForce,\n} from '@myx-trade/sdk';\n\n// History enums\nexport {\n DirectionEnum as MYXDirectionEnum,\n OrderTypeEnum as MYXOrderTypeEnum,\n OperationEnum as MYXOperationEnum,\n OrderStatusEnum as MYXOrderStatusEnum,\n ExecTypeEnum as MYXExecTypeEnum,\n TradeFlowTypeEnum as MYXTradeFlowTypeEnum,\n} from '@myx-trade/sdk';\n\n// Trading params types\nexport type { PlaceOrderParams as MYXPlaceOrderParams } from '@myx-trade/sdk';\nexport type { PositionTpSlOrderParams as MYXPositionTpSlOrderParams } from '@myx-trade/sdk';\nexport type { GetHistoryOrdersParams as MYXGetHistoryOrdersParams } from '@myx-trade/sdk';\n\n// ============================================================================\n// Network Configuration Types\n// ============================================================================\n\n/**\n * MYX Network type - mainnet or testnet\n */\nexport type MYXNetwork = 'mainnet' | 'testnet';\n\n/**\n * MYX Endpoint configuration for a single network\n */\nexport type MYXEndpointConfig = {\n http: string;\n ws: string;\n};\n\n/**\n * MYX Endpoints for all networks\n */\nexport type MYXEndpoints = {\n mainnet: MYXEndpointConfig;\n testnet: MYXEndpointConfig;\n};\n\n/**\n * MYX Asset network configuration (token addresses per network)\n */\nexport type MYXAssetNetworkConfig = {\n chainId: CaipChainId;\n tokenAddress: string;\n};\n\n/**\n * MYX Asset configurations by network\n */\nexport type MYXAssetConfigs = {\n // USDT is the token symbol used as API key - not a variable name\n // eslint-disable-next-line @typescript-eslint/naming-convention\n USDT: {\n mainnet: MYXAssetNetworkConfig;\n testnet: MYXAssetNetworkConfig;\n };\n};\n\n// ============================================================================\n// Market Overlap Configuration\n// ============================================================================\n\n/**\n * Markets that overlap with HyperLiquid\n * These are excluded from MYX display in v1.0 to avoid confusion\n * In Stage 7, we'll implement market collision handling\n */\nexport const MYX_HL_OVERLAPPING_MARKETS = [\n 'BTC',\n 'ETH',\n 'BNB',\n 'PUMP',\n 'WLFI',\n] as const;\n\nexport type MYXOverlappingMarket = (typeof MYX_HL_OVERLAPPING_MARKETS)[number];\n\n// ============================================================================\n// Auth Configuration (passed from init file via babel-transformed env vars)\n// ============================================================================\n\n/**\n * MYX auth credentials passed at construction time.\n * Eliminates runtime `process.env` lookups — values come from the init file\n * where `process.env.X` is babel-transformed at build time.\n */\nexport type MYXAuthConfig = {\n appId: string;\n apiSecret: string;\n brokerAddress: string;\n};\n\n// ============================================================================\n// Client Service Types\n// ============================================================================\n\n/**\n * Price callback for REST polling\n */\nexport type MYXPriceCallback = (\n tickers: { symbol: string; price: string; change24h: number }[],\n) => void;\n\n/**\n * Error callback for client operations\n */\nexport type MYXErrorCallback = (error: Error) => void;\n"]}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MYX Protocol Type Definitions
|
|
3
|
-
*
|
|
4
|
-
* SDK types re-exported with MYX prefix for consistency.
|
|
5
|
-
* Includes types for market display, positions, orders, and trading.
|
|
6
|
-
*/
|
|
7
|
-
import type { CaipChainId } from "@metamask/utils";
|
|
8
|
-
export type { PoolSymbolAllResponse as MYXPoolSymbol } from "@myx-trade/sdk";
|
|
9
|
-
export type { TickerDataItem as MYXTicker } from "@myx-trade/sdk";
|
|
10
|
-
export type { PositionType as MYXPositionType } from "@myx-trade/sdk";
|
|
11
|
-
export type { HistoryOrderItem as MYXHistoryOrderItem } from "@myx-trade/sdk";
|
|
12
|
-
export type { PositionHistoryItem as MYXPositionHistoryItem } from "@myx-trade/sdk";
|
|
13
|
-
export type { TradeFlowItem as MYXTradeFlowItem } from "@myx-trade/sdk";
|
|
14
|
-
export type { KlineDataItemType as MYXKlineData } from "@myx-trade/sdk";
|
|
15
|
-
export type MYXKlineWsData = {
|
|
16
|
-
E: number;
|
|
17
|
-
T: string;
|
|
18
|
-
c: string;
|
|
19
|
-
h: string;
|
|
20
|
-
l: string;
|
|
21
|
-
o: string;
|
|
22
|
-
t: number;
|
|
23
|
-
v: string;
|
|
24
|
-
};
|
|
25
|
-
export type { KlineDataResponse as MYXKlineDataResponse } from "@myx-trade/sdk";
|
|
26
|
-
export { Direction as MYXDirection, OrderType as MYXOrderType, OperationType as MYXOperationType, TriggerType as MYXTriggerType, OrderStatus as MYXOrderStatus, TimeInForce as MYXTimeInForce, } from "@myx-trade/sdk";
|
|
27
|
-
export { DirectionEnum as MYXDirectionEnum, OrderTypeEnum as MYXOrderTypeEnum, OperationEnum as MYXOperationEnum, OrderStatusEnum as MYXOrderStatusEnum, ExecTypeEnum as MYXExecTypeEnum, TradeFlowTypeEnum as MYXTradeFlowTypeEnum, } from "@myx-trade/sdk";
|
|
28
|
-
export type { PlaceOrderParams as MYXPlaceOrderParams } from "@myx-trade/sdk";
|
|
29
|
-
export type { PositionTpSlOrderParams as MYXPositionTpSlOrderParams } from "@myx-trade/sdk";
|
|
30
|
-
export type { GetHistoryOrdersParams as MYXGetHistoryOrdersParams } from "@myx-trade/sdk";
|
|
31
|
-
/**
|
|
32
|
-
* MYX Network type - mainnet or testnet
|
|
33
|
-
*/
|
|
34
|
-
export type MYXNetwork = 'mainnet' | 'testnet';
|
|
35
|
-
/**
|
|
36
|
-
* MYX Endpoint configuration for a single network
|
|
37
|
-
*/
|
|
38
|
-
export type MYXEndpointConfig = {
|
|
39
|
-
http: string;
|
|
40
|
-
ws: string;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* MYX Endpoints for all networks
|
|
44
|
-
*/
|
|
45
|
-
export type MYXEndpoints = {
|
|
46
|
-
mainnet: MYXEndpointConfig;
|
|
47
|
-
testnet: MYXEndpointConfig;
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* MYX Asset network configuration (token addresses per network)
|
|
51
|
-
*/
|
|
52
|
-
export type MYXAssetNetworkConfig = {
|
|
53
|
-
chainId: CaipChainId;
|
|
54
|
-
tokenAddress: string;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* MYX Asset configurations by network
|
|
58
|
-
*/
|
|
59
|
-
export type MYXAssetConfigs = {
|
|
60
|
-
USDT: {
|
|
61
|
-
mainnet: MYXAssetNetworkConfig;
|
|
62
|
-
testnet: MYXAssetNetworkConfig;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Markets that overlap with HyperLiquid
|
|
67
|
-
* These are excluded from MYX display in v1.0 to avoid confusion
|
|
68
|
-
* In Stage 7, we'll implement market collision handling
|
|
69
|
-
*/
|
|
70
|
-
export declare const MYX_HL_OVERLAPPING_MARKETS: readonly ["BTC", "ETH", "BNB", "PUMP", "WLFI"];
|
|
71
|
-
export type MYXOverlappingMarket = (typeof MYX_HL_OVERLAPPING_MARKETS)[number];
|
|
72
|
-
/**
|
|
73
|
-
* MYX auth credentials passed at construction time.
|
|
74
|
-
* Eliminates runtime `process.env` lookups — values come from the init file
|
|
75
|
-
* where `process.env.X` is babel-transformed at build time.
|
|
76
|
-
*/
|
|
77
|
-
export type MYXAuthConfig = {
|
|
78
|
-
appId: string;
|
|
79
|
-
apiSecret: string;
|
|
80
|
-
brokerAddress: string;
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* Price callback for REST polling
|
|
84
|
-
*/
|
|
85
|
-
export type MYXPriceCallback = (tickers: {
|
|
86
|
-
symbol: string;
|
|
87
|
-
price: string;
|
|
88
|
-
change24h: number;
|
|
89
|
-
}[]) => void;
|
|
90
|
-
/**
|
|
91
|
-
* Error callback for client operations
|
|
92
|
-
*/
|
|
93
|
-
export type MYXErrorCallback = (error: Error) => void;
|
|
94
|
-
//# sourceMappingURL=myx-types.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"myx-types.d.cts","sourceRoot":"","sources":["../../src/types/myx-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB;AAMnD,YAAY,EAAE,qBAAqB,IAAI,aAAa,EAAE,uBAAuB;AAC7E,YAAY,EAAE,cAAc,IAAI,SAAS,EAAE,uBAAuB;AAGlE,YAAY,EAAE,YAAY,IAAI,eAAe,EAAE,uBAAuB;AACtE,YAAY,EAAE,gBAAgB,IAAI,mBAAmB,EAAE,uBAAuB;AAC9E,YAAY,EAAE,mBAAmB,IAAI,sBAAsB,EAAE,uBAAuB;AACpF,YAAY,EAAE,aAAa,IAAI,gBAAgB,EAAE,uBAAuB;AACxE,YAAY,EAAE,iBAAiB,IAAI,YAAY,EAAE,uBAAuB;AAGxE,MAAM,MAAM,cAAc,GAAG;IAE3B,CAAC,EAAE,MAAM,CAAC;IAEV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AACF,YAAY,EAAE,iBAAiB,IAAI,oBAAoB,EAAE,uBAAuB;AAGhF,OAAO,EACL,SAAS,IAAI,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;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAMF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EAAE,KAC5D,IAAI,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MYX Protocol Type Definitions
|
|
3
|
-
*
|
|
4
|
-
* SDK types re-exported with MYX prefix for consistency.
|
|
5
|
-
* Includes types for market display, positions, orders, and trading.
|
|
6
|
-
*/
|
|
7
|
-
import type { CaipChainId } from "@metamask/utils";
|
|
8
|
-
export type { PoolSymbolAllResponse as MYXPoolSymbol } from "@myx-trade/sdk";
|
|
9
|
-
export type { TickerDataItem as MYXTicker } from "@myx-trade/sdk";
|
|
10
|
-
export type { PositionType as MYXPositionType } from "@myx-trade/sdk";
|
|
11
|
-
export type { HistoryOrderItem as MYXHistoryOrderItem } from "@myx-trade/sdk";
|
|
12
|
-
export type { PositionHistoryItem as MYXPositionHistoryItem } from "@myx-trade/sdk";
|
|
13
|
-
export type { TradeFlowItem as MYXTradeFlowItem } from "@myx-trade/sdk";
|
|
14
|
-
export type { KlineDataItemType as MYXKlineData } from "@myx-trade/sdk";
|
|
15
|
-
export type MYXKlineWsData = {
|
|
16
|
-
E: number;
|
|
17
|
-
T: string;
|
|
18
|
-
c: string;
|
|
19
|
-
h: string;
|
|
20
|
-
l: string;
|
|
21
|
-
o: string;
|
|
22
|
-
t: number;
|
|
23
|
-
v: string;
|
|
24
|
-
};
|
|
25
|
-
export type { KlineDataResponse as MYXKlineDataResponse } from "@myx-trade/sdk";
|
|
26
|
-
export { Direction as MYXDirection, OrderType as MYXOrderType, OperationType as MYXOperationType, TriggerType as MYXTriggerType, OrderStatus as MYXOrderStatus, TimeInForce as MYXTimeInForce, } from "@myx-trade/sdk";
|
|
27
|
-
export { DirectionEnum as MYXDirectionEnum, OrderTypeEnum as MYXOrderTypeEnum, OperationEnum as MYXOperationEnum, OrderStatusEnum as MYXOrderStatusEnum, ExecTypeEnum as MYXExecTypeEnum, TradeFlowTypeEnum as MYXTradeFlowTypeEnum, } from "@myx-trade/sdk";
|
|
28
|
-
export type { PlaceOrderParams as MYXPlaceOrderParams } from "@myx-trade/sdk";
|
|
29
|
-
export type { PositionTpSlOrderParams as MYXPositionTpSlOrderParams } from "@myx-trade/sdk";
|
|
30
|
-
export type { GetHistoryOrdersParams as MYXGetHistoryOrdersParams } from "@myx-trade/sdk";
|
|
31
|
-
/**
|
|
32
|
-
* MYX Network type - mainnet or testnet
|
|
33
|
-
*/
|
|
34
|
-
export type MYXNetwork = 'mainnet' | 'testnet';
|
|
35
|
-
/**
|
|
36
|
-
* MYX Endpoint configuration for a single network
|
|
37
|
-
*/
|
|
38
|
-
export type MYXEndpointConfig = {
|
|
39
|
-
http: string;
|
|
40
|
-
ws: string;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* MYX Endpoints for all networks
|
|
44
|
-
*/
|
|
45
|
-
export type MYXEndpoints = {
|
|
46
|
-
mainnet: MYXEndpointConfig;
|
|
47
|
-
testnet: MYXEndpointConfig;
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* MYX Asset network configuration (token addresses per network)
|
|
51
|
-
*/
|
|
52
|
-
export type MYXAssetNetworkConfig = {
|
|
53
|
-
chainId: CaipChainId;
|
|
54
|
-
tokenAddress: string;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* MYX Asset configurations by network
|
|
58
|
-
*/
|
|
59
|
-
export type MYXAssetConfigs = {
|
|
60
|
-
USDT: {
|
|
61
|
-
mainnet: MYXAssetNetworkConfig;
|
|
62
|
-
testnet: MYXAssetNetworkConfig;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Markets that overlap with HyperLiquid
|
|
67
|
-
* These are excluded from MYX display in v1.0 to avoid confusion
|
|
68
|
-
* In Stage 7, we'll implement market collision handling
|
|
69
|
-
*/
|
|
70
|
-
export declare const MYX_HL_OVERLAPPING_MARKETS: readonly ["BTC", "ETH", "BNB", "PUMP", "WLFI"];
|
|
71
|
-
export type MYXOverlappingMarket = (typeof MYX_HL_OVERLAPPING_MARKETS)[number];
|
|
72
|
-
/**
|
|
73
|
-
* MYX auth credentials passed at construction time.
|
|
74
|
-
* Eliminates runtime `process.env` lookups — values come from the init file
|
|
75
|
-
* where `process.env.X` is babel-transformed at build time.
|
|
76
|
-
*/
|
|
77
|
-
export type MYXAuthConfig = {
|
|
78
|
-
appId: string;
|
|
79
|
-
apiSecret: string;
|
|
80
|
-
brokerAddress: string;
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* Price callback for REST polling
|
|
84
|
-
*/
|
|
85
|
-
export type MYXPriceCallback = (tickers: {
|
|
86
|
-
symbol: string;
|
|
87
|
-
price: string;
|
|
88
|
-
change24h: number;
|
|
89
|
-
}[]) => void;
|
|
90
|
-
/**
|
|
91
|
-
* Error callback for client operations
|
|
92
|
-
*/
|
|
93
|
-
export type MYXErrorCallback = (error: Error) => void;
|
|
94
|
-
//# sourceMappingURL=myx-types.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"myx-types.d.mts","sourceRoot":"","sources":["../../src/types/myx-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,wBAAwB;AAMnD,YAAY,EAAE,qBAAqB,IAAI,aAAa,EAAE,uBAAuB;AAC7E,YAAY,EAAE,cAAc,IAAI,SAAS,EAAE,uBAAuB;AA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BAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,WAAW,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAG5B,IAAI,EAAE;QACJ,OAAO,EAAE,qBAAqB,CAAC;QAC/B,OAAO,EAAE,qBAAqB,CAAC;KAChC,CAAC;CACH,CAAC;AAMF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,gDAM7B,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAM/E;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAMF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EAAE,KAC5D,IAAI,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC"}
|
package/dist/types/myx-types.mjs
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MYX Protocol Type Definitions
|
|
3
|
-
*
|
|
4
|
-
* SDK types re-exported with MYX prefix for consistency.
|
|
5
|
-
* Includes types for market display, positions, orders, and trading.
|
|
6
|
-
*/
|
|
7
|
-
// SDK enums (re-exported as types since they're const objects in the SDK)
|
|
8
|
-
export { Direction as MYXDirection, OrderType as MYXOrderType, OperationType as MYXOperationType, TriggerType as MYXTriggerType, OrderStatus as MYXOrderStatus, TimeInForce as MYXTimeInForce } from "@myx-trade/sdk";
|
|
9
|
-
// History enums
|
|
10
|
-
export { DirectionEnum as MYXDirectionEnum, OrderTypeEnum as MYXOrderTypeEnum, OperationEnum as MYXOperationEnum, OrderStatusEnum as MYXOrderStatusEnum, ExecTypeEnum as MYXExecTypeEnum, TradeFlowTypeEnum as MYXTradeFlowTypeEnum } from "@myx-trade/sdk";
|
|
11
|
-
// ============================================================================
|
|
12
|
-
// Market Overlap Configuration
|
|
13
|
-
// ============================================================================
|
|
14
|
-
/**
|
|
15
|
-
* Markets that overlap with HyperLiquid
|
|
16
|
-
* These are excluded from MYX display in v1.0 to avoid confusion
|
|
17
|
-
* In Stage 7, we'll implement market collision handling
|
|
18
|
-
*/
|
|
19
|
-
export const MYX_HL_OVERLAPPING_MARKETS = [
|
|
20
|
-
'BTC',
|
|
21
|
-
'ETH',
|
|
22
|
-
'BNB',
|
|
23
|
-
'PUMP',
|
|
24
|
-
'WLFI',
|
|
25
|
-
];
|
|
26
|
-
//# sourceMappingURL=myx-types.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"myx-types.mjs","sourceRoot":"","sources":["../../src/types/myx-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiCH,0EAA0E;AAC1E,OAAO,EACL,SAAS,IAAI,YAAY,EACzB,SAAS,IAAI,YAAY,EACzB,aAAa,IAAI,gBAAgB,EACjC,WAAW,IAAI,cAAc,EAC7B,WAAW,IAAI,cAAc,EAC7B,WAAW,IAAI,cAAc,EAC9B,uBAAuB;AAExB,gBAAgB;AAChB,OAAO,EACL,aAAa,IAAI,gBAAgB,EACjC,aAAa,IAAI,gBAAgB,EACjC,aAAa,IAAI,gBAAgB,EACjC,eAAe,IAAI,kBAAkB,EACrC,YAAY,IAAI,eAAe,EAC/B,iBAAiB,IAAI,oBAAoB,EAC1C,uBAAuB;AAoDxB,+EAA+E;AAC/E,+BAA+B;AAC/B,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,KAAK;IACL,KAAK;IACL,KAAK;IACL,MAAM;IACN,MAAM;CACE,CAAC","sourcesContent":["/**\n * MYX Protocol Type Definitions\n *\n * SDK types re-exported with MYX prefix for consistency.\n * Includes types for market display, positions, orders, and trading.\n */\n\nimport type { CaipChainId } from '@metamask/utils';\n\n// ============================================================================\n// Re-export SDK Types with MYX prefix for consistency\n// ============================================================================\n\nexport type { PoolSymbolAllResponse as MYXPoolSymbol } from '@myx-trade/sdk';\nexport type { TickerDataItem as MYXTicker } from '@myx-trade/sdk';\n\n// Position & order types from SDK\nexport type { PositionType as MYXPositionType } from '@myx-trade/sdk';\nexport type { HistoryOrderItem as MYXHistoryOrderItem } from '@myx-trade/sdk';\nexport type { PositionHistoryItem as MYXPositionHistoryItem } from '@myx-trade/sdk';\nexport type { TradeFlowItem as MYXTradeFlowItem } from '@myx-trade/sdk';\nexport type { KlineDataItemType as MYXKlineData } from '@myx-trade/sdk';\n// KlineData is declared but not exported by @myx-trade/sdk — define locally.\n// Property names match the SDK's wire format (single-char keys).\nexport type MYXKlineWsData = {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n E: number; // Timestamp\n // eslint-disable-next-line @typescript-eslint/naming-convention\n T: string; // Turnover\n c: string; // Close price\n h: string; // High price\n l: string; // Low price\n o: string; // Open price\n t: number; // Timestamp\n v: string; // Volume\n};\nexport type { KlineDataResponse as MYXKlineDataResponse } from '@myx-trade/sdk';\n\n// SDK enums (re-exported as types since they're const objects in the SDK)\nexport {\n Direction as MYXDirection,\n OrderType as MYXOrderType,\n OperationType as MYXOperationType,\n TriggerType as MYXTriggerType,\n OrderStatus as MYXOrderStatus,\n TimeInForce as MYXTimeInForce,\n} from '@myx-trade/sdk';\n\n// History enums\nexport {\n DirectionEnum as MYXDirectionEnum,\n OrderTypeEnum as MYXOrderTypeEnum,\n OperationEnum as MYXOperationEnum,\n OrderStatusEnum as MYXOrderStatusEnum,\n ExecTypeEnum as MYXExecTypeEnum,\n TradeFlowTypeEnum as MYXTradeFlowTypeEnum,\n} from '@myx-trade/sdk';\n\n// Trading params types\nexport type { PlaceOrderParams as MYXPlaceOrderParams } from '@myx-trade/sdk';\nexport type { PositionTpSlOrderParams as MYXPositionTpSlOrderParams } from '@myx-trade/sdk';\nexport type { GetHistoryOrdersParams as MYXGetHistoryOrdersParams } from '@myx-trade/sdk';\n\n// ============================================================================\n// Network Configuration Types\n// ============================================================================\n\n/**\n * MYX Network type - mainnet or testnet\n */\nexport type MYXNetwork = 'mainnet' | 'testnet';\n\n/**\n * MYX Endpoint configuration for a single network\n */\nexport type MYXEndpointConfig = {\n http: string;\n ws: string;\n};\n\n/**\n * MYX Endpoints for all networks\n */\nexport type MYXEndpoints = {\n mainnet: MYXEndpointConfig;\n testnet: MYXEndpointConfig;\n};\n\n/**\n * MYX Asset network configuration (token addresses per network)\n */\nexport type MYXAssetNetworkConfig = {\n chainId: CaipChainId;\n tokenAddress: string;\n};\n\n/**\n * MYX Asset configurations by network\n */\nexport type MYXAssetConfigs = {\n // USDT is the token symbol used as API key - not a variable name\n // eslint-disable-next-line @typescript-eslint/naming-convention\n USDT: {\n mainnet: MYXAssetNetworkConfig;\n testnet: MYXAssetNetworkConfig;\n };\n};\n\n// ============================================================================\n// Market Overlap Configuration\n// ============================================================================\n\n/**\n * Markets that overlap with HyperLiquid\n * These are excluded from MYX display in v1.0 to avoid confusion\n * In Stage 7, we'll implement market collision handling\n */\nexport const MYX_HL_OVERLAPPING_MARKETS = [\n 'BTC',\n 'ETH',\n 'BNB',\n 'PUMP',\n 'WLFI',\n] as const;\n\nexport type MYXOverlappingMarket = (typeof MYX_HL_OVERLAPPING_MARKETS)[number];\n\n// ============================================================================\n// Auth Configuration (passed from init file via babel-transformed env vars)\n// ============================================================================\n\n/**\n * MYX auth credentials passed at construction time.\n * Eliminates runtime `process.env` lookups — values come from the init file\n * where `process.env.X` is babel-transformed at build time.\n */\nexport type MYXAuthConfig = {\n appId: string;\n apiSecret: string;\n brokerAddress: string;\n};\n\n// ============================================================================\n// Client Service Types\n// ============================================================================\n\n/**\n * Price callback for REST polling\n */\nexport type MYXPriceCallback = (\n tickers: { symbol: string; price: string; change24h: number }[],\n) => void;\n\n/**\n * Error callback for client operations\n */\nexport type MYXErrorCallback = (error: Error) => void;\n"]}
|