(Solved) incognito-cli checking a fractional balance

Hi,

I’m using the cli utility to check the balance of an address.

./incognito-cli balance --privateKey [redacted] --tokenID 0000000000000000000000000000000000000000000000000000000000000004

I know (from the mobile app) that there is around 0.43 PRV in my address.
However the output I get is:

0

What can I do to get the full balance?
Also I have submitted by OTA Key before running the balance operation.

1 Like

You should have submitted the key before your “first” tx, not balance operation.

Hi @m-mp,

Have you submitted the OTA key using the CLI tool? And what submission mode did you use (with or without access token)?

I tried balance before that however I always got:

RPC returns an error: &{-4005 List Output Coins By Key Error -4005: OTA Key {...} not synced

Yes, I did:

./incognito-cli sub --otaKey [OTA KEY FROM APP]

This way, you are doing the regular submission, which will not cache output coins before the submission time frame.

Yes, @abduraman is correct. If you use the regular cache, then you have to submit the OTA key before the first receiving transaction. Otherwise, you have to use the enhanced mode, which requires an access token. You can use this token 0ec910a54ffbf2a0bdfc0c8b05e8b5445e51a2ae54f659a35ac7ad9980e4fd2c (with the community host: https://beta-fullnode.incognito.org/fullnode) for the CLI tool. So the example submission command should be:

./incognito-cli --host https://beta-fullnode.incognito.org/fullnode sub --otaKey [YOUR OTA KEY] --accessToken 0ec910a54ffbf2a0bdfc0c8b05e8b5445e51a2ae54f659a35ac7ad9980e4fd2c

It will take a while for the outputs to be fully synced. After that, you’re able to retrieve your balance.

1 Like

There’ll be a release next week with new features, and of course the community full-node will be used as the default full-node of the CLI tool. Right now, add --host https://beta-fullnode.incognito.org/fullnode before any command to make sure the tool will work with best results.

1 Like

Alright thanks this kinda worked.
I first run this with a --isReset true appended, because it failed without it.

Then made another incoming tx to my address and now the balance is the size of that latest tx.

However I still can’t get the full balance.

Do I have to wait like you mentioned for the older txs to show up?

Did you use the community node or the default one? Depend on the full-node performance, if you submit the OTA key properly, it’s gonna take about less than an hour for the full balance to be updated.

And be aware that you must check the balance within the same full-node that you submitted your key. In the case of the community node, try

./incognito-cli --host https://beta-fullnode.incognito.org/fullnode balance ......
1 Like

And be aware that you must check the balance within the same full-node that you submitted your key.

My apologies, I forgot about that and just reused the balance call from earlier.

I’ve got the full balance showing up now, thanks a lot. Works as intended.

3 Likes

Hi @m-mp…welcome to the community… :smiley: …and well I hope your issue was successfully resolved… :sunglasses:

I undated all my apps from my play store earlier not knowing my incognito wallet needed an update. I am trying to send some of my bitcoin to my cash app but I can’t even find my bitcoin anymore. I see there is a convert coins button at belive my balances might be in there but I am clueless as to what this is and how to get my bitcoin out or back.

Hello @Gaygeekedgangster,

If you go into your wallet (assets tab) (where you previously had your BTC stored) there should be a black bar at the bottom indicating you need to convert to v2. Click this bar. On the next page it will show your assets (you should see your BTC v1 coins). Click the convert button.

Thats about it. Oh and please make sure you have a small amount of PRV in your wallet to cover the network fees. You can use the faucet on the home screen to get some.