UNPKG

incubed

Version:

Typescript-version of the incubed client

44 lines (43 loc) 1.98 kB
/*********************************************************** * This file is part of the Slock.it IoT Layer. * * The Slock.it IoT Layer contains: * * - USN (Universal Sharing Network) * * - INCUBED (Trustless INcentivized remote Node Network) * ************************************************************ * Copyright (C) 2016 - 2018 Slock.it GmbH * * All Rights Reserved. * ************************************************************ * You may use, distribute and modify this code under the * * terms of the license contract you have concluded with * * Slock.it GmbH. * * For information about liability, maintenance etc. also * * refer to the contract concluded with Slock.it GmbH. * ************************************************************ * For more information, please refer to https://slock.it * * For questions, please contact info@slock.it * ***********************************************************/ import Client from '../../client/Client'; import { RPCRequest, RPCResponse } from '../../types/types'; import { LogData } from './serialize'; export declare type FilterType = 'event' | 'block' | 'pending'; export interface FilterOptions { fromBlock?: number | string; toBlock?: number | string; address?: string | string[]; topics?: (string | string[])[]; } export interface Filter { type: 'event' | 'block' | 'pending'; options: FilterOptions; lastBlock: number; } export default class Filters { filters: { [id: string]: Filter; }; constructor(); addFilter(client: Client, type: FilterType, options: FilterOptions): Promise<string>; handleIntern(request: RPCRequest, client: Client): Promise<RPCResponse>; getFilterChanges(client: Client, id: string): Promise<any[] | LogData>; removeFilter(id: string): boolean; }