tosunthex / CoinGecko

CoinGecko .Net Standard api wrapper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error converting value {null} to type 'System.Boolean'.

otium99 opened this issue · comments

I am using Version 1.3.1 and I am getting the following error with some of the coins in this function:

CoinGeckoClient.CoinsClient.GetAllCoinDataWithId("loopring")

It happens with these coinId's: blox, dmm-governance, origin-protocol, republic-protocol, havven, ethlend, loopring, decred, ravencoin, status, vechain

System.Net.Http.HttpRequestException: Error converting value {null} to type 'System.Boolean'. Path 'tickers[10].is_anomaly', line 1, position 39366.
at CoinGecko.Clients.BaseApiClient.d__21.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CoinGecko.Clients.CoinsClient.<GetAllCoinDataWithId>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CoinGecko.Clients.CoinsClient.<GetAllCoinDataWithId>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at PriceHistories.Form1.<butCoinMarketCap_Click>d__5.MoveNext()

With CoinId insolar-old it's this error:

System.Net.Http.HttpRequestException: Error converting value {null} to type 'System.DateTimeOffset'. Path 'market_data.last_updated', line 1, position 27053.
at CoinGecko.Clients.BaseApiClient.d__21.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CoinGecko.Clients.CoinsClient.<GetAllCoinDataWithId>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CoinGecko.Clients.CoinsClient.<GetAllCoinDataWithId>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at PriceHistories.Form1.<butCoinMarketCap_Click>d__5.MoveNext()

Hi @otium99

I added test about your scenario but i can't get this error. You can find test script in my last commit.

Hi @tosunthex

Thank you for the quick reply.

Indeed, I can not reproduce the error in the Test Solution with "loopring", which I have no explanation for, why it's not working in my solution but in the Test Solution.

However, I can reproduce the second error in the Test Solution with some coins. I am running a test at the moment and going through all the coins, which will take a while.

Here are a few examples so far:

