Skip to content

Commit

Permalink
Fix Robonomics & Bifrost transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldev5 authored and dudo50 committed Dec 6, 2023
1 parent e1fe819 commit aba856f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/nodes/PolkadotXCMTransferImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PolkadotXCMTransferImpl {
serializedApiCallEnabled
}: PolkadotXCMTransferInput,
method: string,
fees: 'Unlimited' | undefined = undefined
fees: 'Unlimited' | { Limited: string } | undefined = undefined
): Extrinsic | TSerializedApiCall {
if (serializedApiCallEnabled === true) {
return {
Expand Down
3 changes: 2 additions & 1 deletion src/nodes/supported/BifrostKusama.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class BifrostKusama extends ParachainNode implements IXTokensTransfer {

transferXTokens(input: XTokensTransferInput): Extrinsic | TSerializedApiCall {
// Multiple asset options need addressing
return XTokensTransferImpl.transferXTokens(input, { Token: input.currency })
const currencySelection = { Native: input.currency }
return XTokensTransferImpl.transferXTokens(input, currencySelection)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/nodes/supported/BifrostPolkadot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class BifrostPolkadot extends ParachainNode implements IXTokensTransfer {

transferXTokens(input: XTokensTransferInput): Extrinsic | TSerializedApiCall {
// Multiple asset options need addressing
const currencySelection = { Token: input.currency }
const currencySelection = { Native: input.currency }
return XTokensTransferImpl.transferXTokens(input, currencySelection)
}
}
13 changes: 8 additions & 5 deletions src/nodes/supported/Robonomics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ class Robonomics extends ParachainNode implements IPolkadotXCMTransfer {
super('Robonomics', 'robonomics', 'kusama', Version.V1)
}

private static readonly FEE = '400000000'

transferPolkadotXCM(input: PolkadotXCMTransferInput): Extrinsic | TSerializedApiCall {
// TESTED https://robonomics.subscan.io/xcm_message/kusama-e9641113dae59920e5cc0e012f1510ea0e2d0455
// TESTED https://robonomics.subscan.io/xcm_message/kusama-20b03208c99f2ef29d2d4b4cd4bc5659e54311ea
const method =
input.scenario === 'ParaToPara' ? 'reserveTransferAssets' : 'reserveWithdrawAssets'
return PolkadotXCMTransferImpl.transferPolkadotXCM(input, method)
if (input.scenario === 'ParaToPara') {
return PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'limitedReserveTransferAssets', {
Limited: Robonomics.FEE
})
}
return PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'reserveWithdrawAssets')
}
}

Expand Down

0 comments on commit aba856f

Please sign in to comment.