Skip to content

feat: add passport wallet #2193

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

Closed
wants to merge 0 commits into from
Closed

feat: add passport wallet #2193

wants to merge 0 commits into from

Conversation

k-xo
Copy link
Contributor

@k-xo k-xo commented May 14, 2024

Description

Passport is an MPC-based programmable, distributed, and non-custodial key management system, that allows users to generate wallets, scoped to their application, either via user Passkeys, our signer allows you to sign messages and transactions with a Passport Network account.

PLEASE NOTE- Checklist must be complete prior to review.

Checklist

  • Increment the version field in package.json of the package you have made changes in following semantic versioning and using alpha release tagging
  • Check the box that allows repo maintainers to update this PR
  • Test locally to make sure this feature/fix works
  • Run yarn check-all to confirm there are not any associated errors
  • Confirm this PR passes Circle CI checks
  • Add or update relevant information in the documentation

Docs Checklist

  • Include a screenshot of any changes (see docs README on running locally)
  • Add/update the appropriate package README (if applicable)
  • Add/update the related module in the docs demo (if applicable)
  • Add/update the related package in the docs/package.json file (if applicable)

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)

  • send transaction
  • switch chains
  • sign message
  • sign typed message
  • disconnect

Tests with demo app (SDK)

  • send transaction
  • switch chains
  • sign message
  • sign typed message
  • disconnect

Comment on lines 68 to 69
"@0xpass/webauthn-signer": "2.0.0",
"@0xpass/passport": "2.1.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these deps required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes these deps are required

Copy link
Contributor

@Adamj1232 Adamj1232 May 14, 2024

Choose a reason for hiding this comment

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

Why are they required if they are part of the @web3-onboard/passport package dependencies?

Copy link
Contributor Author

@k-xo k-xo May 14, 2024

Choose a reason for hiding this comment

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

actually for this you're right passport can be removed but webauthn-signer is a required dependency. have made changes to reflect this in the latest commit

Copy link
Contributor

@Adamj1232 Adamj1232 May 15, 2024

Choose a reason for hiding this comment

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

@k-xo if it is required for the package to work should it be added to the package dependencies?

Copy link
Contributor Author

@k-xo k-xo May 15, 2024

Choose a reason for hiding this comment

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

@Adamj1232 We have multiple signer types, and support a specific signer interface, so this setup is setting up the flow where users are using passkeys / webauthn signer, so it is required in the application context of setting up the signer, and is the most convenient way of setting it up, however it is not required in the sense it should be included in the onboard package, in future would like to add other signer types as well, but just starting with passkeys, so setting it up this way makes it easier for us to be agnostic with the signer types

so in the demo we have the passport onboard package and the webauthn signer, but in the actual passport package we have the core passport sdk, as well as our viem client.

Copy link

socket-security bot commented May 14, 2024

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

