Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add Web3Modal demo #568

Merged
merged 2 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

- Related documentation: [Deep Linking into the Coinbase Wallet Dapp Browser](https://docs.cloud.coinbase.com/wallet-sdk/docs/deep-link-into-dapp-browser)

### Integrate with web3modal

[web3modal example](web3modal-demo/)

- Related documentation: [Integrating with Web3Modal](https://docs.cloud.coinbase.com/wallet-sdk/docs/web3modal)

### Integrate with web3-onboard

[web3-onboard example](web3-onboard-demo/)
Expand Down
2 changes: 2 additions & 0 deletions examples/web3modal-demo/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
GENERATE_SOURCEMAP=false
INFURA_ID=
21 changes: 21 additions & 0 deletions examples/web3modal-demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
15 changes: 15 additions & 0 deletions examples/web3modal-demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Coinbase Wallet: Integrate with Web3Modal

This sample application demonstrates how to integrate Coinbase Wallet into a decentralized application using the Web3Modal library.

Install packages:

`npm install`

Run app:

`npm start`

Open app:

http://localhost:3000/
32 changes: 32 additions & 0 deletions examples/web3modal-demo/config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
const webpack = require("webpack");

module.exports = function override(config, env) {
config.resolve.fallback = {
...config.resolve.fallback,
assert: require.resolve("assert/"),
buffer: require.resolve("buffer/"),
http: require.resolve("stream-http"),
https: require.resolve("https-browserify"),
os: require.resolve("os-browserify/browser"),
stream: require.resolve("stream-browserify"),
url: require.resolve("url/"),
util: require.resolve("util/"),
};
config.resolve.extensions = [
...config.resolve.extensions,
".ts",
".tsx",
".js",
];
config.plugins = [
...config.plugins,
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"],
}),
new webpack.DefinePlugin({
"process.env.INFURA_ID": JSON.stringify(process.env.INFURA_ID),
}),
];

return config;
};
Loading