Skip to content

Commit

Permalink
use lend vault params
Browse files Browse the repository at this point in the history
Signed-off-by: Gregory Hill <gregorydhill@outlook.com>
  • Loading branch information
gregdhill committed Feb 12, 2024
1 parent 4af205f commit b7cb87c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/register-asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const NEW_ASSET = {
function vaultRegistryCalls(
api: ApiPromise,
collateralCurrency: { ForeignAsset: number } | { LendToken: number },
vaultParams: any,
) {
const {
wrappedCurrency,
Expand All @@ -96,7 +97,7 @@ function vaultRegistryCalls(
secureCollateral,
minimumCollateral,
systemCollateralCeiling
} = NEW_ASSET.vaultParams;
} = vaultParams;
const currencyPair = {
collateral: collateralCurrency,
wrapped: wrappedCurrency,
Expand Down Expand Up @@ -133,10 +134,10 @@ async function main(): Promise<void> {
paraApi.tx.loans.activateMarket(currencyId)
]);

allCalls.push(...vaultRegistryCalls(paraApi, currencyId));
allCalls.push(...vaultRegistryCalls(paraApi, currencyId, NEW_ASSET.vaultParams));

const lendCurrencyId = NEW_ASSET.market.lendTokenId;
allCalls.push(...vaultRegistryCalls(paraApi, lendCurrencyId));
allCalls.push(...vaultRegistryCalls(paraApi, lendCurrencyId, NEW_ASSET.lendVaultParams));

const batched = paraApi.tx.utility.batchAll(allCalls);

Expand Down

0 comments on commit b7cb87c

Please sign in to comment.