Package New capabilities Transitives Size Publisher
npm/@0xpass/webauthn-signer@2.0.0 None +2 321 kB kwk236
npm/@adraffy/ens-normalize@1.10.0 None 0 441 kB adraffy
npm/@babel/helper-module-imports@7.22.15 None 0 54.4 kB nicolo-ribaudo
npm/@babel/runtime@7.23.2 None 0 247 kB nicolo-ribaudo
npm/@blocto/dappauth@2.1.0 None 0 20.1 kB scottphc
npm/@celo/utils@3.2.0 None +5 881 kB alecps
npm/@chakra-ui/accordion@1.4.12 environment +12 1.23 MB segunadebayo
npm/@chakra-ui/alert@1.3.7 environment +8 765 kB segunadebayo
npm/@chakra-ui/anatomy@1.3.0 environment +8 763 kB segunadebayo
npm/@chakra-ui/avatar@1.3.11 environment +11 1.07 MB segunadebayo
npm/@chakra-ui/breadcrumb@1.3.6 environment +8 769 kB segunadebayo
npm/@chakra-ui/button@1.5.10 environment +12 1.07 MB segunadebayo
npm/@chakra-ui/checkbox@1.7.1 environment +12 1.17 MB segunadebayo
npm/@chakra-ui/clickable@1.2.6 environment 0 73.9 kB segunadebayo
npm/@chakra-ui/close-button@1.2.7 environment +8 751 kB segunadebayo
npm/@chakra-ui/color-mode@2.2.0 None +1 119 kB segunadebayo
npm/@chakra-ui/control-box@1.1.6 environment +8 754 kB segunadebayo
npm/@chakra-ui/counter@1.2.10 environment +2 273 kB segunadebayo
npm/@chakra-ui/css-reset@1.1.3 environment 0 24.1 kB segunadebayo
npm/@chakra-ui/editable@1.4.2 environment +10 1.06 MB segunadebayo
npm/@chakra-ui/focus-lock@1.2.6 environment 0 13.1 kB segunadebayo
npm/@chakra-ui/icon@2.0.5 environment +8 757 kB segunadebayo
npm/@chakra-ui/icons@2.1.1 Transitive: environment +9 1.16 MB segunadebayo
npm/@chakra-ui/input@1.4.6 environment +11 1.11 MB segunadebayo
npm/@chakra-ui/layout@1.8.0 environment +8 913 kB segunadebayo
npm/@chakra-ui/live-region@1.1.6 environment 0 17.4 kB segunadebayo
npm/@chakra-ui/media-query@2.0.4 environment +12 8.9 MB segunadebayo
npm/@chakra-ui/menu@1.8.12 environment +14 3.03 MB segunadebayo
npm/@chakra-ui/modal@1.11.1 environment +13 1.27 MB segunadebayo
npm/@chakra-ui/number-input@1.4.7 environment +11 1.19 MB segunadebayo
npm/@chakra-ui/pin-input@1.7.11 environment +11 1.09 MB segunadebayo
npm/@chakra-ui/popover@1.11.9 environment +12 2.62 MB segunadebayo
npm/@chakra-ui/progress@1.2.6 environment +8 798 kB segunadebayo
npm/@chakra-ui/provider@1.7.14 environment +9 2.1 MB segunadebayo
npm/@chakra-ui/radio@1.5.1 environment +12 1.15 MB segunadebayo
npm/@chakra-ui/react-utils@1.2.3 environment 0 19 kB segunadebayo
npm/@chakra-ui/react@1.8.9 environment Transitive: eval +42 15.6 MB segunadebayo
npm/@chakra-ui/theme-tools@1.3.6 environment +9 1.06 MB segunadebayo
npm/@chakra-ui/utils@1.10.4 environment +3 370 kB segunadebayo
npm/@coinbase/wallet-sdk@3.9.3 network 0 368 kB cb-felix-z
npm/@cosmjs/amino@0.29.5 None +1 227 kB webmaster128
npm/@cosmjs/crypto@0.29.4 None 0 139 kB webmaster128
npm/@cosmjs/encoding@0.29.5 None 0 24.6 kB webmaster128
npm/@cosmjs/math@0.29.5 None 0 36.8 kB webmaster128
npm/@cosmjs/proto-signing@0.29.5 None 0 80 kB webmaster128
npm/@cosmjs/stream@0.29.5 None 0 30.4 kB webmaster128
npm/@cosmjs/tendermint-rpc@0.29.5 network Transitive: environment +4 867 kB webmaster128
npm/@cosmjs/utils@0.29.5 None 0 14.5 kB webmaster128
npm/@emotion/is-prop-valid@1.2.2 environment +1 33.5 kB emotion-release-bot
npm/@emotion/react@11.11.4 environment Transitive: filesystem +13 1.94 MB emotion-release-bot
npm/@emotion/serialize@1.1.4 environment +3 91.4 kB emotion-release-bot
npm/@emotion/styled@11.11.5 environment Transitive: filesystem +10 1.37 MB emotion-release-bot
npm/@emotion/unitless@0.8.1 environment 0 7.05 kB emotion-release-bot
npm/@ethereumjs/util@8.1.0 None +5 2.47 MB holgerd77
npm/@lit-labs/ssr-dom-shim@1.1.2 environment 0 33.7 kB lit-robot
npm/@lit/reactive-element@1.6.3 None 0 788 kB lit-robot
npm/@metamask/json-rpc-engine@7.3.3 None 0 96.9 kB metamaskbot
npm/@metamask/rpc-errors@6.2.1 None 0 129 kB metamaskbot
npm/@metamask/sdk-communication-layer@0.18.5 environment 0 2.85 MB metamaskbot
npm/@metamask/sdk-install-modal-web@0.18.5 None 0 547 kB metamaskbot
npm/@metamask/sdk@0.18.6 Transitive: environment, network +9 32.8 MB metamaskbot
npm/@metamask/utils@8.4.0 None +5 1.13 MB metamaskbot
npm/@motionone/animation@10.16.3 None +2 111 kB popmotion
npm/@motionone/dom@10.16.4 None +1 524 kB popmotion
npm/@motionone/types@10.16.3 None 0 11 kB popmotion
npm/@motionone/utils@10.16.3 None 0 33 kB popmotion
npm/@noble/curves@1.2.0 None 0 1.35 MB paulmillr
npm/@noble/hashes@1.3.2 None 0 747 kB paulmillr
npm/@noble/secp256k1@1.7.1 None 0 111 kB paulmillr
npm/@nodelib/fs.stat@2.0.5 filesystem 0 11.8 kB mrmlnc
npm/@safe-global/safe-apps-provider@0.18.0 None 0 33 kB dasanra
npm/@safe-global/safe-apps-sdk@8.1.0 Transitive: network +1 249 kB dasanra
npm/@scure/base@1.1.3 None 0 77.8 kB paulmillr
npm/@scure/bip32@1.3.2 None 0 57.7 kB paulmillr
npm/@scure/bip39@1.2.1 None 0 357 kB paulmillr
npm/@shapeshiftoss/hdwallet-core@1.52.2 None +3 11.6 MB shapeshift-ci-bot
npm/@sindresorhus/is@4.6.0 None 0 57.5 kB sindresorhus
npm/@solana/web3.js@1.87.1 environment, eval, network +4 11.5 MB buffalojoec
npm/@tanstack/query-core@5.36.0 environment 0 1.95 MB tannerlinsley
npm/@tanstack/query-persist-client-core@4.36.1 environment +1 2.37 MB tannerlinsley
npm/@tanstack/query-sync-storage-persister@4.36.1 None 0 46.3 kB tannerlinsley
npm/@tanstack/react-query-persist-client@4.36.1 Transitive: environment +1 1.41 MB tannerlinsley
npm/@tanstack/react-query@5.36.0 environment 0 1.07 MB tannerlinsley
npm/@toruslabs/base-controllers@2.9.0 network +4 9.35 MB chaitanyapotti
npm/@toruslabs/eccrypto@2.2.1 None 0 47.9 kB chaitanyapotti
npm/@toruslabs/openlogin-jrpc@4.7.2 Transitive: environment +8 2.24 MB chaitanyapotti
npm/@types/bn.js@5.1.2 None 0 14.1 kB types
npm/@types/cacheable-request@6.0.3 None +3 30.1 kB types
npm/@types/connect@3.4.36 None 0 6.21 kB types
npm/@types/estree@1.0.2 None 0 25.7 kB types
npm/@types/express-serve-static-core@4.17.37 None +3 67.9 kB types
npm/@types/express@4.17.19 None +4 38.7 kB types
npm/@types/js-cookie@2.2.7 None 0 7.38 kB types
npm/@types/json-schema@7.0.13 None 0 32.2 kB types
npm/@types/lodash@4.14.199 None 0 863 kB types
npm/@types/mime@1.3.3 None 0 4.09 kB types
npm/@types/node@10.17.60 None 0 632 kB types
npm/@types/secp256k1@4.0.6 None 0 8.05 kB types
npm/@usecapsule/user-management-client@1.4.1 network 0 55 kB nsquare
npm/@usecapsule/web-sdk@1.7.1 environment, network +1 258 kB nsquare
npm/@wagmi/chains@1.8.0 None 0 319 kB jmoxey
npm/@wagmi/connectors@4.3.9 Transitive: environment, eval, filesystem, network +52 61 MB
npm/@wagmi/core@2.9.7 Transitive: environment +1 2.08 MB awkweb
npm/@walletconnect/ethereum-provider@2.9.1 None +23 6.29 MB gancho_walletconnect
npm/@walletconnect/legacy-client@2.0.0 network +3 1.22 MB pedrouid
npm/@walletconnect/legacy-modal@2.0.0 network +2 904 kB pedrouid
npm/@walletconnect/legacy-provider@2.0.0 None +2 1.14 MB pedrouid
npm/@walletconnect/legacy-types@2.0.0 None 0 246 kB pedrouid
npm/@walletconnect/sign-client@2.9.1 Transitive: environment, network +26 8.3 MB gancho_walletconnect
npm/@walletconnect/universal-provider@2.9.1 eval +21 6.72 MB gancho_walletconnect
npm/@web3-onboard/arcana-auth@2.0.0 Transitive: network +1 198 kB cmeisl
npm/@web3-onboard/bitget@2.0.1 None +2 511 kB cmeisl
npm/@web3-onboard/blocto@2.0.1 Transitive: network +1 425 kB cmeisl
npm/@web3-onboard/capsule@2.0.3-alpha.1 Transitive: network +11 38.7 MB cmeisl
npm/@web3-onboard/cede-store@2.2.0 None +7 1.13 MB cmeisl
npm/@web3-onboard/coinbase@2.2.7 None 0 7.13 kB cmeisl
npm/@web3-onboard/core@2.21.6 Transitive: network +10 22.1 MB cmeisl
npm/@web3-onboard/dcent@2.2.7 network +2 2.65 MB cmeisl
npm/@web3-onboard/enkrypt@2.0.4 None 0 6.67 kB cmeisl
npm/@web3-onboard/fortmatic@2.0.19 None 0 7.81 kB cmeisl
npm/@web3-onboard/frame@2.0.2 None 0 6.49 kB cmeisl
npm/@web3-onboard/frontier@2.0.4 None 0 6.25 kB cmeisl
npm/@web3-onboard/gas@2.1.8 None +7 867 kB cmeisl
npm/@web3-onboard/gnosis@2.2.1 Transitive: network +3 294 kB cmeisl
npm/@web3-onboard/infinity-wallet@2.0.4 Transitive: environment +3 136 kB cmeisl
npm/@web3-onboard/injected-wallets@2.10.16 None 0 518 kB cmeisl
npm/@web3-onboard/keepkey@2.3.8 Transitive: environment, network +15 16 MB cmeisl
npm/@web3-onboard/keystone@2.3.8 Transitive: environment +11 9.6 MB cmeisl
npm/@web3-onboard/ledger@2.6.0 Transitive: network +5 4.86 MB cmeisl
npm/@web3-onboard/magic@2.1.7 None 0 66.7 kB cmeisl
npm/@web3-onboard/metamask@2.1.0-viem.1 None +1 38.5 kB cmeisl
npm/@web3-onboard/mew-wallet@2.0.4 None 0 18 kB cmeisl
npm/@web3-onboard/particle-network@2.0.1 None +5 1.5 MB cmeisl
npm/@web3-onboard/phantom@2.0.3 None 0 6.25 kB cmeisl
npm/@web3-onboard/portis@2.1.7 Transitive: environment +4 999 kB cmeisl
npm/@web3-onboard/sequence@2.0.8 Transitive: environment, network +17 3.29 MB cmeisl
npm/@web3-onboard/taho@2.0.5 None 0 21.6 kB cmeisl
npm/@web3-onboard/torus@2.2.6 Transitive: network +6 2.41 MB cmeisl
npm/@web3-onboard/transaction-preview@2.0.8 None +2 777 kB cmeisl
npm/@web3-onboard/trezor@2.4.4 Transitive: environment, filesystem, network +33 12.4 MB cmeisl
npm/@web3-onboard/trust@2.0.4 None 0 9.45 kB cmeisl
npm/@web3-onboard/uauth@2.1.2 Transitive: filesystem, network +15 3.54 MB cmeisl
npm/@web3-onboard/venly@2.0.0 Transitive: network +12 3.12 MB cmeisl
npm/@web3-onboard/walletconnect@2.5.5 None +21 3.88 MB cmeisl
npm/@web3-onboard/web3auth@2.2.3 Transitive: eval, network +52 77.7 MB cmeisl
npm/@web3-onboard/xdefi@2.0.5 None 0 10.1 kB cmeisl
npm/@web3-onboard/zeal@2.0.4 None 0 4.08 kB cmeisl
npm/@web3auth/base@5.2.0 None +3 5.26 MB chaitanyapotti
npm/@webassemblyjs/ast@1.11.6 None +5 341 kB xtuc
npm/@webassemblyjs/wasm-parser@1.11.6 None +7 329 kB xtuc
npm/@xobotyi/scrollbar-width@1.9.5 None 0 18.6 kB xobotyi
npm/abitype@1.0.0 None 0 1.16 MB awkweb
npm/accepts@1.3.8 None 0 16.8 kB dougwilson
npm/anymatch@3.1.3 None 0 9.65 kB phated
npm/assert@2.1.0 None 0 82.1 kB ljharb
npm/axios@1.6.8 network +1 1.87 MB jasonsaayman
npm/bignumber.js@9.1.2 None 0 351 kB mikemcl
npm/body-parser@1.20.2 network Transitive: environment, filesystem +3 348 kB dougwilson
npm/braces@3.0.2 None 0 49.2 kB doowb

