@ckb-ccc/connector-react 0.0.17-alpha.1 → 0.0.17-alpha.10
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 +107 -39
- package/README.md +6 -26
- package/dist/hooks/useCcc.d.ts +4 -2
- package/dist/hooks/useCcc.d.ts.map +1 -1
- package/dist/hooks/useCcc.js +11 -5
- package/package.json +6 -6
- package/src/hooks/useCcc.tsx +15 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,89 @@
|
|
|
1
1
|
# @ckb-ccc/connector-react
|
|
2
2
|
|
|
3
|
+
## 0.0.17-alpha.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @ckb-ccc/connector@0.0.17-alpha.9
|
|
9
|
+
|
|
10
|
+
## 0.0.17-alpha.9
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies []:
|
|
15
|
+
- @ckb-ccc/connector@0.0.17-alpha.8
|
|
16
|
+
|
|
17
|
+
## 0.0.17-alpha.8
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies []:
|
|
22
|
+
- @ckb-ccc/connector@0.0.17-alpha.7
|
|
23
|
+
|
|
24
|
+
## 0.0.17-alpha.7
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- [#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
|
|
29
|
+
|
|
30
|
+
## 0.0.17-alpha.6
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- Updated dependencies []:
|
|
35
|
+
- @ckb-ccc/connector@0.0.17-alpha.6
|
|
36
|
+
|
|
37
|
+
## 0.0.17-alpha.5
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies []:
|
|
42
|
+
- @ckb-ccc/connector@0.0.17-alpha.5
|
|
43
|
+
|
|
44
|
+
## 0.0.17-alpha.4
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- [#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
|
|
49
|
+
|
|
50
|
+
- Updated dependencies [[`acfc050`](https://github.com/ckb-devrel/ccc/commit/acfc0502cd6beb48b9310dec8411dcd630507366)]:
|
|
51
|
+
- @ckb-ccc/connector@0.0.17-alpha.4
|
|
52
|
+
|
|
53
|
+
## 0.0.17-alpha.3
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- [#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
|
|
58
|
+
|
|
59
|
+
- [#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
|
|
60
|
+
|
|
61
|
+
- Updated dependencies [[`8824ff2`](https://github.com/ckb-devrel/ccc/commit/8824ff27af3b76186f1a7d6db8c907cd66f09d6a), [`c092988`](https://github.com/ckb-devrel/ccc/commit/c092988e7765b9ac79498d6bd72a6a2f62859b6f)]:
|
|
62
|
+
- @ckb-ccc/connector@0.0.17-alpha.3
|
|
63
|
+
|
|
64
|
+
## 0.0.17-alpha.2
|
|
65
|
+
|
|
66
|
+
### Patch Changes
|
|
67
|
+
|
|
68
|
+
- Updated dependencies []:
|
|
69
|
+
- @ckb-ccc/connector@0.0.17-alpha.2
|
|
70
|
+
|
|
3
71
|
## 0.0.17-alpha.1
|
|
4
72
|
|
|
5
73
|
### Patch Changes
|
|
6
74
|
|
|
7
|
-
- [#62](https://github.com/ckb-
|
|
75
|
+
- [#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
|
|
8
76
|
|
|
9
|
-
- Updated dependencies [[`543c765`](https://github.com/ckb-
|
|
77
|
+
- Updated dependencies [[`543c765`](https://github.com/ckb-devrel/ccc/commit/543c76523b3864f2203631762c27b8fc4c942cd7)]:
|
|
10
78
|
- @ckb-ccc/connector@0.0.17-alpha.1
|
|
11
79
|
|
|
12
80
|
## 0.0.17-alpha.0
|
|
13
81
|
|
|
14
82
|
### Patch Changes
|
|
15
83
|
|
|
16
|
-
- [#60](https://github.com/ckb-
|
|
84
|
+
- [#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
|
|
17
85
|
|
|
18
|
-
- Updated dependencies [[`e904963`](https://github.com/ckb-
|
|
86
|
+
- Updated dependencies [[`e904963`](https://github.com/ckb-devrel/ccc/commit/e904963a16f12c410d861eb3ae01b87d68cb3e34)]:
|
|
19
87
|
- @ckb-ccc/connector@0.0.17-alpha.0
|
|
20
88
|
|
|
21
89
|
## 0.0.16
|
|
@@ -29,53 +97,53 @@
|
|
|
29
97
|
|
|
30
98
|
### Patch Changes
|
|
31
99
|
|
|
32
|
-
- [`2483637`](https://github.com/ckb-
|
|
100
|
+
- [`2483637`](https://github.com/ckb-devrel/ccc/commit/2483637c89a2e012ed6408d8cabc123b8a45faa9) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(connector): animation
|
|
33
101
|
|
|
34
|
-
- Updated dependencies [[`2483637`](https://github.com/ckb-
|
|
102
|
+
- Updated dependencies [[`2483637`](https://github.com/ckb-devrel/ccc/commit/2483637c89a2e012ed6408d8cabc123b8a45faa9)]:
|
|
35
103
|
- @ckb-ccc/connector@0.0.15
|
|
36
104
|
|
|
37
105
|
## 0.0.14
|
|
38
106
|
|
|
39
107
|
### Patch Changes
|
|
40
108
|
|
|
41
|
-
- [#56](https://github.com/ckb-
|
|
109
|
+
- [#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
|
|
42
110
|
|
|
43
|
-
- [#56](https://github.com/ckb-
|
|
111
|
+
- [#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
|
|
44
112
|
|
|
45
|
-
- [#48](https://github.com/ckb-
|
|
113
|
+
- [#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
|
|
46
114
|
|
|
47
|
-
- [#54](https://github.com/ckb-
|
|
115
|
+
- [#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
|
|
48
116
|
|
|
49
|
-
- [#53](https://github.com/ckb-
|
|
117
|
+
- [#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
|
|
50
118
|
|
|
51
|
-
- Updated dependencies [[`b4aa690`](https://github.com/ckb-
|
|
119
|
+
- 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)]:
|
|
52
120
|
- @ckb-ccc/connector@0.0.14
|
|
53
121
|
|
|
54
122
|
## 0.0.14-alpha.3
|
|
55
123
|
|
|
56
124
|
### Patch Changes
|
|
57
125
|
|
|
58
|
-
- [#54](https://github.com/ckb-
|
|
126
|
+
- [#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
|
|
59
127
|
|
|
60
|
-
- Updated dependencies [[`3f49876`](https://github.com/ckb-
|
|
128
|
+
- Updated dependencies [[`3f49876`](https://github.com/ckb-devrel/ccc/commit/3f49876826f5a9eeff8d14c7d8d7b9cf2cea0f32)]:
|
|
61
129
|
- @ckb-ccc/connector@0.0.14-alpha.3
|
|
62
130
|
|
|
63
131
|
## 0.0.14-alpha.2
|
|
64
132
|
|
|
65
133
|
### Patch Changes
|
|
66
134
|
|
|
67
|
-
- [#53](https://github.com/ckb-
|
|
135
|
+
- [#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
|
|
68
136
|
|
|
69
|
-
- Updated dependencies [[`32bffff`](https://github.com/ckb-
|
|
137
|
+
- Updated dependencies [[`32bffff`](https://github.com/ckb-devrel/ccc/commit/32bffff407934ec5d16bf7c5701b128d8b29c452)]:
|
|
70
138
|
- @ckb-ccc/connector@0.0.14-alpha.2
|
|
71
139
|
|
|
72
140
|
## 0.0.14-alpha.1
|
|
73
141
|
|
|
74
142
|
### Patch Changes
|
|
75
143
|
|
|
76
|
-
- [#48](https://github.com/ckb-
|
|
144
|
+
- [#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
|
|
77
145
|
|
|
78
|
-
- Updated dependencies [[`4fb114b`](https://github.com/ckb-
|
|
146
|
+
- Updated dependencies [[`4fb114b`](https://github.com/ckb-devrel/ccc/commit/4fb114bc421c7250eed7388c16f1c026875153e6)]:
|
|
79
147
|
- @ckb-ccc/connector@0.0.14-alpha.1
|
|
80
148
|
|
|
81
149
|
## 0.0.14-alpha.0
|
|
@@ -89,21 +157,21 @@
|
|
|
89
157
|
|
|
90
158
|
### Patch Changes
|
|
91
159
|
|
|
92
|
-
- [`9e6b9fd`](https://github.com/ckb-
|
|
160
|
+
- [`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
|
|
93
161
|
|
|
94
|
-
- [`6d62032`](https://github.com/ckb-
|
|
162
|
+
- [`6d62032`](https://github.com/ckb-devrel/ccc/commit/6d620326f42f8c48eff9deb95578cf28d7bf5c97) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(core): recordCells should not add usableCells
|
|
95
163
|
|
|
96
|
-
- [`3658797`](https://github.com/ckb-
|
|
164
|
+
- [`3658797`](https://github.com/ckb-devrel/ccc/commit/3658797e67c42c56b20fa66481d0455ed019e69f) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): node.js websocket
|
|
97
165
|
|
|
98
|
-
- [#25](https://github.com/ckb-
|
|
166
|
+
- [#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
|
|
99
167
|
|
|
100
|
-
- [`44c7fee`](https://github.com/ckb-
|
|
168
|
+
- [`44c7fee`](https://github.com/ckb-devrel/ccc/commit/44c7feed37369836268fba21884418682f15254b) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(core): completeInputs
|
|
101
169
|
|
|
102
|
-
- [`079e20e`](https://github.com/ckb-
|
|
170
|
+
- [`079e20e`](https://github.com/ckb-devrel/ccc/commit/079e20ef14cf9a7c06bbaddf3e92cbfbb005da11) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): more APIs. Since parsing.
|
|
103
171
|
|
|
104
|
-
- [`ed154d1`](https://github.com/ckb-
|
|
172
|
+
- [`ed154d1`](https://github.com/ckb-devrel/ccc/commit/ed154d189e239907ad686ec51ac8133b6d5eb895) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): Signer.findCells
|
|
105
173
|
|
|
106
|
-
- Updated dependencies [[`6d62032`](https://github.com/ckb-
|
|
174
|
+
- 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)]:
|
|
107
175
|
- @ckb-ccc/connector@0.0.13
|
|
108
176
|
|
|
109
177
|
## 0.0.13-alpha.8
|
|
@@ -117,42 +185,42 @@
|
|
|
117
185
|
|
|
118
186
|
### Patch Changes
|
|
119
187
|
|
|
120
|
-
- [`079e20e`](https://github.com/ckb-
|
|
188
|
+
- [`079e20e`](https://github.com/ckb-devrel/ccc/commit/079e20ef14cf9a7c06bbaddf3e92cbfbb005da11) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): more APIs. Since parsing.
|
|
121
189
|
|
|
122
|
-
- [`ed154d1`](https://github.com/ckb-
|
|
190
|
+
- [`ed154d1`](https://github.com/ckb-devrel/ccc/commit/ed154d189e239907ad686ec51ac8133b6d5eb895) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): Signer.findCells
|
|
123
191
|
|
|
124
|
-
- Updated dependencies [[`079e20e`](https://github.com/ckb-
|
|
192
|
+
- Updated dependencies [[`079e20e`](https://github.com/ckb-devrel/ccc/commit/079e20ef14cf9a7c06bbaddf3e92cbfbb005da11), [`ed154d1`](https://github.com/ckb-devrel/ccc/commit/ed154d189e239907ad686ec51ac8133b6d5eb895)]:
|
|
125
193
|
- @ckb-ccc/connector@0.0.13-alpha.7
|
|
126
194
|
|
|
127
195
|
## 0.0.13-alpha.6
|
|
128
196
|
|
|
129
197
|
### Patch Changes
|
|
130
198
|
|
|
131
|
-
- [#25](https://github.com/ckb-
|
|
199
|
+
- [#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
|
|
132
200
|
|
|
133
|
-
- [`44c7fee`](https://github.com/ckb-
|
|
201
|
+
- [`44c7fee`](https://github.com/ckb-devrel/ccc/commit/44c7feed37369836268fba21884418682f15254b) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(core): completeInputs
|
|
134
202
|
|
|
135
|
-
- Updated dependencies [[`69c10fd`](https://github.com/ckb-
|
|
203
|
+
- Updated dependencies [[`69c10fd`](https://github.com/ckb-devrel/ccc/commit/69c10fdfcd507433c13b15d17015dca4687afb97), [`44c7fee`](https://github.com/ckb-devrel/ccc/commit/44c7feed37369836268fba21884418682f15254b)]:
|
|
136
204
|
- @ckb-ccc/connector@0.0.13-alpha.6
|
|
137
205
|
|
|
138
206
|
## 0.0.13-alpha.5
|
|
139
207
|
|
|
140
208
|
### Patch Changes
|
|
141
209
|
|
|
142
|
-
- [`9e6b9fd`](https://github.com/ckb-
|
|
210
|
+
- [`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
|
|
143
211
|
|
|
144
|
-
- [`6d62032`](https://github.com/ckb-
|
|
212
|
+
- [`6d62032`](https://github.com/ckb-devrel/ccc/commit/6d620326f42f8c48eff9deb95578cf28d7bf5c97) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(core): recordCells should not add usableCells
|
|
145
213
|
|
|
146
|
-
- Updated dependencies [[`6d62032`](https://github.com/ckb-
|
|
214
|
+
- Updated dependencies [[`6d62032`](https://github.com/ckb-devrel/ccc/commit/6d620326f42f8c48eff9deb95578cf28d7bf5c97)]:
|
|
147
215
|
- @ckb-ccc/connector@0.0.13-alpha.5
|
|
148
216
|
|
|
149
217
|
## 0.0.13-alpha.4
|
|
150
218
|
|
|
151
219
|
### Patch Changes
|
|
152
220
|
|
|
153
|
-
- [`3658797`](https://github.com/ckb-
|
|
221
|
+
- [`3658797`](https://github.com/ckb-devrel/ccc/commit/3658797e67c42c56b20fa66481d0455ed019e69f) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): node.js websocket
|
|
154
222
|
|
|
155
|
-
- Updated dependencies [[`3658797`](https://github.com/ckb-
|
|
223
|
+
- Updated dependencies [[`3658797`](https://github.com/ckb-devrel/ccc/commit/3658797e67c42c56b20fa66481d0455ed019e69f)]:
|
|
156
224
|
- @ckb-ccc/connector@0.0.13-alpha.4
|
|
157
225
|
|
|
158
226
|
## 0.0.13-alpha.3
|
|
@@ -187,9 +255,9 @@
|
|
|
187
255
|
|
|
188
256
|
### Patch Changes
|
|
189
257
|
|
|
190
|
-
- [`591e779`](https://github.com/ckb-
|
|
258
|
+
- [`591e779`](https://github.com/ckb-devrel/ccc/commit/591e7794ce3d07ceaad55b7a80d2277fe0aa9fe7) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat: custom SignersController
|
|
191
259
|
|
|
192
|
-
- Updated dependencies [[`6bee006`](https://github.com/ckb-
|
|
260
|
+
- Updated dependencies [[`6bee006`](https://github.com/ckb-devrel/ccc/commit/6bee006fbcb96986c65ca4d2d896fca21db2503b), [`591e779`](https://github.com/ckb-devrel/ccc/commit/591e7794ce3d07ceaad55b7a80d2277fe0aa9fe7)]:
|
|
193
261
|
- @ckb-ccc/connector@0.0.12
|
|
194
262
|
|
|
195
263
|
## 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,11 +17,13 @@ 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;
|
|
24
|
-
wallet?: ccc.Wallet
|
|
25
|
-
signerInfo?: ccc.SignerInfo
|
|
26
|
+
wallet?: ccc.Wallet;
|
|
27
|
+
signerInfo?: ccc.SignerInfo;
|
|
26
28
|
};
|
|
27
29
|
//# sourceMappingURL=useCcc.d.ts.map
|
|
@@ -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.10",
|
|
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,14 +35,14 @@
|
|
|
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.9"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react": ">=16"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "rimraf ./dist && tsc",
|
|
45
|
-
"lint": "eslint",
|
|
46
|
-
"format": "prettier --write . && eslint --fix"
|
|
45
|
+
"lint": "eslint ./src",
|
|
46
|
+
"format": "prettier --write . && eslint --fix ./src"
|
|
47
47
|
}
|
|
48
48
|
}
|
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;
|
|
@@ -66,7 +68,7 @@ export function Provider({
|
|
|
66
68
|
}: {
|
|
67
69
|
children: ReactNode;
|
|
68
70
|
connectorProps?: HTMLAttributes<{}>;
|
|
69
|
-
hideMark?: boolean
|
|
71
|
+
hideMark?: boolean;
|
|
70
72
|
name?: string;
|
|
71
73
|
icon?: string;
|
|
72
74
|
signerFilter?: (
|
|
@@ -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
|
{...{
|