export declare interface IAppEntry { id: string; name: string; homepage: string; chains: string[]; image_id: string; image_url: { sm: string; md: string; lg: string; }; app: { browser: string; ios: string; android: string; mac: string; windows: string; linux: string; }; mobile: { native: string; universal: string; }; desktop: { native: string; universal: string; }; metadata: { shortName: string; colors: { primary: string; secondary: string; }; }; } export declare type IAppRegistry = { [id: string]: IAppEntry; }; export declare type ICallback = () => void; export declare interface ICallTxData { type?: string; to?: string; value?: number | string; gas?: number | string; gasLimit?: number | string; gasPrice?: number | string; nonce?: number | string; data?: string; } export declare interface IClientMeta { description: string; url: string; icons: string[]; name: string; } export declare interface IConnector { bridge: string; key: string; clientId: string; peerId: string; readonly clientMeta: IClientMeta | null; peerMeta: IClientMeta | null; handshakeTopic: string; handshakeId: number; uri: string; chainId: number; networkId: number; accounts: string[]; rpcUrl: string; readonly connected: boolean; readonly pending: boolean; session: IWalletConnectSession; on(event: string, callback: (error: Error | null, payload: any | null) => void): void; connect(opts?: ICreateSessionOptions): Promise; createSession(opts?: ICreateSessionOptions): Promise; approveSession(sessionStatus: ISessionStatus): void; rejectSession(sessionError?: ISessionError): void; updateSession(sessionStatus: ISessionStatus): void; killSession(sessionError?: ISessionError): Promise; sendTransaction(tx: ITxData): Promise; signTransaction(tx: ITxData): Promise; signMessage(params: any[]): Promise; signPersonalMessage(params: any[]): Promise; signTypedData(params: any[]): Promise; updateChain(chainParams: IUpdateChainParams): Promise; sendCustomRequest(request: Partial, options?: IRequestOptions): Promise; unsafeSend(request: IJsonRpcRequest, options?: IRequestOptions): Promise; approveRequest(response: Partial): void; rejectRequest(response: Partial): void; } export declare interface IConnectorOpts { cryptoLib: ICryptoLib; connectorOpts: IWalletConnectOptions; transport?: ITransportLib; sessionStorage?: ISessionStorage; pushServerOpts?: IPushServerOptions; } export declare interface ICreateSessionOptions { chainId?: number; } export declare interface ICryptoLib { generateKey: (length?: number) => Promise; encrypt: (data: IJsonRpcRequest | IJsonRpcResponseSuccess | IJsonRpcResponseError, key: ArrayBuffer, iv?: ArrayBuffer) => Promise; decrypt: (payload: IEncryptionPayload, key: ArrayBuffer) => Promise; } export declare interface IEncryptionPayload { data: string; hmac: string; iv: string; } export declare interface IError extends Error { res?: any; code?: any; } export declare type IErrorCallback = (err: Error | null, data?: any) => void; export declare interface IEventEmitter { event: string; callback: (error: Error | null, request: any | null) => void; } export declare abstract class IEvents { abstract on(event: string, listener: any): void; abstract once(event: string, listener: any): void; abstract off(event: string, listener: any): void; abstract removeListener(event: string, listener: any): void; } export declare interface IInternalEvent { event: string; params: any; } export declare interface IInternalRequestOptions extends IRequestOptions { topic: string; } export declare interface IJsonRpcErrorMessage { code?: number; message: string; data?: string; } export declare interface IJsonRpcRequest { id: number; jsonrpc: string; method: string; params: any[]; } export declare interface IJsonRpcResponseError { id: number; jsonrpc: string; error: IJsonRpcErrorMessage; } export declare interface IJsonRpcResponseSuccess { id: number; jsonrpc: string; result: any; } export declare interface IJsonRpcSubscription { id: number; jsonrpc: string; method: string; params: any; } export declare interface IMobileLinkInfo { name: string; href: string; } export declare type IMobileRegistry = IMobileRegistryEntry[]; export declare interface IMobileRegistryEntry { name: string; shortName: string; color: string; logo: string; universalLink: string; deepLink: string; } export declare interface INativeWalletOptions { clientMeta: IClientMeta; push?: IPushServerOptions | null; } export declare interface INetworkEventEmitter { event: NetworkEvent; callback: () => void; } export declare interface INetworkMonitor { on: (event: NetworkEvent, callback: () => void) => void; } export declare interface INodeJSOptions { clientMeta: IClientMeta; } export declare interface IParseURIResult { protocol: string; handshakeTopic: string; version: number; bridge: string; key: string; } export declare interface IPushServerOptions { url: string; type: string; token: string; peerMeta?: boolean; language?: string; } export declare interface IPushSubscription { bridge: string; topic: string; type: string; token: string; peerName: string; language: string; } export declare interface IQRCodeModal { open(uri: string, cb: any, opts?: any): void; close(): void; } export declare interface IQRCodeModalOptions { registryUrl?: string; mobileLinks?: string[]; desktopLinks?: string[]; } export declare interface IQueryParamsResult { bridge: string; key: string; } export declare interface IRequestOptions { forcePushNotification?: boolean; } export declare interface IRequiredParamsResult { handshakeTopic: string; version: number; } export declare interface IRpcConfig { infuraId: string | undefined; custom: IRPCMap | undefined; } export declare interface IRpcConnection extends IEvents { connected: boolean; send(payload: any): Promise; open(): Promise; close(): Promise; } export declare interface IRPCMap { [chainId: number]: string; } export declare interface ISessionError { message?: string; } export declare interface ISessionParams { approved: boolean; chainId: number | null; networkId: number | null; accounts: string[] | null; rpcUrl?: string | null; peerId?: string | null; peerMeta?: IClientMeta | null; } export declare interface ISessionStatus { chainId: number; accounts: string[]; networkId?: number; rpcUrl?: string; } export declare interface ISessionStorage { getSession: () => IWalletConnectSession | null; setSession: (session: IWalletConnectSession) => IWalletConnectSession; removeSession: () => void; } export declare interface ISocketMessage { topic: string; type: string; payload: string; silent: boolean; } export declare interface ISocketTransportOptions { protocol: string; version: number; url: string; netMonitor?: INetworkMonitor; subscriptions?: string[]; /** * How long (ms) a socket may sit in CONNECTING before the attempt is * abandoned and retried. Guards against handshakes that never resolve * (e.g. the OS suspended the app mid-connect). Default: 10000. */ connectTimeout?: number; } export declare interface ITransportEvent { event: string; callback: (payload: any) => void; } export declare interface ITransportLib { open: () => void; close: () => void; send: (message: string, topic?: string, silent?: boolean) => void; subscribe: (topic: string) => void; on: (event: string, callback: (payload: any) => void) => void; } export declare interface ITxData extends ICallTxData { from: string; } export declare interface IUpdateChainParams { chainId: number; networkId: number; rpcUrl: string; nativeCurrency: { name: string; symbol: string; }; } export declare interface IWalletConnectOptions { bridge?: string; uri?: string; storageId?: string; signingMethods?: string[]; session?: IWalletConnectSession; storage?: ISessionStorage; clientMeta?: IClientMeta; qrcodeModal?: IQRCodeModal; qrcodeModalOptions?: IQRCodeModalOptions; } export declare interface IWalletConnectProviderOptions extends IWCEthRpcConnectionOptions { pollingInterval?: number; qrcodeModal?: IQRCodeModal; } export declare interface IWalletConnectSDKOptions extends IWalletConnectOptions { bridge?: string; } export declare interface IWalletConnectSession { connected: boolean; accounts: string[]; chainId: number; bridge: string; key: string; clientId: string; clientMeta: IClientMeta | null; peerId: string; peerMeta: IClientMeta | null; handshakeId: number; handshakeTopic: string; } export declare interface IWalletConnectStarkwareProviderOptions extends IWCRpcConnectionOptions { contractAddress: string; } export declare interface IWCEthRpcConnectionOptions extends IWCRpcConnectionOptions { rpc?: IRPCMap; infuraId?: string; } export declare interface IWCRpcConnection extends IRpcConnection { bridge: string; qrcode: boolean; qrcodeModalOptions: IQRCodeModalOptions | undefined; wc: IConnector; chainId: number; connected: boolean; connector: IConnector; create(chainId?: number): void; open(): Promise; close(): Promise; onOpen(): void; onClose(): void; onError(payload: any, message: string, code?: number): void; send(payload: any): Promise; sendPayload(payload: any): Promise; } export declare interface IWCRpcConnectionOptions { connector?: IConnector; bridge?: string; qrcode?: boolean; chainId?: number; storageId?: string; signingMethods?: string[]; qrcodeModalOptions?: IQRCodeModalOptions; clientMeta?: IClientMeta; } export declare type JsonRpc = IJsonRpcRequest | IJsonRpcSubscription | IJsonRpcResponseSuccess | IJsonRpcResponseError; export declare type NetworkEvent = "online" | "offline"; export { }