@rabby-wallet/hyperliquid-sdk 1.1.7-beta.0 → 1.1.7-beta.1

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.
@@ -175,17 +175,17 @@ export declare class ExchangeClient {
175
175
  * Place a spot order for stablecoin swaps on Hyperliquid.
176
176
  * Used to swap between USDC, USDT, USDH, USDE on the spot market.
177
177
  *
178
- * @param params.coin - The spot asset to trade (e.g., 'USDT', 'USDH')
178
+ * @param params.coin - The spot asset to trade (e.g., 'USDT', 'USDH', 'USDE')
179
179
  * @param params.isBuy - true = buy the coin (sell USDC), false = sell the coin (buy USDC)
180
180
  * @param params.size - Amount to trade
181
181
  * @param params.limitPx - Limit price (use '1' for stablecoin 1:1 swaps)
182
182
  * @param params.tif - Time in force: 'Ioc' for immediate or cancel
183
183
  */
184
- spotOrder(params: {
185
- coin: string;
184
+ stableCoinOrder(params: {
185
+ coin: 'USDT' | 'USDH' | 'USDE';
186
186
  isBuy: boolean;
187
187
  size: string;
188
188
  limitPx: string;
189
189
  tif?: Tif;
190
- }): Promise<any>;
190
+ }): Promise<OrderResponse>;
191
191
  }
@@ -1061,16 +1061,21 @@ class ExchangeClient {
1061
1061
  * Place a spot order for stablecoin swaps on Hyperliquid.
1062
1062
  * Used to swap between USDC, USDT, USDH, USDE on the spot market.
1063
1063
  *
1064
- * @param params.coin - The spot asset to trade (e.g., 'USDT', 'USDH')
1064
+ * @param params.coin - The spot asset to trade (e.g., 'USDT', 'USDH', 'USDE')
1065
1065
  * @param params.isBuy - true = buy the coin (sell USDC), false = sell the coin (buy USDC)
1066
1066
  * @param params.size - Amount to trade
1067
1067
  * @param params.limitPx - Limit price (use '1' for stablecoin 1:1 swaps)
1068
1068
  * @param params.tif - Time in force: 'Ioc' for immediate or cancel
1069
1069
  */
1070
- spotOrder(params) {
1070
+ stableCoinOrder(params) {
1071
1071
  return __awaiter(this, void 0, void 0, function* () {
1072
- const { coin, isBuy, size, limitPx, tif = 'Ioc' } = params;
1073
- const assetIndex = yield this.symbolConversion.getAssetIndex(coin);
1072
+ const { coin, isBuy, size, limitPx, tif = 'FrontendMarket' } = params;
1073
+ const assetIndexMap = {
1074
+ USDT: 10166,
1075
+ USDH: 10230,
1076
+ USDE: 10150,
1077
+ };
1078
+ const assetIndex = assetIndexMap[coin];
1074
1079
  const nonce = Date.now();
1075
1080
  const orderRequest = {
1076
1081
  a: assetIndex,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/hyperliquid-sdk",
3
- "version": "1.1.7-beta.0",
3
+ "version": "1.1.7-beta.1",
4
4
  "description": "Simplified Hyperliquid Perpetuals Trading SDK for Frontend Applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",