-
Notifications
You must be signed in to change notification settings - Fork 1
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: add transfer flow #26
Conversation
sokolova-an
commented
Dec 21, 2023
- Add confirmation and result pages
- Add address validation
- Add fee calculation
- Add amount validation (disabled for now for the test purpose)
- Add callbacks for MainButton and BackButton
const decoded = base58Decode(address); | ||
if (!ADDRESS_ALLOWED_ENCODED_LENGTHS.includes(decoded.length)) return false; | ||
|
||
const [isValid, endPos, ss58Length] = checkAddressChecksum(decoded); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you, please, clarify what result is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a function from Spectr, in the end, this function will return whether the Address is valid or not
// should we round it more? | ||
const max = Math.max(formattedBalance - fee, 0); | ||
setMaxAmountToSend(max); | ||
setSelectedAsset((prev) => ({ ...prev!, fee })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to save fee to the context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we use it on the next screen (confirmation)
// commented validation for the test purpose | ||
// TODO: uncomment it | ||
|
||
// if (!isAmountValid || !Number(amount)) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably forgot to uncomment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think to leave it this way for now since we don't have a receive flow yet
what do you think?