Skip to content

Commit

Permalink
BNCS integration with Moonbeam (#229)
Browse files Browse the repository at this point in the history
* BNCS integration with Moonbeam

* BNCS integration with Moonbeam

* Update packages/config/src/configs/moonbeam.ts

Co-authored-by: mmaurello <[email protected]>

* Update packages/config/src/configs/moonbeam.ts

Co-authored-by: mmaurello <[email protected]>

* Update packages/config/src/configs/bifrostPolkadot.ts

Co-authored-by: mmaurello <[email protected]>

* Update packages/config/src/configs/moonbeam.ts

Co-authored-by: mmaurello <[email protected]>

---------

Co-authored-by: mmaurello <[email protected]>
  • Loading branch information
awesomepan and mmaurello authored Apr 15, 2024
1 parent ddd6079 commit 9df6359
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/blue-ducks-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@moonbeam-network/xcm-config': patch
---

BNCS integration with Moonbeam
6 changes: 6 additions & 0 deletions packages/config/src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ export const bnc = new Asset({
originSymbol: 'BNC',
});

export const bncs = new Asset({
key: 'bncs',
originSymbol: 'BNCS',
});

export const cfg = new Asset({
key: 'cfg',
originSymbol: 'CFG',
Expand Down Expand Up @@ -349,6 +354,7 @@ export const assetsList: Asset[] = [
auq,
aseed,
bnc,
bncs,
cfg,
crab,
csm,
Expand Down
9 changes: 9 additions & 0 deletions packages/config/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
auq,
betaDEV,
bnc,
bncs,
cfg,
crab,
csm,
Expand Down Expand Up @@ -210,6 +211,10 @@ export const bifrostPolkadot = new Parachain({
asset: bnc,
id: { Native: bnc.originSymbol },
},
{
asset: bncs,
id: { Token2: 9 },
},
{
asset: fil,
id: { Token2: 4 },
Expand Down Expand Up @@ -784,6 +789,10 @@ export const moonbeam = new EvmParachain({
asset: bnc,
id: '165823357460190568952172802245839421906',
},
{
asset: bncs,
id: '142155548796783636521833385094843759961',
},
{
asset: cfg,
id: '91372035960551235635465443179559840483',
Expand Down
18 changes: 17 additions & 1 deletion packages/config/src/configs/bifrostPolkadot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ExtrinsicBuilder,
FeeBuilder,
} from '@moonbeam-network/xcm-builder';
import { bnc, fil, glmr, vastr, vdot, vfil, vglmr, vmanta } from '../assets';
import { bnc, bncs, fil, glmr, vastr, vdot, vfil, vglmr, vmanta } from '../assets';

Check failure on line 7 in packages/config/src/configs/bifrostPolkadot.ts

View workflow job for this annotation

GitHub Actions / unit

Replace `·bnc,·bncs,·fil,·glmr,·vastr,·vdot,·vfil,·vglmr,·vmanta·` with `⏎··bnc,⏎··bncs,⏎··fil,⏎··glmr,⏎··vastr,⏎··vdot,⏎··vfil,⏎··vglmr,⏎··vmanta,⏎`
import { bifrostPolkadot, moonbeam } from '../chains';
import { AssetConfig } from '../types/AssetConfig';
import { ChainConfig } from '../types/ChainConfig';
Expand Down Expand Up @@ -134,6 +134,22 @@ export const bifrostPolkadotConfig = new ChainConfig({
},
min: AssetMinBuilder().assetRegistry().currencyMetadatas(),
}),
new AssetConfig({
asset: bncs,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: moonbeam,
destinationFee: {
amount: 0.05,
asset: bnc,
balance: BalanceBuilder().substrate().system().account(),
},
extrinsic: ExtrinsicBuilder().xTokens().transferMultiCurrencies(),
fee: {
asset: bnc,
balance: BalanceBuilder().substrate().system().account(),
},
min: AssetMinBuilder().assetRegistry().currencyMetadatas(),
}),
],
chain: bifrostPolkadot,
});
16 changes: 16 additions & 0 deletions packages/config/src/configs/moonbeam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
aseed,
astr,
bnc,
bncs,
cfg,
dai,
ded,
Expand Down Expand Up @@ -740,6 +741,21 @@ export const moonbeamConfig = new ChainConfig({
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: bncs,
balance: BalanceBuilder().substrate().assets().account(),
contract: ContractBuilder().Xtokens().transfer(),
destination: bifrostPolkadot,
destinationFee: {
amount: 0.0001,
asset: bncs,
balance: BalanceBuilder().substrate().assets().account(),
},
fee: {
asset: glmr,
balance: BalanceBuilder().substrate().system().account(),
},
}),
],
chain: moonbeam,
});

0 comments on commit 9df6359

Please sign in to comment.