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

fix: keystone approvals, bridge amount too low, spend approval dollar value #85

Merged
merged 4 commits into from
Nov 6, 2024

Conversation

meeh0w
Copy link
Member

@meeh0w meeh0w commented Nov 6, 2024

@@ -212,7 +212,7 @@ export const BridgeForm = ({
const [neededGas, setNeededGas] = useState(0n);

useEffect(() => {
if (minimum && amount.lt(minimum)) {
if (minimum && amount.gt(0) && amount.lt(minimum)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Don't show the "Amount is too low" error if amount is 0

return await this.#walletService.sign(
signingData.data,
network,
action.tabId
Copy link
Member Author

Choose a reason for hiding this comment

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

Pass tabId, so the signature request can later be paired with the window that initiated the request

(diffItemValue as TokenUnit).toDisplay({ asNumber: true }) *
Number(approval.usdPrice)
),
usdPrice: approval.usdPrice,
Copy link
Member Author

@meeh0w meeh0w Nov 6, 2024

Choose a reason for hiding this comment

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

This was being multiplied unnecessarily - I thought usdPrice is the price of a single token here, but it's the USD value of the whole approval.

@meeh0w meeh0w merged commit b2c65b2 into main Nov 6, 2024
5 of 6 checks passed
@meeh0w meeh0w deleted the fix/blue-fixes branch November 6, 2024 20:35
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