15634-liberal-st-detroit-mi-48205
System.Net.Http.HttpRequestException: Error converting value {null} to type 'System.DateTimeOffset'. Path 'market_data.last_updated', line 1, position 6642.
at CoinGecko.Clients.BaseApiClient.GetAsync[T](Uri resourceUri) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\BaseApiClient.cs:line 32
at CoinGecko.Clients.CoinsClient.GetAllCoinDataWithId(String id, String localization, Boolean tickers, Boolean marketData, Boolean communityData, Boolean developerData, Boolean sparkline) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\CoinsClient.cs:line 69
at CoinGecko.Clients.CoinsClient.GetAllCoinDataWithId(String id) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\CoinsClient.cs:line 63
at CoinGecko.Test.CoinsClientTests.Loopring_IsAnomaly_Null_Must_Not_Give_Error() in C:\Development\CoinGecko\CoinGecko-master\CoinGecko.Test\CoinsClientTests.cs:line 232
18900-mansfield-st-detroit-mi-48235
System.Net.Http.HttpRequestException: Error converting value {null} to type 'System.DateTimeOffset'. Path 'market_data.last_updated', line 1, position 6692.
at CoinGecko.Clients.BaseApiClient.GetAsync[T](Uri resourceUri) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\BaseApiClient.cs:line 32
at CoinGecko.Clients.CoinsClient.GetAllCoinDataWithId(String id, String localization, Boolean tickers, Boolean marketData, Boolean communityData, Boolean developerData, Boolean sparkline) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\CoinsClient.cs:line 69
at CoinGecko.Clients.CoinsClient.GetAllCoinDataWithId(String id) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\CoinsClient.cs:line 63
at CoinGecko.Test.CoinsClientTests.Loopring_IsAnomaly_Null_Must_Not_Give_Error() in C:\Development\CoinGecko\CoinGecko-master\CoinGecko.Test\CoinsClientTests.cs:line 232
21vianet-group-inc
System.Net.Http.HttpRequestException: Error converting value {null} to type 'System.DateTimeOffset'. Path 'market_data.last_updated', line 1, position 13465.
at CoinGecko.Clients.BaseApiClient.GetAsync[T](Uri resourceUri) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\BaseApiClient.cs:line 32
at CoinGecko.Clients.CoinsClient.GetAllCoinDataWithId(String id, String localization, Boolean tickers, Boolean marketData, Boolean communityData, Boolean developerData, Boolean sparkline) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\CoinsClient.cs:line 69
at CoinGecko.Clients.CoinsClient.GetAllCoinDataWithId(String id) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\CoinsClient.cs:line 63
at CoinGecko.Test.CoinsClientTests.Loopring_IsAnomaly_Null_Must_Not_Give_Error() in C:\Development\CoinGecko\CoinGecko-master\CoinGecko.Test\CoinsClientTests.cs:line 232
advisorshares-pure-cannabis-etf
System.Net.Http.HttpRequestException: Error converting value {null} to type 'System.DateTimeOffset'. Path 'market_data.last_updated', line 1, position 14175.
at CoinGecko.Clients.BaseApiClient.GetAsync[T](Uri resourceUri) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\BaseApiClient.cs:line 32
at CoinGecko.Clients.CoinsClient.GetAllCoinDataWithId(String id, String localization, Boolean tickers, Boolean marketData, Boolean communityData, Boolean developerData, Boolean sparkline) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\CoinsClient.cs:line 69
at CoinGecko.Clients.CoinsClient.GetAllCoinDataWithId(String id) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\CoinsClient.cs:line 63
at CoinGecko.Test.CoinsClientTests.Loopring_IsAnomaly_Null_Must_Not_Give_Error() in C:\Development\CoinGecko\CoinGecko-master\CoinGecko.Test\CoinsClientTests.cs:line 232
allergan
System.Net.Http.HttpRequestException: Error converting value {null} to type 'System.DateTimeOffset'. Path 'market_data.last_updated', line 1, position 12825.
at CoinGecko.Clients.BaseApiClient.GetAsync[T](Uri resourceUri) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\BaseApiClient.cs:line 32
at CoinGecko.Clients.CoinsClient.GetAllCoinDataWithId(String id, String localization, Boolean tickers, Boolean marketData, Boolean communityData, Boolean developerData, Boolean sparkline) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\CoinsClient.cs:line 69
at CoinGecko.Clients.CoinsClient.GetAllCoinDataWithId(String id) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\CoinsClient.cs:line 63
at CoinGecko.Test.CoinsClientTests.Loopring_IsAnomaly_Null_Must_Not_Give_Error() in C:\Development\CoinGecko\CoinGecko-master\CoinGecko.Test\CoinsClientTests.cs:line 232
alnylam-pharmaceuticals-inc
System.Net.Http.HttpRequestException: Error converting value {null} to type 'System.DateTimeOffset'. Path 'market_data.last_updated', line 1, position 14145.
at CoinGecko.Clients.BaseApiClient.GetAsync[T](Uri resourceUri) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\BaseApiClient.cs:line 32
at CoinGecko.Clients.CoinsClient.GetAllCoinDataWithId(String id, String localization, Boolean tickers, Boolean marketData, Boolean communityData, Boolean developerData, Boolean sparkline) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\CoinsClient.cs:line 69
at CoinGecko.Clients.CoinsClient.GetAllCoinDataWithId(String id) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\CoinsClient.cs:line 63
at CoinGecko.Test.CoinsClientTests.Loopring_IsAnomaly_Null_Must_Not_Give_Error() in C:\Development\CoinGecko\CoinGecko-master\CoinGecko.Test\CoinsClientTests.cs:line 232
amundi
System.Net.Http.HttpRequestException: Error converting value {null} to type 'System.DateTimeOffset'. Path 'market_data.last_updated', line 1, position 12696.
at CoinGecko.Clients.BaseApiClient.GetAsync[T](Uri resourceUri) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\BaseApiClient.cs:line 32
at CoinGecko.Clients.CoinsClient.GetAllCoinDataWithId(String id, String localization, Boolean tickers, Boolean marketData, Boolean communityData, Boolean developerData, Boolean sparkline) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\CoinsClient.cs:line 69
at CoinGecko.Clients.CoinsClient.GetAllCoinDataWithId(String id) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\CoinsClient.cs:line 63
at CoinGecko.Test.CoinsClientTests.Loopring_IsAnomaly_Null_Must_Not_Give_Error() in C:\Development\CoinGecko\CoinGecko-master\CoinGecko.Test\CoinsClientTests.cs:line 232
anarcheth
System.Net.Http.HttpRequestException: Error converting value {null} to type 'System.DateTimeOffset'. Path 'market_data.last_updated', line 1, position 9223.
at CoinGecko.Clients.BaseApiClient.GetAsync[T](Uri resourceUri) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\BaseApiClient.cs:line 32
at CoinGecko.Clients.CoinsClient.GetAllCoinDataWithId(String id, String localization, Boolean tickers, Boolean marketData, Boolean communityData, Boolean developerData, Boolean sparkline) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\CoinsClient.cs:line 69
at CoinGecko.Clients.CoinsClient.GetAllCoinDataWithId(String id) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\CoinsClient.cs:line 63
at CoinGecko.Test.CoinsClientTests.Loopring_IsAnomaly_Null_Must_Not_Give_Error() in C:\Development\CoinGecko\CoinGecko-master\CoinGecko.Test\CoinsClientTests.cs:line 232
ansobit-token
System.Net.Http.HttpRequestException: Error converting value {null} to type 'System.DateTimeOffset'. Path 'market_data.last_updated', line 1, position 14047.
at CoinGecko.Clients.BaseApiClient.GetAsync[T](Uri resourceUri) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\BaseApiClient.cs:line 32
at CoinGecko.Clients.CoinsClient.GetAllCoinDataWithId(String id, String localization, Boolean tickers, Boolean marketData, Boolean communityData, Boolean developerData, Boolean sparkline) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\CoinsClient.cs:line 69
at CoinGecko.Clients.CoinsClient.GetAllCoinDataWithId(String id) in C:\Development\CoinGecko\CoinGecko-master\CoinGecko\Clients\CoinsClient.cs:line 63
at CoinGecko.Test.CoinsClientTests.Loopring_IsAnomaly_Null_Must_Not_Give_Error() in C:\Development\CoinGecko\CoinGecko-master\CoinGecko.Test\CoinsClientTests.cs:line 232

