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: add transfer flow #26

Merged
merged 6 commits into from
Dec 22, 2023
Merged

Feat: add transfer flow #26

merged 6 commits into from
Dec 22, 2023

Conversation

sokolova-an
Copy link
Contributor

  • 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

@sokolova-an sokolova-an requested a review from ERussel December 21, 2023 12:27
src/common/utils/address.ts Outdated Show resolved Hide resolved
const decoded = base58Decode(address);
if (!ADDRESS_ALLOWED_ENCODED_LENGTHS.includes(decoded.length)) return false;

const [isValid, endPos, ss58Length] = checkAddressChecksum(decoded);
Copy link
Contributor

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?

Copy link
Contributor Author

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

src/screens/transfer/amount/amount.tsx Outdated Show resolved Hide resolved
// should we round it more?
const max = Math.max(formattedBalance - fee, 0);
setMaxAmountToSend(max);
setSelectedAsset((prev) => ({ ...prev!, fee }));
Copy link
Contributor

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?

Copy link
Contributor Author

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably forgot to uncomment

Copy link
Contributor Author

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?

@sokolova-an sokolova-an merged commit ff17451 into main Dec 22, 2023
@sokolova-an sokolova-an deleted the feat/transfer-flow branch December 22, 2023 13:52
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