UNPKG

@vocdoni/davinci-contracts

Version:

Smart contracts powering DAVINCI's digital voting protocol

150 lines (149 loc) 8.15 kB
import type { BaseContract, BytesLike, FunctionFragment, Result, Interface, EventFragment, AddressLike, ContractRunner, ContractMethod, Listener } from "ethers"; import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedLogDescription, TypedListener, TypedContractMethod } from "../common"; export interface IOrganizationRegistryInterface extends Interface { getFunction(nameOrSignature: "addAdministrator" | "createOrganization" | "deleteOrganization" | "exists" | "getOrganization" | "isAdministrator" | "removeAdministrator" | "updateOrganization"): FunctionFragment; getEvent(nameOrSignatureOrTopic: "OrganizationCreated" | "OrganizationUpdated"): EventFragment; encodeFunctionData(functionFragment: "addAdministrator", values: [AddressLike, AddressLike]): string; encodeFunctionData(functionFragment: "createOrganization", values: [AddressLike, string, string, AddressLike[]]): string; encodeFunctionData(functionFragment: "deleteOrganization", values: [AddressLike]): string; encodeFunctionData(functionFragment: "exists", values: [AddressLike]): string; encodeFunctionData(functionFragment: "getOrganization", values: [AddressLike]): string; encodeFunctionData(functionFragment: "isAdministrator", values: [AddressLike, AddressLike]): string; encodeFunctionData(functionFragment: "removeAdministrator", values: [AddressLike, AddressLike]): string; encodeFunctionData(functionFragment: "updateOrganization", values: [AddressLike, string, string]): string; decodeFunctionResult(functionFragment: "addAdministrator", data: BytesLike): Result; decodeFunctionResult(functionFragment: "createOrganization", data: BytesLike): Result; decodeFunctionResult(functionFragment: "deleteOrganization", data: BytesLike): Result; decodeFunctionResult(functionFragment: "exists", data: BytesLike): Result; decodeFunctionResult(functionFragment: "getOrganization", data: BytesLike): Result; decodeFunctionResult(functionFragment: "isAdministrator", data: BytesLike): Result; decodeFunctionResult(functionFragment: "removeAdministrator", data: BytesLike): Result; decodeFunctionResult(functionFragment: "updateOrganization", data: BytesLike): Result; } export declare namespace OrganizationCreatedEvent { type InputTuple = [id: AddressLike, creator: AddressLike]; type OutputTuple = [id: string, creator: string]; interface OutputObject { id: string; creator: string; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export declare namespace OrganizationUpdatedEvent { type InputTuple = [id: AddressLike, updater: AddressLike]; type OutputTuple = [id: string, updater: string]; interface OutputObject { id: string; updater: string; } type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>; type Filter = TypedDeferredTopicFilter<Event>; type Log = TypedEventLog<Event>; type LogDescription = TypedLogDescription<Event>; } export interface IOrganizationRegistry extends BaseContract { connect(runner?: ContractRunner | null): IOrganizationRegistry; waitForDeployment(): Promise<this>; interface: IOrganizationRegistryInterface; 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>; addAdministrator: TypedContractMethod<[ id: AddressLike, administrator: AddressLike ], [ void ], "nonpayable">; createOrganization: TypedContractMethod<[ id: AddressLike, name: string, metadataURI: string, administrators: AddressLike[] ], [ void ], "nonpayable">; deleteOrganization: TypedContractMethod<[ id: AddressLike ], [ void ], "nonpayable">; exists: TypedContractMethod<[id: AddressLike], [boolean], "view">; getOrganization: TypedContractMethod<[ id: AddressLike ], [ [string, string] ], "view">; isAdministrator: TypedContractMethod<[ id: AddressLike, account: AddressLike ], [ boolean ], "view">; removeAdministrator: TypedContractMethod<[ id: AddressLike, administrator: AddressLike ], [ void ], "nonpayable">; updateOrganization: TypedContractMethod<[ id: AddressLike, name: string, metadataURI: string ], [ void ], "nonpayable">; getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T; getFunction(nameOrSignature: "addAdministrator"): TypedContractMethod<[ id: AddressLike, administrator: AddressLike ], [ void ], "nonpayable">; getFunction(nameOrSignature: "createOrganization"): TypedContractMethod<[ id: AddressLike, name: string, metadataURI: string, administrators: AddressLike[] ], [ void ], "nonpayable">; getFunction(nameOrSignature: "deleteOrganization"): TypedContractMethod<[id: AddressLike], [void], "nonpayable">; getFunction(nameOrSignature: "exists"): TypedContractMethod<[id: AddressLike], [boolean], "view">; getFunction(nameOrSignature: "getOrganization"): TypedContractMethod<[id: AddressLike], [[string, string]], "view">; getFunction(nameOrSignature: "isAdministrator"): TypedContractMethod<[ id: AddressLike, account: AddressLike ], [ boolean ], "view">; getFunction(nameOrSignature: "removeAdministrator"): TypedContractMethod<[ id: AddressLike, administrator: AddressLike ], [ void ], "nonpayable">; getFunction(nameOrSignature: "updateOrganization"): TypedContractMethod<[ id: AddressLike, name: string, metadataURI: string ], [ void ], "nonpayable">; getEvent(key: "OrganizationCreated"): TypedContractEvent<OrganizationCreatedEvent.InputTuple, OrganizationCreatedEvent.OutputTuple, OrganizationCreatedEvent.OutputObject>; getEvent(key: "OrganizationUpdated"): TypedContractEvent<OrganizationUpdatedEvent.InputTuple, OrganizationUpdatedEvent.OutputTuple, OrganizationUpdatedEvent.OutputObject>; filters: { "OrganizationCreated(address,address)": TypedContractEvent<OrganizationCreatedEvent.InputTuple, OrganizationCreatedEvent.OutputTuple, OrganizationCreatedEvent.OutputObject>; OrganizationCreated: TypedContractEvent<OrganizationCreatedEvent.InputTuple, OrganizationCreatedEvent.OutputTuple, OrganizationCreatedEvent.OutputObject>; "OrganizationUpdated(address,address)": TypedContractEvent<OrganizationUpdatedEvent.InputTuple, OrganizationUpdatedEvent.OutputTuple, OrganizationUpdatedEvent.OutputObject>; OrganizationUpdated: TypedContractEvent<OrganizationUpdatedEvent.InputTuple, OrganizationUpdatedEvent.OutputTuple, OrganizationUpdatedEvent.OutputObject>; }; }