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

add PEN and XLM tokens to Astar portal #1

Merged
merged 12 commits into from
Jul 2, 2024

Conversation

b-yap
Copy link
Collaborator

@b-yap b-yap commented Jun 13, 2024

Pull Request Summary

Add support for PEN asset
Closes https://github.com/pendulum-chain/tasks/issues/310 and https://github.com/pendulum-chain/tasks/issues/314

This pull request makes the following changes:

Adds

  • PEN and XLM svg images
  • PEN and XLM xcm transfer support

Fixes

  • None

Changes

  • None

@b-yap b-yap marked this pull request as ready for review June 14, 2024 10:53
@b-yap
Copy link
Collaborator Author

b-yap commented Jun 14, 2024

@b-yap b-yap requested a review from ebma June 14, 2024 11:21
@b-yap
Copy link
Collaborator Author

b-yap commented Jun 14, 2024

[Chain.PENDULUM]: {
name: Chain.PENDULUM,
relayChain: Chain.POLKADOT,
img: require('/src/assets/img/token/pen.png'),
Copy link
Member

Choose a reason for hiding this comment

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

How about we add the image as an SVG instead so that it's easily scalable.

Copy link
Collaborator Author

@b-yap b-yap Jun 17, 2024

Choose a reason for hiding this comment

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

I didn't see a PEN.svg in our drive...?
https://drive.google.com/drive/u/0/folders/1sZcQzoDxT_EUd2wtEJN8ECNzPakfAMs6 only PNG.
I'll ask Anna in the ticket to provide us one.

oh, nvm. the image was
Screenshot 2024-06-17 at 2 09 15 PM
and I missed it.

ok.

symbol: 'PEN',
isNativeToken: true,
assetId: '18446744073709551634',
originAssetId: '0',
Copy link
Member

Choose a reason for hiding this comment

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

Looking at the other definitions, I think this should rather be

Suggested change
originAssetId: '0',
originAssetId: 'PEN',

though I'm not 100% sure if this is important.

src/modules/xcm/tokens/index.ts Outdated Show resolved Hide resolved

try {
// PEN
if (token.originAssetId == '0') {
Copy link
Member

@ebma ebma Jun 14, 2024

Choose a reason for hiding this comment

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

We would need to change this to == 'PEN' then probably

Copy link
Member

Choose a reason for hiding this comment

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

Besides that, we do get a isNativeToken boolean passed into this function already. What does that do?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated

Comment on lines 37 to 39
if (token.id !== '18446744073709551634') {
throw 'Token must be PEN';
}
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this condition is too strict and we should remove it. Otherwise, we'll have to change it again once we support more tokens other than PEN.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i've updated to add XLM and EURC

if (token.id !== '18446744073709551634') {
throw 'Token must be PEN';
}
let tokenData = PEN;
Copy link
Member

Choose a reason for hiding this comment

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

Then we would probably need to change this to let tokenData = token.originAssetId === "PEN" ? "Native" : { XCM: token.originAssetId } or similiar. Not sure what exactly token.originAssetId can be.

@b-yap b-yap changed the title add PEN token to Astar portal add PEN, XLM, and EURC tokens to Astar portal Jun 17, 2024
@b-yap b-yap marked this pull request as draft June 17, 2024 09:43
@b-yap b-yap changed the title add PEN, XLM, and EURC tokens to Astar portal [ON-HOLD] add PEN, XLM, and EURC tokens to Astar portal Jun 21, 2024
@b-yap
Copy link
Collaborator Author

b-yap commented Jun 21, 2024

Cannot test transfer; ASTR Faucet is running out.
Screenshot 2024-06-21 at 7 14 19 PM

Putting this on-hold

@b-yap b-yap changed the title [ON-HOLD] add PEN, XLM, and EURC tokens to Astar portal [ON-HOLD] add PEN and XLM tokens to Astar portal Jul 2, 2024
@b-yap b-yap changed the title [ON-HOLD] add PEN and XLM tokens to Astar portal add PEN and XLM tokens to Astar portal Jul 2, 2024
@b-yap
Copy link
Collaborator Author

b-yap commented Jul 2, 2024

@b-yap b-yap marked this pull request as ready for review July 2, 2024 11:11
Copy link
Member

@ebma ebma left a comment

Choose a reason for hiding this comment

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

Looks good to me without the console log.

Let's close this PR then and create one to the upstream repo @b-yap

src/v2/repositories/implementations/XcmRepository.ts Outdated Show resolved Hide resolved
@b-yap b-yap merged commit fd2af2a into main Jul 2, 2024
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.

2 participants