-
Notifications
You must be signed in to change notification settings - Fork 113
Send Token to Kusama #1463
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
Send Token to Kusama #1463
Conversation
# Conflicts: # web/packages/operations/package.json # web/packages/operations/src/transfer_token_v2.ts
# Conflicts: # web/packages/api/package.json # web/packages/contract-types/package.json # web/packages/contracts/package.json
# Conflicts: # web/packages/api/package.json # web/packages/api/src/assets_v2.ts # web/packages/api/src/xcmBuilder.ts # web/pnpm-lock.yaml
@yrong sure, https://assethub-kusama.subscan.io/extrinsic/9407589-2. There is a KSM amount minted yeah. |
yes, try to use native whenever possible, I expect requiring KSM on Kusama side to be better UX than requiring DOT there - either way, if the source is KAH or PAH, the UI could check pools and do some swap before to cover all fees using only WETH |
To summarize the changes that I'll make:
|
To be honest, after giving it more thought, I’m not sure the fee estimation justifies the complexity of introducing dry_run. The current API code already feels a bit too complicated. In my opinion,the fee could be added as a static configuration value, which should work fine for both Snowbridge V1 and V2. I'd expect the fee is relatively stable and unlikely to change frequently, we wouldn’t need to reconfigure it often. So, if possible, I’d prefer to do some cleanup rather than introduce more estimation logic and make things even more complex. We can discuss it furthur tomorrow. |
@yrong I changed the fee from K->P to KSM, and added KSM as a transferable asset (with scripts): http://github.com/Snowfork/snowbridge/pull/1463/commits/cd0462175656a8494ca42314758cd13f4b332a31 Awaiting feedback on how to determine the fee: https://snowfork.slack.com/archives/G01BGMGLAC9/p1747993120325679 Once decided, I'll implement it. |
Either way works for me as long as the fee estimation is accurate. I don’t have a strong preference, so I’ll leave the decision to you or Alistair. I may do some cleanup and refactoring to support Snowbridge V2, but that will be handled independently. |
# Conflicts: # web/packages/api/src/assets_v2.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.
Just a dangling debug log command that needs to be removed.
web/packages/api/src/assets_v2.ts
Outdated
@@ -750,6 +856,7 @@ export function padFeeByPercentage(fee: bigint, padPercent: bigint) { | |||
if (padPercent < 0 || padPercent > 100) { | |||
throw Error(`padPercent ${padPercent} not in range of 0 to 100.`) | |||
} | |||
console.log("PAD: ", fee * ((100n + padPercent) / 100n)) |
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.
Remove this logging?
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.
Removed in 90a7ddc.
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.
+1
forKusama