-
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.
- Loading branch information
Showing
65 changed files
with
3,871 additions
and
2,642 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,5 @@ | ||
--- | ||
'@moonbeam-network/xcm-config': patch | ||
--- | ||
|
||
Adjust kbtc and ibtc fees |
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,68 +1,65 @@ | ||
import { | ||
import type { | ||
AssetMinConfigBuilder, | ||
BalanceConfigBuilder, | ||
ContractConfigBuilder, | ||
ExtrinsicConfigBuilder, | ||
FeeConfigBuilder, | ||
} from '@moonbeam-network/xcm-builder'; | ||
import { AnyChain, Asset } from '@moonbeam-network/xcm-types'; | ||
import type { AnyChain, Asset } from '@moonbeam-network/xcm-types'; | ||
|
||
export interface AssetRouteConstructorParams { | ||
asset: Asset; | ||
balance: BalanceConfigBuilder; | ||
source: SourceConfig; | ||
destination: DestinationConfig; | ||
contract?: ContractConfigBuilder; | ||
destination: AnyChain; | ||
destinationFee: DestinationFeeConfig; | ||
extrinsic?: ExtrinsicConfigBuilder; | ||
fee?: FeeAssetConfig; | ||
} | ||
|
||
export interface SourceConfig { | ||
chain: AnyChain; | ||
balance: BalanceConfigBuilder; | ||
fee?: FeeConfig; | ||
min?: AssetMinConfigBuilder; | ||
} | ||
|
||
export interface DestinationFeeConfig extends FeeAssetConfig { | ||
amount: number | FeeConfigBuilder; | ||
export interface DestinationConfig extends Omit<SourceConfig, 'fee'> { | ||
fee: DestinationFeeConfig; | ||
} | ||
|
||
export interface FeeAssetConfig { | ||
export interface FeeConfig { | ||
asset: Asset; | ||
balance: BalanceConfigBuilder; | ||
// Sometimes we need to add some extra amount ("XCM Delivery Fee") to a fee that is returned by "paymentInfo" for extrinsic to not fail. | ||
// NOTE: Sometimes we need to add some extra amount ("XCM Delivery Fee") to a fee | ||
// that is returned by "paymentInfo" for extrinsic to not fail. | ||
extra?: number; | ||
} | ||
|
||
export interface DestinationFeeConfig extends FeeConfig { | ||
amount: number | FeeConfigBuilder; | ||
} | ||
|
||
export class AssetRoute { | ||
readonly asset: Asset; | ||
|
||
readonly balance: BalanceConfigBuilder; | ||
readonly source: SourceConfig; | ||
|
||
readonly contract?: ContractConfigBuilder; | ||
readonly destination: DestinationConfig; | ||
|
||
readonly destination: AnyChain; | ||
|
||
readonly destinationFee: DestinationFeeConfig; | ||
readonly contract?: ContractConfigBuilder; | ||
|
||
readonly extrinsic?: ExtrinsicConfigBuilder; | ||
|
||
readonly fee?: FeeAssetConfig; | ||
|
||
readonly min?: AssetMinConfigBuilder; | ||
|
||
constructor({ | ||
asset, | ||
balance, | ||
contract, | ||
source, | ||
destination, | ||
destinationFee, | ||
contract, | ||
extrinsic, | ||
fee, | ||
min, | ||
}: AssetRouteConstructorParams) { | ||
this.asset = asset; | ||
this.balance = balance; | ||
this.contract = contract; | ||
this.source = source; | ||
this.destination = destination; | ||
this.destinationFee = destinationFee; | ||
this.contract = contract; | ||
this.extrinsic = extrinsic; | ||
this.fee = fee; | ||
this.min = min; | ||
} | ||
} |
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.