-
Notifications
You must be signed in to change notification settings - Fork 9
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
Elmar Kenigs
authored
Mar 30, 2023
1 parent
6a69234
commit 6e01259
Showing
23 changed files
with
406 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { AssetSymbol, ChainKey } from '../../../constants'; | ||
import { | ||
EqBalancesFee, | ||
EqBalancesSuccessEvent, | ||
} from '../../../extrinsic/eqBalances'; | ||
import { | ||
assets, | ||
balance, | ||
chains, | ||
extrinsic, | ||
withdraw, | ||
} from '../moonbase.common'; | ||
import { MoonbaseXcmConfig } from '../moonbase.interfaces'; | ||
|
||
const asset = assets[AssetSymbol.EQ]; | ||
const eqa = chains[ChainKey.EquilibriumAlphanet]; | ||
const eqId = 25_969; | ||
|
||
export const EQ: MoonbaseXcmConfig = { | ||
asset, | ||
origin: eqa, | ||
deposit: { | ||
[eqa.key]: { | ||
source: eqa, | ||
balance: balance.systemEquilibrium(eqId), | ||
extrinsic: extrinsic | ||
.eqBalances() | ||
.xcmTransfer() | ||
.successEvent(EqBalancesSuccessEvent.ExtrinsicSuccess) | ||
.asset(eqId) | ||
.fee(EqBalancesFee.ThisAccWillPay), | ||
}, | ||
}, | ||
withdraw: { | ||
[eqa.key]: withdraw.xTokens({ | ||
balance: balance.systemEquilibrium(eqId), | ||
destination: eqa, | ||
feePerWeight: 3.5, | ||
}), | ||
}, | ||
}; |
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,49 @@ | ||
import { AssetSymbol, ChainKey } from '../../../constants'; | ||
import { | ||
EqBalancesFee, | ||
EqBalancesSuccessEvent, | ||
} from '../../../extrinsic/eqBalances'; | ||
import { | ||
assets, | ||
balance, | ||
chains, | ||
extrinsic, | ||
moonbase, | ||
withdraw, | ||
} from '../moonbase.common'; | ||
import { MoonbaseXcmConfig } from '../moonbase.interfaces'; | ||
|
||
const asset = assets[AssetSymbol.EQD]; | ||
const feeAsset = assets[AssetSymbol.EQ]; | ||
const eqa = chains[ChainKey.EquilibriumAlphanet]; | ||
const eqId = 25_969; | ||
const eqdId = 6_648_164; | ||
|
||
export const EQD: MoonbaseXcmConfig = { | ||
asset, | ||
origin: moonbase, | ||
deposit: { | ||
[eqa.key]: { | ||
source: eqa, | ||
balance: balance.systemEquilibrium(eqdId), | ||
sourceFeeBalance: balance.systemEquilibrium(eqId), | ||
xcmFeeAsset: { | ||
asset: feeAsset, | ||
balance: balance.systemEquilibrium(eqId), | ||
}, | ||
extrinsic: extrinsic | ||
.eqBalances() | ||
.xcmTransfer() | ||
.successEvent(EqBalancesSuccessEvent.ExtrinsicSuccess) | ||
.asset(eqdId) | ||
.fee(EqBalancesFee.ThisAccWillPay), | ||
}, | ||
}, | ||
withdraw: { | ||
[eqa.key]: withdraw.xTokens({ | ||
balance: balance.systemEquilibrium(eqdId), | ||
destination: eqa, | ||
feePerWeight: 0.05, | ||
}), | ||
}, | ||
}; |
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
34 changes: 34 additions & 0 deletions
34
packages/config/src/extrinsic/eqBalances/__snapshots__/eqBalances.test.ts.snap
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,34 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`eqBalances xcmTransfer should be correct config 1`] = ` | ||
{ | ||
"extrinsic": "xcmTransfer", | ||
"getParams": [Function], | ||
"pallet": "eqBalances", | ||
"successEvent": "ExtrinsicSuccess", | ||
} | ||
`; | ||
|
||
exports[`eqBalances xcmTransfer should get correct params 1`] = ` | ||
[ | ||
25969, | ||
1000n, | ||
{ | ||
"interior": { | ||
"X2": [ | ||
{ | ||
"Parachain": 1000, | ||
}, | ||
{ | ||
"AccountKey20": { | ||
"key": "0xeF46c7649270C912704fB09B75097f6E32208b85", | ||
"network": "Any", | ||
}, | ||
}, | ||
], | ||
}, | ||
"parents": 1, | ||
}, | ||
"SovereignAccWillPay", | ||
] | ||
`; |
13 changes: 13 additions & 0 deletions
13
packages/config/src/extrinsic/eqBalances/eqBalances.constants.ts
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,13 @@ | ||
export enum EqBalancesExtrinsic { | ||
XcmTransfer = 'xcmTransfer', | ||
} | ||
|
||
export enum EqBalancesSuccessEvent { | ||
ExtrinsicSuccess = 'ExtrinsicSuccess', | ||
} | ||
|
||
export enum EqBalancesFee { | ||
SovereignAccWillPay = 'SovereignAccWillPay', | ||
TargetChainAccWillPay = 'TargetChainAccWillPay', | ||
ThisAccWillPay = 'ThisAccWillPay', | ||
} |
Oops, something went wrong.