Appearance
Platform REST API — Wallets
Create and import wallets, read balances, and transfer funds.
See Platform REST API for authentication and the response envelope.
Register
POST /api/wallet/register
Store an existing wallet against a user. Unauthenticated — this is where a password is first set.
| Input | Type |
|---|---|
user_id | string |
user_pwd | string |
address | string |
priv_key | string |
Returns { success, data: { address } }.
Existing users must prove ownership
If the user_id already exists, the caller must supply that user's existing password. That stops anyone attaching a wallet to someone else's account.
POST /api/wallet/register_random
Generate a wallet and store it. Also unauthenticated, for the same reason.
Input { user_id, user_pwd }. Returns { success, result: { user_id, pub_key, created_at, updated_at } }.
Create and import
GET /api/wallet/create?user_id=
A random wallet, not stored. User-level auth.
Returns { address, privateKey, mnemonic }.
POST /api/wallet/from-mnemonic
Derive a wallet from a mnemonic. User-level auth.
Input { user_id, user_pwd, mnemonic } → { address, privateKey }. An invalid phrase returns 400.
POST /api/wallet/from-private-key
Derive the address from a key. User-level auth.
Input { user_id, user_pwd, privateKey } → { address }.
Balances
GET /api/wallet/balance/:address?user_id=
Native balance. User-level auth.
json
{ "success": true,
"data": { "address": "0x…", "balance": "1000000000000000000", "balanceEth": "1.0" } }balance is in aknyx; balanceEth is in KNYX. See KNYX and denominations.
GET /api/wallet/tokens?address=
All token balances for one of your wallets. Wallet-level auth.
Returns { tokens: [...] }.
Transfers
POST /api/wallet/send
POST /api/wallet/withdraw
Move funds out. Wallet-level auth on address_from — this spends funds.
| Input | Meaning |
|---|---|
address_from | Source wallet; must be authenticated |
user_pwd | Its password |
token | Token address, or native |
amount | Amount to send |
address_to | Recipient |
Returns { hash } — the transaction hash, which you can follow in the explorer.