@hub3js/core 0.0.0-experimental-03bf1f89-20260602
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 +381 -0
- package/dist/builders/action.d.ts +22 -0
- package/dist/builders/action.d.ts.map +1 -0
- package/dist/builders/mod.d.ts +5 -0
- package/dist/builders/mod.d.ts.map +1 -0
- package/dist/builders/namespace.d.ts +47 -0
- package/dist/builders/namespace.d.ts.map +1 -0
- package/dist/builders/provider.d.ts +37 -0
- package/dist/builders/provider.d.ts.map +1 -0
- package/dist/builders/types.d.ts +23 -0
- package/dist/builders/types.d.ts.map +1 -0
- package/dist/hub/helpers.d.ts +6 -0
- package/dist/hub/helpers.d.ts.map +1 -0
- package/dist/hub/hub.d.ts +44 -0
- package/dist/hub/hub.d.ts.map +1 -0
- package/dist/hub/mod.d.ts +11 -0
- package/dist/hub/mod.d.ts.map +1 -0
- package/dist/hub/namespaces/errors.d.ts +5 -0
- package/dist/hub/namespaces/errors.d.ts.map +1 -0
- package/dist/hub/namespaces/mod.d.ts +3 -0
- package/dist/hub/namespaces/mod.d.ts.map +1 -0
- package/dist/hub/namespaces/namespace.d.ts +148 -0
- package/dist/hub/namespaces/namespace.d.ts.map +1 -0
- package/dist/hub/namespaces/types.d.ts +36 -0
- package/dist/hub/namespaces/types.d.ts.map +1 -0
- package/dist/hub/provider/mod.d.ts +3 -0
- package/dist/hub/provider/mod.d.ts.map +1 -0
- package/dist/hub/provider/provider.d.ts +102 -0
- package/dist/hub/provider/provider.d.ts.map +1 -0
- package/dist/hub/provider/types.d.ts +28 -0
- package/dist/hub/provider/types.d.ts.map +1 -0
- package/dist/hub/store/events.d.ts +54 -0
- package/dist/hub/store/events.d.ts.map +1 -0
- package/dist/hub/store/extend.d.ts +14 -0
- package/dist/hub/store/extend.d.ts.map +1 -0
- package/dist/hub/store/hub.d.ts +11 -0
- package/dist/hub/store/hub.d.ts.map +1 -0
- package/dist/hub/store/mod.d.ts +8 -0
- package/dist/hub/store/mod.d.ts.map +1 -0
- package/dist/hub/store/mod.js +2 -0
- package/dist/hub/store/mod.js.map +7 -0
- package/dist/hub/store/namespaces.d.ts +38 -0
- package/dist/hub/store/namespaces.d.ts.map +1 -0
- package/dist/hub/store/providers.d.ts +84 -0
- package/dist/hub/store/providers.d.ts.map +1 -0
- package/dist/hub/store/selectors.d.ts +18 -0
- package/dist/hub/store/selectors.d.ts.map +1 -0
- package/dist/hub/store/store.d.ts +14 -0
- package/dist/hub/store/store.d.ts.map +1 -0
- package/dist/hub/types.d.ts +5 -0
- package/dist/hub/types.d.ts.map +1 -0
- package/dist/mod.d.ts +5 -0
- package/dist/mod.d.ts.map +1 -0
- package/dist/mod.js +2 -0
- package/dist/mod.js.map +7 -0
- package/dist/test-utils/fixtures.d.ts +4 -0
- package/dist/test-utils/fixtures.d.ts.map +1 -0
- package/dist/test-utils/mod.d.ts +2 -0
- package/dist/test-utils/mod.d.ts.map +1 -0
- package/dist/test-utils/mod.js +2 -0
- package/dist/test-utils/mod.js.map +7 -0
- package/dist/utils/mod.d.ts +3 -0
- package/dist/utils/mod.d.ts.map +1 -0
- package/dist/utils/mod.js +2 -0
- package/dist/utils/mod.js.map +7 -0
- package/dist/utils/versions.d.ts +50 -0
- package/dist/utils/versions.d.ts.map +1 -0
- package/package.json +49 -0
- package/readme.md +4 -0
- package/src/builders/action.test.ts +225 -0
- package/src/builders/action.ts +86 -0
- package/src/builders/mod.ts +5 -0
- package/src/builders/namespace.ts +258 -0
- package/src/builders/provider.ts +101 -0
- package/src/builders/types.ts +28 -0
- package/src/hub/helpers.ts +11 -0
- package/src/hub/hub.test.ts +108 -0
- package/src/hub/hub.ts +145 -0
- package/src/hub/mod.ts +21 -0
- package/src/hub/namespaces/errors.ts +11 -0
- package/src/hub/namespaces/mod.ts +10 -0
- package/src/hub/namespaces/namespace.test.ts +443 -0
- package/src/hub/namespaces/namespace.ts +470 -0
- package/src/hub/namespaces/types.ts +58 -0
- package/src/hub/provider/mod.ts +9 -0
- package/src/hub/provider/provider.test.ts +277 -0
- package/src/hub/provider/provider.ts +286 -0
- package/src/hub/provider/types.ts +37 -0
- package/src/hub/store/events.ts +89 -0
- package/src/hub/store/extend.ts +125 -0
- package/src/hub/store/hub.ts +18 -0
- package/src/hub/store/mod.ts +26 -0
- package/src/hub/store/namespaces.ts +177 -0
- package/src/hub/store/providers.ts +183 -0
- package/src/hub/store/selectors.ts +59 -0
- package/src/hub/store/store.test.ts +50 -0
- package/src/hub/store/store.ts +30 -0
- package/src/hub/types.ts +13 -0
- package/src/mod.ts +27 -0
- package/src/test-utils/fixtures.ts +13 -0
- package/src/test-utils/mod.ts +1 -0
- package/src/utils/mod.ts +2 -0
- package/src/utils/versions.test.ts +23 -0
- package/src/utils/versions.ts +91 -0
- package/store/package.json +8 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
# 0.59.0 (2026-05-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* migrated @rango-dev/wallets-core package to this monorepo with a ([b3e1ba9](https://github.com/rango-exchange/hub3js/commit/b3e1ba980146ed4e8c95489b702d12956264098c))
|
|
7
|
+
## [0.58.1](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.58.0...wallets-core@0.58.1) (2026-05-02)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# [0.58.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.57.0...wallets-core@0.58.0) (2026-04-29)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* integrating gemwallet ([750b0fc](https://github.com/rango-exchange/rango-client/commit/750b0fc72f1d4d6564ebf47e9c58e9f3efc9b3e5))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# [0.57.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.56.0...wallets-core@0.57.0) (2025-12-30)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* integrating xrpl blockchain ([d3f1dc7](https://github.com/rango-exchange/rango-client/commit/d3f1dc7271be0232b99fac25c20d8df853272ee9))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# [0.56.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.55.0...wallets-core@0.56.0) (2025-12-15)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Features
|
|
33
|
+
|
|
34
|
+
* implement suggest action for hub ([c23ca71](https://github.com/rango-exchange/rango-client/commit/c23ca7174cfa388870006482c177c778a047ca58))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# [0.55.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.54.0...wallets-core@0.55.0) (2025-12-09)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Features
|
|
42
|
+
|
|
43
|
+
* add `starknet` namespace to the hub ([b500da5](https://github.com/rango-exchange/rango-client/commit/b500da5f2191c31be69119514865b6f9245968e5))
|
|
44
|
+
* add cosmos namespace to the hub ([2b1539f](https://github.com/rango-exchange/rango-client/commit/2b1539ff01b6c270503a5d84fccaee064592a367))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# [0.54.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.53.0...wallets-core@0.54.0) (2025-12-02)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### Features
|
|
52
|
+
|
|
53
|
+
* add tron namespace ([4a2fb70](https://github.com/rango-exchange/rango-client/commit/4a2fb70c2311dd7d451e2eafa8f0e29c5b30bbce))
|
|
54
|
+
* integrate xverse wallet ([5560aca](https://github.com/rango-exchange/rango-client/commit/5560aca41af54f676b0488e9efc1f00e487189d1))
|
|
55
|
+
* storing `connectArgs` to the namespace state ([0e55dea](https://github.com/rango-exchange/rango-client/commit/0e55dea5af395540d4dbf71c4179bec4fcfa6bb5))
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
# [0.51.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.50.0...wallets-core@0.51.0) (2025-10-29)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Reverts
|
|
63
|
+
|
|
64
|
+
* Revert "feat: implement deep linking" ([a0b0edc](https://github.com/rango-exchange/rango-client/commit/a0b0edcc052bfea69af2037b73c0bb6a9b38c2a9))
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
# [0.50.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.49.0...wallets-core@0.50.0) (2025-09-29)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### Bug Fixes
|
|
72
|
+
|
|
73
|
+
* no evm compatible account available bug ([6e782f0](https://github.com/rango-exchange/rango-client/commit/6e782f034ffdfd8a55bfc893ce55617910310466))
|
|
74
|
+
* read publickey from instance if connect response was empty on solana ([5899196](https://github.com/rango-exchange/rango-client/commit/58991961dce2dcf0468197b0777798aa6a1f7c36))
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
### Features
|
|
78
|
+
|
|
79
|
+
* add single selection to detached modal ([07c7d44](https://github.com/rango-exchange/rango-client/commit/07c7d44ffd3def69e83c54d988c1279ac68d5889))
|
|
80
|
+
* implement changeAccountSubscriber builder ([8e2ca97](https://github.com/rango-exchange/rango-client/commit/8e2ca9783fcd57445ca558e688c402a30aba3686))
|
|
81
|
+
* migrate Coinbase to use Hub ([d7236e4](https://github.com/rango-exchange/rango-client/commit/d7236e4b65f8a955c819ca1eb22c74a37da94022))
|
|
82
|
+
* migrate ledger provider to use hub ([a114101](https://github.com/rango-exchange/rango-client/commit/a114101bd9c317ec5c82c6146a6e88813bcbebf3))
|
|
83
|
+
* migrate metamask to hub ([9ef1b5a](https://github.com/rango-exchange/rango-client/commit/9ef1b5a600945c8467b500a686a96cf081f3fb6e))
|
|
84
|
+
* migrate safepal to hub ([9abf9c9](https://github.com/rango-exchange/rango-client/commit/9abf9c9be4c009e55570b15b0c048b8554f681bc))
|
|
85
|
+
* use existing format account method for subscriber ([f08e6f9](https://github.com/rango-exchange/rango-client/commit/f08e6f94e3edc2241893f8ff3ec9ea1bd79cf81b))
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
# [0.49.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.48.0...wallets-core@0.49.0) (2025-09-06)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
### Features
|
|
93
|
+
|
|
94
|
+
* implement deep linking ([1dec48e](https://github.com/rango-exchange/rango-client/commit/1dec48e4db944977fb6d3797d7aa49527940fab6))
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
# [0.48.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.47.0...wallets-core@0.48.0) (2025-08-19)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### Features
|
|
102
|
+
|
|
103
|
+
* implement retry mechanism for lazy imports ([9a8e191](https://github.com/rango-exchange/rango-client/commit/9a8e191711d2319990ca4d0613e8188a5f86842f))
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
# [0.47.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.46.0...wallets-core@0.47.0) (2025-08-05)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
### Features
|
|
111
|
+
|
|
112
|
+
* implement canSwitchNetwork for hub providers ([5a4eced](https://github.com/rango-exchange/rango-client/commit/5a4eced221046b5474176aca7c569092e36f1bde))
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
# [0.46.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.45.0...wallets-core@0.46.0) (2025-07-22)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
### Bug Fixes
|
|
120
|
+
|
|
121
|
+
* abort all namespace connections if user rejects one connect request ([5824a96](https://github.com/rango-exchange/rango-client/commit/5824a96c8c9d8075c730a19de3b78caccbb04778))
|
|
122
|
+
* handle trust wallet in app browser user rejection error ([1b1d07f](https://github.com/rango-exchange/rango-client/commit/1b1d07f9155bbd7dbe3f7a9157b353e4a2a3cc40))
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
### Features
|
|
126
|
+
|
|
127
|
+
* add derivation path to swap wallets ([0728ac4](https://github.com/rango-exchange/rango-client/commit/0728ac40a67f648d254db2461627b7cd408a28c5))
|
|
128
|
+
* migrate rabby to use hub ([e25ba8c](https://github.com/rango-exchange/rango-client/commit/e25ba8c52e2a603ba0689e91773fd6edebf3003f))
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
### Reverts
|
|
132
|
+
|
|
133
|
+
* Revert "chore(release): publish" ([064ce15](https://github.com/rango-exchange/rango-client/commit/064ce157a2f819856f647f83aeb1c0410542e8d7))
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
# [0.44.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.43.0...wallets-core@0.44.0) (2025-06-09)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
### Bug Fixes
|
|
141
|
+
|
|
142
|
+
* add has method to the namespace proxy ([ee74628](https://github.com/rango-exchange/rango-client/commit/ee7462881c27fbf42fae374064362293f5f92765))
|
|
143
|
+
* avoid hub recreation ([2e5fc07](https://github.com/rango-exchange/rango-client/commit/2e5fc07bc0952d1d98b828d7e70a892034bb99b8))
|
|
144
|
+
* fix phantom transaction failure on sui namespace disabled ([213b235](https://github.com/rango-exchange/rango-client/commit/213b23565b2729a48605d3d06ef5dd6daf66900f))
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
### Features
|
|
148
|
+
|
|
149
|
+
* add detached connect wallet modal ([b2d7d6f](https://github.com/rango-exchange/rango-client/commit/b2d7d6fda2bdfe3e9f72baba95a1a7694e3db21a))
|
|
150
|
+
* integrate slush wallet ([9e9a5cc](https://github.com/rango-exchange/rango-client/commit/9e9a5ccb802fbd1f9a50322a89f65b557f152c6a))
|
|
151
|
+
* migrate trust wallet to use hub and add support for solana ([61497fd](https://github.com/rango-exchange/rango-client/commit/61497fd40d48d48030e5a6d7ece53b5b7daf7b09))
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
# [0.43.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.42.0...wallets-core@0.43.0) (2025-04-30)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
### Bug Fixes
|
|
159
|
+
|
|
160
|
+
* error rethrow in or action ([61bc658](https://github.com/rango-exchange/rango-client/commit/61bc658f6a0dab513bb595e2943c85b675c65ada))
|
|
161
|
+
* rename pbt to ptb for sui ([3d6d89f](https://github.com/rango-exchange/rango-client/commit/3d6d89f2265766607a15d61e0df92643fb33072b))
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
### Features
|
|
165
|
+
|
|
166
|
+
* add can eager connect to namespaces ([16b4792](https://github.com/rango-exchange/rango-client/commit/16b4792f877b565ccf767be22ebe14fa79ddd8c6))
|
|
167
|
+
* implement updated design for initial connect modal ([2873c63](https://github.com/rango-exchange/rango-client/commit/2873c630de0740bb3b9f4e52bfa018857bd54dcd))
|
|
168
|
+
* Sui support for Phantom ([3769b8b](https://github.com/rango-exchange/rango-client/commit/3769b8ba174783190e242103548bcf4da28cff14))
|
|
169
|
+
* update sui to consider recent api changes ([d764b25](https://github.com/rango-exchange/rango-client/commit/d764b2501df9bb295f63cdbc0b05acd4a3abb4b9))
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
# [0.42.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.41.0...wallets-core@0.42.0) (2025-03-11)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
### Features
|
|
177
|
+
|
|
178
|
+
* add bitcoin signer for phantom on hub ([750124e](https://github.com/rango-exchange/rango-client/commit/750124e693753078abb537d4043964e2eebdbc01))
|
|
179
|
+
* add sui namespace to wallets-core ([5bcf5dd](https://github.com/rango-exchange/rango-client/commit/5bcf5ddd1444bcabb894ddfac0e3766c88988fbd))
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
# [0.41.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.40.0...wallets-core@0.41.0) (2025-02-23)
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
### Bug Fixes
|
|
187
|
+
|
|
188
|
+
* ctrl wallet is changing 'keplr' named function to undefined ([f1b7f2a](https://github.com/rango-exchange/rango-client/commit/f1b7f2a814f45441639174b36d498a1e341bb559))
|
|
189
|
+
* remove connected wallet on namespace disconnect ([4f0be8a](https://github.com/rango-exchange/rango-client/commit/4f0be8a1eab99af9e6077b7c8c45fdfc6d40f4e9))
|
|
190
|
+
* switching to not connected account should disconnect evm as well ([8ea7d40](https://github.com/rango-exchange/rango-client/commit/8ea7d40569972fe14dbde630b1e0ba9c4d6b0df5))
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
### Features
|
|
194
|
+
|
|
195
|
+
* add an adapter for Hub for wallets-react and enabling Hub by default. ([a14bdf9](https://github.com/rango-exchange/rango-client/commit/a14bdf9619e448bc4568d6b758ca86d2359e1740))
|
|
196
|
+
* add base chain to phantom evm supported chains ([58a2d54](https://github.com/rango-exchange/rango-client/commit/58a2d54c0eff18e8d5ecf980b2487f7c8dada59f))
|
|
197
|
+
* add chain change subscribe to evm namespace ([0a7e7ee](https://github.com/rango-exchange/rango-client/commit/0a7e7ee6b53c94dcb842fff7e34f9dcbf6120a37))
|
|
198
|
+
* introducing store events for hub and fix switching accounts using that ([ba95ba2](https://github.com/rango-exchange/rango-client/commit/ba95ba2584f41e2a4b4b2984a62c737ab74d7cd8))
|
|
199
|
+
* storing network alongside namespace for hub localstorage ([c5437fa](https://github.com/rango-exchange/rango-client/commit/c5437fa0f5117d9d762358cf7cf8ca4627c43406))
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
# [0.40.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.39.0...wallets-core@0.40.0) (2024-11-12)
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
# [0.39.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.38.0...wallets-core@0.39.0) (2024-10-12)
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
### Bug Fixes
|
|
211
|
+
|
|
212
|
+
* bump sdk and fix type issues ([d442208](https://github.com/rango-exchange/rango-client/commit/d4422083bf5dd27d5f509ce1db7f9560d05428c8))
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
### Features
|
|
216
|
+
|
|
217
|
+
* introducing hub, our new wallet management ([92692fe](https://github.com/rango-exchange/rango-client/commit/92692fe7a05be72caea8b99bcc4ac5e2326f2f5a))
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
### Performance Improvements
|
|
221
|
+
|
|
222
|
+
* lazy load signer packages ([7b88f18](https://github.com/rango-exchange/rango-client/commit/7b88f1834f7b29b4b81ab6c81a07bb88e8ccf55c))
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
# [0.38.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.37.0...wallets-core@0.38.0) (2024-09-10)
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
# [0.37.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.36.1...wallets-core@0.37.0) (2024-08-11)
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
## [0.36.1](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.36.0...wallets-core@0.36.1) (2024-07-14)
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
# [0.36.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.34.0...wallets-core@0.36.0) (2024-07-09)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
### Features
|
|
242
|
+
|
|
243
|
+
* add a modal for setting custom derivation path for ledger ([5b74ec0](https://github.com/rango-exchange/rango-client/commit/5b74ec049393ed74e3e7547edc72b68bd70b7dce))
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
# [0.35.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.34.0...wallets-core@0.35.0) (2024-06-01)
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
# [0.34.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.33.0...wallets-core@0.34.0) (2024-05-14)
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
### Features
|
|
255
|
+
|
|
256
|
+
* add solana to ledger ([77b6695](https://github.com/rango-exchange/rango-client/commit/77b6695758165f9258a0ba5bd3b2cf39b0b2aab5))
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
# [0.33.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.32.0...wallets-core@0.33.0) (2024-04-24)
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
# [0.32.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.31.0...wallets-core@0.32.0) (2024-04-23)
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
### Bug Fixes
|
|
268
|
+
|
|
269
|
+
* set current state for current network in conencting multi-chain wallets ([dc62af0](https://github.com/rango-exchange/rango-client/commit/dc62af03f0edc10400394ba600c7d83e1250b4e8))
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
# [0.31.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.30.0...wallets-core@0.31.0) (2024-04-09)
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
# [0.30.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.29.0...wallets-core@0.30.0) (2024-03-12)
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
### Bug Fixes
|
|
281
|
+
|
|
282
|
+
* fix wallet connect namespace and switch network ([c8f31b3](https://github.com/rango-exchange/rango-client/commit/c8f31b3ddf4ceeaf745bc089f530b6a4b1eb9637))
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
# [0.29.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.28.0...wallets-core@0.29.0) (2024-02-20)
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
# [0.28.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.27.0...wallets-core@0.28.0) (2024-02-07)
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
# [0.27.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.26.0...wallets-core@0.27.0) (2024-01-22)
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
### Bug Fixes
|
|
298
|
+
|
|
299
|
+
* cleanup wallets' subscriber when setProvider get null ([88d6a42](https://github.com/rango-exchange/rango-client/commit/88d6a423c49b34b3d9ff567e22df36c3b009bb76))
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
# [0.26.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.24.0...wallets-core@0.26.0) (2023-12-24)
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
### Bug Fixes
|
|
307
|
+
|
|
308
|
+
* fix HMR for widget and playground ([8524820](https://github.com/rango-exchange/rango-client/commit/8524820f10cf0b8921f3db0c4f620ff98daa4103))
|
|
309
|
+
* handle safe wallet in widget ([52fcca4](https://github.com/rango-exchange/rango-client/commit/52fcca49315f7e2edb4655ae7b9cd0792c2800d7))
|
|
310
|
+
* handle switch network flow for wallet-connect ([8c4a17b](https://github.com/rango-exchange/rango-client/commit/8c4a17b47b2919820a4e0726f6d1c48b8994abe3))
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
# [0.14.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.13.0...wallets-core@0.14.0) (2023-08-03)
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
# [0.13.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.12.0...wallets-core@0.13.0) (2023-08-01)
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
# [0.9.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.8.0...wallets-core@0.9.0) (2023-07-31)
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
### Features
|
|
326
|
+
|
|
327
|
+
* add project id as a external value ([0c80404](https://github.com/rango-exchange/rango-client/commit/0c80404a8cacb6c5b0338dea1e416b0b11db254b))
|
|
328
|
+
* Support for WalletConnect 2 ([faedef0](https://github.com/rango-exchange/rango-client/commit/faedef0b5e6fc3c5ef881cbbe4ec05334cc1c910))
|
|
329
|
+
* support safe wallet ([d04cbcd](https://github.com/rango-exchange/rango-client/commit/d04cbcd2a612755563512d9dff6f2312088d8b4d))
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
# [0.7.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.6.0...wallets-core@0.7.0) (2023-07-11)
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
# [0.6.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.5.0...wallets-core@0.6.0) (2023-07-11)
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
### Features
|
|
341
|
+
|
|
342
|
+
* implement wallets auto-connect functionality ([f47d32b](https://github.com/rango-exchange/rango-client/commit/f47d32bb8bbb38a72b961e5eb2ee7e2b985f9f7d))
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
### Reverts
|
|
346
|
+
|
|
347
|
+
* Revert "support for rango-types cjs format" ([ed4e050](https://github.com/rango-exchange/rango-client/commit/ed4e050bfc0dcde7aeffa6b0d73b02080a5721eb))
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
# [0.5.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.4.0...wallets-core@0.5.0) (2023-05-31)
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
# [0.4.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.3.0...wallets-core@0.4.0) (2023-05-31)
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
# [0.3.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.2.0...wallets-core@0.3.0) (2023-05-30)
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
# [0.2.0](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.1.15...wallets-core@0.2.0) (2023-05-30)
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
### Bug Fixes
|
|
367
|
+
|
|
368
|
+
* fix bug of duplicate modals for wallet connect ([efb5482](https://github.com/rango-exchange/rango-client/commit/efb54827fd51e6c6c8f42c6abf33c3d7610755e8))
|
|
369
|
+
* fix can switch network for wallet connect ([e3cdeac](https://github.com/rango-exchange/rango-client/commit/e3cdeacd836e254ea2d5384aab4b624a3e7259eb))
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
## [0.1.14](https://github.com/rango-exchange/rango-client/compare/wallets-core@0.1.13...wallets-core@0.1.14) (2023-05-15)
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
### Bug Fixes
|
|
377
|
+
|
|
378
|
+
* update rango-types and fix notification bugs ([993f185](https://github.com/rango-exchange/rango-client/commit/993f185e0b8c5e5e15a2c65ba2d85d1f9c8daa90))
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Actions, Context, Operators } from '../hub/namespaces/types.js';
|
|
2
|
+
import type { AnyFunction, FunctionWithContext } from '../hub/types.js';
|
|
3
|
+
export interface ActionByBuilder<T, Context> {
|
|
4
|
+
actionName: keyof T;
|
|
5
|
+
and: Operators<T>;
|
|
6
|
+
or: Operators<T>;
|
|
7
|
+
after: Operators<T>;
|
|
8
|
+
before: Operators<T>;
|
|
9
|
+
action: FunctionWithContext<T[keyof T], Context>;
|
|
10
|
+
}
|
|
11
|
+
export declare class ActionBuilder<T extends Actions<T>, K extends keyof T> {
|
|
12
|
+
#private;
|
|
13
|
+
readonly name: K;
|
|
14
|
+
constructor(name: K);
|
|
15
|
+
and(action: FunctionWithContext<AnyFunction, Context<T>>): this;
|
|
16
|
+
or(action: FunctionWithContext<AnyFunction, Context<T>>): this;
|
|
17
|
+
before(action: FunctionWithContext<AnyFunction, Context<T>>): this;
|
|
18
|
+
after(action: FunctionWithContext<AnyFunction, Context<T>>): this;
|
|
19
|
+
action(action: FunctionWithContext<T[keyof T], Context<T>>): this;
|
|
20
|
+
build(): ActionByBuilder<T, Context<T>>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../src/builders/action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAExE,MAAM,WAAW,eAAe,CAAC,CAAC,EAAE,OAAO;IACzC,UAAU,EAAE,MAAM,CAAC,CAAC;IACpB,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAClB,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IACpB,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IACrB,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;CAClD;AAYD,qBAAa,aAAa,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC;;IAChE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;gBAOL,IAAI,EAAE,CAAC;IAIZ,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAQxD,EAAE,CAAC,MAAM,EAAE,mBAAmB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAQvD,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAQ3D,KAAK,CAAC,MAAM,EAAE,mBAAmB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAQ1D,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAK1D,KAAK,IAAI,eAAe,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;CAc/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/builders/mod.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ActionByBuilder } from './action.js';
|
|
2
|
+
import type { ProxiedNamespace } from './types.js';
|
|
3
|
+
import type { Actions, Context } from '../hub/namespaces/mod.js';
|
|
4
|
+
import type { NamespaceConfig } from '../hub/store/mod.js';
|
|
5
|
+
import type { FunctionWithContext } from '../hub/types.js';
|
|
6
|
+
/**
|
|
7
|
+
* There are Namespace's methods that should be called directly on Proxy object.
|
|
8
|
+
* The Proxy object is creating in `.build`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const allowedMethods: readonly ["init", "state", "after", "before", "and_then", "or_else", "store"];
|
|
11
|
+
export declare class NamespaceBuilder<T extends Actions<T>> {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(id: string, providerId: string);
|
|
14
|
+
/** There are some predefined configs that can be set for each namespace separately */
|
|
15
|
+
config<K extends keyof NamespaceConfig>(name: K, value: NamespaceConfig[K]): this;
|
|
16
|
+
/**
|
|
17
|
+
* Getting a list of actions.
|
|
18
|
+
*
|
|
19
|
+
* e.g.:
|
|
20
|
+
* ```ts
|
|
21
|
+
* .action([
|
|
22
|
+
* ["connect", () => {}],
|
|
23
|
+
* ["disconnect", () => {}]
|
|
24
|
+
* ])
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
action<K extends keyof T>(action: (readonly [K, FunctionWithContext<T[K], Context<T>>])[]): NamespaceBuilder<T>;
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* Add a single action
|
|
32
|
+
*
|
|
33
|
+
* e.g.:
|
|
34
|
+
* ```ts
|
|
35
|
+
* .action( ["connect", () => {}] )
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
action<K extends keyof T>(action: K, actionFn: FunctionWithContext<T[K], Context<T>>): NamespaceBuilder<T>;
|
|
39
|
+
action(action: ActionByBuilder<T, Context<T>>): NamespaceBuilder<T>;
|
|
40
|
+
/**
|
|
41
|
+
* By calling build, an instance of Namespace will be built.
|
|
42
|
+
*
|
|
43
|
+
* Note: it's not exactly a `Namespace`, it returns a Proxy which add more convenient use like `namespace.connect()` instead of `namespace.run("connect")`
|
|
44
|
+
*/
|
|
45
|
+
build(): ProxiedNamespace<T>;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=namespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../../src/builders/namespace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAc,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAI3D;;;GAGG;AACH,eAAO,MAAM,cAAc,+EAQjB,CAAC;AAaX,qBAAa,gBAAgB,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC;;gBAYpC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAM1C,sFAAsF;IAC/E,MAAM,CAAC,CAAC,SAAS,MAAM,eAAe,EAC3C,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC;IAM3B;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,EAC7B,MAAM,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAC9D,gBAAgB,CAAC,CAAC,CAAC;IAEtB;;;;;;;;OAQG;IACI,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,EAC7B,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,GAC9C,gBAAgB,CAAC,CAAC,CAAC;IAEf,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC;IA0C1E;;;;OAIG;IACI,KAAK,IAAI,gBAAgB,CAAC,CAAC,CAAC;CAwHpC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ProxiedNamespace } from './types.js';
|
|
2
|
+
import type { Actions } from '../hub/namespaces/mod.js';
|
|
3
|
+
import type { ExtendableInternalActions, ProviderBuilderOptions } from '../hub/provider/mod.js';
|
|
4
|
+
import type { ProviderConfig } from '../hub/store/mod.js';
|
|
5
|
+
import { Provider } from '../hub/provider/mod.js';
|
|
6
|
+
/**
|
|
7
|
+
* Fluent builder for `Provider`. Each `.add(key, namespace)` call accumulates
|
|
8
|
+
* the registered namespace map into the `TNS` generic, so the resulting
|
|
9
|
+
* `Provider<TNS>` knows exactly which namespaces it owns.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const phantom = new ProviderBuilder('phantom')
|
|
14
|
+
* .config('metadata', meta)
|
|
15
|
+
* .add('evm', evmNamespace) // adds { evm: EvmActions }
|
|
16
|
+
* .add('solana', solanaNamespace) // adds { solana: SolanaActions }
|
|
17
|
+
* .build();
|
|
18
|
+
* // Provider<{ evm: EvmActions; solana: SolanaActions }>
|
|
19
|
+
* ```
|
|
20
|
+
* `{}` is intentional: identity element under intersection so the first
|
|
21
|
+
* `.add(K, T)` produces `{} & Record<K, T> = Record<K, T>` and subsequent calls
|
|
22
|
+
* accumulate cleanly. Not the unsafe "any non-nullish" usage the rule targets.
|
|
23
|
+
*/
|
|
24
|
+
export declare class ProviderBuilder<TNS = {}> {
|
|
25
|
+
#private;
|
|
26
|
+
constructor(id: string, options?: ProviderBuilderOptions);
|
|
27
|
+
/**
|
|
28
|
+
* Register a namespace under `id`. Captures both the key and the namespace's
|
|
29
|
+
* action interface into the builder's `TNS` so subsequent operations are
|
|
30
|
+
* statically typed against the accumulated set.
|
|
31
|
+
*/
|
|
32
|
+
add<const K extends string, T extends Actions<T>>(id: K, namespace: ProxiedNamespace<T>): ProviderBuilder<TNS & Record<K, T>>;
|
|
33
|
+
config<K extends keyof ProviderConfig<TNS>>(name: K, value: ProviderConfig<TNS>[K]): this;
|
|
34
|
+
init(cb: Exclude<ExtendableInternalActions['init'], undefined>): this;
|
|
35
|
+
build(): Provider<TNS>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/builders/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,KAAK,EACV,yBAAyB,EACzB,sBAAsB,EAEvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD;;;;;;;;;;;;;;;;;GAiBG;AAEH,qBAAa,eAAe,CAAC,GAAG,GAAG,EAAE;;gBAWvB,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,sBAAsB;IAKxD;;;;OAIG;IACI,GAAG,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,EACrD,EAAE,EAAE,CAAC,EACL,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAC7B,eAAe,CAAC,GAAG,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAQ/B,MAAM,CAAC,CAAC,SAAS,MAAM,cAAc,CAAC,GAAG,CAAC,EAC/C,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAC5B,IAAI;IAKA,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,GAAG,IAAI;IAKrE,KAAK,IAAI,QAAQ,CAAC,GAAG,CAAC;CAyB9B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { allowedMethods } from './namespace.js';
|
|
2
|
+
import type { Actions, Namespace } from '../hub/namespaces/mod.js';
|
|
3
|
+
type NamespacePublicValues = {
|
|
4
|
+
namespaceId: string;
|
|
5
|
+
providerId: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* NamespaceBuilder is creating a proxy instead of return Namespace instance.
|
|
9
|
+
* The reason is improving access to actions. e.g `.connect()` instead of `.run('connect')`
|
|
10
|
+
*/
|
|
11
|
+
export type ProxiedNamespace<T extends Actions<T>> = T & Pick<Namespace<T>, (typeof allowedMethods)[number]> & NamespacePublicValues;
|
|
12
|
+
/**
|
|
13
|
+
* Map a key into the corresponding proxied namespace inside a namespace set.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* type List = { evm: EvmActions; solana: SolanaActions };
|
|
18
|
+
* FindProxiedNamespace<'solana', List>; // ProxiedNamespace<SolanaActions>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export type FindProxiedNamespace<K extends keyof T, T> = T[K] extends Actions<T[K]> ? ProxiedNamespace<T[K]> : never;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/builders/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGnE,KAAK,qBAAqB,GAAG;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GACpD,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,GACnD,qBAAqB,CAAC;AAExB;;;;;;;;GAQG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,IACnD,CAAC,CAAC,CAAC,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Note: This only works native async, if we are going to support for old transpilers like Babel.
|
|
3
|
+
*/
|
|
4
|
+
export declare function isAsync(fn: Function): boolean;
|
|
5
|
+
export declare function generateStoreId(providerId: string, namespace: string): string;
|
|
6
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/hub/helpers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,wBAAgB,OAAO,CAAC,EAAE,EAAE,QAAQ,WAEnC;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAEpE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { State as NamespaceState } from './namespaces/mod.js';
|
|
2
|
+
import type { Provider, State as ProviderState } from './provider/mod.js';
|
|
3
|
+
import type { Store } from './store/mod.js';
|
|
4
|
+
/**
|
|
5
|
+
* Hub stores providers with heterogeneous `TNS` shapes. `Provider<TNS>` is
|
|
6
|
+
* invariant in `TNS` (TNS appears in both reading and writing positions via
|
|
7
|
+
* the internal `Map`), so the only universally-assignable upper bound is
|
|
8
|
+
* `Provider<any>`. Concrete TNS information is preserved on each `Provider`
|
|
9
|
+
* instance itself — consumers recover precise types via `provider.get('evm')`.
|
|
10
|
+
*
|
|
11
|
+
* TODO: consider making `Provider<TNS>` covariant in TNS so this `any` can be
|
|
12
|
+
* replaced with `Provider<unknown>`. Requires switching the internal storage
|
|
13
|
+
* to a covariant container (e.g. `ReadonlyMap` semantics), moving TNS-typed
|
|
14
|
+
* constructor inputs out of the public class surface (factory pattern or
|
|
15
|
+
* interface + impl), and dropping TNS info from `getAll()`'s return type.
|
|
16
|
+
* Bigger surgery than this PR; deserves its own review cycle.
|
|
17
|
+
*/
|
|
18
|
+
type AnyProvider = Provider<any>;
|
|
19
|
+
type HubState = {
|
|
20
|
+
[key in string]: ProviderState & {
|
|
21
|
+
namespaces: NamespaceState[];
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
type RunAllResult = {
|
|
25
|
+
id: string;
|
|
26
|
+
provider: unknown;
|
|
27
|
+
namespaces: unknown[];
|
|
28
|
+
};
|
|
29
|
+
interface HubOptions {
|
|
30
|
+
store?: Store;
|
|
31
|
+
}
|
|
32
|
+
export declare class Hub {
|
|
33
|
+
#private;
|
|
34
|
+
constructor(options?: HubOptions);
|
|
35
|
+
init(): void;
|
|
36
|
+
runAll(action: string): RunAllResult[];
|
|
37
|
+
add(id: string, provider: AnyProvider): this;
|
|
38
|
+
remove(id: string): this;
|
|
39
|
+
get(providerId: string): AnyProvider | undefined;
|
|
40
|
+
getAll(): Map<string, AnyProvider>;
|
|
41
|
+
state(): HubState;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=hub.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hub.d.ts","sourceRoot":"","sources":["../../src/hub/hub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,KAAK,IAAI,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C;;;;;;;;;;;;;GAaG;AAEH,KAAK,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;AAEjC,KAAK,QAAQ,GAAG;KACb,GAAG,IAAI,MAAM,GAAG,aAAa,GAAG;QAC/B,UAAU,EAAE,cAAc,EAAE,CAAC;KAC9B;CACF,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,EAAE,CAAC;CACvB,CAAC;AAEF,UAAU,UAAU;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,qBAAa,GAAG;;gBAIF,OAAO,CAAC,EAAE,UAAU;IAIhC,IAAI;IASJ,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,EAAE;IAqCtC,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,GAAG,IAAI;IAQ5C,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAaxB,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAIhD,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC;IAIlC,KAAK,IAAI,QAAQ;CAwBlB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type { Actions, Subscriber, SubscriberCleanUp, Context, } from './namespaces/mod.js';
|
|
2
|
+
export { Namespace } from './namespaces/mod.js';
|
|
3
|
+
export { Provider } from './provider/mod.js';
|
|
4
|
+
export type { RegisteredNamespaces } from './provider/mod.js';
|
|
5
|
+
export { Hub } from './hub.js';
|
|
6
|
+
export type { Store, State, ProviderMetadata } from './store/mod.js';
|
|
7
|
+
export { createStore, guessProviderStateSelector, namespaceStateSelector, } from './store/mod.js';
|
|
8
|
+
export { generateStoreId } from './helpers.js';
|
|
9
|
+
export type { CanEagerConnect } from './namespaces/types.js';
|
|
10
|
+
export type { FunctionWithContext, AnyFunction } from './types.js';
|
|
11
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/hub/mod.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,OAAO,EACP,UAAU,EACV,iBAAiB,EACjB,OAAO,GACR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EACL,WAAW,EACX,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const ACTION_NOT_FOUND_ERROR: (name: string) => string;
|
|
2
|
+
export declare const OR_ELSE_ACTION_FAILED_ERROR: (name: string) => string;
|
|
3
|
+
export declare const BEFORE_ACTION_FAILED_ERROR: (name: string) => string;
|
|
4
|
+
export declare const NO_STORE_FOUND_ERROR = "For setup store, you should set `store` first.";
|
|
5
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/hub/namespaces/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,SAAU,MAAM,WACsB,CAAC;AAE1E,eAAO,MAAM,2BAA2B,SAAU,MAAM,WACZ,CAAC;AAE7C,eAAO,MAAM,0BAA0B,SAAU,MAAM,WACS,CAAC;AAEjE,eAAO,MAAM,oBAAoB,mDACiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/hub/namespaces/mod.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,KAAK,EACL,iBAAiB,IAAI,UAAU,EAC/B,OAAO,EACP,OAAO,GACR,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|