Authentication
Approve PermitSingle budget
Changed onSet a timed allowance budget for an operator (e.g. OperatorHub). The account grants the operator a notional USD spending budget, enabling the backend to execute orders on the account's behalf without per-order signatures. Required for TPSL (Take Profit / Stop Loss) orders.
Prerequisites:
- GET /v1/system/config — get operator_hub address (the operator to approve)
- GET /v1/auth/eip712-domain — get EIP-712 domain for signing
- GET /v1/nonce-state/{account} — get nonce_anchor and current_bitmap_index
Account signs PermitSingle (EIP-712):
PermitSingle(address account,address operator,uint96 budget,uint32 allowanceExpiry,uint48 nonceAnchor,uint8 nonceBitmap)
Struct hash: keccak256(abi.encode(PERMIT_SINGLE, account, operator, budget, allowanceExpiry, nonceAnchor, nonceBitmap))
The type string is hashed literally, so it must be copied verbatim — a single added space yields a different typehash and the signature will not recover.
Uses the EIP-712 domain from GET /v1/auth/eip712-domain.
Constraints:
- budget must be > 0 (notional USD in WAD, 18 decimals, uint96)
- allowanceExpiry must be in the future (unix timestamp in seconds)
- Cannot overwrite an active (non-expired) allowance — call lockdownAllowance(operator) on the Authorization contract first, or wait for expiry
- All submitted fields must exactly match the signed EIP-712 values
Budget management:
- Each executed order consumes size × price (notional) from the budget
- Query remaining budget: call getAllowance(account, operator) on the Authorization contract
- Emergency revoke: call lockdownAllowance(operator) directly on the Authorization contract (msg.sender = account)
post/v1/auth/approve-single
Request
- Base URLhttps://api.testnet.rise.trade
- Authnone required
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"account": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"operator": "0x1234567890123456789012345678901234567890",
"budget": "1000000000000000000000",
"nonce_anchor": "0",
"signature": "0x1234..."
}Response
A successful response.
Example response
{
"transaction_hash": "0xabcd1234...",
"block_number": "12345678"
}Changes
- info
endpoint added
- info