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(frontend): add ATA creation fee to the Solana send flow #4358

Conversation

AntonioVentilii
Copy link
Collaborator

Motivation

If a Solana address does not have a correspondent Associated Token Account (ATA) for the sending token, OISY will add the instructions to create one. However, this costs money, so it is useful to show it to the user.

Changes

  • Add optional prop to SolFeeDisplay to turn on or off the ATA fee.
  • Add html component to show the ATA fee if required/needed.
  • Calculate the fee refreshing for any change of the prop.

Tests

The complete flow is:

Screen.Recording.2025-01-20.at.23.29.33.mov

@AntonioVentilii AntonioVentilii requested a review from a team as a code owner January 20, 2025 22:37
@AntonioVentilii AntonioVentilii marked this pull request as draft January 20, 2025 22:40
})
);

ataFee = showAtaFee ? await getSolCreateAccountFee(solNetwork) : undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

Now it can be just ataFee = await getSolCreateAccountFee(solNetwork) 🙂

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

right!

Copy link
Contributor

@DenysKarmazynDFINITY DenysKarmazynDFINITY left a comment

Choose a reason for hiding this comment

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

Please take a look at my latest comment, we can simplify one more thing.

LGTM, thanks.

@AntonioVentilii AntonioVentilii enabled auto-merge (squash) January 21, 2025 12:56
@AntonioVentilii AntonioVentilii merged commit 77c8e7a into main Jan 21, 2025
22 checks passed
@AntonioVentilii AntonioVentilii deleted the feat(frontend)/add-ATA-creation-fee-to-the-Solana-send-flow branch January 21, 2025 16:50
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.

2 participants