From a685bdc24d284af027a502f4cafb8f786f198963 Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Thu, 31 Oct 2019 16:46:52 -0230 Subject: [PATCH 1/2] Update custom account to use html in prompt --- examples/custom-account/dist/bundle.js | 4 +++- examples/custom-account/index.html | 2 +- examples/custom-account/index.js | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/custom-account/dist/bundle.js b/examples/custom-account/dist/bundle.js index 8c38868e4..41042c43c 100644 --- a/examples/custom-account/dist/bundle.js +++ b/examples/custom-account/dist/bundle.js @@ -26,7 +26,9 @@ wallet.registerAccountMessageHandler(async (origin, req) => { case 'wallet_signTypedData': case 'wallet_signTypedData_v3': case 'wallet_signTypedData_v4': - const result = await prompt(`The site from ${origin} requests you sign this with your offline strategy:\n${JSON.stringify(req)}`) + const result = await prompt(`
+ The site from ${origin} requests you sign this with your offline strategy:\n${JSON.stringify(req)} +
`) return result default: throw rpcErrors.methodNotFound(req) diff --git a/examples/custom-account/index.html b/examples/custom-account/index.html index 092cef1f0..62b99729c 100644 --- a/examples/custom-account/index.html +++ b/examples/custom-account/index.html @@ -85,7 +85,7 @@

Hello Offline Account!

method: 'eth_sendTransaction', params: [{ from: account, - value: '0x100000000000000000', + value: '0x10000000000000', to: '0x55e2780588aa5000f464f700d2676fd0a22ee160', }] }) diff --git a/examples/custom-account/index.js b/examples/custom-account/index.js index 1d629eb31..0ff952f53 100644 --- a/examples/custom-account/index.js +++ b/examples/custom-account/index.js @@ -25,7 +25,9 @@ wallet.registerAccountMessageHandler(async (origin, req) => { case 'wallet_signTypedData': case 'wallet_signTypedData_v3': case 'wallet_signTypedData_v4': - const result = await prompt(`The site from ${origin} requests you sign this with your offline strategy:\n${JSON.stringify(req)}`) + const result = await prompt(`
+ The site from ${origin} requests you sign this with your offline strategy:\n${JSON.stringify(req)} +
`) return result default: throw rpcErrors.methodNotFound(req) From 1e6f3e1963c3ea2ca54e0f8dc373563b2393fc11 Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Thu, 31 Oct 2019 16:48:29 -0230 Subject: [PATCH 2/2] Update custom-account example to use customHtml property --- examples/custom-account/dist/bundle.js | 4 ++-- examples/custom-account/index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/custom-account/dist/bundle.js b/examples/custom-account/dist/bundle.js index 41042c43c..239dcc1ae 100644 --- a/examples/custom-account/dist/bundle.js +++ b/examples/custom-account/dist/bundle.js @@ -26,9 +26,9 @@ wallet.registerAccountMessageHandler(async (origin, req) => { case 'wallet_signTypedData': case 'wallet_signTypedData_v3': case 'wallet_signTypedData_v4': - const result = await prompt(`
+ const result = await prompt({ customHtml: `
The site from ${origin} requests you sign this with your offline strategy:\n${JSON.stringify(req)} -
`) +
`}) return result default: throw rpcErrors.methodNotFound(req) diff --git a/examples/custom-account/index.js b/examples/custom-account/index.js index 0ff952f53..c0df862ff 100644 --- a/examples/custom-account/index.js +++ b/examples/custom-account/index.js @@ -25,9 +25,9 @@ wallet.registerAccountMessageHandler(async (origin, req) => { case 'wallet_signTypedData': case 'wallet_signTypedData_v3': case 'wallet_signTypedData_v4': - const result = await prompt(`
+ const result = await prompt({ customHtml: `
The site from ${origin} requests you sign this with your offline strategy:\n${JSON.stringify(req)} -
`) +
`}) return result default: throw rpcErrors.methodNotFound(req)