-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into add-sol-to-moonnbeam
- Loading branch information
Showing
77 changed files
with
1,097 additions
and
382 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
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,4 @@ | ||
export * from './extension'; | ||
export * from './provider'; | ||
export * as asset from './types'; | ||
export * from './utils'; | ||
export * from './types'; |
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,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,22 @@ | ||
import { XcmV3Junctions, XcmV3Junction } from '@polkadot-api/descriptors'; | ||
|
||
import { AnyParachain, Asset, multiloc } from '@galacticcouncil/xcm-core'; | ||
|
||
import { XcmV3Multilocation } from './types'; | ||
|
||
export const getFeeAsset = (chain: AnyParachain, asset: Asset) => { | ||
const location = chain.getAssetXcmLocation(asset); | ||
if (location) { | ||
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; | ||
} | ||
throw new Error('Asset locations not found'); | ||
}; |
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
Oops, something went wrong.