@bigmi/react 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +200 -0
- package/dist/cjs/context.js.map +1 -1
- package/dist/cjs/errors/context.js.map +1 -1
- package/dist/cjs/hooks/useAccount.js.map +1 -1
- package/dist/cjs/hooks/useConfig.js.map +1 -1
- package/dist/cjs/hooks/useConnect.js.map +1 -1
- package/dist/cjs/hooks/useConnectors.js.map +1 -1
- package/dist/cjs/hooks/useReconnect.js.map +1 -1
- package/dist/cjs/hooks/useSyncExternalStoreWithTracked.js.map +1 -1
- package/dist/cjs/hydrate.js.map +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/context.js.map +1 -1
- package/dist/esm/errors/context.d.ts.map +1 -1
- package/dist/esm/errors/context.js.map +1 -1
- package/dist/esm/hooks/useAccount.d.ts.map +1 -1
- package/dist/esm/hooks/useAccount.js.map +1 -1
- package/dist/esm/hooks/useConfig.d.ts.map +1 -1
- package/dist/esm/hooks/useConfig.js.map +1 -1
- package/dist/esm/hooks/useConnect.d.ts.map +1 -1
- package/dist/esm/hooks/useConnect.js.map +1 -1
- package/dist/esm/hooks/useConnectors.d.ts.map +1 -1
- package/dist/esm/hooks/useConnectors.js.map +1 -1
- package/dist/esm/hooks/useReconnect.d.ts.map +1 -1
- package/dist/esm/hooks/useReconnect.js.map +1 -1
- package/dist/esm/hooks/useSyncExternalStoreWithTracked.d.ts.map +1 -1
- package/dist/esm/hooks/useSyncExternalStoreWithTracked.js.map +1 -1
- package/dist/esm/hydrate.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/package.json +4 -3
- package/src/version.ts +1 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# @bigmi/react
|
|
2
|
+
|
|
3
|
+
## 0.8.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`767fb0c`](https://github.com/lifinance/bigmi/commit/767fb0cba233decea140daf1b562c104f027a261)]:
|
|
8
|
+
- @bigmi/core@0.8.1
|
|
9
|
+
- @bigmi/client@0.8.1
|
|
10
|
+
|
|
11
|
+
> **Pre-Changesets history (aggregated, repo-wide).** The entries below are
|
|
12
|
+
> inherited verbatim from the repository root `CHANGELOG.md`, which aggregated
|
|
13
|
+
> releases across all packages of this monorepo before the Changesets cutover.
|
|
14
|
+
> Many entries reference packages other than `@bigmi/react`; per-package release
|
|
15
|
+
> notes (attributed by Changesets) appear above this section as future releases
|
|
16
|
+
> ship.
|
|
17
|
+
|
|
18
|
+
All notable changes to this project, up to `0.8.0`, were documented in this file
|
|
19
|
+
using [standard-version](https://github.com/conventional-changelog/standard-version)
|
|
20
|
+
commit guidelines.
|
|
21
|
+
|
|
22
|
+
## [0.8.0](https://github.com/lifinance/bigmi/compare/v0.7.1...v0.8.0) (2026-03-25)
|
|
23
|
+
|
|
24
|
+
### ⚠ BREAKING CHANGES
|
|
25
|
+
|
|
26
|
+
- migrate build pipeline from tsc to tsdown (#51)
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
- **react:** resolve useSyncExternalStore SSR infinite loop in useAccount and useConnectors ([#50](https://github.com/lifinance/bigmi/issues/50)) ([691b26c](https://github.com/lifinance/bigmi/commit/691b26c45c1de91ae3a1aaac93b675b40c1d8e5f))
|
|
31
|
+
|
|
32
|
+
- migrate build pipeline from tsc to tsdown ([#51](https://github.com/lifinance/bigmi/issues/51)) ([0c4defb](https://github.com/lifinance/bigmi/commit/0c4defb4d4611fe09fddf01fed1a312de0344c1e))
|
|
33
|
+
|
|
34
|
+
### [0.7.1](https://github.com/lifinance/bigmi/compare/v0.7.0...v0.7.1) (2026-03-12)
|
|
35
|
+
|
|
36
|
+
### Bug Fixes
|
|
37
|
+
|
|
38
|
+
- **core:** add missing jsonrpc and id fields to RPC request body ([#48](https://github.com/lifinance/bigmi/issues/48)) ([9896c7c](https://github.com/lifinance/bigmi/commit/9896c7c6f1498f54c29ae78be8a74008bad3a98a))
|
|
39
|
+
|
|
40
|
+
## [0.7.0](https://github.com/lifinance/bigmi/compare/v0.6.5...v0.7.0) (2026-02-05)
|
|
41
|
+
|
|
42
|
+
### ⚠ BREAKING CHANGES
|
|
43
|
+
|
|
44
|
+
- **client:** add unhosted wallet support (#46)
|
|
45
|
+
|
|
46
|
+
### Features
|
|
47
|
+
|
|
48
|
+
- add reown support ([#44](https://github.com/lifinance/bigmi/issues/44)) ([657cae6](https://github.com/lifinance/bigmi/commit/657cae6615965ec5be6b1c079abc10c34cdc572d))
|
|
49
|
+
- **client:** add unhosted wallet support ([#46](https://github.com/lifinance/bigmi/issues/46)) ([b3537b7](https://github.com/lifinance/bigmi/commit/b3537b77cc8a6322868330f5c6528834d86a5d99))
|
|
50
|
+
|
|
51
|
+
### [0.6.5](https://github.com/lifinance/bigmi/compare/v0.6.4...v0.6.5) (2026-01-08)
|
|
52
|
+
|
|
53
|
+
### Bug Fixes
|
|
54
|
+
|
|
55
|
+
- **blockchair-getXpubAddresses:** return empty data when api returns empty data with 200 ([#43](https://github.com/lifinance/bigmi/issues/43)) ([d2e9b5b](https://github.com/lifinance/bigmi/commit/d2e9b5ba85eff202bfdafa5b6bf9041589e994c8))
|
|
56
|
+
|
|
57
|
+
### [0.6.4](https://github.com/lifinance/bigmi/compare/v0.6.3...v0.6.4) (2025-12-17)
|
|
58
|
+
|
|
59
|
+
### Features
|
|
60
|
+
|
|
61
|
+
- add getXPubAddresses action ([#41](https://github.com/lifinance/bigmi/issues/41)) ([2aa3216](https://github.com/lifinance/bigmi/commit/2aa321602e83fc5642d7b86c8d114a0e0d38c13b))
|
|
62
|
+
|
|
63
|
+
### [0.6.3](https://github.com/lifinance/bigmi/compare/v0.6.2...v0.6.3) (2025-11-26)
|
|
64
|
+
|
|
65
|
+
### [0.6.2](https://github.com/lifinance/bigmi/compare/v0.6.1...v0.6.2) (2025-11-13)
|
|
66
|
+
|
|
67
|
+
### Bug Fixes
|
|
68
|
+
|
|
69
|
+
- **leather-wallet:** cache wallet connection with daily expiry and improve wallet reconnection reliability ([#36](https://github.com/lifinance/bigmi/issues/36)) ([fcff06e](https://github.com/lifinance/bigmi/commit/fcff06e19426154750b775f7a1b83f5c6db038dd))
|
|
70
|
+
|
|
71
|
+
### [0.6.1](https://github.com/lifinance/bigmi/compare/v0.6.0...v0.6.1) (2025-10-29)
|
|
72
|
+
|
|
73
|
+
## [0.6.0](https://github.com/lifinance/bigmi/compare/v0.5.4...v0.6.0) (2025-10-06)
|
|
74
|
+
|
|
75
|
+
### ⚠ BREAKING CHANGES
|
|
76
|
+
|
|
77
|
+
- bump packages
|
|
78
|
+
|
|
79
|
+
- bump packages ([3576fa5](https://github.com/lifinance/bigmi/commit/3576fa55cd7ed3492f29f96a8cff6274313477ff))
|
|
80
|
+
|
|
81
|
+
### [0.5.4](https://github.com/lifinance/bigmi/compare/v0.5.3...v0.5.4) (2025-09-29)
|
|
82
|
+
|
|
83
|
+
### Bug Fixes
|
|
84
|
+
|
|
85
|
+
- **blockchair:** handle zero balance addresses edge case ([#35](https://github.com/lifinance/bigmi/issues/35)) ([a57c5fd](https://github.com/lifinance/bigmi/commit/a57c5fd49ec22df2dd6165725ce2750d81f3267e))
|
|
86
|
+
|
|
87
|
+
### [0.5.3](https://github.com/lifinance/bigmi/compare/v0.5.2...v0.5.3) (2025-09-22)
|
|
88
|
+
|
|
89
|
+
### [0.5.2](https://github.com/lifinance/bigmi/compare/v0.5.1...v0.5.2) (2025-08-28)
|
|
90
|
+
|
|
91
|
+
### Bug Fixes
|
|
92
|
+
|
|
93
|
+
- imports ([6b26572](https://github.com/lifinance/bigmi/commit/6b265727d74bd84d326543a61ab52d4fb0c58ae0))
|
|
94
|
+
|
|
95
|
+
### [0.5.1](https://github.com/lifinance/bigmi/compare/v0.5.0...v0.5.1) (2025-08-28)
|
|
96
|
+
|
|
97
|
+
### Bug Fixes
|
|
98
|
+
|
|
99
|
+
- update connectors to determine chain id based on address ([#33](https://github.com/lifinance/bigmi/issues/33)) ([ae969c9](https://github.com/lifinance/bigmi/commit/ae969c909f6ca4376e4e2468152309251a983910))
|
|
100
|
+
|
|
101
|
+
## [0.5.0](https://github.com/lifinance/bigmi/compare/v0.4.5...v0.5.0) (2025-08-28)
|
|
102
|
+
|
|
103
|
+
### ⚠ BREAKING CHANGES
|
|
104
|
+
|
|
105
|
+
- change chainId to enum (#31)
|
|
106
|
+
|
|
107
|
+
- change chainId to enum ([#31](https://github.com/lifinance/bigmi/issues/31)) ([4e93517](https://github.com/lifinance/bigmi/commit/4e93517e50353ffe949c7fd7cebd3313a9d2d69e))
|
|
108
|
+
|
|
109
|
+
### [0.4.5](https://github.com/lifinance/bigmi/compare/v0.4.4...v0.4.5) (2025-08-27)
|
|
110
|
+
|
|
111
|
+
### [0.4.4](https://github.com/lifinance/bigmi/compare/v0.4.3...v0.4.4) (2025-08-18)
|
|
112
|
+
|
|
113
|
+
### [0.4.3](https://github.com/lifinance/bigmi/compare/v0.4.2...v0.4.3) (2025-07-31)
|
|
114
|
+
|
|
115
|
+
### Bug Fixes
|
|
116
|
+
|
|
117
|
+
- **connectors:** remove retry logic when checking if app isAuthorized ([#30](https://github.com/lifinance/bigmi/issues/30)) ([7709d68](https://github.com/lifinance/bigmi/commit/7709d68f67b19880940d68e288ac061ec4f074f8))
|
|
118
|
+
|
|
119
|
+
### [0.4.2](https://github.com/lifinance/bigmi/compare/v0.4.1...v0.4.2) (2025-07-17)
|
|
120
|
+
|
|
121
|
+
### [0.4.1](https://github.com/lifinance/bigmi/compare/v0.4.0...v0.4.1) (2025-07-02)
|
|
122
|
+
|
|
123
|
+
### Bug Fixes
|
|
124
|
+
|
|
125
|
+
- unisat wallet connector ([#24](https://github.com/lifinance/bigmi/issues/24)) ([6466bc5](https://github.com/lifinance/bigmi/commit/6466bc543719b1b26b1cdf990f2dc667659042a4))
|
|
126
|
+
|
|
127
|
+
## [0.4.0](https://github.com/lifinance/bigmi/compare/v0.4.0-beta.2...v0.4.0) (2025-07-01)
|
|
128
|
+
|
|
129
|
+
### Bug Fixes
|
|
130
|
+
|
|
131
|
+
- **client:** update ctrl wallet signPSBT() signature ([#23](https://github.com/lifinance/bigmi/issues/23)) ([f502b92](https://github.com/lifinance/bigmi/commit/f502b924cdc4412f551c39333ae6bab800904975))
|
|
132
|
+
|
|
133
|
+
### [0.3.1](https://github.com/lifinance/bigmi/compare/v0.3.0...v0.3.1) (2025-05-30)
|
|
134
|
+
|
|
135
|
+
### Features
|
|
136
|
+
|
|
137
|
+
- add more connectors (oyl, binance, magicEden & bitget) ([#17](https://github.com/lifinance/bigmi/issues/17)) ([18ad09a](https://github.com/lifinance/bigmi/commit/18ad09acd07726d25bd6422b0ecedd37745be335))
|
|
138
|
+
|
|
139
|
+
## [0.3.0](https://github.com/lifinance/bigmi/compare/v0.2.1...v0.3.0) (2025-05-28)
|
|
140
|
+
|
|
141
|
+
### ⚠ BREAKING CHANGES
|
|
142
|
+
|
|
143
|
+
- add getUTXOs action (#16)
|
|
144
|
+
|
|
145
|
+
### Features
|
|
146
|
+
|
|
147
|
+
- add getUTXOs action ([#16](https://github.com/lifinance/bigmi/issues/16)) ([e884c02](https://github.com/lifinance/bigmi/commit/e884c02ad902123a9daf2edaeea2ab777c315925))
|
|
148
|
+
|
|
149
|
+
### [0.2.1](https://github.com/lifinance/bigmi/compare/v0.2.0...v0.2.1) (2025-05-14)
|
|
150
|
+
|
|
151
|
+
### Bug Fixes
|
|
152
|
+
|
|
153
|
+
- optimize usage of supported methods by RPC and API transports ([#15](https://github.com/lifinance/bigmi/issues/15)) ([ff20e08](https://github.com/lifinance/bigmi/commit/ff20e089286bdc5f6f9d12ed2362f95d3c276fd9))
|
|
154
|
+
|
|
155
|
+
## [0.2.0](https://github.com/lifinance/bigmi/compare/v0.1.1...v0.2.0) (2025-05-14)
|
|
156
|
+
|
|
157
|
+
### ⚠ BREAKING CHANGES
|
|
158
|
+
|
|
159
|
+
- remove viem dependencies (#14)
|
|
160
|
+
|
|
161
|
+
- remove viem dependencies ([#14](https://github.com/lifinance/bigmi/issues/14)) ([3c3461f](https://github.com/lifinance/bigmi/commit/3c3461f8b646253df0c1614706f4dd5027d53930))
|
|
162
|
+
|
|
163
|
+
### [0.1.1](https://github.com/lifinance/bigmi/compare/v0.0.8...v0.1.1) (2025-02-04)
|
|
164
|
+
|
|
165
|
+
### [0.0.8](https://github.com/lifinance/bigmi/compare/v0.0.7...v0.0.8) (2024-12-30)
|
|
166
|
+
|
|
167
|
+
### Features
|
|
168
|
+
|
|
169
|
+
- add Leather and OneKey wallets ([#7](https://github.com/lifinance/bigmi/issues/7)) ([ac93f66](https://github.com/lifinance/bigmi/commit/ac93f665c8baa24752fd0ad4e2c513b72587060f))
|
|
170
|
+
|
|
171
|
+
### [0.0.7](https://github.com/lifinance/bigmi/compare/v0.0.6...v0.0.7) (2024-12-20)
|
|
172
|
+
|
|
173
|
+
### Features
|
|
174
|
+
|
|
175
|
+
- improve peer dependencies ([#6](https://github.com/lifinance/bigmi/issues/6)) ([a9359d1](https://github.com/lifinance/bigmi/commit/a9359d1f72d5089652bad9311d8cd0ee67c909d4))
|
|
176
|
+
|
|
177
|
+
### [0.0.6](https://github.com/lifinance/bigmi/compare/v0.0.5...v0.0.6) (2024-12-13)
|
|
178
|
+
|
|
179
|
+
### [0.0.5](https://github.com/lifinance/bigmi/compare/v0.0.4...v0.0.5) (2024-12-05)
|
|
180
|
+
|
|
181
|
+
### [0.0.4](https://github.com/lifinance/bigmi/compare/v0.0.3...v0.0.4) (2024-10-28)
|
|
182
|
+
|
|
183
|
+
### Features
|
|
184
|
+
|
|
185
|
+
- add okx wallet ([58b93b5](https://github.com/lifinance/bigmi/commit/58b93b5f8839bbbb0340ff7ac77f03617325c506))
|
|
186
|
+
|
|
187
|
+
### [0.0.3](https://github.com/lifinance/bigmi/compare/v0.0.2...v0.0.3) (2024-10-23)
|
|
188
|
+
|
|
189
|
+
### 0.0.2 (2024-10-17)
|
|
190
|
+
|
|
191
|
+
### Bug Fixes
|
|
192
|
+
|
|
193
|
+
- add createConfig export ([dec450a](https://github.com/lifinance/bigmi/commit/dec450a7e5a071e67e259be78c0b9a8b616c7183))
|
|
194
|
+
|
|
195
|
+
### 0.0.1 (2024-10-15)
|
|
196
|
+
|
|
197
|
+
### Bug Fixes
|
|
198
|
+
|
|
199
|
+
- biome checks ([bc348fa](https://github.com/lifinance/bigmi/commit/bc348faad5cec9ddada1a0c82f4d34e68b85c1c4))
|
|
200
|
+
- tsconfig ([bf6ccea](https://github.com/lifinance/bigmi/commit/bf6cceae3a1602b99b4825ee3695b367d5935226))
|
package/dist/cjs/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","names":["Hydrate"],"sources":["../../src/context.ts"],"sourcesContent":["'use client'\nimport type { State } from '@bigmi/client'\nimport {\n type Context,\n createContext,\n createElement,\n type PropsWithChildren,\n type ReactElement,\n} from 'react'\nimport { Hydrate } from './hydrate.js'\nimport type { ResolvedRegister } from './types.js'\n\nexport const BigmiContext: Context<ResolvedRegister['config'] | undefined> =\n createContext<ResolvedRegister['config'] | undefined>(undefined)\n\nexport type BigmiProviderProps = {\n config: ResolvedRegister['config']\n initialState?: State | undefined\n reconnectOnMount?: boolean | undefined\n}\n\nexport function BigmiProvider(\n parameters: PropsWithChildren<BigmiProviderProps>\n): ReactElement {\n const { children, config } = parameters\n\n const props = { value: config }\n return createElement(\n Hydrate,\n parameters,\n createElement(BigmiContext.Provider, props, children)\n )\n}\n"],"mappings":";;;;;AAYA,MAAa,gBAAA,GAAA,MAAA,eAC2C,KAAA,
|
|
1
|
+
{"version":3,"file":"context.js","names":["Hydrate"],"sources":["../../src/context.ts"],"sourcesContent":["'use client'\nimport type { State } from '@bigmi/client'\nimport {\n type Context,\n createContext,\n createElement,\n type PropsWithChildren,\n type ReactElement,\n} from 'react'\nimport { Hydrate } from './hydrate.js'\nimport type { ResolvedRegister } from './types.js'\n\nexport const BigmiContext: Context<ResolvedRegister['config'] | undefined> =\n createContext<ResolvedRegister['config'] | undefined>(undefined)\n\nexport type BigmiProviderProps = {\n config: ResolvedRegister['config']\n initialState?: State | undefined\n reconnectOnMount?: boolean | undefined\n}\n\nexport function BigmiProvider(\n parameters: PropsWithChildren<BigmiProviderProps>\n): ReactElement {\n const { children, config } = parameters\n\n const props = { value: config }\n return createElement(\n Hydrate,\n parameters,\n createElement(BigmiContext.Provider, props, children)\n )\n}\n"],"mappings":";;;;;AAYA,MAAa,gBAAA,GAAA,MAAA,eAC2C,KAAA,CAAS;AAQjE,SAAgB,cACd,YACc;CACd,MAAM,EAAE,UAAU,WAAW;CAE7B,MAAM,QAAQ,EAAE,OAAO,OAAO;CAC9B,QAAA,GAAA,MAAA,eACEA,gBAAAA,SACA,aAAA,GAAA,MAAA,eACc,aAAa,UAAU,OAAO,QAAQ,CACtD;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","names":["BaseError"],"sources":["../../../src/errors/context.ts"],"sourcesContent":["import { BaseError } from '@bigmi/core'\n\nexport type BigmiProviderNotFoundErrorType = BigmiProviderNotFoundError & {\n name: 'BigmiProviderNotFoundError'\n}\nexport class BigmiProviderNotFoundError extends BaseError {\n override name = 'BigmiProviderNotFoundError'\n constructor() {\n super('`useConfig` must be used within `BigmiProvider`.')\n }\n}\n"],"mappings":";;;AAKA,IAAa,6BAAb,cAAgDA,YAAAA,UAAU;CAExD,cAAc;
|
|
1
|
+
{"version":3,"file":"context.js","names":["BaseError"],"sources":["../../../src/errors/context.ts"],"sourcesContent":["import { BaseError } from '@bigmi/core'\n\nexport type BigmiProviderNotFoundErrorType = BigmiProviderNotFoundError & {\n name: 'BigmiProviderNotFoundError'\n}\nexport class BigmiProviderNotFoundError extends BaseError {\n override name = 'BigmiProviderNotFoundError'\n constructor() {\n super('`useConfig` must be used within `BigmiProvider`.')\n }\n}\n"],"mappings":";;;AAKA,IAAa,6BAAb,cAAgDA,YAAAA,UAAU;CAExD,cAAc;EACZ,MAAM,kDAAkD;cAF1C;CAGhB;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAccount.js","names":["useConfig","useSyncExternalStoreWithTracked"],"sources":["../../../src/hooks/useAccount.ts"],"sourcesContent":["'use client'\n\nimport {\n type Config,\n type GetAccountReturnType,\n getAccount,\n watchAccount,\n} from '@bigmi/client'\n\nimport type { ResolvedRegister } from '../types.js'\nimport { type ConfigParameter, useConfig } from './useConfig.js'\nimport { useSyncExternalStoreWithTracked } from './useSyncExternalStoreWithTracked.js'\n\nexport type UseAccountParameters<config extends Config = Config> =\n ConfigParameter<config>\n\nexport type UseAccountReturnType<config extends Config = Config> =\n GetAccountReturnType<config>\n\nconst DISCONNECTED_ACCOUNT: GetAccountReturnType = {\n account: undefined,\n accounts: undefined,\n chain: undefined,\n chainId: undefined,\n connector: undefined,\n isConnected: false,\n isConnecting: false,\n isDisconnected: true,\n isReconnecting: false,\n status: 'disconnected',\n}\n\nexport function useAccount<C extends Config = ResolvedRegister['config']>(\n parameters: UseAccountParameters<C> = {}\n): UseAccountReturnType<C> {\n const config = useConfig(parameters)\n\n return useSyncExternalStoreWithTracked(\n (onChange) => watchAccount(config, { onChange }),\n () => getAccount(config),\n () => DISCONNECTED_ACCOUNT as UseAccountReturnType<C>\n )\n}\n"],"mappings":";;;;;;AAmBA,MAAM,uBAA6C;CACjD,SAAS,KAAA;CACT,UAAU,KAAA;CACV,OAAO,KAAA;CACP,SAAS,KAAA;CACT,WAAW,KAAA;CACX,aAAa;CACb,cAAc;CACd,gBAAgB;CAChB,gBAAgB;CAChB,QAAQ;
|
|
1
|
+
{"version":3,"file":"useAccount.js","names":["useConfig","useSyncExternalStoreWithTracked"],"sources":["../../../src/hooks/useAccount.ts"],"sourcesContent":["'use client'\n\nimport {\n type Config,\n type GetAccountReturnType,\n getAccount,\n watchAccount,\n} from '@bigmi/client'\n\nimport type { ResolvedRegister } from '../types.js'\nimport { type ConfigParameter, useConfig } from './useConfig.js'\nimport { useSyncExternalStoreWithTracked } from './useSyncExternalStoreWithTracked.js'\n\nexport type UseAccountParameters<config extends Config = Config> =\n ConfigParameter<config>\n\nexport type UseAccountReturnType<config extends Config = Config> =\n GetAccountReturnType<config>\n\nconst DISCONNECTED_ACCOUNT: GetAccountReturnType = {\n account: undefined,\n accounts: undefined,\n chain: undefined,\n chainId: undefined,\n connector: undefined,\n isConnected: false,\n isConnecting: false,\n isDisconnected: true,\n isReconnecting: false,\n status: 'disconnected',\n}\n\nexport function useAccount<C extends Config = ResolvedRegister['config']>(\n parameters: UseAccountParameters<C> = {}\n): UseAccountReturnType<C> {\n const config = useConfig(parameters)\n\n return useSyncExternalStoreWithTracked(\n (onChange) => watchAccount(config, { onChange }),\n () => getAccount(config),\n () => DISCONNECTED_ACCOUNT as UseAccountReturnType<C>\n )\n}\n"],"mappings":";;;;;;AAmBA,MAAM,uBAA6C;CACjD,SAAS,KAAA;CACT,UAAU,KAAA;CACV,OAAO,KAAA;CACP,SAAS,KAAA;CACT,WAAW,KAAA;CACX,aAAa;CACb,cAAc;CACd,gBAAgB;CAChB,gBAAgB;CAChB,QAAQ;AACV;AAEA,SAAgB,WACd,aAAsC,CAAC,GACd;CACzB,MAAM,SAASA,wBAAAA,UAAU,UAAU;CAEnC,OAAOC,8CAAAA,iCACJ,cAAA,GAAA,cAAA,cAA0B,QAAQ,EAAE,SAAS,CAAC,UAAA,GAAA,cAAA,YAC9B,MAAM,SACjB,oBACR;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConfig.js","names":["BigmiContext","BigmiProviderNotFoundError"],"sources":["../../../src/hooks/useConfig.ts"],"sourcesContent":["'use client'\n\nimport type { Config } from '@bigmi/client'\nimport { useContext } from 'react'\nimport { BigmiContext } from '../context.js'\nimport { BigmiProviderNotFoundError } from '../errors/context.js'\nimport type { ResolvedRegister } from '../types.js'\n\nexport type ConfigParameter<config extends Config = Config> = {\n config?: Config | config | undefined\n}\n\nexport type UseConfigParameters<config extends Config = Config> =\n ConfigParameter<config>\n\nexport type UseConfigReturnType<config extends Config = Config> = config\n\nexport function useConfig<C extends Config = ResolvedRegister['config']>(\n parameters: UseConfigParameters<C> = {}\n): UseConfigReturnType<C> {\n // biome-ignore lint/correctness/useHookAtTopLevel: part of the hook\n const config = parameters.config ?? useContext(BigmiContext)\n if (!config) {\n throw new BigmiProviderNotFoundError()\n }\n return config as UseConfigReturnType<C>\n}\n"],"mappings":";;;;;;AAiBA,SAAgB,UACd,aAAqC,
|
|
1
|
+
{"version":3,"file":"useConfig.js","names":["BigmiContext","BigmiProviderNotFoundError"],"sources":["../../../src/hooks/useConfig.ts"],"sourcesContent":["'use client'\n\nimport type { Config } from '@bigmi/client'\nimport { useContext } from 'react'\nimport { BigmiContext } from '../context.js'\nimport { BigmiProviderNotFoundError } from '../errors/context.js'\nimport type { ResolvedRegister } from '../types.js'\n\nexport type ConfigParameter<config extends Config = Config> = {\n config?: Config | config | undefined\n}\n\nexport type UseConfigParameters<config extends Config = Config> =\n ConfigParameter<config>\n\nexport type UseConfigReturnType<config extends Config = Config> = config\n\nexport function useConfig<C extends Config = ResolvedRegister['config']>(\n parameters: UseConfigParameters<C> = {}\n): UseConfigReturnType<C> {\n // biome-ignore lint/correctness/useHookAtTopLevel: part of the hook\n const config = parameters.config ?? useContext(BigmiContext)\n if (!config) {\n throw new BigmiProviderNotFoundError()\n }\n return config as UseConfigReturnType<C>\n}\n"],"mappings":";;;;;;AAiBA,SAAgB,UACd,aAAqC,CAAC,GACd;CAExB,MAAM,SAAS,WAAW,WAAA,GAAA,MAAA,YAAqBA,gBAAAA,YAAY;CAC3D,IAAI,CAAC,QACH,MAAM,IAAIC,uBAAAA,2BAA2B;CAEvC,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnect.js","names":["useConfig","useConnectors"],"sources":["../../../src/hooks/useConnect.ts"],"sourcesContent":["'use client'\n\nimport {\n type Config,\n type ConnectData,\n type ConnectErrorType,\n type ConnectMutate,\n type ConnectMutateAsync,\n type ConnectVariables,\n connectMutationOptions,\n} from '@bigmi/client'\nimport type { Compute } from '@bigmi/core'\nimport { useMutation } from '@tanstack/react-query'\nimport { useEffect } from 'react'\nimport type { ResolvedRegister } from '../types.js'\nimport type {\n UseMutationParameters,\n UseMutationReturnType,\n} from '../utils/query.js'\nimport { type ConfigParameter, useConfig } from './useConfig.js'\nimport { type UseConnectorsReturnType, useConnectors } from './useConnectors.js'\n\nexport type UseConnectParameters<\n config extends Config = Config,\n context = unknown,\n> = Compute<\n ConfigParameter<config> & {\n mutation?:\n | UseMutationParameters<\n ConnectData<config>,\n ConnectErrorType,\n ConnectVariables<config, config['connectors'][number]>,\n context\n >\n | undefined\n }\n>\n\nexport type UseConnectReturnType<\n config extends Config = Config,\n context = unknown,\n> = Compute<\n UseMutationReturnType<\n ConnectData<config>,\n ConnectErrorType,\n ConnectVariables<config, config['connectors'][number]>,\n context\n > & {\n connect: ConnectMutate<config, context>\n connectAsync: ConnectMutateAsync<config, context>\n connectors: Compute<UseConnectorsReturnType> | config['connectors']\n }\n>\n\nexport function useConnect<\n config extends Config = ResolvedRegister['config'],\n context = unknown,\n>(\n parameters: UseConnectParameters<config, context> = {}\n): UseConnectReturnType<config, context> {\n const { mutation } = parameters\n\n const config = useConfig(parameters)\n\n const mutationOptions = connectMutationOptions(config)\n const { mutate, mutateAsync, reset, ...result } = useMutation({\n ...mutation,\n ...mutationOptions,\n })\n\n // Reset mutation back to an idle state when the connector disconnects.\n useEffect(() => {\n return config.subscribe(\n ({ status }) => status,\n (status, previousStatus) => {\n if (previousStatus === 'connected' && status === 'disconnected') {\n reset()\n }\n }\n )\n }, [config, reset])\n\n type Return = UseConnectReturnType<config, context>\n return {\n ...(result as Return),\n connect: mutate as Return['connect'],\n connectAsync: mutateAsync as Return['connectAsync'],\n connectors: useConnectors({ config }),\n }\n}\n"],"mappings":";;;;;;;;AAsDA,SAAgB,WAId,aAAoD,
|
|
1
|
+
{"version":3,"file":"useConnect.js","names":["useConfig","useConnectors"],"sources":["../../../src/hooks/useConnect.ts"],"sourcesContent":["'use client'\n\nimport {\n type Config,\n type ConnectData,\n type ConnectErrorType,\n type ConnectMutate,\n type ConnectMutateAsync,\n type ConnectVariables,\n connectMutationOptions,\n} from '@bigmi/client'\nimport type { Compute } from '@bigmi/core'\nimport { useMutation } from '@tanstack/react-query'\nimport { useEffect } from 'react'\nimport type { ResolvedRegister } from '../types.js'\nimport type {\n UseMutationParameters,\n UseMutationReturnType,\n} from '../utils/query.js'\nimport { type ConfigParameter, useConfig } from './useConfig.js'\nimport { type UseConnectorsReturnType, useConnectors } from './useConnectors.js'\n\nexport type UseConnectParameters<\n config extends Config = Config,\n context = unknown,\n> = Compute<\n ConfigParameter<config> & {\n mutation?:\n | UseMutationParameters<\n ConnectData<config>,\n ConnectErrorType,\n ConnectVariables<config, config['connectors'][number]>,\n context\n >\n | undefined\n }\n>\n\nexport type UseConnectReturnType<\n config extends Config = Config,\n context = unknown,\n> = Compute<\n UseMutationReturnType<\n ConnectData<config>,\n ConnectErrorType,\n ConnectVariables<config, config['connectors'][number]>,\n context\n > & {\n connect: ConnectMutate<config, context>\n connectAsync: ConnectMutateAsync<config, context>\n connectors: Compute<UseConnectorsReturnType> | config['connectors']\n }\n>\n\nexport function useConnect<\n config extends Config = ResolvedRegister['config'],\n context = unknown,\n>(\n parameters: UseConnectParameters<config, context> = {}\n): UseConnectReturnType<config, context> {\n const { mutation } = parameters\n\n const config = useConfig(parameters)\n\n const mutationOptions = connectMutationOptions(config)\n const { mutate, mutateAsync, reset, ...result } = useMutation({\n ...mutation,\n ...mutationOptions,\n })\n\n // Reset mutation back to an idle state when the connector disconnects.\n useEffect(() => {\n return config.subscribe(\n ({ status }) => status,\n (status, previousStatus) => {\n if (previousStatus === 'connected' && status === 'disconnected') {\n reset()\n }\n }\n )\n }, [config, reset])\n\n type Return = UseConnectReturnType<config, context>\n return {\n ...(result as Return),\n connect: mutate as Return['connect'],\n connectAsync: mutateAsync as Return['connectAsync'],\n connectors: useConnectors({ config }),\n }\n}\n"],"mappings":";;;;;;;;AAsDA,SAAgB,WAId,aAAoD,CAAC,GACd;CACvC,MAAM,EAAE,aAAa;CAErB,MAAM,SAASA,wBAAAA,UAAU,UAAU;CAEnC,MAAM,mBAAA,GAAA,cAAA,wBAAyC,MAAM;CACrD,MAAM,EAAE,QAAQ,aAAa,OAAO,GAAG,YAAA,GAAA,sBAAA,aAAuB;EAC5D,GAAG;EACH,GAAG;CACL,CAAC;CAGD,CAAA,GAAA,MAAA,iBAAgB;EACd,OAAO,OAAO,WACX,EAAE,aAAa,SACf,QAAQ,mBAAmB;GAC1B,IAAI,mBAAmB,eAAe,WAAW,gBAC/C,MAAM;EAEV,CACF;CACF,GAAG,CAAC,QAAQ,KAAK,CAAC;CAGlB,OAAO;EACL,GAAI;EACJ,SAAS;EACT,cAAc;EACd,YAAYC,4BAAAA,cAAc,EAAE,OAAO,CAAC;CACtC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnectors.js","names":["useConfig"],"sources":["../../../src/hooks/useConnectors.ts"],"sourcesContent":["'use client'\n\nimport {\n type Config,\n type GetConnectorsReturnType,\n getConnectors,\n watchConnectors,\n} from '@bigmi/client'\nimport { useSyncExternalStore } from 'react'\nimport type { ResolvedRegister } from '../types.js'\nimport { type ConfigParameter, useConfig } from './useConfig.js'\n\nexport type UseConnectorsParameters<config extends Config = Config> =\n ConfigParameter<config>\n\nexport type UseConnectorsReturnType<config extends Config = Config> =\n GetConnectorsReturnType<config>\n\nconst EMPTY_CONNECTORS: readonly [] = []\n\nexport function useConnectors<\n config extends Config = ResolvedRegister['config'],\n>(\n parameters: UseConnectorsParameters<config> = {}\n): UseConnectorsReturnType<config> {\n const config = useConfig(parameters)\n\n return useSyncExternalStore(\n (onChange) => watchConnectors(config, { onChange }),\n () => getConnectors(config),\n () => EMPTY_CONNECTORS as UseConnectorsReturnType<config>\n )\n}\n"],"mappings":";;;;;;AAkBA,MAAM,mBAAgC,
|
|
1
|
+
{"version":3,"file":"useConnectors.js","names":["useConfig"],"sources":["../../../src/hooks/useConnectors.ts"],"sourcesContent":["'use client'\n\nimport {\n type Config,\n type GetConnectorsReturnType,\n getConnectors,\n watchConnectors,\n} from '@bigmi/client'\nimport { useSyncExternalStore } from 'react'\nimport type { ResolvedRegister } from '../types.js'\nimport { type ConfigParameter, useConfig } from './useConfig.js'\n\nexport type UseConnectorsParameters<config extends Config = Config> =\n ConfigParameter<config>\n\nexport type UseConnectorsReturnType<config extends Config = Config> =\n GetConnectorsReturnType<config>\n\nconst EMPTY_CONNECTORS: readonly [] = []\n\nexport function useConnectors<\n config extends Config = ResolvedRegister['config'],\n>(\n parameters: UseConnectorsParameters<config> = {}\n): UseConnectorsReturnType<config> {\n const config = useConfig(parameters)\n\n return useSyncExternalStore(\n (onChange) => watchConnectors(config, { onChange }),\n () => getConnectors(config),\n () => EMPTY_CONNECTORS as UseConnectorsReturnType<config>\n )\n}\n"],"mappings":";;;;;;AAkBA,MAAM,mBAAgC,CAAC;AAEvC,SAAgB,cAGd,aAA8C,CAAC,GACd;CACjC,MAAM,SAASA,wBAAAA,UAAU,UAAU;CAEnC,QAAA,GAAA,MAAA,uBACG,cAAA,GAAA,cAAA,iBAA6B,QAAQ,EAAE,SAAS,CAAC,UAAA,GAAA,cAAA,eAC9B,MAAM,SACpB,gBACR;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReconnect.js","names":[],"sources":["../../../src/hooks/useReconnect.ts"],"sourcesContent":["'use client'\n\nimport { type Config, reconnect } from '@bigmi/client'\n\nimport { useEffect } from 'react'\n\nexport const useReconnect = (config: Config): void => {\n useEffect(() => {\n reconnect(config)\n }, [config])\n}\n"],"mappings":";;;;;AAMA,MAAa,gBAAgB,WAAyB;
|
|
1
|
+
{"version":3,"file":"useReconnect.js","names":[],"sources":["../../../src/hooks/useReconnect.ts"],"sourcesContent":["'use client'\n\nimport { type Config, reconnect } from '@bigmi/client'\n\nimport { useEffect } from 'react'\n\nexport const useReconnect = (config: Config): void => {\n useEffect(() => {\n reconnect(config)\n }, [config])\n}\n"],"mappings":";;;;;AAMA,MAAa,gBAAgB,WAAyB;CACpD,CAAA,GAAA,MAAA,iBAAgB;EACd,CAAA,GAAA,cAAA,WAAU,MAAM;CAClB,GAAG,CAAC,MAAM,CAAC;AACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSyncExternalStoreWithTracked.js","names":["deepEqual"],"sources":["../../../src/hooks/useSyncExternalStoreWithTracked.ts"],"sourcesContent":["'use client'\nimport { deepEqual } from '@bigmi/core'\nimport { useMemo, useRef, useSyncExternalStore } from 'react'\n\nconst isPlainObject = (obj: unknown): obj is Record<string, any> =>\n typeof obj === 'object' && !Array.isArray(obj)\n\nexport function useSyncExternalStoreWithTracked<\n Snapshot extends Selection,\n Selection = Snapshot,\n>(\n subscribe: (onStoreChange: () => void) => () => void,\n getSnapshot: () => Snapshot,\n getServerSnapshot: (() => Snapshot) | undefined = getSnapshot,\n isEqual: (a: Selection, b: Selection) => boolean = deepEqual\n): Selection {\n const trackedKeys = useRef<Set<string>>(new Set())\n const previousResult = useRef<Selection | undefined>(undefined)\n const snapshotCache = useRef(getSnapshot())\n\n const snapshot = useSyncExternalStore(\n (onChange) =>\n subscribe(() => {\n snapshotCache.current = getSnapshot()\n onChange()\n }),\n () => snapshotCache.current!,\n getServerSnapshot\n )\n\n const result = useMemo(() => {\n if (!isPlainObject(snapshot)) {\n return snapshot\n }\n\n const trackedResult = { ...snapshot }\n Object.defineProperties(\n trackedResult,\n Object.fromEntries(\n Object.entries(trackedResult).map(([key, value]) => [\n key,\n {\n configurable: false,\n enumerable: true,\n get: () => {\n trackedKeys.current.add(key)\n return value\n },\n },\n ])\n )\n )\n return trackedResult\n }, [snapshot])\n\n return useMemo(() => {\n if (!trackedKeys.current.size || !previousResult.current) {\n previousResult.current = result\n return result\n }\n\n const hasChanged = Array.from(trackedKeys.current).some(\n (key) =>\n !isEqual(\n (result as Record<string, Selection>)[key],\n (previousResult.current as Record<string, Selection>)[key]\n )\n )\n\n if (!hasChanged) {\n return previousResult.current\n }\n previousResult.current = result\n return result\n }, [result, isEqual])\n}\n"],"mappings":";;;;;AAIA,MAAM,iBAAiB,QACrB,OAAO,QAAQ,YAAY,CAAC,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"useSyncExternalStoreWithTracked.js","names":["deepEqual"],"sources":["../../../src/hooks/useSyncExternalStoreWithTracked.ts"],"sourcesContent":["'use client'\nimport { deepEqual } from '@bigmi/core'\nimport { useMemo, useRef, useSyncExternalStore } from 'react'\n\nconst isPlainObject = (obj: unknown): obj is Record<string, any> =>\n typeof obj === 'object' && !Array.isArray(obj)\n\nexport function useSyncExternalStoreWithTracked<\n Snapshot extends Selection,\n Selection = Snapshot,\n>(\n subscribe: (onStoreChange: () => void) => () => void,\n getSnapshot: () => Snapshot,\n getServerSnapshot: (() => Snapshot) | undefined = getSnapshot,\n isEqual: (a: Selection, b: Selection) => boolean = deepEqual\n): Selection {\n const trackedKeys = useRef<Set<string>>(new Set())\n const previousResult = useRef<Selection | undefined>(undefined)\n const snapshotCache = useRef(getSnapshot())\n\n const snapshot = useSyncExternalStore(\n (onChange) =>\n subscribe(() => {\n snapshotCache.current = getSnapshot()\n onChange()\n }),\n () => snapshotCache.current!,\n getServerSnapshot\n )\n\n const result = useMemo(() => {\n if (!isPlainObject(snapshot)) {\n return snapshot\n }\n\n const trackedResult = { ...snapshot }\n Object.defineProperties(\n trackedResult,\n Object.fromEntries(\n Object.entries(trackedResult).map(([key, value]) => [\n key,\n {\n configurable: false,\n enumerable: true,\n get: () => {\n trackedKeys.current.add(key)\n return value\n },\n },\n ])\n )\n )\n return trackedResult\n }, [snapshot])\n\n return useMemo(() => {\n if (!trackedKeys.current.size || !previousResult.current) {\n previousResult.current = result\n return result\n }\n\n const hasChanged = Array.from(trackedKeys.current).some(\n (key) =>\n !isEqual(\n (result as Record<string, Selection>)[key],\n (previousResult.current as Record<string, Selection>)[key]\n )\n )\n\n if (!hasChanged) {\n return previousResult.current\n }\n previousResult.current = result\n return result\n }, [result, isEqual])\n}\n"],"mappings":";;;;;AAIA,MAAM,iBAAiB,QACrB,OAAO,QAAQ,YAAY,CAAC,MAAM,QAAQ,GAAG;AAE/C,SAAgB,gCAId,WACA,aACA,oBAAkD,aAClD,UAAmDA,YAAAA,WACxC;CACX,MAAM,eAAA,GAAA,MAAA,wBAAkC,IAAI,IAAI,CAAC;CACjD,MAAM,kBAAA,GAAA,MAAA,QAA+C,KAAA,CAAS;CAC9D,MAAM,iBAAA,GAAA,MAAA,QAAuB,YAAY,CAAC;CAE1C,MAAM,YAAA,GAAA,MAAA,uBACH,aACC,gBAAgB;EACd,cAAc,UAAU,YAAY;EACpC,SAAS;CACX,CAAC,SACG,cAAc,SACpB,iBACF;CAEA,MAAM,UAAA,GAAA,MAAA,eAAuB;EAC3B,IAAI,CAAC,cAAc,QAAQ,GACzB,OAAO;EAGT,MAAM,gBAAgB,EAAE,GAAG,SAAS;EACpC,OAAO,iBACL,eACA,OAAO,YACL,OAAO,QAAQ,aAAa,EAAE,KAAK,CAAC,KAAK,WAAW,CAClD,KACA;GACE,cAAc;GACd,YAAY;GACZ,WAAW;IACT,YAAY,QAAQ,IAAI,GAAG;IAC3B,OAAO;GACT;EACF,CACF,CAAC,CACH,CACF;EACA,OAAO;CACT,GAAG,CAAC,QAAQ,CAAC;CAEb,QAAA,GAAA,MAAA,eAAqB;EACnB,IAAI,CAAC,YAAY,QAAQ,QAAQ,CAAC,eAAe,SAAS;GACxD,eAAe,UAAU;GACzB,OAAO;EACT;EAUA,IAAI,CARe,MAAM,KAAK,YAAY,OAAO,EAAE,MAChD,QACC,CAAC,QACE,OAAqC,MACrC,eAAe,QAAsC,IACxD,CAGU,GACZ,OAAO,eAAe;EAExB,eAAe,UAAU;EACzB,OAAO;CACT,GAAG,CAAC,QAAQ,OAAO,CAAC;AACtB"}
|
package/dist/cjs/hydrate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydrate.js","names":[],"sources":["../../src/hydrate.ts"],"sourcesContent":["'use client'\n\nimport { type Config, reconnect, type State } from '@bigmi/client'\n\nimport { type ReactElement, useEffect, useRef } from 'react'\n\nimport type { ResolvedRegister } from './types.js'\n\nexport type HydrateProps = {\n config: ResolvedRegister['config']\n initialState?: State | undefined\n reconnectOnMount?: boolean | undefined\n}\n\ntype HydrateParameters = {\n initialState?: State | undefined\n reconnectOnMount?: boolean | undefined\n}\n\nexport function hydrate(\n config: Config,\n parameters: HydrateParameters\n): { onMount(): Promise<void> } {\n const { initialState, reconnectOnMount } = parameters\n\n if (initialState && !config._internal.store.persist.hasHydrated()) {\n config.setState({\n ...initialState,\n chainId: config.chains.some((x) => x.id === initialState.chainId)\n ? initialState.chainId\n : config.chains[0].id,\n connections: reconnectOnMount ? initialState.connections : new Map(),\n status: reconnectOnMount ? 'reconnecting' : 'disconnected',\n })\n }\n\n return {\n async onMount(): Promise<void> {\n if (config._internal.ssr) {\n await config._internal.store.persist.rehydrate()\n }\n\n if (reconnectOnMount) {\n reconnect(config)\n } else if (config.storage) {\n // Reset connections that may have been hydrated from storage.\n config.setState((x) => ({\n ...x,\n connections: new Map(),\n }))\n }\n },\n }\n}\n\nexport function Hydrate(parameters: React.PropsWithChildren<HydrateProps>) {\n const { children, config, initialState, reconnectOnMount = true } = parameters\n\n const { onMount } = hydrate(config, {\n initialState,\n reconnectOnMount,\n })\n\n // Hydrate for non-SSR\n if (!config._internal.ssr) {\n onMount()\n }\n\n // Hydrate for SSR\n const active = useRef(true)\n // biome-ignore lint/correctness/useExhaustiveDependencies: `queryKey` not required\n useEffect(() => {\n if (!active.current) {\n return\n }\n if (!config._internal.ssr) {\n return\n }\n onMount()\n return () => {\n active.current = false\n }\n }, [])\n\n return children as ReactElement\n}\n"],"mappings":";;;;;AAmBA,SAAgB,QACd,QACA,YAC8B;CAC9B,MAAM,EAAE,cAAc,qBAAqB;
|
|
1
|
+
{"version":3,"file":"hydrate.js","names":[],"sources":["../../src/hydrate.ts"],"sourcesContent":["'use client'\n\nimport { type Config, reconnect, type State } from '@bigmi/client'\n\nimport { type ReactElement, useEffect, useRef } from 'react'\n\nimport type { ResolvedRegister } from './types.js'\n\nexport type HydrateProps = {\n config: ResolvedRegister['config']\n initialState?: State | undefined\n reconnectOnMount?: boolean | undefined\n}\n\ntype HydrateParameters = {\n initialState?: State | undefined\n reconnectOnMount?: boolean | undefined\n}\n\nexport function hydrate(\n config: Config,\n parameters: HydrateParameters\n): { onMount(): Promise<void> } {\n const { initialState, reconnectOnMount } = parameters\n\n if (initialState && !config._internal.store.persist.hasHydrated()) {\n config.setState({\n ...initialState,\n chainId: config.chains.some((x) => x.id === initialState.chainId)\n ? initialState.chainId\n : config.chains[0].id,\n connections: reconnectOnMount ? initialState.connections : new Map(),\n status: reconnectOnMount ? 'reconnecting' : 'disconnected',\n })\n }\n\n return {\n async onMount(): Promise<void> {\n if (config._internal.ssr) {\n await config._internal.store.persist.rehydrate()\n }\n\n if (reconnectOnMount) {\n reconnect(config)\n } else if (config.storage) {\n // Reset connections that may have been hydrated from storage.\n config.setState((x) => ({\n ...x,\n connections: new Map(),\n }))\n }\n },\n }\n}\n\nexport function Hydrate(parameters: React.PropsWithChildren<HydrateProps>) {\n const { children, config, initialState, reconnectOnMount = true } = parameters\n\n const { onMount } = hydrate(config, {\n initialState,\n reconnectOnMount,\n })\n\n // Hydrate for non-SSR\n if (!config._internal.ssr) {\n onMount()\n }\n\n // Hydrate for SSR\n const active = useRef(true)\n // biome-ignore lint/correctness/useExhaustiveDependencies: `queryKey` not required\n useEffect(() => {\n if (!active.current) {\n return\n }\n if (!config._internal.ssr) {\n return\n }\n onMount()\n return () => {\n active.current = false\n }\n }, [])\n\n return children as ReactElement\n}\n"],"mappings":";;;;;AAmBA,SAAgB,QACd,QACA,YAC8B;CAC9B,MAAM,EAAE,cAAc,qBAAqB;CAE3C,IAAI,gBAAgB,CAAC,OAAO,UAAU,MAAM,QAAQ,YAAY,GAC9D,OAAO,SAAS;EACd,GAAG;EACH,SAAS,OAAO,OAAO,MAAM,MAAM,EAAE,OAAO,aAAa,OAAO,IAC5D,aAAa,UACb,OAAO,OAAO,GAAG;EACrB,aAAa,mBAAmB,aAAa,8BAAc,IAAI,IAAI;EACnE,QAAQ,mBAAmB,iBAAiB;CAC9C,CAAC;CAGH,OAAO,EACL,MAAM,UAAyB;EAC7B,IAAI,OAAO,UAAU,KACnB,MAAM,OAAO,UAAU,MAAM,QAAQ,UAAU;EAGjD,IAAI,kBACF,CAAA,GAAA,cAAA,WAAU,MAAM;OACX,IAAI,OAAO,SAEhB,OAAO,UAAU,OAAO;GACtB,GAAG;GACH,6BAAa,IAAI,IAAI;EACvB,EAAE;CAEN,EACF;AACF;AAEA,SAAgB,QAAQ,YAAmD;CACzE,MAAM,EAAE,UAAU,QAAQ,cAAc,mBAAmB,SAAS;CAEpE,MAAM,EAAE,YAAY,QAAQ,QAAQ;EAClC;EACA;CACF,CAAC;CAGD,IAAI,CAAC,OAAO,UAAU,KACpB,QAAQ;CAIV,MAAM,UAAA,GAAA,MAAA,QAAgB,IAAI;CAE1B,CAAA,GAAA,MAAA,iBAAgB;EACd,IAAI,CAAC,OAAO,SACV;EAEF,IAAI,CAAC,OAAO,UAAU,KACpB;EAEF,QAAQ;EACR,aAAa;GACX,OAAO,UAAU;EACnB;CACF,GAAG,CAAC,CAAC;CAEL,OAAO;AACT"}
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
package/dist/cjs/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@bigmi/react'\nexport const version = '0.8.
|
|
1
|
+
{"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@bigmi/react'\nexport const version = '0.8.1'\n"],"mappings":";;AAAA,MAAa,OAAO;AACpB,MAAa,UAAU"}
|
package/dist/esm/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","names":[],"sources":["../../src/context.ts"],"sourcesContent":["'use client'\nimport type { State } from '@bigmi/client'\nimport {\n type Context,\n createContext,\n createElement,\n type PropsWithChildren,\n type ReactElement,\n} from 'react'\nimport { Hydrate } from './hydrate.js'\nimport type { ResolvedRegister } from './types.js'\n\nexport const BigmiContext: Context<ResolvedRegister['config'] | undefined> =\n createContext<ResolvedRegister['config'] | undefined>(undefined)\n\nexport type BigmiProviderProps = {\n config: ResolvedRegister['config']\n initialState?: State | undefined\n reconnectOnMount?: boolean | undefined\n}\n\nexport function BigmiProvider(\n parameters: PropsWithChildren<BigmiProviderProps>\n): ReactElement {\n const { children, config } = parameters\n\n const props = { value: config }\n return createElement(\n Hydrate,\n parameters,\n createElement(BigmiContext.Provider, props, children)\n )\n}\n"],"mappings":";;;;AAYA,MAAa,eACX,cAAsD,KAAA,
|
|
1
|
+
{"version":3,"file":"context.js","names":[],"sources":["../../src/context.ts"],"sourcesContent":["'use client'\nimport type { State } from '@bigmi/client'\nimport {\n type Context,\n createContext,\n createElement,\n type PropsWithChildren,\n type ReactElement,\n} from 'react'\nimport { Hydrate } from './hydrate.js'\nimport type { ResolvedRegister } from './types.js'\n\nexport const BigmiContext: Context<ResolvedRegister['config'] | undefined> =\n createContext<ResolvedRegister['config'] | undefined>(undefined)\n\nexport type BigmiProviderProps = {\n config: ResolvedRegister['config']\n initialState?: State | undefined\n reconnectOnMount?: boolean | undefined\n}\n\nexport function BigmiProvider(\n parameters: PropsWithChildren<BigmiProviderProps>\n): ReactElement {\n const { children, config } = parameters\n\n const props = { value: config }\n return createElement(\n Hydrate,\n parameters,\n createElement(BigmiContext.Provider, props, children)\n )\n}\n"],"mappings":";;;;AAYA,MAAa,eACX,cAAsD,KAAA,CAAS;AAQjE,SAAgB,cACd,YACc;CACd,MAAM,EAAE,UAAU,WAAW;CAE7B,MAAM,QAAQ,EAAE,OAAO,OAAO;CAC9B,OAAO,cACL,SACA,YACA,cAAc,aAAa,UAAU,OAAO,QAAQ,CACtD;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","names":[],"sources":["../../../src/errors/context.ts"],"mappings":";;;KAEY,8BAAA,GAAiC,0BAAA;EAC3C,IAAA;AAAA;AAAA,cAEW,0BAAA,SAAmC,SAAA;EAAA,SACrC,IAAA;EACT,WAAA
|
|
1
|
+
{"version":3,"file":"context.d.ts","names":[],"sources":["../../../src/errors/context.ts"],"mappings":";;;KAEY,8BAAA,GAAiC,0BAAA;EAC3C,IAAA;AAAA;AAAA,cAEW,0BAAA,SAAmC,SAAA;EAAA,SACrC,IAAA;EACT,WAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","names":[],"sources":["../../../src/errors/context.ts"],"sourcesContent":["import { BaseError } from '@bigmi/core'\n\nexport type BigmiProviderNotFoundErrorType = BigmiProviderNotFoundError & {\n name: 'BigmiProviderNotFoundError'\n}\nexport class BigmiProviderNotFoundError extends BaseError {\n override name = 'BigmiProviderNotFoundError'\n constructor() {\n super('`useConfig` must be used within `BigmiProvider`.')\n }\n}\n"],"mappings":";;AAKA,IAAa,6BAAb,cAAgD,UAAU;CAExD,cAAc;
|
|
1
|
+
{"version":3,"file":"context.js","names":[],"sources":["../../../src/errors/context.ts"],"sourcesContent":["import { BaseError } from '@bigmi/core'\n\nexport type BigmiProviderNotFoundErrorType = BigmiProviderNotFoundError & {\n name: 'BigmiProviderNotFoundError'\n}\nexport class BigmiProviderNotFoundError extends BaseError {\n override name = 'BigmiProviderNotFoundError'\n constructor() {\n super('`useConfig` must be used within `BigmiProvider`.')\n }\n}\n"],"mappings":";;AAKA,IAAa,6BAAb,cAAgD,UAAU;CAExD,cAAc;EACZ,MAAM,kDAAkD;cAF1C;CAGhB;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAccount.d.ts","names":[],"sources":["../../../src/hooks/useAccount.ts"],"mappings":";;;;;KAaY,oBAAA,gBAAoC,MAAA,GAAS,MAAA,IACvD,eAAA,CAAgB,MAAA;AAAA,KAEN,oBAAA,gBAAoC,MAAA,GAAS,MAAA,IACvD,oBAAA,CAAqB,MAAA;AAAA,iBAeP,UAAA,WAAqB,MAAA,GAAS,gBAAA,
|
|
1
|
+
{"version":3,"file":"useAccount.d.ts","names":[],"sources":["../../../src/hooks/useAccount.ts"],"mappings":";;;;;KAaY,oBAAA,gBAAoC,MAAA,GAAS,MAAA,IACvD,eAAA,CAAgB,MAAA;AAAA,KAEN,oBAAA,gBAAoC,MAAA,GAAS,MAAA,IACvD,oBAAA,CAAqB,MAAA;AAAA,iBAeP,UAAA,WAAqB,MAAA,GAAS,gBAAA,YAC5C,UAAA,GAAY,oBAAA,CAAqB,CAAA,IAChC,oBAAA,CAAqB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAccount.js","names":[],"sources":["../../../src/hooks/useAccount.ts"],"sourcesContent":["'use client'\n\nimport {\n type Config,\n type GetAccountReturnType,\n getAccount,\n watchAccount,\n} from '@bigmi/client'\n\nimport type { ResolvedRegister } from '../types.js'\nimport { type ConfigParameter, useConfig } from './useConfig.js'\nimport { useSyncExternalStoreWithTracked } from './useSyncExternalStoreWithTracked.js'\n\nexport type UseAccountParameters<config extends Config = Config> =\n ConfigParameter<config>\n\nexport type UseAccountReturnType<config extends Config = Config> =\n GetAccountReturnType<config>\n\nconst DISCONNECTED_ACCOUNT: GetAccountReturnType = {\n account: undefined,\n accounts: undefined,\n chain: undefined,\n chainId: undefined,\n connector: undefined,\n isConnected: false,\n isConnecting: false,\n isDisconnected: true,\n isReconnecting: false,\n status: 'disconnected',\n}\n\nexport function useAccount<C extends Config = ResolvedRegister['config']>(\n parameters: UseAccountParameters<C> = {}\n): UseAccountReturnType<C> {\n const config = useConfig(parameters)\n\n return useSyncExternalStoreWithTracked(\n (onChange) => watchAccount(config, { onChange }),\n () => getAccount(config),\n () => DISCONNECTED_ACCOUNT as UseAccountReturnType<C>\n )\n}\n"],"mappings":";;;;;AAmBA,MAAM,uBAA6C;CACjD,SAAS,KAAA;CACT,UAAU,KAAA;CACV,OAAO,KAAA;CACP,SAAS,KAAA;CACT,WAAW,KAAA;CACX,aAAa;CACb,cAAc;CACd,gBAAgB;CAChB,gBAAgB;CAChB,QAAQ;
|
|
1
|
+
{"version":3,"file":"useAccount.js","names":[],"sources":["../../../src/hooks/useAccount.ts"],"sourcesContent":["'use client'\n\nimport {\n type Config,\n type GetAccountReturnType,\n getAccount,\n watchAccount,\n} from '@bigmi/client'\n\nimport type { ResolvedRegister } from '../types.js'\nimport { type ConfigParameter, useConfig } from './useConfig.js'\nimport { useSyncExternalStoreWithTracked } from './useSyncExternalStoreWithTracked.js'\n\nexport type UseAccountParameters<config extends Config = Config> =\n ConfigParameter<config>\n\nexport type UseAccountReturnType<config extends Config = Config> =\n GetAccountReturnType<config>\n\nconst DISCONNECTED_ACCOUNT: GetAccountReturnType = {\n account: undefined,\n accounts: undefined,\n chain: undefined,\n chainId: undefined,\n connector: undefined,\n isConnected: false,\n isConnecting: false,\n isDisconnected: true,\n isReconnecting: false,\n status: 'disconnected',\n}\n\nexport function useAccount<C extends Config = ResolvedRegister['config']>(\n parameters: UseAccountParameters<C> = {}\n): UseAccountReturnType<C> {\n const config = useConfig(parameters)\n\n return useSyncExternalStoreWithTracked(\n (onChange) => watchAccount(config, { onChange }),\n () => getAccount(config),\n () => DISCONNECTED_ACCOUNT as UseAccountReturnType<C>\n )\n}\n"],"mappings":";;;;;AAmBA,MAAM,uBAA6C;CACjD,SAAS,KAAA;CACT,UAAU,KAAA;CACV,OAAO,KAAA;CACP,SAAS,KAAA;CACT,WAAW,KAAA;CACX,aAAa;CACb,cAAc;CACd,gBAAgB;CAChB,gBAAgB;CAChB,QAAQ;AACV;AAEA,SAAgB,WACd,aAAsC,CAAC,GACd;CACzB,MAAM,SAAS,UAAU,UAAU;CAEnC,OAAO,iCACJ,aAAa,aAAa,QAAQ,EAAE,SAAS,CAAC,SACzC,WAAW,MAAM,SACjB,oBACR;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConfig.d.ts","names":[],"sources":["../../../src/hooks/useConfig.ts"],"mappings":";;;;KAQY,eAAA,gBAA+B,MAAA,GAAS,MAAA;EAClD,MAAA,GAAS,MAAA,GAAS,MAAA;AAAA;AAAA,KAGR,mBAAA,gBAAmC,MAAA,GAAS,MAAA,IACtD,eAAA,CAAgB,MAAA;AAAA,KAEN,mBAAA,gBAAmC,MAAA,GAAS,MAAA,IAAU,MAAA;AAAA,iBAElD,SAAA,WAAoB,MAAA,GAAS,gBAAA,
|
|
1
|
+
{"version":3,"file":"useConfig.d.ts","names":[],"sources":["../../../src/hooks/useConfig.ts"],"mappings":";;;;KAQY,eAAA,gBAA+B,MAAA,GAAS,MAAA;EAClD,MAAA,GAAS,MAAA,GAAS,MAAA;AAAA;AAAA,KAGR,mBAAA,gBAAmC,MAAA,GAAS,MAAA,IACtD,eAAA,CAAgB,MAAA;AAAA,KAEN,mBAAA,gBAAmC,MAAA,GAAS,MAAA,IAAU,MAAA;AAAA,iBAElD,SAAA,WAAoB,MAAA,GAAS,gBAAA,YAC3C,UAAA,GAAY,mBAAA,CAAoB,CAAA,IAC/B,mBAAA,CAAoB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConfig.js","names":[],"sources":["../../../src/hooks/useConfig.ts"],"sourcesContent":["'use client'\n\nimport type { Config } from '@bigmi/client'\nimport { useContext } from 'react'\nimport { BigmiContext } from '../context.js'\nimport { BigmiProviderNotFoundError } from '../errors/context.js'\nimport type { ResolvedRegister } from '../types.js'\n\nexport type ConfigParameter<config extends Config = Config> = {\n config?: Config | config | undefined\n}\n\nexport type UseConfigParameters<config extends Config = Config> =\n ConfigParameter<config>\n\nexport type UseConfigReturnType<config extends Config = Config> = config\n\nexport function useConfig<C extends Config = ResolvedRegister['config']>(\n parameters: UseConfigParameters<C> = {}\n): UseConfigReturnType<C> {\n // biome-ignore lint/correctness/useHookAtTopLevel: part of the hook\n const config = parameters.config ?? useContext(BigmiContext)\n if (!config) {\n throw new BigmiProviderNotFoundError()\n }\n return config as UseConfigReturnType<C>\n}\n"],"mappings":";;;;;AAiBA,SAAgB,UACd,aAAqC,
|
|
1
|
+
{"version":3,"file":"useConfig.js","names":[],"sources":["../../../src/hooks/useConfig.ts"],"sourcesContent":["'use client'\n\nimport type { Config } from '@bigmi/client'\nimport { useContext } from 'react'\nimport { BigmiContext } from '../context.js'\nimport { BigmiProviderNotFoundError } from '../errors/context.js'\nimport type { ResolvedRegister } from '../types.js'\n\nexport type ConfigParameter<config extends Config = Config> = {\n config?: Config | config | undefined\n}\n\nexport type UseConfigParameters<config extends Config = Config> =\n ConfigParameter<config>\n\nexport type UseConfigReturnType<config extends Config = Config> = config\n\nexport function useConfig<C extends Config = ResolvedRegister['config']>(\n parameters: UseConfigParameters<C> = {}\n): UseConfigReturnType<C> {\n // biome-ignore lint/correctness/useHookAtTopLevel: part of the hook\n const config = parameters.config ?? useContext(BigmiContext)\n if (!config) {\n throw new BigmiProviderNotFoundError()\n }\n return config as UseConfigReturnType<C>\n}\n"],"mappings":";;;;;AAiBA,SAAgB,UACd,aAAqC,CAAC,GACd;CAExB,MAAM,SAAS,WAAW,UAAU,WAAW,YAAY;CAC3D,IAAI,CAAC,QACH,MAAM,IAAI,2BAA2B;CAEvC,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnect.d.ts","names":[],"sources":["../../../src/hooks/useConnect.ts"],"mappings":";;;;;;;;KAsBY,oBAAA,gBACK,MAAA,GAAS,MAAA,uBAEtB,OAAA,CACF,eAAA,CAAgB,MAAA;EACd,QAAA,GACI,qBAAA,CACE,WAAA,CAAY,MAAA,GACZ,gBAAA,EACA,gBAAA,CAAiB,MAAA,EAAQ,MAAA,yBACzB,OAAA;AAAA;AAAA,KAME,oBAAA,gBACK,MAAA,GAAS,MAAA,uBAEtB,OAAA,CACF,qBAAA,CACE,WAAA,CAAY,MAAA,GACZ,gBAAA,EACA,gBAAA,CAAiB,MAAA,EAAQ,MAAA,yBACzB,OAAA;EAEA,OAAA,EAAS,aAAA,CAAc,MAAA,EAAQ,OAAA;EAC/B,YAAA,EAAc,kBAAA,CAAmB,MAAA,EAAQ,OAAA;EACzC,UAAA,EAAY,OAAA,CAAQ,uBAAA,IAA2B,MAAA;AAAA;AAAA,iBAInC,UAAA,gBACC,MAAA,GAAS,gBAAA,
|
|
1
|
+
{"version":3,"file":"useConnect.d.ts","names":[],"sources":["../../../src/hooks/useConnect.ts"],"mappings":";;;;;;;;KAsBY,oBAAA,gBACK,MAAA,GAAS,MAAA,uBAEtB,OAAA,CACF,eAAA,CAAgB,MAAA;EACd,QAAA,GACI,qBAAA,CACE,WAAA,CAAY,MAAA,GACZ,gBAAA,EACA,gBAAA,CAAiB,MAAA,EAAQ,MAAA,yBACzB,OAAA;AAAA;AAAA,KAME,oBAAA,gBACK,MAAA,GAAS,MAAA,uBAEtB,OAAA,CACF,qBAAA,CACE,WAAA,CAAY,MAAA,GACZ,gBAAA,EACA,gBAAA,CAAiB,MAAA,EAAQ,MAAA,yBACzB,OAAA;EAEA,OAAA,EAAS,aAAA,CAAc,MAAA,EAAQ,OAAA;EAC/B,YAAA,EAAc,kBAAA,CAAmB,MAAA,EAAQ,OAAA;EACzC,UAAA,EAAY,OAAA,CAAQ,uBAAA,IAA2B,MAAA;AAAA;AAAA,iBAInC,UAAA,gBACC,MAAA,GAAS,gBAAA,+BAGxB,UAAA,GAAY,oBAAA,CAAqB,MAAA,EAAQ,OAAA,IACxC,oBAAA,CAAqB,MAAA,EAAQ,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnect.js","names":[],"sources":["../../../src/hooks/useConnect.ts"],"sourcesContent":["'use client'\n\nimport {\n type Config,\n type ConnectData,\n type ConnectErrorType,\n type ConnectMutate,\n type ConnectMutateAsync,\n type ConnectVariables,\n connectMutationOptions,\n} from '@bigmi/client'\nimport type { Compute } from '@bigmi/core'\nimport { useMutation } from '@tanstack/react-query'\nimport { useEffect } from 'react'\nimport type { ResolvedRegister } from '../types.js'\nimport type {\n UseMutationParameters,\n UseMutationReturnType,\n} from '../utils/query.js'\nimport { type ConfigParameter, useConfig } from './useConfig.js'\nimport { type UseConnectorsReturnType, useConnectors } from './useConnectors.js'\n\nexport type UseConnectParameters<\n config extends Config = Config,\n context = unknown,\n> = Compute<\n ConfigParameter<config> & {\n mutation?:\n | UseMutationParameters<\n ConnectData<config>,\n ConnectErrorType,\n ConnectVariables<config, config['connectors'][number]>,\n context\n >\n | undefined\n }\n>\n\nexport type UseConnectReturnType<\n config extends Config = Config,\n context = unknown,\n> = Compute<\n UseMutationReturnType<\n ConnectData<config>,\n ConnectErrorType,\n ConnectVariables<config, config['connectors'][number]>,\n context\n > & {\n connect: ConnectMutate<config, context>\n connectAsync: ConnectMutateAsync<config, context>\n connectors: Compute<UseConnectorsReturnType> | config['connectors']\n }\n>\n\nexport function useConnect<\n config extends Config = ResolvedRegister['config'],\n context = unknown,\n>(\n parameters: UseConnectParameters<config, context> = {}\n): UseConnectReturnType<config, context> {\n const { mutation } = parameters\n\n const config = useConfig(parameters)\n\n const mutationOptions = connectMutationOptions(config)\n const { mutate, mutateAsync, reset, ...result } = useMutation({\n ...mutation,\n ...mutationOptions,\n })\n\n // Reset mutation back to an idle state when the connector disconnects.\n useEffect(() => {\n return config.subscribe(\n ({ status }) => status,\n (status, previousStatus) => {\n if (previousStatus === 'connected' && status === 'disconnected') {\n reset()\n }\n }\n )\n }, [config, reset])\n\n type Return = UseConnectReturnType<config, context>\n return {\n ...(result as Return),\n connect: mutate as Return['connect'],\n connectAsync: mutateAsync as Return['connectAsync'],\n connectors: useConnectors({ config }),\n }\n}\n"],"mappings":";;;;;;;AAsDA,SAAgB,WAId,aAAoD,
|
|
1
|
+
{"version":3,"file":"useConnect.js","names":[],"sources":["../../../src/hooks/useConnect.ts"],"sourcesContent":["'use client'\n\nimport {\n type Config,\n type ConnectData,\n type ConnectErrorType,\n type ConnectMutate,\n type ConnectMutateAsync,\n type ConnectVariables,\n connectMutationOptions,\n} from '@bigmi/client'\nimport type { Compute } from '@bigmi/core'\nimport { useMutation } from '@tanstack/react-query'\nimport { useEffect } from 'react'\nimport type { ResolvedRegister } from '../types.js'\nimport type {\n UseMutationParameters,\n UseMutationReturnType,\n} from '../utils/query.js'\nimport { type ConfigParameter, useConfig } from './useConfig.js'\nimport { type UseConnectorsReturnType, useConnectors } from './useConnectors.js'\n\nexport type UseConnectParameters<\n config extends Config = Config,\n context = unknown,\n> = Compute<\n ConfigParameter<config> & {\n mutation?:\n | UseMutationParameters<\n ConnectData<config>,\n ConnectErrorType,\n ConnectVariables<config, config['connectors'][number]>,\n context\n >\n | undefined\n }\n>\n\nexport type UseConnectReturnType<\n config extends Config = Config,\n context = unknown,\n> = Compute<\n UseMutationReturnType<\n ConnectData<config>,\n ConnectErrorType,\n ConnectVariables<config, config['connectors'][number]>,\n context\n > & {\n connect: ConnectMutate<config, context>\n connectAsync: ConnectMutateAsync<config, context>\n connectors: Compute<UseConnectorsReturnType> | config['connectors']\n }\n>\n\nexport function useConnect<\n config extends Config = ResolvedRegister['config'],\n context = unknown,\n>(\n parameters: UseConnectParameters<config, context> = {}\n): UseConnectReturnType<config, context> {\n const { mutation } = parameters\n\n const config = useConfig(parameters)\n\n const mutationOptions = connectMutationOptions(config)\n const { mutate, mutateAsync, reset, ...result } = useMutation({\n ...mutation,\n ...mutationOptions,\n })\n\n // Reset mutation back to an idle state when the connector disconnects.\n useEffect(() => {\n return config.subscribe(\n ({ status }) => status,\n (status, previousStatus) => {\n if (previousStatus === 'connected' && status === 'disconnected') {\n reset()\n }\n }\n )\n }, [config, reset])\n\n type Return = UseConnectReturnType<config, context>\n return {\n ...(result as Return),\n connect: mutate as Return['connect'],\n connectAsync: mutateAsync as Return['connectAsync'],\n connectors: useConnectors({ config }),\n }\n}\n"],"mappings":";;;;;;;AAsDA,SAAgB,WAId,aAAoD,CAAC,GACd;CACvC,MAAM,EAAE,aAAa;CAErB,MAAM,SAAS,UAAU,UAAU;CAEnC,MAAM,kBAAkB,uBAAuB,MAAM;CACrD,MAAM,EAAE,QAAQ,aAAa,OAAO,GAAG,WAAW,YAAY;EAC5D,GAAG;EACH,GAAG;CACL,CAAC;CAGD,gBAAgB;EACd,OAAO,OAAO,WACX,EAAE,aAAa,SACf,QAAQ,mBAAmB;GAC1B,IAAI,mBAAmB,eAAe,WAAW,gBAC/C,MAAM;EAEV,CACF;CACF,GAAG,CAAC,QAAQ,KAAK,CAAC;CAGlB,OAAO;EACL,GAAI;EACJ,SAAS;EACT,cAAc;EACd,YAAY,cAAc,EAAE,OAAO,CAAC;CACtC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnectors.d.ts","names":[],"sources":["../../../src/hooks/useConnectors.ts"],"mappings":";;;;;KAYY,uBAAA,gBAAuC,MAAA,GAAS,MAAA,IAC1D,eAAA,CAAgB,MAAA;AAAA,KAEN,uBAAA,gBAAuC,MAAA,GAAS,MAAA,IAC1D,uBAAA,CAAwB,MAAA;AAAA,iBAIV,aAAA,gBACC,MAAA,GAAS,gBAAA,
|
|
1
|
+
{"version":3,"file":"useConnectors.d.ts","names":[],"sources":["../../../src/hooks/useConnectors.ts"],"mappings":";;;;;KAYY,uBAAA,gBAAuC,MAAA,GAAS,MAAA,IAC1D,eAAA,CAAgB,MAAA;AAAA,KAEN,uBAAA,gBAAuC,MAAA,GAAS,MAAA,IAC1D,uBAAA,CAAwB,MAAA;AAAA,iBAIV,aAAA,gBACC,MAAA,GAAS,gBAAA,YAExB,UAAA,GAAY,uBAAA,CAAwB,MAAA,IACnC,uBAAA,CAAwB,MAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnectors.js","names":[],"sources":["../../../src/hooks/useConnectors.ts"],"sourcesContent":["'use client'\n\nimport {\n type Config,\n type GetConnectorsReturnType,\n getConnectors,\n watchConnectors,\n} from '@bigmi/client'\nimport { useSyncExternalStore } from 'react'\nimport type { ResolvedRegister } from '../types.js'\nimport { type ConfigParameter, useConfig } from './useConfig.js'\n\nexport type UseConnectorsParameters<config extends Config = Config> =\n ConfigParameter<config>\n\nexport type UseConnectorsReturnType<config extends Config = Config> =\n GetConnectorsReturnType<config>\n\nconst EMPTY_CONNECTORS: readonly [] = []\n\nexport function useConnectors<\n config extends Config = ResolvedRegister['config'],\n>(\n parameters: UseConnectorsParameters<config> = {}\n): UseConnectorsReturnType<config> {\n const config = useConfig(parameters)\n\n return useSyncExternalStore(\n (onChange) => watchConnectors(config, { onChange }),\n () => getConnectors(config),\n () => EMPTY_CONNECTORS as UseConnectorsReturnType<config>\n )\n}\n"],"mappings":";;;;;AAkBA,MAAM,mBAAgC,
|
|
1
|
+
{"version":3,"file":"useConnectors.js","names":[],"sources":["../../../src/hooks/useConnectors.ts"],"sourcesContent":["'use client'\n\nimport {\n type Config,\n type GetConnectorsReturnType,\n getConnectors,\n watchConnectors,\n} from '@bigmi/client'\nimport { useSyncExternalStore } from 'react'\nimport type { ResolvedRegister } from '../types.js'\nimport { type ConfigParameter, useConfig } from './useConfig.js'\n\nexport type UseConnectorsParameters<config extends Config = Config> =\n ConfigParameter<config>\n\nexport type UseConnectorsReturnType<config extends Config = Config> =\n GetConnectorsReturnType<config>\n\nconst EMPTY_CONNECTORS: readonly [] = []\n\nexport function useConnectors<\n config extends Config = ResolvedRegister['config'],\n>(\n parameters: UseConnectorsParameters<config> = {}\n): UseConnectorsReturnType<config> {\n const config = useConfig(parameters)\n\n return useSyncExternalStore(\n (onChange) => watchConnectors(config, { onChange }),\n () => getConnectors(config),\n () => EMPTY_CONNECTORS as UseConnectorsReturnType<config>\n )\n}\n"],"mappings":";;;;;AAkBA,MAAM,mBAAgC,CAAC;AAEvC,SAAgB,cAGd,aAA8C,CAAC,GACd;CACjC,MAAM,SAAS,UAAU,UAAU;CAEnC,OAAO,sBACJ,aAAa,gBAAgB,QAAQ,EAAE,SAAS,CAAC,SAC5C,cAAc,MAAM,SACpB,gBACR;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReconnect.d.ts","names":[],"sources":["../../../src/hooks/useReconnect.ts"],"mappings":";;;cAMa,YAAA,GAAgB,
|
|
1
|
+
{"version":3,"file":"useReconnect.d.ts","names":[],"sources":["../../../src/hooks/useReconnect.ts"],"mappings":";;;cAMa,YAAA,GAAgB,MAAQ,EAAA,MAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReconnect.js","names":[],"sources":["../../../src/hooks/useReconnect.ts"],"sourcesContent":["'use client'\n\nimport { type Config, reconnect } from '@bigmi/client'\n\nimport { useEffect } from 'react'\n\nexport const useReconnect = (config: Config): void => {\n useEffect(() => {\n reconnect(config)\n }, [config])\n}\n"],"mappings":";;;;AAMA,MAAa,gBAAgB,WAAyB;
|
|
1
|
+
{"version":3,"file":"useReconnect.js","names":[],"sources":["../../../src/hooks/useReconnect.ts"],"sourcesContent":["'use client'\n\nimport { type Config, reconnect } from '@bigmi/client'\n\nimport { useEffect } from 'react'\n\nexport const useReconnect = (config: Config): void => {\n useEffect(() => {\n reconnect(config)\n }, [config])\n}\n"],"mappings":";;;;AAMA,MAAa,gBAAgB,WAAyB;CACpD,gBAAgB;EACd,UAAU,MAAM;CAClB,GAAG,CAAC,MAAM,CAAC;AACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSyncExternalStoreWithTracked.d.ts","names":[],"sources":["../../../src/hooks/useSyncExternalStoreWithTracked.ts"],"mappings":";iBAOgB,+BAAA,kBACG,SAAA,cACL,QAAA,
|
|
1
|
+
{"version":3,"file":"useSyncExternalStoreWithTracked.d.ts","names":[],"sources":["../../../src/hooks/useSyncExternalStoreWithTracked.ts"],"mappings":";iBAOgB,+BAAA,kBACG,SAAA,cACL,QAAA,EAEZ,SAAA,GAAY,aAAA,6BACZ,WAAA,QAAmB,QAAA,EACnB,iBAAA,UAA0B,QAAA,eAC1B,OAAA,IAAU,CAAA,EAAG,SAAA,EAAW,CAAA,EAAG,SAAA,eAC1B,SAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSyncExternalStoreWithTracked.js","names":[],"sources":["../../../src/hooks/useSyncExternalStoreWithTracked.ts"],"sourcesContent":["'use client'\nimport { deepEqual } from '@bigmi/core'\nimport { useMemo, useRef, useSyncExternalStore } from 'react'\n\nconst isPlainObject = (obj: unknown): obj is Record<string, any> =>\n typeof obj === 'object' && !Array.isArray(obj)\n\nexport function useSyncExternalStoreWithTracked<\n Snapshot extends Selection,\n Selection = Snapshot,\n>(\n subscribe: (onStoreChange: () => void) => () => void,\n getSnapshot: () => Snapshot,\n getServerSnapshot: (() => Snapshot) | undefined = getSnapshot,\n isEqual: (a: Selection, b: Selection) => boolean = deepEqual\n): Selection {\n const trackedKeys = useRef<Set<string>>(new Set())\n const previousResult = useRef<Selection | undefined>(undefined)\n const snapshotCache = useRef(getSnapshot())\n\n const snapshot = useSyncExternalStore(\n (onChange) =>\n subscribe(() => {\n snapshotCache.current = getSnapshot()\n onChange()\n }),\n () => snapshotCache.current!,\n getServerSnapshot\n )\n\n const result = useMemo(() => {\n if (!isPlainObject(snapshot)) {\n return snapshot\n }\n\n const trackedResult = { ...snapshot }\n Object.defineProperties(\n trackedResult,\n Object.fromEntries(\n Object.entries(trackedResult).map(([key, value]) => [\n key,\n {\n configurable: false,\n enumerable: true,\n get: () => {\n trackedKeys.current.add(key)\n return value\n },\n },\n ])\n )\n )\n return trackedResult\n }, [snapshot])\n\n return useMemo(() => {\n if (!trackedKeys.current.size || !previousResult.current) {\n previousResult.current = result\n return result\n }\n\n const hasChanged = Array.from(trackedKeys.current).some(\n (key) =>\n !isEqual(\n (result as Record<string, Selection>)[key],\n (previousResult.current as Record<string, Selection>)[key]\n )\n )\n\n if (!hasChanged) {\n return previousResult.current\n }\n previousResult.current = result\n return result\n }, [result, isEqual])\n}\n"],"mappings":";;;;AAIA,MAAM,iBAAiB,QACrB,OAAO,QAAQ,YAAY,CAAC,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"useSyncExternalStoreWithTracked.js","names":[],"sources":["../../../src/hooks/useSyncExternalStoreWithTracked.ts"],"sourcesContent":["'use client'\nimport { deepEqual } from '@bigmi/core'\nimport { useMemo, useRef, useSyncExternalStore } from 'react'\n\nconst isPlainObject = (obj: unknown): obj is Record<string, any> =>\n typeof obj === 'object' && !Array.isArray(obj)\n\nexport function useSyncExternalStoreWithTracked<\n Snapshot extends Selection,\n Selection = Snapshot,\n>(\n subscribe: (onStoreChange: () => void) => () => void,\n getSnapshot: () => Snapshot,\n getServerSnapshot: (() => Snapshot) | undefined = getSnapshot,\n isEqual: (a: Selection, b: Selection) => boolean = deepEqual\n): Selection {\n const trackedKeys = useRef<Set<string>>(new Set())\n const previousResult = useRef<Selection | undefined>(undefined)\n const snapshotCache = useRef(getSnapshot())\n\n const snapshot = useSyncExternalStore(\n (onChange) =>\n subscribe(() => {\n snapshotCache.current = getSnapshot()\n onChange()\n }),\n () => snapshotCache.current!,\n getServerSnapshot\n )\n\n const result = useMemo(() => {\n if (!isPlainObject(snapshot)) {\n return snapshot\n }\n\n const trackedResult = { ...snapshot }\n Object.defineProperties(\n trackedResult,\n Object.fromEntries(\n Object.entries(trackedResult).map(([key, value]) => [\n key,\n {\n configurable: false,\n enumerable: true,\n get: () => {\n trackedKeys.current.add(key)\n return value\n },\n },\n ])\n )\n )\n return trackedResult\n }, [snapshot])\n\n return useMemo(() => {\n if (!trackedKeys.current.size || !previousResult.current) {\n previousResult.current = result\n return result\n }\n\n const hasChanged = Array.from(trackedKeys.current).some(\n (key) =>\n !isEqual(\n (result as Record<string, Selection>)[key],\n (previousResult.current as Record<string, Selection>)[key]\n )\n )\n\n if (!hasChanged) {\n return previousResult.current\n }\n previousResult.current = result\n return result\n }, [result, isEqual])\n}\n"],"mappings":";;;;AAIA,MAAM,iBAAiB,QACrB,OAAO,QAAQ,YAAY,CAAC,MAAM,QAAQ,GAAG;AAE/C,SAAgB,gCAId,WACA,aACA,oBAAkD,aAClD,UAAmD,WACxC;CACX,MAAM,cAAc,uBAAoB,IAAI,IAAI,CAAC;CACjD,MAAM,iBAAiB,OAA8B,KAAA,CAAS;CAC9D,MAAM,gBAAgB,OAAO,YAAY,CAAC;CAE1C,MAAM,WAAW,sBACd,aACC,gBAAgB;EACd,cAAc,UAAU,YAAY;EACpC,SAAS;CACX,CAAC,SACG,cAAc,SACpB,iBACF;CAEA,MAAM,SAAS,cAAc;EAC3B,IAAI,CAAC,cAAc,QAAQ,GACzB,OAAO;EAGT,MAAM,gBAAgB,EAAE,GAAG,SAAS;EACpC,OAAO,iBACL,eACA,OAAO,YACL,OAAO,QAAQ,aAAa,EAAE,KAAK,CAAC,KAAK,WAAW,CAClD,KACA;GACE,cAAc;GACd,YAAY;GACZ,WAAW;IACT,YAAY,QAAQ,IAAI,GAAG;IAC3B,OAAO;GACT;EACF,CACF,CAAC,CACH,CACF;EACA,OAAO;CACT,GAAG,CAAC,QAAQ,CAAC;CAEb,OAAO,cAAc;EACnB,IAAI,CAAC,YAAY,QAAQ,QAAQ,CAAC,eAAe,SAAS;GACxD,eAAe,UAAU;GACzB,OAAO;EACT;EAUA,IAAI,CARe,MAAM,KAAK,YAAY,OAAO,EAAE,MAChD,QACC,CAAC,QACE,OAAqC,MACrC,eAAe,QAAsC,IACxD,CAGU,GACZ,OAAO,eAAe;EAExB,eAAe,UAAU;EACzB,OAAO;CACT,GAAG,CAAC,QAAQ,OAAO,CAAC;AACtB"}
|
package/dist/esm/hydrate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydrate.js","names":[],"sources":["../../src/hydrate.ts"],"sourcesContent":["'use client'\n\nimport { type Config, reconnect, type State } from '@bigmi/client'\n\nimport { type ReactElement, useEffect, useRef } from 'react'\n\nimport type { ResolvedRegister } from './types.js'\n\nexport type HydrateProps = {\n config: ResolvedRegister['config']\n initialState?: State | undefined\n reconnectOnMount?: boolean | undefined\n}\n\ntype HydrateParameters = {\n initialState?: State | undefined\n reconnectOnMount?: boolean | undefined\n}\n\nexport function hydrate(\n config: Config,\n parameters: HydrateParameters\n): { onMount(): Promise<void> } {\n const { initialState, reconnectOnMount } = parameters\n\n if (initialState && !config._internal.store.persist.hasHydrated()) {\n config.setState({\n ...initialState,\n chainId: config.chains.some((x) => x.id === initialState.chainId)\n ? initialState.chainId\n : config.chains[0].id,\n connections: reconnectOnMount ? initialState.connections : new Map(),\n status: reconnectOnMount ? 'reconnecting' : 'disconnected',\n })\n }\n\n return {\n async onMount(): Promise<void> {\n if (config._internal.ssr) {\n await config._internal.store.persist.rehydrate()\n }\n\n if (reconnectOnMount) {\n reconnect(config)\n } else if (config.storage) {\n // Reset connections that may have been hydrated from storage.\n config.setState((x) => ({\n ...x,\n connections: new Map(),\n }))\n }\n },\n }\n}\n\nexport function Hydrate(parameters: React.PropsWithChildren<HydrateProps>) {\n const { children, config, initialState, reconnectOnMount = true } = parameters\n\n const { onMount } = hydrate(config, {\n initialState,\n reconnectOnMount,\n })\n\n // Hydrate for non-SSR\n if (!config._internal.ssr) {\n onMount()\n }\n\n // Hydrate for SSR\n const active = useRef(true)\n // biome-ignore lint/correctness/useExhaustiveDependencies: `queryKey` not required\n useEffect(() => {\n if (!active.current) {\n return\n }\n if (!config._internal.ssr) {\n return\n }\n onMount()\n return () => {\n active.current = false\n }\n }, [])\n\n return children as ReactElement\n}\n"],"mappings":";;;;AAmBA,SAAgB,QACd,QACA,YAC8B;CAC9B,MAAM,EAAE,cAAc,qBAAqB;
|
|
1
|
+
{"version":3,"file":"hydrate.js","names":[],"sources":["../../src/hydrate.ts"],"sourcesContent":["'use client'\n\nimport { type Config, reconnect, type State } from '@bigmi/client'\n\nimport { type ReactElement, useEffect, useRef } from 'react'\n\nimport type { ResolvedRegister } from './types.js'\n\nexport type HydrateProps = {\n config: ResolvedRegister['config']\n initialState?: State | undefined\n reconnectOnMount?: boolean | undefined\n}\n\ntype HydrateParameters = {\n initialState?: State | undefined\n reconnectOnMount?: boolean | undefined\n}\n\nexport function hydrate(\n config: Config,\n parameters: HydrateParameters\n): { onMount(): Promise<void> } {\n const { initialState, reconnectOnMount } = parameters\n\n if (initialState && !config._internal.store.persist.hasHydrated()) {\n config.setState({\n ...initialState,\n chainId: config.chains.some((x) => x.id === initialState.chainId)\n ? initialState.chainId\n : config.chains[0].id,\n connections: reconnectOnMount ? initialState.connections : new Map(),\n status: reconnectOnMount ? 'reconnecting' : 'disconnected',\n })\n }\n\n return {\n async onMount(): Promise<void> {\n if (config._internal.ssr) {\n await config._internal.store.persist.rehydrate()\n }\n\n if (reconnectOnMount) {\n reconnect(config)\n } else if (config.storage) {\n // Reset connections that may have been hydrated from storage.\n config.setState((x) => ({\n ...x,\n connections: new Map(),\n }))\n }\n },\n }\n}\n\nexport function Hydrate(parameters: React.PropsWithChildren<HydrateProps>) {\n const { children, config, initialState, reconnectOnMount = true } = parameters\n\n const { onMount } = hydrate(config, {\n initialState,\n reconnectOnMount,\n })\n\n // Hydrate for non-SSR\n if (!config._internal.ssr) {\n onMount()\n }\n\n // Hydrate for SSR\n const active = useRef(true)\n // biome-ignore lint/correctness/useExhaustiveDependencies: `queryKey` not required\n useEffect(() => {\n if (!active.current) {\n return\n }\n if (!config._internal.ssr) {\n return\n }\n onMount()\n return () => {\n active.current = false\n }\n }, [])\n\n return children as ReactElement\n}\n"],"mappings":";;;;AAmBA,SAAgB,QACd,QACA,YAC8B;CAC9B,MAAM,EAAE,cAAc,qBAAqB;CAE3C,IAAI,gBAAgB,CAAC,OAAO,UAAU,MAAM,QAAQ,YAAY,GAC9D,OAAO,SAAS;EACd,GAAG;EACH,SAAS,OAAO,OAAO,MAAM,MAAM,EAAE,OAAO,aAAa,OAAO,IAC5D,aAAa,UACb,OAAO,OAAO,GAAG;EACrB,aAAa,mBAAmB,aAAa,8BAAc,IAAI,IAAI;EACnE,QAAQ,mBAAmB,iBAAiB;CAC9C,CAAC;CAGH,OAAO,EACL,MAAM,UAAyB;EAC7B,IAAI,OAAO,UAAU,KACnB,MAAM,OAAO,UAAU,MAAM,QAAQ,UAAU;EAGjD,IAAI,kBACF,UAAU,MAAM;OACX,IAAI,OAAO,SAEhB,OAAO,UAAU,OAAO;GACtB,GAAG;GACH,6BAAa,IAAI,IAAI;EACvB,EAAE;CAEN,EACF;AACF;AAEA,SAAgB,QAAQ,YAAmD;CACzE,MAAM,EAAE,UAAU,QAAQ,cAAc,mBAAmB,SAAS;CAEpE,MAAM,EAAE,YAAY,QAAQ,QAAQ;EAClC;EACA;CACF,CAAC;CAGD,IAAI,CAAC,OAAO,UAAU,KACpB,QAAQ;CAIV,MAAM,SAAS,OAAO,IAAI;CAE1B,gBAAgB;EACd,IAAI,CAAC,OAAO,SACV;EAEF,IAAI,CAAC,OAAO,UAAU,KACpB;EAEF,QAAQ;EACR,aAAa;GACX,OAAO,UAAU;EACnB;CACF,GAAG,CAAC,CAAC;CAEL,OAAO;AACT"}
|
package/dist/esm/version.d.ts
CHANGED
package/dist/esm/version.js
CHANGED
package/dist/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@bigmi/react'\nexport const version = '0.8.
|
|
1
|
+
{"version":3,"file":"version.js","names":[],"sources":["../../src/version.ts"],"sourcesContent":["export const name = '@bigmi/react'\nexport const version = '0.8.1'\n"],"mappings":";AAAA,MAAa,OAAO;AACpB,MAAa,UAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigmi/react",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "React primitives for Bitcoin apps.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/esm/index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"hooks"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@bigmi/
|
|
33
|
-
"@bigmi/
|
|
32
|
+
"@bigmi/client": "0.8.1",
|
|
33
|
+
"@bigmi/core": "0.8.1"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@tanstack/react-query": ">=5.68.0",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"files": [
|
|
41
41
|
"dist/**",
|
|
42
|
+
"CHANGELOG.md",
|
|
42
43
|
"!dist/**/*.tsbuildinfo",
|
|
43
44
|
"src/**/*.ts",
|
|
44
45
|
"!src/**/*.spec.ts",
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@bigmi/react'
|
|
2
|
-
export const version = '0.8.
|
|
2
|
+
export const version = '0.8.1'
|