-
Notifications
You must be signed in to change notification settings - Fork 12
Adds multiple wallet providers support with Web3modal #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
config/webpack.config.js
Outdated
@@ -27,5 +29,25 @@ module.exports = { | |||
}, | |||
resolve: { | |||
extensions: ['.ts', '.js', '.tsx', '.jsx'], | |||
fallback: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a few issues with @walletconnect/web3-provider
, needed this "polyfills" to work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related coinbase/coinbase-wallet-sdk#56
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use https://github.com/Richienb/node-polyfill-webpack-plugin instead
// new webpack.ProvidePlugin({ | ||
// process: 'process/browser', | ||
// }), | ||
new Dotenv(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed for .env.
support + webpack
src/DropKit.ts
Outdated
static async create( | ||
key: string, | ||
isDev?: boolean, | ||
providerOptions?: IProviderOptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users could use their own provider as well, pending documentation on this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
related with #5
@@ -64,7 +64,7 @@ | |||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ | |||
|
|||
/* Advanced Options */ | |||
// "skipLibCheck": true, /* Skip type checking of declaration files. */ | |||
"skipLibCheck": true, /* Skip type checking of declaration files. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't like this setting here: had a "clash" with a global type (ethereum
) defined in both: web3modal and walletlink, got the following error:
node_modules/walletlink/dist/index.d.ts:10:9 - error TS2687: All declarations of 'ethereum' must have identical modifiers.
10 ethereum?: WalletLinkProvider;
~~~~~~~~
node_modules/walletlink/dist/index.d.ts:10:9 - error TS2717: Subsequent property declarations must have the same type. Property 'ethereum' must be of type 'any', but here has type 'WalletLinkProvider | undefined'.
10 ethereum?: WalletLinkProvider;
~~~~~~~~
node_modules/web3modal/dist/components/Modal.d.ts:6:9
6 ethereum: any;
~~~~~~~~
'ethereum' was also declared here.
node_modules/web3modal/dist/components/Modal.d.ts:6:9 - error TS2687: All declarations of 'ethereum' must have identical modifiers.
6 ethereum: any;
~~~~~~~~
Found 3 errors.
There is an open issue about this
I will test further but this might break installs of this library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tpae @kelokchan any ideas of how to resolve this issue without setting skipLibCheck
to true
?
# Conflicts: # src/DropKit.ts
Now users will be asked to switch networks if they are connected to a network different than the collections. Also, if the wallet doesn't have the network installed, it prompts to install it as well.
# Conflicts: # src/DropKit.ts
# Conflicts: # config/webpack.config.js # package-lock.json # package.json # src/config/providers.ts
Changes
Adds support for the following providers:
See web3modal