Current collected state Current
Observed since 20 Oct, 19:31 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
3commas-typescript
TypeScript 3Commas API client
An unofficial 3Commas API wrapper in TypeScript. Check out the offical documentation here.
npm install 3commas-typescript
import { API } from '3commas-typescript';
const api = new API({
key: 'YOUR_KEY', // Optional if only query endpoints with no security requirement
secrets: 'YOUR_SECRETS', // Optional
timeout: 60000, // Optional, in ms, default to 30000
forcedMode: 'real' | 'paper',
errorHandler: (response, reject) => {
// Optional, Custom handler for 3Commas error
const { error, error_description } = response;
reject(new Error(error_description ?? error));
},
});
ping()
time()
transfer(params: TransferParams)
getTransferHistory(params: TransferHistoryParams)
getTransferData()
addExchangeAccount(params: any)
editExchangeAccount(params: any)
getExchange()
getMarketList()
getMarketPairs(params?: any)
getCurrencyRate(params: CurrencyParams)
getCurrencyRateWithLeverageData(params: MarketCurrencyParams)
getActiveTradeEntities(account_id: number)
sellAllToUSD(account_id: number)
sellAllToBTC(account_id: number)
getBalanceChartData(account_id: number, params: any)
loadBalances(account_id: number)
renameExchangeAccount(account_id: number, name: string)
removeExchangeAccount(account_id: number)
getPieChartData(account_id: number)
getAccountTableData(account_id: number)
getAccountInfo(account_id?: number)
changeUserMode(mode: 'paper' | 'real')
getSmartTradeHistory(params?: SmartTradeHistoryParams)
smartTrade(params: SmartTradeParams)
getSmartTrade(id: number)
cancelSmartTrade(id: number)
updateSmartTrade(id: number)
averageSmartTrade(id: number, params: FundParams)
reduceFund(id: number, params: FundParams)
closeSmartTrade(id: number)
forceStartSmartTrade(id: number)
forceProcessSmartTrade(id: number)
setNoteSmartTrade(id: number, note: string)
getSubTrade(id: number)
closeSubTrade(smartTradeId: number, subTradeId: number)
cancelSubTrade(smartTradeId: number, subTradeId: number)
getBots(params?: BotsParams)
getBot(id: number)
getBotsStats(params?: BotsStatsParams)
getDeals(params?: DealsParams)
getDeal(id: number)
getDealSafetyOrders(id: number)
customRequest(method: string, version: number, path: string, payload?: any)
subscribeSmartTrade(callback?: (data: WebSocket.Data) => void)
subscribeDeal(callback?: (data: WebSocket.Data) => void)
unsubscribe()
The Order type returned by smart trade endpoint is generated using quicktype.
The type correctness isn't guaranteed. You can perform a type check before access.
try {
const order = await api.getSmartTrade(1234567)
const validatedOrder = api.validateOrderType(order)
...
} catch (error) {
console.error(error)
}
Buy me a coffee
ETH: 0xB6fc1dFABf1244138b048C3F80ba5678d8f6f0CE
BAT: 0x336bFB8247640C0848F8aFFB80464f3fF489B888
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
axiosEnvironment{
"local_name": "axios",
"alias": false,
"peer_metadata": null
} | ^0.19.2 | runtime |
crypto-jsEnvironment{
"local_name": "crypto-js",
"alias": false,
"peer_metadata": null
} | ^4.0.0 | runtime |
qsEnvironment{
"local_name": "qs",
"alias": false,
"peer_metadata": null
} | ^6.9.4 | runtime |
@types/crypto-jsEnvironment{
"local_name": "@types/crypto-js",
"alias": false,
"peer_metadata": null
} | ^3.1.47 | development |
@types/qsEnvironment{
"local_name": "@types/qs",
"alias": false,
"peer_metadata": null
} | ^6.9.4 | development |
ts-node-devEnvironment{
"local_name": "ts-node-dev",
"alias": false,
"peer_metadata": null
} | ^1.0.0-pre.56 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^3.9.7 | development |
Source distribution
{
"integrity": "sha512-vmJP2Xv4bYBolEo2ngHuPUH2ZddBXx5QXExx9UqkJbN9EaUSBnqEk5XgT0HTOSp8rs/+JgD/a+0DHlVq+Wv0Aw==",
"shasum": "a95a3cec9cd1f8e7c4c9d54c93d3a644023189e2",
"tarball": "https://registry.npmjs.org/3commas-typescript/-/3commas-typescript-1.0.0.tgz",
"fileCount": 1024,
"unpackedSize": 58057805,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHbEACRA9TVsSAnZWagAAw7oQAIzlT0Sk/43PLx1JBN2F\nWsXBzRxshvGi8VHw4R78hsiHbYzc4Q7rFLYlEqYvE7jsEOGwACsRw8DgDCNt\neDhQgWuNgjbC8djhZQLjrgTR9WrYydBJbCIYTmExfQxaHJFZg+50fxEgmhO6\nC2CbDdz3Bi0iMmJZossRHkSH4aJoqQvK6/fsCiQOyHu+mpHJ+ZnsM07yRicY\nIRRkPVNtYM1R+JOaRkJO6jhQBDqeHQ3u8hcmbENoxv4/UUr3HEjQW1g/EtiH\nuUg6wTZLe2PxYBEU04uakal6xJQIZWKkIhC4yzZBoex9ES/utWoDd6fZ26iR\nf2Xj0wJZNraiBn9LhCTun3u9+v54oU32i2A2BiQ4nluYbUWYuGAEg3iqui6l\nGs+4EDB6RDG6BemdldOtfhlocMwRh66cd0RfgjhKwho4xxDMf9Eq/HaxD/fN\nTH5BZuIH5HbUoKYLNKMlkp0CESDYuk/yR/B9XPbzCK0u1QxuvluYz+UBl64U\nc3+g0fH812tiPPlVfzRvq9jxg/IJ3pSZlHIGt4GJ7DWj0VwXOIUfJPA5pczu\nOJ+WtorV8yyMmnoqwfpK/+gJeQw26Gni+bgIqbO0TWVTc8T9mOXHQuedayL4\no3d9nzWea/6PWBq1tNdzM4PD4+bZZqQC8984kv1BO/MdqV/PAbB1vaQgSxZF\nhlKv\r\n=7mCc\r\n-----END PGP SIGNATURE-----\r\n",
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEUCIHtbj2WbqTFQzlfaRc6scs5t+NbiaInxu6BB9602l/rdAiEAwuShYUoPzOLtx6Gpk7T5JWhqbqMVKGyU6cpxHBvUK0Q="
}
]
}Observed since 20 Oct, 19:31 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:58e99ccf5488d45cb89bac80dd9fc017a45fae45f4a9a3e1eaff9af2ef103839