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

Update type signature of RpcProviderModule to implement Web3's AbstractProvider #83

Closed
2 tasks done
smithki opened this issue May 5, 2020 · 5 comments · Fixed by #201
Closed
2 tasks done

Update type signature of RpcProviderModule to implement Web3's AbstractProvider #83

smithki opened this issue May 5, 2020 · 5 comments · Fixed by #201
Assignees
Labels
✨Feature Request 💜 Help Wanted prerelease This change is available in a prerelease. released This issue/pull request has been released.

Comments

@smithki
Copy link
Contributor

smithki commented May 5, 2020

✅ Prerequisites

  • Did you perform a cursory search of open issues? Is this feature already requested elsewhere?
  • Are you reporting to the correct repository (magic-sdk)?

✨ Feature Request

Currently, to use Web3 features in TypeScript, the magic.rpcProvider member must be cast to any, like this:

new Web3(magic.rpcProvider as any);

But, now that web3/web3.js#3380 is resolved, we can implement the Web3 AbstractProvider interface to gain strong typing. Once this is implemented, consumers of rpcProvider can simply do this:

new Web3(magic.rpcProvider); // No compiler error! Yay! 🚀
@sebastiandine
Copy link

This issue still exists in the latest version. The workaround is still applicable but it would be nice to see this completely fixed in future releases.

@smithki
Copy link
Contributor Author

smithki commented Jun 28, 2021

We are open to a community PR @sebastiandine!

adenekan41 added a commit that referenced this issue Sep 1, 2021
adenekan41 added a commit that referenced this issue Sep 1, 2021
smithki added a commit that referenced this issue Sep 2, 2021
* (feat): Added 'web3-core' package v1.5.2  to import the new AbstractProvider Type

* (feat): fix #83

* First step to refactoring 'PayloadTransport' into 'ViewController'

* Fix remaining tests

* Update 'peerDependencies' for @magic-sdk/commons

* Fix clean script

Co-authored-by: Adenekan Wonderful <[email protected]>
@smithki smithki added the released This issue/pull request has been released. label Sep 2, 2021
smithki added a commit that referenced this issue Sep 2, 2021
* (feat): Added 'web3-core' package v1.5.2  to import the new AbstractProvider Type

* (feat): fix #83

* First step to refactoring 'PayloadTransport' into 'ViewController'

* Fix remaining tests

* Update 'peerDependencies' for @magic-sdk/commons

* Fix clean script

Co-authored-by: Adenekan Wonderful <[email protected]>
smithki added a commit that referenced this issue Sep 10, 2021
* Re-factor scripts for building, development, linting, and cleaning to TypeScript

* Remove remnants of old test runner (ava)

* Re-factor scripts for unit testing to TypeScript

* Small cleanups

* Refactor to merge `ViewController` and `PayloadTransport` classes (#203)

* (feat): Added 'web3-core' package v1.5.2  to import the new AbstractProvider Type

* (feat): fix #83

* First step to refactoring 'PayloadTransport' into 'ViewController'

* Fix remaining tests

* Update 'peerDependencies' for @magic-sdk/commons

* Fix clean script

Co-authored-by: Adenekan Wonderful <[email protected]>

* Make script code more DRY

* Update TypeScript & make scripts more DRY

* Fix typo and add 'printSeparator' script utility

* Fix 'inject-env.ts' script following re-organization of code

* Remove outdated / unused dependencies from root PackageJSON

* Progress towards integrating microbundle

* Update build scripts to bundle all packages via microbundle

* Remove unnecessary console statement

* Run pre-commit hooks against all packages

* Add more memory for tasks spawned via 'wsrun'

* Raise the resource class in CI

* Try to fix ENOMEM errors in CI by limiting concurrency

* Replace 'p-limit' dependency with prior version (new version is ESM-only)

* Better caching in CircleCI

* Update test script to work with Yarn 2

* Fix tests related to ViewController refactor

* Reduce the CircleCI resource class back to medium

* Fix tests related to ViewController refactor

Co-authored-by: Adenekan Wonderful <[email protected]>
@smithki smithki added the prerelease This change is available in a prerelease. label Sep 10, 2021
smithki added a commit that referenced this issue Sep 14, 2021
* Re-factor build scripts to TypeScript (#202)

* Re-factor scripts for building, development, linting, and cleaning to TypeScript

* Remove remnants of old test runner (ava)

* Re-factor scripts for unit testing to TypeScript

* Small cleanups

* Refactor to merge `ViewController` and `PayloadTransport` classes (#203)

* (feat): Added 'web3-core' package v1.5.2  to import the new AbstractProvider Type

* (feat): fix #83

* First step to refactoring 'PayloadTransport' into 'ViewController'

* Fix remaining tests

* Update 'peerDependencies' for @magic-sdk/commons

* Fix clean script

Co-authored-by: Adenekan Wonderful <[email protected]>

* Make script code more DRY

* Update TypeScript & make scripts more DRY

* Fix typo and add 'printSeparator' script utility

* Fix 'inject-env.ts' script following re-organization of code

* Remove outdated / unused dependencies from root PackageJSON

* Progress towards integrating microbundle

* Update build scripts to bundle all packages via microbundle

* Remove unnecessary console statement

* Run pre-commit hooks against all packages

* Add more memory for tasks spawned via 'wsrun'

* Raise the resource class in CI

* Try to fix ENOMEM errors in CI by limiting concurrency

* Replace 'p-limit' dependency with prior version (new version is ESM-only)

* Better caching in CircleCI

* Update test script to work with Yarn 2

* Fix tests related to ViewController refactor

* Reduce the CircleCI resource class back to medium

* Fix tests related to ViewController refactor

Co-authored-by: Adenekan Wonderful <[email protected]>

* Fix ENV variable interpolations

* Force publish

* Remove temporary change (#205)

* Add '--force-publish' flag to 'lerna version' command

* Apply forcePublish to 'auto'

* Log environment in one place during build

* Trigger publish on 'magic-sdk' and '@magic-sdk/react-native'

* Remove comments used to trigger prerelease

* Fix SemVer issues

* Ignore 'semver' wrapper from test coverage

* Target 'web'

Co-authored-by: Adenekan Wonderful <[email protected]>
@smithki
Copy link
Contributor Author

smithki commented Sep 17, 2021

2 similar comments
@smithki
Copy link
Contributor Author

smithki commented Sep 17, 2021

@smithki
Copy link
Contributor Author

smithki commented Sep 17, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨Feature Request 💜 Help Wanted prerelease This change is available in a prerelease. released This issue/pull request has been released.
Projects
None yet
2 participants