Skip to content

Commit

Permalink
update v1 contract from config file to api
Browse files Browse the repository at this point in the history
  • Loading branch information
xieqian committed Jan 24, 2024
1 parent 72cd9d3 commit 1503e85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions interfaces/burrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export interface IConfig {
maximum_staleness_duration_sec: number;
minimum_staking_duration_sec: number;
oracle_account_id: string;
ref_exchange_id: string;
owner_id: string;
x_booster_multiplier_at_maximum_staking_duration: number;
}
Expand Down
15 changes: 7 additions & 8 deletions utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Contract } from "near-api-js";
import BN from "bn.js";
import Decimal from "decimal.js";

import { defaultNetwork, LOGIC_CONTRACT_NAME, REFV1_CONTRACT_NAME } from "./config";
import { defaultNetwork, LOGIC_CONTRACT_NAME } from "./config";
import { nearMetadata, wooMetadata } from "../components/Assets";

import {
Expand Down Expand Up @@ -139,13 +139,6 @@ export const getBurrow = async ({
ViewMethodsLogic,
ChangeMethodsLogic,
);
const refv1Contract: Contract = await getContract(
account,
REFV1_CONTRACT_NAME,
ViewMethodsREFV1,
ChangeMethodsREFV1,
);

// get oracle address from
const config = (await view(
logicContract,
Expand All @@ -158,6 +151,12 @@ export const getBurrow = async ({
ViewMethodsOracle,
ChangeMethodsOracle,
);
const refv1Contract: Contract = await getContract(
account,
config.ref_exchange_id,
ViewMethodsREFV1,
ChangeMethodsREFV1,
);

if (localStorage.getItem("near-wallet-selector:selectedWalletId") == null) {
if (
Expand Down

0 comments on commit 1503e85

Please sign in to comment.