web icon indicating copy to clipboard operation
web copied to clipboard

Automatic account detection

Open 0xApotheosis opened this issue 3 years ago • 3 comments

Overview

When a user connects a wallet we want to automatically detect and populate those accounts with a balance.

References and additional details

We want to be efficient with the way we check for accounts.

Options might include always checking the first 3 accounts for a balance in batch, and then only checking for additional accounts if account 3 has a balance.

Another option might be to sequentially check one by one until we hit an account with no balance, though I suspect it'll be more efficient to check in batches initially, and then sequentially check the long-tail, or something.

We'll likely also use a heuristic that says if an account is empty the next account likely is two.

Acceptance Criteria

All accounts with a balance get populated.

Need By Date

No response

Screenshots/Mockups

No response

Estimated effort

No response

0xApotheosis avatar Aug 23 '22 21:08 0xApotheosis

{
  "balance": "0",
  "unconfirmedBalance": "0",
  "nonce": 0,
  "pubkey": "0x41b4D81dD40c6c91d21f686Bb0596E37e4C8cb90",
  "tokens": []
}

if (balance === '0' && nonce === '0' && tokens.length === 0) we have an unused account - no need to call unchained for tx history

0xdef1cafe avatar Aug 23 '22 22:08 0xdef1cafe

0x41b4D81dD40c6c91d21f686Bb0596E37e4C8cb90 empty address at https://api.ethereum.shapeshift.com/docs/#/v1/GetAccount

0xdef1cafe avatar Aug 23 '22 22:08 0xdef1cafe

blocked by https://github.com/shapeshift/web/issues/2882 - granular tx loading status will help with this immensely

0xdef1cafe avatar Oct 17 '22 19:10 0xdef1cafe