blocknative / web3-onboard

Client library to onboard users to web3 apps
https://onboard.blocknative.com/
MIT License
813 stars 474 forks source link

chore: update web3auth deps and fix build #2228

Closed bengobeil closed 3 weeks ago

bengobeil commented 3 weeks ago

Description

resolve #2056

PLEASE NOTE- Checklist must be complete prior to review.

Checklist

Docs Checklist

If this PR includes changes to add an injected wallet or SDK wallet module:

Please complete the following using the internal demo package. To run this demo use the command yarn && yarn dev to get the project running at http://localhost:8080/

Tests with demo app (injected)

Tests with demo app (SDK)

bengobeil commented 3 weeks ago

just have one question in the code pertaining to behavior for empty rpcUrl now that web3auth does not allow undefined

socket-security[bot] commented 3 weeks ago

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSource
Protestware/Troll package npm/es5-ext@0.10.62
  • Note: This package prints a protestware console message on install regarding Ukraine for users with Russian language locale
Install scripts npm/es5-ext@0.10.62
  • Install script: postinstall
  • Source: node -e "try{require('./_postinstall')}catch(e){}" || exit 0
Install scripts npm/esbuild@0.18.20
Install scripts npm/svelte-preprocess@5.0.1
  • Install script: postinstall
  • Source: echo "[svelte-preprocess] Don't forget to install the preprocessors packages that will be used: sass, stylus, less, postcss & postcss-load-config, coffeescript, pug, etc..."
Install scripts npm/@sveltejs/kit@1.0.0-next.589
  • Install script: postinstall
  • Source: node postinstall.js
Install scripts npm/esbuild@0.21.5
Install scripts npm/secp256k1@3.8.0
  • Install script: install
  • Source: npm run rebuild || echo "Secp256k1 bindings compilation fail. Pure JS implementation will be used."
Install scripts npm/keccak@1.4.0
  • Install script: install
  • Source: npm run rebuild || echo "Keccak bindings compilation fail. Pure JS implementation will be used."

View full report↗︎

Next steps

What is protestware?

This package is a joke, parody, or includes undocumented or hidden behavior unrelated to its primary function.

Consider that consuming this package my come along with functionality unrelated to its primary purpose.

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore npm/es5-ext@0.10.62
  • @SocketSecurity ignore npm/esbuild@0.18.20
  • @SocketSecurity ignore npm/svelte-preprocess@5.0.1
  • @SocketSecurity ignore npm/@sveltejs/kit@1.0.0-next.589
  • @SocketSecurity ignore npm/esbuild@0.21.5
  • @SocketSecurity ignore npm/secp256k1@3.8.0
  • @SocketSecurity ignore npm/keccak@1.4.0
bengobeil commented 3 weeks ago

tested locally within our dapp image

bengobeil commented 3 weeks ago

