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

THEA Enhancements - I #231

Closed
wants to merge 33 commits into from
Closed

THEA Enhancements - I #231

wants to merge 33 commits into from

Conversation

ap211unitech
Copy link
Member

@ap211unitech ap211unitech commented May 1, 2024

📝 Description

As of now, we have successfully migrated exisiting THEA functionalities to @polkadex/thea package i.e. THEA deposits and withdrawals for existing chains and assets.

Now, our next goal is to allow depositing non-native assets of exisiting chains to Polkadex network and allow withdrawals from Polkadex network back to original chain.
For example, Interlay supports DOT, USDT and more assets which are already supported by Polkadex network, but we never integrated it frontend. Technically, Transfer for these assets should work. So, we will be testing and allowing these transfers.

In this task, we will be adding these assets for existing chains -

  • Interlay to Polkadex and vice versa
    • DOT
    • GLMR
    • BNC
    • vDOT

Summary by CodeRabbit

  • New Features

    • Added support for new assets (dot, usdt, usdc, glmr, ibtc, bnc, vdot) in the interlay parachain.
    • Introduced new AssetConfig entries for assets (dot, glmr, bnc, vdot) in polkadex, detailing balances, destinations, fees, and extrinsics.
  • Enhancements

    • Updated transferMultiasset function to handle transfers with XcmVersion v2, improving transfer configurations.

Copy link

changeset-bot bot commented May 1, 2024

🦋 Changeset detected

Latest commit: c2197fd

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

This PR includes changesets to release 1 package
Name Type
@polkadex/thea 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 May 1, 2024

Warning

Rate limit exceeded

@ap211unitech has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 54 minutes and 36 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between f570877 and c2197fd.

Walkthrough

The recent updates enhance the @polkadex/thea package by adding support for new assets and improving the transfer functionalities. Specifically, new assets have been added to the interlay and polkadex configurations, and the transferMultiasset function has been updated to handle XcmVersion v2 transfers. These changes aim to facilitate broader asset transfers across different chains, aligning with the objectives of ongoing THEA enhancements.

Changes

File Change Summary
.../substrate/builders/pallets/xTokens.ts Updated transferMultiasset function to include a new extrinsic configuration builder X2 for XcmVersion v2 transfers.
.../substrate/chains.ts Expanded the interlay object to include additional assets (dot, usdt, usdc, glmr, ibtc, bnc, vdot).
.../substrate/config/interlay.ts Added new assets (dot, glmr, bnc, vdot) to the toPolkadex array with their configurations.
.../substrate/config/polkadex.ts Added new AssetConfig entries for various assets (dot, glmr, bnc, vdot) with detailed configurations.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant User
    participant Polkadex
    participant Interlay
    participant XcmModule

    User->>Polkadex: Initiate transfer of DOT
    Polkadex->>XcmModule: Create X2 extrinsic for DOT transfer
    XcmModule->>Interlay: Execute X2 extrinsic
    Interlay-->>XcmModule: Acknowledge transfer
    XcmModule-->>Polkadex: Confirm transfer completion
    Polkadex-->>User: Notify transfer success
Loading

Possibly related issues

Poem

In the realm of code so grand,
New assets join, hand in hand.
Transfers flow with Xcm's might,
Across the chains, day and night.
Polkadex and Interlay unite,
Bringing users sheer delight.
🎉✨


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.

@ap211unitech ap211unitech self-assigned this May 1, 2024
Base automatically changed from feat/thea-withdrawals to main May 1, 2024 09:28
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: 9

Comment on lines 25 to 40
// Not working
new AssetConfig({
asset: dot,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: polkadex,
destinationFee: {
amount: 0,
asset: dot,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transfer().X2(),
fee: {
asset: intr,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
}),
Copy link

Choose a reason for hiding this comment

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

The asset configuration for DOT is marked as "Not working." Please clarify the status and ensure it is tested thoroughly before deployment.

Comment on lines 42 to 57
// Not working
new AssetConfig({
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: polkadex,
destinationFee: {
amount: 0,
asset: usdt,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transfer().X2(),
fee: {
asset: intr,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
}),
Copy link

Choose a reason for hiding this comment

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

The asset configuration for USDT is marked as "Not working." It is crucial to resolve any issues and verify the configuration's functionality.

Comment on lines 59 to 74
// Not working
new AssetConfig({
asset: usdc,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: polkadex,
destinationFee: {
amount: 0,
asset: usdc,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transfer().X2(),
fee: {
asset: intr,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
}),
Copy link

Choose a reason for hiding this comment

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

The asset configuration for USDC is marked as "Not working." Please provide details on the issues and confirm that they have been addressed.

Comment on lines 76 to 91
// Not working
new AssetConfig({
asset: glmr,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: polkadex,
destinationFee: {
amount: 0,
asset: glmr,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilderV2().xTokens().transfer().X2(),
fee: {
asset: intr,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
}),
Copy link

Choose a reason for hiding this comment

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

The asset configuration for GLMR is marked as "Not working." Ensure that all problems are resolved and the configuration is fully operational.

Comment on lines 11 to 30
// Not working
new AssetConfig({
asset: dot,
balance: BalanceBuilder().substrate().system().account(),
destination: polkadex,
destinationFee: {
amount: 0,
asset: dot,
balance: BalanceBuilder().substrate().assets().account(),
},
extrinsic: ExtrinsicBuilderV2()
.polkadotXcm()
.limitedReserveTransferAssets()
.here(),
fee: {
asset: dot,
balance: BalanceBuilder().substrate().system().account(),
xcmDeliveryFeeAmount,
},
}),
Copy link

Choose a reason for hiding this comment

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

The asset configuration for DOT is marked as "Not working." Please clarify the current issues and ensure that the configuration is tested and functional.

Comment on lines 288 to 309
// Need to test
new AssetConfig({
asset: dot,
balance: BalanceBuilder().substrate().assets().account(),
destination: interlay,
destinationFee: {
amount: 0, // TODO: Change it later
asset: dot,
balance: BalanceBuilder().substrate().system().account(),
},
extrinsic: ExtrinsicBuilderV2()
.theaExecuter()
.parachainWithdraw()
.X2()
.sufficient(),
min: AssetMinBuilder().assets().asset(),
fee: {
asset: pdex,
balance: BalanceBuilder().substrate().system().account(),
xcmDeliveryFeeAmount,
},
}),
Copy link

Choose a reason for hiding this comment

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

The new AssetConfig instance for DOT is marked as "Need to test." Please ensure that this configuration is thoroughly tested and functional before deployment.

@ap211unitech ap211unitech linked an issue May 1, 2024 that may be closed by this pull request
1 task
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: 4

Outside diff range and nitpick comments (3)
packages/thea/src/config/substrate/chains.ts (1)

Line range hint 1-6: Consider using TypeScript's import type for imports that are only used as types.

- import { Parachain, EvmParachain, Ecosystem, AnyChain } from "@moonbeam-network/xcm-types";
+ import type { Parachain, EvmParachain, Ecosystem, AnyChain } from "@moonbeam-network/xcm-types";
packages/thea/src/sdk/substrate/interlay.ts (2)

Line range hint 51-59: Consider replacing forEach with for...of loops for better performance and readability, especially in asynchronous contexts.

- supportedAssets.forEach((asset) => {
+ for (const asset of supportedAssets) {

Also applies to: 69-78


Line range hint 4-5: Similar to the previous file, use import type for imports that are only used as types to clarify their usage and potentially optimize bundling.

- import { AnyChain } from "@moonbeam-network/xcm-types";
+ import type { AnyChain } from "@moonbeam-network/xcm-types";

Also applies to: 7-18, 18-19

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 8b0854b and 3121b8e.
Files selected for processing (3)
  • packages/thea/src/config/substrate/chains.ts (1 hunks)
  • packages/thea/src/config/substrate/config/polkadex.ts (2 hunks)
  • packages/thea/src/sdk/substrate/interlay.ts (1 hunks)
Additional Context Used
Biome (6)
packages/thea/src/config/substrate/chains.ts (1)

1-6: Some named imports are only used as types.

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

51-59: Prefer for...of instead of forEach.


69-78: Prefer for...of instead of forEach.


4-5: All these imports are only used as types.


7-18: Some named imports are only used as types.


18-19: All these imports are only used as types.

Additional comments not posted (2)
packages/thea/src/config/substrate/chains.ts (1)

150-173: The addition of new assets (dot, usdt, usdc, glmr) to the interlay parachain configuration aligns with the PR objectives to support these assets for cross-chain transfers. Ensure that the id and metadataId values are correctly configured and consistent with the asset specifications.

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

215-215: The query modification from Token: a.ticker to a.id in the getBalances method is a significant change. Ensure that this aligns with the backend API expectations and that a.id is always provided and valid.

Comment on lines 36 to 58
// Need to test
new AssetConfig({
asset: dot,
balance: BalanceBuilder().substrate().assets().account(),
destination: assetHub,
destinationFee: {
amount: 0, // TODO: Change it later
asset: dot,
balance: BalanceBuilder().substrate().system().account(),
},
extrinsic: ExtrinsicBuilderV2()
.theaExecuter()
.parachainWithdraw()
.X2()
.sufficient(),
min: AssetMinBuilder().assets().asset(),
fee: {
asset: pdex,
balance: BalanceBuilder().substrate().system().account(),
xcmDeliveryFeeAmount,
},
}),

Copy link

Choose a reason for hiding this comment

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

The new AssetConfig for DOT in the toAssethub array is marked as "Need to test." Ensure that this configuration is thoroughly tested and functional before deployment, especially the TODO comment about changing the destination fee amount later.

Comment on lines 314 to 335
// Need to test
new AssetConfig({
asset: usdt,
balance: BalanceBuilder().substrate().assets().account(),
destination: interlay,
destinationFee: {
amount: 0, // TODO: Change it later
asset: usdt,
balance: BalanceBuilder().substrate().system().account(),
},
extrinsic: ExtrinsicBuilderV2()
.theaExecuter()
.parachainWithdraw()
.X2()
.sufficient(),
min: AssetMinBuilder().assets().asset(),
fee: {
asset: pdex,
balance: BalanceBuilder().substrate().system().account(),
xcmDeliveryFeeAmount,
},
}),
Copy link

Choose a reason for hiding this comment

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

The new AssetConfig instance for USDT is marked as "Need to test." It is crucial to resolve any issues and verify the configuration's functionality. Ensure that the destination fee and other parameters are correctly set and functional.

Comment on lines 337 to 358
// Need to test
new AssetConfig({
asset: usdc,
balance: BalanceBuilder().substrate().assets().account(),
destination: interlay,
destinationFee: {
amount: 0, // TODO: Change it later
asset: usdc,
balance: BalanceBuilder().substrate().system().account(),
},
extrinsic: ExtrinsicBuilderV2()
.theaExecuter()
.parachainWithdraw()
.X2()
.sufficient(),
min: AssetMinBuilder().assets().asset(),
fee: {
asset: pdex,
balance: BalanceBuilder().substrate().system().account(),
xcmDeliveryFeeAmount,
},
}),
Copy link

Choose a reason for hiding this comment

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

The new AssetConfig instance for USDC is marked as "Need to test." Please provide details on the issues and confirm that they have been addressed. Additionally, verify the correct setup of the destination fee and other related configurations.

Comment on lines 360 to 381
// Need to test
new AssetConfig({
asset: glmr,
balance: BalanceBuilder().substrate().assets().account(),
destination: interlay,
destinationFee: {
amount: 0, // TODO: Change it later
asset: glmr,
balance: BalanceBuilder().substrate().system().account(),
},
extrinsic: ExtrinsicBuilderV2()
.theaExecuter()
.parachainWithdraw()
.X2()
.sufficient(),
min: AssetMinBuilder().assets().asset(),
fee: {
asset: pdex,
balance: BalanceBuilder().substrate().system().account(),
xcmDeliveryFeeAmount,
},
}),
Copy link

Choose a reason for hiding this comment

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

The new AssetConfig instance for GLMR is marked as "Need to test." Ensure that all problems are resolved and the configuration is fully operational. Pay special attention to the destination fee setup and other parameters.

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3121b8e and e29f862.

Files selected for processing (2)
  • packages/thea/src/config/substrate/config/polkadex.ts (2 hunks)
  • packages/thea/src/sdk/substrate/interlay.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/thea/src/config/substrate/config/polkadex.ts
Additional context used
Biome
packages/thea/src/sdk/substrate/interlay.ts

[error] 51-59: Prefer for...of instead of forEach.


[error] 69-78: Prefer for...of instead of forEach.


[error] 4-5: All these imports are only used as types.


[error] 7-18: Some named imports are only used as types.


[error] 18-19: All these imports are only used as types.

Additional comments not posted (1)
packages/thea/src/sdk/substrate/interlay.ts (1)

224-224: LGTM! The updated query parameter aligns with the PR objectives to enhance querying mechanisms.

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e29f862 and 2b0045b.

Files selected for processing (1)
  • packages/thea/src/config/substrate/config/polkadex.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/thea/src/config/substrate/config/polkadex.ts

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2b0045b and 2f3b5a9.

Files selected for processing (3)
  • packages/thea/src/config/substrate/chains.ts (1 hunks)
  • packages/thea/src/config/substrate/config/interlay.ts (2 hunks)
  • packages/thea/src/config/substrate/config/polkadex.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/thea/src/config/substrate/config/polkadex.ts
Additional comments not posted (7)
packages/thea/src/config/substrate/config/interlay.ts (2)

76-91: Configuration for GLMR is marked as "Tested & working" and appears to be correctly set up.


93-108: Configuration for BNC is marked as "Tested & working" and appears to be correctly set up.

packages/thea/src/config/substrate/chains.ts (5)

150-155: Configuration for DOT has been updated with new ID and metadata settings, aligning with the PR objectives.


157-161: Configuration for USDT has been updated with a new ID and metadata settings, aligning with the PR objectives.


163-166: Configuration for USDC has been updated with a new ID and metadata settings, aligning with the PR objectives.


169-172: Configuration for GLMR has been updated with a new ID and metadata settings, aligning with the PR objectives.


181-184: Configuration for BNC has been updated with a new ID and metadata settings, aligning with the PR objectives.

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2f3b5a9 and 6a54ca6.

Files selected for processing (3)
  • packages/thea/src/config/substrate/chains.ts (1 hunks)
  • packages/thea/src/config/substrate/config/interlay.ts (2 hunks)
  • packages/thea/src/config/substrate/config/polkadex.ts (2 hunks)
Files skipped from review as they are similar to previous changes (3)
  • packages/thea/src/config/substrate/chains.ts
  • packages/thea/src/config/substrate/config/interlay.ts
  • packages/thea/src/config/substrate/config/polkadex.ts

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6a54ca6 and 3266dd0.

Files selected for processing (2)
  • packages/thea/src/config/substrate/builders/pallets/xTokens.ts (1 hunks)
  • packages/thea/src/config/substrate/config/interlay.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/thea/src/config/substrate/config/interlay.ts
Additional comments not posted (1)
packages/thea/src/config/substrate/builders/pallets/xTokens.ts (1)

70-86: Verify the implementation of X2 in transferMultiasset.

Ensure that the use of "Unlimited" aligns with the intended behavior and security practices.

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: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3266dd0 and 130880f.

Files selected for processing (2)
  • packages/thea/src/config/substrate/builders/pallets/polkadotXcm.ts (1 hunks)
  • packages/thea/src/config/substrate/config/polkadex.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/thea/src/config/substrate/config/polkadex.ts
Additional comments not posted (2)
packages/thea/src/config/substrate/builders/pallets/polkadotXcm.ts (2)

18-18: Review the addition of the new here method in limitedTeleportAssets for potential duplication with existing methods.

Verification successful

The search for potential duplication of the here method in limitedTeleportAssets did not produce any results, indicating that there are no similar methods in the codebase.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check for potential duplication of the `here` method in `limitedTeleportAssets`.

# Test: Search for similar methods in the codebase. Expect: No similar methods.
rg --type typescript $'here: \(\) => ExtrinsicConfigBuilder'

Length of output: 96



Script:

#!/bin/bash
# Description: Check for potential duplication of the `here` method in `limitedTeleportAssets`.

# Test: Search for similar methods in the codebase. Expect: No similar methods.
rg --type ts $'here: \(\) => ExtrinsicConfigBuilder'

Length of output: 53


18-18: Review the new X3 version for consistency with XCM version v3 specifications.

@@ -15,7 +15,7 @@ const limitedReserveTransferAssets = () => {
const func = "limitedReserveTransferAssets";
return {
X1: (): ExtrinsicConfigBuilder => ({
build: ({ address, amount, asset, destination, palletInstance }) =>
build: ({ address, amount, destination }) =>
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The build function with the old parameters { address, amount, asset, destination, palletInstance } is still present in packages/thea/src/config/substrate/builders/pallets/xTokens.ts. This indicates that the removal of these parameters in polkadotXcm.ts might not be consistent across the codebase.

  • packages/thea/src/config/substrate/builders/pallets/xTokens.ts:
    • Line(s) containing the old parameters:
      • build: ({ address, amount, asset, destination, palletInstance }) =>

Please review and update the xTokens.ts file to ensure consistency.

Analysis chain

Verify the removal of asset and palletInstance parameters in the build function of X1.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the removal of parameters in other parts of the codebase.

# Test: Search for the usage of `build` function of `X1` with old parameters. Expect: No occurrences.
rg --type typescript $'build: \({ address, amount, asset, destination, palletInstance }\)'

Length of output: 251



Script:

#!/bin/bash
# Description: Verify the removal of parameters in other parts of the codebase.

# Test: Search for the usage of `build` function of `X1` with old parameters. Expect: No occurrences.
rg --type typescript 'build: \(\{ address, amount, asset, destination, palletInstance \}\)'

Length of output: 128



Script:

#!/bin/bash
# Description: Verify the removal of parameters in other parts of the codebase.

# Test: Search for the usage of `build` function of `X1` with old parameters. Expect: No occurrences.
rg --type ts 'build: \(\{ address, amount, asset, destination, palletInstance \}\)'

Length of output: 359


Tip

Codebase Verification

The here method in reserveTransferAssets appears to be duplicated across multiple files:

  • 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/xTransfer.ts
  • packages/thea/src/config/substrate/builders/pallets/xcmPallet.ts

Please review these instances to ensure there is no unnecessary duplication and consider refactoring if needed.

Analysis chain

Review the addition of the new here method in reserveTransferAssets for potential duplication with existing methods.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check for potential duplication of the `here` method in `reserveTransferAssets`.

# Test: Search for similar methods in the codebase. Expect: No similar methods.
rg --type typescript $'here: \(\) => ExtrinsicConfigBuilder'

Length of output: 96



Script:

#!/bin/bash
# Description: Check for potential duplication of the `here` method in `reserveTransferAssets`.

# Test: Search for similar methods in the codebase. Expect: No similar methods.
rg --type ts $'here: \(\) => ExtrinsicConfigBuilder'

Length of output: 53



Script:

#!/bin/bash
# Description: Check for potential duplication of the `here` method in `reserveTransferAssets`.

# Test: Search for similar methods in the codebase. Expect: No similar methods.
rg --type ts 'here: \(\) =>'

Length of output: 30



Script:

#!/bin/bash
# Description: Check for potential duplication of the `here` method in `reserveTransferAssets`.

# Test: Search for similar methods in the codebase. Expect: No similar methods.
rg --type ts 'here:'

Length of output: 778

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 130880f and a5561b8.

Files selected for processing (3)
  • packages/thea/src/config/substrate/builders/pallets/xTokens.ts (1 hunks)
  • packages/thea/src/config/substrate/chains.ts (1 hunks)
  • packages/thea/src/config/substrate/config/polkadex.ts (1 hunks)
Files skipped from review as they are similar to previous changes (3)
  • packages/thea/src/config/substrate/builders/pallets/xTokens.ts
  • packages/thea/src/config/substrate/chains.ts
  • packages/thea/src/config/substrate/config/polkadex.ts

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a5561b8 and dcd4d42.

Files selected for processing (2)
  • packages/thea/src/config/substrate/config/interlay.ts (2 hunks)
  • packages/thea/src/config/substrate/config/polkadex.ts (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • packages/thea/src/config/substrate/config/interlay.ts
  • packages/thea/src/config/substrate/config/polkadex.ts

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between dcd4d42 and c10656b.

Files selected for processing (1)
  • packages/thea/src/config/substrate/config/interlay.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/thea/src/config/substrate/config/interlay.ts

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between c10656b and 5ab8ea1.

Files selected for processing (1)
  • packages/thea/src/config/substrate/config/polkadex.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/thea/src/config/substrate/config/polkadex.ts

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5ab8ea1 and f570877.

Files selected for processing (1)
  • packages/thea/src/config/substrate/config/polkadex.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/thea/src/config/substrate/config/polkadex.ts

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.

Non native tokens transfer b/w Interlay & Polkadex
2 participants