Skip to main content

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: '[email protected]',
  password: 'SecurePass123!',
  firstName: 'John',
  lastName: 'Doe'
});
Returns: Promise<User>

getCurrentUser()

Get authenticated user details.
const user = await client.users.getCurrentUser();
console.log(`Email: ${user.email}`);
console.log(`Name: ${user.firstName} ${user.lastName}`);
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('[email protected]');
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: '[email protected]',
  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 user = await client.users.getCurrentUser();
console.log(`Current email: ${user.email}`);

// Update profile
const updated = await client.users.updateCurrentUser({
  phone: '+1234567890',
  address: '123 Main St'
});
console.log('Profile updated');