-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update transfer example (papi fallback with tx opts)
- Loading branch information
Showing
7 changed files
with
70 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export * from './extension'; | ||
export * from './provider'; | ||
export * as asset from './types'; | ||
export * from './utils'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,6 @@ | ||
import { XcmV3Junctions, XcmV3Junction } from '@polkadot-api/descriptors'; | ||
import { XcmV3Junctions } from '@polkadot-api/descriptors'; | ||
|
||
type XcmV3Multilocation = { | ||
export type XcmV3Multilocation = { | ||
parents: number; | ||
interior: XcmV3Junctions; | ||
}; | ||
|
||
export const usdt = { | ||
parents: 0, | ||
interior: XcmV3Junctions.X2([ | ||
XcmV3Junction.PalletInstance(50), | ||
XcmV3Junction.GeneralIndex(BigInt(1984)), | ||
]), | ||
} as XcmV3Multilocation; | ||
|
||
export const usdc = { | ||
parents: 0, | ||
interior: XcmV3Junctions.X2([ | ||
XcmV3Junction.PalletInstance(50), | ||
XcmV3Junction.GeneralIndex(BigInt(1337)), | ||
]), | ||
} as XcmV3Multilocation; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { XcmV3Junctions, XcmV3Junction } from '@polkadot-api/descriptors'; | ||
|
||
import { multiloc } from '@galacticcouncil/xcm-core'; | ||
|
||
import { XcmV3Multilocation } from './types'; | ||
|
||
export const getFeeAsset = (location: any) => { | ||
const pallet = multiloc.findPalletInstance(location); | ||
const index = multiloc.findGeneralIndex(location); | ||
|
||
return { | ||
parents: 0, | ||
interior: XcmV3Junctions.X2([ | ||
XcmV3Junction.PalletInstance(Number(pallet)), | ||
XcmV3Junction.GeneralIndex(BigInt(index)), | ||
]), | ||
} as XcmV3Multilocation; | ||
}; |