Skip to content

Commit e522683

Browse files
committed
refactor(metamask-connect): consolidate into progressive-disclosure skills
Collapses the 18 granular per-chain/platform/operation skills into 5 task-oriented skills, each with a thin routing skill.md that points into a references/ library (mirrors the domains/performance pattern): - setup-app (9 references: evm/solana x browser/react/react-native, multichain, wagmi, wagmi-connector) - sign-message (evm, solana) - send-transaction (evm, solana) - multichain-operations (evm, solana — invokeMethod sign/send) - migrate (from-sdk, wagmi-connector) troubleshoot-connection and metamask-connect-conventions are unchanged. Original (source-verified) bodies move verbatim into references; only stale cross-skill mentions were rewritten. Addresses review feedback to favor progressive disclosure and composability.
1 parent 1c7d7a8 commit e522683

23 files changed

Lines changed: 109 additions & 91 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12-
- Add `metamask-connect` domain: 18 skills for building dApps with the MetaMask Connect SDK (`@metamask/connect-evm`, `@metamask/connect-multichain`, `@metamask/connect-solana`) across EVM, Solana, multichain, wagmi, and React Native, plus signing, transaction, migration, and troubleshooting skills, and a `metamask-connect-conventions` guardrails skill
12+
- Add `metamask-connect` domain for building dApps with the MetaMask Connect SDK (`@metamask/connect-evm`, `@metamask/connect-multichain`, `@metamask/connect-solana`) and the wagmi `metaMask()` connector. Organized with progressive disclosure as `setup-app`, `sign-message`, `send-transaction`, `multichain-operations`, and `migrate` (each routing into per-stack `references/`), plus `troubleshoot-connection` and a `metamask-connect-conventions` guardrails skill
1313

1414
## [0.1.0]
1515

domains/metamask-connect/skills/migrate-from-sdk/skill.md renamed to domains/metamask-connect/skills/migrate/references/from-sdk.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
---
2-
name: migrate-from-sdk
3-
description: Migrate from @metamask/sdk to @metamask/connect-evm, @metamask/connect-multichain, and @metamask/connect-solana with step-by-step package, API, and configuration changes
4-
maturity: stable
5-
---
61
# Migrate from @metamask/sdk to @metamask/connect
72

83
## When to use
@@ -315,7 +310,7 @@ Key differences:
315310
- The connect-evm-backed `metaMask()` connector ships in `wagmi/connectors` from wagmi 3.6 / `@wagmi/connectors` 8 — there is no `@metamask/connect-evm/wagmi` subpath; install `@metamask/connect-evm` at wagmi's declared peer range
316311
- Use `dapp` not `dappMetadata`
317312
- Connector ID is `'metaMaskSDK'` — find it with `connectors.find(c => c.id === 'metaMaskSDK')`
318-
- Most wagmi hooks work unchanged, but note the wagmi v3 renames: `useConnect().connectors``useConnectors()`, `connectAsync``mutateAsync`, `useAccount``useConnection` (see the migrate-wagmi-metamask-connector skill)
313+
- Most wagmi hooks work unchanged, but note the wagmi v3 renames: `useConnect().connectors``useConnectors()`, `connectAsync``mutateAsync`, `useAccount``useConnection` (see `references/wagmi-connector.md`)
319314

320315
---
321316

