@ckb-ccc/connector-react 0.0.17-alpha.6 → 0.0.17-alpha.8
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 +57 -44
- package/README.md +6 -26
- package/dist/hooks/useCcc.d.ts +2 -0
- package/dist/hooks/useCcc.d.ts.map +1 -1
- package/dist/hooks/useCcc.js +11 -5
- package/package.json +4 -4
- package/src/hooks/useCcc.tsx +14 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @ckb-ccc/connector-react
|
|
2
2
|
|
|
3
|
+
## 0.0.17-alpha.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @ckb-ccc/connector@0.0.17-alpha.7
|
|
9
|
+
|
|
10
|
+
## 0.0.17-alpha.7
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#78](https://github.com/ckb-devrel/ccc/pull/78) [`517dd3a`](https://github.com/ckb-devrel/ccc/commit/517dd3a28a0d6bf14df68450101f82e94a230801) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(connector-react): useCcc().isOpen
|
|
15
|
+
|
|
3
16
|
## 0.0.17-alpha.6
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -18,20 +31,20 @@
|
|
|
18
31
|
|
|
19
32
|
### Patch Changes
|
|
20
33
|
|
|
21
|
-
- [#70](https://github.com/ckb-
|
|
34
|
+
- [#70](https://github.com/ckb-devrel/ccc/pull/70) [`acfc050`](https://github.com/ckb-devrel/ccc/commit/acfc0502cd6beb48b9310dec8411dcd630507366) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(core): websocket transport
|
|
22
35
|
|
|
23
|
-
- Updated dependencies [[`acfc050`](https://github.com/ckb-
|
|
36
|
+
- Updated dependencies [[`acfc050`](https://github.com/ckb-devrel/ccc/commit/acfc0502cd6beb48b9310dec8411dcd630507366)]:
|
|
24
37
|
- @ckb-ccc/connector@0.0.17-alpha.4
|
|
25
38
|
|
|
26
39
|
## 0.0.17-alpha.3
|
|
27
40
|
|
|
28
41
|
### Patch Changes
|
|
29
42
|
|
|
30
|
-
- [#69](https://github.com/ckb-
|
|
43
|
+
- [#69](https://github.com/ckb-devrel/ccc/pull/69) [`8824ff2`](https://github.com/ckb-devrel/ccc/commit/8824ff27af3b76186f1a7d6db8c907cd66f09d6a) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): Client.waitTransaction
|
|
31
44
|
|
|
32
|
-
- [#67](https://github.com/ckb-
|
|
45
|
+
- [#67](https://github.com/ckb-devrel/ccc/pull/67) [`c092988`](https://github.com/ckb-devrel/ccc/commit/c092988e7765b9ac79498d6bd72a6a2f62859b6f) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): auto fee rate
|
|
33
46
|
|
|
34
|
-
- Updated dependencies [[`8824ff2`](https://github.com/ckb-
|
|
47
|
+
- Updated dependencies [[`8824ff2`](https://github.com/ckb-devrel/ccc/commit/8824ff27af3b76186f1a7d6db8c907cd66f09d6a), [`c092988`](https://github.com/ckb-devrel/ccc/commit/c092988e7765b9ac79498d6bd72a6a2f62859b6f)]:
|
|
35
48
|
- @ckb-ccc/connector@0.0.17-alpha.3
|
|
36
49
|
|
|
37
50
|
## 0.0.17-alpha.2
|
|
@@ -45,18 +58,18 @@
|
|
|
45
58
|
|
|
46
59
|
### Patch Changes
|
|
47
60
|
|
|
48
|
-
- [#62](https://github.com/ckb-
|
|
61
|
+
- [#62](https://github.com/ckb-devrel/ccc/pull/62) [`543c765`](https://github.com/ckb-devrel/ccc/commit/543c76523b3864f2203631762c27b8fc4c942cd7) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(connector): Powered by CCC
|
|
49
62
|
|
|
50
|
-
- Updated dependencies [[`543c765`](https://github.com/ckb-
|
|
63
|
+
- Updated dependencies [[`543c765`](https://github.com/ckb-devrel/ccc/commit/543c76523b3864f2203631762c27b8fc4c942cd7)]:
|
|
51
64
|
- @ckb-ccc/connector@0.0.17-alpha.1
|
|
52
65
|
|
|
53
66
|
## 0.0.17-alpha.0
|
|
54
67
|
|
|
55
68
|
### Patch Changes
|
|
56
69
|
|
|
57
|
-
- [#60](https://github.com/ckb-
|
|
70
|
+
- [#60](https://github.com/ckb-devrel/ccc/pull/60) [`e904963`](https://github.com/ckb-devrel/ccc/commit/e904963a16f12c410d861eb3ae01b87d68cb3e34) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat: support Xverse
|
|
58
71
|
|
|
59
|
-
- Updated dependencies [[`e904963`](https://github.com/ckb-
|
|
72
|
+
- Updated dependencies [[`e904963`](https://github.com/ckb-devrel/ccc/commit/e904963a16f12c410d861eb3ae01b87d68cb3e34)]:
|
|
60
73
|
- @ckb-ccc/connector@0.0.17-alpha.0
|
|
61
74
|
|
|
62
75
|
## 0.0.16
|
|
@@ -70,53 +83,53 @@
|
|
|
70
83
|
|
|
71
84
|
### Patch Changes
|
|
72
85
|
|
|
73
|
-
- [`2483637`](https://github.com/ckb-
|
|
86
|
+
- [`2483637`](https://github.com/ckb-devrel/ccc/commit/2483637c89a2e012ed6408d8cabc123b8a45faa9) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(connector): animation
|
|
74
87
|
|
|
75
|
-
- Updated dependencies [[`2483637`](https://github.com/ckb-
|
|
88
|
+
- Updated dependencies [[`2483637`](https://github.com/ckb-devrel/ccc/commit/2483637c89a2e012ed6408d8cabc123b8a45faa9)]:
|
|
76
89
|
- @ckb-ccc/connector@0.0.15
|
|
77
90
|
|
|
78
91
|
## 0.0.14
|
|
79
92
|
|
|
80
93
|
### Patch Changes
|
|
81
94
|
|
|
82
|
-
- [#56](https://github.com/ckb-
|
|
95
|
+
- [#56](https://github.com/ckb-devrel/ccc/pull/56) [`b4aa690`](https://github.com/ckb-devrel/ccc/commit/b4aa69085d69fc0953629fd907212922d7d106dd) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(connector): manage button
|
|
83
96
|
|
|
84
|
-
- [#56](https://github.com/ckb-
|
|
97
|
+
- [#56](https://github.com/ckb-devrel/ccc/pull/56) [`f13f4d3`](https://github.com/ckb-devrel/ccc/commit/f13f4d319ca66b571029a65e945e3a038bfeea25) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): Signer.findTransactions
|
|
85
98
|
|
|
86
|
-
- [#48](https://github.com/ckb-
|
|
99
|
+
- [#48](https://github.com/ckb-devrel/ccc/pull/48) [`4fb114b`](https://github.com/ckb-devrel/ccc/commit/4fb114bc421c7250eed7388c16f1c026875153e6) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(okx): make okx wallet happy
|
|
87
100
|
|
|
88
|
-
- [#54](https://github.com/ckb-
|
|
101
|
+
- [#54](https://github.com/ckb-devrel/ccc/pull/54) [`3f49876`](https://github.com/ckb-devrel/ccc/commit/3f49876826f5a9eeff8d14c7d8d7b9cf2cea0f32) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(connector): useless back button
|
|
89
102
|
|
|
90
|
-
- [#53](https://github.com/ckb-
|
|
103
|
+
- [#53](https://github.com/ckb-devrel/ccc/pull/53) [`32bffff`](https://github.com/ckb-devrel/ccc/commit/32bffff407934ec5d16bf7c5701b128d8b29c452) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(connector): select client
|
|
91
104
|
|
|
92
|
-
- Updated dependencies [[`b4aa690`](https://github.com/ckb-
|
|
105
|
+
- Updated dependencies [[`b4aa690`](https://github.com/ckb-devrel/ccc/commit/b4aa69085d69fc0953629fd907212922d7d106dd), [`f13f4d3`](https://github.com/ckb-devrel/ccc/commit/f13f4d319ca66b571029a65e945e3a038bfeea25), [`4fb114b`](https://github.com/ckb-devrel/ccc/commit/4fb114bc421c7250eed7388c16f1c026875153e6), [`3f49876`](https://github.com/ckb-devrel/ccc/commit/3f49876826f5a9eeff8d14c7d8d7b9cf2cea0f32), [`32bffff`](https://github.com/ckb-devrel/ccc/commit/32bffff407934ec5d16bf7c5701b128d8b29c452)]:
|
|
93
106
|
- @ckb-ccc/connector@0.0.14
|
|
94
107
|
|
|
95
108
|
## 0.0.14-alpha.3
|
|
96
109
|
|
|
97
110
|
### Patch Changes
|
|
98
111
|
|
|
99
|
-
- [#54](https://github.com/ckb-
|
|
112
|
+
- [#54](https://github.com/ckb-devrel/ccc/pull/54) [`3f49876`](https://github.com/ckb-devrel/ccc/commit/3f49876826f5a9eeff8d14c7d8d7b9cf2cea0f32) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(connector): useless back button
|
|
100
113
|
|
|
101
|
-
- Updated dependencies [[`3f49876`](https://github.com/ckb-
|
|
114
|
+
- Updated dependencies [[`3f49876`](https://github.com/ckb-devrel/ccc/commit/3f49876826f5a9eeff8d14c7d8d7b9cf2cea0f32)]:
|
|
102
115
|
- @ckb-ccc/connector@0.0.14-alpha.3
|
|
103
116
|
|
|
104
117
|
## 0.0.14-alpha.2
|
|
105
118
|
|
|
106
119
|
### Patch Changes
|
|
107
120
|
|
|
108
|
-
- [#53](https://github.com/ckb-
|
|
121
|
+
- [#53](https://github.com/ckb-devrel/ccc/pull/53) [`32bffff`](https://github.com/ckb-devrel/ccc/commit/32bffff407934ec5d16bf7c5701b128d8b29c452) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(connector): select client
|
|
109
122
|
|
|
110
|
-
- Updated dependencies [[`32bffff`](https://github.com/ckb-
|
|
123
|
+
- Updated dependencies [[`32bffff`](https://github.com/ckb-devrel/ccc/commit/32bffff407934ec5d16bf7c5701b128d8b29c452)]:
|
|
111
124
|
- @ckb-ccc/connector@0.0.14-alpha.2
|
|
112
125
|
|
|
113
126
|
## 0.0.14-alpha.1
|
|
114
127
|
|
|
115
128
|
### Patch Changes
|
|
116
129
|
|
|
117
|
-
- [#48](https://github.com/ckb-
|
|
130
|
+
- [#48](https://github.com/ckb-devrel/ccc/pull/48) [`4fb114b`](https://github.com/ckb-devrel/ccc/commit/4fb114bc421c7250eed7388c16f1c026875153e6) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(okx): make okx wallet happy
|
|
118
131
|
|
|
119
|
-
- Updated dependencies [[`4fb114b`](https://github.com/ckb-
|
|
132
|
+
- Updated dependencies [[`4fb114b`](https://github.com/ckb-devrel/ccc/commit/4fb114bc421c7250eed7388c16f1c026875153e6)]:
|
|
120
133
|
- @ckb-ccc/connector@0.0.14-alpha.1
|
|
121
134
|
|
|
122
135
|
## 0.0.14-alpha.0
|
|
@@ -130,21 +143,21 @@
|
|
|
130
143
|
|
|
131
144
|
### Patch Changes
|
|
132
145
|
|
|
133
|
-
- [`9e6b9fd`](https://github.com/ckb-
|
|
146
|
+
- [`9e6b9fd`](https://github.com/ckb-devrel/ccc/commit/9e6b9fd40274015a0964dec8e0ee58dcbc06c786) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(connector-react): if the filter is undefined, accept all
|
|
134
147
|
|
|
135
|
-
- [`6d62032`](https://github.com/ckb-
|
|
148
|
+
- [`6d62032`](https://github.com/ckb-devrel/ccc/commit/6d620326f42f8c48eff9deb95578cf28d7bf5c97) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(core): recordCells should not add usableCells
|
|
136
149
|
|
|
137
|
-
- [`3658797`](https://github.com/ckb-
|
|
150
|
+
- [`3658797`](https://github.com/ckb-devrel/ccc/commit/3658797e67c42c56b20fa66481d0455ed019e69f) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): node.js websocket
|
|
138
151
|
|
|
139
|
-
- [#25](https://github.com/ckb-
|
|
152
|
+
- [#25](https://github.com/ckb-devrel/ccc/pull/25) [`69c10fd`](https://github.com/ckb-devrel/ccc/commit/69c10fdfcd507433c13b15d17015dca4687afb97) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(utxo-global): switchNetwork
|
|
140
153
|
|
|
141
|
-
- [`44c7fee`](https://github.com/ckb-
|
|
154
|
+
- [`44c7fee`](https://github.com/ckb-devrel/ccc/commit/44c7feed37369836268fba21884418682f15254b) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(core): completeInputs
|
|
142
155
|
|
|
143
|
-
- [`079e20e`](https://github.com/ckb-
|
|
156
|
+
- [`079e20e`](https://github.com/ckb-devrel/ccc/commit/079e20ef14cf9a7c06bbaddf3e92cbfbb005da11) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): more APIs. Since parsing.
|
|
144
157
|
|
|
145
|
-
- [`ed154d1`](https://github.com/ckb-
|
|
158
|
+
- [`ed154d1`](https://github.com/ckb-devrel/ccc/commit/ed154d189e239907ad686ec51ac8133b6d5eb895) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): Signer.findCells
|
|
146
159
|
|
|
147
|
-
- Updated dependencies [[`6d62032`](https://github.com/ckb-
|
|
160
|
+
- Updated dependencies [[`6d62032`](https://github.com/ckb-devrel/ccc/commit/6d620326f42f8c48eff9deb95578cf28d7bf5c97), [`3658797`](https://github.com/ckb-devrel/ccc/commit/3658797e67c42c56b20fa66481d0455ed019e69f), [`69c10fd`](https://github.com/ckb-devrel/ccc/commit/69c10fdfcd507433c13b15d17015dca4687afb97), [`44c7fee`](https://github.com/ckb-devrel/ccc/commit/44c7feed37369836268fba21884418682f15254b), [`079e20e`](https://github.com/ckb-devrel/ccc/commit/079e20ef14cf9a7c06bbaddf3e92cbfbb005da11), [`ed154d1`](https://github.com/ckb-devrel/ccc/commit/ed154d189e239907ad686ec51ac8133b6d5eb895)]:
|
|
148
161
|
- @ckb-ccc/connector@0.0.13
|
|
149
162
|
|
|
150
163
|
## 0.0.13-alpha.8
|
|
@@ -158,42 +171,42 @@
|
|
|
158
171
|
|
|
159
172
|
### Patch Changes
|
|
160
173
|
|
|
161
|
-
- [`079e20e`](https://github.com/ckb-
|
|
174
|
+
- [`079e20e`](https://github.com/ckb-devrel/ccc/commit/079e20ef14cf9a7c06bbaddf3e92cbfbb005da11) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): more APIs. Since parsing.
|
|
162
175
|
|
|
163
|
-
- [`ed154d1`](https://github.com/ckb-
|
|
176
|
+
- [`ed154d1`](https://github.com/ckb-devrel/ccc/commit/ed154d189e239907ad686ec51ac8133b6d5eb895) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): Signer.findCells
|
|
164
177
|
|
|
165
|
-
- Updated dependencies [[`079e20e`](https://github.com/ckb-
|
|
178
|
+
- Updated dependencies [[`079e20e`](https://github.com/ckb-devrel/ccc/commit/079e20ef14cf9a7c06bbaddf3e92cbfbb005da11), [`ed154d1`](https://github.com/ckb-devrel/ccc/commit/ed154d189e239907ad686ec51ac8133b6d5eb895)]:
|
|
166
179
|
- @ckb-ccc/connector@0.0.13-alpha.7
|
|
167
180
|
|
|
168
181
|
## 0.0.13-alpha.6
|
|
169
182
|
|
|
170
183
|
### Patch Changes
|
|
171
184
|
|
|
172
|
-
- [#25](https://github.com/ckb-
|
|
185
|
+
- [#25](https://github.com/ckb-devrel/ccc/pull/25) [`69c10fd`](https://github.com/ckb-devrel/ccc/commit/69c10fdfcd507433c13b15d17015dca4687afb97) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(utxo-global): switchNetwork
|
|
173
186
|
|
|
174
|
-
- [`44c7fee`](https://github.com/ckb-
|
|
187
|
+
- [`44c7fee`](https://github.com/ckb-devrel/ccc/commit/44c7feed37369836268fba21884418682f15254b) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(core): completeInputs
|
|
175
188
|
|
|
176
|
-
- Updated dependencies [[`69c10fd`](https://github.com/ckb-
|
|
189
|
+
- Updated dependencies [[`69c10fd`](https://github.com/ckb-devrel/ccc/commit/69c10fdfcd507433c13b15d17015dca4687afb97), [`44c7fee`](https://github.com/ckb-devrel/ccc/commit/44c7feed37369836268fba21884418682f15254b)]:
|
|
177
190
|
- @ckb-ccc/connector@0.0.13-alpha.6
|
|
178
191
|
|
|
179
192
|
## 0.0.13-alpha.5
|
|
180
193
|
|
|
181
194
|
### Patch Changes
|
|
182
195
|
|
|
183
|
-
- [`9e6b9fd`](https://github.com/ckb-
|
|
196
|
+
- [`9e6b9fd`](https://github.com/ckb-devrel/ccc/commit/9e6b9fd40274015a0964dec8e0ee58dcbc06c786) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(connector-react): if the filter is undefined, accept all
|
|
184
197
|
|
|
185
|
-
- [`6d62032`](https://github.com/ckb-
|
|
198
|
+
- [`6d62032`](https://github.com/ckb-devrel/ccc/commit/6d620326f42f8c48eff9deb95578cf28d7bf5c97) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(core): recordCells should not add usableCells
|
|
186
199
|
|
|
187
|
-
- Updated dependencies [[`6d62032`](https://github.com/ckb-
|
|
200
|
+
- Updated dependencies [[`6d62032`](https://github.com/ckb-devrel/ccc/commit/6d620326f42f8c48eff9deb95578cf28d7bf5c97)]:
|
|
188
201
|
- @ckb-ccc/connector@0.0.13-alpha.5
|
|
189
202
|
|
|
190
203
|
## 0.0.13-alpha.4
|
|
191
204
|
|
|
192
205
|
### Patch Changes
|
|
193
206
|
|
|
194
|
-
- [`3658797`](https://github.com/ckb-
|
|
207
|
+
- [`3658797`](https://github.com/ckb-devrel/ccc/commit/3658797e67c42c56b20fa66481d0455ed019e69f) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): node.js websocket
|
|
195
208
|
|
|
196
|
-
- Updated dependencies [[`3658797`](https://github.com/ckb-
|
|
209
|
+
- Updated dependencies [[`3658797`](https://github.com/ckb-devrel/ccc/commit/3658797e67c42c56b20fa66481d0455ed019e69f)]:
|
|
197
210
|
- @ckb-ccc/connector@0.0.13-alpha.4
|
|
198
211
|
|
|
199
212
|
## 0.0.13-alpha.3
|
|
@@ -228,9 +241,9 @@
|
|
|
228
241
|
|
|
229
242
|
### Patch Changes
|
|
230
243
|
|
|
231
|
-
- [`591e779`](https://github.com/ckb-
|
|
244
|
+
- [`591e779`](https://github.com/ckb-devrel/ccc/commit/591e7794ce3d07ceaad55b7a80d2277fe0aa9fe7) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat: custom SignersController
|
|
232
245
|
|
|
233
|
-
- Updated dependencies [[`6bee006`](https://github.com/ckb-
|
|
246
|
+
- Updated dependencies [[`6bee006`](https://github.com/ckb-devrel/ccc/commit/6bee006fbcb96986c65ca4d2d896fca21db2503b), [`591e779`](https://github.com/ckb-devrel/ccc/commit/591e7794ce3d07ceaad55b7a80d2277fe0aa9fe7)]:
|
|
234
247
|
- @ckb-ccc/connector@0.0.12
|
|
235
248
|
|
|
236
249
|
## 0.0.12-alpha.7
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<a href="https://app.ckbccc.com/">
|
|
3
|
-
<img alt="Logo" src="https://raw.githubusercontent.com/ckb-
|
|
3
|
+
<img alt="Logo" src="https://raw.githubusercontent.com/ckb-devrel/ccc/master/assets/logoAndText.svg" style="height: 8rem; max-width: 90%; padding: 0.5rem 0;" />
|
|
4
4
|
</a>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
<a href="https://www.npmjs.com/package/@ckb-ccc/connector-react"><img
|
|
13
13
|
alt="NPM Version" src="https://img.shields.io/npm/v/%40ckb-ccc%2Fconnector-react"
|
|
14
14
|
/></a>
|
|
15
|
-
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/ckb-
|
|
16
|
-
<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/ckb-
|
|
17
|
-
<img alt="GitHub branch check runs" src="https://img.shields.io/github/check-runs/ckb-
|
|
15
|
+
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/ckb-devrel/ccc" />
|
|
16
|
+
<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/ckb-devrel/ccc/master" />
|
|
17
|
+
<img alt="GitHub branch check runs" src="https://img.shields.io/github/check-runs/ckb-devrel/ccc/master" />
|
|
18
18
|
<a href="https://live.ckbccc.com/"><img
|
|
19
19
|
alt="Playground" src="https://img.shields.io/website?url=https%3A%2F%2Flive.ckbccc.com%2F&label=Playground"
|
|
20
20
|
/></a>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
</p>
|
|
28
28
|
|
|
29
29
|
<p align="center">
|
|
30
|
-
|
|
30
|
+
CCC - CKBers' Codebase is a one-stop solution for your CKB JS/TS ecosystem development.
|
|
31
31
|
<br />
|
|
32
32
|
Empower yourself with CCC to discover the unlimited potential of CKB.
|
|
33
33
|
<br />
|
|
@@ -36,26 +36,6 @@
|
|
|
36
36
|
Fully enabling CKB's Turing completeness and cryptographic freedom power.
|
|
37
37
|
</p>
|
|
38
38
|
|
|
39
|
-
## Playground
|
|
40
|
-
|
|
41
|
-
<p align="center">
|
|
42
|
-
<a href="https://live.ckbccc.com/">
|
|
43
|
-
<img src="https://raw.githubusercontent.com/ckb-ecofund/ccc/master/assets/preview.png" width="90%" />
|
|
44
|
-
</a>
|
|
45
|
-
</p>
|
|
46
|
-
|
|
47
|
-
This project is still under active development, and we are looking forward to your feedback. You can [experiment instantly in the playground](https://live.ckbccc.com/). If you are new to the CKB, we recommend checking [Nervos CKB Docs](https://docs.nervos.org/) for basic knowledge.
|
|
48
|
-
|
|
49
|
-
## App
|
|
50
|
-
|
|
51
|
-
<p align="center">
|
|
52
|
-
<a href="https://app.ckbccc.com/">
|
|
53
|
-
<img src="https://raw.githubusercontent.com/ckb-ecofund/ccc/master/assets/appPreview.png" width="50%" />
|
|
54
|
-
</a>
|
|
55
|
-
</p>
|
|
56
|
-
|
|
57
|
-
For non-developers, you can also [try CCC's app now here](https://app.ckbccc.com/). It showcases how to use CCC for some basic scenarios in CKB.
|
|
58
|
-
|
|
59
39
|
## Use the Connector UI
|
|
60
40
|
|
|
61
41
|
Before using the Connector, wrap your UI with the CCC Provider:
|
|
@@ -67,5 +47,5 @@ Before using the Connector, wrap your UI with the CCC Provider:
|
|
|
67
47
|
Check [the document for @ckb-ccc/connector-react](https://docs.ckbccc.com/modules/_ckb_ccc_connector_react.index.ccc.html) for more information.
|
|
68
48
|
|
|
69
49
|
<h3 align="center">
|
|
70
|
-
Read more about CCC on <a href="https://docs.ckbccc.com">our website</a> or <a href="https://github.com/ckb-
|
|
50
|
+
Read more about CCC on <a href="https://docs.ckbccc.com">our website</a> or <a href="https://github.com/ckb-devrel/ccc">GitHub Repo</a>.
|
|
71
51
|
</h3>
|
package/dist/hooks/useCcc.d.ts
CHANGED
|
@@ -17,7 +17,9 @@ export declare function Provider({ children, connectorProps, hideMark, name, ico
|
|
|
17
17
|
preferredNetworks?: ccc.NetworkPreference[];
|
|
18
18
|
}): React.JSX.Element;
|
|
19
19
|
export declare function useCcc(): {
|
|
20
|
+
isOpen: boolean;
|
|
20
21
|
open: () => unknown;
|
|
22
|
+
close: () => unknown;
|
|
21
23
|
disconnect: () => unknown;
|
|
22
24
|
setClient: (client: ccc.Client) => unknown;
|
|
23
25
|
client: ccc.Client;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCcc.d.ts","sourceRoot":"","sources":["../../src/hooks/useCcc.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,KAAK,EAAE,EAEZ,cAAc,EACd,SAAS,EAQV,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useCcc.d.ts","sourceRoot":"","sources":["../../src/hooks/useCcc.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,KAAK,EAAE,EAEZ,cAAc,EACd,SAAS,EAQV,MAAM,OAAO,CAAC;AA4Cf,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,iBAAiB,GAClB,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,cAAc,CAAC,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,CACb,UAAU,EAAE,GAAG,CAAC,UAAU,EAC1B,MAAM,EAAE,GAAG,CAAC,MAAM,KACf,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB,iBAAiB,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC;IAC1C,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACtE,iBAAiB,CAAC,EAAE,GAAG,CAAC,iBAAiB,EAAE,CAAC;CAC7C,qBA8FA;AAED,wBAAgB,MAAM;YAhKR,OAAO;UACT,MAAM,OAAO;WACZ,MAAM,OAAO;gBACR,MAAM,OAAO;eACd,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,KAAK,OAAO;YAClC,GAAG,CAAC,MAAM;aACT,GAAG,CAAC,MAAM;iBACN,GAAG,CAAC,UAAU;EAiKhC"}
|
package/dist/hooks/useCcc.js
CHANGED
|
@@ -19,12 +19,16 @@ export function Provider({ children, connectorProps, hideMark, name, icon, signe
|
|
|
19
19
|
const [ref, setRef] = useState(null);
|
|
20
20
|
const [isOpen, setIsOpen] = useState(false);
|
|
21
21
|
const [_, setFlag] = useState(0);
|
|
22
|
-
const
|
|
22
|
+
const defaultSignersController = useRef(undefined);
|
|
23
23
|
const client = useMemo(() => ref?.client ?? new ccc.ClientPublicTestnet(), [ref?.client]);
|
|
24
24
|
const open = useCallback(() => {
|
|
25
25
|
setIsOpen(true);
|
|
26
26
|
ref?.requestUpdate();
|
|
27
27
|
}, [setIsOpen, ref, ref?.requestUpdate]);
|
|
28
|
+
const close = useCallback(() => {
|
|
29
|
+
setIsOpen(false);
|
|
30
|
+
ref?.requestUpdate();
|
|
31
|
+
}, [setIsOpen, ref, ref?.requestUpdate]);
|
|
28
32
|
const disconnect = useMemo(() => ref?.disconnect.bind(ref) ?? (() => { }), [ref, ref?.disconnect]);
|
|
29
33
|
const setClient = useMemo(() => ref?.setClient.bind(ref) ?? (() => { }), [ref, ref?.setClient]);
|
|
30
34
|
useEffect(() => {
|
|
@@ -33,22 +37,24 @@ export function Provider({ children, connectorProps, hideMark, name, icon, signe
|
|
|
33
37
|
}
|
|
34
38
|
}, [setClient]);
|
|
35
39
|
useEffect(() => {
|
|
36
|
-
if (!
|
|
37
|
-
|
|
40
|
+
if (!defaultSignersController.current) {
|
|
41
|
+
defaultSignersController.current = new SignersControllerWithFilter(signerFilter);
|
|
38
42
|
}
|
|
39
43
|
else {
|
|
40
|
-
|
|
44
|
+
defaultSignersController.current.filter = signerFilter;
|
|
41
45
|
}
|
|
42
46
|
}, [signerFilter]);
|
|
43
47
|
return (React.createElement(CCC_CONTEXT.Provider, { value: {
|
|
48
|
+
isOpen,
|
|
44
49
|
open,
|
|
50
|
+
close,
|
|
45
51
|
disconnect,
|
|
46
52
|
setClient,
|
|
47
53
|
client,
|
|
48
54
|
wallet: ref?.wallet,
|
|
49
55
|
signerInfo: ref?.signer,
|
|
50
56
|
} },
|
|
51
|
-
React.createElement(Connector, { hideMark: hideMark, name: name, icon: icon, signersController: signersController ??
|
|
57
|
+
React.createElement(Connector, { hideMark: hideMark, name: name, icon: icon, signersController: signersController ?? defaultSignersController.current, ref: setRef, onWillUpdate: () => setFlag((f) => f + 1), onClose: close, preferredNetworks: preferredNetworks, clientOptions: clientOptions, ...connectorProps,
|
|
52
58
|
style: {
|
|
53
59
|
zIndex: 999,
|
|
54
60
|
...(isOpen ? {} : { display: "none" }),
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckb-ccc/connector-react",
|
|
3
|
-
"version": "0.0.17-alpha.
|
|
3
|
+
"version": "0.0.17-alpha.8",
|
|
4
4
|
"description": "CCC - CKBer's Codebase. Common Chains Connector UI Component for React",
|
|
5
5
|
"author": "Hanssen0 <hanssen0@hanssen0.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"private": false,
|
|
8
|
-
"homepage": "https://github.com/ckb-
|
|
8
|
+
"homepage": "https://github.com/ckb-devrel/ccc",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git://github.com/ckb-
|
|
11
|
+
"url": "git://github.com/ckb-devrel/ccc.git"
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
14
14
|
"main": "dist/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@lit/react": "^1.0.5",
|
|
38
|
-
"@ckb-ccc/connector": "0.0.17-alpha.
|
|
38
|
+
"@ckb-ccc/connector": "0.0.17-alpha.7"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react": ">=16"
|
package/src/hooks/useCcc.tsx
CHANGED
|
@@ -15,7 +15,9 @@ import { Connector } from "../components/index.js";
|
|
|
15
15
|
|
|
16
16
|
const CCC_CONTEXT = createContext<
|
|
17
17
|
| {
|
|
18
|
+
isOpen: boolean;
|
|
18
19
|
open: () => unknown;
|
|
20
|
+
close: () => unknown;
|
|
19
21
|
disconnect: () => unknown;
|
|
20
22
|
setClient: (client: ccc.Client) => unknown;
|
|
21
23
|
client: ccc.Client;
|
|
@@ -81,7 +83,7 @@ export function Provider({
|
|
|
81
83
|
const [ref, setRef] = useState<ccc.WebComponentConnector | null>(null);
|
|
82
84
|
const [isOpen, setIsOpen] = useState(false);
|
|
83
85
|
const [_, setFlag] = useState(0);
|
|
84
|
-
const
|
|
86
|
+
const defaultSignersController = useRef<
|
|
85
87
|
SignersControllerWithFilter | undefined
|
|
86
88
|
>(undefined);
|
|
87
89
|
|
|
@@ -93,6 +95,10 @@ export function Provider({
|
|
|
93
95
|
setIsOpen(true);
|
|
94
96
|
ref?.requestUpdate();
|
|
95
97
|
}, [setIsOpen, ref, ref?.requestUpdate]);
|
|
98
|
+
const close = useCallback(() => {
|
|
99
|
+
setIsOpen(false);
|
|
100
|
+
ref?.requestUpdate();
|
|
101
|
+
}, [setIsOpen, ref, ref?.requestUpdate]);
|
|
96
102
|
const disconnect = useMemo(
|
|
97
103
|
() => ref?.disconnect.bind(ref) ?? (() => {}),
|
|
98
104
|
[ref, ref?.disconnect],
|
|
@@ -108,19 +114,21 @@ export function Provider({
|
|
|
108
114
|
}
|
|
109
115
|
}, [setClient]);
|
|
110
116
|
useEffect(() => {
|
|
111
|
-
if (!
|
|
112
|
-
|
|
117
|
+
if (!defaultSignersController.current) {
|
|
118
|
+
defaultSignersController.current = new SignersControllerWithFilter(
|
|
113
119
|
signerFilter,
|
|
114
120
|
);
|
|
115
121
|
} else {
|
|
116
|
-
|
|
122
|
+
defaultSignersController.current.filter = signerFilter;
|
|
117
123
|
}
|
|
118
124
|
}, [signerFilter]);
|
|
119
125
|
|
|
120
126
|
return (
|
|
121
127
|
<CCC_CONTEXT.Provider
|
|
122
128
|
value={{
|
|
129
|
+
isOpen,
|
|
123
130
|
open,
|
|
131
|
+
close,
|
|
124
132
|
disconnect,
|
|
125
133
|
setClient,
|
|
126
134
|
|
|
@@ -134,11 +142,11 @@ export function Provider({
|
|
|
134
142
|
name={name}
|
|
135
143
|
icon={icon}
|
|
136
144
|
signersController={
|
|
137
|
-
signersController ??
|
|
145
|
+
signersController ?? defaultSignersController.current
|
|
138
146
|
}
|
|
139
147
|
ref={setRef}
|
|
140
148
|
onWillUpdate={() => setFlag((f) => f + 1)}
|
|
141
|
-
onClose={
|
|
149
|
+
onClose={close}
|
|
142
150
|
preferredNetworks={preferredNetworks}
|
|
143
151
|
clientOptions={clientOptions}
|
|
144
152
|
{...{
|