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

AssetHub: Fee payment with any sufficient asset #11229

Merged
merged 25 commits into from
Feb 6, 2025

Conversation

ap211unitech
Copy link
Contributor

@ap211unitech ap211unitech commented Jan 23, 2025

📝 Description

This PR introduces the ability to select an asset for paying fees. For example, Asset Hub allows fees to be paid in sufficient assets like USDt and USDC. Initially, this feature will be implemented for the Balance Transfer component, with plans to extend it across other relevant pages/components in the future.

Screen.Recording.2025-02-03.at.16.11.19.mov

⚠️ For now, this feature is being added specifically for the Asset Hub chain. In future, it can be extended to other chains as per requirements.

✅ Tasks

  • Create PayWithAsset component which allow users to choose asset to pay fee
  • Integrate it with Transfer Modal (for now)
  • End to End testng for it (just for AssetHub)
  • Allow this feature to other chains which can accept fee in other assets

@ap211unitech ap211unitech self-assigned this Jan 23, 2025
@ap211unitech ap211unitech linked an issue Jan 30, 2025 that may be closed by this pull request
@ap211unitech ap211unitech marked this pull request as ready for review February 3, 2025 10:48
@ap211unitech ap211unitech requested a review from TarikGul February 3, 2025 10:48
@ap211unitech ap211unitech requested a review from TarikGul February 3, 2025 16:18
Copy link
Member

@TarikGul TarikGul left a comment

Choose a reason for hiding this comment

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

I think we can better optimize the way we handle chains that support using assetId's. Even if the support only extends to assset-hub (statemine, statemint) we can better improve our workflow here.

The best approach IMO is to see if the necessary assets pallet exists (there might be some additional checks we can make to ensure we can pay with assets for fees) - check what the palletIndex is (for inputting in the multilocation) - and then from there offer support for paying with assets for fees.

@ap211unitech ap211unitech requested a review from TarikGul February 6, 2025 04:32
Copy link
Member

@TarikGul TarikGul left a comment

Choose a reason for hiding this comment

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

Amazing job! 👍

@ap211unitech ap211unitech merged commit bdfceda into master Feb 6, 2025
5 checks passed
@ap211unitech ap211unitech deleted the feat/pay-with-asset branch February 6, 2025 15:50
Kailai-Wang pushed a commit to litentry/polkadot-js-apps that referenced this pull request Feb 6, 2025
* feat: created useAssetIds and useAssetInfo hook

* feat: created pay with asset component

* feat: add paywith asset component with Transfer modal

* fix: signer options as prop

* fix: payment info

* feat: created PayWithAsset provider and integrated with transfer form

* chore: rename variable

* fix: PayWithAsset provider wrapping

* feat: integrate PayWithAsset context and enhance asset info fetching

* fix: some build errors

* refactor: update imports and simplify getFeeAssetLocation function

* refactor: simplify component structure and update PayWithAsset import paths

* fix: all build errors

* fix: avoid redundant type

* feat: added translation

* feat: enhance fee payment info & fee asset handling

* fix: translations ordering

* fix: remove redundant types and hooks

* chore: added statemine chain

* refactor: generalize fee acceptance check for non-native assets

* fix: remove constants and generalize palletIndex
@polkadot-js-bot
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Feb 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AssetHub: fee payment in any asset
3 participants