Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface LinkTransport

Protocol link transports need to implement.

A transport is responsible for getting the request to the user, e.g. by opening request URIs or displaying QR codes.

Hierarchy

  • LinkTransport

Index

Properties

storage?: LinkStorage

Can be implemented if transport provides a storage as well.

Methods

  • onFailure(request: SigningRequest, error: Error): void
  • Called if the request failed.

    Parameters

    • request: SigningRequest
    • error: Error

    Returns void

  • onRequest(request: SigningRequest, cancel: (reason: string | Error) => void): void
  • Present a signing request to the user.

    Parameters

    • request: SigningRequest

      The signing request.

    • cancel: (reason: string | Error) => void

      Can be called to abort the request.

        • (reason: string | Error): void
        • Parameters

          • reason: string | Error

          Returns void

    Returns void

  • onSessionRequest(session: LinkSession, request: SigningRequest, cancel: (reason: string | Error) => void): void
  • Called when a session request is initiated.

    Parameters

    • session: LinkSession

      Session where the request originated.

    • request: SigningRequest

      Signing request that will be sent over the session.

    • cancel: (reason: string | Error) => void
        • (reason: string | Error): void
        • Parameters

          • reason: string | Error

          Returns void

    Returns void

  • prepare(request: SigningRequest, session?: LinkSession): Promise<SigningRequest>
  • Can be implemented to modify request just after it has been created.

    Parameters

    Returns Promise<SigningRequest>

  • recoverError(error: Error, request: SigningRequest): boolean
  • Can be implemented to recover from certain errors, if the function returns true the error will not bubble up to the caller of .transact or .login and the link will continue waiting for the callback.

    Parameters

    • error: Error
    • request: SigningRequest

    Returns boolean

  • sendSessionPayload(payload: Bytes, session: LinkSession): boolean
  • Send session request payload, optional. Can return false to indicate it has to be sent over the socket.

    Parameters

    Returns boolean

  • showLoading(): void
  • userAgent(): string

Generated using TypeDoc