CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-oanda--v20

Java bindings for the OANDA v20 REST API enabling programmatic access to forex trading, account management, market data, and transaction history

Overview
Eval results
Files

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');
  }
});

Install with Tessl CLI

npx tessl i tessl/maven-oanda--v20

docs

account.md

core.md

index.md

instruments.md

orders.md

positions.md

pricing.md

trades.md

transactions.md

users.md

tile.json