@ckb-ccc/joy-id 0.0.16-alpha.3 → 0.0.16-alpha.5
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 +46 -32
- package/README.md +6 -26
- package/dist/btc/index.d.ts.map +1 -1
- package/dist/btc/index.js +5 -5
- package/dist/ckb/index.d.ts.map +1 -1
- package/dist/ckb/index.js +1 -0
- package/dist/common/index.d.ts +5 -5
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +2 -0
- package/dist/connectionsStorage/index.d.ts.map +1 -1
- package/dist/evm/index.d.ts.map +1 -1
- package/dist/evm/index.js +4 -4
- package/dist/nostr/index.d.ts.map +1 -1
- package/dist/nostr/index.js +3 -3
- package/dist.commonjs/btc/index.d.ts.map +1 -1
- package/dist.commonjs/btc/index.js +5 -5
- package/dist.commonjs/ckb/index.d.ts.map +1 -1
- package/dist.commonjs/ckb/index.js +1 -0
- package/dist.commonjs/common/index.d.ts +5 -5
- package/dist.commonjs/common/index.d.ts.map +1 -1
- package/dist.commonjs/common/index.js +3 -2
- package/dist.commonjs/connectionsStorage/index.d.ts.map +1 -1
- package/dist.commonjs/connectionsStorage/index.js +2 -2
- package/dist.commonjs/evm/index.d.ts.map +1 -1
- package/dist.commonjs/evm/index.js +4 -4
- package/dist.commonjs/nostr/index.d.ts.map +1 -1
- package/dist.commonjs/nostr/index.js +3 -3
- package/dist.commonjs/signerFactory/index.js +1 -2
- package/package.json +6 -6
- package/src/btc/index.ts +5 -5
- package/src/ckb/index.ts +1 -0
- package/src/common/index.ts +7 -5
- package/src/connectionsStorage/index.ts +4 -1
- package/src/evm/index.ts +4 -4
- package/src/nostr/index.ts +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,162 +1,176 @@
|
|
|
1
1
|
# @ckb-ccc/joy-id
|
|
2
2
|
|
|
3
|
+
## 0.0.16-alpha.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`50f2ce0`](https://github.com/ckb-devrel/ccc/commit/50f2ce08e74cb3fbeae926267d42e28b426fd7f4)]:
|
|
8
|
+
- @ckb-ccc/core@0.1.0-alpha.5
|
|
9
|
+
|
|
10
|
+
## 0.0.16-alpha.4
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [[`f21d7e4`](https://github.com/ckb-devrel/ccc/commit/f21d7e4cf422edab4a836ef6d678b620594fef8d)]:
|
|
15
|
+
- @ckb-ccc/core@0.1.0-alpha.4
|
|
16
|
+
|
|
3
17
|
## 0.0.16-alpha.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
6
20
|
|
|
7
|
-
- Updated dependencies [[`a3d5359`](https://github.com/ckb-
|
|
21
|
+
- Updated dependencies [[`a3d5359`](https://github.com/ckb-devrel/ccc/commit/a3d53595f6dd11f2f59cdf0086b3d7ce558a2fdd)]:
|
|
8
22
|
- @ckb-ccc/core@0.0.16-alpha.3
|
|
9
23
|
|
|
10
24
|
## 0.0.16-alpha.2
|
|
11
25
|
|
|
12
26
|
### Patch Changes
|
|
13
27
|
|
|
14
|
-
- [#70](https://github.com/ckb-
|
|
28
|
+
- [#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
|
|
15
29
|
|
|
16
|
-
- Updated dependencies [[`acfc050`](https://github.com/ckb-
|
|
30
|
+
- Updated dependencies [[`acfc050`](https://github.com/ckb-devrel/ccc/commit/acfc0502cd6beb48b9310dec8411dcd630507366)]:
|
|
17
31
|
- @ckb-ccc/core@0.0.16-alpha.2
|
|
18
32
|
|
|
19
33
|
## 0.0.16-alpha.1
|
|
20
34
|
|
|
21
35
|
### Patch Changes
|
|
22
36
|
|
|
23
|
-
- Updated dependencies [[`8824ff2`](https://github.com/ckb-
|
|
37
|
+
- Updated dependencies [[`8824ff2`](https://github.com/ckb-devrel/ccc/commit/8824ff27af3b76186f1a7d6db8c907cd66f09d6a), [`c092988`](https://github.com/ckb-devrel/ccc/commit/c092988e7765b9ac79498d6bd72a6a2f62859b6f)]:
|
|
24
38
|
- @ckb-ccc/core@0.0.16-alpha.1
|
|
25
39
|
|
|
26
40
|
## 0.0.16-alpha.0
|
|
27
41
|
|
|
28
42
|
### Patch Changes
|
|
29
43
|
|
|
30
|
-
- Updated dependencies [[`1720d5a`](https://github.com/ckb-
|
|
44
|
+
- Updated dependencies [[`1720d5a`](https://github.com/ckb-devrel/ccc/commit/1720d5a398543f1c6e24763eeaf15d84cd2214bf)]:
|
|
31
45
|
- @ckb-ccc/core@0.0.16-alpha.0
|
|
32
46
|
|
|
33
47
|
## 0.0.15
|
|
34
48
|
|
|
35
49
|
### Patch Changes
|
|
36
50
|
|
|
37
|
-
- Updated dependencies [[`8f2560a`](https://github.com/ckb-
|
|
51
|
+
- Updated dependencies [[`8f2560a`](https://github.com/ckb-devrel/ccc/commit/8f2560ab0e5619654fff7c5eacda8425385f908e)]:
|
|
38
52
|
- @ckb-ccc/core@0.0.15
|
|
39
53
|
|
|
40
54
|
## 0.0.14
|
|
41
55
|
|
|
42
56
|
### Patch Changes
|
|
43
57
|
|
|
44
|
-
- Updated dependencies [[`5e942f8`](https://github.com/ckb-
|
|
58
|
+
- Updated dependencies [[`5e942f8`](https://github.com/ckb-devrel/ccc/commit/5e942f8f1ed678abdb7ab9716f5449f0714cea53), [`f5b5938`](https://github.com/ckb-devrel/ccc/commit/f5b5938ab8f9c0a338dfd6765fe717f7ad1b1dd8), [`f13f4d3`](https://github.com/ckb-devrel/ccc/commit/f13f4d319ca66b571029a65e945e3a038bfeea25), [`7ba62a0`](https://github.com/ckb-devrel/ccc/commit/7ba62a056f17808fe5684786c00c2dff80bb7d1d), [`2164efd`](https://github.com/ckb-devrel/ccc/commit/2164efd6d834c1917ad5f4a514dc25941f937185), [`e5bd2ad`](https://github.com/ckb-devrel/ccc/commit/e5bd2ad5de4b42a22c422ecfc42056750f69b88b), [`aae3e06`](https://github.com/ckb-devrel/ccc/commit/aae3e0679fb940dd8c12ac9be12a4b53277a339d)]:
|
|
45
59
|
- @ckb-ccc/core@0.0.14
|
|
46
60
|
|
|
47
61
|
## 0.0.14-alpha.2
|
|
48
62
|
|
|
49
63
|
### Patch Changes
|
|
50
64
|
|
|
51
|
-
- Updated dependencies [[`7ba62a0`](https://github.com/ckb-
|
|
65
|
+
- Updated dependencies [[`7ba62a0`](https://github.com/ckb-devrel/ccc/commit/7ba62a056f17808fe5684786c00c2dff80bb7d1d)]:
|
|
52
66
|
- @ckb-ccc/core@0.0.14-alpha.2
|
|
53
67
|
|
|
54
68
|
## 0.0.14-alpha.1
|
|
55
69
|
|
|
56
70
|
### Patch Changes
|
|
57
71
|
|
|
58
|
-
- Updated dependencies [[`5e942f8`](https://github.com/ckb-
|
|
72
|
+
- Updated dependencies [[`5e942f8`](https://github.com/ckb-devrel/ccc/commit/5e942f8f1ed678abdb7ab9716f5449f0714cea53), [`e5bd2ad`](https://github.com/ckb-devrel/ccc/commit/e5bd2ad5de4b42a22c422ecfc42056750f69b88b), [`aae3e06`](https://github.com/ckb-devrel/ccc/commit/aae3e0679fb940dd8c12ac9be12a4b53277a339d)]:
|
|
59
73
|
- @ckb-ccc/core@0.0.14-alpha.1
|
|
60
74
|
|
|
61
75
|
## 0.0.14-alpha.0
|
|
62
76
|
|
|
63
77
|
### Patch Changes
|
|
64
78
|
|
|
65
|
-
- Updated dependencies [[`f5b5938`](https://github.com/ckb-
|
|
79
|
+
- Updated dependencies [[`f5b5938`](https://github.com/ckb-devrel/ccc/commit/f5b5938ab8f9c0a338dfd6765fe717f7ad1b1dd8), [`2164efd`](https://github.com/ckb-devrel/ccc/commit/2164efd6d834c1917ad5f4a514dc25941f937185)]:
|
|
66
80
|
- @ckb-ccc/core@0.0.14-alpha.0
|
|
67
81
|
|
|
68
82
|
## 0.0.13
|
|
69
83
|
|
|
70
84
|
### Patch Changes
|
|
71
85
|
|
|
72
|
-
- [`6d62032`](https://github.com/ckb-
|
|
86
|
+
- [`6d62032`](https://github.com/ckb-devrel/ccc/commit/6d620326f42f8c48eff9deb95578cf28d7bf5c97) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(core): recordCells should not add usableCells
|
|
73
87
|
|
|
74
|
-
- [`3658797`](https://github.com/ckb-
|
|
88
|
+
- [`3658797`](https://github.com/ckb-devrel/ccc/commit/3658797e67c42c56b20fa66481d0455ed019e69f) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): node.js websocket
|
|
75
89
|
|
|
76
|
-
- [`588db84`](https://github.com/ckb-
|
|
90
|
+
- [`588db84`](https://github.com/ckb-devrel/ccc/commit/588db8434d76a5a9ea6dd1d4c5b03f356ec1fb7d) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix: joyid CkbSigner appUri
|
|
77
91
|
|
|
78
|
-
- [`44c7fee`](https://github.com/ckb-
|
|
92
|
+
- [`44c7fee`](https://github.com/ckb-devrel/ccc/commit/44c7feed37369836268fba21884418682f15254b) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(core): completeInputs
|
|
79
93
|
|
|
80
|
-
- [`079e20e`](https://github.com/ckb-
|
|
94
|
+
- [`079e20e`](https://github.com/ckb-devrel/ccc/commit/079e20ef14cf9a7c06bbaddf3e92cbfbb005da11) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): more APIs. Since parsing.
|
|
81
95
|
|
|
82
|
-
- [`ed154d1`](https://github.com/ckb-
|
|
96
|
+
- [`ed154d1`](https://github.com/ckb-devrel/ccc/commit/ed154d189e239907ad686ec51ac8133b6d5eb895) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): Signer.findCells
|
|
83
97
|
|
|
84
|
-
- Updated dependencies [[`3378e85`](https://github.com/ckb-
|
|
98
|
+
- Updated dependencies [[`3378e85`](https://github.com/ckb-devrel/ccc/commit/3378e85b32797f5cdc1943b9ecaca1fd1d9fad5e), [`8629449`](https://github.com/ckb-devrel/ccc/commit/86294490e76fc2a1cee20f827883e02fceca6e8b), [`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), [`600cc13`](https://github.com/ckb-devrel/ccc/commit/600cc137ac6eb7c5b2533670de6df29d82f1b9e1), [`642f731`](https://github.com/ckb-devrel/ccc/commit/642f7317f4951ef801f1245aea96c40b4b6fb73e), [`96dbb61`](https://github.com/ckb-devrel/ccc/commit/96dbb6107d2071b9383350ddd578557746227054), [`0462a4e`](https://github.com/ckb-devrel/ccc/commit/0462a4ee101926f0da857173626dc4ab879e3b56), [`52156f9`](https://github.com/ckb-devrel/ccc/commit/52156f9df9cae9e0b71b77b49cda0e4d73e76142), [`63606db`](https://github.com/ckb-devrel/ccc/commit/63606db908f95bfc857430083932144d1ef4deef), [`44c7fee`](https://github.com/ckb-devrel/ccc/commit/44c7feed37369836268fba21884418682f15254b), [`1043c2b`](https://github.com/ckb-devrel/ccc/commit/1043c2bc211ec283b88dba3b81feef98e4185c0e), [`079e20e`](https://github.com/ckb-devrel/ccc/commit/079e20ef14cf9a7c06bbaddf3e92cbfbb005da11), [`1f999f8`](https://github.com/ckb-devrel/ccc/commit/1f999f854beb255b3cd9dbbc5a7268e75442b3db), [`a69a9dc`](https://github.com/ckb-devrel/ccc/commit/a69a9dc0c722f7b4cfa36b2ae8ecba4dcde0db90), [`ed154d1`](https://github.com/ckb-devrel/ccc/commit/ed154d189e239907ad686ec51ac8133b6d5eb895)]:
|
|
85
99
|
- @ckb-ccc/core@0.0.13
|
|
86
100
|
|
|
87
101
|
## 0.0.13-alpha.8
|
|
88
102
|
|
|
89
103
|
### Patch Changes
|
|
90
104
|
|
|
91
|
-
- Updated dependencies [[`8629449`](https://github.com/ckb-
|
|
105
|
+
- Updated dependencies [[`8629449`](https://github.com/ckb-devrel/ccc/commit/86294490e76fc2a1cee20f827883e02fceca6e8b), [`52156f9`](https://github.com/ckb-devrel/ccc/commit/52156f9df9cae9e0b71b77b49cda0e4d73e76142), [`63606db`](https://github.com/ckb-devrel/ccc/commit/63606db908f95bfc857430083932144d1ef4deef)]:
|
|
92
106
|
- @ckb-ccc/core@0.0.13-alpha.8
|
|
93
107
|
|
|
94
108
|
## 0.0.13-alpha.7
|
|
95
109
|
|
|
96
110
|
### Patch Changes
|
|
97
111
|
|
|
98
|
-
- [`079e20e`](https://github.com/ckb-
|
|
112
|
+
- [`079e20e`](https://github.com/ckb-devrel/ccc/commit/079e20ef14cf9a7c06bbaddf3e92cbfbb005da11) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): more APIs. Since parsing.
|
|
99
113
|
|
|
100
|
-
- [`ed154d1`](https://github.com/ckb-
|
|
114
|
+
- [`ed154d1`](https://github.com/ckb-devrel/ccc/commit/ed154d189e239907ad686ec51ac8133b6d5eb895) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): Signer.findCells
|
|
101
115
|
|
|
102
|
-
- Updated dependencies [[`1043c2b`](https://github.com/ckb-
|
|
116
|
+
- Updated dependencies [[`1043c2b`](https://github.com/ckb-devrel/ccc/commit/1043c2bc211ec283b88dba3b81feef98e4185c0e), [`079e20e`](https://github.com/ckb-devrel/ccc/commit/079e20ef14cf9a7c06bbaddf3e92cbfbb005da11), [`ed154d1`](https://github.com/ckb-devrel/ccc/commit/ed154d189e239907ad686ec51ac8133b6d5eb895)]:
|
|
103
117
|
- @ckb-ccc/core@0.0.13-alpha.7
|
|
104
118
|
|
|
105
119
|
## 0.0.13-alpha.6
|
|
106
120
|
|
|
107
121
|
### Patch Changes
|
|
108
122
|
|
|
109
|
-
- [`44c7fee`](https://github.com/ckb-
|
|
123
|
+
- [`44c7fee`](https://github.com/ckb-devrel/ccc/commit/44c7feed37369836268fba21884418682f15254b) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(core): completeInputs
|
|
110
124
|
|
|
111
|
-
- Updated dependencies [[`69c10fd`](https://github.com/ckb-
|
|
125
|
+
- Updated dependencies [[`69c10fd`](https://github.com/ckb-devrel/ccc/commit/69c10fdfcd507433c13b15d17015dca4687afb97), [`44c7fee`](https://github.com/ckb-devrel/ccc/commit/44c7feed37369836268fba21884418682f15254b)]:
|
|
112
126
|
- @ckb-ccc/core@0.0.13-alpha.6
|
|
113
127
|
|
|
114
128
|
## 0.0.13-alpha.5
|
|
115
129
|
|
|
116
130
|
### Patch Changes
|
|
117
131
|
|
|
118
|
-
- [`6d62032`](https://github.com/ckb-
|
|
132
|
+
- [`6d62032`](https://github.com/ckb-devrel/ccc/commit/6d620326f42f8c48eff9deb95578cf28d7bf5c97) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(core): recordCells should not add usableCells
|
|
119
133
|
|
|
120
|
-
- Updated dependencies [[`6d62032`](https://github.com/ckb-
|
|
134
|
+
- Updated dependencies [[`6d62032`](https://github.com/ckb-devrel/ccc/commit/6d620326f42f8c48eff9deb95578cf28d7bf5c97)]:
|
|
121
135
|
- @ckb-ccc/core@0.0.13-alpha.5
|
|
122
136
|
|
|
123
137
|
## 0.0.13-alpha.4
|
|
124
138
|
|
|
125
139
|
### Patch Changes
|
|
126
140
|
|
|
127
|
-
- [`3658797`](https://github.com/ckb-
|
|
141
|
+
- [`3658797`](https://github.com/ckb-devrel/ccc/commit/3658797e67c42c56b20fa66481d0455ed019e69f) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): node.js websocket
|
|
128
142
|
|
|
129
|
-
- Updated dependencies [[`3658797`](https://github.com/ckb-
|
|
143
|
+
- Updated dependencies [[`3658797`](https://github.com/ckb-devrel/ccc/commit/3658797e67c42c56b20fa66481d0455ed019e69f), [`642f731`](https://github.com/ckb-devrel/ccc/commit/642f7317f4951ef801f1245aea96c40b4b6fb73e)]:
|
|
130
144
|
- @ckb-ccc/core@0.0.13-alpha.4
|
|
131
145
|
|
|
132
146
|
## 0.0.13-alpha.3
|
|
133
147
|
|
|
134
148
|
### Patch Changes
|
|
135
149
|
|
|
136
|
-
- Updated dependencies [[`1f999f8`](https://github.com/ckb-
|
|
150
|
+
- Updated dependencies [[`1f999f8`](https://github.com/ckb-devrel/ccc/commit/1f999f854beb255b3cd9dbbc5a7268e75442b3db)]:
|
|
137
151
|
- @ckb-ccc/core@0.0.13-alpha.3
|
|
138
152
|
|
|
139
153
|
## 0.0.13-alpha.2
|
|
140
154
|
|
|
141
155
|
### Patch Changes
|
|
142
156
|
|
|
143
|
-
- Updated dependencies [[`96dbb61`](https://github.com/ckb-
|
|
157
|
+
- Updated dependencies [[`96dbb61`](https://github.com/ckb-devrel/ccc/commit/96dbb6107d2071b9383350ddd578557746227054)]:
|
|
144
158
|
- @ckb-ccc/core@0.0.13-alpha.2
|
|
145
159
|
|
|
146
160
|
## 0.0.13-alpha.1
|
|
147
161
|
|
|
148
162
|
### Patch Changes
|
|
149
163
|
|
|
150
|
-
- [`588db84`](https://github.com/ckb-
|
|
164
|
+
- [`588db84`](https://github.com/ckb-devrel/ccc/commit/588db8434d76a5a9ea6dd1d4c5b03f356ec1fb7d) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix: joyid CkbSigner appUri
|
|
151
165
|
|
|
152
|
-
- Updated dependencies [[`3378e85`](https://github.com/ckb-
|
|
166
|
+
- Updated dependencies [[`3378e85`](https://github.com/ckb-devrel/ccc/commit/3378e85b32797f5cdc1943b9ecaca1fd1d9fad5e), [`a69a9dc`](https://github.com/ckb-devrel/ccc/commit/a69a9dc0c722f7b4cfa36b2ae8ecba4dcde0db90)]:
|
|
153
167
|
- @ckb-ccc/core@0.0.13-alpha.1
|
|
154
168
|
|
|
155
169
|
## 0.0.13-alpha.0
|
|
156
170
|
|
|
157
171
|
### Patch Changes
|
|
158
172
|
|
|
159
|
-
- Updated dependencies [[`600cc13`](https://github.com/ckb-
|
|
173
|
+
- Updated dependencies [[`600cc13`](https://github.com/ckb-devrel/ccc/commit/600cc137ac6eb7c5b2533670de6df29d82f1b9e1)]:
|
|
160
174
|
- @ckb-ccc/core@0.0.13-alpha.0
|
|
161
175
|
|
|
162
176
|
## 0.0.12
|
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/joy-id"><img
|
|
13
13
|
alt="NPM Version" src="https://img.shields.io/npm/v/%40ckb-ccc%2Fjoy-id"
|
|
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
|
<h3 align="center">
|
|
60
|
-
Read more about CCC on <a href="https://docs.ckbccc.com">our website</a> or <a href="https://github.com/ckb-
|
|
40
|
+
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>.
|
|
61
41
|
</h3>
|
package/dist/btc/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[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AAe,EAC/C,OAAO,CAAC,EAAE,MAAM,YAAA,EAChB,eAAe,GAAE,eAAmD;IAKvF;;;OAGG;IACH,OAAO,CAAC,SAAS;IA6BX,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IASjC;;;OAGG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAKtC;;;OAGG;IACG,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAKzC;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IA+B9B;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAYrC;;;;OAIG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;CAsBvE"}
|
package/dist/btc/index.js
CHANGED
|
@@ -12,8 +12,8 @@ export class BitcoinSigner extends ccc.SignerBtc {
|
|
|
12
12
|
* @throws Will throw an error if not connected.
|
|
13
13
|
* @returns The current connection.
|
|
14
14
|
*/
|
|
15
|
-
assertConnection() {
|
|
16
|
-
if (!this.isConnected() || !this.connection) {
|
|
15
|
+
async assertConnection() {
|
|
16
|
+
if (!(await this.isConnected()) || !this.connection) {
|
|
17
17
|
throw new Error("Not connected");
|
|
18
18
|
}
|
|
19
19
|
return this.connection;
|
|
@@ -82,7 +82,7 @@ export class BitcoinSigner extends ccc.SignerBtc {
|
|
|
82
82
|
* @returns A promise that resolves to the Bitcoin account address.
|
|
83
83
|
*/
|
|
84
84
|
async getBtcAccount() {
|
|
85
|
-
const { address } = this.assertConnection();
|
|
85
|
+
const { address } = await this.assertConnection();
|
|
86
86
|
return address;
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
@@ -90,7 +90,7 @@ export class BitcoinSigner extends ccc.SignerBtc {
|
|
|
90
90
|
* @returns A promise that resolves to the Bitcoin public key.
|
|
91
91
|
*/
|
|
92
92
|
async getBtcPublicKey() {
|
|
93
|
-
const { publicKey } = this.assertConnection();
|
|
93
|
+
const { publicKey } = await this.assertConnection();
|
|
94
94
|
return publicKey;
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
@@ -139,7 +139,7 @@ export class BitcoinSigner extends ccc.SignerBtc {
|
|
|
139
139
|
* @returns A promise that resolves to the signed message.
|
|
140
140
|
*/
|
|
141
141
|
async signMessageRaw(message) {
|
|
142
|
-
const { address } = this.assertConnection();
|
|
142
|
+
const { address } = await this.assertConnection();
|
|
143
143
|
const challenge = typeof message === "string" ? message : ccc.hexFrom(message).slice(2);
|
|
144
144
|
const config = this.getConfig();
|
|
145
145
|
const { signature } = await createPopup(buildJoyIDURL({
|
package/dist/ckb/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ckb/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAIpC,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAExC;;;GAGG;AACH,qBAAa,SAAU,SAAQ,GAAG,CAAC,MAAM;IA2CrC,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC;IAChC,OAAO,CAAC,QAAQ,CAAC,eAAe;IA9ClC;;;OAGG;IACH,IAAI,IAAI,IAAI,GAAG,CAAC,UAAU,CAEzB;IAED;;;OAGG;IACH,IAAI,QAAQ,IAAI,GAAG,CAAC,cAAc,CAEjC;IAED,OAAO,CAAC,UAAU,CAAC,CAAa;IAEhC;;;;OAIG;YACW,gBAAgB;IAQ9B;;;;;;;;OAQG;gBAED,MAAM,EAAE,GAAG,CAAC,MAAM,EACD,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,
|
|
1
|
+
{"version":3,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;IAO3C;;;OAGG;IACG,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAI9C;;;;OAIG;IACG,kBAAkB,CACtB,MAAM,EAAE,GAAG,CAAC,eAAe,GAC1B,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;IAmB3B;;;;;OAKG;YACW,2BAA2B;IA0CzC;;;;OAIG;IACG,mBAAmB,CACvB,MAAM,EAAE,GAAG,CAAC,eAAe,GAC1B,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;IA+C3B;;;;OAIG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;IA2BtE;;;OAGG;YACW,cAAc;IAU5B;;;OAGG;YACW,iBAAiB;CAMhC"}
|
package/dist/ckb/index.js
CHANGED
|
@@ -216,6 +216,7 @@ export class CkbSigner extends ccc.Signer {
|
|
|
216
216
|
const config = this.getConfig();
|
|
217
217
|
const res = await createPopup(buildJoyIDURL({
|
|
218
218
|
...config,
|
|
219
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
219
220
|
tx: JSON.parse(tx.stringify()),
|
|
220
221
|
signerAddress: (await this.assertConnection()).address,
|
|
221
222
|
witnessIndexes,
|
package/dist/common/index.d.ts
CHANGED
|
@@ -14,11 +14,11 @@ export interface PopupReturnType {
|
|
|
14
14
|
[DappRequestType.SignCotaNFT]: SignCotaNFTResponseData;
|
|
15
15
|
[DappRequestType.SignCkbRawTx]: SignCkbTxResponseData;
|
|
16
16
|
[DappRequestType.SignNostrEvent]: SignNostrEventData;
|
|
17
|
-
[DappRequestType.EncryptNostrMessage]:
|
|
18
|
-
[DappRequestType.DecryptNostrMessage]:
|
|
19
|
-
[DappRequestType.AuthMiniApp]:
|
|
20
|
-
[DappRequestType.SignMiniAppEvm]:
|
|
21
|
-
[DappRequestType.SignMiniAppMessage]:
|
|
17
|
+
[DappRequestType.EncryptNostrMessage]: unknown;
|
|
18
|
+
[DappRequestType.DecryptNostrMessage]: unknown;
|
|
19
|
+
[DappRequestType.AuthMiniApp]: unknown;
|
|
20
|
+
[DappRequestType.SignMiniAppEvm]: unknown;
|
|
21
|
+
[DappRequestType.SignMiniAppMessage]: unknown;
|
|
22
22
|
[DappRequestType.EvmWeb2Login]: EvmWeb2LoginResponse;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EAEpB,kBAAkB,EAGlB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAInB,MAAM,eAAe,CAAC;AAEvB;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACzC,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACvD,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,qBAAqB,CAAC;IACjD,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IAClD,CAAC,eAAe,CAAC,aAAa,CAAC,EAAE;QAC/B,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;IACF,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,qBAAqB,CAAC;IACnD,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACvD,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACtD,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACrD,CAAC,eAAe,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC/C,CAAC,eAAe,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC/C,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IACvC,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC1C,CAAC,eAAe,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC9C,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE,oBAAoB,CAAC;CACtD;AAED;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAAC,CAAC,SAAS,eAAe,EACzD,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GACtD,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CA0D7B"}
|
package/dist/common/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
1
3
|
import { DappRequestType, PopupCancelledError, PopupNotSupportedError, PopupTimeoutError, createBlockDialog, isStandaloneBrowser, openPopup, } from "@joyid/common";
|
|
2
4
|
/**
|
|
3
5
|
* Creates a popup window for JoyID Dapp requests.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connectionsStorage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,CAAC,EAAE,eAAe,EAClB,MAAM,EAAE,eAAe,GACtB,OAAO,CAET;AAED;;GAEG;AACH,MAAM,MAAM,U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AAa;IAEhC;;;;OAIG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/evm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGpC,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAExC;;;GAGG;AACH,qBAAa,SAAU,SAAQ,GAAG,CAAC,SAAS;IA0BxC,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;IA5BlC,OAAO,CAAC,UAAU,CAAC,CAAa;IAEhC;;;;OAIG;YACW,gBAAgB;IAQ9B;;;;;;;OAOG;gBAED,MAAM,EAAE,GAAG,CAAC,MAAM,EACD,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,YAAA,EAChB,eAAe,GAAE,eAAmD;IAKvF;;;OAGG;IACH,OAAO,CAAC,SAAS;IAcjB;;;OAGG;IACG,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAIvC;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBxB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAOjC;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAQrC;;;;OAIG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAuBvE;;;OAGG;YACW,cAAc;IAU5B;;;OAGG;YACW,iBAAiB;CAMhC"}
|
package/dist/evm/index.js
CHANGED
|
@@ -12,8 +12,8 @@ export class EvmSigner extends ccc.SignerEvm {
|
|
|
12
12
|
* @throws Will throw an error if not connected.
|
|
13
13
|
* @returns The current connection.
|
|
14
14
|
*/
|
|
15
|
-
assertConnection() {
|
|
16
|
-
if (!this.isConnected() || !this.connection) {
|
|
15
|
+
async assertConnection() {
|
|
16
|
+
if (!(await this.isConnected()) || !this.connection) {
|
|
17
17
|
throw new Error("Not connected");
|
|
18
18
|
}
|
|
19
19
|
return this.connection;
|
|
@@ -54,7 +54,7 @@ export class EvmSigner extends ccc.SignerEvm {
|
|
|
54
54
|
* @returns A promise that resolves to the EVM account address.
|
|
55
55
|
*/
|
|
56
56
|
async getEvmAccount() {
|
|
57
|
-
return this.assertConnection().address;
|
|
57
|
+
return (await this.assertConnection()).address;
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
* Connects to the provider by requesting authentication.
|
|
@@ -95,7 +95,7 @@ export class EvmSigner extends ccc.SignerEvm {
|
|
|
95
95
|
* @returns A promise that resolves to the signed message.
|
|
96
96
|
*/
|
|
97
97
|
async signMessageRaw(message) {
|
|
98
|
-
const { address } = this.assertConnection();
|
|
98
|
+
const { address } = await this.assertConnection();
|
|
99
99
|
const challenge = typeof message === "string" ? message : ccc.hexFrom(message).slice(2);
|
|
100
100
|
const config = this.getConfig();
|
|
101
101
|
const { signature } = await createPopup(buildJoyIDURL({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/nostr/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGpC,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAExC;;;GAGG;AACH,qBAAa,WAAY,SAAQ,GAAG,CAAC,WAAW;IA0B5C,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;IA5BlC,OAAO,CAAC,UAAU,CAAC,CAAa;IAEhC;;;;OAIG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/nostr/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGpC,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAExC;;;GAGG;AACH,qBAAa,WAAY,SAAQ,GAAG,CAAC,WAAW;IA0B5C,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;IA5BlC,OAAO,CAAC,UAAU,CAAC,CAAa;IAEhC;;;;OAIG;YACW,gBAAgB;IAQ9B;;;;;;;OAOG;gBAED,MAAM,EAAE,GAAG,CAAC,MAAM,EACD,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,YAAA,EAChB,eAAe,GAAE,eAAmD;IAKvF;;;OAGG;IACH,OAAO,CAAC,SAAS;IAcjB;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAexB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAOjC;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAS/B,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAIrC,cAAc,CAClB,KAAK,EAAE,GAAG,CAAC,UAAU,GACpB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAYpC;;;OAGG;YACW,cAAc;IAU5B;;;OAGG;YACW,iBAAiB;CAMhC"}
|
package/dist/nostr/index.js
CHANGED
|
@@ -12,8 +12,8 @@ export class NostrSigner extends ccc.SignerNostr {
|
|
|
12
12
|
* @throws Will throw an error if not connected.
|
|
13
13
|
* @returns The current connection.
|
|
14
14
|
*/
|
|
15
|
-
assertConnection() {
|
|
16
|
-
if (!this.isConnected() || !this.connection) {
|
|
15
|
+
async assertConnection() {
|
|
16
|
+
if (!(await this.isConnected()) || !this.connection) {
|
|
17
17
|
throw new Error("Not connected");
|
|
18
18
|
}
|
|
19
19
|
return this.connection;
|
|
@@ -83,7 +83,7 @@ export class NostrSigner extends ccc.SignerNostr {
|
|
|
83
83
|
return this.connection !== undefined;
|
|
84
84
|
}
|
|
85
85
|
async getNostrPublicKey() {
|
|
86
|
-
return this.assertConnection().publicKey;
|
|
86
|
+
return (await this.assertConnection()).publicKey;
|
|
87
87
|
}
|
|
88
88
|
async signNostrEvent(event) {
|
|
89
89
|
const config = this.getConfig();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGpC,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAExC;;;GAGG;AACH,qBAAa,aAAc,SAAQ,GAAG,CAAC,SAAS;aA4B5B,IAAI,EAAE,MAAM;aACZ,IAAI,EAAE,MAAM;IAC5B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;aAYlB,WAAW,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM;IACvD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;IA3ClC,OAAO,CAAC,UAAU,CAAC,CAAa;IAChC,OAAO,CAAC,OAAO,CAAgB;IAE/B;;;;OAIG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGpC,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAExC;;;GAGG;AACH,qBAAa,aAAc,SAAQ,GAAG,CAAC,SAAS;aA4B5B,IAAI,EAAE,MAAM;aACZ,IAAI,EAAE,MAAM;IAC5B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;aAYlB,WAAW,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM;IACvD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;IA3ClC,OAAO,CAAC,UAAU,CAAC,CAAa;IAChC,OAAO,CAAC,OAAO,CAAgB;IAE/B;;;;OAIG;YACW,gBAAgB;IAQ9B;;;;;;;;OAQG;gBAED,MAAM,EAAE,GAAG,CAAC,MAAM,EACF,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACX,iBAAiB,GAAE,GAAG,CAAC,iBAAiB,EAWxD,EACe,WAAW,GAAE,MAAM,GAAG,QAAQ,GAAG,MAAe,EAC/C,OAAO,CAAC,EAAE,MAAM,YAAA,EAChB,eAAe,GAAE,eAAmD;IAKvF;;;OAGG;IACH,OAAO,CAAC,SAAS;IA6BX,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IASjC;;;OAGG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAKtC;;;OAGG;IACG,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAKzC;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IA+B9B;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAYrC;;;;OAIG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;CAsBvE"}
|
|
@@ -15,8 +15,8 @@ class BitcoinSigner extends core_1.ccc.SignerBtc {
|
|
|
15
15
|
* @throws Will throw an error if not connected.
|
|
16
16
|
* @returns The current connection.
|
|
17
17
|
*/
|
|
18
|
-
assertConnection() {
|
|
19
|
-
if (!this.isConnected() || !this.connection) {
|
|
18
|
+
async assertConnection() {
|
|
19
|
+
if (!(await this.isConnected()) || !this.connection) {
|
|
20
20
|
throw new Error("Not connected");
|
|
21
21
|
}
|
|
22
22
|
return this.connection;
|
|
@@ -85,7 +85,7 @@ class BitcoinSigner extends core_1.ccc.SignerBtc {
|
|
|
85
85
|
* @returns A promise that resolves to the Bitcoin account address.
|
|
86
86
|
*/
|
|
87
87
|
async getBtcAccount() {
|
|
88
|
-
const { address } = this.assertConnection();
|
|
88
|
+
const { address } = await this.assertConnection();
|
|
89
89
|
return address;
|
|
90
90
|
}
|
|
91
91
|
/**
|
|
@@ -93,7 +93,7 @@ class BitcoinSigner extends core_1.ccc.SignerBtc {
|
|
|
93
93
|
* @returns A promise that resolves to the Bitcoin public key.
|
|
94
94
|
*/
|
|
95
95
|
async getBtcPublicKey() {
|
|
96
|
-
const { publicKey } = this.assertConnection();
|
|
96
|
+
const { publicKey } = await this.assertConnection();
|
|
97
97
|
return publicKey;
|
|
98
98
|
}
|
|
99
99
|
/**
|
|
@@ -142,7 +142,7 @@ class BitcoinSigner extends core_1.ccc.SignerBtc {
|
|
|
142
142
|
* @returns A promise that resolves to the signed message.
|
|
143
143
|
*/
|
|
144
144
|
async signMessageRaw(message) {
|
|
145
|
-
const { address } = this.assertConnection();
|
|
145
|
+
const { address } = await this.assertConnection();
|
|
146
146
|
const challenge = typeof message === "string" ? message : core_1.ccc.hexFrom(message).slice(2);
|
|
147
147
|
const config = this.getConfig();
|
|
148
148
|
const { signature } = await (0, index_js_1.createPopup)((0, common_1.buildJoyIDURL)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ckb/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAIpC,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAExC;;;GAGG;AACH,qBAAa,SAAU,SAAQ,GAAG,CAAC,MAAM;IA2CrC,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,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cAAc,CAAC,EAAE,MAAM,YAAA,EACvB,eAAe,GAAE,eAAmD;IAKvF;;;OAGG;IACH,OAAO,CAAC,SAAS;IAajB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IASxB;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBxB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAOjC;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAQrC;;;OAGG;IACG,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAI3C;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAQpC;;;OAGG;IACG,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;IAO3C;;;OAGG;IACG,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAI9C;;;;OAIG;IACG,kBAAkB,CACtB,MAAM,EAAE,GAAG,CAAC,eAAe,GAC1B,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;IAmB3B;;;;;OAKG;YACW,2BAA2B;IA0CzC;;;;OAIG;IACG,mBAAmB,CACvB,MAAM,EAAE,GAAG,CAAC,eAAe,GAC1B,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;IA+C3B;;;;OAIG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC;IA2BtE;;;OAGG;YACW,cAAc;IAU5B;;;OAGG;YACW,iBAAiB;CAMhC"}
|
|
@@ -219,6 +219,7 @@ class CkbSigner extends core_1.ccc.Signer {
|
|
|
219
219
|
const config = this.getConfig();
|
|
220
220
|
const res = await (0, index_js_1.createPopup)((0, common_1.buildJoyIDURL)({
|
|
221
221
|
...config,
|
|
222
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
222
223
|
tx: JSON.parse(tx.stringify()),
|
|
223
224
|
signerAddress: (await this.assertConnection()).address,
|
|
224
225
|
witnessIndexes,
|
|
@@ -14,11 +14,11 @@ export interface PopupReturnType {
|
|
|
14
14
|
[DappRequestType.SignCotaNFT]: SignCotaNFTResponseData;
|
|
15
15
|
[DappRequestType.SignCkbRawTx]: SignCkbTxResponseData;
|
|
16
16
|
[DappRequestType.SignNostrEvent]: SignNostrEventData;
|
|
17
|
-
[DappRequestType.EncryptNostrMessage]:
|
|
18
|
-
[DappRequestType.DecryptNostrMessage]:
|
|
19
|
-
[DappRequestType.AuthMiniApp]:
|
|
20
|
-
[DappRequestType.SignMiniAppEvm]:
|
|
21
|
-
[DappRequestType.SignMiniAppMessage]:
|
|
17
|
+
[DappRequestType.EncryptNostrMessage]: unknown;
|
|
18
|
+
[DappRequestType.DecryptNostrMessage]: unknown;
|
|
19
|
+
[DappRequestType.AuthMiniApp]: unknown;
|
|
20
|
+
[DappRequestType.SignMiniAppEvm]: unknown;
|
|
21
|
+
[DappRequestType.SignMiniAppMessage]: unknown;
|
|
22
22
|
[DappRequestType.EvmWeb2Login]: EvmWeb2LoginResponse;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EAEpB,kBAAkB,EAGlB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAInB,MAAM,eAAe,CAAC;AAEvB;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACzC,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACvD,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,qBAAqB,CAAC;IACjD,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IAClD,CAAC,eAAe,CAAC,aAAa,CAAC,EAAE;QAC/B,KAAK,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;IACF,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,qBAAqB,CAAC;IACnD,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,uBAAuB,CAAC;IACvD,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACtD,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,kBAAkB,CAAC;IACrD,CAAC,eAAe,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC/C,CAAC,eAAe,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC/C,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IACvC,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAC1C,CAAC,eAAe,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC9C,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE,oBAAoB,CAAC;CACtD;AAED;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAAC,CAAC,SAAS,eAAe,EACzD,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GACtD,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CA0D7B"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createPopup =
|
|
3
|
+
exports.createPopup = createPopup;
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
4
6
|
const common_1 = require("@joyid/common");
|
|
5
7
|
/**
|
|
6
8
|
* Creates a popup window for JoyID Dapp requests.
|
|
@@ -60,4 +62,3 @@ async function createPopup(url, config) {
|
|
|
60
62
|
window.addEventListener("message", popupEventListener);
|
|
61
63
|
});
|
|
62
64
|
}
|
|
63
|
-
exports.createPopup = createPopup;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connectionsStorage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,CAAC,EAAE,eAAe,EAClB,MAAM,EAAE,eAAe,GACtB,OAAO,CAET;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,GAAG,CAAC;IAC5B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,GAAG,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;IAEhE;;;;;OAKG;IACH,GAAG,CACD,QAAQ,EAAE,eAAe,EACzB,UAAU,EAAE,UAAU,GAAG,SAAS,GACjC,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB;AAED;;GAEG;AACH,qBAAa,2BAA4B,YAAW,eAAe;IAKrD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAJvC;;;OAGG;gBAC0B,UAAU,SAAsB;IAE7D;;;OAGG;IACG,eAAe,IAAI,OA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AMrE;;;;;OAKG;IACG,GAAG,CACP,QAAQ,EAAE,eAAe,EACzB,UAAU,EAAE,UAAU,GAAG,SAAS,GACjC,OAAO,CAAC,IAAI,CAAC;CAoBjB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConnectionsRepoLocalStorage =
|
|
3
|
+
exports.ConnectionsRepoLocalStorage = void 0;
|
|
4
|
+
exports.isSelectorMatch = isSelectorMatch;
|
|
4
5
|
/**
|
|
5
6
|
* Checks if a AccountSelector matches the filter
|
|
6
7
|
* @param a - The first account selector.
|
|
@@ -10,7 +11,6 @@ exports.ConnectionsRepoLocalStorage = exports.isSelectorMatch = void 0;
|
|
|
10
11
|
function isSelectorMatch(a, filter) {
|
|
11
12
|
return a.uri === filter.uri && a.addressType.startsWith(filter.addressType);
|
|
12
13
|
}
|
|
13
|
-
exports.isSelectorMatch = isSelectorMatch;
|
|
14
14
|
/**
|
|
15
15
|
* Class representing a local storage-based repository for managing connections.
|
|
16
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/evm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGpC,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAExC;;;GAGG;AACH,qBAAa,SAAU,SAAQ,GAAG,CAAC,SAAS;IA0BxC,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;IA5BlC,OAAO,CAAC,UAAU,CAAC,CAAa;IAEhC;;;;OAIG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/evm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGpC,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAExC;;;GAGG;AACH,qBAAa,SAAU,SAAQ,GAAG,CAAC,SAAS;IA0BxC,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;IA5BlC,OAAO,CAAC,UAAU,CAAC,CAAa;IAEhC;;;;OAIG;YACW,gBAAgB;IAQ9B;;;;;;;OAOG;gBAED,MAAM,EAAE,GAAG,CAAC,MAAM,EACD,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,YAAA,EAChB,eAAe,GAAE,eAAmD;IAKvF;;;OAGG;IACH,OAAO,CAAC,SAAS;IAcjB;;;OAGG;IACG,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAIvC;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBxB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAOjC;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAQrC;;;;OAIG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAuBvE;;;OAGG;YACW,cAAc;IAU5B;;;OAGG;YACW,iBAAiB;CAMhC"}
|
|
@@ -15,8 +15,8 @@ class EvmSigner extends core_1.ccc.SignerEvm {
|
|
|
15
15
|
* @throws Will throw an error if not connected.
|
|
16
16
|
* @returns The current connection.
|
|
17
17
|
*/
|
|
18
|
-
assertConnection() {
|
|
19
|
-
if (!this.isConnected() || !this.connection) {
|
|
18
|
+
async assertConnection() {
|
|
19
|
+
if (!(await this.isConnected()) || !this.connection) {
|
|
20
20
|
throw new Error("Not connected");
|
|
21
21
|
}
|
|
22
22
|
return this.connection;
|
|
@@ -57,7 +57,7 @@ class EvmSigner extends core_1.ccc.SignerEvm {
|
|
|
57
57
|
* @returns A promise that resolves to the EVM account address.
|
|
58
58
|
*/
|
|
59
59
|
async getEvmAccount() {
|
|
60
|
-
return this.assertConnection().address;
|
|
60
|
+
return (await this.assertConnection()).address;
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* Connects to the provider by requesting authentication.
|
|
@@ -98,7 +98,7 @@ class EvmSigner extends core_1.ccc.SignerEvm {
|
|
|
98
98
|
* @returns A promise that resolves to the signed message.
|
|
99
99
|
*/
|
|
100
100
|
async signMessageRaw(message) {
|
|
101
|
-
const { address } = this.assertConnection();
|
|
101
|
+
const { address } = await this.assertConnection();
|
|
102
102
|
const challenge = typeof message === "string" ? message : core_1.ccc.hexFrom(message).slice(2);
|
|
103
103
|
const config = this.getConfig();
|
|
104
104
|
const { signature } = await (0, index_js_1.createPopup)((0, common_1.buildJoyIDURL)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/nostr/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGpC,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAExC;;;GAGG;AACH,qBAAa,WAAY,SAAQ,GAAG,CAAC,WAAW;IA0B5C,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;IA5BlC,OAAO,CAAC,UAAU,CAAC,CAAa;IAEhC;;;;OAIG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/nostr/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAGpC,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAExC;;;GAGG;AACH,qBAAa,WAAY,SAAQ,GAAG,CAAC,WAAW;IA0B5C,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;IA5BlC,OAAO,CAAC,UAAU,CAAC,CAAa;IAEhC;;;;OAIG;YACW,gBAAgB;IAQ9B;;;;;;;OAOG;gBAED,MAAM,EAAE,GAAG,CAAC,MAAM,EACD,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,YAAA,EAChB,eAAe,GAAE,eAAmD;IAKvF;;;OAGG;IACH,OAAO,CAAC,SAAS;IAcjB;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAexB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAOjC;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAS/B,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAIrC,cAAc,CAClB,KAAK,EAAE,GAAG,CAAC,UAAU,GACpB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAYpC;;;OAGG;YACW,cAAc;IAU5B;;;OAGG;YACW,iBAAiB;CAMhC"}
|
|
@@ -15,8 +15,8 @@ class NostrSigner extends core_1.ccc.SignerNostr {
|
|
|
15
15
|
* @throws Will throw an error if not connected.
|
|
16
16
|
* @returns The current connection.
|
|
17
17
|
*/
|
|
18
|
-
assertConnection() {
|
|
19
|
-
if (!this.isConnected() || !this.connection) {
|
|
18
|
+
async assertConnection() {
|
|
19
|
+
if (!(await this.isConnected()) || !this.connection) {
|
|
20
20
|
throw new Error("Not connected");
|
|
21
21
|
}
|
|
22
22
|
return this.connection;
|
|
@@ -86,7 +86,7 @@ class NostrSigner extends core_1.ccc.SignerNostr {
|
|
|
86
86
|
return this.connection !== undefined;
|
|
87
87
|
}
|
|
88
88
|
async getNostrPublicKey() {
|
|
89
|
-
return this.assertConnection().publicKey;
|
|
89
|
+
return (await this.assertConnection()).publicKey;
|
|
90
90
|
}
|
|
91
91
|
async signNostrEvent(event) {
|
|
92
92
|
const config = this.getConfig();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getJoyIdSigners =
|
|
3
|
+
exports.getJoyIdSigners = getJoyIdSigners;
|
|
4
4
|
const core_1 = require("@ckb-ccc/core");
|
|
5
5
|
const common_1 = require("@joyid/common");
|
|
6
6
|
const index_js_1 = require("../btc/index.js");
|
|
@@ -52,4 +52,3 @@ function getJoyIdSigners(client, name, icon, preferredNetworks) {
|
|
|
52
52
|
},
|
|
53
53
|
];
|
|
54
54
|
}
|
|
55
|
-
exports.getJoyIdSigners = getJoyIdSigners;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckb-ccc/joy-id",
|
|
3
|
-
"version": "0.0.16-alpha.
|
|
3
|
+
"version": "0.0.16-alpha.5",
|
|
4
4
|
"description": "Connector's support for JoyID",
|
|
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
|
"main": "dist.commonjs/index.js",
|
|
14
14
|
"module": "dist/index.js",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@joyid/ckb": "^1.0.1",
|
|
38
38
|
"@joyid/common": "^0.2.0",
|
|
39
|
-
"@ckb-ccc/core": "0.0
|
|
39
|
+
"@ckb-ccc/core": "0.1.0-alpha.5"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "rimraf ./dist && rimraf ./dist.commonjs && tsc && tsc --project tsconfig.commonjs.json && copyfiles -u 2 misc/basedirs/**/* .",
|
|
43
|
-
"lint": "eslint",
|
|
44
|
-
"format": "prettier --write . && eslint --fix"
|
|
43
|
+
"lint": "eslint ./src",
|
|
44
|
+
"format": "prettier --write . && eslint --fix ./src"
|
|
45
45
|
}
|
|
46
46
|
}
|
package/src/btc/index.ts
CHANGED
|
@@ -20,8 +20,8 @@ export class BitcoinSigner extends ccc.SignerBtc {
|
|
|
20
20
|
* @throws Will throw an error if not connected.
|
|
21
21
|
* @returns The current connection.
|
|
22
22
|
*/
|
|
23
|
-
private assertConnection(): Connection {
|
|
24
|
-
if (!this.isConnected() || !this.connection) {
|
|
23
|
+
private async assertConnection(): Promise<Connection> {
|
|
24
|
+
if (!(await this.isConnected()) || !this.connection) {
|
|
25
25
|
throw new Error("Not connected");
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -107,7 +107,7 @@ export class BitcoinSigner extends ccc.SignerBtc {
|
|
|
107
107
|
* @returns A promise that resolves to the Bitcoin account address.
|
|
108
108
|
*/
|
|
109
109
|
async getBtcAccount(): Promise<string> {
|
|
110
|
-
const { address } = this.assertConnection();
|
|
110
|
+
const { address } = await this.assertConnection();
|
|
111
111
|
return address;
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -116,7 +116,7 @@ export class BitcoinSigner extends ccc.SignerBtc {
|
|
|
116
116
|
* @returns A promise that resolves to the Bitcoin public key.
|
|
117
117
|
*/
|
|
118
118
|
async getBtcPublicKey(): Promise<ccc.Hex> {
|
|
119
|
-
const { publicKey } = this.assertConnection();
|
|
119
|
+
const { publicKey } = await this.assertConnection();
|
|
120
120
|
return publicKey;
|
|
121
121
|
}
|
|
122
122
|
|
|
@@ -177,7 +177,7 @@ export class BitcoinSigner extends ccc.SignerBtc {
|
|
|
177
177
|
* @returns A promise that resolves to the signed message.
|
|
178
178
|
*/
|
|
179
179
|
async signMessageRaw(message: string | ccc.BytesLike): Promise<string> {
|
|
180
|
-
const { address } = this.assertConnection();
|
|
180
|
+
const { address } = await this.assertConnection();
|
|
181
181
|
|
|
182
182
|
const challenge =
|
|
183
183
|
typeof message === "string" ? message : ccc.hexFrom(message).slice(2);
|
package/src/ckb/index.ts
CHANGED
|
@@ -283,6 +283,7 @@ export class CkbSigner extends ccc.Signer {
|
|
|
283
283
|
buildJoyIDURL(
|
|
284
284
|
{
|
|
285
285
|
...config,
|
|
286
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
286
287
|
tx: JSON.parse(tx.stringify()),
|
|
287
288
|
signerAddress: (await this.assertConnection()).address,
|
|
288
289
|
witnessIndexes,
|
package/src/common/index.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
1
3
|
import {
|
|
2
4
|
AuthResponseData,
|
|
3
5
|
DappRequestType,
|
|
@@ -31,11 +33,11 @@ export interface PopupReturnType {
|
|
|
31
33
|
[DappRequestType.SignCotaNFT]: SignCotaNFTResponseData;
|
|
32
34
|
[DappRequestType.SignCkbRawTx]: SignCkbTxResponseData;
|
|
33
35
|
[DappRequestType.SignNostrEvent]: SignNostrEventData;
|
|
34
|
-
[DappRequestType.EncryptNostrMessage]:
|
|
35
|
-
[DappRequestType.DecryptNostrMessage]:
|
|
36
|
-
[DappRequestType.AuthMiniApp]:
|
|
37
|
-
[DappRequestType.SignMiniAppEvm]:
|
|
38
|
-
[DappRequestType.SignMiniAppMessage]:
|
|
36
|
+
[DappRequestType.EncryptNostrMessage]: unknown;
|
|
37
|
+
[DappRequestType.DecryptNostrMessage]: unknown;
|
|
38
|
+
[DappRequestType.AuthMiniApp]: unknown;
|
|
39
|
+
[DappRequestType.SignMiniAppEvm]: unknown;
|
|
40
|
+
[DappRequestType.SignMiniAppMessage]: unknown;
|
|
39
41
|
[DappRequestType.EvmWeb2Login]: EvmWeb2LoginResponse;
|
|
40
42
|
}
|
|
41
43
|
|
|
@@ -83,7 +83,10 @@ export class ConnectionsRepoLocalStorage implements ConnectionsRepo {
|
|
|
83
83
|
* @returns A promise that resolves to an array of selectors and connections.
|
|
84
84
|
*/
|
|
85
85
|
async readConnections(): Promise<[AccountSelector, Connection][]> {
|
|
86
|
-
return JSON.parse(window.localStorage.getItem(this.storageKey) ?? "[]")
|
|
86
|
+
return JSON.parse(window.localStorage.getItem(this.storageKey) ?? "[]") as [
|
|
87
|
+
AccountSelector,
|
|
88
|
+
Connection,
|
|
89
|
+
][];
|
|
87
90
|
}
|
|
88
91
|
|
|
89
92
|
/**
|
package/src/evm/index.ts
CHANGED
|
@@ -19,8 +19,8 @@ export class EvmSigner extends ccc.SignerEvm {
|
|
|
19
19
|
* @throws Will throw an error if not connected.
|
|
20
20
|
* @returns The current connection.
|
|
21
21
|
*/
|
|
22
|
-
private assertConnection(): Connection {
|
|
23
|
-
if (!this.isConnected() || !this.connection) {
|
|
22
|
+
private async assertConnection(): Promise<Connection> {
|
|
23
|
+
if (!(await this.isConnected()) || !this.connection) {
|
|
24
24
|
throw new Error("Not connected");
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -68,7 +68,7 @@ export class EvmSigner extends ccc.SignerEvm {
|
|
|
68
68
|
* @returns A promise that resolves to the EVM account address.
|
|
69
69
|
*/
|
|
70
70
|
async getEvmAccount(): Promise<ccc.Hex> {
|
|
71
|
-
return this.assertConnection().address as ccc.Hex;
|
|
71
|
+
return (await this.assertConnection()).address as ccc.Hex;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
/**
|
|
@@ -116,7 +116,7 @@ export class EvmSigner extends ccc.SignerEvm {
|
|
|
116
116
|
* @returns A promise that resolves to the signed message.
|
|
117
117
|
*/
|
|
118
118
|
async signMessageRaw(message: string | ccc.BytesLike): Promise<ccc.Hex> {
|
|
119
|
-
const { address } = this.assertConnection();
|
|
119
|
+
const { address } = await this.assertConnection();
|
|
120
120
|
|
|
121
121
|
const challenge =
|
|
122
122
|
typeof message === "string" ? message : ccc.hexFrom(message).slice(2);
|
package/src/nostr/index.ts
CHANGED
|
@@ -19,8 +19,8 @@ export class NostrSigner extends ccc.SignerNostr {
|
|
|
19
19
|
* @throws Will throw an error if not connected.
|
|
20
20
|
* @returns The current connection.
|
|
21
21
|
*/
|
|
22
|
-
private assertConnection(): Connection {
|
|
23
|
-
if (!this.isConnected() || !this.connection) {
|
|
22
|
+
private async assertConnection(): Promise<Connection> {
|
|
23
|
+
if (!(await this.isConnected()) || !this.connection) {
|
|
24
24
|
throw new Error("Not connected");
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -103,7 +103,7 @@ export class NostrSigner extends ccc.SignerNostr {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
async getNostrPublicKey(): Promise<ccc.Hex> {
|
|
106
|
-
return this.assertConnection().publicKey;
|
|
106
|
+
return (await this.assertConnection()).publicKey;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
async signNostrEvent(
|