UNPKG

@descent-protocol/sdk

Version:

A Typescript library for interacting with the Descent Protocol

355 lines (354 loc) 19.8 kB
import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, EventFragment, AddressLike, ContractRunner, ContractMethod, Listener } from "ethers"; import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedLogDescription, TypedListener, TypedContractMethod } from "./common"; export interface CurrencyInterface extends Interface { getFunction(nameOrSignature: "DOMAIN_SEPARATOR" | "PERMIT2" | "allowance" | "approve" | "balanceOf" | "burn" | "cancelOwnershipHandover" | "completeOwnershipHandover" | "decimals" | "mint" | "minterRole" | "name" | "nonces" | "owner" | "ownershipHandoverExpiresAt" | "permit" | "permit2Enabled" | "recoverToken" | "renounceOwnership" | "requestOwnershipHandover" | "setMinterRole" | "symbol" | "totalSupply" | "transfer" | "transferFrom" | "transferOwnership" | "updatePermit2Allowance"): FunctionFragment; getEvent(nameOrSignatureOrTopic: "Approval" | "OwnershipHandoverCanceled" | "OwnershipHandoverRequested" | "OwnershipTransferred" | "Permit2AllowanceUpdated" | "Transfer"): EventFragment; encodeFunctionData(functionFragment: "DOMAIN_SEPARATOR", values?: undefined): string; encodeFunctionData(functionFragment: "PERMIT2", values?: undefined): string; encodeFunctionData(functionFragment: "allowance", values: [AddressLike, AddressLike]): string; encodeFunctionData(functionFragment: "approve", values: [AddressLike, BigNumberish]): string; encodeFunctionData(functionFragment: "balanceOf", values: [AddressLike]): string; encodeFunctionData(functionFragment: "burn", values: [AddressLike, BigNumberish]): string; encodeFunctionData(functionFragment: "cancelOwnershipHandover", values?: undefined): string; encodeFunctionData(functionFragment: "completeOwnershipHandover", values: [AddressLike]): string; encodeFunctionData(functionFragment: "decimals", values?: undefined): string; encodeFunctionData(functionFragment: "mint", values: [AddressLike, BigNumberish]): string; encodeFunctionData(functionFragment: "minterRole", values: [AddressLike]): string; encodeFunctionData(functionFragment: "name", values?: undefined): string; encodeFunctionData(functionFragment: "nonces", values: [AddressLike]): string; encodeFunctionData(functionFragment: "owner", values?: undefined): string; encodeFunctionData(functionFragment: "ownershipHandoverExpiresAt", values: [AddressLike]): string; encodeFunctionData(functionFragment: "permit", values: [ AddressLike, AddressLike, BigNumberish, BigNumberish, BigNumberish, BytesLike, BytesLike ]): string; encodeFunctionData(functionFragment: "permit2Enabled", values?: undefined): string; encodeFunctionData(functionFragment: "recoverToken", values: [AddressLike, AddressLike]): string; encodeFunctionData(functionFragment: "renounceOwnership", values?: undefined): string; encodeFunctionData(functionFragment: "requestOwnershipHandover", values?: undefined): string; encodeFunctionData(functionFragment: "setMinterRole", values: [AddressLike, boolean]): string; encodeFunctionData(functionFragment: "symbol", values?: undefined): string; encodeFunctionData(functionFragment: "totalSupply", values?: undefined): string; encodeFunctionData(functionFragment: "transfer", values: [AddressLike, BigNumberish]): string; encodeFunctionData(functionFragment: "transferFrom", values: [AddressLike, AddressLike, BigNumberish]): string; encodeFunctionData(functionFragment: "transferOwnership", values: [AddressLike]): string; encodeFunctionData(functionFragment: "updatePermit2Allowance", values: [boolean]): string; decodeFunctionResult(functionFragment: "DOMAIN_SEPARATOR", data: BytesLike): Result; decodeFunctionResult(functionFragment: "PERMIT2", data: BytesLike): Result; decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; decodeFunctionResult(functionFragment: "burn", data: BytesLike): Result; decodeFunctionResult(functionFragment: "cancelOwnershipHandover", data: BytesLike): Result; decodeFunctionResult(functionFragment: "completeOwnershipHandover", data: BytesLike): Result; decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result; decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; decodeFunctionResult(functionFragment: "minterRole", data: BytesLike): Result; decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; decodeFunctionResult(functionFragment: "nonces", data: BytesLike): Result; decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; decodeFunctionResult(functionFragment: "ownershipHandoverExpiresAt", data: BytesLike): Result; decodeFunctionResult(functionFragment: "permit", data: BytesLike): Result; decodeFunctionResult(functionFragment: "permit2Enabled", data: BytesLike): Result; decodeFunctionResult(functionFragment: "recoverToken", data: BytesLike): Result; decodeFunctionResult(functionFragment: "renounceOwnership", data: BytesLike): Result; decodeFunctionResult(functionFragment: "requestOwnershipHandover", data: BytesLike): Result; decodeFunctionResult(functionFragment: "setMinterRole", data: BytesLike): Result; decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; decodeFunctionResult(functionFragment: "totalSupply", data: BytesLike): Result; decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; decodeFunctionResult(functionFragment: "transferFrom", data: BytesLike): Result; decodeFunctionResult(functionFragment: "transferOwnership", data: BytesLike): Result; decodeFunctionResult(functionFragment: "updatePermit2Allowance", data: BytesLike): Result; } export declare namespace ApprovalEvent { type InputTuple = [ owner: AddressLike, spender: AddressLike, amount: BigNumberish ]; type OutputTuple = [owner: string, spender: string, amount: bigint]; interface OutputObject { owner: string; spender: string; amount: bigint; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export declare namespace OwnershipHandoverCanceledEvent { type InputTuple = [pendingOwner: AddressLike]; type OutputTuple = [pendingOwner: string]; interface OutputObject { pendingOwner: string; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export declare namespace OwnershipHandoverRequestedEvent { type InputTuple = [pendingOwner: AddressLike]; type OutputTuple = [pendingOwner: string]; interface OutputObject { pendingOwner: string; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export declare namespace OwnershipTransferredEvent { type InputTuple = [oldOwner: AddressLike, newOwner: AddressLike]; type OutputTuple = [oldOwner: string, newOwner: string]; interface OutputObject { oldOwner: string; newOwner: string; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export declare namespace Permit2AllowanceUpdatedEvent { type InputTuple = [enabled: boolean]; type OutputTuple = [enabled: boolean]; interface OutputObject { enabled: boolean; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export declare namespace TransferEvent { type InputTuple = [ from: AddressLike, to: AddressLike, amount: BigNumberish ]; type OutputTuple = [from: string, to: string, amount: bigint]; interface OutputObject { from: string; to: string; amount: bigint; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export interface Currency extends BaseContract { connect(runner?: ContractRunner | null): Currency; waitForDeployment(): Promise<this>; interface: CurrencyInterface; 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>; DOMAIN_SEPARATOR: TypedContractMethod<[], [string], "view">; PERMIT2: TypedContractMethod<[], [string], "view">; allowance: TypedContractMethod<[ _owner: AddressLike, spender: AddressLike ], [ bigint ], "view">; approve: TypedContractMethod<[ spender: AddressLike, amount: BigNumberish ], [ boolean ], "nonpayable">; balanceOf: TypedContractMethod<[owner: AddressLike], [bigint], "view">; burn: TypedContractMethod<[ account: AddressLike, amount: BigNumberish ], [ boolean ], "nonpayable">; cancelOwnershipHandover: TypedContractMethod<[], [void], "payable">; completeOwnershipHandover: TypedContractMethod<[ pendingOwner: AddressLike ], [ void ], "payable">; decimals: TypedContractMethod<[], [bigint], "view">; mint: TypedContractMethod<[ account: AddressLike, amount: BigNumberish ], [ boolean ], "nonpayable">; minterRole: TypedContractMethod<[arg0: AddressLike], [boolean], "view">; name: TypedContractMethod<[], [string], "view">; nonces: TypedContractMethod<[owner: AddressLike], [bigint], "view">; owner: TypedContractMethod<[], [string], "view">; ownershipHandoverExpiresAt: TypedContractMethod<[ pendingOwner: AddressLike ], [ bigint ], "view">; permit: TypedContractMethod<[ owner: AddressLike, spender: AddressLike, value: BigNumberish, deadline: BigNumberish, v: BigNumberish, r: BytesLike, s: BytesLike ], [ void ], "nonpayable">; permit2Enabled: TypedContractMethod<[], [boolean], "view">; recoverToken: TypedContractMethod<[ token: AddressLike, to: AddressLike ], [ void ], "nonpayable">; renounceOwnership: TypedContractMethod<[], [void], "payable">; requestOwnershipHandover: TypedContractMethod<[], [void], "payable">; setMinterRole: TypedContractMethod<[ account: AddressLike, isMinter: boolean ], [ void ], "nonpayable">; symbol: TypedContractMethod<[], [string], "view">; totalSupply: TypedContractMethod<[], [bigint], "view">; transfer: TypedContractMethod<[ to: AddressLike, amount: BigNumberish ], [ boolean ], "nonpayable">; transferFrom: TypedContractMethod<[ from: AddressLike, to: AddressLike, amount: BigNumberish ], [ boolean ], "nonpayable">; transferOwnership: TypedContractMethod<[ newOwner: AddressLike ], [ void ], "payable">; updatePermit2Allowance: TypedContractMethod<[ enabled: boolean ], [ void ], "nonpayable">; getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T; getFunction(nameOrSignature: "DOMAIN_SEPARATOR"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "PERMIT2"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "allowance"): TypedContractMethod<[ _owner: AddressLike, spender: AddressLike ], [ bigint ], "view">; getFunction(nameOrSignature: "approve"): TypedContractMethod<[ spender: AddressLike, amount: BigNumberish ], [ boolean ], "nonpayable">; getFunction(nameOrSignature: "balanceOf"): TypedContractMethod<[owner: AddressLike], [bigint], "view">; getFunction(nameOrSignature: "burn"): TypedContractMethod<[ account: AddressLike, amount: BigNumberish ], [ boolean ], "nonpayable">; getFunction(nameOrSignature: "cancelOwnershipHandover"): TypedContractMethod<[], [void], "payable">; getFunction(nameOrSignature: "completeOwnershipHandover"): TypedContractMethod<[pendingOwner: AddressLike], [void], "payable">; getFunction(nameOrSignature: "decimals"): TypedContractMethod<[], [bigint], "view">; getFunction(nameOrSignature: "mint"): TypedContractMethod<[ account: AddressLike, amount: BigNumberish ], [ boolean ], "nonpayable">; getFunction(nameOrSignature: "minterRole"): TypedContractMethod<[arg0: AddressLike], [boolean], "view">; getFunction(nameOrSignature: "name"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "nonces"): TypedContractMethod<[owner: AddressLike], [bigint], "view">; getFunction(nameOrSignature: "owner"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "ownershipHandoverExpiresAt"): TypedContractMethod<[pendingOwner: AddressLike], [bigint], "view">; getFunction(nameOrSignature: "permit"): TypedContractMethod<[ owner: AddressLike, spender: AddressLike, value: BigNumberish, deadline: BigNumberish, v: BigNumberish, r: BytesLike, s: BytesLike ], [ void ], "nonpayable">; getFunction(nameOrSignature: "permit2Enabled"): TypedContractMethod<[], [boolean], "view">; getFunction(nameOrSignature: "recoverToken"): TypedContractMethod<[ token: AddressLike, to: AddressLike ], [ void ], "nonpayable">; getFunction(nameOrSignature: "renounceOwnership"): TypedContractMethod<[], [void], "payable">; getFunction(nameOrSignature: "requestOwnershipHandover"): TypedContractMethod<[], [void], "payable">; getFunction(nameOrSignature: "setMinterRole"): TypedContractMethod<[ account: AddressLike, isMinter: boolean ], [ void ], "nonpayable">; getFunction(nameOrSignature: "symbol"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "totalSupply"): TypedContractMethod<[], [bigint], "view">; getFunction(nameOrSignature: "transfer"): TypedContractMethod<[ to: AddressLike, amount: BigNumberish ], [ boolean ], "nonpayable">; getFunction(nameOrSignature: "transferFrom"): TypedContractMethod<[ from: AddressLike, to: AddressLike, amount: BigNumberish ], [ boolean ], "nonpayable">; getFunction(nameOrSignature: "transferOwnership"): TypedContractMethod<[newOwner: AddressLike], [void], "payable">; getFunction(nameOrSignature: "updatePermit2Allowance"): TypedContractMethod<[enabled: boolean], [void], "nonpayable">; getEvent(key: "Approval"): TypedContractEvent<ApprovalEvent.InputTuple, ApprovalEvent.OutputTuple, ApprovalEvent.OutputObject>; getEvent(key: "OwnershipHandoverCanceled"): TypedContractEvent<OwnershipHandoverCanceledEvent.InputTuple, OwnershipHandoverCanceledEvent.OutputTuple, OwnershipHandoverCanceledEvent.OutputObject>; getEvent(key: "OwnershipHandoverRequested"): TypedContractEvent<OwnershipHandoverRequestedEvent.InputTuple, OwnershipHandoverRequestedEvent.OutputTuple, OwnershipHandoverRequestedEvent.OutputObject>; getEvent(key: "OwnershipTransferred"): TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>; getEvent(key: "Permit2AllowanceUpdated"): TypedContractEvent<Permit2AllowanceUpdatedEvent.InputTuple, Permit2AllowanceUpdatedEvent.OutputTuple, Permit2AllowanceUpdatedEvent.OutputObject>; getEvent(key: "Transfer"): TypedContractEvent<TransferEvent.InputTuple, TransferEvent.OutputTuple, TransferEvent.OutputObject>; filters: { "Approval(address,address,uint256)": TypedContractEvent<ApprovalEvent.InputTuple, ApprovalEvent.OutputTuple, ApprovalEvent.OutputObject>; Approval: TypedContractEvent<ApprovalEvent.InputTuple, ApprovalEvent.OutputTuple, ApprovalEvent.OutputObject>; "OwnershipHandoverCanceled(address)": TypedContractEvent<OwnershipHandoverCanceledEvent.InputTuple, OwnershipHandoverCanceledEvent.OutputTuple, OwnershipHandoverCanceledEvent.OutputObject>; OwnershipHandoverCanceled: TypedContractEvent<OwnershipHandoverCanceledEvent.InputTuple, OwnershipHandoverCanceledEvent.OutputTuple, OwnershipHandoverCanceledEvent.OutputObject>; "OwnershipHandoverRequested(address)": TypedContractEvent<OwnershipHandoverRequestedEvent.InputTuple, OwnershipHandoverRequestedEvent.OutputTuple, OwnershipHandoverRequestedEvent.OutputObject>; OwnershipHandoverRequested: TypedContractEvent<OwnershipHandoverRequestedEvent.InputTuple, OwnershipHandoverRequestedEvent.OutputTuple, OwnershipHandoverRequestedEvent.OutputObject>; "OwnershipTransferred(address,address)": TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>; OwnershipTransferred: TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>; "Permit2AllowanceUpdated(bool)": TypedContractEvent<Permit2AllowanceUpdatedEvent.InputTuple, Permit2AllowanceUpdatedEvent.OutputTuple, Permit2AllowanceUpdatedEvent.OutputObject>; Permit2AllowanceUpdated: TypedContractEvent<Permit2AllowanceUpdatedEvent.InputTuple, Permit2AllowanceUpdatedEvent.OutputTuple, Permit2AllowanceUpdatedEvent.OutputObject>; "Transfer(address,address,uint256)": TypedContractEvent<TransferEvent.InputTuple, TransferEvent.OutputTuple, TransferEvent.OutputObject>; Transfer: TypedContractEvent<TransferEvent.InputTuple, TransferEvent.OutputTuple, TransferEvent.OutputObject>; }; }