You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These do not have a uniform interface, and differ per provider.
There is also no cross-ecosystem standardized way for fetching balances. For EVM, Cosmos, and Move we have different methods of fetching balances.
We currently handle all of these in the frontend, but this has several disadvantages:
When working with the TypeScript SDK and GraphQL API, devs do not have access to this core functionality.
Because the logic of fetching these balances happens on the frontend, we have no way of monitoring and alerting if requests are successful (they frequently broke on testnet-8)
The frontend needs to write adapters for different kind of responses and make them uniform across ecosystems, something that's better done on the backend
if the app user has a slow internet connection, then the loop of "try provider 1, if it does not work, go to provider 2" is slow.
Solution
We move this logic into a simple Rust service that we can monitor.
Problem
There is no standardized way to fetch balances from chains for assets. For EVM assets, there are multiple custom APIs that are extensions of normal RPC endpoints: https://github.com/unionlabs/union/blob/main/app/src/lib/queries/balance/index.ts
These do not have a uniform interface, and differ per provider.
There is also no cross-ecosystem standardized way for fetching balances. For EVM, Cosmos, and Move we have different methods of fetching balances.
We currently handle all of these in the frontend, but this has several disadvantages:
Solution
We move this logic into a simple Rust service that we can monitor.
The api will be something like
GET /balances/<chain_id>/<address>
and return
[ { denom: 0xabc..., amount: 140n, decimals: 18, symbols: 4n, supported: true } ]
in a uniform manner, regardless of execution environment and underlying provider used.
Optionally, we can add a batch request
GET /all_balances/<evm_address>/<cosmos_address>/<move_address>
to in 1 request get all sendable balances.
Hasura integration for v2
Through hasuras remote schemas this can be directly integrated into graphql.union.buid
The text was updated successfully, but these errors were encountered: