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

Support XCM #394

Merged
merged 25 commits into from May 18, 2022
Merged

Support XCM #394

merged 25 commits into from May 18, 2022

Conversation

sirius651
Copy link
Contributor

Pull Request Summary

Describe what changes this pull request makes to the repository

Check list

  • contains breaking changes
  • adds new feature
  • modifies existing feature (bug fix or improvements)
  • relies on other tasks
  • documentation changes

This pull request makes the following changes:

@sirius651
Copy link
Contributor Author

@impelcrypto Updated useXcmBridge hook but still not finished yet :(. will let you know once it done.

@github-actions
Copy link

github-actions bot commented May 15, 2022

Visit the preview URL for this PR (updated for commit 661b650):

https://astar-apps--pr394-feature-xcm-asset-qskhh23h.web.app

(expires Wed, 25 May 2022 14:16:34 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@sirius651
Copy link
Contributor Author

Hi @impelcrypto , I updated RelayWidget and hooks for binding the data on that. I'll keep updating hooks & testing stuff, but you can go ahead implementation of bridge from now on.

sirius651 and others added 9 commits May 15, 2022 22:13
* feat: added 'XCM' in sidebar

* feat: modified widget styling

* styling: added XCM assets panel for native accounts

* feat: added ModalXcmBridge

* feat: updated formattedSelectedTokenBalance

* refactor: clean up

* refactor: clean up (2)

* feat: added ModalXcmTransfer

* fix: removed unused file

* fix: added 'isXcmCompatible' property in xcmToken var

* fix: clean up

* refactor: added comments

* refactor: isEnableXcm condition

* feat: added 'XCM bridge to EVM network' UI

* fix: removed XcmAssetList from NativeAssetList.vue

* fix: removed XCM tab from sidebar
* feat: added DOT and KSM tokens in EVM assets

* fix: update styling

* fix: estimate gas
* fix: fetch user balance

* fix: conflicts

* feat: update the total native assets (USD)

* refactor: clean up

* refactor: clean up
resetStates();
};

const chainIcon = computed<{ src: string; dest: string }>(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is a scalable solution. Why don't we create an interface that handles the chain data like name and icon (and maybe the asset info too), and move that to a config file?

For example,

interface XcmNetwork {
   name: 'Polkadot';
   icon: './path/to/dot.png';
   endpoint: 'wss://...';
   asset: XcmAsset;
}

and create an object with the type:

interface XcmChannel {
   astar: XcmNetwork[];
   shiden: XcmNetwork[];
   shibuya: XcmNetwork[];
}

This is just an example, but because we plan to add more channels and we want this process to be scalable, code structure is key I think

sirius651 and others added 5 commits May 17, 2022 23:13
* fix: update token image for DOT

* fix: font size for XCM bridge modal

* fix: font size for XCM bridge modal (2)

* fix: fetch the existential data from API

* fix: updated warning section

* refactor: clean up

* feat: changed oreder of the assets

* fix: decimals calculation

* fix: words

* feat: update the XCM asset balances after bridge transaction

* styling: font size in warning text
* Asset transfer to native

* Asset transfer to EVM

* Code cleanup
@sirius651 sirius651 marked this pull request as ready for review May 18, 2022 07:22
* fix: words

* fix: disabled faucet button

* fix: enabled max button for XCM assets token transfer

* fix: decimal calculation for XCM assets transfer

* fix: disabled faucet button for EVM account
Copy link
Contributor

@hoonsubin hoonsubin left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@Kahonnohak Kahonnohak left a comment

Choose a reason for hiding this comment

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

LGTM!

@hoonsubin hoonsubin merged commit b56b903 into main May 18, 2022
@hoonsubin hoonsubin deleted the feature/xcm-asset branch May 18, 2022 15:41
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.

None yet

5 participants