-
-
Notifications
You must be signed in to change notification settings - Fork 362
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
teleport KSM token between Kusama and Basilisk #4297
Conversation
SUCCESS @Jarsen136 PR for issue #4035 which is assigned to you. Please wait for review and don't hesitate to grab another issue in the meantime! |
✅ Deploy Preview for koda-nuxt ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Work in progress:
I have send 1 ksm from Kusama to Basilisk on teleport page. https://kusama.subscan.io/xcm_message/kusama-350df3d577486e2054b580f0065c872b4b4d693b
|
Basilisk is bricked for now and won't work for like 5-6 days for sure :| BUT we can test it against
|
Oh, that would be better. |
Once merge, we can test this one |
It should working now? 👀 lmk whenever we can test & merge this 😎 |
Teleport bridge path: https://deploy-preview-4297--koda-nuxt.netlify.app/teleport-bridge
Teleport Steps:
Teleport Steps:
I have tried many times to test the functionality that on Basilisk. However, it's hard for me to connect with the Basilisk websocket network. Could anyone do a teleport test from Kusama to Basilisk? |
I have found out why it does not work properly when I teleport ksm from Basilisk. As we could see at Function So, I guess we should fulfill the function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 14635 lines exceeds the maximum allowed for the inline comments feature.
what does that mean? |
@Jarsen136 Transfer Basilisk to Relay chain does not work because you use wrong version of sdk, currently version in main branch is suited for localhost use with UI only. However if you switch to beta-pre-release branch I think you will find what you were searching for :).. |
Hey, @dudo50 thanks for your answer. The For now, I write the transfer function call code without using any SDK. If the latest version of @paraspell/sdk is released in the future, I would switch to using the SDK to support transfer tokens on more network |
@Jarsen136 there is actually it is called 0.0.11.alpha I believe, you can check it on npm.. It supports Basilisk and Kusama transfers out of the box. However I respect your decision, I would like to encourage you to check it anyways so you can see how to construct calls you seek if there is something you still need to implement :) |
Thanks for correcting me : ) I will use this alpha version of SDK to help to build the teleport function. I think it would do better. |
No worries @Jarsen136, it is still under construction so some things might not be clear right away. We plan on converting it into a builder pattern soon to make things as intuitive as possible.. If you have any questions feel free to tag me :).. |
After many times of testing, I think the functionality is good for testing now. @yangwao https://deploy-preview-4297--koda-nuxt.netlify.app/teleport-bridge |
@Jarsen136, maybe adding teleport-bridge to dropdown? I would add it under Transfer for now :) once this is merged,
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use already made components
components/teleport/Teleport.vue
Outdated
</b-select> | ||
</b-field> | ||
|
||
<b-field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AccountInput cries in the corner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
components/teleport/Teleport.vue
Outdated
</b-select> | ||
</b-field> | ||
|
||
<b-field class="" label-position="inside" label="Input currency amount"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BalanceInput cries in the corner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
components/teleport/Teleport.vue
Outdated
:step="0.0001"></b-input> | ||
</b-field> | ||
|
||
<b-button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SubmitButton cries in third corner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
import { ApiPromise, WsProvider } from '@polkadot/api' | ||
import { web3Enable } from '@polkadot/extension-dapp' | ||
import '@polkadot/api-augment' | ||
import { toDefaultAddress } from '@/utils/account' | ||
import { getAddress } from '@/utils/extension' | ||
import { Chain, ChainIdMap } from '@/utils/teleport' | ||
import { notificationTypes, showNotification } from '@/utils/notification' | ||
import useAuth from '@/composables/useAuth' | ||
import Loader from '@/components/shared/Loader.vue' | ||
import * as paraspell from '@paraspell/sdk' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Plese use sub-api
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid that it could not use sub-api
. Because If I want to teleport tokens from Kusama, I need to use ApiPromise
of kusama. On the other hand, I would use ApiPromise
of basilisk.
And sub-api
would only return the API endpoint according to the current prefix. 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
components/teleport/Teleport.vue
Outdated
const injector = await getAddress(toDefaultAddress(address)) | ||
|
||
if (fromChain.value === Chain.KUSAMA) { | ||
const wsProvider = new WsProvider('wss://public-rpc.pinknode.io/kusama') | ||
const apiKusama = await ApiPromise.create({ provider: wsProvider }) | ||
|
||
const promise = paraspell.xTokens.transferRelayToPara( | ||
apiKusama, | ||
ChainIdMap[Chain.BASILISK], | ||
amount.value * 1e12, | ||
toAddress.value | ||
) | ||
|
||
promise | ||
.signAndSend(address, { signer: injector.signer }, transactionHandler) | ||
.catch(errorHandler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transactionExecutor.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used txCb
utils function
Code Climate has analyzed commit 6b2311b and detected 0 issues on this pull request. View more on Code Climate. |
😍 Perfect, I’ve sent the payout 🪅 Let’s grab another issue and get rewarded! |
Let's now crack on |
Thank you for your contribution to the KodaDot NFT gallery.
👇 _ Let's make a quick check before the contribution.
PR Type
Context
Before submitting pull request, please make sure:
Optional
Had issue bounty label?
Community participation
Screenshot 📸
currently, the url for teleport is
/teleport-bridge