Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(balance): adding forced balance update by the contract address #655

Merged
merged 2 commits into from
May 20, 2024

Conversation

geekbrother
Copy link
Contributor

@geekbrother geekbrother commented May 14, 2024

Description

This PR adds a forced balance update for a certain token by passing the ERC-20 token contract address.

According to the SPEC the optional forceUpdate argument can be passed to the /balance endpoint with the list of token contract addresses (CAIP-10) to force the balance update by invoking the RPC call to the contract and overriding the balance response from Zerion for certain tokens contract addresses.

This improvement is useful to live update the balance at the UI when making token swaps or on-ramp payments by bypassing Zerion's cached balances.

How Has This Been Tested?

Due Diligence

  • Breaking change
  • Requires a documentation update
  • Requires a e2e/integration test update

@geekbrother geekbrother self-assigned this May 14, 2024
]"#,
);

let provider = Provider::<Http>::try_from(format!(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be refactored in a followup to use the SelfProvider and direct rpc calls, like in #649

@geekbrother geekbrother marked this pull request as ready for review May 14, 2024 21:30
src/utils/crypto.rs Outdated Show resolved Hide resolved
@geekbrother geekbrother force-pushed the feat/invalidating_balance_cache branch from 965d110 to 45bf830 Compare May 20, 2024 12:06
@geekbrother geekbrother merged commit e4f1168 into master May 20, 2024
23 checks passed
@geekbrother geekbrother deleted the feat/invalidating_balance_cache branch May 20, 2024 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants