or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

account.mdcore.mdindex.mdinstruments.mdorders.mdpositions.mdpricing.mdtrades.mdtransactions.mdusers.md
tile.json

users.mddocs/

User Information

User profile information and external user data.

API Methods

getInfo

Get detailed user information (private).

getInfo(userSpecifier: string, responseHandler: (response: Response) => void): void;

Parameters:

  • userSpecifier - User ID or '@' for authenticated user

Response: { userInfo: UserInfo }

Example:

ctx.user.getInfo('@', (response) => {
  if (response.isSuccess()) {
    const user = response.body.userInfo;
    console.log(user.username, user.userID, user.country, user.emailAddress);
  }
});

getExternalInfo

Get external (public) user information.

getExternalInfo(userSpecifier: string, responseHandler: (response: Response) => void): void;

Response: { userInfo: UserInfoExternal }

Example:

ctx.user.getExternalInfo('12345', (response) => {
  if (response.isSuccess()) {
    const userInfo = response.body.userInfo;
    console.log(userInfo.userID, userInfo.country, userInfo.FIFO);
  }
});

Data Classes

UserInfo

Complete user information.

class UserInfo {
  username: string;
  userID: number;
  country: string;
  emailAddress: string;
}

UserInfoExternal

External (public) user information.

class UserInfoExternal {
  userID: number;
  country: string;
  FIFO: boolean;  // First-In-First-Out execution rules
}

User Specifiers

  • '@' - Currently authenticated user
  • User ID as string (e.g., '12345')

FIFO Trading Rules

The FIFO flag indicates whether accounts must follow First-In-First-Out execution:

  • true: Trades must be closed in order opened (US accounts, NFA regulations)
  • false: Trades can be closed in any order

Error Handling

ctx.user.getInfo('@', (response) => {
  if (response.isSuccess()) {
    const user = response.body.userInfo;
  } else if (response.statusCode === '401') {
    console.error('Authentication failed');
  } else if (response.statusCode === '403') {
    console.error('Access forbidden');
  }
});