@prosopo/keyring 2.9.0 → 2.9.34

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @prosopo/keyring@2.9.0 build:cjs
2
+ > @prosopo/keyring@2.9.34 build:cjs
3
3
  > NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
4
4
 
5
5
  ViteCommonJSConfig: .
@@ -7,8 +7,9 @@ ViteCommonJSConfig: .
7
7
  tsConfigPaths: [
8
8
  '/home/runner/work/captcha/captcha/packages/common/tsconfig.json',
9
9
  '/home/runner/work/captcha/captcha/packages/locale/tsconfig.json',
10
- '/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
10
+ '/home/runner/work/captcha/captcha/packages/logger/tsconfig.json',
11
11
  '/home/runner/work/captcha/captcha/packages/util/tsconfig.json',
12
+ '/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
12
13
  '/home/runner/work/captcha/captcha/packages/util-crypto/tsconfig.json'
13
14
  ]
14
15
  }
@@ -16,8 +17,9 @@ ViteCommonJSConfig: .
16
17
  externals: [
17
18
  '@prosopo/common',
18
19
  '@prosopo/locale',
19
- '@prosopo/types',
20
+ '@prosopo/logger',
20
21
  '@prosopo/util',
22
+ '@prosopo/types',
21
23
  '@prosopo/util-crypto'
22
24
  ]
23
25
  }
@@ -35,9 +37,9 @@ rendering chunks...
35
37
  dist/cjs/pair/encode.cjs  0.80 kB
36
38
  dist/cjs/keyring/pairs.cjs  0.83 kB
37
39
  dist/cjs/index.cjs  0.87 kB
38
- dist/cjs/accounts/testAccounts.cjs  1.29 kB
40
+ dist/cjs/accounts/testAccounts.cjs  1.39 kB
39
41
  dist/cjs/accounts/getPair.cjs  1.48 kB
40
42
  dist/cjs/pair/decode.cjs  1.49 kB
41
43
  dist/cjs/pair/index.cjs  5.24 kB
42
44
  dist/cjs/keyring/keyring.cjs 10.59 kB
43
- ✓ built in 358ms
45
+ ✓ built in 345ms
@@ -1,29 +1,32 @@
1
1
 
2
- > @prosopo/keyring@2.9.0 build:tsc
2
+ > @prosopo/keyring@2.9.34 build:tsc
3
3
  > tsc --build --verbose
4
4
 
5
- 4:56:53 PM - Projects in this build:
5
+ 8:14:34 AM - Projects in this build:
6
6
  * ../../dev/config/tsconfig.json
7
7
  * ../locale/tsconfig.json
8
8
  * ../util/tsconfig.json
9
+ * ../logger/tsconfig.json
9
10
  * ../util-crypto/tsconfig.json
10
11
  * ../types/tsconfig.json
11
12
  * ../common/tsconfig.json
12
13
  * tsconfig.json
13
14
 
14
- 4:56:53 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/dependencies.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
15
+ 8:14:34 AM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
15
16
 
16
- 4:56:53 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
17
+ 8:14:34 AM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
17
18
 
18
- 4:56:53 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/verifyRecency.ts' is older than output '../util/tsconfig.tsbuildinfo'
19
+ 8:14:34 AM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
19
20
 
20
- 4:56:53 PM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
21
+ 8:14:34 AM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
21
22
 
22
- 4:56:53 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/procaptcha/api.ts' is older than output '../types/tsconfig.tsbuildinfo'
23
+ 8:14:34 AM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
23
24
 
24
- 4:56:53 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/logger.ts' is older than output '../common/tsconfig.tsbuildinfo'
25
+ 8:14:34 AM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/procaptcha/api.ts' is older than output '../types/tsconfig.tsbuildinfo'
25
26
 
26
- 4:56:53 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
27
+ 8:14:34 AM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/error.ts' is older than output '../common/tsconfig.tsbuildinfo'
27
28
 
28
- 4:56:53 PM - Building project '/home/runner/work/captcha/captcha/packages/keyring/tsconfig.json'...
29
+ 8:14:34 AM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
30
+
31
+ 8:14:34 AM - Building project '/home/runner/work/captcha/captcha/packages/keyring/tsconfig.json'...
29
32
 
@@ -1,9 +1,9 @@
1
1
 
2
- > @prosopo/keyring@2.9.0 build
2
+ > @prosopo/keyring@2.9.34 build
3
3
  > npm run build:cross-env -- --mode ${NODE_ENV:-development}
4
4
 
5
5
 
