Skip to content

Commit

Permalink
add connect coinbase handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Derick1530 committed May 5, 2022
1 parent 1055822 commit cd7f486
Show file tree
Hide file tree
Showing 4 changed files with 679 additions and 3,989 deletions.
11 changes: 4 additions & 7 deletions lib/web3/helpers/connecters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ export const connectCoinbase = async () => {
darkMode: false,
});

const provider = coinbaseWallet.makeWeb3Provider(
const ethereum = coinbaseWallet.makeWeb3Provider(
DEFAULT_ETH_JSONRPC_URL,
DEFAULT_CHAIN_ID
);
const web3 = new Web3(provider as any);
const accounts: string[] = await provider.request({

const web3 = new Web3(ethereum as any);
const accounts: string[] = await (ethereum as any).request({
method: "eth_requestAccounts",
});
const account = accounts[0];
Expand All @@ -29,7 +30,3 @@ export const connectCoinbase = async () => {
console.log(ex);
}
};
// const disconnectCoinbase = () => {
// coinbaseWallet.close();
// coinbaseWallet(null);
// };
Loading

0 comments on commit cd7f486

Please sign in to comment.