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

Direct Deposit & Withdrawal #295

Merged
merged 17 commits into from
Jun 19, 2024
Merged

Direct Deposit & Withdrawal #295

merged 17 commits into from
Jun 19, 2024

Conversation

ap211unitech
Copy link
Member

@ap211unitech ap211unitech commented Jun 17, 2024

Description

  1. Allow direct deposit in the extrinsic.
  2. Created helper function for returning direct withdrawal multilocation

Summary by CodeRabbit

  • New Features

    • Introduced direct deposit functionality in the app.
  • Updates

    • Changed source chain from "Polkadex" to "Interlay".
    • Changed destination chain from "AssetHub" to "Polkadex".
    • Updated selected asset from "USDT" to "vDOT".
    • Enhanced asset querying and transfer handling.
  • Improvements

    • Added optional isDirectTransfer parameter for more flexible asset transfers across multiple chains.

Copy link

changeset-bot bot commented Jun 17, 2024

🦋 Changeset detected

Latest commit: b11bace

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@polkadex/thea Major
@polkadex/cross-chain Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

coderabbitai bot commented Jun 17, 2024

Walkthrough

In this update, significant changes were made to the PolkadotEco component and several modules within the @polkadex/thea SDK. These changes primarily involve updating chain and asset configurations, improving asset transfer functionality, and introducing direct deposit functionality for specific chains. The updates aim to enhance cross-chain asset handling and implement new features for seamless user experience across different blockchains.

Changes

File(s) Summary
apps/cross-chain/app/components/polkadotEco.tsx Updated source and destination chains, selected asset, revised balance queries and transfer handling, and added doDirectDeposit function for direct deposits.
packages/thea/src/sdk/helpers.ts Added imports (AccountId32, Chain, getSubstrateChain) and introduced getDirectWithdrawalMultilocation function.
packages/thea/src/sdk/substrate/* For astar.ts, bifrost.ts, interlay.ts, moonbeam.ts, phala.ts, polkadot.ts, unique.ts: Added isDirectTransfer parameter to transfer methods.
packages/thea/src/sdk/substrate/assetHub.ts Added isDirectTransfer parameter to transferAsset method signature.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PolkadotEco
    participant PolkadexApi
    participant InterlayApi

    User->>PolkadotEco: Initiate direct deposit
    PolkadotEco->>PolkadexApi: Query balance
    PolkadotEco->>InterlayApi: Initiate direct deposit transaction
    InterlayApi->>PolkadotEco: Confirmation of deposit
    PolkadotEco->>User: Notify deposit success
Loading

Possibly related issues

Poem

In the heart of chains, assets now flow,
From Interlay to Polkadex, new paths we bestow.
vDOTs dance in wallets, seamless and swift,
With direct deposits, a seamless gift.
Through code our journey, cross-chain's cheer,
For every rabbit, innovation is here.


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
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • 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 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 for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

Outside diff range and nitpick comments (5)
packages/thea/src/config/substrate/builders/pallets/polkadotXcm.utils.ts (1)

24-38: Consider adding documentation for the isDirectTransfer parameter in the toBeneficiary function.

Adding parameter documentation can enhance readability and maintainability, especially for developers unfamiliar with the codebase or the specific functionality of isDirectTransfer.

apps/cross-chain/app/components/polkadotEco.tsx (1)

7-9: Update documentation to reflect the changes in constants for SOURCE_CHAIN, DESTINATION_CHAIN, and SELECTED_ASSET.

Documenting these changes can help maintain clarity about the purpose and usage of these constants, especially if they are central to the functionality of the component.

packages/thea/src/sdk/substrate/interlay.ts (1)

[!TIP]
Codebase Verification

The isDirectTransfer parameter is declared as an optional boolean and is used without validation. To prevent potential runtime errors, consider adding validation to ensure it receives a boolean value.

  • File: packages/thea/src/sdk/substrate/interlay.ts
  • Lines: 87-94
Analysis chain

Line range hint 90-215: Ensure proper validation and error handling for the isDirectTransfer parameter.

While the code correctly uses the isDirectTransfer parameter, adding validation or checks to ensure it receives a boolean value can prevent runtime errors and ensure more robust code.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check if 'isDirectTransfer' is validated before use in the 'getTransferConfig' method.

# Test: Search for validation logic. Expect: Validation checks for 'isDirectTransfer'.
rg --type ts $'isDirectTransfer' src/sdk/substrate/interlay.ts

Length of output: 131



Script:

#!/bin/bash
# Locate the correct path for `interlay.ts`.
fd interlay.ts

Length of output: 150



Script:

#!/bin/bash
# Description: Check if 'isDirectTransfer' is validated before use in the 'getTransferConfig' method.

# Test: Search for validation logic. Expect: Validation checks for 'isDirectTransfer'.
rg --type ts 'isDirectTransfer' packages/thea/src/sdk/substrate/interlay.ts

Length of output: 134

packages/thea/src/sdk/substrate/phala.ts (1)

Line range hint 88-209: Consider adding detailed documentation for the isDirectTransfer parameter to explain its impact on the transfer process.

Adding detailed comments in the code about how the isDirectTransfer parameter affects the transfer logic would be beneficial for future maintainers or developers interfacing with this SDK.

packages/thea/src/sdk/substrate/polkadex.ts (1)

[!TIP]
Codebase Verification

The integration of the isDirectTransfer parameter in the getTransferConfig method is not consistent across all usages. Some instances correctly pass the isDirectTransfer parameter, while others do not.

  • File: packages/thea/src/direct/index.ts
    • isDirectTransfer is passed correctly.
  • File: packages/thea/src/sdk/types.ts
    • The method signature includes isDirectTransfer.
  • File: packages/thea/src/sdk/substrate/unique.ts
    • The method includes isDirectTransfer in the signature.
  • File: packages/thea/src/sdk/substrate/polkadot.ts
    • The method includes isDirectTransfer in the signature.
  • File: packages/thea/src/sdk/evm/sepolia.ts
    • isDirectTransfer is missing in the method call.
  • File: apps/cross-chain/app/components/polkadotEco.tsx
    • isDirectTransfer is missing in the method call.
  • File: apps/cross-chain/app/components/ethereumEco.tsx
    • isDirectTransfer is missing in the method call.

Please ensure that all instances of getTransferConfig correctly pass the isDirectTransfer parameter where necessary.

  • File: packages/thea/src/sdk/evm/sepolia.ts
  • File: apps/cross-chain/app/components/polkadotEco.tsx
  • File: apps/cross-chain/app/components/ethereumEco.tsx
Analysis chain

Line range hint 90-218: The addition of isDirectTransfer parameter is well-integrated into the getTransferConfig method. Ensure that all dependent components correctly handle this new parameter.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify integration of `isDirectTransfer` with other components.

# Test: Search for usage of `getTransferConfig` to ensure correct passing of `isDirectTransfer`.
rg --type python $'getTransferConfig'

Length of output: 67



Script:

#!/bin/bash
# Description: Verify integration of `isDirectTransfer` with other components.

# Test: Search for usage of `getTransferConfig` to ensure correct passing of `isDirectTransfer`.
rg --type js 'getTransferConfig'

Length of output: 32



Script:

#!/bin/bash
# Description: Verify integration of `isDirectTransfer` with other components.

# Test: Search for usage of `getTransferConfig` to ensure correct passing of `isDirectTransfer`.
rg --type js,ts 'getTransferConfig'

Length of output: 65



Script:

#!/bin/bash
# Description: Verify integration of `isDirectTransfer` with other components.

# Test: Search for usage of `getTransferConfig` to ensure correct passing of `isDirectTransfer`.
rg --type-add 'js:*.{js,jsx,ts,tsx}' 'getTransferConfig'

Length of output: 1139



Script:

#!/bin/bash
# Description: Extract lines around `getTransferConfig` to check for `isDirectTransfer` parameter integration.

# Files to inspect
files=(
  "packages/thea/src/direct/index.ts"
  "packages/thea/src/sdk/types.ts"
  "packages/thea/src/sdk/substrate/unique.ts"
  "packages/thea/src/sdk/substrate/polkadot.ts"
  "packages/thea/src/sdk/evm/sepolia.ts"
  "packages/thea/src/sdk/substrate/polkadex.ts"
  "packages/thea/src/sdk/substrate/phala.ts"
  "packages/thea/src/sdk/substrate/moonbeam.ts"
  "packages/thea/src/sdk/substrate/bifrost.ts"
  "packages/thea/src/sdk/substrate/astar.ts"
  "packages/thea/src/sdk/substrate/interlay.ts"
  "packages/thea/src/sdk/substrate/assetHub.ts"
  "apps/cross-chain/app/components/polkadotEco.tsx"
  "apps/cross-chain/app/components/ethereumEco.tsx"
)

# Extract lines around `getTransferConfig` usage
for file in "${files[@]}"; do
  echo "File: $file"
  rg -A 5 -B 5 'getTransferConfig' "$file"
done

Length of output: 6932

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f6f994a and d191a86.

Files selected for processing (23)
  • apps/cross-chain/app/components/polkadotEco.tsx (4 hunks)
  • packages/thea/src/config/substrate/builders/pallets/polkadotXcm.ts (4 hunks)
  • packages/thea/src/config/substrate/builders/pallets/polkadotXcm.utils.ts (1 hunks)
  • packages/thea/src/config/substrate/builders/pallets/xTokens.ts (5 hunks)
  • packages/thea/src/config/substrate/builders/pallets/xTokens.utils.ts (2 hunks)
  • packages/thea/src/config/substrate/builders/pallets/xTransfer.ts (2 hunks)
  • packages/thea/src/config/substrate/builders/pallets/xTransfer.utils.ts (1 hunks)
  • packages/thea/src/config/substrate/builders/pallets/xcmPallet.ts (2 hunks)
  • packages/thea/src/config/substrate/builders/pallets/xcmPallet.utils.ts (1 hunks)
  • packages/thea/src/config/substrate/index.ts (1 hunks)
  • packages/thea/src/config/substrate/types.ts (1 hunks)
  • packages/thea/src/direct/index.ts (1 hunks)
  • packages/thea/src/index.ts (1 hunks)
  • packages/thea/src/sdk/substrate/assetHub.ts (3 hunks)
  • packages/thea/src/sdk/substrate/astar.ts (3 hunks)
  • packages/thea/src/sdk/substrate/bifrost.ts (3 hunks)
  • packages/thea/src/sdk/substrate/interlay.ts (3 hunks)
  • packages/thea/src/sdk/substrate/moonbeam.ts (3 hunks)
  • packages/thea/src/sdk/substrate/phala.ts (3 hunks)
  • packages/thea/src/sdk/substrate/polkadex.ts (3 hunks)
  • packages/thea/src/sdk/substrate/polkadot.ts (3 hunks)
  • packages/thea/src/sdk/substrate/unique.ts (3 hunks)
  • packages/thea/src/sdk/types.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • packages/thea/src/config/substrate/index.ts
Additional context used
Biome
apps/cross-chain/app/components/polkadotEco.tsx

[error] 132-135: Provide an explicit type prop for the button element. (lint/a11y/useButtonType)

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset


[error] 138-141: Provide an explicit type prop for the button element. (lint/a11y/useButtonType)

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset


[error] 144-147: Provide an explicit type prop for the button element. (lint/a11y/useButtonType)

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

Additional comments not posted (17)
packages/thea/src/index.ts (1)

4-4: Export statement for direct deposit module added correctly.

packages/thea/src/config/substrate/types.ts (1)

1-5: Type definition for handling direct deposit scenarios is correctly added.

packages/thea/src/config/substrate/builders/pallets/xcmPallet.utils.ts (1)

15-29: The addition of isDirectTransfer to handle direct transfers is well-implemented. Consider adding a more specific type for the account parameter to enhance type safety.

packages/thea/src/config/substrate/builders/pallets/xTransfer.ts (1)

Line range hint 16-36: The refactoring to use ExtrinsicConfigBuilderParams enhances flexibility and maintainability. Consider adding error handling or defaults for potentially undefined values in args.

packages/thea/src/config/substrate/builders/pallets/xTokens.utils.ts (1)

Line range hint 7-37: The changes to support direct transfers in the toDest function are correctly implemented. Adding comments to explain the handling of different chain keys and the direct transfer logic would improve readability and maintainability.

packages/thea/src/sdk/types.ts (1)

42-43: The addition of isDirectTransfer to getTransferConfig is correctly implemented and aligns with the functionality introduced across the codebase.

packages/thea/src/config/substrate/builders/pallets/polkadotXcm.ts (1)

Line range hint 37-93: Ensure consistent handling of isDirectTransfer across different asset transfer configurations.

This verification is crucial to maintain the integrity of the feature across different modules.

Verification successful

The search results indicate that isDirectTransfer is used consistently across multiple files and configurations. The presence of this parameter in various contexts suggests that it is handled uniformly.

  • Files and lines with isDirectTransfer usage:
    • packages/thea/src/sdk/types.ts
    • packages/thea/src/sdk/substrate/bifrost.ts
    • packages/thea/src/config/substrate/types.ts
    • packages/thea/src/sdk/substrate/unique.ts
    • packages/thea/src/config/substrate/builders/pallets/xcmPallet.utils.ts
    • packages/thea/src/config/substrate/builders/pallets/xTransfer.utils.ts
    • packages/thea/src/config/substrate/builders/pallets/xTransfer.ts
    • packages/thea/src/config/substrate/builders/pallets/xcmPallet.ts
    • packages/thea/src/config/substrate/builders/pallets/xTokens.ts
    • packages/thea/src/config/substrate/builders/pallets/polkadotXcm.ts
    • packages/thea/src/config/substrate/builders/pallets/polkadotXcm.utils.ts
    • packages/thea/src/sdk/substrate/polkadot.ts
    • packages/thea/src/sdk/substrate/moonbeam.ts
    • packages/thea/src/sdk/substrate/polkadex.ts
    • packages/thea/src/sdk/substrate/interlay.ts
    • packages/thea/src/sdk/substrate/astar.ts
    • packages/thea/src/sdk/substrate/phala.ts
    • packages/thea/src/sdk/substrate/assetHub.ts

Given the extensive and consistent usage of isDirectTransfer across the codebase, the concern regarding its consistent handling is verified.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that `isDirectTransfer` is used consistently across all configurations.

# Test: Search for inconsistent uses of `isDirectTransfer`.
rg --type typescript --files-with-matches $'isDirectTransfer'

Length of output: 95



Script:

#!/bin/bash
# Description: Verify that `isDirectTransfer` is used consistently across all configurations.

# Test: Search for inconsistent uses of `isDirectTransfer`.
rg 'isDirectTransfer' --glob '*.ts'

Length of output: 4599

apps/cross-chain/app/components/polkadotEco.tsx (1)

73-118: Validate error handling in the doDirectDeposit function to ensure robustness.

Proper error handling is essential, particularly in financial transactions, to prevent misleading outcomes and ensure user confidence.

packages/thea/src/sdk/substrate/assetHub.ts (2)

88-89: Added isDirectTransfer parameter to enhance flexibility in transfer configurations.


208-209: Ensure that the isDirectTransfer parameter is appropriately used in all relevant blockchain transactions.

packages/thea/src/sdk/substrate/polkadot.ts (2)

88-89: Added isDirectTransfer parameter to enable specific configurations for direct transfers.


208-209: Correct usage of isDirectTransfer in blockchain transactions to support direct transfers.

packages/thea/src/sdk/substrate/bifrost.ts (2)

89-90: Successfully integrated isDirectTransfer parameter for enhanced transfer configurations.


213-214: Proper implementation of isDirectTransfer in transaction logic to facilitate direct transfers.

packages/thea/src/sdk/substrate/astar.ts (2)

90-91: Integration of isDirectTransfer parameter enhances the configurability of transfers.


214-215: Effective use of isDirectTransfer in transaction logic to support the functionality of direct deposits.

packages/thea/src/sdk/substrate/moonbeam.ts (1)

Line range hint 90-215: The addition of isDirectTransfer parameter is well-integrated into the getTransferConfig method. Ensure that all dependent components correctly handle this new parameter.

Verification successful

The isDirectTransfer parameter appears to be correctly integrated and passed in various files where getTransferConfig is used. Here are the relevant locations:

  • packages/thea/src/sdk/substrate/unique.ts
  • packages/thea/src/sdk/substrate/polkadot.ts
  • packages/thea/src/sdk/substrate/polkadex.ts
  • packages/thea/src/sdk/substrate/phala.ts
  • packages/thea/src/sdk/substrate/moonbeam.ts
  • packages/thea/src/sdk/substrate/interlay.ts
  • packages/thea/src/sdk/substrate/bifrost.ts
  • packages/thea/src/sdk/substrate/astar.ts
  • packages/thea/src/sdk/substrate/assetHub.ts

This confirms that the isDirectTransfer parameter is consistently passed and handled across these files.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify integration of `isDirectTransfer` with other components.

# Test: Search for usage of `getTransferConfig` to ensure correct passing of `isDirectTransfer`.
rg --type python $'getTransferConfig'

Length of output: 67



Script:

#!/bin/bash
# Description: Verify integration of `isDirectTransfer` with other components.

# Test: Search for usage of `getTransferConfig` to ensure correct passing of `isDirectTransfer`.
rg 'getTransferConfig'

Length of output: 1105



Script:

#!/bin/bash
# Description: Verify the usage of `isDirectTransfer` in the identified files.

# Test: Search for the term `isDirectTransfer` in the identified files to confirm its usage and integration.
rg 'isDirectTransfer' packages/thea/src/sdk/substrate packages/thea/src/direct/index.ts apps/cross-chain/app/components

Length of output: 1424

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d191a86 and 5aabfa1.

Files selected for processing (9)
  • apps/cross-chain/app/components/polkadotEco.tsx (4 hunks)
  • packages/thea/src/sdk/substrate/assetHub.ts (3 hunks)
  • packages/thea/src/sdk/substrate/astar.ts (3 hunks)
  • packages/thea/src/sdk/substrate/bifrost.ts (3 hunks)
  • packages/thea/src/sdk/substrate/interlay.ts (3 hunks)
  • packages/thea/src/sdk/substrate/moonbeam.ts (3 hunks)
  • packages/thea/src/sdk/substrate/phala.ts (3 hunks)
  • packages/thea/src/sdk/substrate/polkadot.ts (3 hunks)
  • packages/thea/src/sdk/substrate/unique.ts (3 hunks)
Files skipped from review due to trivial changes (3)
  • packages/thea/src/sdk/substrate/phala.ts
  • packages/thea/src/sdk/substrate/polkadot.ts
  • packages/thea/src/sdk/substrate/unique.ts
Files skipped from review as they are similar to previous changes (5)
  • packages/thea/src/sdk/substrate/assetHub.ts
  • packages/thea/src/sdk/substrate/astar.ts
  • packages/thea/src/sdk/substrate/bifrost.ts
  • packages/thea/src/sdk/substrate/interlay.ts
  • packages/thea/src/sdk/substrate/moonbeam.ts
Additional context used
Biome
apps/cross-chain/app/components/polkadotEco.tsx

[error] 132-135: Provide an explicit type prop for the button element. (lint/a11y/useButtonType)

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset


[error] 138-141: Provide an explicit type prop for the button element. (lint/a11y/useButtonType)

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset


[error] 144-147: Provide an explicit type prop for the button element. (lint/a11y/useButtonType)

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

Additional comments not posted (3)
apps/cross-chain/app/components/polkadotEco.tsx (3)

5-5: The import of directDeposit is correctly added to accommodate the new functionality for direct deposits.


7-9: Constants for SOURCE_CHAIN, DESTINATION_CHAIN, and SELECTED_ASSET have been updated to reflect the new chain and asset requirements. Ensure that these changes align with the business logic and intended use cases.


73-118: The doDirectDeposit function is well-implemented, following the pattern established in other parts of the code. It appropriately handles potential errors and logs necessary information. However, consider adding more detailed error messages or handling specific error types to improve debugging and user feedback.

@ap211unitech ap211unitech linked an issue Jun 17, 2024 that may be closed by this pull request
@ap211unitech ap211unitech changed the title Direct Deposit Direct Deposit & Withdrawal Jun 17, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5aabfa1 and 22f18bf.

Files selected for processing (1)
  • packages/thea/src/sdk/helpers.ts (3 hunks)
Additional comments not posted (1)
packages/thea/src/sdk/helpers.ts (1)

1-1: Imports are correctly added and relevant to the new functionality.

Also applies to: 14-15

packages/thea/src/sdk/helpers.ts Outdated Show resolved Hide resolved
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Outside diff range and nitpick comments (2)
.changeset/tasty-lamps-rhyme.md (1)

6-6: Ensure the description in the changeset is detailed enough to cover all significant changes made in this PR.

apps/cross-chain/app/components/polkadotEco.tsx (1)

13-13: Ensure the amount is set correctly and consider making it configurable if it's meant to vary.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 22f18bf and b11bace.

Files selected for processing (3)
  • .changeset/tasty-lamps-rhyme.md (1 hunks)
  • apps/cross-chain/app/components/polkadotEco.tsx (4 hunks)
  • packages/thea/src/sdk/helpers.ts (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/thea/src/sdk/helpers.ts
Additional context used
Biome
apps/cross-chain/app/components/polkadotEco.tsx

[error] 133-136: Provide an explicit type prop for the button element. (lint/a11y/useButtonType)

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset


[error] 139-142: Provide an explicit type prop for the button element. (lint/a11y/useButtonType)

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset


[error] 145-148: Provide an explicit type prop for the button element. (lint/a11y/useButtonType)

The default type of a button is submit, which causes the submission of a form when placed inside a form element. This is likely not the behaviour that you want inside a React application.
Allowed button types are: submit, button or reset

Additional comments not posted (4)
.changeset/tasty-lamps-rhyme.md (1)

1-4: The changeset correctly updates package versions to reflect the significance of the changes.

apps/cross-chain/app/components/polkadotEco.tsx (3)

7-9: Constants for chains and assets have been updated to reflect the new configuration.


73-119: The doDirectDeposit function correctly implements the logic for direct deposits, including error handling and asset transfer.


25-27: The asset balance querying logic seems correct. Ensure getAllAssets and getBalances methods handle errors gracefully.

Copy link
Member

@minikas minikas left a comment

Choose a reason for hiding this comment

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

LGTM

@nuel77 nuel77 merged commit 65619dc into main Jun 19, 2024
2 checks passed
@nuel77 nuel77 deleted the direct-deposit-and-withdrawal branch June 19, 2024 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Direct Deposit & Withdrawal
4 participants