0.1.21 • Published 5 months ago

@sharplygroup/xtb-api-js v0.1.21

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

xtb-api-js

Description

A NodeJS library for interacting with the XTB API. It provides functionalities for account operations, market data, trading operations, and more.

Table of Contents

Installation

npm install @sharplygroup/xtb-api-js

or

yarn add @sharplygroup/xtb-api-js

Example usage

const {
  WebSocketManager,
  AccountOperations,
} = require("@sharplygroup/xtb-api-js");

const wsManager = new WebSocketManager({
  userId: "your_user_id", // Replace with your user ID
  password: "your_password", // Replace with your password
  demo: true, // Set to false for live account
});

async function getAccountData() {
  try {
    await wsManager.connect();
    const accountOperations = new AccountOperations(wsManager);
    const accountData = await accountOperations.getCurrentUserData();
    console.log(accountData);
  } catch (error) {
    console.error(error);
  } finally {
    await wsManager.disconnect();
  }
}

getAccountData();

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your changes.

License

MIT

Support

Please open an issue on GitHub for any questions or problems.

Credits

Acknowledgment of any contributors or dependencies.

0.1.21

5 months ago

0.1.19

5 months ago

0.1.16

5 months ago

0.1.15

5 months ago

0.1.13

5 months ago

0.1.12

5 months ago

0.1.11

5 months ago

0.1.10

5 months ago

0.1.4

5 months ago

0.1.3

5 months ago

0.1.2

5 months ago

0.1.1

5 months ago

0.1.0

5 months ago