6
- > @prosopo/keyring@2.9.0 build:cross-env
6
+ > @prosopo/keyring@2.9.34 build:cross-env
7
7
  > vite build --config vite.esm.config.ts --mode production
8
8
 
9
9
  ViteEsmConfig: .
@@ -11,8 +11,9 @@ ViteEsmConfig: .
11
11
  tsConfigPaths: [
12
12
  '/home/runner/work/captcha/captcha/packages/common/tsconfig.json',
13
13
  '/home/runner/work/captcha/captcha/packages/locale/tsconfig.json',
14
- '/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
14
+ '/home/runner/work/captcha/captcha/packages/logger/tsconfig.json',
15
15
  '/home/runner/work/captcha/captcha/packages/util/tsconfig.json',
16
+ '/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
16
17
  '/home/runner/work/captcha/captcha/packages/util-crypto/tsconfig.json'
17
18
  ]
18
19
  }
@@ -20,8 +21,9 @@ ViteEsmConfig: .
20
21
  externals: [
21
22
  '@prosopo/common',
22
23
  '@prosopo/locale',
23
- '@prosopo/types',
24
+ '@prosopo/logger',
24
25
  '@prosopo/util',
26
+ '@prosopo/types',
25
27
  '@prosopo/util-crypto'
26
28
  ]
27
29
  }
@@ -39,9 +41,9 @@ rendering chunks...
39
41
  dist/accounts/mnemonic.js  0.63 kB
40
42
  dist/pair/encode.js  0.68 kB
41
43
  dist/keyring/pairs.js  0.70 kB
42
- dist/accounts/testAccounts.js  1.14 kB
44
+ dist/accounts/testAccounts.js  1.23 kB
43
45
  dist/pair/decode.js  1.31 kB
44
46
  dist/accounts/getPair.js  1.34 kB
45
47
  dist/pair/index.js  5.18 kB
46
48
  dist/keyring/keyring.js 10.45 kB
47
- ✓ built in 346ms
49
+ ✓ built in 340ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,257 @@
1
1
  # @prosopo/keyring
2
2
 
3
+ ## 2.9.34
4
+ ### Patch Changes
5
+
6
+ - Updated dependencies [a1d60db]
7
+ - Updated dependencies [2392aaf]
8
+ - Updated dependencies [6ca1125]
9
+ - @prosopo/types@4.3.0
10
+ - @prosopo/util@3.2.15
11
+ - @prosopo/common@3.1.38
12
+
13
+ ## 2.9.33
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [6c26669]
17
+ - Updated dependencies [f7f9ec5]
18
+ - @prosopo/types@4.2.1
19
+
20
+ ## 2.9.32
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies [0fd81af]
24
+ - @prosopo/common@3.1.37
25
+
26
+ ## 2.9.31
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [20cae63]
30
+ - Updated dependencies [4d9923e]
31
+ - @prosopo/types@4.2.0
32
+
33
+ ## 2.9.30
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies [d351362]
37
+ - @prosopo/types@4.1.4
38
+
39
+ ## 2.9.29
40
+ ### Patch Changes
41
+
42
+ - Updated dependencies [6567ce0]
43
+ - Updated dependencies [e2711ae]
44
+ - Updated dependencies [5786629]
45
+ - @prosopo/util@3.2.14
46
+ - @prosopo/types@4.1.3
47
+ - @prosopo/common@3.1.36
48
+
49
+ ## 2.9.28
50
+ ### Patch Changes
51
+
52
+ - Updated dependencies [72a1218]
53
+ - @prosopo/util@3.2.13
54
+ - @prosopo/types@4.1.2
55
+
56
+ ## 2.9.27
57
+ ### Patch Changes
58
+
59
+ - Updated dependencies [91958da]
60
+ - @prosopo/types@4.1.1
61
+ - @prosopo/common@3.1.35
62
+
63
+ ## 2.9.26
64
+ ### Patch Changes
65
+
66
+ - Updated dependencies [6a741ce]
67
+ - @prosopo/types@4.1.0
68
+
69
+ ## 2.9.25
70
+ ### Patch Changes
71
+
72
+ - 8bb7286: Move `captchaType` from client (`data-captcha-type` / render-options prop)
73
+ to a server-side site-key setting; the bundle now calls `/frictionless`
74
+ for all flows. Renames the bundle's universal mount component from
75
+ `FrictionlessCaptcha` to `BundleCaptcha` to reflect that it is no longer
76
+ frictionless-specific — the server decides which concrete challenge type
77
+ to render.
78
+ - Updated dependencies [3c0be68]
79
+ - Updated dependencies [f9ea09d]
80
+ - Updated dependencies [4aae4e6]
81
+ - Updated dependencies [d865319]
82
+ - Updated dependencies [753304b]
83
+ - Updated dependencies [8bb7286]
84
+ - Updated dependencies [f9ea09d]
85
+ - Updated dependencies [4aae4e6]
86
+ - Updated dependencies [4993813]
87
+ - @prosopo/types@4.0.0
88
+ - @prosopo/util@3.2.12
89
+ - @prosopo/common@3.1.34
90
+
91
+ ## 2.9.24
92
+ ### Patch Changes
93
+
94
+ - Updated dependencies [819ed95]
95
+ - @prosopo/types@3.16.1
96
+
97
+ ## 2.9.23
98
+ ### Patch Changes
99
+
100
+ - Updated dependencies [f6a4402]
101
+ - Updated dependencies [99dfb44]
102
+ - @prosopo/types@3.16.0
103
+
104
+ ## 2.9.22
105
+ ### Patch Changes
106
+
107
+ - Updated dependencies [3e54c0a]
108
+ - @prosopo/types@3.15.0
109
+
110
+ ## 2.9.21
111
+ ### Patch Changes
112
+
113
+ - Updated dependencies [946a8ba]
114
+ - Updated dependencies [5614814]
115
+ - @prosopo/types@3.14.1
116
+ - @prosopo/common@3.1.33
117
+
118
+ ## 2.9.20
119
+ ### Patch Changes
120
+
121
+ - Updated dependencies [fc514dd]
122
+ - Updated dependencies [42650db]
123
+ - @prosopo/types@3.14.0
124
+ - @prosopo/common@3.1.32
125
+
126
+ ## 2.9.19
127
+ ### Patch Changes
128
+
129
+ - Updated dependencies [4a9c518]
130
+ - @prosopo/common@3.1.31
131
+
132
+ ## 2.9.18
133
+ ### Patch Changes
134
+
135
+ - Updated dependencies [a25dffa]
136
+ - @prosopo/util@3.2.11
137
+ - @prosopo/types@3.13.3
138
+
139
+ ## 2.9.17
140
+ ### Patch Changes
141
+
142
+ - Updated dependencies [346edd7]
143
+ - @prosopo/util@3.2.10
144
+ - @prosopo/types@3.13.2
145
+
146
+ ## 2.9.16
147
+ ### Patch Changes
148
+
149
+ - Updated dependencies [22bfee7]
150
+ - @prosopo/util@3.2.9
151
+ - @prosopo/types@3.13.1
152
+
153
+ ## 2.9.15
154
+ ### Patch Changes
155
+
156
+ - Updated dependencies [e0fb3d6]
157
+ - Updated dependencies [e6d9553]
158
+ - Updated dependencies [f3f23e3]
159
+ - @prosopo/util@3.2.8
160
+ - @prosopo/types@3.13.0
161
+
162
+ ## 2.9.14
163
+ ### Patch Changes
164
+
165
+ - Updated dependencies [d5082a9]
166
+ - Updated dependencies [e1ea65f]
167
+ - Updated dependencies [c316257]
168
+ - @prosopo/types@3.12.3
169
+ - @prosopo/util@3.2.7
170
+
171
+ ## 2.9.13
172
+ ### Patch Changes
173
+
174
+ - Updated dependencies [adb89a6]
175
+ - @prosopo/types@3.12.2
176
+ - @prosopo/util@3.2.6
177
+ - @prosopo/common@3.1.30
178
+
179
+ ## 2.9.12
180
+ ### Patch Changes
181
+
182
+ - Updated dependencies [c5ee492]
183
+ - Updated dependencies [a90eb54]
184
+ - @prosopo/common@3.1.29
185
+ - @prosopo/types@3.12.1
186
+
187
+ ## 2.9.11
188
+ ### Patch Changes
189
+
190
+ - 676c5f2: Use HTTPS in developmentwq
191
+ - Updated dependencies [676c5f2]
192
+ - Updated dependencies [feaca02]
193
+ - @prosopo/types@3.12.0
194
+
195
+ ## 2.9.10
196
+ ### Patch Changes
197
+
198
+ - Updated dependencies [8148587]
199
+ - @prosopo/types@3.11.1
200
+
201
+ ## 2.9.9
202
+ ### Patch Changes
203
+
204
+ - Updated dependencies [7f6ffc5]
205
+ - @prosopo/types@3.11.0
206
+
207
+ ## 2.9.8
208
+ ### Patch Changes
209
+
210
+ - Updated dependencies [93fa086]
211
+ - @prosopo/types@3.10.2
212
+
213
+ ## 2.9.7
214
+ ### Patch Changes
215
+
216
+ - Updated dependencies [cde7550]
217
+ - @prosopo/types@3.10.1
218
+
219
+ ## 2.9.6
220
+ ### Patch Changes
221
+
222
+ - Updated dependencies [ad6d622]
223
+ - @prosopo/types@3.10.0
224
+
225
+ ## 2.9.5
226
+ ### Patch Changes
227
+
228
+ - Updated dependencies [ff58a70]
229
+ - @prosopo/types@3.9.0
230
+
231
+ ## 2.9.4
232
+ ### Patch Changes
233
+
234
+ - Updated dependencies [d2431cd]
235
+ - @prosopo/types@3.8.4
236
+
237
+ ## 2.9.3
238
+ ### Patch Changes
239
+
240
+ - Updated dependencies [bd6995b]
241
+ - @prosopo/types@3.8.3
242
+
243
+ ## 2.9.2
244
+ ### Patch Changes
245
+
246
+ - Updated dependencies [9633e58]
247
+ - @prosopo/types@3.8.2
248
+
249
+ ## 2.9.1
250
+ ### Patch Changes
251
+
252
+ - Updated dependencies [f52a5c1]
253
+ - @prosopo/types@3.8.1
254
+
3
255
  ## 2.9.0
4
256
  ### Minor Changes
5
257
 
@@ -1 +1 @@
1
- {"version":3,"file":"testAccounts.d.ts","sourceRoot":"","sources":["../../src/accounts/testAccounts.ts"],"names":[],"mappings":"AAcA,OAAO,EAGN,KAAK,gBAAgB,EACrB,KAAK,KAAK,EACV,MAAM,gBAAgB,CAAC;AAIxB,wBAAgB,kBAAkB,IAAI,KAAK,EAAE,CAqB5C;AAED,wBAAgB,mBAAmB,IAAI,gBAAgB,EAAE,CAcxD"}
1
+ {"version":3,"file":"testAccounts.d.ts","sourceRoot":"","sources":["../../src/accounts/testAccounts.ts"],"names":[],"mappings":"AAcA,OAAO,EAGN,KAAK,gBAAgB,EACrB,KAAK,KAAK,EACV,MAAM,gBAAgB,CAAC;AAIxB,wBAAgB,kBAAkB,IAAI,KAAK,EAAE,CA0B5C;AAED,wBAAgB,mBAAmB,IAAI,gBAAgB,EAAE,CAcxD"}
@@ -6,7 +6,8 @@ function getDefaultSiteKeys() {
6
6
  const captchaTypes = [
7
7
  CaptchaType.image,
8
8
  CaptchaType.pow,
9
- CaptchaType.frictionless
9
+ CaptchaType.frictionless,
10
+ CaptchaType.puzzle
10
11
  ];
11
12
  const sites = [];
12
13
  for (const captchaType of captchaTypes) {
@@ -18,7 +19,9 @@ function getDefaultSiteKeys() {
18
19
  secret,
19
20
  settings: ClientSettingsSchema.parse({
20
21
  captchaType,
21
- domains: ["localhost"]
22
+ domains: ["localhost"],
23
+ imageMaxRounds: 2,
24
+ frictionlessThreshold: 0.8
22
25
  })
23
26
  });
24
27
  }
@@ -30,7 +33,7 @@ function getDefaultProviders() {
30
33
  );
