baluni-contracts
Version:
Smart Contracts for Baluni
741 lines (687 loc) • 20 kB
text/typescript
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type {
BaseContract,
BigNumberish,
BytesLike,
FunctionFragment,
Result,
Interface,
AddressLike,
ContractRunner,
ContractMethod,
Listener,
} from "ethers";
import type {
TypedContractEvent,
TypedDeferredTopicFilter,
TypedEventLog,
TypedListener,
TypedContractMethod,
} from "../../common";
export declare namespace IBaluniV1Agent {
export type CallStruct = {
to: AddressLike;
value: BigNumberish;
data: BytesLike;
};
export type CallStructOutput = [to: string, value: bigint, data: string] & {
to: string;
value: bigint;
data: string;
};
}
export interface IBaluniV1RouterInterface extends Interface {
getFunction(
nameOrSignature:
| "USDC"
| "WNATIVE"
| "_BPS_BASE"
| "_BPS_FEE"
| "_MAX_BPS_FEE"
| "agentFactory"
| "baluniFactory"
| "baluniPeriphery"
| "burnERC20"
| "burnUSDC"
| "calculateTokenShare"
| "callRebalance"
| "changeAgentFactory"
| "changeBpsFee"
| "changeMarketOracle"
| "changeRebalancer"
| "changeTreasury"
| "execute"
| "fetchMarketPrices"
| "getAgentAddress"
| "getTokens"
| "getUSDCShareValue"
| "getVersion"
| "initialize"
| "initializeMarketOracle"
| "liquidate"
| "liquidateAll"
| "marketOracle"
| "mintWithUSDC"
| "oracle"
| "rebalancer"
| "reinitialize"
| "requiredUSDCtoMint"
| "tokenValuation"
| "totalValuation"
| "treasury"
| "uniswapFactory"
| "uniswapRouter"
| "unitPrice"
): FunctionFragment;
encodeFunctionData(functionFragment: "USDC", values?: undefined): string;
encodeFunctionData(functionFragment: "WNATIVE", values?: undefined): string;
encodeFunctionData(functionFragment: "_BPS_BASE", values?: undefined): string;
encodeFunctionData(functionFragment: "_BPS_FEE", values?: undefined): string;
encodeFunctionData(
functionFragment: "_MAX_BPS_FEE",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "agentFactory",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "baluniFactory",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "baluniPeriphery",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "burnERC20",
values: [BigNumberish]
): string;
encodeFunctionData(
functionFragment: "burnUSDC",
values: [BigNumberish]
): string;
encodeFunctionData(
functionFragment: "calculateTokenShare",
values: [BigNumberish, BigNumberish, BigNumberish, BigNumberish]
): string;
encodeFunctionData(
functionFragment: "callRebalance",
values: [
AddressLike[],
BigNumberish[],
AddressLike,
AddressLike,
BigNumberish,
AddressLike
]
): string;
encodeFunctionData(
functionFragment: "changeAgentFactory",
values: [AddressLike]
): string;
encodeFunctionData(
functionFragment: "changeBpsFee",
values: [BigNumberish]
): string;
encodeFunctionData(
functionFragment: "changeMarketOracle",
values: [AddressLike]
): string;
encodeFunctionData(
functionFragment: "changeRebalancer",
values: [AddressLike]
): string;
encodeFunctionData(
functionFragment: "changeTreasury",
values: [AddressLike]
): string;
encodeFunctionData(
functionFragment: "execute",
values: [IBaluniV1Agent.CallStruct[], AddressLike[]]
): string;
encodeFunctionData(
functionFragment: "fetchMarketPrices",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "getAgentAddress",
values: [AddressLike]
): string;
encodeFunctionData(functionFragment: "getTokens", values?: undefined): string;
encodeFunctionData(
functionFragment: "getUSDCShareValue",
values: [BigNumberish]
): string;
encodeFunctionData(
functionFragment: "getVersion",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "initialize",
values: [
AddressLike,
AddressLike,
AddressLike,
AddressLike,
AddressLike,
AddressLike
]
): string;
encodeFunctionData(
functionFragment: "initializeMarketOracle",
values: [AddressLike]
): string;
encodeFunctionData(
functionFragment: "liquidate",
values: [AddressLike]
): string;
encodeFunctionData(
functionFragment: "liquidateAll",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "marketOracle",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "mintWithUSDC",
values: [BigNumberish]
): string;
encodeFunctionData(functionFragment: "oracle", values?: undefined): string;
encodeFunctionData(
functionFragment: "rebalancer",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "reinitialize",
values: [
AddressLike,
AddressLike,
AddressLike,
AddressLike,
AddressLike,
AddressLike,
BigNumberish
]
): string;
encodeFunctionData(
functionFragment: "requiredUSDCtoMint",
values: [BigNumberish]
): string;
encodeFunctionData(
functionFragment: "tokenValuation",
values: [BigNumberish, AddressLike]
): string;
encodeFunctionData(
functionFragment: "totalValuation",
values?: undefined
): string;
encodeFunctionData(functionFragment: "treasury", values?: undefined): string;
encodeFunctionData(
functionFragment: "uniswapFactory",
values?: undefined
): string;
encodeFunctionData(
functionFragment: "uniswapRouter",
values?: undefined
): string;
encodeFunctionData(functionFragment: "unitPrice", values?: undefined): string;
decodeFunctionResult(functionFragment: "USDC", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "WNATIVE", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "_BPS_BASE", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "_BPS_FEE", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "_MAX_BPS_FEE",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "agentFactory",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "baluniFactory",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "baluniPeriphery",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "burnERC20", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "burnUSDC", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "calculateTokenShare",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "callRebalance",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "changeAgentFactory",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "changeBpsFee",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "changeMarketOracle",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "changeRebalancer",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "changeTreasury",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "execute", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "fetchMarketPrices",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "getAgentAddress",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "getTokens", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "getUSDCShareValue",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "getVersion", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "initializeMarketOracle",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "liquidate", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "liquidateAll",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "marketOracle",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "mintWithUSDC",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "oracle", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "rebalancer", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "reinitialize",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "requiredUSDCtoMint",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "tokenValuation",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "totalValuation",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "treasury", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "uniswapFactory",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "uniswapRouter",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "unitPrice", data: BytesLike): Result;
}
export interface IBaluniV1Router extends BaseContract {
connect(runner?: ContractRunner | null): IBaluniV1Router;
waitForDeployment(): Promise<this>;
interface: IBaluniV1RouterInterface;
queryFilter<TCEvent extends TypedContractEvent>(
event: TCEvent,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TypedEventLog<TCEvent>>>;
queryFilter<TCEvent extends TypedContractEvent>(
filter: TypedDeferredTopicFilter<TCEvent>,
fromBlockOrBlockhash?: string | number | undefined,
toBlock?: string | number | undefined
): Promise<Array<TypedEventLog<TCEvent>>>;
on<TCEvent extends TypedContractEvent>(
event: TCEvent,
listener: TypedListener<TCEvent>
): Promise<this>;
on<TCEvent extends TypedContractEvent>(
filter: TypedDeferredTopicFilter<TCEvent>,
listener: TypedListener<TCEvent>
): Promise<this>;
once<TCEvent extends TypedContractEvent>(
event: TCEvent,
listener: TypedListener<TCEvent>
): Promise<this>;
once<TCEvent extends TypedContractEvent>(
filter: TypedDeferredTopicFilter<TCEvent>,
listener: TypedListener<TCEvent>
): Promise<this>;
listeners<TCEvent extends TypedContractEvent>(
event: TCEvent
): Promise<Array<TypedListener<TCEvent>>>;
listeners(eventName?: string): Promise<Array<Listener>>;
removeAllListeners<TCEvent extends TypedContractEvent>(
event?: TCEvent
): Promise<this>;
USDC: TypedContractMethod<[], [string], "view">;
WNATIVE: TypedContractMethod<[], [string], "view">;
_BPS_BASE: TypedContractMethod<[], [bigint], "view">;
_BPS_FEE: TypedContractMethod<[], [bigint], "view">;
_MAX_BPS_FEE: TypedContractMethod<[], [bigint], "view">;
agentFactory: TypedContractMethod<[], [string], "view">;
baluniFactory: TypedContractMethod<[], [string], "view">;
baluniPeriphery: TypedContractMethod<[], [string], "view">;
burnERC20: TypedContractMethod<
[burnAmount: BigNumberish],
[void],
"nonpayable"
>;
burnUSDC: TypedContractMethod<
[burnAmount: BigNumberish],
[void],
"nonpayable"
>;
calculateTokenShare: TypedContractMethod<
[
totalBaluni: BigNumberish,
totalERC20Balance: BigNumberish,
baluniAmount: BigNumberish,
tokenDecimals: BigNumberish
],
[bigint],
"view"
>;
callRebalance: TypedContractMethod<
[
assets: AddressLike[],
weights: BigNumberish[],
sender: AddressLike,
receiver: AddressLike,
limit: BigNumberish,
baseAsset: AddressLike
],
[void],
"nonpayable"
>;
changeAgentFactory: TypedContractMethod<
[_agentFactory: AddressLike],
[void],
"nonpayable"
>;
changeBpsFee: TypedContractMethod<
[_newFee: BigNumberish],
[void],
"nonpayable"
>;
changeMarketOracle: TypedContractMethod<
[_marketOracle: AddressLike],
[void],
"nonpayable"
>;
changeRebalancer: TypedContractMethod<
[_newRebalancer: AddressLike],
[void],
"nonpayable"
>;
changeTreasury: TypedContractMethod<
[_newTreasury: AddressLike],
[void],
"nonpayable"
>;
execute: TypedContractMethod<
[calls: IBaluniV1Agent.CallStruct[], tokensReturn: AddressLike[]],
[void],
"nonpayable"
>;
fetchMarketPrices: TypedContractMethod<[], [[bigint, bigint]], "view">;
getAgentAddress: TypedContractMethod<[_user: AddressLike], [string], "view">;
getTokens: TypedContractMethod<[], [string[]], "view">;
getUSDCShareValue: TypedContractMethod<
[amount: BigNumberish],
[bigint],
"view"
>;
getVersion: TypedContractMethod<[], [bigint], "view">;
initialize: TypedContractMethod<
[
_usdc: AddressLike,
_wnative: AddressLike,
_1inchSpotAgg: AddressLike,
_uniRouter: AddressLike,
_uniFactory: AddressLike,
_rebalancer: AddressLike
],
[void],
"nonpayable"
>;
initializeMarketOracle: TypedContractMethod<
[_marketOracle: AddressLike],
[void],
"nonpayable"
>;
liquidate: TypedContractMethod<[token: AddressLike], [void], "nonpayable">;
liquidateAll: TypedContractMethod<[], [void], "nonpayable">;
marketOracle: TypedContractMethod<[], [string], "view">;
mintWithUSDC: TypedContractMethod<
[balAmountToMint: BigNumberish],
[void],
"nonpayable"
>;
oracle: TypedContractMethod<[], [string], "view">;
rebalancer: TypedContractMethod<[], [string], "view">;
reinitialize: TypedContractMethod<
[
_usdc: AddressLike,
_wnative: AddressLike,
_1inchSpotAgg: AddressLike,
_uniRouter: AddressLike,
_uniFactory: AddressLike,
_rebalancer: AddressLike,
version: BigNumberish
],
[void],
"nonpayable"
>;
requiredUSDCtoMint: TypedContractMethod<
[balAmountToMint: BigNumberish],
[bigint],
"view"
>;
tokenValuation: TypedContractMethod<
[amount: BigNumberish, token: AddressLike],
[bigint],
"view"
>;
totalValuation: TypedContractMethod<[], [bigint], "view">;
treasury: TypedContractMethod<[], [string], "view">;
uniswapFactory: TypedContractMethod<[], [string], "view">;
uniswapRouter: TypedContractMethod<[], [string], "view">;
unitPrice: TypedContractMethod<[], [bigint], "view">;
getFunction<T extends ContractMethod = ContractMethod>(
key: string | FunctionFragment
): T;
getFunction(
nameOrSignature: "USDC"
): TypedContractMethod<[], [string], "view">;
getFunction(
nameOrSignature: "WNATIVE"
): TypedContractMethod<[], [string], "view">;
getFunction(
nameOrSignature: "_BPS_BASE"
): TypedContractMethod<[], [bigint], "view">;
getFunction(
nameOrSignature: "_BPS_FEE"
): TypedContractMethod<[], [bigint], "view">;
getFunction(
nameOrSignature: "_MAX_BPS_FEE"
): TypedContractMethod<[], [bigint], "view">;
getFunction(
nameOrSignature: "agentFactory"
): TypedContractMethod<[], [string], "view">;
getFunction(
nameOrSignature: "baluniFactory"
): TypedContractMethod<[], [string], "view">;
getFunction(
nameOrSignature: "baluniPeriphery"
): TypedContractMethod<[], [string], "view">;
getFunction(
nameOrSignature: "burnERC20"
): TypedContractMethod<[burnAmount: BigNumberish], [void], "nonpayable">;
getFunction(
nameOrSignature: "burnUSDC"
): TypedContractMethod<[burnAmount: BigNumberish], [void], "nonpayable">;
getFunction(
nameOrSignature: "calculateTokenShare"
): TypedContractMethod<
[
totalBaluni: BigNumberish,
totalERC20Balance: BigNumberish,
baluniAmount: BigNumberish,
tokenDecimals: BigNumberish
],
[bigint],
"view"
>;
getFunction(
nameOrSignature: "callRebalance"
): TypedContractMethod<
[
assets: AddressLike[],
weights: BigNumberish[],
sender: AddressLike,
receiver: AddressLike,
limit: BigNumberish,
baseAsset: AddressLike
],
[void],
"nonpayable"
>;
getFunction(
nameOrSignature: "changeAgentFactory"
): TypedContractMethod<[_agentFactory: AddressLike], [void], "nonpayable">;
getFunction(
nameOrSignature: "changeBpsFee"
): TypedContractMethod<[_newFee: BigNumberish], [void], "nonpayable">;
getFunction(
nameOrSignature: "changeMarketOracle"
): TypedContractMethod<[_marketOracle: AddressLike], [void], "nonpayable">;
getFunction(
nameOrSignature: "changeRebalancer"
): TypedContractMethod<[_newRebalancer: AddressLike], [void], "nonpayable">;
getFunction(
nameOrSignature: "changeTreasury"
): TypedContractMethod<[_newTreasury: AddressLike], [void], "nonpayable">;
getFunction(
nameOrSignature: "execute"
): TypedContractMethod<
[calls: IBaluniV1Agent.CallStruct[], tokensReturn: AddressLike[]],
[void],
"nonpayable"
>;
getFunction(
nameOrSignature: "fetchMarketPrices"
): TypedContractMethod<[], [[bigint, bigint]], "view">;
getFunction(
nameOrSignature: "getAgentAddress"
): TypedContractMethod<[_user: AddressLike], [string], "view">;
getFunction(
nameOrSignature: "getTokens"
): TypedContractMethod<[], [string[]], "view">;
getFunction(
nameOrSignature: "getUSDCShareValue"
): TypedContractMethod<[amount: BigNumberish], [bigint], "view">;
getFunction(
nameOrSignature: "getVersion"
): TypedContractMethod<[], [bigint], "view">;
getFunction(
nameOrSignature: "initialize"
): TypedContractMethod<
[
_usdc: AddressLike,
_wnative: AddressLike,
_1inchSpotAgg: AddressLike,
_uniRouter: AddressLike,
_uniFactory: AddressLike,
_rebalancer: AddressLike
],
[void],
"nonpayable"
>;
getFunction(
nameOrSignature: "initializeMarketOracle"
): TypedContractMethod<[_marketOracle: AddressLike], [void], "nonpayable">;
getFunction(
nameOrSignature: "liquidate"
): TypedContractMethod<[token: AddressLike], [void], "nonpayable">;
getFunction(
nameOrSignature: "liquidateAll"
): TypedContractMethod<[], [void], "nonpayable">;
getFunction(
nameOrSignature: "marketOracle"
): TypedContractMethod<[], [string], "view">;
getFunction(
nameOrSignature: "mintWithUSDC"
): TypedContractMethod<[balAmountToMint: BigNumberish], [void], "nonpayable">;
getFunction(
nameOrSignature: "oracle"
): TypedContractMethod<[], [string], "view">;
getFunction(
nameOrSignature: "rebalancer"
): TypedContractMethod<[], [string], "view">;
getFunction(
nameOrSignature: "reinitialize"
): TypedContractMethod<
[
_usdc: AddressLike,
_wnative: AddressLike,
_1inchSpotAgg: AddressLike,
_uniRouter: AddressLike,
_uniFactory: AddressLike,
_rebalancer: AddressLike,
version: BigNumberish
],
[void],
"nonpayable"
>;
getFunction(
nameOrSignature: "requiredUSDCtoMint"
): TypedContractMethod<[balAmountToMint: BigNumberish], [bigint], "view">;
getFunction(
nameOrSignature: "tokenValuation"
): TypedContractMethod<
[amount: BigNumberish, token: AddressLike],
[bigint],
"view"
>;
getFunction(
nameOrSignature: "totalValuation"
): TypedContractMethod<[], [bigint], "view">;
getFunction(
nameOrSignature: "treasury"
): TypedContractMethod<[], [string], "view">;
getFunction(
nameOrSignature: "uniswapFactory"
): TypedContractMethod<[], [string], "view">;
getFunction(
nameOrSignature: "uniswapRouter"
): TypedContractMethod<[], [string], "view">;
getFunction(
nameOrSignature: "unitPrice"
): TypedContractMethod<[], [bigint], "view">;
filters: {};
}