Registry / finance / bitexthai

bitexthai

JSON →
library0.1.0jsnpmunverified

A basic Node.js API wrapper for Bitexthai (bx.in.th) Bitcoin exchange REST API, supporting both public and private endpoints. Current version 0.1.0, requires Node >= 4. Provides simple callback-based methods for ticker, orderbook, trades, and private account operations like order creation, balance checks, and withdrawals. Not actively maintained; last release is dated, and the exchange API may have changed since.

npm install bitexthai
INSTALL
IMPORT
SIG · BITEXTHAI
B
bitexthai
financejavascriptv0.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const BitexthaiAPI = require('bitexthai');
import BitexthaiAPI from 'bitexthai';
Package uses CommonJS and does not support ESM imports. Attempting default ESM import will fail.
constructor
new BitexthaiAPI(key, secret, twofa)
new BitexthaiAPI({ key, secret, twofa })
Constructor expects three separate arguments (key, secret, twofa), not an options object. 'twofa' is required even if empty string.
ticker
bitexthai.ticker(callback)
bitexthai.ticker()
Public API methods require a callback; they do not return promises or accept promises. Passing no callback will throw an error.

Initializes BitexthaiAPI with credentials and calls public ticker and private getBalances methods using callbacks.

const BitexthaiAPI = require('bitexthai'); const key = process.env.KEY ?? ''; const secret = process.env.SECRET ?? ''; const twofa = process.env.TWOFA ?? ''; const bitexthai = new BitexthaiAPI(key, secret, twofa); // Public API: get ticker bitexthai.ticker((err, result) => { if (err) return console.error(err); console.log('Ticker:', result); }); // Private API: get balances bitexthai.getBalances((err, balances) => { if (err) return console.error(err); console.log('Balances:', balances); });
Debug
Known issues
gotchaPackage expects callback functions; no Promise support. Using async/await will not work without promisification.
fix
Wrap methods with util.promisify or use a library like bluebird.
affects: >=0.1.0
gotchaConstructor requires three arguments (key, secret, twofa) in order; passing an object will cause unexpected behavior.
fix
Pass key, secret, and twofa as separate string arguments. Use empty string if not needed.
affects: >=0.1.0
deprecatedThe underlying HTTP library 'request' is deprecated. This may cause issues with future Node versions.
fix
Consider migrating to an alternative library that uses fetch or axios.
affects: >=0.1.0
gotchaPublic API methods like ticker require a callback; omitting it will cause an error.
fix
Always provide a callback function as the last argument.
affects: >=0.1.0
Errors
Common errors & fixes
TypeError: bitexthai.ticker is not a function
Importing incorrectly (e.g., using default import in ESM).
fix
Use require('bitexthai') to get the constructor, not import.
Error: API key is required
Calling private API methods without providing credentials or with incorrect arguments.
fix
Ensure you pass key, secret, and twofa to the constructor: new BitexthaiAPI(key, secret, twofa).
TypeError: callback is not a function
Calling a method without providing a callback function.
fix
Always pass a callback as the last argument, e.g., bitexthai.ticker((err, data) => { ... }).
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies
requestrequiredHTTP client used internally for API calls
Agent activity
61 hits · last 30 days
node
52
Perplexity
1
OpenAI (training)
1
Resources
bitexthai — npm install bitexthai · libregistry