CRYPTO NEWS

NBitcoin, how to implement wallet restoration? How does it work?

at first sorry for my ignorance, I have little experience at bitcoin programming.

Im trying to implement a very simple wallet using NBitcoin library. I have done some work, but now Im stucked with wallet restoration function.

Lets say I have mnemonic private key, then I calculate its public key.

With public key am I able to track all transactions associated with this key? Even if I used multiple adresses? How its done(NBitcoin)? Any advice? Do I have to iterate throught whole blockchain and chceck signatures?

Thank you.

Crypto Hats, Crypto Shirts, Crypto Socks, Crypto Clothing

Axios GET request working in plain js but not working in react – CORS error

When I make a GET request inside in react, I get blocked by CORS policy error. However if I make the same request inside vanilla js (a simple .js file) I get the appropriate response. Here is my code in the react: const axios = require(‘axios’); function getLatestPrice() { const config = { url: ‘https://api.kraken.com/0/public/Trades?pair=ETHUSDT&since=1656322000’,::Listen

When I make a GET request inside in react, I get blocked by CORS policy error. However if I make the same request inside vanilla js (a simple .js file) I get the appropriate response.

Here is my code in the react:

const axios = require('axios');

function getLatestPrice() {
  const config = {
    url: 'https://api.kraken.com/0/public/Trades?pair=ETHUSDT&since=1656322000',
    method: 'GET'
  };
  
  return axios(config);
}

exports.getLatestPrice = getLatestPrice;

I get the following error:

Access to XMLHttpRequest at 'https://api.kraken.com/0/public/Trades?pair=ETHUSDT&since=1656322000' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

My code in vanilla js file

const axios = require('axios');

const url = "https://api.kraken.com/0/public/Trades?pair=ETHUSDT&since=1656322000";


const config = {
  url: url,
  method: "GET"
};

axios(config).then(res => {
  console.log(res.data);
}).catch(err => {
  console.log(err);
});

Here I am getting the correct response.

(I am not controlling the API backend)

NBitcoin, how to implement wallet restoration? How does it work?

Shopping cart
There are no products in the cart!
Continue shopping
0