From 1d187b4b195531cf5174a1101049271ac0b1387f Mon Sep 17 00:00:00 2001 From: jalil Date: Thu, 30 Jul 2026 12:25:25 +0200 Subject: [PATCH] Add pluggable wallet onboarding --- .changeset/smart-wallet-paths.md | 7 ++ docs/components/evm.md | 59 ++++++++++----- .../src/components/EvmConnect.vue | 64 +++++++++++++--- .../src/components/EvmConnectAuth.vue | 3 + .../src/components/EvmConnectAuthDialog.vue | 3 + .../src/components/EvmConnectDialog.vue | 3 + .../src/components/EvmInAppWalletSetup.vue | 73 ++++++++++++++++--- packages/components.evm/src/index.ts | 3 + packages/components.evm/src/types.ts | 21 +++++- 9 files changed, 193 insertions(+), 43 deletions(-) create mode 100644 .changeset/smart-wallet-paths.md diff --git a/.changeset/smart-wallet-paths.md b/.changeset/smart-wallet-paths.md new file mode 100644 index 00000000..a7daeb98 --- /dev/null +++ b/.changeset/smart-wallet-paths.md @@ -0,0 +1,7 @@ +--- +'@1001-digital/components.evm': minor +--- + +Make wallet onboarding composable with external-only and in-app-only connector +filters, direct create or restore entry points for in-app wallets, and back +events that bubble through the connect and SIWE auth wrappers. diff --git a/docs/components/evm.md b/docs/components/evm.md index 262b1d17..c3822272 100644 --- a/docs/components/evm.md +++ b/docs/components/evm.md @@ -6,17 +6,17 @@ Components that require wallet or browser APIs are marked client-only by the Nux ## Wallet Connection -| Component | Purpose | Key API | -| ------------------------- | ----------------------------------- | ---------------------------------------------------- | -| `EvmConnect` | Inline wallet connection UI. | Emits `connecting`, `connected`. | -| `EvmConnectDialog` | Dialog-based wallet connection. | Prop `className`; emits `connected`, `disconnected`. | -| `EvmConnectionStatus` | Displays current connection status. | Uses wagmi connection state. | -| `EvmConnectorQR` | Generic QR connector UI. | Prop `uri`. | -| `EvmMetaMaskQR` | MetaMask QR flow. | Prop `uri`; emits `back`. | -| `EvmWalletConnectQR` | WalletConnect QR flow. | Prop `uri`. | -| `EvmWalletConnectWallets` | WalletConnect wallet list. | Prop `uri`; emits `back`. | -| `EvmInAppWalletSetup` | In-app wallet setup UI. | Prop `note`; emits `connected`, `back`. | -| `EvmSeedPhraseInput` | Seed phrase input. | `v-model`, `disabled`; emits `valid`, `submit`. | +| Component | Purpose | Key API | +| ------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------- | +| `EvmConnect` | Inline wallet connection UI. | Props `connectorFilter`, `inAppWalletInitialStep`; emits `connecting`, `connected`, `back`. | +| `EvmConnectDialog` | Dialog-based wallet connection. | Connect props plus `className`; emits `connected`, `disconnected`, `back`. | +| `EvmConnectionStatus` | Displays current connection status. | Uses wagmi connection state. | +| `EvmConnectorQR` | Generic QR connector UI. | Prop `uri`. | +| `EvmMetaMaskQR` | MetaMask QR flow. | Prop `uri`; emits `back`. | +| `EvmWalletConnectQR` | WalletConnect QR flow. | Prop `uri`. | +| `EvmWalletConnectWallets` | WalletConnect wallet list. | Prop `uri`; emits `back`. | +| `EvmInAppWalletSetup` | In-app wallet setup UI. | Props `note`, `initialStep`; emits `connected`, `back`. | +| `EvmSeedPhraseInput` | Seed phrase input. | `v-model`, `disabled`; emits `valid`, `submit`. | ```vue ``` +Use `connectorFilter` to let the host application own a wallet-choice screen. +`external` excludes the in-app connector, while `in-app` opens the in-app +setup without showing the connector list. The optional +`inAppWalletInitialStep` can skip the setup's internal chooser: + +```vue + +``` + ## Accounts, Inputs, and Profiles | Component | Purpose | Key API | @@ -117,12 +142,12 @@ The transaction flow checks chain selection, requests a transaction, waits for a ## SIWE and Auth -| Component | Purpose | Key API | -| ---------------------- | ------------------------------------- | ------------------------------------------------------------------------- | -| `EvmSiwe` | Inline Sign-In with Ethereum flow. | Requires `getNonce` and `verify`; emits `authenticated`, `error`. | -| `EvmSiweDialog` | Dialog-based SIWE flow. | SIWE props plus `className`; emits `authenticated`, `signedOut`, `error`. | -| `EvmConnectAuth` | Wallet connect plus SIWE auth flow. | SIWE props; emits connection and auth events. | -| `EvmConnectAuthDialog` | Dialog wrapper for connect plus SIWE. | SIWE props plus `className`, `noTrigger`. | +| Component | Purpose | Key API | +| ---------------------- | ------------------------------------- | --------------------------------------------------------------------------------------- | +| `EvmSiwe` | Inline Sign-In with Ethereum flow. | Requires `getNonce` and `verify`; emits `authenticated`, `error`. | +| `EvmSiweDialog` | Dialog-based SIWE flow. | SIWE props plus `className`; emits `authenticated`, `signedOut`, `error`. | +| `EvmConnectAuth` | Wallet connect plus SIWE auth flow. | SIWE and connect props; emits connection, auth, and `back` events. | +| `EvmConnectAuthDialog` | Dialog wrapper for connect plus SIWE. | SIWE and connect props plus `className`, `noTrigger`; emits auth and connection events. | ```vue