UNPKG

@keplr-ewallet/ewallet-sdk-cosmos

Version:
25 lines 728 B
import { v4 as uuidv4 } from "uuid"; export async function openModal(data) { const modal_id = uuidv4(); const openModalMsg = { target: "keplr_ewallet_attached", msg_type: "open_modal", payload: { modal_type: "cosmos/make_signature", modal_id, data, }, }; try { const modalResult = await this.eWallet.openModal(openModalMsg); if (!modalResult.success) { throw new Error("modal result not success"); } this.eWallet.closeModal(); return modalResult.data; } catch (err) { throw new Error(`Error getting modal response, err: ${err}`); } } //# sourceMappingURL=open_modal.js.map