@Adamj1232 ready for review! (can't add a reviewer it seems)

bengobeil commented 3 weeks ago

@Adamj1232 ready for re-review, rpcUrl is required for web3auth

socket-security[bot] commented 3 weeks ago

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@babel/code-frame@7.24.7 environment 0 24.1 kB nicolo-ribaudo
npm/@babel/compat-data@7.24.7 None 0 65.6 kB nicolo-ribaudo
npm/@babel/core@7.24.7 environment, filesystem, unsafe +1 840 kB nicolo-ribaudo
npm/@babel/generator@7.24.7 None +3 797 kB nicolo-ribaudo
npm/@babel/helper-compilation-targets@7.24.7 None 0 52.2 kB nicolo-ribaudo
npm/@babel/helper-environment-visitor@7.24.7 None 0 6.72 kB nicolo-ribaudo
npm/@babel/helper-function-name@7.24.7 None 0 21.7 kB nicolo-ribaudo
npm/@babel/helper-hoist-variables@7.24.7 None 0 6.99 kB nicolo-ribaudo
npm/@babel/helper-module-imports@7.24.7 None 0 63.7 kB nicolo-ribaudo
npm/@babel/helper-module-transforms@7.24.7 None 0 158 kB nicolo-ribaudo
npm/@babel/helper-plugin-utils@7.24.7 None 0 127 kB nicolo-ribaudo
npm/@babel/helper-simple-access@7.24.7 None 0 14.1 kB nicolo-ribaudo
npm/@babel/helper-split-export-declaration@7.24.7 None 0 10.8 kB nicolo-ribaudo
npm/@babel/helper-string-parser@7.24.7 None 0 31.8 kB nicolo-ribaudo
npm/@babel/helper-validator-identifier@7.24.7 None 0 49.3 kB nicolo-ribaudo
npm/@babel/helper-validator-option@7.24.7 None 0 11.8 kB nicolo-ribaudo
npm/@babel/helpers@7.24.7 None 0 859 kB nicolo-ribaudo
npm/@babel/highlight@7.24.7 environment +1 47.2 kB nicolo-ribaudo
npm/@babel/parser@7.24.7 None 0 1.89 MB nicolo-ribaudo
npm/@babel/runtime@7.21.0 None 0 258 kB nicolo-ribaudo
npm/@babel/template@7.24.7 None 0 69 kB nicolo-ribaudo
npm/@babel/traverse@7.24.7 None 0 634 kB nicolo-ribaudo
npm/@babel/types@7.24.7 environment 0 2.41 MB nicolo-ribaudo
npm/@ensdomains/address-encoder@0.1.9 None 0 2.21 MB makoto_inoue
npm/@ensdomains/ens@0.4.5 None 0 3.96 MB makoto_inoue
npm/@ensdomains/ensjs@2.1.0 None +2 15.8 MB nickjohnson
npm/@esbuild-plugins/node-globals-polyfill@0.2.3 Transitive: environment, filesystem, network, shell +24 227 MB xmorse
npm/@esbuild-plugins/node-modules-polyfill@0.2.2 filesystem Transitive: environment, network, shell, unsafe +31 229 MB xmorse
npm/@eslint-community/eslint-utils@4.3.0 None 0 375 kB eslint-community-bot
npm/@ethereumjs/common@2.5.0 None +3 6.45 MB holgerd77
npm/@ethereumjs/tx@3.3.2 None +1 4.02 MB holgerd77
npm/@ethersproject/abi@5.5.0 None 0 495 kB ricmoo
npm/@ethersproject/abi@5.7.0 None 0 498 kB ricmoo
npm/@ethersproject/abstract-provider@5.7.0 None 0 61 kB ricmoo
npm/@ethersproject/abstract-signer@5.7.0 None 0 82.2 kB ricmoo
npm/@ethersproject/address@5.7.0 None 0 33.1 kB ricmoo
npm/@ethersproject/base64@5.7.0 None 0 11.3 kB ricmoo
npm/@ethersproject/basex@5.7.0 None 0 30.1 kB ricmoo
npm/@ethersproject/bignumber@5.7.0 None 0 143 kB ricmoo
npm/@ethersproject/bytes@5.7.0 None 0 80.9 kB ricmoo
npm/@ethersproject/constants@5.7.0 None 0 18.7 kB ricmoo
npm/@ethersproject/contracts@5.5.0 None 0 249 kB ricmoo
npm/@ethersproject/contracts@5.7.0 None 0 250 kB ricmoo
npm/@ethersproject/hash@5.7.0 None 0 257 kB ricmoo
npm/@ethersproject/hdnode@5.5.0 None 0 81 kB ricmoo
npm/@ethersproject/hdnode@5.7.0 None 0 80.7 kB ricmoo
npm/@ethersproject/json-wallets@5.5.0 None +2 2.78 MB ricmoo
npm/@ethersproject/json-wallets@5.7.0 None 0 125 kB ricmoo
npm/@ethersproject/keccak256@5.7.0 None +1 59 kB ricmoo
npm/@ethersproject/networks@5.7.0 None 0 46.8 kB ricmoo
npm/@ethersproject/networks@5.7.1 None 0 47.5 kB ricmoo
npm/@ethersproject/pbkdf2@5.7.0 None 0 17.4 kB ricmoo
npm/@ethersproject/properties@5.7.0 None 0 31 kB ricmoo
npm/@ethersproject/providers@5.5.0 network +1 1.12 MB ricmoo
npm/@ethersproject/providers@5.7.2 network 0 1.2 MB ricmoo
npm/@ethersproject/random@5.7.0 None 0 17.3 kB ricmoo
npm/@ethersproject/rlp@5.7.0 None 0 29.6 kB ricmoo
npm/@ethersproject/sha2@5.7.0 None 0 21.7 kB ricmoo
npm/@ethersproject/signing-key@5.7.0 None 0 244 kB ricmoo
npm/@ethersproject/solidity@5.5.0 None 0 23.2 kB ricmoo
npm/@ethersproject/solidity@5.7.0 None 0 23.2 kB ricmoo
npm/@ethersproject/strings@5.7.0 None 0 119 kB ricmoo
npm/@ethersproject/transactions@5.7.0 None 0 89.6 kB ricmoo
npm/@ethersproject/units@5.5.0 None 0 20.2 kB ricmoo
npm/@ethersproject/units@5.7.0 None 0 20.2 kB ricmoo
npm/@ethersproject/wallet@5.5.0 None 0 55.5 kB ricmoo
npm/@ethersproject/wallet@5.7.0 None 0 55.2 kB ricmoo
npm/@ethersproject/web@5.7.0 network 0 127 kB ricmoo
npm/@ethersproject/web@5.7.1 network 0 128 kB ricmoo
npm/@ethersproject/wordlists@5.7.0 None 0 390 kB ricmoo
npm/@fontsource/fira-mono@4.5.10 None 0 1.02 MB lotusdevshack
npm/@jridgewell/gen-mapping@0.1.1 None 0 52.4 kB jridgewell
npm/@jridgewell/sourcemap-codec@1.4.14 None 0 40 kB jridgewell
npm/@ledgerhq/devices@4.78.0 None +1 95.8 kB gre
npm/@ledgerhq/errors@4.78.0 None 0 90.7 kB gre
npm/@ledgerhq/hw-transport@4.74.2 None 0 68.2 kB gre
npm/@lit/reactive-element@1.6.1 None +1 800 kB lit-robot
npm/@playwright/test@1.31.2 environment, eval, filesystem, network, shell, unsafe +1 6.31 MB aslushnikov
npm/@rollup/plugin-commonjs@25.0.7 filesystem Transitive: environment +12 861 kB shellscape
npm/@sindresorhus/is@0.7.0 None 0 88.6 kB sindresorhus
npm/@stablelib/random@1.0.2 None +3 157 kB dchest
npm/@sveltejs/adapter-auto@1.0.0-next.91 environment, filesystem, shell +1 78.4 kB svelte-admin
npm/@sveltejs/kit@1.0.0-next.589 environment, eval, filesystem Transitive: network, unsafe +20 2.75 MB svelte-admin
npm/@synthetixio/synpress@3.5.1 environment, filesystem Transitive: eval, network, unsafe +102 38 MB drptbl
npm/@szmarczak/http-timer@4.0.6 None 0 10.8 kB szmarczak
npm/@truffle/abi-utils@0.3.9 None +2 3.87 MB eggplantzzz
npm/@truffle/blockchain-utils@0.1.7 None 0 13.6 kB eggplantzzz
npm/@truffle/codec@0.14.16 None +5 12.9 MB eggplantzzz
npm/@truffle/contract-schema@3.4.13 None 0 277 kB eggplantzzz
npm/@truffle/contract@4.6.18 Transitive: network +17 55.7 MB eggplantzzz
npm/@types/cacheable-request@6.0.3 None +4 3.66 MB types
npm/@types/cookie@0.5.1 None 0 9.76 kB types
npm/@types/estree@1.0.0 None 0 25.7 kB types
npm/@types/express-serve-static-core@4.17.33 None +3 3.69 MB types
npm/@types/express@4.17.17 None +4 3.66 MB types
npm/@types/serve-static@1.15.1 None +2 3.64 MB types
npm/@types/tapable@1.0.8 None 0 17.9 kB types
npm/@typescript-eslint/eslint-plugin@5.49.0 Transitive: environment, filesystem +26 5.69 MB jameshenry
npm/@typescript-eslint/parser@5.49.0 Transitive: environment, filesystem +15 1.98 MB jameshenry
npm/@walletconnect/jsonrpc-provider@1.0.13 None 0 103 kB gancho_walletconnect
npm/@walletconnect/jsonrpc-types@1.0.3 None +1 188 kB gancho_walletconnect
npm/@walletconnect/jsonrpc-utils@1.0.8 None +1 345 kB gancho_walletconnect
npm/@walletconnect/safe-json@1.0.2 None 0 215 kB gancho_walletconnect
npm/@walletconnect/window-getters@1.0.1 None 0 218 kB bkrem
npm/@web3-onboard/common@2.4.2 Transitive: environment, network +16 17.6 MB cmeisl
npm/@web3-onboard/core@2.22.1 network Transitive: environment, filesystem +45 28 MB cmeisl
npm/@web3-onboard/injected-wallets@2.10.1 None +7 1.19 MB cmeisl
npm/@web3-onboard/walletconnect@2.3.9 Transitive: environment, eval, filesystem, network, unsafe +171 33.1 MB cmeisl
npm/ansi-styles@4.3.0 None +2 50.9 kB sindresorhus
npm/assert@2.1.0 Transitive: environment, eval +9 357 kB ljharb
npm/browserify-rsa@4.1.0 None 0 3.68 kB cwmma
npm/browserify-zlib@0.2.0 None +1 980 kB dignifiedquire
npm/call-bind@1.0.7 None +5 100 kB ljharb
npm/crypto-browserify@3.12.0 None +12 334 kB cwmma
npm/d@1.0.1 None +1 125 kB medikoo
npm/debug@4.3.4 environment +1 49.2 kB qix
npm/deepmerge@4.3.0 None 0 30.4 kB tehshrike
npm/define-properties@1.2.1 None +1 39.4 kB ljharb
npm/elliptic@6.5.4 None +2 148 kB indutny
npm/es5-ext@0.10.62 eval +1 402 kB medikoo
npm/es6-symbol@3.1.3 None +2 131 kB medikoo
npm/eslint-config-prettier@8.6.0 None 0 18.2 kB lydell
npm/eslint-plugin-svelte3@4.0.0 None 0 41.3 kB conduitry
npm/eslint@8.33.0 filesystem Transitive: environment, shell, unsafe +61 8.93 MB eslintbot
npm/ethers@5.5.3 Transitive: network +25 12.6 MB ricmoo
npm/fast-glob@3.2.12 filesystem +1 148 kB mrmlnc
npm/get-intrinsic@1.2.4 eval +5 127 kB ljharb
npm/has-tostringtag@1.0.2 None +1 38.2 kB ljharb
npm/hash-base@3.0.4 None 0 6.03 kB dcousens
npm/import-fresh@3.3.0 Transitive: filesystem, unsafe +3 19.8 kB sindresorhus
npm/minimatch@3.1.2 None +3 57.8 kB isaacs
npm/minimist@1.2.6 None 0 33.2 kB substack
npm/next-tick@1.1.0 None 0 7.65 kB medikoo
npm/parse-asn1@5.1.7 Transitive: unsafe +2 167 kB ljharb
npm/prettier-plugin-svelte@2.9.0 environment 0 254 kB dummdidumm
npm/prettier@2.8.3 environment, filesystem, unsafe 0 11.7 MB prettier-bot
npm/readable-stream@2.3.8 environment +5 147 kB matteo.collina
npm/rollup-plugin-polyfill-node@0.12.0 None +3 1.52 MB fredkschott
npm/rxjs@7.8.0 None 0 4.49 MB blesh
npm/sade@1.8.1 None +1 44.8 kB lukeed
npm/svelte-check@3.0.3 Transitive: environment, filesystem +10 4.76 MB svelte-language-tools-deploy
npm/svelte-preprocess@5.0.1 environment, filesystem Transitive: eval +21 2.88 MB dummdidumm
npm/svelte@3.55.1 None 0 9.74 MB conduitry
npm/type-check@0.4.0 None +1 57.9 kB gkz
npm/uint8arrays@3.1.1 None +1 624 kB achingbrain
npm/vite@4.5.3 environment, eval, filesystem, network, shell, unsafe +29 213 MB vitebot
npm/which-typed-array@1.1.15 None +5 122 kB ljharb

🚮 Removed packages: npm/@ampproject/remapping@2.2.1, npm/@babel/code-frame@7.12.11, npm/@babel/helper-annotate-as-pure@7.22.5, npm/@babel/helper-environment-visitor@7.22.20, npm/@babel/helper-module-imports@7.22.15, npm/@babel/helper-validator-option@7.22.15, npm/@babel/parser@7.23.0, npm/@jridgewell/gen-mapping@0.3.3, npm/@jridgewell/resolve-uri@3.1.1, npm/@protobufjs/aspromise@1.1.2, npm/@protobufjs/base64@1.1.2, npm/@protobufjs/codegen@2.0.4, npm/@protobufjs/eventemitter@1.1.0, npm/@protobufjs/fetch@1.1.0, npm/@protobufjs/float@1.0.2, npm/@protobufjs/path@1.1.2, npm/@protobufjs/pool@1.1.0, npm/@protobufjs/utf8@1.1.0, npm/@types/glob@7.2.0, npm/@types/retry@0.12.1, npm/@types/ws@7.4.7, npm/accepts@1.3.8, npm/acorn@7.4.1, npm/agent-base@6.0.2, npm/aggregate-error@3.1.0, npm/ansi-html-community@0.0.8, npm/any-promise@1.3.0, npm/anymatch@3.1.3, npm/arg@4.1.3, npm/array-flatten@1.1.1, npm/assert-plus@1.0.0, npm/batch@0.6.1, npm/big-integer@1.6.51, npm/bluebird@3.7.2, npm/browser-process-hrtime@1.0.0, npm/bytes@3.1.2, npm/call-bind@1.0.2, npm/caniuse-lite@1.0.30001549, npm/combined-stream@1.0.8, npm/commander@2.20.3, npm/compressible@2.0.18, npm/console-control-strings@1.1.0, npm/core-util-is@1.0.2, npm/create-require@1.1.1, npm/cssom@0.3.8, npm/default-gateway@6.0.3, npm/depd@1.1.2, npm/enhanced-resolve@5.17.0, npm/escape-string-regexp@1.0.5, npm/esprima@4.0.1, npm/ethjs-unit@0.1.6, npm/extsprintf@1.3.0, npm/fast-safe-stringify@2.1.1, npm/get-intrinsic@1.1.1, npm/global@4.4.0, npm/has-symbols@1.0.2, npm/hdkey@2.0.1, npm/html-entities@2.3.3, npm/iconv-lite@0.4.24, npm/icss-utils@5.1.0, npm/ipaddr.js@1.9.1, npm/is-callable@1.2.4, npm/is-docker@2.2.1, npm/is-regex@1.1.4, npm/is-string@1.0.7, npm/is-symbol@1.0.4, npm/json-parse-even-better-errors@2.3.1, npm/json-stringify-safe@5.0.1, npm/json5@2.2.3, npm/keccak@3.0.2, npm/lodash@4.17.21, npm/mime-db@1.52.0, npm/mime-types@2.1.35, npm/minimist@1.2.8, npm/ms@2.1.3, npm/nanoid@3.3.6, npm/node-forge@1.3.1, npm/node-releases@2.0.13, npm/object-assign@4.1.1, npm/object-is@1.1.5, npm/open@8.4.2, npm/parseurl@1.3.3, npm/path-key@2.0.1, npm/postcss-value-parser@4.2.0, npm/postcss@8.4.31, npm/process@0.11.10, npm/range-parser@1.2.1, npm/readable-stream@3.6.0, npm/redis-errors@1.2.0, npm/regenerator-runtime@0.14.0, npm/safe-stable-stringify@2.4.3, npm/safer-buffer@2.1.2, npm/semver@5.7.1, npm/signal-exit@3.0.7, npm/source-map@0.5.7, npm/statuses@1.5.0, npm/tapable@2.2.1, npm/through2@2.0.5, npm/through@2.3.8, npm/tough-cookie@2.5.0, npm/tweetnacl@0.14.5, npm/unpipe@1.0.0, npm/uuid@8.3.2, npm/vary@1.1.2, npm/whatwg-mimetype@2.3.0, npm/xhr-request@1.1.0, npm/xhr@2.6.0, npm/xtend@4.0.2, npm/yallist@3.1.1

View full report↗︎

bengobeil commented 3 weeks ago

yarn check-all passes locally @Adamj1232 one check is failing but from what I can see it originates from another merged PR

Adamj1232 commented 3 weeks ago

@bengobeil Im getting this error running the alpha branch - does privateKeyProvider need to be added to web3Auth init props?

Screenshot 2024-06-13 at 13 44 32
bengobeil commented 3 weeks ago

@bengobeil Im getting this error running the alpha branch - does privateKeyProvider need to be added to web3Auth init props? Screenshot 2024-06-13 at 13 44 32

Yes, looks like this when I initialize it

image

bengobeil commented 3 weeks ago

@bengobeil Im getting this error running the alpha branch - does privateKeyProvider need to be added to web3Auth init props? Screenshot 2024-06-13 at 13 44 32

Yes, looks like this when I initialize it

image

from package @web3auth/ethereum-provider

Adamj1232 commented 3 weeks ago

@bengobeil Ok well I will need to revert this merge as it doesnt look like it was tested with the internal demo app or updated for the necessary props

bengobeil commented 3 weeks ago

@Adamj1232 OK, I tried using the demo app with the current version (without my changes) and it didn't seem to work either. I think there is a react dependency.

I think the same props in a react app and it worked (the demo is with svelte).

As for the new props, how do you want to handle that?

Adamj1232 commented 3 weeks ago

@bengobeil new props will need to be added to the Web3AuthModuleInitOptions type here - https://github.com/blocknative/web3-onboard/blob/4d47a5c8f1cb69ae335653ef63066823341a4463/packages/web3auth/src/index.ts#L11

Then after checking with the internal svelte demo that it works we can test again. If there is a react dependency then it may need to be added to the web3auth package.json - possibly as a peer-dep depending on how its setup

bengobeil commented 3 weeks ago

@Adamj1232 it seems privateKeyProvider is already in the props as part of Web3AuthOptions image

bengobeil commented 3 weeks ago

you should get a compiler error if it's not present

bengobeil commented 3 weeks ago

I will however try to get it working with the demo