Is there a way to get a trade history report from the Bitfinex API

0 votes

I'm using Bitfinex's WebSockets API v2 via their Node.JS package. I am not able to get a report on my trade history through the API. When I authenticate like below:

const BFX = require('bitfinex-api-node')

const bitfinexClient = new BFX(API_KEY, API_SECRET, {
  version: 2,
  transform: true
}).ws

bitfinexClient.on('open', () => {
  bws .auth()
})

The following code delivers nothing:

bitfinexClient.on('auth', () => {
  bitfinexClient.on('te', (data) => {
    console.log(data)
  })
})

Both v1 and v2 of the API return an error saying that fetchMyTrades/fetchMyOrders is not supported yet. How do I get it done?

Aug 30, 2018 in Blockchain by sabby
• 4,390 points
1,637 views

1 answer to this question.

0 votes

You can still fetch your private trades from Bitfinex v1 with CCXT, like here:

"use strict";

const ccxt = require ('ccxt')

const exchange = new ccxt.bitfinex ({
    'apiKey': 'YOUR_API_KEY', // ←---- change your credentials
    'secret': 'YOUR_SECRET',
});

(async () => {
    await exchange.loadMarkets ()
    const myTrades = await exchange.private_post_mytrades ({
        'symbol': exchange.markets['BTC/USD'].id, // ←-- choose your pair
        'timestamp': exchange.seconds () - 86400 * 365, // ← last 365 days
    })
    console.log (myTrades)
}) ()
answered Aug 30, 2018 by Perry
• 17,100 points

Related Questions In Blockchain

0 votes
1 answer

Is there a way to get the market cap or market cap rank of a coin using the Binance API?

This is how I did so: https://www.binance.com/exchange-api/v2/public/asset-service/product/get-products Get this ...READ MORE

answered Apr 6, 2022 in Blockchain by Aditya
• 7,680 points
2,885 views
0 votes
1 answer
+1 vote
1 answer

How does a miner get to know that a transaction is verified by all the nodes?

Contrary to the popular belief, it is ...READ MORE

answered Mar 27, 2018 in Blockchain by Johnathon
• 9,090 points
2,793 views
0 votes
1 answer

How to send Bitcoins with node.js?

This website https://blockr.io/tx/push will successfully do the ...READ MORE

answered Jul 20, 2018 in Blockchain by Christine
• 15,790 points
3,376 views
0 votes
1 answer

blockchain.info api_code is missing

Check the blockchain api. it should be $Blockchain ...READ MORE

answered Aug 22, 2018 in Blockchain by slayer
• 29,370 points
1,219 views
0 votes
1 answer
+1 vote
1 answer

Is there a way to send funds from a specific bitcoin address in a wallet?

I'll answer my own question, It was unbelievably ...READ MORE

answered Sep 3, 2018 in Blockchain by Perry
• 17,100 points
1,407 views
+1 vote
1 answer

What is the best way to search for an item in blockchain?

All transactions and records in blockchain are ...READ MORE

answered Apr 21, 2018 in Blockchain by Perry
• 17,100 points
1,852 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP