/** * @wharfkit/wallet-plugin-cloudwallet v1.6.5 * https://github.com/wharfkit/wallet-plugin-cloudwallet * * @license * Copyright (c) 2023 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 { Signature, AbstractWalletPlugin, WalletPlugin, WalletPluginConfig, WalletPluginMetadata, LoginContext, Cancelable, WalletPluginLoginResponse, ResolvedSigningRequest, TransactContext, WalletPluginSignResponse, UserInterfaceTranslateOptions } from '@wharfkit/session'; interface WAXCloudWalletResponse { verified: boolean; } interface WAXCloudWalletSigningResponse extends WAXCloudWalletResponse { cpu?: number; estimatorWorking?: boolean; net?: number; ram?: number; ramFee?: number; serializedTransaction?: Uint8Array; signatures: Signature[]; type: string; waxFee?: number; } interface WalletPluginCloudWalletOptions { supportedChains?: string[]; url?: string; loginTimeout?: number; /** * @deprecated Mobile app connection support has been discontinued. * This option is accepted for backwards compatibility and ignored. */ mobileAppConnectConfig?: any; } declare class WalletPluginCloudWallet extends AbstractWalletPlugin implements WalletPlugin { /** * The unique identifier for the wallet plugin. */ id: string; /** * The translations for this plugin */ translations: { en: { connecting: string; error: { closed: string; endpoint: string; exception: string; popup: string; response: string; timeout: string; }; login: { popup: string; }; transact: { popup: string; }; }; ko: { connecting: string; error: { closed: string; endpoint: string; exception: string; popup: string; response: string; timeout: string; }; login: { popup: string; }; transact: { popup: string; }; }; 'zh-Hans': { connecting: string; error: { closed: string; endpoint: string; exception: string; popup: string; response: string; timeout: string; }; login: { popup: string; }; transact: { popup: string; }; }; 'zh-Hant': { connecting: string; error: { closed: string; endpoint: string; exception: string; popup: string; response: string; timeout: string; }; login: { popup: string; }; transact: { popup: string; }; }; }; /** * The logic configuration for the wallet plugin. */ readonly config: WalletPluginConfig; /** * The metadata for the wallet plugin to be displayed in the user interface. */ readonly metadata: WalletPluginMetadata; /** * Cloud Wallet Configuration */ url: string; loginTimeout: number; private options?; /** * Constructor to allow overriding of plugin configuration. */ constructor(options?: WalletPluginCloudWalletOptions); /** * Performs the wallet logic required to login and return the chain and permission level to use. * * @param options WalletPluginLoginOptions * @returns Promise */ login(context: LoginContext): Cancelable; waxLogin(context: LoginContext): Promise; /** * Performs the wallet logic required to sign a transaction and return the signature. * * @param chain ChainDefinition * @param resolved ResolvedSigningRequest * @returns Promise */ sign(resolved: ResolvedSigningRequest, context: TransactContext): Cancelable; waxSign(resolved: ResolvedSigningRequest, context: TransactContext): Promise; getWalletResponse(resolved: ResolvedSigningRequest, context: TransactContext, t: (key: string, options?: UserInterfaceTranslateOptions) => string, timeout?: number): Promise; logout(): Promise; } export { WalletPluginCloudWallet };