SubaccountService
Create Subaccount Challenge
Request the next smart account and an EIP-191 authorization. Requires current terms acceptance.
Request
curl --request POST \ \
--url 'https://api.testnet.polyester.com/v1/auth/subaccounts/challenge' \
--header 'Accept: */*' \
--header 'X-API-KEY-ID: YOUR_API_KEY_ID' \
--header 'X-API-TIMESTAMP: YOUR_API_TIMESTAMP' \
--header 'X-API-SIGNATURE: YOUR_API_SIGNATURE' \
--header 'Content-Type: application/json' \
--data '{
"ownerAddress": "0x5555555555555555555555555555555555555555",
"uri": "https://devnet.polyester.com"
}'Responses
{
"expiresAt": "2026-01-01T00:05:00Z",
"message": "Polyester account authorization\n\nCreate a sub-account controlled by the smart account below.\nThis does not authorize a transaction or a login.\n\naction: create_subaccount\norigin: https://devnet.polyester.com\naudience: devnet\npolyester_chain_id: 888168\nroot_account_id: 123456789\nowner_address: 0x5555555555555555555555555555555555555555\nsmart_account_address: 0x2222222222222222222222222222222222222222\nsalt_nonce: 1\nrequest_id: 8f3a72c91b4de6058f3a72c91b4de6058f3a72c91b4de6058f3a72c91b4de605\nissued_at: 2026-01-01T00:00:00Z\nexpiration: 2026-01-01T00:05:00Z",
"polyesterChainId": "888168",
"smartAccountAddress": "0x2222222222222222222222222222222222222222",
"smartAccountSaltNonce": 1
}Selected EOA bound to the authenticated root account.
Requesting browser origin including scheme and optional port, without path, query, fragment, or user information. Must match the HTTP Origin when present.
Exact UTF-8 EIP-191 personal_sign message. This is an account-control authorization, not an EIP-4361 sign-in message. Sign through the returned smart account; do not hash, alter, or reconstruct the message.
Polyester account authorization
Create a sub-account controlled by the smart account below.
This does not authorize a transaction or a login.
action: create_subaccount
origin: https://devnet.polyester.com
audience: devnet
polyester_chain_id: 888168
root_account_id: 123456789
owner_address: 0x5555555555555555555555555555555555555555
smart_account_address: 0x2222222222222222222222222222222222222222
salt_nonce: 1
request_id: 8f3a72c91b4de6058f3a72c91b4de6058f3a72c91b4de6058f3a72c91b4de605
issued_at: 2026-01-01T00:00:00Z
expiration: 2026-01-01T00:05:00ZCanonical address of the next smart account, derived by the server.
0x2222222222222222222222222222222222222222Canonical derivation salt nonce for the returned smart account.
1Expiration in UTC, five minutes after issuance.
2026-01-01T00:05:00ZPolyester EIP-155 chain ID used for smart-account derivation and verification.
888168| Key | Status | Error | When |
|---|---|---|---|
| unauthenticated | 401 | Unauthenticated | Authentication required. |
| permission-denied | 403 | Permission Denied | Permission denied. |
| invalid-argument | 400 | Invalid Argument | Invalid argument. |
| not-found | 404 | Not Found | Not found. |
| unavailable | 503 | Unavailable | Service unavailable. |