Skip to content

Commit

Permalink
snap-examples: Fix compatibility issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rekmarks committed Sep 15, 2021
1 parent bffee9d commit ff50eb5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/snap-examples/examples/bls-signer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 3 additions & 1 deletion packages/snap-examples/examples/ethers-js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion packages/snap-examples/examples/hello-snaps/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit ff50eb5

Please sign in to comment.