import type { Bytes } from '@greymass/eosio' ; import type { SigningRequest } from 'eosio-signing-request' ; import type { TransactResult } from './link' ; import type { LinkSession } from './link-session' ; import type { LinkStorage } from './link-storage' ; /**
 * 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.
 */ export interface LinkTransport { param request param cancel onRequest ( request , cancel ) : void ; /** Called if the request was successful. */ onSuccess ? ( request , result ) : void ; /** Called if the request failed. */ onFailure ? ( request , error ) : void ; param session param request onSessionRequest ? ( session , request , cancel ) : void ; /** Can be implemented if transport provides a storage as well. */ storage ? : LinkStorage ; /** Can be implemented to modify request just after it has been created. */ prepare ? ( request , session ? ) : Promise < SigningRequest > ; /** Called immediately when the transaction starts */ showLoading ? ( ) : void ; /** User agent reported to the signer. */ userAgent ? ( ) : string ; /** Send session request payload, optional. Can return false to indicate it has to be sent over the socket. */ sendSessionPayload ? ( payload , session ) : 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.
     */ recoverError ? ( error , request ) : boolean ; }