1.2.0 • Published 5 months ago

okx-api-connect v1.2.0

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

OKX API Connect

npm version License: ISC

OKX API Connect is a TypeScript library for seamless integration with the OKX exchange API. This library streamlines the process of making public and private API calls to OKX, providing endpoints for retrieving market data, managing orders, and more.

Installation

Install the package via npm:

npm install okx-api-connect

Usage

Initializing API Configuration

Before making API calls, initialize the API configuration.

import { ApiConfiguration } from "okx-api-connect/types/types";

const apiConfig: ApiConfiguration = {
  apiKey: "your-api-key",
  secretKey: "your-secret-key",
  passphrase: "your-passphrase",
};

Making Public API Calls

The OkxPublicService class provides methods for making public API calls.

import { OkxPublicService } from "okx-api-connect/services/publicService";

const publicService = new OkxPublicService(apiConfig);

// Example: Get currencies
publicService.getCurrencies().then((response) => {
  console.log(response);
});

Making Order-related API Calls

The OkxOrderService class provides methods for making order-related API calls.

import { OkxOrderService } from "okx-api-connect/services/orderService";

const orderService = new OkxOrderService(apiConfig);

// Example: Get order history
orderService.getOrderHistory({ instType: "SPOT" }).then((response) => {
  console.log(response);
});

Package Information

- Package Name: okx-api-connect
- Version: 1.2.0

Scripts

- dev: Start the development server using ts-node-dev.
- build: Build the project using ts-node.
- build-ex: Build the project using tsc.

Dependencies

- @types/node: ^20.10.1
- ts-node: ^10.9.1
- ts-node-dev: ^2.0.0
- typescript: ^5.3.2

License

This project is licensed under the ISC License - see the LICENSE.md file for details.

1.2.0

5 months ago

1.1.9

6 months ago

1.1.8

6 months ago

1.1.7

7 months ago

1.1.6

8 months ago

1.1.5

8 months ago

1.1.4

8 months ago

1.1.3

10 months ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.0

1 year ago