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

Cex withdraw #301

Merged
merged 6 commits into from
Feb 17, 2024
Merged

Cex withdraw #301

merged 6 commits into from
Feb 17, 2024

Conversation

rosepuppy
Copy link
Contributor

Screen.Recording.2024-02-13.at.10.09.47.PM.mov

depends on dydxprotocol/v4-abacus#220 and dydxprotocol/v4-localization#273


Views

  • src/views/dialogs/DepositDialog.tsx

    • Do not close dialog on deposit
  • src/views/dialogs/OnboardingDialog.tsx

    • Pipe the eventData for DepositForm
  • src/views/dialogs/DepositDialog/DepositDialogContent.tsx

    • Turns out we were not tracking deposit events on this entry point D:
  • src/views/forms/AccountManagementForms/DepositForm.tsx

    • Moved onDeposit callback to after notifaction is added, to ensure notification being added.
  • src/views/forms/AccountManagementForms/TokenSelectMenu.tsx

    • Hide receipt and search if Exchange is selected
  • src/views/forms/AccountManagementForms/WithdrawForm.tsx

    • Update token and network select menus to support exchanges
    • add tracking events here
    • Update status notification to indicate exchange
  • src/views/forms/AccountManagementForms/WithdrawForm/WithdrawButtonAndReceipt.tsx

    • Hide exchange rate and slippage fields for exchange option
  • src/views/forms/NobleDeposit.tsx

    • Updated according to design
    • hide QR unless acknowledged
    • TODO: add header subtitle text
  • src/views/notifications/TransferStatusNotification/index.tsx

    • assume notification status is completed for exchange withdraws.

Components

  • src/components/SearchSelectMenu.tsx

    • remove --stickyArea1-topHeight if withSearch is false, since you won't want to make room for the search input
  • src/components/TimeoutButton.tsx

    • Add onTimeout callback

Constants/Types

  • src/constants/analytics.ts
    • Track chain and asset type for Deposit and Withdraws

Functions

  • src/lib/addressUtils.ts
    • Add function to validate cosmos address

Hooks

  • src/hooks/useLocalNotifications.tsx
  • src/hooks/useNotificationTypes.tsx
    • Do not fetch for squid status if this is an exchange notification. Assume it is already completed. Since the notification is triggered after exchange withdraw Transaction is already completed.

Packages

  • Updated abacus and v4-localization

Copy link

vercel bot commented Feb 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
v4-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 17, 2024 1:55am
v4-testnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 17, 2024 1:55am

Comment on lines +35 to +46
export function validateCosmosAddress(address: string, prefix: string) {
try {
// Decode the address to verify its structure and prefix
const { prefix: decodedPrefix } = fromBech32(address);

// Check if the decoded address has the expected prefix
return decodedPrefix === prefix;
} catch (error) {
// If decoding fails, the address is not valid
return false;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

good candidate to add to tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants