From f8fa057ef0e1707ca4f8e136e717c2b2eacf9e25 Mon Sep 17 00:00:00 2001 From: Guilherme Moura Date: Sat, 20 Nov 2021 23:05:13 -0300 Subject: [PATCH] Added accountShow to fetch a sing account by id --- example.js | 17 ----------------- index.js | 6 +++++- package.json | 2 +- 3 files changed, 6 insertions(+), 19 deletions(-) delete mode 100644 example.js diff --git a/example.js b/example.js deleted file mode 100644 index 101422e..0000000 --- a/example.js +++ /dev/null @@ -1,17 +0,0 @@ -const threeCommasAPI = require('3commas-api-node') - -const api = new threeCommasAPI({ - apiKey: '', - apiSecret: '' -}) - -// get last 20 active deals -const showActiveDeals = async () => { - let data = await api.getDeals({ - limit: 20, - scope: 'active', - }) - console.log(data) -} - -showActiveDeals() diff --git a/index.js b/index.js index 0a63460..810fee4 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ 'use strict' -const querystring = require('querystring'); +const querystring = require('querystring') const crypto = require('crypto') const fetch = require('node-fetch') @@ -239,6 +239,10 @@ class threeCommasAPI { return await this.makeRequest('POST', `/public/api/ver1/accounts/${account_id}/remove?`, { account_id }) } + async accountShow (account_id) { + return await this.makeRequest('GET', `/public/api/ver1/accounts/${account_id}?`, { account_id }) + } + } module.exports = threeCommasAPI diff --git a/package.json b/package.json index a91209e..9df49eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "3commas-api-node", - "version": "1.1.1", + "version": "1.1.2", "description": "3commas API NodeJS wrapper", "main": "index.js", "engines": {