or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

account.mdcore.mdindex.mdorder.mdposition.mdpricing.mdtrade.mdtransaction.mduser.md
tile.json

user.mddocs/

User Information

Operations for retrieving user account information including username, country, email, and FIFO status.

All user operations are accessed via ctx.user where ctx is a Context instance.

Capabilities

Get User Information

Get information about a user.

/**
 * Get user information
 * @param userSpecifier - User identifier (username or user ID)
 * @param responseHandler - Callback receiving Response object
 * Response body contains: { userInfo: UserInfo }
 */
getInfo(userSpecifier, responseHandler);

Usage Example:

ctx.user.getInfo('12345678', response => {
  if (response.isSuccess()) {
    const user = response.body.userInfo;
    console.log('User Information:');
    console.log(`  User ID: ${user.userID}`);
    console.log(`  Username: ${user.username}`);
    console.log(`  Email: ${user.emailAddress}`);
    console.log(`  Country: ${user.country}`);
  }
});

Get External User Information

Get external user information (public-facing information).

/**
 * Get external user information
 * @param userSpecifier - User identifier (username or user ID)
 * @param responseHandler - Callback receiving Response object
 * Response body contains: { userInfo: UserInfoExternal }
 */
getExternalInfo(userSpecifier, responseHandler);

Usage Example:

ctx.user.getExternalInfo('12345678', response => {
  if (response.isSuccess()) {
    const user = response.body.userInfo;
    console.log('External User Information:');
    console.log(`  User ID: ${user.userID}`);
    console.log(`  Country: ${user.country}`);
    console.log(`  FIFO: ${user.FIFO}`);
  }
});

Types

UserInfo

Complete user information.

interface UserInfo {
  username: string;  // User-provided username
  userID: string;    // OANDA-assigned user ID
  country: string;   // User's country
  emailAddress: string;  // User's email address
}

UserInfoExternal

External (public) user information.

interface UserInfoExternal {
  userID: string;  // OANDA-assigned user ID
  country: string;  // User's country
  FIFO: boolean;    // Flag indicating if First-In-First-Out rules apply
}

FIFO Rules

The FIFO (First-In-First-Out) flag indicates whether the user's account is subject to FIFO trade closure rules:

  • FIFO = true: When closing positions, trades must be closed in the order they were opened (required in some jurisdictions like the US)
  • FIFO = false: Trades can be closed in any order

This affects how trade closure operations work and which trades can be individually closed.