Ok. Below you find the complete list out of all the ~7'700 Coins which don't work in the Test Solution.
(They all seem to be empty on the CoinGecko Website though)

Then I found out, why my Project is not working with "loopring" and other coins, even though it does work in the Test Solution:
The CoinGecko.dll are not the same! I am using the Package Manager from this source https://www.nuget.org/packages/CoinGeckoAsyncApi/ which downloads another CoinGecko.dll than what is produced when I download it from GitHub and compile it myself.

I hope this helps.

CoinGeckoError

15634-liberal-st-detroit-mi-48205
18900-mansfield-st-detroit-mi-48235
21vianet-group-inc
advisorshares-pure-cannabis-etf
allergan
alnylam-pharmaceuticals-inc
amundi
anarcheth
ansobit-token
bic-coin
bitcoinboss
bitflexo-native-token
blockplus
bmtoken
brick
catalent-inc
central-market
chipcoin
climarex-energy
cr-coin
cultural-heritage-token
darwinia-crab-network
deere
denchcoin
dico-coin
dowdupoint-inc
eastman-chemical
energous-corporation
equal
etoro-hong-kong-dollar
fivetoken
focus
friendcoin007
garmin-ltd
gluwacoin
gzclub-token
high-roi
hosting-token
idash
ietc
infinity-token
insolar-old
joint-admissions-chain
kapow
kellogg
lasercoin
lider-token
lordless-hops
mafer-token
magicneworld
mazecurrency
minanjo-token
moneyminerzshares
mongo-coin
moon
plumecoin
pnc-financial-servicecs-group
project-coin
qorvo-inc
rbcoin
resmed
secret
smartchain-protocol
sprint
steel-dynamics-inc
symantec-corp
take-two-interactive-software-inc
taurus-chain
tbtc
teradyne
texttron
thinkium
thomson-reuters
transfereuim
tripadvisor-inc
twilio-ci-a
ucolon-coin
under-armour-ci-a
wavesgames
wayfair-ci-a
weibo-corporation
weidai
whiting-petroleum
world-wide-web-coin
xilinx-inc
xpo-logistics
yandex
yelp
yyinc
zero-protocol-token
zom
15634-liberal-st-detroit-mi-48205
18900-mansfield-st-detroit-mi-48235
21vianet-group-inc
advisorshares-pure-cannabis-etf
allergan
alnylam-pharmaceuticals-inc
amundi
anarcheth
ansobit-token
bic-coin
bitcoinboss
bitflexo-native-token
blockplus
bmtoken
brick
catalent-inc
central-market
chipcoin
climarex-energy
cr-coin
cultural-heritage-token
darwinia-crab-network
deere
denchcoin
dico-coin
dowdupoint-inc
eastman-chemical
energous-corporation
equal
etoro-hong-kong-dollar
fivetoken
focus
friendcoin007
garmin-ltd
gluwacoin
gzclub-token
high-roi
hosting-token
idash
ietc
infinity-token
insolar-old
joint-admissions-chain
kapow
kellogg
lasercoin
lider-token
lordless-hops
mafer-token
magicneworld
mazecurrency
minanjo-token
moneyminerzshares
mongo-coin
moon
plumecoin
pnc-financial-servicecs-group
project-coin
qorvo-inc
rbcoin
resmed
secret
smartchain-protocol
sprint
steel-dynamics-inc
symantec-corp
take-two-interactive-software-inc
taurus-chain
tbtc
teradyne
texttron
thinkium
thomson-reuters
transfereuim
tripadvisor-inc
twilio-ci-a
ucolon-coin
under-armour-ci-a
wavesgames
wayfair-ci-a
weibo-corporation
weidai
whiting-petroleum
world-wide-web-coin
xilinx-inc
xpo-logistics
yandex
yelp
yyinc
zero-protocol-token
zom
15634-liberal-st-detroit-mi-48205
18900-mansfield-st-detroit-mi-48235
21vianet-group-inc
advisorshares-pure-cannabis-etf
allergan
alnylam-pharmaceuticals-inc
amundi
anarcheth
ansobit-token
bic-coin
bitcoinboss
bitflexo-native-token
blockplus
bmtoken
brick
catalent-inc
central-market
chipcoin
climarex-energy
cr-coin
cultural-heritage-token
darwinia-crab-network
deere
denchcoin
dico-coin
dowdupoint-inc
eastman-chemical
energous-corporation
equal
etoro-hong-kong-dollar
fivetoken
focus
friendcoin007
garmin-ltd
gluwacoin
gzclub-token
high-roi
hosting-token
idash
ietc
infinity-token
insolar-old
joint-admissions-chain
kapow
kellogg
lasercoin
lider-token
lordless-hops
mafer-token
magicneworld
mazecurrency
minanjo-token
moneyminerzshares
mongo-coin
moon
plumecoin
pnc-financial-servicecs-group
project-coin
qorvo-inc
rbcoin
resmed
secret
smartchain-protocol
sprint
steel-dynamics-inc
symantec-corp
take-two-interactive-software-inc
taurus-chain
tbtc
teradyne
texttron
thinkium
thomson-reuters
transfereuim
tripadvisor-inc
twilio-ci-a
ucolon-coin
under-armour-ci-a
wavesgames
wayfair-ci-a
weibo-corporation
weidai
whiting-petroleum
world-wide-web-coin
xilinx-inc
xpo-logistics
yandex
yelp
yyinc
zero-protocol-token
zom
15634-liberal-st-detroit-mi-48205
18900-mansfield-st-detroit-mi-48235
21vianet-group-inc
advisorshares-pure-cannabis-etf
allergan
alnylam-pharmaceuticals-inc
amundi
anarcheth
ansobit-token
bic-coin
bitcoinboss
bitflexo-native-token
blockplus
bmtoken
brick
catalent-inc
central-market
chipcoin
climarex-energy
cr-coin
cultural-heritage-token
darwinia-crab-network
deere
denchcoin
dico-coin
dowdupoint-inc
eastman-chemical
energous-corporation
equal
etoro-hong-kong-dollar
fivetoken
focus
friendcoin007
garmin-ltd
gluwacoin
gzclub-token
high-roi
hosting-token
idash
ietc
infinity-token
insolar-old
joint-admissions-chain
kapow
kellogg
lasercoin
lider-token
lordless-hops
mafer-token
magicneworld
mazecurrency
minanjo-token
moneyminerzshares
mongo-coin
moon
plumecoin
pnc-financial-servicecs-group
project-coin
qorvo-inc
rbcoin
resmed
secret
smartchain-protocol
sprint
steel-dynamics-inc
symantec-corp
take-two-interactive-software-inc
taurus-chain
tbtc
teradyne
texttron
thinkium
thomson-reuters
transfereuim
tripadvisor-inc
twilio-ci-a
ucolon-coin
under-armour-ci-a
wavesgames
wayfair-ci-a
weibo-corporation
weidai
whiting-petroleum
world-wide-web-coin
xilinx-inc
xpo-logistics
yandex
yelp
yyinc
zero-protocol-token
zom

Hi @otium99,

Thank you for detailed answer. I just published new version could you download it from Nuget?

Installed the version 1.3.2.0 through NuGet, tested "loopring" and a few other coins from the list and it works fine.

Thank you!