Skip to content
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

Adds multiple wallet providers support with Web3modal #8

Closed
wants to merge 20 commits into from

Conversation

jcurbelo
Copy link
Collaborator

@jcurbelo jcurbelo commented Feb 6, 2022

Changes

Adds support for the following providers:

See web3modal

@@ -27,5 +29,25 @@ module.exports = {
},
resolve: {
extensions: ['.ts', '.js', '.tsx', '.jsx'],
fallback: {
Copy link
Collaborator Author

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// new webpack.ProvidePlugin({
// process: 'process/browser',
// }),
new Dotenv(),
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

Copy link
Collaborator Author

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. */
Copy link
Collaborator Author

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

Copy link
Collaborator Author

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?

@jcurbelo jcurbelo marked this pull request as ready for review February 6, 2022 22:30
@jcurbelo jcurbelo added the enhancement New feature or request label Feb 9, 2022
@jcurbelo jcurbelo closed this Mar 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant