Skip to content

Commit

Permalink
Mint relay chain tokens on initialization (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
Szegoo authored Jun 20, 2024
1 parent 9eeb7cf commit abbd00c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/regionx/index.init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ export async function regionxInit(relayEndpoint: string, regionxEndpoint: string
const relayApi = await ApiPromise.create({ provider: relayWsProvider });

await setupRelayAsset(regionxApi);
const giveRcTokensCall = regionxApi.tx.tokens.setBalance(alice.address, RELAY_ASSET_ID, 10n ** 18n, 0);
await force(regionxApi, giveRcTokensCall);

if (regionxAccount) {
const giveBalanceCall = regionxApi.tx.balances.forceSetBalance(regionxAccount, 10n ** 18n);
await force(regionxApi, giveBalanceCall);
const giveRcTokensCall = regionxApi.tx.tokens.setBalance(regionxAccount, RELAY_ASSET_ID, 10n ** 18n, 0);
await force(regionxApi, regionxApi.tx.utility.batch([giveBalanceCall, giveRcTokensCall]));
await transferRelayTokensToRegionX(100n * 10n ** 12n, regionxAccount, relayApi, alice);
}

Expand Down

0 comments on commit abbd00c

Please sign in to comment.