/** * Anchor Link Browser Transport v3.6.1 * https://github.com/greymass/anchor-link-browser-transport * * @license * Copyright (c) 2020 Greymass Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistribution of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * 2. Redistribution in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its contributors * may be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * YOU ACKNOWLEDGE THAT THIS SOFTWARE IS NOT DESIGNED, LICENSED OR INTENDED FOR USE * IN THE DESIGN, CONSTRUCTION, OPERATION OR MAINTENANCE OF ANY MILITARY FACILITY. */ import { LinkTransport, LinkStorage, SigningRequest, LinkSession, Bytes } from 'anchor-link'; interface BrowserTransportOptions { /** CSS class prefix, defaults to `anchor-link` */ classPrefix?: string; /** Whether to inject CSS styles in the page header, defaults to true. */ injectStyles?: boolean; /** Whether to display request success and error messages, defaults to true */ requestStatus?: boolean; /** Local storage prefix, defaults to `anchor-link`. */ storagePrefix?: string; /** * Whether to use Greymass Fuel for low resource accounts, defaults to false. * Note that this service is not available on all networks. * Visit https://greymass.com/en/fuel for more information. */ disableGreymassFuel?: boolean; /** * The referring account to pass along to the Greymass Fuel API endpoint. * Specifying an account name will indicate to the API which account is eligible * to potentially receive a share of the fees generated by their application. */ fuelReferrer?: string; /** * Override of the supported resource provider chains. */ supportedChains?: Record; /** * Set to false to not use !important styles, defaults to true. */ importantStyles?: boolean; } declare class BrowserTransport implements LinkTransport { readonly options: BrowserTransportOptions; /** Package version. */ static version: string; storage: LinkStorage; constructor(options?: BrowserTransportOptions); private classPrefix; private injectStyles; private importantStyles; private requestStatus; private fuelEnabled; private fuelReferrer; private supportedChains; private activeRequest?; private activeCancel?; private containerEl; private requestEl; private styleEl?; private countdownTimer?; private closeTimer?; private prepareStatusEl?; private showingManual; private closeModal; private setupElements; private createEl; private hide; private show; private showDialog; private displayRequest; showLoading(): Promise; onRequest(request: SigningRequest, cancel: (reason: string | Error) => void): void; onSessionRequest(session: LinkSession, request: SigningRequest, cancel: (reason: string | Error) => void): void; sendSessionPayload(payload: Bytes, session: LinkSession): boolean; private clearTimers; private showFee; private showRecovery; prepare(request: SigningRequest, session?: LinkSession): Promise; recoverError(error: Error, request: SigningRequest): boolean; onSuccess(request: SigningRequest): void; onFailure(request: SigningRequest, error: Error): void; userAgent(): string; } export { BrowserTransportOptions, BrowserTransport as default };