domains/metamask-connect/skills/migrate-wagmi-metamask-connector/skill.md renamed to domains/metamask-connect/skills/migrate/references/wagmi-connector.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
---
2-
name: migrate-wagmi-metamask-connector
3-
description: Migrate a wagmi app from @metamask/sdk to the new @metamask/connect-evm connector (wagmi PR #4960)
4-
maturity: stable
5-
---
61
# Migrate Wagmi MetaMask Connector to @metamask/connect-evm
72

83
## When to use
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: migrate
3+
description: Migrate an existing MetaMask integration to the MetaMask Connect SDK — from @metamask/sdk to @metamask/connect-evm / -multichain / -solana with step-by-step package, API, and config changes, or a wagmi app to the new connect-evm metaMask() connector. Routes to per-path references.
4+
maturity: stable
5+
---
6+
# Migrate to the MetaMask Connect SDK
7+
8+
## When to use
9+
10+
Use this when **moving an existing app** onto the MetaMask Connect SDK.
11+
12+
| Migrating from | Reference |
13+
|----------------|-----------|
14+
| `@metamask/sdk``@metamask/connect-*` | [`references/from-sdk.md`](references/from-sdk.md) |
15+
| wagmi app → the new `@metamask/connect-evm` connector | [`references/wagmi-connector.md`](references/wagmi-connector.md) |
16+
17+
After migrating, follow the `metamask-connect-conventions` skill to catch behavior differences (singleton behavior, event payloads, hex chain IDs).

domains/metamask-connect/skills/sign-multichain-evm-transaction/skill.md renamed to domains/metamask-connect/skills/multichain-operations/references/evm.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
---
2-
name: sign-multichain-evm-transaction
3-
description: Sign and send EVM transactions using the multichain client's invokeMethod. Covers eth_sendTransaction, personal_sign, eth_signTypedData_v4, scope selection, and RPC routing for read vs sign operations.
4-
maturity: stable
5-
---
61
# Sign EVM Transactions via Multichain Client
72

83
## When to use

domains/metamask-connect/skills/sign-multichain-solana-transaction/skill.md renamed to domains/metamask-connect/skills/multichain-operations/references/solana.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
---
2-
name: sign-multichain-solana-transaction
3-
description: Sign and send Solana transactions using the multichain client's invokeMethod. Covers signTransaction, signAndSendTransaction, signMessage, building transactions with @solana/web3.js, base64 encoding, mainnet/devnet scopes, and selective disconnect.
4-
maturity: stable
5-
---
61
# Sign Solana Transactions via Multichain Client
72

83
## When to use
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: multichain-operations
3+
description: Sign and send transactions and messages through the MetaMask Connect multichain client's invokeMethod — EVM (eth_sendTransaction, personal_sign, eth_signTypedData_v4) and Solana (signTransaction, signAndSendTransaction, signMessage). Use after createMultichainClient when performing operations across CAIP-2 scopes, including building Solana transactions with @solana/web3.js, base64 encoding, mainnet/devnet scope selection, RPC routing for read vs sign, and selective disconnect. Routes to per-ecosystem references.
4+
maturity: stable
5+
---
6+
# Operations via the MetaMask Connect Multichain Client
7+
8+
## When to use
9+
10+
Use this when you created a **multichain** client (`createMultichainClient`, see the `setup-app` skill → `references/multichain.md`) and need to **sign or send** across CAIP-2 scopes with `invokeMethod`. For the single-chain `createEVMClient` / `createSolanaClient` paths, use the `sign-message` and `send-transaction` skills instead.
11+
12+
| Ecosystem | Reference |
13+
|-----------|-----------|
14+
| EVM scopes (`eth_sendTransaction`, `personal_sign`, `eth_signTypedData_v4`) | [`references/evm.md`](references/evm.md) |
15+
| Solana scopes (`signTransaction`, `signAndSendTransaction`, `signMessage`) | [`references/solana.md`](references/solana.md) |
16+
17+
Follow the `metamask-connect-conventions` skill, especially the multichain session-lifecycle guardrails.

domains/metamask-connect/skills/send-evm-transaction/skill.md renamed to domains/metamask-connect/skills/send-transaction/references/evm.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
---
2-
name: send-evm-transaction
3-
description: Send ETH and contract transactions with MetaMask using eth_sendTransaction via the EIP-1193 provider, gas estimation, receipt polling, and the connectWith shortcut
4-
maturity: stable
5-
---
61
# Send EVM Transactions with MetaMask Connect
72

83
## When to use

domains/metamask-connect/skills/send-solana-transaction/skill.md renamed to domains/metamask-connect/skills/send-transaction/references/solana.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
---
2-
name: send-solana-transaction
3-
description: Build and send a Solana transaction using MetaMask Connect. Covers both the React wallet-adapter approach (sendTransaction) and the vanilla browser approach (signAndSendTransaction wallet-standard feature).
4-
maturity: stable
5-
---
61
# Send Solana Transaction with MetaMask
72

83
## When to use
@@ -47,7 +42,7 @@ transaction.feePayer = senderPubkey;
4742

4843
### Step 2a: Send with React wallet-adapter (useWallet)
4944

50-
**Prerequisites:** `createSolanaClient` has been awaited before rendering, `WalletProvider` is configured with `wallets={[]}`, and the user is connected. See the `setup-solana-react-app` skill.
45+
**Prerequisites:** `createSolanaClient` has been awaited before rendering, `WalletProvider` is configured with `wallets={[]}`, and the user is connected. See the `setup-app` skill (`references/solana-react.md`).
5146

5247
```tsx
5348
import { useWallet, useConnection } from '@solana/wallet-adapter-react';
@@ -102,7 +97,7 @@ function SendTransactionButton() {
10297

10398
### Step 2b: Send with vanilla browser (wallet-standard feature)
10499

105-
**Prerequisites:** `createSolanaClient` has been called and the wallet is connected via `standard:connect`. See the `setup-solana-browser-app` skill.
100+
**Prerequisites:** `createSolanaClient` has been called and the wallet is connected via `standard:connect`. See the `setup-app` skill (`references/solana-browser.md`).
106101

107102
```typescript
108103
import { createSolanaClient } from '@metamask/connect-solana';
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: send-transaction
3+
description: Send transactions with MetaMask in a dApp — EVM (eth_sendTransaction with gas estimation and receipt polling, plus the connectWith shortcut) and Solana (React wallet-adapter sendTransaction or vanilla signAndSendTransaction). Use when submitting on-chain transactions. Routes to per-chain references. For sending through the multichain client's invokeMethod, see the multichain-operations skill.
4+
maturity: stable
5+
---
6+
# Send Transactions with MetaMask Connect
7+
8+
## When to use
9+
10+
Use this to **submit an on-chain transaction** with a directly-created EVM or Solana client. If you set up the **multichain** client (`createMultichainClient`), send via `invokeMethod` instead — see the `multichain-operations` skill.
11+
12+
| Chain | Reference |
13+
|-------|-----------|
14+
| EVM (`eth_sendTransaction`, gas, receipts, `connectWith`) | [`references/evm.md`](references/evm.md) |
15+
| Solana (`sendTransaction` / `signAndSendTransaction`) | [`references/solana.md`](references/solana.md) |
16+
17+
Follow the `metamask-connect-conventions` skill for provider/error-handling guardrails.

0 commit comments

Comments
 (0)