forked from unstoppabledomains/MEWconnect-web-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle send with two arguments instead of properly formatted payload
- Loading branch information
1 parent
59a9481
commit 6fbc1d1
Showing
8 changed files
with
68 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,4 @@ export default async ({ payload, store }, res, next) => { | |
res(null, toPayload(payload.id, [])); | ||
} | ||
} | ||
|
||
}; |
16 changes: 16 additions & 0 deletions
16
src/connectProvider/web3Provider/web3-provider/methods/eth_requestAccounts.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { toPayload } from '../jsonrpc'; | ||
|
||
export default async ({ payload, store }, res, next) => { | ||
if (payload.method !== 'eth_requestAccounts') return next(); | ||
if(store.state.wallet){ | ||
res(null, toPayload(payload.id, [store.state.wallet.getAddressString()])); | ||
} else { | ||
try { | ||
store.state.enable().then(accounts =>{ | ||
res(null, toPayload(payload.id, accounts)); | ||
}) | ||
} catch (e) { | ||
res(null, toPayload(payload.id, [])); | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters