Skip to main content

Accounts

The Account resource allows you to retrieve details of your GStable accounts.

Accessing accounts

Access account methods through the client.account property on your GStableClient instance.

Read-only resource

The Account resource is read-only within the SDK. To create or modify account settings, please use the GStable Dashboard.

TypeScript support

We export type definitions for accounts. Import them from the package root:

import type { Account, AccountStatus, AccountType } from 'gstable-js';

list

Returns every account visible to your API key in one response (no pagination on the server).

client.account.list()

Parameters

NameTypeRequiredDescription
No parameters.

Returns

Promise<Account[]> — Array of account objects (accountId, accountName, accountAddress, accountType, settlementCurrencies, version, status, optional createAt / updateAt).

Example

import { GStableClient } from 'gstable-js';

const client = new GStableClient({ apiKey: process.env.GSTABLE_API_KEY! });
const accounts = await client.account.list();
console.log(accounts.map((a) => a.accountId));

detail

Loads one account by id.

client.account.detail(accountId)

Parameters

NameTypeRequiredDescription
accountIdstringYesAccount identifier.

Returns

Promise<Account> — Single Account record.

Example

import { GStableClient } from 'gstable-js';

const client = new GStableClient({ apiKey: process.env.GSTABLE_API_KEY! });
const account = await client.account.detail('acc_xxxxxxxx');
console.log(account.settlementCurrencies);