import { Address } from '@btc-vision/transaction'; import { CallResult } from '../../../../contracts/CallResult.js'; import { OPNetEvent } from '../../../../contracts/OPNetEvent.js'; import { IOP_NETContract } from '../opnet/IOP_NETContract.js'; // ------------------------------------------------------------------ // Event Definitions // ------------------------------------------------------------------ export type OwnershipTransferredEvent = { readonly previousOwner: Address; readonly newOwner: Address; }; // ------------------------------------------------------------------ // Call Results // ------------------------------------------------------------------ /** * @description Represents the result of the owner function call. */ export type Owner = CallResult< { owner: Address; }, OPNetEvent[] >; /** * @description Represents the result of the renounceOwnership function call. */ export type RenounceOwnership = CallResult<{}, OPNetEvent[]>; /** * @description Represents the result of the transferOwnership function call. */ export type TransferOwnership = CallResult<{}, OPNetEvent[]>; // ------------------------------------------------------------------ // IOwnable // ------------------------------------------------------------------ interface IOwnable extends IOP_NETContract { owner(): Promise; renounceOwnership(): Promise; transferOwnership(newOwner: Address): Promise; } // ------------------------------------------------------------------ // Event Definitions // ------------------------------------------------------------------ export type PoolAddedEvent = { readonly poolId: number; readonly allocPoint: bigint; readonly lpToken: Address; }; export type InitializedEvent = {}; export type PoolUpdatedEvent = { readonly poolId: number; readonly lastRewardBlock: bigint; readonly lpSupply: bigint; readonly accMotoPerShare: bigint; }; export type BTCStakedEvent = { readonly user: Address; readonly netAmount: bigint; readonly stakeTxId: bigint; readonly stakeIndex: bigint; }; export type BTCUnstakedEvent = { readonly user: Address; readonly pendingMoto: bigint; readonly storedTxId: bigint; readonly storedIndex: bigint; }; export type BTCStakeRemovedEvent = { readonly user: Address; readonly storedTxId: bigint; readonly storedIndex: bigint; }; export type PoolSetEvent = { readonly poolId: number; readonly allocPoint: bigint; }; export type DepositedEvent = { readonly user: Address; readonly poolId: number; readonly amount: bigint; readonly to: Address; }; export type WithdrawnEvent = { readonly user: Address; readonly poolId: number; readonly amount: bigint; readonly to: Address; }; export type HarvestedEvent = { readonly user: Address; readonly poolId: number; readonly amount: bigint; }; export type EmergencyWithdrawnEvent = { readonly user: Address; readonly poolId: number; readonly amount: bigint; readonly to: Address; }; // ------------------------------------------------------------------ // Call Results // ------------------------------------------------------------------ /** * @description Represents the result of the update function call. */ export type Update = CallResult<{}, OPNetEvent[]>; /** * @description Represents the result of the initialize function call. */ export type Initialize = CallResult<{}, OPNetEvent[]>; /** * @description Represents the result of the totalAllocPoint function call. */ export type TotalAllocPoint = CallResult< { totalAllocPoint: bigint; }, OPNetEvent[] >; /** * @description Represents the result of the getMotoPerBlock function call. */ export type GetMotoPerBlock = CallResult< { motoPerBlock: bigint; }, OPNetEvent[] >; /** * @description Represents the result of the getBonusEndBlock function call. */ export type GetBonusEndBlock = CallResult< { bonusEndBlock: bigint; }, OPNetEvent[] >; /** * @description Represents the result of the getBonusMultiplier function call. */ export type GetBonusMultiplier = CallResult< { bonusMultiplier: bigint; }, OPNetEvent[] >; /** * @description Represents the result of the getLpTokens function call. */ export type GetLpTokens = CallResult< { lpTokens: Address[]; }, OPNetEvent[] >; /** * @description Represents the result of the getPoolsLength function call. */ export type GetPoolsLength = CallResult< { poolsLength: number; }, OPNetEvent[] >; /** * @description Represents the result of the getLpToken function call. */ export type GetLpToken = CallResult< { lpToken: Address; }, OPNetEvent[] >; /** * @description Represents the result of the getPoolInfo function call. */ export type GetPoolInfo = CallResult< { accMotoPerShare: bigint; lastRewardBlock: bigint; allocPoint: bigint; }, OPNetEvent[] >; /** * @description Represents the result of the getUserInfo function call. */ export type GetUserInfo = CallResult< { amount: bigint; rewardDebt: bigint; }, OPNetEvent[] >; /** * @description Represents the result of the getMultiplier function call. */ export type GetMultiplier = CallResult< { multiplier: bigint; }, OPNetEvent[] >; /** * @description Represents the result of the pendingMoto function call. */ export type PendingMoto = CallResult< { pendingMoto: bigint; }, OPNetEvent[] >; /** * @description Represents the result of the treasuryAddress function call. */ export type TreasuryAddress = CallResult< { treasuryAddress: string; }, OPNetEvent[] >; /** * @description Represents the result of the getStakingTxId function call. */ export type GetStakingTxId = CallResult< { stakingTxId: bigint; }, OPNetEvent[] >; /** * @description Represents the result of the getStakingIndex function call. */ export type GetStakingIndex = CallResult< { stakingIndex: bigint; }, OPNetEvent[] >; /** * @description Represents the result of the totalBTCStaked function call. */ export type TotalBTCStaked = CallResult< { totalBTCStaked: bigint; }, OPNetEvent[] >; /** * @description Represents the result of the stakeBTC function call. */ export type StakeBTC = CallResult< {}, OPNetEvent[] >; /** * @description Represents the result of the unstakeBTC function call. */ export type UnstakeBTC = CallResult<{}, OPNetEvent[]>; /** * @description Represents the result of the removeBTCStake function call. */ export type RemoveBTCStake = CallResult<{}, OPNetEvent[]>; /** * @description Represents the result of the add function call. */ export type Add = CallResult<{}, OPNetEvent[]>; /** * @description Represents the result of the set function call. */ export type Set = CallResult<{}, OPNetEvent[]>; /** * @description Represents the result of the updatePool function call. */ export type UpdatePool = CallResult< { accMotoPerShare: bigint; lastRewardBlock: bigint; allocPoint: bigint; }, OPNetEvent[] >; /** * @description Represents the result of the massUpdatePools function call. */ export type MassUpdatePools = CallResult<{}, OPNetEvent[]>; /** * @description Represents the result of the deposit function call. */ export type Deposit = CallResult<{}, OPNetEvent[]>; /** * @description Represents the result of the withdraw function call. */ export type Withdraw = CallResult<{}, OPNetEvent[]>; /** * @description Represents the result of the harvest function call. */ export type Harvest = CallResult<{}, OPNetEvent[]>; /** * @description Represents the result of the withdrawAndHarvest function call. */ export type WithdrawAndHarvest = CallResult< {}, OPNetEvent[] >; /** * @description Represents the result of the emergencyWithdraw function call. */ export type EmergencyWithdraw = CallResult<{}, OPNetEvent[]>; /** * @description Represents the result of the setMotoPerBlock function call. */ export type SetMotoPerBlock = CallResult<{}, OPNetEvent[]>; /** * @description Represents the result of the setBonusEndBlock function call. */ export type SetBonusEndBlock = CallResult<{}, OPNetEvent[]>; /** * @description Represents the result of the setBonusMultiplier function call. */ export type SetBonusMultiplier = CallResult<{}, OPNetEvent[]>; /** * @description Represents the result of the onOP20Received function call. */ export type OnOP20Received = CallResult< { selector: Uint8Array; }, OPNetEvent[] >; // ------------------------------------------------------------------ // IMotoChef // ------------------------------------------------------------------ export interface IMotoChef extends IOwnable { update(sourceAddress: Address, updateCalldata: Uint8Array): Promise; initialize( motoAddress: Address, premineAmount: bigint, premineRecipient: Address, motoPerBlock: bigint, bonusEndBlock: bigint, bonusMultiplier: bigint, treasuryAddress: string, BTCAllocPoint: bigint, MOTOAllocPoint: bigint, ): Promise; totalAllocPoint(): Promise; getMotoPerBlock(): Promise; getBonusEndBlock(): Promise; getBonusMultiplier(): Promise; getLpTokens(): Promise; getPoolsLength(): Promise; getLpToken(poolId: number): Promise; getPoolInfo(poolId: number): Promise; getUserInfo(poolId: number, user: Address): Promise; getMultiplier(from: bigint, to: bigint): Promise; pendingMoto(poolId: number, user: Address): Promise; treasuryAddress(): Promise; getStakingTxId(user: Address): Promise; getStakingIndex(user: Address): Promise; totalBTCStaked(): Promise; stakeBTC(amount: bigint): Promise; unstakeBTC(): Promise; removeBTCStake(user: Address): Promise; add(allocPoint: bigint, lpToken: Address): Promise; set(poolId: number, allocPoint: bigint, withUpdate: number): Promise; updatePool(poolId: number): Promise; massUpdatePools(length: number, poolIds: number[]): Promise; deposit(poolId: number, amount: bigint, to: Address): Promise; withdraw(poolId: number, amount: bigint, to: Address): Promise; harvest(poolId: number, to: Address): Promise; withdrawAndHarvest(poolId: number, amount: bigint, to: Address): Promise; emergencyWithdraw(poolId: number, to: Address): Promise; onOP20Received( operator: Address, from: Address, amount: bigint, data: Uint8Array, ): Promise; setMotoPerBlock(motoPerBlock: bigint): Promise; setBonusEndBlock(bonusEndBlock: bigint): Promise; setBonusMultiplier(bonusMultiplier: bigint): Promise; }