Skip to content

feat(bitcoin): add MetaMask Bitcoin wallet support#805

Merged
chybisov merged 6 commits into
mainfrom
feature/emb-21-add-bitcoin-support-for-metamask
Jun 26, 2026
Merged

feat(bitcoin): add MetaMask Bitcoin wallet support#805
chybisov merged 6 commits into
mainfrom
feature/emb-21-add-bitcoin-support-for-metamask

Conversation

@chybisov

@chybisov chybisov commented Jun 24, 2026

Copy link
Copy Markdown
Member

Description

Adds MetaMask Bitcoin support to the widget via the Bigmi metamask() connector (lifinance/bigmi#60, released in @bigmi/client@0.9.0).

MetaMask BTC is opt-in, mirroring how reown() is wired — the widget packages add zero @metamask/* dependencies:

  • widget-provider (isWalletInstalled): detects MetaMask Bitcoin (io.metamask.bitcoin) via the shared window.ethereum.isMetaMask signal (same extension as MetaMask EVM; a Wallet-Standard registry check would be a false positive since the adapter registers unconditionally).
  • wallet-management (icons): io.metamask.bitcoin reuses the MetaMask icon, so it dedupes with MetaMask EVM in the wallet list.
  • widget-provider-bitcoin: BitcoinProvider gains a connectors option so integrators can append metamask(). The connector is not in the default config.
  • Playground demonstrates the opt-in: installs @metamask/bitcoin-wallet-standard + @metamask/multichain-api-client, registers the adapter, and passes metamask() via connectors.

Integrators (e.g. Jumper) enable it by installing those two packages, calling registerBitcoinWalletStandard({ client }), and adding metamask() to their bigmi connectors.

Also bumps @bigmi/client^0.9.0 and @bigmi/react^0.8.2. (Phantom Bitcoin was removed separately in #804 — Phantom deprecated its BTC wallet.)

The SDK needs no change — sdk-provider-bitcoin is wallet-agnostic.

Testing

  • pnpm build + pnpm check:types (full workspace) + biome — green.
  • Manual (needs a real wallet): with MetaMask + a Bitcoin account, confirm MetaMask BTC lists, connects, returns a payment address, and signs a testnet PSBT through a LI.FI route. Negative case: a profile without MetaMask must NOT show it as installed.

Linear: EMB-21

@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8415b7b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
@lifi/widget-provider Minor
@lifi/widget-provider-bitcoin Minor
@lifi/wallet-management Patch
@lifi/widget-provider-ethereum Patch
@lifi/widget-provider-solana Patch
@lifi/widget-provider-sui Patch
@lifi/widget-provider-tron Patch
@lifi/widget Patch
vite-iframe Patch
nft-checkout Patch
tanstack-router-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chybisov chybisov added the release-preview Publish a 0.0.0-preview-<sha> build of this PR to npm label Jun 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 Preview published under the preview dist-tag.

Install the exact version(s) — @preview moves with the newest preview across PRs:

npm i @lifi/wallet-management@0.0.0-preview-fe8dc5e6
npm i @lifi/widget-provider-bitcoin@0.0.0-preview-fe8dc5e6
npm i @lifi/widget-provider-ethereum@0.0.0-preview-fe8dc5e6
npm i @lifi/widget-provider-solana@0.0.0-preview-fe8dc5e6
npm i @lifi/widget-provider-sui@0.0.0-preview-fe8dc5e6
npm i @lifi/widget-provider-tron@0.0.0-preview-fe8dc5e6
npm i @lifi/widget-provider@0.0.0-preview-fe8dc5e6
npm i @lifi/widget@0.0.0-preview-fe8dc5e6

@github-actions github-actions Bot removed the release-preview Publish a 0.0.0-preview-<sha> build of this PR to npm label Jun 24, 2026
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

✅ E2E Dev Smoke — passing

Check Result
Dev server start (pnpm dev) ✅ started
Smoke tests ✅ passed

4 passed · 0 failed · 0 skipped · 19s

View run

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

E2E Examples — all passed

All examples passed in the latest run.

@chybisov

Copy link
Copy Markdown
Member Author

Testing the previews

Two ways to test MetaMask Bitcoin against the preview build:

A) This repo's playground (recommended — already wired):

git checkout feature/emb-21-add-bitcoin-support-for-metamask
pnpm install   # pnpm-workspace.yaml override pins @bigmi/client@0.0.0-preview-aab0339
pnpm dev       # widget-playground-vite on :3000

B) Installing the published widget preview elsewhere — NOT self-contained.
The widget ships unbundled and @lifi/widget-provider-bitcoin@preview still declares @bigmi/client: ^0.8.1, so you must also pin the bigmi preview, otherwise @bigmi/client@0.8.1 resolves and metamask is undefined:

// package.json
"@lifi/widget": "0.0.0-preview-fe8dc5e6",
"pnpm": { "overrides": {
  "@bigmi/client": "0.0.0-preview-aab0339",
  "@bigmi/react": "0.0.0-preview-aab0339"
}}

Bigmi preview: lifinance/bigmi#60@bigmi/client@0.0.0-preview-aab0339.
On bigmi 0.9.0 release: drop the override and bump @bigmi/* to ^0.9.0.

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

E2E Playground results

passed  158 passed

Details

stats  158 tests across 10 suites
duration  2 minutes, 15 seconds
commit  8415b7b

📥 Download full HTML report (open the run → Artifacts → playwright-report)

@tomiiide tomiiide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Image Image

Verified and looks good. Thanks for finding this finally.

One Nit:
Can we make the code comments more concise, they are very verbose.

Mirror the reown()/dynamic() pattern: widget packages carry no @metamask/*
deps. widget-provider-bitcoin reverts to no metamask in the default config;
adds a connectors option on BitcoinProvider so integrators append metamask().
Keeps MetaMask BTC detection + icon. Playground demos the opt-in.
…tcoin

Graduates off the preview pin to released @bigmi/client@0.9.0 (which ships the
metamask() connector) + @bigmi/react@0.8.2; removes the pnpm preview override.
bigmi 0.9.0 removed the phantom() connector (Phantom deprecated its BTC wallet),
so drop phantom() from the default config and its installed-check case.
@chybisov chybisov merged commit 6d19d22 into main Jun 26, 2026
29 checks passed
@chybisov chybisov deleted the feature/emb-21-add-bitcoin-support-for-metamask branch June 26, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants