UNPKG

@vechain/connex

Version:

Standard interface to connect DApp with VeChain and user

40 lines (39 loc) 2.28 kB
/// <reference types="@vechain/connex-types" /> /// <reference types="@vechain/connex-framework/dist/driver-interface" /> import { DriverNoVendor } from '@vechain/connex-driver'; import { NewSignerFunc } from './signer'; /** the LazyDriver implements vendor methods at construction but allows attaching NoVendorDriver later to be a full one*/ export declare class LazyDriver implements Connex.Driver { private readonly signer; private _driver; constructor(signer: Promise<Connex.Signer>); private get noVendor(); setNoVendor(driver: DriverNoVendor): void; get genesis(): Connex.Thor.Block; get head(): Connex.Thor.Status['head']; pollHead(): Promise<Connex.Thor.Status['head']>; getBlock(revision: string | number): Promise<Connex.Thor.Block | null>; getTransaction(id: string, allowPending: boolean): Promise<Connex.Thor.Transaction | null>; getReceipt(id: string): Promise<Connex.Thor.Transaction.Receipt | null>; getAccount(addr: string, revision: string): Promise<Connex.Thor.Account>; getCode(addr: string, revision: string): Promise<Connex.Thor.Account.Code>; getStorage(addr: string, key: string, revision: string): Promise<Connex.Thor.Account.Storage>; explain(arg: Connex.Driver.ExplainArg, revision: string, cacheHints?: string[]): Promise<Connex.VM.Output[]>; filterEventLogs(arg: Connex.Driver.FilterEventLogsArg): Promise<Connex.Thor.Filter.Row<'event'>[]>; filterTransferLogs(arg: Connex.Driver.FilterTransferLogsArg): Promise<Connex.Thor.Filter.Row<'transfer'>[]>; signTx(msg: Connex.Vendor.TxMessage, options: Connex.Signer.TxOptions): Promise<Connex.Vendor.TxResponse>; signCert(msg: Connex.Vendor.CertMessage, options: Connex.Signer.CertOptions): Promise<Connex.Vendor.CertResponse>; } /** * create a no vendor driver * @param node the url of thor node * @param genesis the enforced genesis block */ export declare function createNoVendor(node: string, genesis: Connex.Thor.Block): DriverNoVendor; /** * create a full driver * @param node the url of thor node * @param genesis the enforced genesis block * @param newSigner a function to create signer */ export declare function createFull(node: string, genesis: Connex.Thor.Block, newSigner: NewSignerFunc): Connex.Driver;