client.APIKeys lists and streams API key metadata and generates local Ed25519 keypairs. Methods
are authenticated and account-scoped.
Methods (API-key SDK)
| Method | Summary |
|---|---|
GenerateKeypair | Local Ed25519 keypair. Never sends the secret. |
List | List non-revoked keys. Needs a session. |
Get | Fetch one key by ak_... id. Needs a session. |
Subscribe | Stream private key updates (Messages()). |
There is no Create / Update / Delete on this SDK. Creating or revoking keys is a
JWT/session product flow (TypeScript / browser).
GenerateKeypair()
pair := client.APIKeys.GenerateKeypair()
// pair.PublicKeyHex / pair.SecretKeyHex, persist secret yourselfList / Get
List and Get need an interactive session token, and this SDK authenticates with an API key
only. The server refuses an API key with AUTH_SESSION_KIND_NOT_ALLOWED, which the SDK returns as *errors.SessionRequiredError. List and inspect keys in the Polyester app or with the TypeScript
SDK on a session.
keys, err := client.APIKeys.List(ctx, nil, nil)
if sdkerrors.IsSessionRequired(err) {
log.Fatal("listing API keys needs a session; use the Polyester app")
}
if err != nil { log.Fatal(err) }
for _, key := range keys.Keys {
fmt.Println(key.KeyID, key.Label, key.Status)
}Subscribe(ctx, accountID)
Requires the API-key administration read permission and an Account ID. The method returns only after the subscription-token request and Centrifugo handshake succeed.
sub, err := client.APIKeys.Subscribe(ctx, client.DefaultAccountID)
if err != nil { log.Fatal(err) }
defer sub.Close()
for key := range sub.Messages() {
fmt.Println(key.KeyID, key.Status)
break
}Create is JWT/session only
Generate a keypair here, then create the key in the Polyester app or TypeScript client.
Related
Related Topics
Address book Saved destinations and whitelist views. Auth Auth service helpers including nested profile access. Balances List ledger balances and history, and subscribe to live updates with the Go BalancesService. Candles Read and stream public spot OHLCV candles via MarketData (Candles alias). Catalog Spot/Zipper catalog hydration via HydrateCatalogs and WaitForCatalogs, plus Manager lookups. Chain helpers On-chain Funding → Trading and Funding withdraw helpers. Chain analytics Chain analytics read APIs. Client configuration Config fields, URLs, catalogs, wire format, and FromEnv behavior. Deposit Create and list per-account chain deposit addresses for funding your Polyester account. Errors Go SDK error types, sentinel ErrPolyester, MFA auth codes, and queue overflow. Fees Read effective spot fee rates, reserve rates, the next scheduled change, and the fee breakdown with the Go FeeService. Guard signer Guard signer approval helpers. Heatmap L2 order book heatmap reads. Internal transfers Move trading balances between Polyester accounts without touching a chain. Lifecycle Deposit/withdraw lifecycle flows and subscribe. Market overview List and subscribe to per-market stats with optional snapshot-then-stream merge. Order book Depth snapshots and a stateful live order book that reconstructs the book for you. Orders Place, modify, cancel, batch, and stream spot orders with the Go OrdersService. Policies Realtime API-key and subaccount-policy updates. Profile Profile identity reads and subscribe helpers. Public trades Public trade tape reads and subscribe via MarketData. Realtime Shared Centrifugo client, Messages() delivery, handshake-before-return, and fail-closed overflow. Social verification Social verification APIs (reference-only). Subaccounts Subaccount reads, members, invites, activity. User trades List and stream your private spot fills (not the public tape). Transfers Transfer history reads. Triggers Create, manage, pause/resume, and stream standalone trigger automations with the Go TriggersService. Withdrawals Trading withdraw intents to funding or external chain destinations (signed payload). Zipper Deposit/withdraw config and related Zipper reads.