Loading...
Loading...
Use when the user mentions staking SUI, withdrawing, claiming rewards, or operating haSUI on Haedal Protocol (a DeFi/LST protocol on SUI). Trigger phrases: "haedal","stake sui","stake hasui", "withdraw hasui", "withdraw sui","instant withdraw hasui", "instant withdraw sui", "claim hasui rewards","claim sui rewards". This skill calls https://skillsapi.haedal.xyz/api/v1/hasui/* via curl POST. On HTTP 200 returns txBytes (base64); on non‑200 returns msg.
npx skill4agent add haedallsd/haedal-skill haedal-hasuiamount"amount":"20"validatornode_id0x0node_idreferences/validators.mdnode_idaddress{
"list": [
{
"objectId": "0x...",
"type": "0x...::staking::UnstakeTicket",
"version": "...",
"fields": {
"claim_epoch": "646",
"claim_timestamp_ms": "1737135496590",
"id": { "id": "0x..." },
"st_amount": "1000000000",
"sui_amount": "1045887315",
"unstake_timestamp_ms": "1737085604741"
}
}
]
}objectIdst_amountsui_amountclaim_epochclaim_timestamp_msobjectIdPOST /api/v1/hasui/claim{"address":"0x...","NFTObj":"<objectId from previous step>"}objectIdhttps://skillsapi.haedal.xyz/api/v1/hasui| Method | Required fields | Notes |
|---|---|---|
| stake | address, amount, validator | No object field |
| withdraw | address, amount | No object field |
| withdraw_instant | address, amount | No object field |
| claim | address, NFTObj | Requires NFT object ID, see the "Claiming rewards" flow above |
| get_unstake_tickets_list | address | Query the UnstakeTicket list for this address to obtain NFTObj |
validator0x0references/validators.md# Use the default validator
curl -s -w "\n%{http_code}" -X POST "https://skillsapi.haedal.xyz/api/v1/hasui/stake" \
-H "Content-Type: application/json" \
-d '{"address":"0xYOUR_ADDRESS","amount":"100","validator":"0x0"}'
# Or specify an explicit validator node_id (for example Haedal Protocol)
curl -s -w "\n%{http_code}" -X POST "https://skillsapi.haedal.xyz/api/v1/hasui/stake" \
-H "Content-Type: application/json" \
-d '{"address":"0xYOUR_ADDRESS","amount":"100","validator":"0xc8a57a7ae3b814afc15a907d963a288454b2c0f1a323fd556cb2d56d85a94583"}'curl -s -w "\n%{http_code}" -X POST "https://skillsapi.haedal.xyz/api/v1/hasui/withdraw" \
-H "Content-Type: application/json" \
-d '{"address":"0xYOUR_ADDRESS","amount":"100"}'curl -s -w "\n%{http_code}" -X POST "https://skillsapi.haedal.xyz/api/v1/hasui/withdraw_instant" \
-H "Content-Type: application/json" \
-d '{"address":"0xYOUR_ADDRESS","amount":"100"}'curl -s -w "\n%{http_code}" -X POST "https://skillsapi.haedal.xyz/api/v1/hasui/get_unstake_tickets_list" \
-H "Content-Type: application/json" \
-d '{"address":"0xYOUR_ADDRESS"}'{"list":[{"objectId":"...","type":"...","version":"...","fields":{...}}, ...]}objectIdst_amountsui_amountclaim_epochclaim_timestamp_mslist[].objectIdcurl -s -w "\n%{http_code}" -X POST "https://skillsapi.haedal.xyz/api/v1/hasui/claim" \
-H "Content-Type: application/json" \
-d '{"address":"0xYOUR_ADDRESS","NFTObj":"0xOBJECT_ID_FROM_LIST"}'{"txBytes":"<base64>"}jq -r '.txBytes'jq -r '.msg'{"list":[{"objectId","type","version","fields":{...}}, ...]}jq -r '.list'fieldsst_amountsui_amountclaim_epochclaim_timestamp_msunstake_timestamp_msobjectIdMoveAbort(..., <code>)| Code | Constant Name | Description |
|---|---|---|
| 1 | | Data does not match the program |
| 2 | | Staked SUI rewards do not match |
| 3 | | Invalid staking parameters |
| 4 | | Not enough SUI to stake |
| 5 | | No stSUI minted during staking |
| 6 | | Normal unstake ticket is still in locking period |
| 7 | | Not enough SUI to fulfill unstake |
| 8 | | Unstake amount exceeds the max SUI amount |
| 9 | | Instant unstake requires a service fee (fee not set) |
| 10 | | Commented out: not enough staked SUI for unstake |
| 11 | | Unstake stSUI amount must not be zero |
| 12 | | Staking is paused |
| 13 | | Unstaking is paused |
| 14 | | Commented out: reserved for claim |
| 15 | | Commented out: no minimum staking threshold met |
| 16 | | Unstake |
| 17 | | Claiming is paused |
| 18 | | Validator count does not match |
| 19 | | Validator not found |
| 20 | | Injected rewards amount is too low |