Skip to content

Commit fe66ec2

Browse files
committed
bump
1 parent 36359b5 commit fe66ec2

File tree

5 files changed

+103
-5
lines changed

5 files changed

+103
-5
lines changed

README.md

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,94 @@ sdk.exchange
264264
.catch(error => {
265265
console.error('Error transferring funds:', error);
266266
});
267+
268+
// Transfer spot tokens to another address
269+
// IMPORTANT: Token format must be "TOKEN_NAME:TOKEN_ADDRESS"
270+
sdk.exchange
271+
.spotTransfer(
272+
'0x1234567890123456789012345678901234567890', // destination address
273+
'PURR:0xeb62eee3685fc4c43992febcd9e75443', // token format: "NAME:ADDRESS"
274+
'1.0' // amount as string
275+
)
276+
.then(transferResult => {
277+
console.log(transferResult);
278+
})
279+
.catch(error => {
280+
console.error('Error transferring spot tokens:', error);
281+
});
282+
```
283+
284+
## 📋 Token Format Requirements
285+
286+
### Spot Token Format
287+
288+
When using `spotTransfer` or other spot token operations, the token parameter must follow the format:
289+
290+
```
291+
"TOKEN_NAME:TOKEN_ADDRESS"
292+
```
293+
294+
**Examples:**
295+
296+
- `"PURR:0xeb62eee3685fc4c43992febcd9e75443"` - PURR token
297+
- `"USDC:0xaf88d065e77c8cc2239327c5edb3a432268e5831"` - USDC token
298+
299+
**How to get token addresses:**
300+
301+
1. Use the `sdk.info.spot.getSpotMeta()` method to get all available spot tokens
302+
2. Each token object contains the `tokenId` field which is the address to use
303+
3. Format: `"${token.name}:${token.tokenId}"`
304+
305+
**Common mistakes:**
306+
307+
-`"PURR-SPOT"` - Incorrect format
308+
-`"PURR"` - Missing address
309+
-`"0xeb62eee3685fc4c43992febcd9e75443"` - Missing token name
310+
-`"PURR:0xeb62eee3685fc4c43992febcd9e75443"` - Correct format
311+
Transfer spot tokens to another address
312+
// IMPORTANT: Token format must be "TOKEN_NAME:TOKEN_ADDRESS"
313+
sdk.exchange
314+
.spotTransfer(
315+
'0x1234567890123456789012345678901234567890', // destination address
316+
'PURR:0xeb62eee3685fc4c43992febcd9e75443', // token format: "NAME:ADDRESS"
317+
'1.0' // amount as string
318+
)
319+
.then(transferResult => {
320+
console.log(transferResult);
321+
})
322+
.catch(error => {
323+
console.error('Error transferring spot tokens:', error);
324+
});
325+
326+
```
327+
328+
## 📋 Token Format Requirements
329+
330+
### Spot Token Format
331+
332+
When using `spotTransfer` or other spot token operations, the token parameter must follow the format:
333+
267334
```
268335

336+
"TOKEN_NAME:TOKEN_ADDRESS"
337+
338+
````
339+
340+
**Examples:**
341+
- `"PURR:0xeb62eee3685fc4c43992febcd9e75443"` - PURR token
342+
- `"USDC:0xaf88d065e77c8cc2239327c5edb3a432268e5831"` - USDC token
343+
344+
**How to get token addresses:**
345+
1. Use the `sdk.info.spot.getSpotMeta()` method to get all available spot tokens
346+
2. Each token object contains the `tokenId` field which is the address to use
347+
3. Format: `"${token.name}:${token.tokenId}"`
348+
349+
**Common mistakes:**
350+
- ❌ `"PURR-SPOT"` - Incorrect format
351+
- ❌ `"PURR"` - Missing address
352+
- ❌ `"0xeb62eee3685fc4c43992febcd9e75443"` - Missing token name
353+
- ✅ `"PURR:0xeb62eee3685fc4c43992febcd9e75443"` - Correct format
354+
269355
All methods supported can be found here: [Hyperliquid Exchange Endpoint API Documentation](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint)
270356
271357
### General Info Methods
@@ -300,7 +386,7 @@ sdk.info
300386
.catch(error => {
301387
console.error('Error getting L2 book:', error);
302388
});
303-
```
389+
````
304390

305391
All methods supported can be found here: [Hyperliquid Info Endpoint API Documentation](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint)
306392

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
- Added support for perpDexLimits and noop operations
44
- Add support for new userFills response fields
55

6+
## Bug Fixes
7+
- Fixed Websocket connection issues
8+
69

710

811
# Version 1.7.6

examples/info_api_testing.cjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,16 @@ async function testPerpetualsInfoAPI(sdk) {
224224

225225
console.log("getPerpsAtOpenInterestCap:");
226226
console.log(await sdk.info.perpetuals.getPerpsAtOpenInterestCap(raw_mode));
227-
await waitForInput("Press Enter to continue...")
227+
await waitForInput("Press Enter to continue...");
228+
229+
console.log("getPerpDexLimits:");
230+
try {
231+
// Example with a test dex name - replace with actual dex name
232+
console.log(await sdk.info.perpetuals.getPerpDexLimits("test", raw_mode));
233+
} catch (error) {
234+
console.log("Error (expected if dex doesn't exist):", error.message);
235+
}
236+
await waitForInput("Press Enter to continue...");
228237
}
229238

230239
async function main() {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hyperliquid",
3-
"version": "1.7.6",
3+
"version": "1.7.7",
44
"description": "SDK for Hyperliquid API",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",

0 commit comments

Comments
 (0)