client.SubAccounts contains API-key-safe reads and private streams. Mutations and member/invite
administration are JWT/session-only and are not included.
| Method | Purpose |
|---|---|
List | Visible subaccounts |
Get | One subaccount with optional related data |
ListMembers / ListInvites | Membership reads |
ListActivity | Paginated audit activity |
Subscribe | Subaccount state stream |
SubscribeAPIKeys | API-key metadata stream |
subs, err := client.SubAccounts.List(ctx)
if err != nil { log.Fatal(err) }
for _, subaccount := range subs.Subaccounts {
fmt.Println(subaccount.SubaccountID, subaccount.Label, subaccount.Status)
}
subID := "123"
// includeAPIKeys, includeMembers, includeInvites, includePolicy, includeBalances, invitesDirection
detail, err := client.SubAccounts.Get(
ctx, nil, &subID,
false, true, false, true, true, "",
)With includeBalances, GetSubaccountResult.Balances holds the subaccount's current balances, in the
same shape as Balances.List; it is nil when not asked for. It needs the READ_BALANCES action on
the subaccount or fails with a permission error, and it fails with the retryable AUTH_TEMPORARILY_UNAVAILABLE when balances cannot be read right now.
Use Config.DefaultSubAccountID, an AccountScope, or the method subAccountID argument to
scope trading. Subaccount IDs are not the root Account ID used in private channel names.
Activity page tokens are opaque and must be replayed unchanged. Private subscribe methods require API key + root Account ID.