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 29, 2018 in Blockchain by sabby
• 4,370 points
300 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 29, 2018 by Perry
• 17,090 points

Related Questions In Blockchain

+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 26, 2018 in Blockchain by Johnathon
• 9,090 points
99 views
+1 vote
1 answer

I would like to create a blockchain network which will stay at the same level of complexity, is it possible?

You can very easily create a cryptocurrency having a ...READ MORE

answered Apr 4, 2018 in Blockchain by Christine
• 15,810 points
66 views
0 votes
1 answer

In a Blockchain, how difficult is it to modify the third to last block?

Technically, it's not difficult at all, all ...READ MORE

answered Apr 20, 2018 in Blockchain by Christine
• 15,810 points
84 views
0 votes
1 answer

How to send Bitcoins with node.js?

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

answered Jul 20, 2018 in Blockchain by Christine
• 15,810 points
495 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,240 points
101 views
0 votes
1 answer
0 votes
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,090 points
92 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 20, 2018 in Blockchain by Perry
• 17,090 points
65 views