From 9e0ce113017f35636f2f7c0ed8af41b28da92758 Mon Sep 17 00:00:00 2001 From: Florian Lenz Date: Tue, 26 Jun 2018 03:16:46 +0300 Subject: [PATCH] [vm] added modal and message handler --- index.js | 2 ++ vm-raw/index.js | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/index.js b/index.js index 6875da3..dff058b 100644 --- a/index.js +++ b/index.js @@ -6,6 +6,8 @@ const Pangea = { sendMessage: vm.sendMessage, pangeaETHAddress: vm.pangeaETHAddress, setOpenHandler: vm.setOpenHandler, + showModal: vm.showModal, + setMessageHandler: vm.setMessageHandler }; export default Object.assign(UIElements, Pangea); diff --git a/vm-raw/index.js b/vm-raw/index.js index 8cc54ec..041e41b 100644 --- a/vm-raw/index.js +++ b/vm-raw/index.js @@ -41,4 +41,22 @@ export default { * @param {function} callback */ setOpenHandler: global.onOpen, + + /** + * @desc show modal + * @param {string} title Title to display on modal + * @param {string} layout Layout of the modal body + * @param {function|null} will be called when modal is rendered + */ + showModal: global.showModal, + + /** + * @typedef {Object} DAppMessage + * + * @desc render a message and return json layout + * @param {DAppMessage} dAppMessage The DApp message + * @param {Object} context + * @param {function} callback + */ + setMessageHandler: global.setMessageHandler }