-
Notifications
You must be signed in to change notification settings - Fork 36
/
overseer-config.ts
37 lines (35 loc) · 953 Bytes
/
overseer-config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { LCDClient } from '@terra-money/terra.js';
import {
AddressProvider,
MARKET_DENOMS,
} from '../../address-provider/provider';
interface Option {
lcd: LCDClient;
overseer: MARKET_DENOMS;
}
interface ConfigResponse {
ownerAddr: string;
oracle_contract: string;
market_contract: string;
collector_contract: string;
liquidation_contract: string;
threshold_deposit_rate: string;
distribution_threshold_rate: string;
target_deposit_rate: string;
buffer_distribution_factor: string;
stable_denom: string;
epoch_period: number;
price_timeframe: number;
}
export const queryOverseerConfig = ({ lcd, overseer }: Option) => async (
addressProvider: AddressProvider,
): Promise<ConfigResponse> => {
const overseerContractAddress = addressProvider.overseer(overseer);
const response: ConfigResponse = await lcd.wasm.contractQuery(
overseerContractAddress,
{
config: {},
},
);
return response;
};