Polkadex-Substrate / Polkadex-Orderbook-Frontend

https://orderbook.polkadex.trade
3 stars 3 forks source link

Deposit/Withdraw Integration #1332

Closed ap211unitech closed 2 months ago

ap211unitech commented 2 months ago

📝 Description

We have already created packages for enabling direct deposits and withdrawal. Now, next task is to integrate them with UI so that direct deposits/withdrawal could be done from UI.

With Direct deposit, we can deposit tokens from any foreign chain to polkadex orderbook. With Direct withdraw, we can withdraw tokens from polkadex orderbook to any foreign chain.

Tasks -

Note -

CI is failing due to netlify issue. Build is successful.

image

Checklist

coderabbitai[bot] commented 2 months ago

[!IMPORTANT]

Review skipped

Review was skipped due to path filters

Files ignored due to path filters (1) * `yarn.lock` is excluded by `!**/yarn.lock`, `!**/*.lock`, `!**/*.lock`

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes primarily introduce and update functionality related to deposits, withdrawals, and asset management within the Hestia app. New components and hooks for handling direct deposit and withdrawal processes are added, while existing paths and import statements are updated to support these features. Several components are refined with state management and validation logic improvements to enhance user interactions and streamline transaction flows.

Changes

File(s) Change Summary
apps/.../send-and-receive/layout.tsx
apps/.../send-and-receive/page.tsx
Introduction of layout and page components for send-and-receive functionality.
apps/.../balances/Overview/index.tsx
apps/.../balances/Table/columns.tsx
apps/.../balances/Table/responsiveTable.tsx
Updated href paths and query parameters for deposit, withdrawal, and transfer actions.
apps/.../sendAndReceive/History/*.tsx Added, updated, and refined components related to transaction history, including filtering, exporting, and loading states.
apps/.../sendAndReceive/deposit/*.tsx
apps/.../sendAndReceive/withdraw/*.tsx
Introduction of new deposit and withdrawal components with enhanced form handling, transaction confirmations, and UI interactions.
apps/.../sendAndReceive/*.tsx Introduced utility components like FAQ, help, and select asset/network.
apps/.../ui/ConnectWallet/*.tsx
apps/.../ui/Footer/QuickStart/index.tsx
apps/.../ui/Header/fundWalletModal.tsx
Updated href paths and improved content for wallet connectivity, funding, and onboarding new users.
packages/.../core/providers/user/sendAndReceive/withdraw/*.tsx Added new provider components and hooks for managing withdrawal processes.
packages/.../core/providers/user/subscription/provider.tsx Modified notification logic for transaction types within subscription provider.
packages/.../core/validations/index.ts Added and updated validation logic for direct deposit and withdrawal processes.
apps/hestia/hooks/index.ts
packages/core/providers/index.ts
Exported new hooks and providers for direct deposit and withdrawal functionalities.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant HestiaApp
    participant DirectDepositProvider
    participant DirectWithdrawProvider

    User->>HestiaApp: Navigates to /send-and-receive
    HestiaApp->>DirectDepositProvider: Initialize DirectDepositProvider
    HestiaApp->>DirectWithdrawProvider: Initialize DirectWithdrawProvider

    User->>HestiaApp: Initiates Deposit
    HestiaApp->>DirectDepositProvider: Handle deposit transaction
    DirectDepositProvider->>User: Display deposit confirmation

    User->>HestiaApp: Initiates Withdrawal
    HestiaApp->>DirectWithdrawProvider: Handle withdrawal transaction
    DirectWithdrawProvider->>User: Display withdrawal confirmation

Poem

Amid the code in Hestia's heart,
Deposits and withdrawals now light the chart.
Paths are smoothed, transactions clear,
With added flows and logic dear.
A rabbit's joy in every byte,
🐇 In the code, the future's bright! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
netlify[bot] commented 2 months ago

Deploy Preview for stupendous-valkyrie-505e4a failed. Why did it fail? →

Name Link
Latest commit 0f5537872c577b00f87d9566780f5a7a7fbb06d7
Latest deploy log https://app.netlify.com/sites/stupendous-valkyrie-505e4a/deploys/6686c7fee1150f0008cb9639
ap211unitech commented 2 months ago

Screen.Recording.2024-06-26.at.05.58.05.mov @nuel77 @ap211unitech I can't withdraw

@minikas You should have DOT in AssetHub network. It will withdraw to AssetHub chain.

ap211unitech commented 2 months ago

Screen.Recording.2024-06-26.at.06.15.16.mov The MAX button works differently in withdraw and deposit.

@minikas What is the issue here ? It's working as expected.

ap211unitech commented 2 months ago

Screen.Recording.2024-06-26.at.06.23.46.mov @ap211unitech Please reset the form when switching networks & assets

@minikas This is added now.

minikas commented 2 months ago

Screen.Recording.2024-06-26.at.05.58.05.mov @nuel77 @ap211unitech I can't withdraw

@minikas You should have DOT in AssetHub network. It will withdraw to AssetHub chain.

Screen.Recording.2024-06-26.at.05.58.05.mov @nuel77 @ap211unitech I can't withdraw

@minikas You should have DOT in AssetHub network. It will withdraw to AssetHub chain.

@ap211unitech DOT to pay the fee or for existential purposes, or exactly why? @nuel77 Shouldn't we inform the user about this (maybe a component with this kind of information)?

ap211unitech commented 2 months ago

Screen.Recording.2024-06-26.at.05.58.05.mov @nuel77 @ap211unitech I can't withdraw

@minikas You should have DOT in AssetHub network. It will withdraw to AssetHub chain.

Screen.Recording.2024-06-26.at.05.58.05.mov @nuel77 @ap211unitech I can't withdraw

@minikas You should have DOT in AssetHub network. It will withdraw to AssetHub chain.

@ap211unitech DOT to pay the fee or for existential purposes, or exactly why? @nuel77 Shouldn't we inform the user about this (maybe a component with this kind of information)?

@minikas Whenever we do a bridge transfer, Destionation account must have existential amount in destination chain else bridge ttransfer will fail.