MetacoSA / QBitNinja

An Open Source and powerful blockchain API
MIT License
68 stars 42 forks source link

QBitNinjaException : Invalid base58 string on GetBalance with HTTP #119

Closed ArtjomP closed 4 years ago

ArtjomP commented 4 years ago

Hello! I get a QBitNinjaException when creating QBitNinja with HTTP. The following code throws an QBitNinjaException

Message: 
    QBitNinja.Client.Models.QBitNinjaException : Invalid base58 string
  Stack Trace: 
    QBitNinjaClient.Send[T](HttpMethod method, Object body, String relativePath, Object[] parameters)
    ...
    --- End of stack trace from previous location where exception was thrown ---

The code itself:

var network = Network.TestNet;
var client = new QBitNinjaClient("http://api.qbit.ninja/", network);
var destination = BitcoinAddress
                .Create("mkUbdYtNTs9Vds3YuBAGwirb2dkW3rC8Ph", network);
var balance = await client
                .GetBalance(destination, true)
                .ConfigureAwait(false);

The address is valid: https://btc.com/mkUbdYtNTs9Vds3YuBAGwirb2dkW3rC8Ph I've updated NBitcoin dependency to the latest one 5.0.39 but it didn't help. Any ideas?

Thank you in advance!

ArtjomP commented 4 years ago

The same for addresses (TestNet): n4Dnbi6Vc3MfrcWNbb33byenxyqKU2LvHi mg2Ep2JVBNuTfWFqNJQDtxoYqwtLNsSKLE

NicolasDorier commented 4 years ago

if you use testnet, you need to use http://tapi.qbit.ninja