Type alias DownloadOptions<S>

DownloadOptions<S>: {
    auth?: SignedEvent;
    onAuth?: ((server, sha256) => Promise<SignedEvent>);
    onPayment?: ((server, sha256, request) => Promise<Token>);
    signal?: AbortSignal;
    timeout?: number;
}

Type Parameters

Type declaration

  • Optional auth?: SignedEvent

    Override auth event to use

  • Optional onAuth?: ((server, sha256) => Promise<SignedEvent>)

    A method used to request a signed auth event for a server and sha256

      • (server, sha256): Promise<SignedEvent>
      • Parameters

        • server: S

          the server requesting the auth

        • sha256: string

          the sha256 of the blob being upload or mirror to the server

        Returns Promise<SignedEvent>

  • Optional onPayment?: ((server, sha256, request) => Promise<Token>)

    A method used to request payment when downloading

      • (server, sha256, request): Promise<Token>
      • Parameters

        • server: S

          the server requiring payment

        • sha256: string

          the sha256 of the blob being uploaded or mirrored

        • request: PaymentRequest

          the payment request

        Returns Promise<Token>

  • Optional signal?: AbortSignal

    AbortSignal to cancel the action

  • Optional timeout?: number

    Request timeout