Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/binance-unisat-injection.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/disconnect-state-consistency.md

This file was deleted.

13 changes: 0 additions & 13 deletions .changeset/metamask-passive-reconnect.md

This file was deleted.

18 changes: 18 additions & 0 deletions packages/client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# @bigmi/client

## 0.10.4

### Patch Changes

- [#80](https://github.com/lifinance/bigmi/pull/80) [`c3bff6a`](https://github.com/lifinance/bigmi/commit/c3bff6a26eefb41316f13fb9a6d52deace5bcb70) Thanks [@chybisov](https://github.com/chybisov)! - Detect Binance when `window.binancew3w` carries no bitcoin provider but `window.unisat` reports `isBinance`. The check returned early on `binancew3w` alone, so that build fell through and Binance was reported unavailable.

- [#80](https://github.com/lifinance/bigmi/pull/80) [`c3bff6a`](https://github.com/lifinance/bigmi/commit/c3bff6a26eefb41316f13fb9a6d52deace5bcb70) Thanks [@chybisov](https://github.com/chybisov)! - Clear a connection even when the connector's `disconnect()` throws. `xverse`, `oyl` and `leather` throw `ProviderNotFoundError` once their provider is gone, which skipped the delete and left the connection to be promoted to `current` — so the store still reported an account that could never sign, and the next disconnect failed too. The state is now consistent and the error still reaches the caller. The connector's own storage shim is cleared on that path too, so the store and storage cannot disagree and a later reconnect cannot silently restore what the user disconnected.

- [#80](https://github.com/lifinance/bigmi/pull/80) [`c3bff6a`](https://github.com/lifinance/bigmi/commit/c3bff6a26eefb41316f13fb9a6d52deace5bcb70) Thanks [@chybisov](https://github.com/chybisov)! - Stop MetaMask Bitcoin from opening the extension on page load. `connect()` ignored the `isReconnecting` flag and read accounts through the interactive `bitcoin:connect`, so `reconnect()` prompted a returning user whose wallet was locked. It now reads the session the wallet already restored, matching `unisat`, `okx`, `binance`, `bitget` and `onekey`.

The wallet fills its `accounts` from a session lookup it does not await, so that read is polled briefly rather than taken as a first snapshot — otherwise a wallet that registers after the app mounts reports no session and never recovers. An absent session now rejects with `ConnectorNotConnectedError` instead of `UserRejectedRequestError`, since nothing was shown to the user.

`isAuthorized()` deliberately gates on the storage shim and the wallet's presence, not on its accounts: the wallet fills its `accounts` from a lookup it does not await, so reading them there would race the restore, report false on every reload and skip reconnect entirely. `connect({ isReconnecting: true })` is what waits for the session and rejects when it never arrives. A failure while reconnecting keeps its own error type rather than becoming `UserRejectedRequestError`, and an account that cannot be parsed is skipped instead of ending the poll.

A `change` event no longer throws out of MetaMask's emitter when one account cannot be parsed, and a batch where nothing parses is treated as the transient half-initialized state rather than a disconnect, and a selection that leaves no payment address now disconnects instead of reporting a connected wallet with no usable address. The connected shim is cleared when the wallet itself disconnects, so revoking the site inside MetaMask is not retried on every load.

An empty selection — a user with no Bitcoin account — now rejects with `ConnectorNotConnectedError` on the interactive path too, rather than a `TypeError` relabelled as a rejection. A reconnect that finds no session keeps the connected shim, because the poll cannot tell an absent session from a wallet that has not answered yet and dropping it would permanently sign out a user whose session is valid; a genuine revoke still clears it through `onDisconnect`. Only the interactive `bitcoin:connect` maps to `UserRejectedRequestError`, so a blocked storage write no longer reports a successful connect as a rejection, and `onDisconnect` releases the events subscription so a later connect rebinds to the current wallet object.

## 0.10.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bigmi/client",
"version": "0.10.3",
"version": "0.10.4",
"description": "Reactive primitives for Bitcoin apps.",
"type": "module",
"main": "./src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const name = '@bigmi/client'
export const version = '0.10.3'
export const version = '0.10.4'
7 changes: 7 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @bigmi/react

## 0.9.4

### Patch Changes

- Updated dependencies [[`c3bff6a`](https://github.com/lifinance/bigmi/commit/c3bff6a26eefb41316f13fb9a6d52deace5bcb70), [`c3bff6a`](https://github.com/lifinance/bigmi/commit/c3bff6a26eefb41316f13fb9a6d52deace5bcb70), [`c3bff6a`](https://github.com/lifinance/bigmi/commit/c3bff6a26eefb41316f13fb9a6d52deace5bcb70)]:
- @bigmi/client@0.10.4

## 0.9.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bigmi/react",
"version": "0.9.3",
"version": "0.9.4",
"description": "React primitives for Bitcoin apps.",
"type": "module",
"main": "./src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const name = '@bigmi/react'
export const version = '0.9.3'
export const version = '0.9.4'