Services on this page use the authenticated transport except the auth login endpoints, client.subaccounts.listRoles(), and client.vip.listTiers(), which are public. Methods marked stream return () => void and take onEvent (+ optional onOpen / onClose / onError).
client.auth
Base auth service (all clients):
| Method | Input โ Result | Notes |
|---|---|---|
acceptTerms(options?) | โ void | Record explicit terms consent. Interactive JWT only; no MFA. |
me(options?) | โ Me | Backend-verified caller identity: accountId, public ak_... apiKeyId?, username, session assurance info. |
createWalletChallenge(input, options?) | โ WalletChallenge | Server-generated EIP-4361 login message, single-use, 5-minute expiry. |
profile | โ ProfileService | See below. |
On PolyesterBrowserClient, auth is an AccountSignerAuthService with the managed login
flow on top:
| Member | Signature | Notes |
|---|---|---|
login(options) | { provider: "metamask" | "phantom" | "turnkey" | "other", uri?, loginMethod? } โ LoginResult | Signs the exact SIWE challenge, stores the session. |
restoreSession() | โ { accountId, username } | null | Restores a persisted, environment-bound session. |
refreshSession(params?) | โ LoginResult | Fresh SIWE challenge + signature. |
logout() | โ void | Clears state, disconnects private realtime. |
getState() | โ AuthState | isAuthenticated, addresses, mainAccountId, activeAccount. |
getSessionTimeToExpiry() | โ number | Milliseconds remaining. |
hydrateAuthState(data) | AuthHydrationData โ void | Seed state from SSR before restoreSession. |
switchAccount(accountId) | โ { accountId, isMain } | Changes the active account scope. |
createSubaccount(params) | { accountSigner, label?, uri?, ownerAddress? } โ { subaccountId, smartAccountSaltNonce, revision } | |
setAccountSigner(signer) / getAccountSigner() | Swap or read the signer. | |
events | EventEmitter | authenticated, loggedOut, error, servicesReady, stateChange. |
client.auth.profile
| Method | Input โ Result | Notes |
|---|---|---|
get(options?) | โ Profile | Username eligibility/cooldown, socials, avatar, VIP tier. See VIP for the catalog and root status. |
update(input, options?) | mutable fields โ Profile | Empty string clears an optional text field. |
getUsernameHistory(options?) | โ UsernameHistoryEntry[] | Newest first, โค 20. |
generateUsernameOptions(options?) | โ generated offer | Usernames, short-lived offer token, optional expiry. |
claimGeneratedUsername(input, options?) | offer token + zero-based index โ Profile | Claims one generated username. |
subscribeIdentity(input) | accountId โ stream | Public identity updates. |
client.accounts
| Method | Input โ Result | Notes |
|---|---|---|
resolve(input, options?) | query (username / id / address), includeSubaccounts? โ ResolvedAccount[] | Resolves transfer destinations. |
client.subaccounts
| Method | Input โ Result | Notes |
|---|---|---|
list(options?) | โ { totalCreated, subaccounts } | Owned + shared. |
get(input, options?) | subaccountId โ subaccount + apiKeys, policy, members, invites | Throws if missing. |
createChallenge(input, options?) | ownerAddress, uri โ SubaccountChallenge | Next smart account + authorization message. |
create(input, options?) | address/message/signature proof โ CreateSubaccountResult | Browser apps: prefer auth.createSubaccount. |
update(input, options?) | subaccountId, label/status โ result | |
inviteMember(input, options?) | subaccountId, invitee, role โ SubaccountInvite | |
respondInvite(input, options?) | accept/reject/cancel โ SubaccountInvite | |
listInvites(input, options?) | direction filter โ SubaccountInvite[] | |
listRoles(options?) | โ role and permission catalog | Public. |
getEffectivePermissions(input, options?) | subaccountId โ role, permissions, policy ID | Authenticated caller. |
listMembers(input, options?) | subaccountId โ SubaccountMember[] | Owner + delegates. |
updateMemberRole(input, options?) | โ result | |
setMemberMfaRequirement(input, options?) | โ result | Owner-controlled MFA gate. |
listEvents(input, options?) | subaccountId, pagination โ { events, nextPageToken } | Audit trail, โค 200/page. |
subscribe(input) | accountId โ stream of subaccount updates | |
subscribeApiKeys(input) | accountId โ stream of API key updates |
client.subaccounts.policies
Reusable permission templates for subaccounts.
| Method | Input โ Result |
|---|---|
list(options?) | โ SubaccountPolicy[] |
get(input, options?) | { policyId } โ SubaccountPolicy | null |
create(input, options?) | scopes/actions/limits (+ optional target) โ SubaccountPolicy |
update(input, options?) | { policyId, expectedRevision, ...patch } โ SubaccountPolicy |
delete(policyId, options?) | โ void (only when unused) |
apply(input, options?) | { subaccountId, policyId | null } โ void |
subscribePolicies(input) | accountId โ stream |
client.apiKeys
| Method | Input โ Result | Notes |
|---|---|---|
generateKeypair() | โ { publicKey: { hex, bytes }, secretKey: { hex, bytes } } | Local only; never sends the secret. |
create(payload, options?) | label, publicKeyEd25519 (bytes), ipWhitelist?, icon?, color?, account? โ ApiKey | null | May require stepUpToken. |
list(params?, options?) | โ ApiKey[] | Non-revoked, newest first. |
get(input, options?) | keyId (ak_โฆ) โ ApiKey | null | |
update(payload, options?) | keyId + metadata/status/whitelist/expiry โ ApiKey | null | |
delete(input, options?) | keyId โ void | Permanent revocation. |
subscribe(input) | accountId โ stream of ApiKey |
client.apiKeys.policies mirrors the subaccount policies API (list / get / create / update / delete / apply) for API key policy templates.
client.balances
| Method | Input โ Result | Notes |
|---|---|---|
list(input?, options?) | account? โ LedgerBalance[] | Decimal strings. |
getBalanceHistory(input, options?) | time range + asset/bucket filters โ BalanceHistoryResponse | Columnar. |
getEquityHistory(input, options?) | time range + grouping โ EquityHistoryResponse | Columnar. |
getPortfolioEquityHistory(input, options?) | range โ PortfolioEquityHistoryResponse | Root portfolio. |
getPortfolioEquitySnapshot(options?) | โ PortfolioEquitySnapshotResponse | Root portfolio. |
subscribe(input) | accountId โ stream of LedgerBalance |
client.claims
Daily campaign rewards belong to the authenticated root account. These endpoints require a session JWT; API keys are not accepted.
| Method | Result | Notes |
|---|---|---|
getDailyClaimStatus(options?) | DailyClaimStatus | Read the current UTC day's available or existing claim and reset time. |
claimDailyReward(options?) | ClaimDailyRewardResult | Claim the current UTC day's reward; retries return the same claim. |
const status = await client.claims.getDailyClaimStatus();
if (status.state === "available") {
const claim = await client.claims.claimDailyReward();
console.log(claim.claimId, claim.state, claim.rewards);
}Both results include state, claimId, rewards, optional resetAt, and optional campaign. state is "available", "processing", "claimed", "unavailable", or "unspecified".
Each reward has assetId, assetCode, and an exact decimal-string amount.
The claim result also includes optional claimedAt and transfers, an array of { assetId, transferId }. Timestamps are epoch milliseconds when present. A campaign has campaignId, name, description, and claimPolicy ("utc_daily" or "unspecified").
Read status again to follow a "processing" claim rather than treating it as completed.
client.mfa
| Method | Purpose |
|---|---|
listFactors(options?) | Enrolled factors + whether unused recovery codes exist. |
beginTotpEnrollment / finishTotpEnrollment | TOTP enrollment, recovery codes, and optional elevated session/access token. |
beginPasskeyEnrollment / finishPasskeyEnrollment | Passkey enrollment, recovery codes, and optional elevated session/access token. |
beginChallenge(input, options?) | Start a challenge with purpose: "sessionElevation" | "freshStepUp". |
verifyTotpChallenge / finishPasskeyChallenge / verifyRecoveryCodeChallenge | Complete a challenge โ { stepUpToken?, โฆ }. |
updateFactor / deleteFactor | Relabel / remove a factor. |
regenerateRecoveryCodes(input?, options?) | Rotate recovery codes (step-up required). |
claimFreshStepUp / consumeFreshStepUp / releaseFreshStepUp | Bind, finalize, or release a step-up proof for one protected request. |
See Error handling for the step-up retry pattern.
client.addressBook
| Method | Purpose |
|---|---|
listBooks(options?) | Root/subaccount books visible to the caller. |
listEntries / createEntry / updateEntry / deleteEntry / copyEntry | Saved destination CRUD (+ copy across books). |
createTag / updateTag / deleteTag | Organizational tags. |
listTransferCounterparties(input?, options?) | Recent counterparties incl. unsaved ones. |
listTransferDestinations(input?, options?) | Saved + whitelisted destinations for transfer flows. |
listInternalTransferWhitelistEntries(input?, options?) | Internal-transfer whitelist with resolution status. |
getWithdrawWhitelistView(input?, options?) | Withdrawal whitelist requirements + mirrored entries. |
getView(input?, options?) | Composite view, optionally at minimumViewRevision. |
subscribeViewInvalidations(input) | stream of signals to refetch getView. |
client.vip
VIP policy service. listTiers is public. getStatus is authenticated and always reads the
root account. Full shapes: VIP.
| Method | Input โ Result | Notes |
|---|---|---|
listTiers(options?) | โ VipTierCatalog | Public. VIP0+ thresholds, fee rates, policy version. |
getStatus(options?) | โ VipStatus | Authenticated. Always the caller's root account. |
client.socialVerification
| Method | Purpose |
|---|---|
start(input, options?) | Begin provider verification โ poly_โฆ challenge code (~15 min). |
markReady(input, options?) | Queue the provider check once the code is placed. |
get(input, options?) | Current status, attempts, last error. |
client.guardSigner
Backend guard wallets that co-sign protected account actions.
| Method | Purpose |
|---|---|
createWallet(input?, options?) | Create the guard wallet โ signer EVM address. |
getStatus(input?, options?) | Stored/live status, null if absent. |
signProtectedAction(input, options?) | One approval signature. |
batchSignProtectedActions(input, options?) | Ordered approvals for a batch. |
rotateWallet(input?, options?) | Replacement wallet + rotation approval. |
exportWallet(input?, options?) | Export key material (owner authorization + fresh step-up). |
client.whiteboard
Collaborative whiteboards: create, get, list, update, updateAcl, archive, and mintJoinToken (string shorthand accepted where an id is the only field).