opnet
Version:
The perfect library for building Bitcoin-based applications.
209 lines (208 loc) • 7.53 kB
TypeScript
import { Address } from '@btc-vision/transaction';
import { CallResult, OPNetEvent } from '../../../../opnet';
import { IOP_NETContract } from '../opnet/IOP_NETContract';
export type OwnershipTransferredEvent = {
readonly previousOwner: Address;
readonly newOwner: Address;
};
export type Owner = CallResult<{
owner: Address;
}, OPNetEvent<never>[]>;
export type RenounceOwnership = CallResult<{
success: boolean;
}, OPNetEvent<OwnershipTransferredEvent>[]>;
export type TransferOwnership = CallResult<{
success: boolean;
}, OPNetEvent<OwnershipTransferredEvent>[]>;
interface IOwnable extends IOP_NETContract {
owner(): Promise<Owner>;
renounceOwnership(): Promise<RenounceOwnership>;
transferOwnership(newOwner: Address): Promise<TransferOwnership>;
}
export type LogPoolAdditionEvent = {
readonly poolId: bigint;
readonly allocPoint: bigint;
readonly lpToken: Address;
};
export type LogInitEvent = {};
export type LogUpdatePoolEvent = {
readonly poolId: bigint;
readonly lastRewardBlock: bigint;
readonly lpSupply: bigint;
readonly accMotoPerShare: bigint;
};
export type StakedBTCEvent = {
readonly user: Address;
readonly netAmount: bigint;
readonly stakeTxId: bigint;
readonly stakeIndex: bigint;
};
export type UnstakedBTCEvent = {
readonly user: Address;
readonly pendingMoto: bigint;
readonly storedTxId: bigint;
readonly storedIndex: bigint;
};
export type LogSetPoolEvent = {
readonly poolId: bigint;
readonly allocPoint: bigint;
};
export type DepositEvent = {
readonly user: Address;
readonly poolId: bigint;
readonly amount: bigint;
readonly to: Address;
};
export type WithdrawEvent = {
readonly user: Address;
readonly poolId: bigint;
readonly amount: bigint;
readonly to: Address;
};
export type HarvestEvent = {
readonly user: Address;
readonly poolId: bigint;
readonly amount: bigint;
};
export type EmergencyWithdrawEvent = {
readonly user: Address;
readonly poolId: bigint;
readonly amount: bigint;
readonly to: Address;
};
export type Initialize = CallResult<{
success: boolean;
}, OPNetEvent<LogPoolAdditionEvent | LogInitEvent>[]>;
export type TotalAllocPoint = CallResult<{
totalAllocPoint: bigint;
}, OPNetEvent<never>[]>;
export type DevAddress = CallResult<{
devAddress: Address;
}, OPNetEvent<never>[]>;
export type GetMotoPerBlock = CallResult<{
motoPerBlock: bigint;
}, OPNetEvent<never>[]>;
export type GetBonusEndBlock = CallResult<{
bonusEndBlock: bigint;
}, OPNetEvent<never>[]>;
export type GetBonusMultiplier = CallResult<{
bonusMultiplier: bigint;
}, OPNetEvent<never>[]>;
export type GetLpTokens = CallResult<{
lpTokens: Address[];
}, OPNetEvent<never>[]>;
export type GetPoolsLength = CallResult<{
poolsLength: bigint;
}, OPNetEvent<never>[]>;
export type GetLpToken = CallResult<{
lpToken: Address;
}, OPNetEvent<never>[]>;
export type GetPoolInfo = CallResult<{
accMotoPerShare: bigint;
lastRewardBlock: bigint;
allocPoint: bigint;
}, OPNetEvent<never>[]>;
export type GetUserInfo = CallResult<{
amount: bigint;
rewardDebt: bigint;
}, OPNetEvent<never>[]>;
export type GetMultiplier = CallResult<{
multiplier: bigint;
}, OPNetEvent<never>[]>;
export type PendingMoto = CallResult<{
pendingMoto: bigint;
}, OPNetEvent<never>[]>;
export type TreasuryAddress = CallResult<{
treasuryAddress: string;
}, OPNetEvent<never>[]>;
export type GetStakingTxId = CallResult<{
stakingTxId: bigint;
}, OPNetEvent<never>[]>;
export type GetStakingIndex = CallResult<{
stakingIndex: bigint;
}, OPNetEvent<never>[]>;
export type TotalBTCStaked = CallResult<{
totalBTCStaked: bigint;
}, OPNetEvent<never>[]>;
export type StakeBTC = CallResult<{
success: boolean;
}, OPNetEvent<LogUpdatePoolEvent | StakedBTCEvent>[]>;
export type UnstakeBTC = CallResult<{
success: boolean;
}, OPNetEvent<LogUpdatePoolEvent | UnstakedBTCEvent>[]>;
export type Add = CallResult<{
success: boolean;
}, OPNetEvent<LogPoolAdditionEvent>[]>;
export type Set = CallResult<{
success: boolean;
}, OPNetEvent<LogSetPoolEvent>[]>;
export type UpdatePool = CallResult<{
accMotoPerShare: bigint;
lastRewardBlock: bigint;
allocPoint: bigint;
}, OPNetEvent<LogUpdatePoolEvent>[]>;
export type MassUpdatePools = CallResult<{
success: boolean;
}, OPNetEvent<LogUpdatePoolEvent>[]>;
export type Deposit = CallResult<{
success: boolean;
}, OPNetEvent<LogUpdatePoolEvent | DepositEvent>[]>;
export type Withdraw = CallResult<{
success: boolean;
}, OPNetEvent<LogUpdatePoolEvent | WithdrawEvent>[]>;
export type Harvest = CallResult<{
success: boolean;
}, OPNetEvent<LogUpdatePoolEvent | HarvestEvent>[]>;
export type WithdrawAndHarvest = CallResult<{
success: boolean;
}, OPNetEvent<LogUpdatePoolEvent | WithdrawEvent | HarvestEvent>[]>;
export type EmergencyWithdraw = CallResult<{
success: boolean;
}, OPNetEvent<EmergencyWithdrawEvent>[]>;
export type SetMotoPerBlock = CallResult<{
success: boolean;
}, OPNetEvent<never>[]>;
export type SetBonusEndBlock = CallResult<{
success: boolean;
}, OPNetEvent<never>[]>;
export type SetBonusMultiplier = CallResult<{
success: boolean;
}, OPNetEvent<never>[]>;
export type SetDev = CallResult<{
success: boolean;
}, OPNetEvent<never>[]>;
export interface IMotoChef extends IOwnable {
initialize(motoAddress: Address, premineAmount: bigint, devAddress: Address, motoPerBlock: bigint, bonusEndBlock: bigint, bonusMultiplier: bigint, treasuryAddress: string, BTCAllocPoint: bigint): Promise<Initialize>;
totalAllocPoint(): Promise<TotalAllocPoint>;
devAddress(): Promise<DevAddress>;
getMotoPerBlock(): Promise<GetMotoPerBlock>;
getBonusEndBlock(): Promise<GetBonusEndBlock>;
getBonusMultiplier(): Promise<GetBonusMultiplier>;
getLpTokens(): Promise<GetLpTokens>;
getPoolsLength(): Promise<GetPoolsLength>;
getLpToken(poolId: bigint): Promise<GetLpToken>;
getPoolInfo(poolId: bigint): Promise<GetPoolInfo>;
getUserInfo(poolId: bigint, user: Address): Promise<GetUserInfo>;
getMultiplier(from: bigint, to: bigint): Promise<GetMultiplier>;
pendingMoto(poolId: bigint, user: Address): Promise<PendingMoto>;
treasuryAddress(): Promise<TreasuryAddress>;
getStakingTxId(user: Address): Promise<GetStakingTxId>;
getStakingIndex(user: Address): Promise<GetStakingIndex>;
totalBTCStaked(): Promise<TotalBTCStaked>;
stakeBTC(amount: bigint): Promise<StakeBTC>;
unstakeBTC(): Promise<UnstakeBTC>;
add(allocPoint: bigint, lpToken: Address): Promise<Add>;
set(poolId: bigint, allocPoint: bigint): Promise<Set>;
updatePool(poolId: bigint): Promise<UpdatePool>;
massUpdatePools(length: number, poolIds: bigint[]): Promise<MassUpdatePools>;
deposit(poolId: bigint, amount: bigint, to: Address): Promise<Deposit>;
withdraw(poolId: bigint, amount: bigint, to: Address): Promise<Withdraw>;
harvest(poolId: bigint, to: Address): Promise<Harvest>;
withdrawAndHarvest(poolId: bigint, amount: bigint, to: Address): Promise<WithdrawAndHarvest>;
emergencyWithdraw(poolId: bigint, to: Address): Promise<EmergencyWithdraw>;
setMotoPerBlock(motoPerBlock: bigint): Promise<SetMotoPerBlock>;
setBonusEndBlock(bonusEndBlock: bigint): Promise<SetBonusEndBlock>;
setBonusMultiplier(bonusMultiplier: bigint): Promise<SetBonusMultiplier>;
setDev(devAddress: Address): Promise<SetDev>;
}
export {};