Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/demo-trading.ts → examples/Rest/demo-trading.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RestClient, WebsocketClient } from '../src/index';
import { RestClient, WebsocketClient } from '../../src/index.js';

// or
// import { RestClient} from 'okx-api';
Expand Down Expand Up @@ -55,7 +55,7 @@ demoWsClient.on('reconnect', ({ wsKey }) => {
demoWsClient.on('reconnected', (data) => {
console.log('ws has reconnected ', data?.wsKey);
});
demoWsClient.on('error', (data) => {
demoWsClient.on('exception', (data) => {
console.error('ws exception: ', data);
});

Expand Down
2 changes: 1 addition & 1 deletion examples/my.okx.com.ts → examples/Rest/my.okx.com.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RestClient, WebsocketClient } from '../src/index';
import { RestClient, WebsocketClient } from '../../src/index.js';

// or
// import { RestClient } from 'okx-api';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import { RestClient } from '../src/index.js';
import { OrderRequest } from '../src/types/rest/request/trade.js';
import { RestClient } from '../../src/index.js';
import { OrderRequest } from '../../src/types/rest/request/trade.js';

// or
// import { SpotClient } from 'okx-api';
Expand Down
2 changes: 1 addition & 1 deletion examples/rest-public.ts → examples/Rest/rest-public.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RestClient } from '../src/index';
import { RestClient } from '../../src/index.js';

// or
// import { RestClient } from 'okx-api';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DefaultLogger, WebsocketAPIClient } from '../src';
import { DefaultLogger, WebsocketAPIClient } from '../../../src/index.js';

// or use the module installed via `npm install okx-api`:
// import { WebsocketClient, DefaultLogger } from 'okx-api';
Expand Down Expand Up @@ -55,9 +55,9 @@ import { DefaultLogger, WebsocketAPIClient } from '../src';
accounts: [
// For private topics, include one or more accounts in an array. Otherwise only public topics will work
{
apiKey: API_KEY,
apiSecret: API_SECRET,
apiPass: API_PASSPHRASE,
apiKey: API_KEY || '',
apiSecret: API_SECRET || '',
apiPass: API_PASSPHRASE || '',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// If you cloned the repo and are using typescript, you can import from src directly:
import { DefaultLogger, WebsocketClient, WS_KEY_MAP } from '../src';
import {
DefaultLogger,
WebsocketClient,
WS_KEY_MAP,
} from '../../../src/index.js';

// or use the module installed via `npm install okx-api`:
// import { WebsocketClient, DefaultLogger } from 'okx-api';
Expand All @@ -26,9 +30,9 @@ import { DefaultLogger, WebsocketClient, WS_KEY_MAP } from '../src';
accounts: [
// For private topics, include one or more accounts in an array. Otherwise only public topics will work
{
apiKey: API_KEY,
apiSecret: API_SECRET,
apiPass: API_PASSPHRASE,
apiKey: API_KEY || '',
apiSecret: API_SECRET || '',
apiPass: API_PASSPHRASE || '',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// If you cloned the repo and are using typescript, you can import from src directly:
import { WebsocketClient } from '../src';
import { WebsocketClient } from '../../src/index.js';

/**
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// If you cloned the repo and are using typescript, you can import from src directly:
import { DefaultLogger, WebsocketClient } from '../src';
import { DefaultLogger, WebsocketClient } from '../../src/index.js';

// or use the module installed via `npm install okx-api`:
// import { WebsocketClient, DefaultLogger } from 'okx-api';
Expand Down
2 changes: 1 addition & 1 deletion examples/ws-public.ts → examples/Websocket/ws-public.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DefaultLogger, WebsocketClient } from '../src';
import { DefaultLogger, WebsocketClient } from '../../src/index.js';

// or use the module installed via `npm install okx-api`:
// import { WebsocketClient, DefaultLogger } from 'okx-api';
Expand Down
2 changes: 1 addition & 1 deletion examples/app.okx.com.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RestClient, WebsocketClient } from '../src/index';
import { RestClient, WebsocketClient } from '../src/index.js';

// or
// import { RestClient } from 'okx-api';
Expand Down
12 changes: 8 additions & 4 deletions examples/auth/fasterHmacSign.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { createHmac } from 'crypto';

import { DefaultLogger, RestClient, WebsocketClient } from '../../src/';
import {
DefaultLogger,
RestClient,
WebsocketClient,
} from '../../src/index.js';

// or
// import { createHmac } from 'crypto';
Expand Down Expand Up @@ -62,9 +66,9 @@ const wsClient = new WebsocketClient(
accounts: [
// For private topics, include one or more accounts in an array. Otherwise only public topics will work
{
apiKey: API_KEY,
apiSecret: API_SECRET,
apiPass: API_PASS,
apiKey: API_KEY || '',
apiSecret: API_SECRET || '',
apiPass: API_PASS || '',
},
],
/**
Expand Down
2 changes: 1 addition & 1 deletion examples/rest-private-trade-market.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { OrderRequest, RestClient } from '../src/index';
import { OrderRequest, RestClient } from '../src/index.js';

// or
// import { RestClient, OrderRequest } from 'okx-api';
Expand Down
Loading