Type alias WaitFunction

WaitFunction: ((type?: "byBlock" | "byTransactionId", timeout?: number) => Promise<{ blockId: string; blockNumber?: number }>)

Type declaration

    • (type?: "byBlock" | "byTransactionId", timeout?: number): Promise<{ blockId: string; blockNumber?: number }>
    • Function to wait for a transaction to be mined. This function comes as a response after sending a transaction. See Provider.sendTransaction

      Parameters

      • Optional type: "byBlock" | "byTransactionId"

        Type must be "byBlock" (default) or "byTransactionId". byBlock will query the blockchain to get blocks and search for the transaction there. byTransactionId will query the "transaction store" microservice to search the transaction by its id. If non of them is specified the function will use "byBlock" (as "byTransactionId" requires the transaction store, which is an optional microservice).

        When byBlock is used it returns the block number.

        When byTransactionId is used it returns the block id.

      • Optional timeout: number

        Timeout in milliseconds. By default it is 15000

      Returns Promise<{ blockId: string; blockNumber?: number }>

Generated using TypeDoc