Documentation Index
Fetch the complete documentation index at: https://finance.dev/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Users API allows you to create users, retrieve and update profiles, manage email addresses, and configure trading passwords.
Class Reference
import { AriesClient } from '@aries-exchange/sdk';
const client = new AriesClient({
clientId: 'your_client_id',
clientSecret: 'your_client_secret'
});
Methods
createUser()
Create a new user account.
const user = await client.users.createUser({
email: 'user@example.com',
password: 'SecurePass123!',
firstName: 'John',
lastName: 'Doe'
});
Returns: Promise<User>
updateCurrentUser()
Update user profile information.
const updated = await client.users.updateCurrentUser({
firstName: 'Jane',
phone: '+1234567890'
});
Returns: Promise<User>
getUserAccounts()
Get all trading accounts owned by user.
const accounts = await client.users.getUserAccounts();
accounts.forEach(account => {
console.log(`Account: ${account.id} - ${account.accountType}`);
});
Returns: Promise<Account[]>
getUserProfile()
Get complete user profile.
const profile = await client.users.getUserProfile();
Returns: Promise<Profile> with personal details
changeEmail()
Update account email address.
const result = await client.users.changeEmail('newemail@example.com');
Returns: Promise<void> - Success confirmation
setTradingPassword()
Configure password for sensitive operations.
await client.users.setTradingPassword('TradingPass456!');
Returns: Promise<void> - Success confirmation
TypeScript Types
interface User {
id: string;
email: string;
firstName: string;
lastName: string;
createdAt: Date;
}
interface Account {
id: string;
accountType: string;
status: string;
}
Examples
User Registration Flow
// Create new user
const user = await client.users.createUser({
email: 'trader@example.com',
password: 'SecurePass123!',
firstName: 'Alex',
lastName: 'Smith'
});
// Set trading password
await client.users.setTradingPassword('TradingPass456!');
// Get user accounts
const accounts = await client.users.getUserAccounts();
console.log(`Accounts created: ${accounts.length}`);
Update User Profile
const profile = await client.users.getUserProfile();
console.log(`Current email: ${profile.email}`);
// Update profile
const updated = await client.users.updateCurrentUser({
phone: '+1234567890',
address: '123 Main St'
});
console.log('Profile updated');