UNPKG

@q-dev/q-ts-gdk-sdk

Version:

Typescript Library to interact with GDK Contracts

52 lines (51 loc) 2.32 kB
/// <reference types="node" /> import type { ContractOptions } from "web3-eth-contract"; import type { EventLog } from "web3-core"; import type { EventEmitter } from "events"; import type { Callback, NonPayableTransactionObject, BlockType, ContractEventLog, BaseContract } from "./types"; export interface EventOptions { filter?: object; fromBlock?: BlockType; topics?: string[]; } export type AddedContract = ContractEventLog<{ name: string; contractAddress: string; isProxy: boolean; 0: string; 1: string; 2: boolean; }>; export type Initialized = ContractEventLog<{ version: string; 0: string; }>; export type RemovedContract = ContractEventLog<{ name: string; 0: string; }>; export interface AbstractContractsRegistry extends BaseContract { constructor(jsonInterface: any[], address?: string, options?: ContractOptions): AbstractContractsRegistry; clone(): AbstractContractsRegistry; methods: { getContract(name_: string): NonPayableTransactionObject<string>; getImplementation(name_: string): NonPayableTransactionObject<string>; getProxyUpgrader(): NonPayableTransactionObject<string>; hasContract(name_: string): NonPayableTransactionObject<boolean>; }; events: { AddedContract(cb?: Callback<AddedContract>): EventEmitter; AddedContract(options?: EventOptions, cb?: Callback<AddedContract>): EventEmitter; Initialized(cb?: Callback<Initialized>): EventEmitter; Initialized(options?: EventOptions, cb?: Callback<Initialized>): EventEmitter; RemovedContract(cb?: Callback<RemovedContract>): EventEmitter; RemovedContract(options?: EventOptions, cb?: Callback<RemovedContract>): EventEmitter; allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter; }; once(event: "AddedContract", cb: Callback<AddedContract>): void; once(event: "AddedContract", options: EventOptions, cb: Callback<AddedContract>): void; once(event: "Initialized", cb: Callback<Initialized>): void; once(event: "Initialized", options: EventOptions, cb: Callback<Initialized>): void; once(event: "RemovedContract", cb: Callback<RemovedContract>): void; once(event: "RemovedContract", options: EventOptions, cb: Callback<RemovedContract>): void; }