Current collected state Current
Observed since 20 Oct, 19:32 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.25.0 | runtime |
crypto-jsEnvironment{
"local_name": "crypto-js",
"alias": false,
"peer_metadata": null
} | ^4.1.1 | runtime |
qsEnvironment{
"local_name": "qs",
"alias": false,
"peer_metadata": null
} | ^6.10.3 | runtime |
wsEnvironment{
"local_name": "ws",
"alias": false,
"peer_metadata": null
} | ^8.4.2 | runtime |
@types/crypto-jsEnvironment{
"local_name": "@types/crypto-js",
"alias": false,
"peer_metadata": null
} | ^4.1.0 | development |
@types/nodeEnvironment{
"local_name": "@types/node",
"alias": false,
"peer_metadata": null
} | ^17.0.14 | development |
@types/qsEnvironment{
"local_name": "@types/qs",
"alias": false,
"peer_metadata": null
} | ^6.9.7 | development |
@types/wsEnvironment{
"local_name": "@types/ws",
"alias": false,
"peer_metadata": null
} | ^8.2.2 | development |
dotenvEnvironment{
"local_name": "dotenv",
"alias": false,
"peer_metadata": null
} | ^15.0.0 | development |
huskyEnvironment{
"local_name": "husky",
"alias": false,
"peer_metadata": null
} | ^7.0.4 | development |
lint-stagedEnvironment{
"local_name": "lint-staged",
"alias": false,
"peer_metadata": null
} | ^12.3.3 | development |
prettierEnvironment{
"local_name": "prettier",
"alias": false,
"peer_metadata": null
} | ^2.5.1 | development |
ts-node-devEnvironment{
"local_name": "ts-node-dev",
"alias": false,
"peer_metadata": null
} | ^1.1.8 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^4.5.5 | development |
Source distribution
{
"integrity": "sha512-xaFbz9Zd+AWr7IhsPXeZLkF5DraQb5bjWIZVcEZKjTXVPC6Rq9CO1VfbOttSrcyXyGPPwYXal6/yQMKPKhFWBA==",
"shasum": "f0de7c5ab60406dcb01b3d26ab55194d3bbdf96a",
"tarball": "https://registry.npmjs.org/3commas-typescript/-/3commas-typescript-1.3.5.tgz",
"fileCount": 20,
"unpackedSize": 80706,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+g8cCRA9TVsSAnZWagAAQD0P/2jRDAxTl1kay6Qepyx5\nJlWaVF1XzdNg0xy98kcX+bA9e5P7eUt+MMD5IL+DWlqSedrmRm75smpJzmwK\njCSK6HEOx25/VqMvDS4F5dyIynKoj2Ev3BQVwnpOc4f3kkLd3DVanNuRlRPT\nyeLT/KBeP+y/jow+tIw3Ce5ym8P8hT6oMhd0qzTKVnxzpG80tnHjslw7ln8I\nwxgNJvRNA+f3jMCv7SCmo09nXFeR+8blk21zdRQxAwvra7n2r0SBh1MQcHHG\nDUSKJjR2h/xNjE0SrdXiq389RCGwDL+mtVfgJRpX/4BGYE5Z8zdqI2EnnFRB\n62svfcXGldy55G4e+lazMfKUYaPgWy0UiD+S1p21aqDj+dFsdRqpaPM68AOr\nHbpg1+PG7JM7OjC9WOXOWT7XOIqfg9FJeXuDRRZf7z1eRI88qj6ZoHSdlynd\nFCmfX3KDYMHAVofzwc7zdHxBxUtDcmpj1M7ijvlJynt7Y/0gYluZASkG97fz\nqme5mH5fuKm886koUnMr3c1fwCpEO4h8F49zuzzYZKJFL4c2FQ15P4MIxCuf\nc7ve30ZliTlDn8Bhuu5oMAaPMq/K3BsxJIFCpz+7bii27tLZknQ2cZQyl9ag\nScQpXWEVa8X9iyD7cZBIkFxXX+yKA3a+ROBTIow3oxlwNCeTefy8kKtCpr0W\n6jyS\r\n=Nq4x\r\n-----END PGP SIGNATURE-----\r\n",
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEUCIEJcxCxXXso95exPFsu8Q4WQ5028zUZJ0fy+fHSEDCzEAiEAqWiirD7oiA6OOr5GC1rjLFszOUsb5yvu2CJrRocw5MA="
}
]
}Observed since 20 Oct, 19:32 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:f317573e69b494a1aa7467b3d84dfa21e81de4e4e4f9d24051cbc7736dd356d7