🚮 Removed packages: npm/@babel/helper-plugin-utils@7.20.2, npm/@babel/runtime@7.20.6, npm/@cosmjs/encoding@0.28.13, npm/@cosmjs/proto-signing@0.28.13, npm/@cosmjs/tendermint-rpc@0.28.13, npm/@ethersproject/sha2@5.7.0, npm/@gnosis.pm/safe-react-gateway-sdk@2.10.3, npm/@lit-labs/ssr-dom-shim@1.1.0, npm/@lit/reactive-element@1.6.1, npm/@noble/hashes@1.1.4, npm/@shapeshiftoss/hdwallet-core@1.41.0, npm/@types/bn.js@5.1.1, npm/@types/node@18.11.11, npm/@types/react-dom@18.0.9, npm/@types/react@18.0.26, npm/@web3-onboard/coinbase@2.2.2, npm/@web3-onboard/dcent@2.2.5, npm/@web3-onboard/fortmatic@2.0.17, npm/@web3-onboard/gnosis@2.1.8, npm/@web3-onboard/hw-common@2.2.1, npm/@web3-onboard/injected-wallets@2.10.6, npm/@web3-onboard/keepkey@2.3.5, npm/@web3-onboard/keystone@2.3.5, npm/@web3-onboard/ledger@2.4.4, npm/@web3-onboard/magic@2.1.5, npm/@web3-onboard/mew-wallet@2.0.2, npm/@web3-onboard/portis@2.1.5, npm/@web3-onboard/react@2.8.12, npm/@web3-onboard/sequence@2.0.6, npm/@web3-onboard/taho@2.0.2, npm/@web3-onboard/torus@2.2.3, npm/@web3-onboard/trezor@2.4.3, npm/@web3-onboard/trust@2.0.2, npm/@web3-onboard/walletconnect@2.4.6, npm/ansi-styles@3.2.1, npm/bignumber.js@9.1.1, npm/browserslist@4.23.0, npm/bs58@4.0.1, npm/bs58check@2.1.2, npm/buffer@6.0.3, npm/bytebuffer@5.0.1, npm/call-bind@1.0.2, npm/camelcase@5.3.1, npm/caniuse-lite@1.0.30001618, npm/cipher-base@1.0.4, npm/clone@2.1.2, npm/combined-stream@1.0.8, npm/create-hash@1.2.0, npm/create-hmac@1.1.7, npm/cross-fetch@3.1.5, npm/d@1.0.1, npm/debug@4.3.4, npm/decode-uri-component@0.2.2, npm/duplexify@4.1.2, npm/electron-to-chromium@1.4.284, npm/elliptic@6.5.4, npm/end-of-stream@1.4.4, npm/es5-ext@0.10.62, npm/es6-promise@4.2.8, npm/es6-symbol@3.1.3, npm/escalade@3.1.2, npm/eth-block-tracker@4.4.3, npm/eth-json-rpc-filters@4.2.2, npm/eth-query@2.1.2, npm/eth-rpc-errors@4.0.2, npm/ethereumjs-common@1.5.2, npm/ethereumjs-tx@1.3.7, npm/ethers@5.7.2, npm/ethjs-util@0.1.6, npm/events@3.3.0, npm/evp_bytestokey@1.0.3, npm/extsprintf@1.3.0, npm/fast-safe-stringify@2.1.1, npm/follow-redirects@1.15.2, npm/get-intrinsic@1.1.3, npm/google-protobuf@3.21.2, npm/has-symbols@1.0.3, npm/hash.js@1.1.7, npm/ieee754@1.2.1, npm/inherits@2.0.4, npm/is-typed-array@1.1.10, npm/is-typedarray@1.0.0, npm/js-sha3@0.8.0, npm/js-tokens@4.0.0, npm/json-rpc-engine@6.1.0, npm/json-rpc-random-id@1.0.1, npm/json-stable-stringify@1.0.2, npm/json-stringify-safe@5.0.1, npm/keccak@3.0.2, npm/level-errors@1.0.5, npm/lodash@4.17.21, npm/loose-envify@1.4.0, npm/merkle-patricia-tree@2.3.2, npm/mime-types@2.1.35, npm/minimalistic-assert@1.0.1, npm/minimist@1.2.7, npm/nan@2.17.0, npm/next-tick@1.1.0, npm/next@13.1.6, npm/node-fetch@2.6.7, npm/node-gyp-build@4.5.0, npm/node-releases@2.0.14, npm/object-assign@4.1.1, npm/once@1.4.0, npm/p-limit@2.3.0, npm/parse-asn1@5.1.6, npm/pbkdf2@3.1.2, npm/prop-types@15.8.1, npm/protobufjs@6.11.4, npm/randombytes@2.1.0, npm/react-dom@18.2.0, npm/react@18.2.0, npm/readable-stream@3.6.0, npm/ripemd160@2.0.2, npm/ripple-address-codec@4.2.5, npm/rlp@2.2.7, npm/safe-buffer@5.2.1, npm/safer-buffer@2.1.2, npm/scrypt-js@3.0.1, npm/sdp@2.12.0, npm/secp256k1@4.0.3, npm/semaphore@1.1.0, npm/semver@6.3.0, npm/sha.js@2.4.11, npm/string-width@4.2.3, npm/strip-ansi@6.0.1, npm/through2@2.0.5

View full report↗︎

Copy link

socket-security bot commented May 14, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

@@ -0,0 +1,298 @@
import { createEIP1193Provider, type WalletInit } from '@web3-onboard/common'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import { createEIP1193Provider, type WalletInit } from '@web3-onboard/common'
import type { WalletInit } from '@web3-onboard/common'

Can you please split this out as well and dynamically import createEIP1193Provider within the getInterface method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@k-xo
Copy link
Contributor Author

k-xo commented May 15, 2024

@Adamj1232 any pointer to fixing the build issue? haven't made any changes to any other packages, was working fine at a point, and now... isn't unsure why

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants