From ff50eb5b1f0035068fd9bb1eb825e002636a782e Mon Sep 17 00:00:00 2001 From: Erik Marks Date: Tue, 14 Sep 2021 22:17:53 -0700 Subject: [PATCH] snap-examples: Fix compatibility issues --- packages/snap-examples/examples/bls-signer/index.js | 2 +- packages/snap-examples/examples/ethers-js/index.js | 4 +++- packages/snap-examples/examples/hello-snaps/index.js | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/snap-examples/examples/bls-signer/index.js b/packages/snap-examples/examples/bls-signer/index.js index 4b925547bf..3b6d5b5976 100644 --- a/packages/snap-examples/examples/bls-signer/index.js +++ b/packages/snap-examples/examples/bls-signer/index.js @@ -8,7 +8,7 @@ console.log('Hello from bls-snap!'); wallet.registerRpcMessageHandler(async (_originString, requestObject) => { switch (requestObject.method) { case 'getAccount': - return getPubKey(); + return await getPubKey(); case 'signMessage': { const pubKey = await getPubKey(); diff --git a/packages/snap-examples/examples/ethers-js/index.js b/packages/snap-examples/examples/ethers-js/index.js index 09c89151a1..13228f0b7e 100644 --- a/packages/snap-examples/examples/ethers-js/index.js +++ b/packages/snap-examples/examples/ethers-js/index.js @@ -12,7 +12,9 @@ const provider = new ethers.providers.Web3Provider(wallet); wallet.registerRpcMessageHandler(async (_originString, requestObject) => { console.log('received request', requestObject); - const privKey = await wallet.getAppKey(); + const privKey = await wallet.request({ + method: 'snap_getAppKey', + }); console.log(`privKey is ${privKey}`); const ethWallet = new ethers.Wallet(privKey, provider); console.dir(ethWallet); diff --git a/packages/snap-examples/examples/hello-snaps/index.js b/packages/snap-examples/examples/hello-snaps/index.js index cc4440dcd5..73e14a19da 100644 --- a/packages/snap-examples/examples/hello-snaps/index.js +++ b/packages/snap-examples/examples/hello-snaps/index.js @@ -2,7 +2,7 @@ wallet.registerRpcMessageHandler(async (originString, requestObject) => { switch (requestObject.method) { case 'hello': return wallet.request({ - method: 'alert', + method: 'snap_confirm', params: [`Hello, ${originString}!`], }); default: