@ckb-ccc/nip07 0.0.0-canary-20250214032000

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +319 -0
  2. package/README.md +41 -0
  3. package/dist/advanced.d.ts +2 -0
  4. package/dist/advanced.d.ts.map +1 -0
  5. package/dist/advanced.js +1 -0
  6. package/dist/barrel.d.ts +3 -0
  7. package/dist/barrel.d.ts.map +1 -0
  8. package/dist/barrel.js +2 -0
  9. package/dist/index.d.ts +2 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +1 -0
  12. package/dist/nip07.advanced.d.ts +6 -0
  13. package/dist/nip07.advanced.d.ts.map +1 -0
  14. package/dist/nip07.advanced.js +1 -0
  15. package/dist/package.json +3 -0
  16. package/dist/signer.d.ts +15 -0
  17. package/dist/signer.d.ts.map +1 -0
  18. package/dist/signer.js +32 -0
  19. package/dist/signersFactory.d.ts +7 -0
  20. package/dist/signersFactory.d.ts.map +1 -0
  21. package/dist/signersFactory.js +11 -0
  22. package/dist.commonjs/advanced.d.ts +2 -0
  23. package/dist.commonjs/advanced.d.ts.map +1 -0
  24. package/dist.commonjs/advanced.js +37 -0
  25. package/dist.commonjs/barrel.d.ts +3 -0
  26. package/dist.commonjs/barrel.d.ts.map +1 -0
  27. package/dist.commonjs/barrel.js +18 -0
  28. package/dist.commonjs/index.d.ts +2 -0
  29. package/dist.commonjs/index.d.ts.map +1 -0
  30. package/dist.commonjs/index.js +37 -0
  31. package/dist.commonjs/nip07.advanced.d.ts +6 -0
  32. package/dist.commonjs/nip07.advanced.d.ts.map +1 -0
  33. package/dist.commonjs/nip07.advanced.js +2 -0
  34. package/dist.commonjs/package.json +3 -0
  35. package/dist.commonjs/signer.d.ts +15 -0
  36. package/dist.commonjs/signer.d.ts.map +1 -0
  37. package/dist.commonjs/signer.js +36 -0
  38. package/dist.commonjs/signersFactory.d.ts +7 -0
  39. package/dist.commonjs/signersFactory.d.ts.map +1 -0
  40. package/dist.commonjs/signersFactory.js +14 -0
  41. package/package.json +51 -0
  42. package/src/advanced.ts +1 -0
  43. package/src/barrel.ts +2 -0
  44. package/src/index.ts +1 -0
  45. package/src/nip07.advanced.ts +6 -0
  46. package/src/signer.ts +44 -0
  47. package/src/signersFactory.ts +16 -0
  48. package/typedoc.json +6 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,319 @@
1
+ # @ckb-ccc/nip07
2
+
3
+ ## 0.0.0-canary-20250214032000
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`80e605d`](https://github.com/ckb-devrel/ccc/commit/80e605d0645e87b4e8b5be85c63322f7a3926e38), [`def62a0`](https://github.com/ckb-devrel/ccc/commit/def62a08bf908c6a21fe91c8db2c60848a2ada52), [`d584059`](https://github.com/ckb-devrel/ccc/commit/d584059644e8bcd3a0ea8b0314fdcbb68ee66013), [`1e88ad8`](https://github.com/ckb-devrel/ccc/commit/1e88ad8743428b46b28fe790bd559b96df8a6ce4), [`6f10589`](https://github.com/ckb-devrel/ccc/commit/6f1058977e7aa113808fa74793f1ad5d672626d2), [`d7728d9`](https://github.com/ckb-devrel/ccc/commit/d7728d9edb46c9c5a2bfeb342fc68a8b1c0fec5d)]:
8
+ - @ckb-ccc/core@0.0.0-canary-20250214032000
9
+
10
+ ## 1.0.11
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`28c211d`](https://github.com/ckb-devrel/ccc/commit/28c211d839a2d2305eca56e82ba7da144aa3df4a)]:
15
+ - @ckb-ccc/core@1.5.0
16
+
17
+ ## 1.0.10
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies [[`3fdb2c4`](https://github.com/ckb-devrel/ccc/commit/3fdb2c477d0b2766b231e436b8f396f047b02634), [`f429087`](https://github.com/ckb-devrel/ccc/commit/f4290874dfab3fe58844e5169673c5d47bda64e3)]:
22
+ - @ckb-ccc/core@1.4.0
23
+
24
+ ## 1.0.9
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies [[`a48cccf`](https://github.com/ckb-devrel/ccc/commit/a48cccfae3ce6b3456a5eb863f207e7e5a6e568f)]:
29
+ - @ckb-ccc/core@1.3.1
30
+
31
+ ## 1.0.8
32
+
33
+ ### Patch Changes
34
+
35
+ - Updated dependencies [[`4dbf4fd`](https://github.com/ckb-devrel/ccc/commit/4dbf4fd8021cf14d05282706a7667ea7d108fb09), [`4c76f9e`](https://github.com/ckb-devrel/ccc/commit/4c76f9e2a93a226fcfc4c32a5378bb531bfff08f), [`c2c4c26`](https://github.com/ckb-devrel/ccc/commit/c2c4c264e04461948e4b913b2f22054e6032ddc8), [`b6a73fa`](https://github.com/ckb-devrel/ccc/commit/b6a73fa9628ebdff51cb8f246309654cd53e36f2), [`8c97c85`](https://github.com/ckb-devrel/ccc/commit/8c97c851db4a2d940c7e59116ca7620cfd0afae1)]:
36
+ - @ckb-ccc/core@1.3.0
37
+
38
+ ## 1.0.7
39
+
40
+ ### Patch Changes
41
+
42
+ - Updated dependencies [[`01263bd`](https://github.com/ckb-devrel/ccc/commit/01263bd8c601fa8fcdfa24be52601716e1864843)]:
43
+ - @ckb-ccc/core@1.2.3
44
+
45
+ ## 1.0.6
46
+
47
+ ### Patch Changes
48
+
49
+ - Updated dependencies [[`7886e3d`](https://github.com/ckb-devrel/ccc/commit/7886e3d89e9ca8f3514a2044c6dd4e8ec6b49933)]:
50
+ - @ckb-ccc/core@1.2.2
51
+
52
+ ## 1.0.5
53
+
54
+ ### Patch Changes
55
+
56
+ - Updated dependencies [[`94e2618`](https://github.com/ckb-devrel/ccc/commit/94e26182515e09d6086ec5b653d091f117a499e6)]:
57
+ - @ckb-ccc/core@1.2.1
58
+
59
+ ## 1.0.4
60
+
61
+ ### Patch Changes
62
+
63
+ - Updated dependencies [[`128e87b`](https://github.com/ckb-devrel/ccc/commit/128e87b5ca3e97bfe7842e76f786aa6aec010797)]:
64
+ - @ckb-ccc/core@1.2.0
65
+
66
+ ## 1.0.3
67
+
68
+ ### Patch Changes
69
+
70
+ - Updated dependencies [[`925991c`](https://github.com/ckb-devrel/ccc/commit/925991c8a24b1f34667e30b28b69812e936e3928)]:
71
+ - @ckb-ccc/core@1.1.1
72
+
73
+ ## 1.0.2
74
+
75
+ ### Patch Changes
76
+
77
+ - Updated dependencies [[`ddc0a28`](https://github.com/ckb-devrel/ccc/commit/ddc0a281c3d1dfa6ebc990dae92994f026dfddcc)]:
78
+ - @ckb-ccc/core@1.1.0
79
+
80
+ ## 1.0.1
81
+
82
+ ### Patch Changes
83
+
84
+ - Updated dependencies [[`719055b`](https://github.com/ckb-devrel/ccc/commit/719055b404f31b40362f51714b9f11c85b857581), [`94caaca`](https://github.com/ckb-devrel/ccc/commit/94caaca11c63752a25282d42f51161c94397dec6)]:
85
+ - @ckb-ccc/core@1.0.1
86
+
87
+ ## 1.0.0
88
+
89
+ ### Major Changes
90
+
91
+ - [#107](https://github.com/ckb-devrel/ccc/pull/107) [`b99f55f`](https://github.com/ckb-devrel/ccc/commit/b99f55f74e64106391ce53f7d0bd0fa7522023cc) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat: molecule
92
+
93
+ ### Patch Changes
94
+
95
+ - Updated dependencies [[`b99f55f`](https://github.com/ckb-devrel/ccc/commit/b99f55f74e64106391ce53f7d0bd0fa7522023cc)]:
96
+ - @ckb-ccc/core@1.0.0
97
+
98
+ ## 0.0.18
99
+
100
+ ### Patch Changes
101
+
102
+ - Updated dependencies [[`c1cb910`](https://github.com/ckb-devrel/ccc/commit/c1cb91091780c7b33fbbd683ef8edc9f11452ecd)]:
103
+ - @ckb-ccc/core@0.1.2
104
+
105
+ ## 0.0.17
106
+
107
+ ### Patch Changes
108
+
109
+ - [#101](https://github.com/ckb-devrel/ccc/pull/101) [`d9affcc`](https://github.com/ckb-devrel/ccc/commit/d9affcc01c7b839b227e4d79bcb66e717577502a) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix: commonjs
110
+
111
+ - Updated dependencies [[`d9affcc`](https://github.com/ckb-devrel/ccc/commit/d9affcc01c7b839b227e4d79bcb66e717577502a)]:
112
+ - @ckb-ccc/core@0.1.1
113
+
114
+ ## 0.0.16
115
+
116
+ ### Patch Changes
117
+
118
+ - [#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
119
+
120
+ - Updated dependencies [[`a3d5359`](https://github.com/ckb-devrel/ccc/commit/a3d53595f6dd11f2f59cdf0086b3d7ce558a2fdd), [`8824ff2`](https://github.com/ckb-devrel/ccc/commit/8824ff27af3b76186f1a7d6db8c907cd66f09d6a), [`f07a506`](https://github.com/ckb-devrel/ccc/commit/f07a506bd6fc27fe659a17d2f7baaeec54716d81), [`f21d7e4`](https://github.com/ckb-devrel/ccc/commit/f21d7e4cf422edab4a836ef6d678b620594fef8d), [`acfc050`](https://github.com/ckb-devrel/ccc/commit/acfc0502cd6beb48b9310dec8411dcd630507366), [`1720d5a`](https://github.com/ckb-devrel/ccc/commit/1720d5a398543f1c6e24763eeaf15d84cd2214bf), [`e63a06e`](https://github.com/ckb-devrel/ccc/commit/e63a06ee75ac8595208d216dec88a4228c465e23), [`c092988`](https://github.com/ckb-devrel/ccc/commit/c092988e7765b9ac79498d6bd72a6a2f62859b6f), [`50f2ce0`](https://github.com/ckb-devrel/ccc/commit/50f2ce08e74cb3fbeae926267d42e28b426fd7f4), [`4709384`](https://github.com/ckb-devrel/ccc/commit/4709384e37188991cb937b16f99f47ca82c912b8)]:
121
+ - @ckb-ccc/core@0.1.0
122
+
123
+ ## 0.0.16-alpha.7
124
+
125
+ ### Patch Changes
126
+
127
+ - Updated dependencies [[`f07a506`](https://github.com/ckb-devrel/ccc/commit/f07a506bd6fc27fe659a17d2f7baaeec54716d81)]:
128
+ - @ckb-ccc/core@0.1.0-alpha.7
129
+
130
+ ## 0.0.16-alpha.6
131
+
132
+ ### Patch Changes
133
+
134
+ - Updated dependencies [[`4709384`](https://github.com/ckb-devrel/ccc/commit/4709384e37188991cb937b16f99f47ca82c912b8)]:
135
+ - @ckb-ccc/core@0.1.0-alpha.6
136
+
137
+ ## 0.0.16-alpha.5
138
+
139
+ ### Patch Changes
140
+
141
+ - Updated dependencies [[`50f2ce0`](https://github.com/ckb-devrel/ccc/commit/50f2ce08e74cb3fbeae926267d42e28b426fd7f4)]:
142
+ - @ckb-ccc/core@0.1.0-alpha.5
143
+
144
+ ## 0.0.16-alpha.4
145
+
146
+ ### Patch Changes
147
+
148
+ - Updated dependencies [[`f21d7e4`](https://github.com/ckb-devrel/ccc/commit/f21d7e4cf422edab4a836ef6d678b620594fef8d)]:
149
+ - @ckb-ccc/core@0.1.0-alpha.4
150
+
151
+ ## 0.0.16-alpha.3
152
+
153
+ ### Patch Changes
154
+
155
+ - Updated dependencies [[`a3d5359`](https://github.com/ckb-devrel/ccc/commit/a3d53595f6dd11f2f59cdf0086b3d7ce558a2fdd)]:
156
+ - @ckb-ccc/core@0.0.16-alpha.3
157
+
158
+ ## 0.0.16-alpha.2
159
+
160
+ ### Patch Changes
161
+
162
+ - [#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
163
+
164
+ - Updated dependencies [[`acfc050`](https://github.com/ckb-devrel/ccc/commit/acfc0502cd6beb48b9310dec8411dcd630507366)]:
165
+ - @ckb-ccc/core@0.0.16-alpha.2
166
+
167
+ ## 0.0.16-alpha.1
168
+
169
+ ### Patch Changes
170
+
171
+ - Updated dependencies [[`8824ff2`](https://github.com/ckb-devrel/ccc/commit/8824ff27af3b76186f1a7d6db8c907cd66f09d6a), [`c092988`](https://github.com/ckb-devrel/ccc/commit/c092988e7765b9ac79498d6bd72a6a2f62859b6f)]:
172
+ - @ckb-ccc/core@0.0.16-alpha.1
173
+
174
+ ## 0.0.16-alpha.0
175
+
176
+ ### Patch Changes
177
+
178
+ - Updated dependencies [[`1720d5a`](https://github.com/ckb-devrel/ccc/commit/1720d5a398543f1c6e24763eeaf15d84cd2214bf)]:
179
+ - @ckb-ccc/core@0.0.16-alpha.0
180
+
181
+ ## 0.0.15
182
+
183
+ ### Patch Changes
184
+
185
+ - Updated dependencies [[`8f2560a`](https://github.com/ckb-devrel/ccc/commit/8f2560ab0e5619654fff7c5eacda8425385f908e)]:
186
+ - @ckb-ccc/core@0.0.15
187
+
188
+ ## 0.0.14
189
+
190
+ ### Patch Changes
191
+
192
+ - 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)]:
193
+ - @ckb-ccc/core@0.0.14
194
+
195
+ ## 0.0.14-alpha.2
196
+
197
+ ### Patch Changes
198
+
199
+ - Updated dependencies [[`7ba62a0`](https://github.com/ckb-devrel/ccc/commit/7ba62a056f17808fe5684786c00c2dff80bb7d1d)]:
200
+ - @ckb-ccc/core@0.0.14-alpha.2
201
+
202
+ ## 0.0.14-alpha.1
203
+
204
+ ### Patch Changes
205
+
206
+ - 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)]:
207
+ - @ckb-ccc/core@0.0.14-alpha.1
208
+
209
+ ## 0.0.14-alpha.0
210
+
211
+ ### Patch Changes
212
+
213
+ - Updated dependencies [[`f5b5938`](https://github.com/ckb-devrel/ccc/commit/f5b5938ab8f9c0a338dfd6765fe717f7ad1b1dd8), [`2164efd`](https://github.com/ckb-devrel/ccc/commit/2164efd6d834c1917ad5f4a514dc25941f937185)]:
214
+ - @ckb-ccc/core@0.0.14-alpha.0
215
+
216
+ ## 0.0.13
217
+
218
+ ### Patch Changes
219
+
220
+ - [`6d62032`](https://github.com/ckb-devrel/ccc/commit/6d620326f42f8c48eff9deb95578cf28d7bf5c97) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(core): recordCells should not add usableCells
221
+
222
+ - [`3658797`](https://github.com/ckb-devrel/ccc/commit/3658797e67c42c56b20fa66481d0455ed019e69f) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): node.js websocket
223
+
224
+ - [`44c7fee`](https://github.com/ckb-devrel/ccc/commit/44c7feed37369836268fba21884418682f15254b) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(core): completeInputs
225
+
226
+ - [`079e20e`](https://github.com/ckb-devrel/ccc/commit/079e20ef14cf9a7c06bbaddf3e92cbfbb005da11) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): more APIs. Since parsing.
227
+
228
+ - [`ed154d1`](https://github.com/ckb-devrel/ccc/commit/ed154d189e239907ad686ec51ac8133b6d5eb895) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): Signer.findCells
229
+
230
+ - 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)]:
231
+ - @ckb-ccc/core@0.0.13
232
+
233
+ ## 0.0.13-alpha.8
234
+
235
+ ### Patch Changes
236
+
237
+ - 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)]:
238
+ - @ckb-ccc/core@0.0.13-alpha.8
239
+
240
+ ## 0.0.13-alpha.7
241
+
242
+ ### Patch Changes
243
+
244
+ - [`079e20e`](https://github.com/ckb-devrel/ccc/commit/079e20ef14cf9a7c06bbaddf3e92cbfbb005da11) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): more APIs. Since parsing.
245
+
246
+ - [`ed154d1`](https://github.com/ckb-devrel/ccc/commit/ed154d189e239907ad686ec51ac8133b6d5eb895) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): Signer.findCells
247
+
248
+ - 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)]:
249
+ - @ckb-ccc/core@0.0.13-alpha.7
250
+
251
+ ## 0.0.13-alpha.6
252
+
253
+ ### Patch Changes
254
+
255
+ - [`44c7fee`](https://github.com/ckb-devrel/ccc/commit/44c7feed37369836268fba21884418682f15254b) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(core): completeInputs
256
+
257
+ - Updated dependencies [[`69c10fd`](https://github.com/ckb-devrel/ccc/commit/69c10fdfcd507433c13b15d17015dca4687afb97), [`44c7fee`](https://github.com/ckb-devrel/ccc/commit/44c7feed37369836268fba21884418682f15254b)]:
258
+ - @ckb-ccc/core@0.0.13-alpha.6
259
+
260
+ ## 0.0.13-alpha.5
261
+
262
+ ### Patch Changes
263
+
264
+ - [`6d62032`](https://github.com/ckb-devrel/ccc/commit/6d620326f42f8c48eff9deb95578cf28d7bf5c97) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(core): recordCells should not add usableCells
265
+
266
+ - Updated dependencies [[`6d62032`](https://github.com/ckb-devrel/ccc/commit/6d620326f42f8c48eff9deb95578cf28d7bf5c97)]:
267
+ - @ckb-ccc/core@0.0.13-alpha.5
268
+
269
+ ## 0.0.13-alpha.4
270
+
271
+ ### Patch Changes
272
+
273
+ - [`3658797`](https://github.com/ckb-devrel/ccc/commit/3658797e67c42c56b20fa66481d0455ed019e69f) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): node.js websocket
274
+
275
+ - Updated dependencies [[`3658797`](https://github.com/ckb-devrel/ccc/commit/3658797e67c42c56b20fa66481d0455ed019e69f), [`642f731`](https://github.com/ckb-devrel/ccc/commit/642f7317f4951ef801f1245aea96c40b4b6fb73e)]:
276
+ - @ckb-ccc/core@0.0.13-alpha.4
277
+
278
+ ## 0.0.13-alpha.3
279
+
280
+ ### Patch Changes
281
+
282
+ - Updated dependencies [[`1f999f8`](https://github.com/ckb-devrel/ccc/commit/1f999f854beb255b3cd9dbbc5a7268e75442b3db)]:
283
+ - @ckb-ccc/core@0.0.13-alpha.3
284
+
285
+ ## 0.0.13-alpha.2
286
+
287
+ ### Patch Changes
288
+
289
+ - Updated dependencies [[`96dbb61`](https://github.com/ckb-devrel/ccc/commit/96dbb6107d2071b9383350ddd578557746227054)]:
290
+ - @ckb-ccc/core@0.0.13-alpha.2
291
+
292
+ ## 0.0.13-alpha.1
293
+
294
+ ### Patch Changes
295
+
296
+ - Updated dependencies [[`3378e85`](https://github.com/ckb-devrel/ccc/commit/3378e85b32797f5cdc1943b9ecaca1fd1d9fad5e), [`a69a9dc`](https://github.com/ckb-devrel/ccc/commit/a69a9dc0c722f7b4cfa36b2ae8ecba4dcde0db90)]:
297
+ - @ckb-ccc/core@0.0.13-alpha.1
298
+
299
+ ## 0.0.13-alpha.0
300
+
301
+ ### Patch Changes
302
+
303
+ - Updated dependencies [[`600cc13`](https://github.com/ckb-devrel/ccc/commit/600cc137ac6eb7c5b2533670de6df29d82f1b9e1)]:
304
+ - @ckb-ccc/core@0.0.13-alpha.0
305
+
306
+ ## 0.0.12
307
+
308
+ ### Patch Changes
309
+
310
+ - [`6bee006`](https://github.com/ckb-devrel/ccc/commit/6bee006fbcb96986c65ca4d2d896fca21db2503b) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(connector): catch connecting error
311
+
312
+ - Updated dependencies []:
313
+ - @ckb-ccc/core@0.0.12
314
+
315
+ ## 0.0.12-alpha.2
316
+
317
+ ### Patch Changes
318
+
319
+ - fix(connector): catch connecting error
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ <p align="center">
2
+ <a href="https://app.ckbccc.com/">
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
+ </a>
5
+ </p>
6
+
7
+ <h1 align="center" style="font-size: 48px;">
8
+ CCC's support for NIP07
9
+ </h1>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/@ckb-ccc/nip07"><img
13
+ alt="NPM Version" src="https://img.shields.io/npm/v/%40ckb-ccc%2Fnip07"
14
+ /></a>
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
+ <a href="https://live.ckbccc.com/"><img
19
+ alt="Playground" src="https://img.shields.io/website?url=https%3A%2F%2Flive.ckbccc.com%2F&label=Playground"
20
+ /></a>
21
+ <a href="https://app.ckbccc.com/"><img
22
+ alt="App" src="https://img.shields.io/website?url=https%3A%2F%2Fapp.ckbccc.com%2F&label=App"
23
+ /></a>
24
+ <a href="https://docs.ckbccc.com/"><img
25
+ alt="Docs" src="https://img.shields.io/website?url=https%3A%2F%2Fdocs.ckbccc.com%2F&label=Docs"
26
+ /></a>
27
+ </p>
28
+
29
+ <p align="center">
30
+ CCC - CKBers' Codebase is a one-stop solution for your CKB JS/TS ecosystem development.
31
+ <br />
32
+ Empower yourself with CCC to discover the unlimited potential of CKB.
33
+ <br />
34
+ Interoperate with wallets from different chain ecosystems.
35
+ <br />
36
+ Fully enabling CKB's Turing completeness and cryptographic freedom power.
37
+ </p>
38
+
39
+ <h3 align="center">
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>.
41
+ </h3>
@@ -0,0 +1,2 @@
1
+ export * as Nip07A from "./nip07.advanced.js";
2
+ //# sourceMappingURL=advanced.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"advanced.d.ts","sourceRoot":"","sources":["../src/advanced.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1 @@
1
+ export * as Nip07A from "./nip07.advanced.js";
@@ -0,0 +1,3 @@
1
+ export * from "./signer.js";
2
+ export * from "./signersFactory.js";
3
+ //# sourceMappingURL=barrel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"barrel.d.ts","sourceRoot":"","sources":["../src/barrel.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC"}
package/dist/barrel.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./signer.js";
2
+ export * from "./signersFactory.js";
@@ -0,0 +1,2 @@
1
+ export * as Nip07 from "./barrel.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * as Nip07 from "./barrel.js";
@@ -0,0 +1,6 @@
1
+ import { ccc } from "@ckb-ccc/core";
2
+ export interface Provider {
3
+ getPublicKey(): Promise<string>;
4
+ signEvent(event: ccc.NostrEvent): Promise<Required<ccc.NostrEvent>>;
5
+ }
6
+ //# sourceMappingURL=nip07.advanced.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nip07.advanced.d.ts","sourceRoot":"","sources":["../src/nip07.advanced.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,MAAM,WAAW,QAAQ;IACvB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;CACrE"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -0,0 +1,15 @@
1
+ import { ccc } from "@ckb-ccc/core";
2
+ import { Provider } from "./nip07.advanced.js";
3
+ /**
4
+ * @public
5
+ */
6
+ export declare class Signer extends ccc.SignerNostr {
7
+ readonly provider: Provider;
8
+ private publicKeyCache?;
9
+ constructor(client: ccc.Client, provider: Provider);
10
+ getNostrPublicKey(): Promise<ccc.Hex>;
11
+ signNostrEvent(event: ccc.NostrEvent): Promise<Required<ccc.NostrEvent>>;
12
+ connect(): Promise<void>;
13
+ isConnected(): Promise<boolean>;
14
+ }
15
+ //# sourceMappingURL=signer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../src/signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C;;GAEG;AACH,qBAAa,MAAO,SAAQ,GAAG,CAAC,WAAW;aAKvB,QAAQ,EAAE,QAAQ;IAJpC,OAAO,CAAC,cAAc,CAAC,CAA8B;gBAGnD,MAAM,EAAE,GAAG,CAAC,MAAM,EACF,QAAQ,EAAE,QAAQ;IAK9B,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAWrC,cAAc,CAClB,KAAK,EAAE,GAAG,CAAC,UAAU,GACpB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAO9B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxB,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;CAGtC"}
package/dist/signer.js ADDED
@@ -0,0 +1,32 @@
1
+ import { ccc } from "@ckb-ccc/core";
2
+ /**
3
+ * @public
4
+ */
5
+ export class Signer extends ccc.SignerNostr {
6
+ constructor(client, provider) {
7
+ super(client);
8
+ this.provider = provider;
9
+ this.publicKeyCache = undefined;
10
+ }
11
+ async getNostrPublicKey() {
12
+ if (!this.publicKeyCache) {
13
+ this.publicKeyCache = this.provider.getPublicKey().catch((e) => {
14
+ this.publicKeyCache = undefined;
15
+ throw e;
16
+ });
17
+ }
18
+ return ccc.hexFrom(await this.publicKeyCache);
19
+ }
20
+ async signNostrEvent(event) {
21
+ return this.provider.signEvent({
22
+ ...event,
23
+ pubkey: await this.publicKeyCache,
24
+ });
25
+ }
26
+ async connect() {
27
+ await this.getNostrPublicKey();
28
+ }
29
+ async isConnected() {
30
+ return true;
31
+ }
32
+ }
@@ -0,0 +1,7 @@
1
+ import { ccc } from "@ckb-ccc/core";
2
+ import { Signer } from "./signer.js";
3
+ /**
4
+ * @public
5
+ */
6
+ export declare function getNip07Signer(client: ccc.Client): Signer | undefined;
7
+ //# sourceMappingURL=signersFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signersFactory.d.ts","sourceRoot":"","sources":["../src/signersFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,SAAS,CAQrE"}
@@ -0,0 +1,11 @@
1
+ import { Signer } from "./signer.js";
2
+ /**
3
+ * @public
4
+ */
5
+ export function getNip07Signer(client) {
6
+ const windowRef = window;
7
+ if (typeof windowRef.nostr === "undefined") {
8
+ return;
9
+ }
10
+ return new Signer(client, windowRef.nostr);
11
+ }
@@ -0,0 +1,2 @@
1
+ export * as Nip07A from "./nip07.advanced.js";
2
+ //# sourceMappingURL=advanced.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"advanced.d.ts","sourceRoot":"","sources":["../src/advanced.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Nip07A = void 0;
37
+ exports.Nip07A = __importStar(require("./nip07.advanced.js"));
@@ -0,0 +1,3 @@
1
+ export * from "./signer.js";
2
+ export * from "./signersFactory.js";
3
+ //# sourceMappingURL=barrel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"barrel.d.ts","sourceRoot":"","sources":["../src/barrel.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./signer.js"), exports);
18
+ __exportStar(require("./signersFactory.js"), exports);
@@ -0,0 +1,2 @@
1
+ export * as Nip07 from "./barrel.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Nip07 = void 0;
37
+ exports.Nip07 = __importStar(require("./barrel.js"));
@@ -0,0 +1,6 @@
1
+ import { ccc } from "@ckb-ccc/core";
2
+ export interface Provider {
3
+ getPublicKey(): Promise<string>;
4
+ signEvent(event: ccc.NostrEvent): Promise<Required<ccc.NostrEvent>>;
5
+ }
6
+ //# sourceMappingURL=nip07.advanced.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nip07.advanced.d.ts","sourceRoot":"","sources":["../src/nip07.advanced.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,MAAM,WAAW,QAAQ;IACvB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;CACrE"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,15 @@
1
+ import { ccc } from "@ckb-ccc/core";
2
+ import { Provider } from "./nip07.advanced.js";
3
+ /**
4
+ * @public
5
+ */
6
+ export declare class Signer extends ccc.SignerNostr {
7
+ readonly provider: Provider;
8
+ private publicKeyCache?;
9
+ constructor(client: ccc.Client, provider: Provider);
10
+ getNostrPublicKey(): Promise<ccc.Hex>;
11
+ signNostrEvent(event: ccc.NostrEvent): Promise<Required<ccc.NostrEvent>>;
12
+ connect(): Promise<void>;
13
+ isConnected(): Promise<boolean>;
14
+ }
15
+ //# sourceMappingURL=signer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../src/signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C;;GAEG;AACH,qBAAa,MAAO,SAAQ,GAAG,CAAC,WAAW;aAKvB,QAAQ,EAAE,QAAQ;IAJpC,OAAO,CAAC,cAAc,CAAC,CAA8B;gBAGnD,MAAM,EAAE,GAAG,CAAC,MAAM,EACF,QAAQ,EAAE,QAAQ;IAK9B,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;IAWrC,cAAc,CAClB,KAAK,EAAE,GAAG,CAAC,UAAU,GACpB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAO9B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxB,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;CAGtC"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Signer = void 0;
4
+ const core_1 = require("@ckb-ccc/core");
5
+ /**
6
+ * @public
7
+ */
8
+ class Signer extends core_1.ccc.SignerNostr {
9
+ constructor(client, provider) {
10
+ super(client);
11
+ this.provider = provider;
12
+ this.publicKeyCache = undefined;
13
+ }
14
+ async getNostrPublicKey() {
15
+ if (!this.publicKeyCache) {
16
+ this.publicKeyCache = this.provider.getPublicKey().catch((e) => {
17
+ this.publicKeyCache = undefined;
18
+ throw e;
19
+ });
20
+ }
21
+ return core_1.ccc.hexFrom(await this.publicKeyCache);
22
+ }
23
+ async signNostrEvent(event) {
24
+ return this.provider.signEvent({
25
+ ...event,
26
+ pubkey: await this.publicKeyCache,
27
+ });
28
+ }
29
+ async connect() {
30
+ await this.getNostrPublicKey();
31
+ }
32
+ async isConnected() {
33
+ return true;
34
+ }
35
+ }
36
+ exports.Signer = Signer;
@@ -0,0 +1,7 @@
1
+ import { ccc } from "@ckb-ccc/core";
2
+ import { Signer } from "./signer.js";
3
+ /**
4
+ * @public
5
+ */
6
+ export declare function getNip07Signer(client: ccc.Client): Signer | undefined;
7
+ //# sourceMappingURL=signersFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signersFactory.d.ts","sourceRoot":"","sources":["../src/signersFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,SAAS,CAQrE"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getNip07Signer = getNip07Signer;
4
+ const signer_js_1 = require("./signer.js");
5
+ /**
6
+ * @public
7
+ */
8
+ function getNip07Signer(client) {
9
+ const windowRef = window;
10
+ if (typeof windowRef.nostr === "undefined") {
11
+ return;
12
+ }
13
+ return new signer_js_1.Signer(client, windowRef.nostr);
14
+ }
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@ckb-ccc/nip07",
3
+ "version": "0.0.0-canary-20250214032000",
4
+ "description": "CCC - CKBer's Codebase. Common Chains Connector's support for NIP07",
5
+ "author": "Hanssen0 <hanssen0@hanssen0.com>",
6
+ "license": "MIT",
7
+ "private": false,
8
+ "homepage": "https://github.com/ckb-devrel/ccc",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git://github.com/ckb-devrel/ccc.git"
12
+ },
13
+ "sideEffects": false,
14
+ "main": "dist.commonjs/index.js",
15
+ "module": "dist/index.js",
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/index.js",
19
+ "require": "./dist.commonjs/index.js",
20
+ "default": "./dist.commonjs/index.js"
21
+ },
22
+ "./advanced": {
23
+ "import": "./dist/advanced.js",
24
+ "require": "./dist.commonjs/advanced.js",
25
+ "default": "./dist.commonjs/advanced.js"
26
+ }
27
+ },
28
+ "devDependencies": {
29
+ "@eslint/js": "^9.1.1",
30
+ "copyfiles": "^2.4.1",
31
+ "eslint": "^9.1.0",
32
+ "eslint-config-prettier": "^9.1.0",
33
+ "eslint-plugin-prettier": "^5.1.3",
34
+ "prettier": "^3.2.5",
35
+ "prettier-plugin-organize-imports": "^3.2.4",
36
+ "rimraf": "^5.0.5",
37
+ "typescript": "^5.4.5",
38
+ "typescript-eslint": "^7.7.0"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "dependencies": {
44
+ "@ckb-ccc/core": "0.0.0-canary-20250214032000"
45
+ },
46
+ "scripts": {
47
+ "build": "rimraf ./dist && rimraf ./dist.commonjs && tsc && tsc --project tsconfig.commonjs.json && copyfiles -u 2 misc/basedirs/**/* .",
48
+ "lint": "eslint ./src",
49
+ "format": "prettier --write . && eslint --fix ./src"
50
+ }
51
+ }
@@ -0,0 +1 @@
1
+ export * as Nip07A from "./nip07.advanced.js";
package/src/barrel.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./signer.js";
2
+ export * from "./signersFactory.js";
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * as Nip07 from "./barrel.js";
@@ -0,0 +1,6 @@
1
+ import { ccc } from "@ckb-ccc/core";
2
+
3
+ export interface Provider {
4
+ getPublicKey(): Promise<string>;
5
+ signEvent(event: ccc.NostrEvent): Promise<Required<ccc.NostrEvent>>;
6
+ }
package/src/signer.ts ADDED
@@ -0,0 +1,44 @@
1
+ import { ccc } from "@ckb-ccc/core";
2
+ import { Provider } from "./nip07.advanced.js";
3
+
4
+ /**
5
+ * @public
6
+ */
7
+ export class Signer extends ccc.SignerNostr {
8
+ private publicKeyCache?: Promise<string> = undefined;
9
+
10
+ constructor(
11
+ client: ccc.Client,
12
+ public readonly provider: Provider,
13
+ ) {
14
+ super(client);
15
+ }
16
+
17
+ async getNostrPublicKey(): Promise<ccc.Hex> {
18
+ if (!this.publicKeyCache) {
19
+ this.publicKeyCache = this.provider.getPublicKey().catch((e) => {
20
+ this.publicKeyCache = undefined;
21
+ throw e;
22
+ });
23
+ }
24
+
25
+ return ccc.hexFrom(await this.publicKeyCache);
26
+ }
27
+
28
+ async signNostrEvent(
29
+ event: ccc.NostrEvent,
30
+ ): Promise<Required<ccc.NostrEvent>> {
31
+ return this.provider.signEvent({
32
+ ...event,
33
+ pubkey: await this.publicKeyCache,
34
+ });
35
+ }
36
+
37
+ async connect(): Promise<void> {
38
+ await this.getNostrPublicKey();
39
+ }
40
+
41
+ async isConnected(): Promise<boolean> {
42
+ return true;
43
+ }
44
+ }
@@ -0,0 +1,16 @@
1
+ import { ccc } from "@ckb-ccc/core";
2
+ import { Provider } from "./nip07.advanced.js";
3
+ import { Signer } from "./signer.js";
4
+
5
+ /**
6
+ * @public
7
+ */
8
+ export function getNip07Signer(client: ccc.Client): Signer | undefined {
9
+ const windowRef = window as { nostr?: Provider };
10
+
11
+ if (typeof windowRef.nostr === "undefined") {
12
+ return;
13
+ }
14
+
15
+ return new Signer(client, windowRef.nostr);
16
+ }
package/typedoc.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://typedoc.org/schema.json",
3
+ "entryPoints": ["./src/index.ts", "./src/advanced.ts"],
4
+ "extends": ["../../typedoc.base.json"],
5
+ "name": "@ckb-ccc nip07"
6
+ }