Discussions
Wrong data returned from the ankr_getAccountBalance
Hello,
the ankr_getAccountBalance function keeps returning outdated data, i tried multiple addresses, all the data returned is old.
is there a plan to fix it, or we need to lookup for another API.
Thanks
Posted by null 5 months ago
how to foce sync on requests? all my data is old (-18hours, -4 days) etc
Im using ankr but i have started to feel like they're going backwards.
I am trying to make simple calls to get users balances of tokens on many chains but when i do so, recently, the indexer is always delayed / behind by a big chunk.
this is useless to me if it's the wrong data being provided...
surely there's a way to force sync the results so its 100% accurate instead of a 50 50 guess...
no happy at the moment but hopefully they can get it fixed
Posted by Jonathan Maroe 5 months ago
Getting ERC-20 token balances on testnets
I'm hoping to use the Advanced API to get balances for ERC-20 tokens. But when I tried it with the Avalanche Fuji and Polygon Mumbai testnets, calling `ankr_getAccountBalance` only shows the native token for each chain. And calling `ankr_getCurrencies` always returns `null` for both chains. e.g.
```json json
{
"jsonrpc": "2.0",
"method": "ankr_getCurrencies",
"params": {
"blockchain": "avalanche_fuji"
},
"id": 2
}
```
returns
```json
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"currencies": null,
"syncStatus": {
"timestamp": 0,
"lag": "-0s",
"status": "synced"
}
}
}
```
Am I missing something, or are ERC-20 tokens only supported on mainnet chains?
Posted by null 6 months ago
API returns error "we can't execute this request"
```Text json
{
"jsonrpc": "2.0",
"error": {
"code": 0,
"message": "we can't execute this request"
},
"id": null
}
```
<br>
I am using Ankr pro API. I tried with both SDK and Curl. The problem seems to be caused by your API server
Posted by Jane 6 months ago
ankr_getAccountBalance returns wrong ETH price in chain optimism
I tried to run this ankr_getAccountBalance method for get account balance in optimism chain but got wrong ETH price in the result
```curl
curl --request POST \
--url 'https://rpc.ankr.com/multichain/79258ce7f7ee046decc3b5292a24eb4bf7c910d7e39b691384c7ce0cfb839a01/?ankr_getAccountBalance=' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "ankr_getAccountBalance",
"params": {
"blockchain": [
"optimism"
],
"walletAddress": "0x8D53B8DEad212d0D6a5Eb42FcB2E7ae02135bBE6"
},
"id": 1
}
'
```
This is result returned
```curl
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"totalBalanceUsd": "3.079760680144404025",
"totalCount": 1,
"assets": [
{
"blockchain": "optimism",
"tokenName": "Ether",
"tokenSymbol": "ETH",
"tokenDecimals": 18,
"tokenType": "NATIVE",
"holderAddress": "0x8d53b8dead212d0d6a5eb42fcb2e7ae02135bbe6",
"balance": "0.00089391",
"balanceRawInteger": "893910000000000",
"balanceUsd": "3.079760680144404025",
"tokenPrice": "3.928929827952243552",
"thumbnail": "https://ankrscan.io/assets/blockchains/eth.svg"
}
],
"syncStatus": {
"timestamp": 1711506603,
"lag": "-54s",
"status": "synced"
}
}
}
```
As you can see the field "tokenPrice": "3.928929827952243552", its a wrong ETH price, the correct ETH price should be 3599 at this request time (you can check it here <https://gyazo.com/f700b3d1fa72f39938b0c681a00d38d3>)
Posted by amm 7 months ago
Is it impossible to get earlier price data?
Hi,
I get price data using a request
POST <https://rpc.ankr.com/multichain/79258ce7f7ee046decc3b5292a24eb4bf7c910d7e39b691384c7ce0cfb839a01>
req:
{"id":1,"jsonrpc":"2.0","method":"ankr_getTokenPriceHistory","params":{"blockchain":"eth","contractAddress":"0xB8c77482e45F1F44dE1745F52C74426C631bDD52", "interval":86400, "limit":1000}}
In response, I receive data for at least 1684320971 to the current time. Is it possible to get earlier data than 1684320971?
Posted by Vlad G 9 months ago
ankr_getTokenTransfers
pageToken 参数的详解
Posted by w 11 months ago
The ankr_getCurrencies method return null
When i set the blockchain for base, zksync_era, polygon_zkevm. The http response return currencies is null
pls help me. and btw, does have a plan to support linea chain?
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"currencies": null
}
}
Posted by Fury about 1 year ago
ankr_getTokenPriceHistory returns empty
I am getting no results for many tokens that I tried to get the historical token price
Request
```
{
"jsonrpc": "2.0",
"method": "ankr_getTokenPriceHistory",
"params": {
"blockchain": "eth",
"contractAddress": "0x85F17Cf997934a597031b2E18a9aB6ebD4B9f6a4",
"fromTimestamp": 1673164570
},
"id": 34234
}
```
REsponse:
```
{
"jsonrpc": "2.0",
"id": 34234,
"result": {
"quotes": []
}
}
```
Kindly provide a solution for that
Posted by Abid Jamal about 1 year ago
what is the way show me all transactions internal by my address?
i cant see any api to get all transactions internal by my address, let me know the way to get it.
Posted by Dustin about 1 year ago