31
34
  return [
32
35
  {
33
- url: "http://localhost:9229",
36
+ url: "https://localhost:9229",
34
37
  pair,
35
38
  address: pair.address,
36
39
  datasetFile: "./dev/data/captchas.json",
@@ -1 +1 @@
1
- {"version":3,"file":"testAccounts.js","sourceRoot":"","sources":["../../src/accounts/testAccounts.ts"],"names":[],"mappings":"AAcA,OAAO,EACN,WAAW,EACX,oBAAoB,GAGpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,UAAU,kBAAkB;IACjC,MAAM,YAAY,GAAG;QACpB,WAAW,CAAC,KAAK;QACjB,WAAW,CAAC,GAAG;QACf,WAAW,CAAC,YAAY;KACxB,CAAC;IACF,MAAM,KAAK,GAAY,EAAE,CAAC;IAC1B,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;QACxC,MAAM,MAAM,GAAG,GAAG,UAAU,KAAK,WAAW,EAAE,CAAC;QAC/C,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QAC7B,KAAK,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,oBAAoB,CAAC,KAAK,CAAC;gBACpC,WAAW,EAAE,WAAW;gBACxB,OAAO,EAAE,CAAC,WAAW,CAAC;aACtB,CAAC;SACF,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED,MAAM,UAAU,mBAAmB;IAClC,MAAM,IAAI,GAAG,OAAO,CACnB,oFAAoF,CACpF,CAAC;IACF,OAAO;QACN;YACC,GAAG,EAAE,uBAAuB;YAC5B,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,0BAA0B;YACvC,gBAAgB,EACf,oEAAoE;SACrE;KACD,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"testAccounts.js","sourceRoot":"","sources":["../../src/accounts/testAccounts.ts"],"names":[],"mappings":"AAcA,OAAO,EACN,WAAW,EACX,oBAAoB,GAGpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,UAAU,kBAAkB;IACjC,MAAM,YAAY,GAAG;QACpB,WAAW,CAAC,KAAK;QACjB,WAAW,CAAC,GAAG;QACf,WAAW,CAAC,YAAY;QACxB,WAAW,CAAC,MAAM;KAClB,CAAC;IACF,MAAM,KAAK,GAAY,EAAE,CAAC;IAC1B,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;QACxC,MAAM,MAAM,GAAG,GAAG,UAAU,KAAK,WAAW,EAAE,CAAC;QAC/C,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QAG7B,KAAK,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,oBAAoB,CAAC,KAAK,CAAC;gBACpC,WAAW,EAAE,WAAW;gBACxB,OAAO,EAAE,CAAC,WAAW,CAAC;gBACtB,cAAc,EAAE,CAAC;gBACjB,qBAAqB,EAAE,GAAG;aAC1B,CAAC;SACF,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED,MAAM,UAAU,mBAAmB;IAClC,MAAM,IAAI,GAAG,OAAO,CACnB,oFAAoF,CACpF,CAAC;IACF,OAAO;QACN;YACC,GAAG,EAAE,wBAAwB;YAC7B,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,0BAA0B;YACvC,gBAAgB,EACf,oEAAoE;SACrE;KACD,CAAC;AACH,CAAC"}
@@ -8,7 +8,8 @@ function getDefaultSiteKeys() {
8
8
  const captchaTypes = [
9
9
  types.CaptchaType.image,
10
10
  types.CaptchaType.pow,
11
- types.CaptchaType.frictionless
11
+ types.CaptchaType.frictionless,
12
+ types.CaptchaType.puzzle
12
13
  ];
13
14
  const sites = [];
14
15
  for (const captchaType of captchaTypes) {
@@ -20,7 +21,9 @@ function getDefaultSiteKeys() {
20
21
  secret,
21
22
  settings: types.ClientSettingsSchema.parse({
22
23
  captchaType,
23
- domains: ["localhost"]
24
+ domains: ["localhost"],
25
+ imageMaxRounds: 2,
26
+ frictionlessThreshold: 0.8
24
27
  })
25
28
  });
26
29
  }
@@ -32,7 +35,7 @@ function getDefaultProviders() {
32
35
  );
33
36
  return [
34
37
  {
35
- url: "http://localhost:9229",
38
+ url: "https://localhost:9229",
36
39
  pair,
37
40
  address: pair.address,
38
41
  datasetFile: "./dev/data/captchas.json",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/keyring",
3
- "version": "2.9.0",
3
+ "version": "2.9.34",
4
4
  "description": "Keypair generator for Prosopo",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -27,7 +27,8 @@
27
27
  },
28
28
  "repository": {
29
29
  "type": "git",
30
- "url": "git+ssh://git@github.com/prosopo/types.git"
30
+ "url": "git+https://github.com/prosopo/captcha.git",
31
+ "directory": "packages/keyring"
31
32
  },
32
33
  "author": "Prosopo Limited",
33
34
  "license": "Apache-2.0",
@@ -38,14 +39,14 @@
38
39
  "dependencies": {
39
40
  "@polkadot/util": "13.5.7",
40
41
  "@polkadot/util-crypto": "13.5.7",
41
- "@prosopo/common": "3.1.28",
42
- "@prosopo/types": "3.8.0",
43
- "@prosopo/util": "3.2.5",
42
+ "@prosopo/common": "3.1.38",
43
+ "@prosopo/types": "4.3.0",
44
+ "@prosopo/util": "3.2.15",
44
45
  "@prosopo/util-crypto": "13.5.29",
45
46
  "dotenv": "16.4.5"
46
47
  },
47
48
  "devDependencies": {
48
- "@prosopo/config": "3.3.0",
49
+ "@prosopo/config": "3.3.1",
49
50
  "@types/node": "22.10.2",
50
51
  "@vitest/coverage-v8": "3.2.4",
51
52
  "concurrently": "9.0.1",
@@ -0,0 +1,63 @@
1
+ // Copyright 2021-2026 Prosopo (UK) Ltd.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ import { hexToU8a } from "@polkadot/util/hex";
16
+ import { isHex } from "@polkadot/util/is";
17
+ import { ProsopoEnvError } from "@prosopo/common";
18
+ import type { PolkadotSecretJSON } from "@prosopo/types";
19
+ import type { KeyringPair, KeyringPair$Json } from "@prosopo/types";
20
+ import { mnemonicValidate } from "@prosopo/util-crypto";
21
+ import type { KeypairType } from "@prosopo/util-crypto";
22
+ import { Keyring } from "../keyring/keyring.js";
23
+
24
+ export function getPair(
25
+ secret?: string | KeyringPair$Json | PolkadotSecretJSON,
26
+ account?: string | Uint8Array,
27
+ pairType?: KeypairType,
28
+ ss58Format?: number,
29
+ ): KeyringPair {
30
+ pairType = pairType || "sr25519";
31
+ ss58Format = ss58Format || 42;
32
+ const keyring = new Keyring({ type: pairType, ss58Format });
33
+ if (!secret && account) {
34
+ return keyring.addFromAddress(account);
35
+ }
36
+ if (secret && typeof secret === "string") {
37
+ if (mnemonicValidate(secret)) {
38
+ return keyring.addFromMnemonic(secret);
39
+ }
40
+ if (isHex(secret)) {
41
+ return keyring.addFromSeed(hexToU8a(secret));
42
+ }
43
+ if (secret.includes("//")) {
44
+ return keyring.addFromUri(secret);
45
+ }
46
+ try {
47
+ const json = JSON.parse(secret);
48
+ const {
49
+ encoding: { content },
50
+ } = json;
51
+ const keyring = new Keyring({ type: content[1], ss58Format });
52
+ return keyring.addFromJson(json as KeyringPair$Json);
53
+ } catch (e) {
54
+ throw new ProsopoEnvError("GENERAL.MISSING_SECRET_KEY", {
55
+ context: { error: e },
56
+ });
57
+ }
58
+ } else if (typeof secret === "object") {
59
+ return keyring.addFromJson(secret as KeyringPair$Json);
60
+ } else {
61
+ throw new ProsopoEnvError("GENERAL.MISSING_SECRET_KEY");
62
+ }
63
+ }
@@ -0,0 +1,16 @@
1
+ // Copyright 2021-2026 Prosopo (UK) Ltd.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ export * from "./mnemonic.js";
15
+ export * from "./getPair.js";
16
+ export * from "./testAccounts.js";
@@ -0,0 +1,45 @@
1
+ // Copyright 2021-2026 Prosopo (UK) Ltd.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ import { mnemonicGenerate, mnemonicToMiniSecret } from "@prosopo/util-crypto";
16
+ import type { KeypairType } from "@prosopo/util-crypto";
17
+ import { Keyring } from "../keyring/keyring.js";
18
+
19
+ /** Generate a mnemonic, returning the mnemonic and associated address
20
+ * @param keyring
21
+ * @param pairType
22
+ */
23
+ export async function generateMnemonic(
24
+ keyring?: Keyring,
25
+ pairType?: KeypairType,
26
+ ): Promise<[string, string]> {
27
+ if (!keyring) {
28
+ keyring = new Keyring({ type: pairType || "sr25519" });
29
+ }
30
+ const mnemonic = mnemonicGenerate();
31
+ const account = keyring.addFromMnemonic(mnemonic);
32
+ return [mnemonic, account.address];
33
+ }
34
+
35
+ /** Generate a secret, returning the secret and associated address
36
+ * @param keyring
37
+ * @param pairType
38
+ */
39
+ export async function generateMiniSecret(
40
+ keyring?: Keyring,
41
+ pairType?: KeypairType,
42
+ ): Promise<[Uint8Array, string]> {
43
+ const [mnemonic, address] = await generateMnemonic(keyring, pairType);
44
+ return [mnemonicToMiniSecret(mnemonic), address];
45
+ }