For the complete documentation index, see llms.txt. This page is also available as Markdown.
Quick Start
This guide walks through the full setup: creating an organization, adding a user, granting policies, and creating a wallet — everything you need before executing transactions.
Prerequisites
npminstalltweetnacl
Setup helpers
constnacl=require("tweetnacl");const{randomUUID}=require("crypto");constWAAS_BASE_URL="https://api.hinkal.io";functionbytesToHex(bytes){returnBuffer.from(bytes).toString("hex");}functionnormalizeRoutePath(path){constwithSlash=path.startsWith("/") ?path:`/${path}`;returnwithSlash.length>1?withSlash.replace(/\/+$/,"") :withSlash;}// Must match the server's route pattern exactly, e.g. "POST /waas/create-wallet"functionbuildActionBinding(method,routePath){return`${method.toUpperCase()}${normalizeRoutePath(routePath)}`;}functionbuildXStamp(binding,params,keypair){constcanonical=JSON.stringify([binding,Object.entries(params)]);constsigBytes=nacl.sign.detached(Buffer.from(canonical,"utf8"),keypair.secretKey);conststamp={publicKey:bytesToHex(keypair.publicKey),signature:bytesToHex(sigBytes),};returnBuffer.from(JSON.stringify(stamp)).toString("base64url");}asyncfunctionpost(path,body,keypair){constbodyWithNonce={...body,nonce:randomUUID() };constbinding=buildActionBinding("POST",path);constres=awaitfetch(`${WAAS_BASE_URL}${path}`,{method:"POST",headers:{"Content-Type":"application/json","X-Stamp":buildXStamp(binding,bodyWithNonce,keypair),},body:JSON.stringify(bodyWithNonce),});returnres.json();}
1
Step 1 — Generate keypairs
The root keypair belongs to the organization administrator. The user keypair belongs to the end user.
2
Step 2 — Create an organization
The root keypair signs this request. The signing public key becomes the root user's identifier.
3
Step 3 — Create a user
Root creates a user by registering the user's public key.
4
Step 4 — Grant policies
Policies define what actions a user is allowed to perform. Grant CREATE_WALLET and SIGN_TRANSACTION before the user can create wallets or execute transactions.
5
Step 5 — Create a wallet
The user signs this request with their own keypair. The response contains EVM, Tron, and Solana addresses.
6
Step 6 — Execute a transaction
Once the wallet is set up, execute transactions using the user's keypair.
POST /waas/public-to-public performs a deposit-and-withdraw: it deposits tokens into Hinkal and immediately schedules the withdrawal to the recipient. The response includes both a txHash (the deposit transaction) and a scheduleId for polling the withdrawal status.
7
Step 7 — Poll withdrawal status
Use the scheduleId to track when the withdrawal reaches the recipient on-chain. Poll until status is completed or failed.
For private transactions, use /waas/public-to-private, /waas/private-to-public, or /waas/private-to-private with the same request shape.