-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply XcmPaymentApi fees in transactions to Moonbeam / Moonriver / Mo…
…onbase-Alpha (#351) * -wip- initial commit and initial configs * -wip- extract common code * -wip- fix some types * -wip- TODOs and refactoring * -wip- group all in a single function * -wip- apply to all Acala and Hydration routes * -wip- apply to manta routes * apply xcmv4 and solution for registered asset id for ERC20s * sort assets, handle different palletInstances and apply to several configs * remove unused property * remove logs * remove deleted routes from snapshots * apply new configuration to Kusama chains * add changeset * remove assetTypeUnitsPerSecond function since it is not used now * remove assetTypeUnitsPerSecond function since it is not used now * apply PR reviews
- Loading branch information
Showing
60 changed files
with
700 additions
and
231 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
'@moonbeam-network/xcm-builder': minor | ||
'@moonbeam-network/xcm-config': minor | ||
'@moonbeam-network/xcm-types': minor | ||
'@moonbeam-network/xcm-sdk': minor | ||
--- | ||
|
||
Implement XcmPaymentApi to calculate fees for routes going to Moonbeam / Moonriver / Moonbase-Alpha |
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,12 +1,28 @@ | ||
import { ChainAssetId } from '@moonbeam-network/xcm-types'; | ||
import { AnyParachain, ChainAssetId } from '@moonbeam-network/xcm-types'; | ||
import { ApiPromise } from '@polkadot/api'; | ||
import { Enum } from '@polkadot/types'; | ||
import { StagingXcmV3MultiLocation } from '@polkadot/types/lookup'; | ||
import { SubstrateCallConfig } from '../types/substrate/SubstrateCallConfig'; | ||
|
||
export interface FeeConfigBuilder { | ||
build: (params: FeeConfigBuilderPrams) => SubstrateCallConfig; | ||
} | ||
|
||
export interface FeeConfigBuilderPrams { | ||
asset: ChainAssetId; | ||
address: string; | ||
api: ApiPromise; | ||
feeAsset: ChainAssetId; | ||
transferAsset: ChainAssetId; | ||
chain: AnyParachain; | ||
} | ||
|
||
export interface XcmPaymentFeeProps { | ||
isAssetReserveChain: boolean; | ||
shouldTransferAssetPrecedeAsset?: boolean; | ||
} | ||
|
||
export interface MoonbeamRuntimeXcmConfigAssetType extends Enum { | ||
readonly isXcm: boolean; | ||
readonly asXcm: StagingXcmV3MultiLocation; | ||
readonly type: 'Xcm'; | ||
} |
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.