@prosopo/procaptcha-pow 2.8.26 → 2.8.31

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.
@@ -0,0 +1,48 @@
1
+
2
+ > @prosopo/procaptcha-pow@2.8.31 build:cjs
3
+ > NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
4
+
5
+ ViteCommonJSConfig: .
6
+ {
7
+ tsConfigPaths: [
8
+ '/home/runner/work/captcha/captcha/packages/api/tsconfig.json',
9
+ '/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
10
+ '/home/runner/work/captcha/captcha/packages/locale/tsconfig.json',
11
+ '/home/runner/work/captcha/captcha/packages/util/tsconfig.json',
12
+ '/home/runner/work/captcha/captcha/packages/util-crypto/tsconfig.json',
13
+ '/home/runner/work/captcha/captcha/packages/common/tsconfig.json',
14
+ '/home/runner/work/captcha/captcha/packages/procaptcha-common/tsconfig.json',
15
+ '/home/runner/work/captcha/captcha/packages/load-balancer/tsconfig.json',
16
+ '/home/runner/work/captcha/captcha/packages/widget-skeleton/tsconfig.json',
17
+ '/home/runner/work/captcha/captcha/packages/account/tsconfig.json',
18
+ '/home/runner/work/captcha/captcha/packages/fingerprint/tsconfig.json',
19
+ '/home/runner/work/captcha/captcha/packages/keyring/tsconfig.json'
20
+ ]
21
+ }
22
+ {
23
+ externals: [
24
+ '@prosopo/api',
25
+ '@prosopo/types',
26
+ '@prosopo/locale',
27
+ '@prosopo/util',
28
+ '@prosopo/util-crypto',
29
+ '@prosopo/common',
30
+ '@prosopo/procaptcha-common',
31
+ '@prosopo/load-balancer',
32
+ '@prosopo/widget-skeleton',
33
+ '@prosopo/account',
34
+ '@prosopo/fingerprint',
35
+ '@prosopo/keyring'
36
+ ]
37
+ }
38
+ vite v6.4.1 building SSR bundle for production...
39
+ Bundle build started
40
+ transforming...
41
+ Build end
42
+ ✓ 4 modules transformed.
43
+ rendering chunks...
44
+ dist/cjs/index.cjs 0.25 kB
45
+ dist/cjs/components/ProcaptchaPoW.cjs 0.82 kB
46
+ dist/cjs/components/ProcaptchaWidget.cjs 3.52 kB
47
+ dist/cjs/services/Manager.cjs 8.65 kB
48
+ ✓ built in 290ms
@@ -0,0 +1,50 @@
1
+
2
+ > @prosopo/procaptcha-pow@2.8.31 build:tsc
3
+ > tsc --build --verbose
4
+
5
+ 4:57:20 PM - Projects in this build:
6
+ * ../../dev/config/tsconfig.json
7
+ * ../locale/tsconfig.json
8
+ * ../util/tsconfig.json
9
+ * ../util-crypto/tsconfig.json
10
+ * ../types/tsconfig.json
11
+ * ../api/tsconfig.json
12
+ * ../common/tsconfig.json
13
+ * ../load-balancer/tsconfig.json
14
+ * ../widget-skeleton/tsconfig.json
15
+ * ../fingerprint/tsconfig.json
16
+ * ../keyring/tsconfig.json
17
+ * ../account/tsconfig.json
18
+ * ../procaptcha-common/tsconfig.json
19
+ * tsconfig.json
20
+
21
+ 4:57:20 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'
22
+
23
+ 4:57:20 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
24
+
25
+ 4:57:20 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/verifyRecency.ts' is older than output '../util/tsconfig.tsbuildinfo'
26
+
27
+ 4:57:20 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'
28
+
29
+ 4:57:20 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/procaptcha/api.ts' is older than output '../types/tsconfig.tsbuildinfo'
30
+
31
+ 4:57:20 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
32
+
33
+ 4:57:20 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/logger.ts' is older than output '../common/tsconfig.tsbuildinfo'
34
+
35
+ 4:57:21 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/balancer.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
36
+
37
+ 4:57:21 PM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/constants.ts' is older than output '../widget-skeleton/tsconfig.tsbuildinfo'
38
+
39
+ 4:57:21 PM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.ts' is older than output '../fingerprint/tsconfig.tsbuildinfo'
40
+
41
+ 4:57:21 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/index.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
42
+
43
+ 4:57:21 PM - Project '../account/tsconfig.json' is up to date because newest input '../account/src/custom.d.ts' is older than output '../account/tsconfig.tsbuildinfo'
44
+
45
+ 4:57:21 PM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/state/builder.ts' is older than output '../procaptcha-common/tsconfig.tsbuildinfo'
46
+
47
+ 4:57:21 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
48
+
49
+ 4:57:21 PM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-pow/tsconfig.json'...
50
+
@@ -0,0 +1,52 @@
1
+
2
+ > @prosopo/procaptcha-pow@2.8.31 build
3
+ > npm run build:cross-env -- --mode ${NODE_ENV:-development}
4
+
5
+
6
+ > @prosopo/procaptcha-pow@2.8.31 build:cross-env
7
+ > vite build --config vite.esm.config.ts --mode production
8
+
9
+ ViteEsmConfig: .
10
+ {
11
+ tsConfigPaths: [
12
+ '/home/runner/work/captcha/captcha/packages/api/tsconfig.json',
13
+ '/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
14
+ '/home/runner/work/captcha/captcha/packages/locale/tsconfig.json',
15
+ '/home/runner/work/captcha/captcha/packages/util/tsconfig.json',
16
+ '/home/runner/work/captcha/captcha/packages/util-crypto/tsconfig.json',
17
+ '/home/runner/work/captcha/captcha/packages/common/tsconfig.json',
18
+ '/home/runner/work/captcha/captcha/packages/procaptcha-common/tsconfig.json',
19
+ '/home/runner/work/captcha/captcha/packages/load-balancer/tsconfig.json',
20
+ '/home/runner/work/captcha/captcha/packages/widget-skeleton/tsconfig.json',
21
+ '/home/runner/work/captcha/captcha/packages/account/tsconfig.json',
22
+ '/home/runner/work/captcha/captcha/packages/fingerprint/tsconfig.json',
23
+ '/home/runner/work/captcha/captcha/packages/keyring/tsconfig.json'
24
+ ]
25
+ }
26
+ {
27
+ externals: [
28
+ '@prosopo/api',
29
+ '@prosopo/types',
30
+ '@prosopo/locale',
31
+ '@prosopo/util',
32
+ '@prosopo/util-crypto',
33
+ '@prosopo/common',
34
+ '@prosopo/procaptcha-common',
35
+ '@prosopo/load-balancer',
36
+ '@prosopo/widget-skeleton',
37
+ '@prosopo/account',
38
+ '@prosopo/fingerprint',
39
+ '@prosopo/keyring'
40
+ ]
41
+ }
42
+ vite v6.4.1 building SSR bundle for production...
43
+ Bundle build started
44
+ transforming...
45
+ Build end
46
+ ✓ 4 modules transformed.
47
+ rendering chunks...
48
+ dist/index.js 0.13 kB
49
+ dist/components/ProcaptchaPoW.js 0.46 kB
50
+ dist/components/ProcaptchaWidget.js 3.41 kB
51
+ dist/services/Manager.js 8.50 kB
52
+ ✓ built in 231ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,75 @@
1
1
  # @prosopo/procaptcha-pow
2
2
 
3
+ ## 2.8.31
4
+ ### Patch Changes
5
+
6
+ - a53526b: enhance/pow-client-solution
7
+ - 0a38892: feat/cross-os-testing
8
+ - a8faa9a: bump license year
9
+ - 7543d17: mouse movements bot stopping
10
+ - 3acc333: Release 3.3.0
11
+ - Updated dependencies [a53526b]
12
+ - Updated dependencies [f3cf586]
13
+ - Updated dependencies [3acc333]
14
+ - Updated dependencies [0a38892]
15
+ - Updated dependencies [1ee3d80]
16
+ - Updated dependencies [a8faa9a]
17
+ - Updated dependencies [7543d17]
18
+ - Updated dependencies [fe9fe22]
19
+ - Updated dependencies [3acc333]
20
+ - @prosopo/util@3.2.5
21
+ - @prosopo/procaptcha-common@2.9.23
22
+ - @prosopo/util-crypto@13.5.29
23
+ - @prosopo/types@3.8.0
24
+ - @prosopo/widget-skeleton@2.7.13
25
+ - @prosopo/common@3.1.28
26
+ - @prosopo/locale@3.1.28
27
+ - @prosopo/api@3.1.41
28
+
29
+ ## 2.8.30
30
+ ### Patch Changes
31
+
32
+ - 141e462: Capture correct event
33
+ - Updated dependencies [141e462]
34
+ - @prosopo/types@3.7.2
35
+ - @prosopo/api@3.1.40
36
+ - @prosopo/procaptcha-common@2.9.22
37
+
38
+ ## 2.8.29
39
+ ### Patch Changes
40
+
41
+ - 345b25b: pow coord
42
+ - Updated dependencies [345b25b]
43
+ - @prosopo/types@3.7.1
44
+ - @prosopo/api@3.1.39
45
+ - @prosopo/procaptcha-common@2.9.21
46
+
47
+ ## 2.8.28
48
+ ### Patch Changes
49
+
50
+ - Updated dependencies [ce70a2b]
51
+ - Updated dependencies [c2b940f]
52
+ - Updated dependencies [f6b5094]
53
+ - Updated dependencies [e01227b]
54
+ - @prosopo/types@3.7.0
55
+ - @prosopo/locale@3.1.27
56
+ - @prosopo/api@3.1.38
57
+ - @prosopo/common@3.1.27
58
+ - @prosopo/procaptcha-common@2.9.20
59
+
60
+ ## 2.8.27
61
+ ### Patch Changes
62
+
63
+ - 7d5eb3f: bump
64
+ - Updated dependencies [7d5eb3f]
65
+ - @prosopo/api@3.1.37
66
+ - @prosopo/common@3.1.26
67
+ - @prosopo/locale@3.1.26
68
+ - @prosopo/procaptcha-common@2.9.19
69
+ - @prosopo/types@3.6.4
70
+ - @prosopo/util@3.2.4
71
+ - @prosopo/widget-skeleton@2.7.12
72
+
3
73
  ## 2.8.26
4
74
  ### Patch Changes
5
75
 
@@ -71,15 +71,26 @@ const Procaptcha = (props) => {
71
71
  procaptchaCommon.Checkbox,
72
72
  {
73
73
  checked: state.isHuman,
74
- onChange: async () => {
74
+ theme,
75
+ onChange: async (event) => {
75
76
  if (loading) {
76
77
  return;
77
78
  }
78
79
  setLoading(true);
79
- await manager.current.start();
80
+ let x = 0;
81
+ let y = 0;
82
+ const mouseOrTouchEvent = event.nativeEvent;
83
+ if (!mouseOrTouchEvent.isTrusted) {
84
+ } else if ("touches" in mouseOrTouchEvent && mouseOrTouchEvent.touches.length > 0 && mouseOrTouchEvent.touches[0]) {
85
+ x = mouseOrTouchEvent.touches[0].clientX;
86
+ y = mouseOrTouchEvent.touches[0].clientY;
87
+ } else if ("clientX" in mouseOrTouchEvent && "clientY" in mouseOrTouchEvent) {
88
+ x = mouseOrTouchEvent.clientX;
89
+ y = mouseOrTouchEvent.clientY;
90
+ }
91
+ await manager.current.start(x, y);
80
92
  setLoading(false);
81
93
  },
82
- theme,
83
94
  labelText: isTranslationReady ? t("WIDGET.I_AM_HUMAN") : "",
84
95
  error: state.error?.message,
85
96
  "aria-label": "human checkbox",
@@ -6,6 +6,7 @@ const common = require("@prosopo/common");
6
6
  const procaptchaCommon = require("@prosopo/procaptcha-common");
7
7
  const types = require("@prosopo/types");
8
8
  const util = require("@prosopo/util");
9
+ const utilCrypto = require("@prosopo/util-crypto");
9
10
  const Manager = (configInput, state, onStateUpdate, callbacks, frictionlessState) => {
10
11
  const events = procaptchaCommon.getDefaultEvents(callbacks);
11
12
  const defaultState = () => {
@@ -43,7 +44,6 @@ const Manager = (configInput, state, onStateUpdate, callbacks, frictionlessState
43
44
  userAccountAddress: configInput.userAccountAddress || "",
44
45
  ...configInput
45
46
  };
46
- console.log("Using config:", config);
47
47
  if (state.account) {
48
48
  config.userAccountAddress = state.account.account.address;
49
49
  }
@@ -84,7 +84,7 @@ const Manager = (configInput, state, onStateUpdate, callbacks, frictionlessState
84
84
  }, timeMillis);
85
85
  updateState({ successfullChallengeTimeout });
86
86
  };
87
- const start = async () => {
87
+ const start = async (x = 0, y = 0) => {
88
88
  await procaptchaCommon.providerRetry(
89
89
  async () => {
90
90
  if (state.loading) {
@@ -107,7 +107,6 @@ const Manager = (configInput, state, onStateUpdate, callbacks, frictionlessState
107
107
  return ext.getAccount(config);
108
108
  };
109
109
  const user = await selectAccount();
110
- console.log("User", user);
111
110
  const userAccount = user.account.address;
112
111
  updateState({
113
112
  account: { account: { address: userAccount } }
@@ -145,7 +144,18 @@ const Manager = (configInput, state, onStateUpdate, callbacks, frictionlessState
145
144
  }
146
145
  });
147
146
  } else {
148
- const solution = util.solvePoW(challenge.challenge, challenge.difficulty);
147
+ const solution = await util.solvePoW(
148
+ challenge.challenge,
149
+ challenge.difficulty
150
+ );
151
+ let salt;
152
+ if (x !== void 0 && y !== void 0) {
153
+ const coords = [x, y];
154
+ const randomSalt = utilCrypto.randomAsHex(
155
+ coords.map((coord) => coord.toString(16).length + 4).reduce((acc, curr) => acc + curr, 0)
156
+ );
157
+ salt = util.embedData(randomSalt, coords);
158
+ }
149
159
  const signer = user.extension?.signer;
150
160
  if (!signer || !signer.signRaw) {
151
161
  throw new common.ProsopoEnvError("GENERAL.CANT_FIND_KEYRINGPAIR", {
@@ -159,13 +169,31 @@ const Manager = (configInput, state, onStateUpdate, callbacks, frictionlessState
159
169
  data: string.stringToHex(challenge[types.ApiParams.timestamp].toString()),
160
170
  type: "bytes"
161
171
  });
172
+ let encryptedBehavioralData;
173
+ if (frictionlessState?.encryptBehavioralData && (frictionlessState?.behaviorCollector1 || frictionlessState?.behaviorCollector2 || frictionlessState?.behaviorCollector3)) {
174
+ try {
175
+ const behavioralData = {
176
+ collector1: frictionlessState.behaviorCollector1?.getData() || [],
177
+ collector2: frictionlessState.behaviorCollector2?.getData() || [],
178
+ collector3: frictionlessState.behaviorCollector3?.getData() || [],
179
+ deviceCapability: frictionlessState.deviceCapability || "unknown"
180
+ };
181
+ const dataToEncrypt = frictionlessState.packBehavioralData ? frictionlessState.packBehavioralData(behavioralData) : behavioralData;
182
+ encryptedBehavioralData = await frictionlessState.encryptBehavioralData(
183
+ JSON.stringify(dataToEncrypt)
184
+ );
185
+ } catch {
186
+ }
187
+ }
162
188
  const verifiedSolution = await providerApi.submitPowCaptchaSolution(
163
189
  challenge,
164
190
  getAccount().account.account.address,
165
191
  getDappAccount(),
166
192
  solution,
167
193
  userTimestampSignature.signature.toString(),
168
- config.captchas.pow.verifiedTimeout
194
+ config.captchas.pow.verifiedTimeout,
195
+ encryptedBehavioralData,
196
+ salt
169
197
  );
170
198
  if (verifiedSolution[types.ApiParams.verified]) {
171
199
  updateState({
@@ -0,0 +1,3 @@
1
+ import type { ProcaptchaProps } from "@prosopo/types";
2
+ export declare const ProcaptchaPow: (props: ProcaptchaProps) => import("@emotion/react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=ProcaptchaPoW.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProcaptchaPoW.d.ts","sourceRoot":"","sources":["../../src/components/ProcaptchaPoW.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AActD,eAAO,MAAM,aAAa,UAAW,eAAe,qDASnD,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProcaptchaPoW.js","sourceRoot":"","sources":["../../src/components/ProcaptchaPoW.tsx"],"names":[],"mappings":";AAeA,OAAO,EAA4B,QAAQ,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AASjE,MAAM,gBAAgB,GAAmD,IAAI,CAC5E,KAAK,IAAI,EAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAC3C,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAsB,EAAE,EAAE,CAAC,CACxD,KAAC,QAAQ,cACR,KAAC,gBAAgB,IAChB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,EAC1C,IAAI,EAAE,KAAK,CAAC,IAAI,GACf,GACQ,CACX,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type ProcaptchaProps } from "@prosopo/types";
2
+ declare const Procaptcha: (props: ProcaptchaProps) => import("@emotion/react/jsx-runtime").JSX.Element | null;
3
+ export default Procaptcha;
4
+ //# sourceMappingURL=ProcaptchaWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProcaptchaWidget.d.ts","sourceRoot":"","sources":["../../src/components/ProcaptchaWidget.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAQhE,QAAA,MAAM,UAAU,UAAW,eAAe,4DAuHzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -70,15 +70,26 @@ const Procaptcha = (props) => {
70
70
  Checkbox,
71
71
  {
72
72
  checked: state.isHuman,
73
- onChange: async () => {
73
+ theme,
74
+ onChange: async (event) => {
74
75
  if (loading) {
75
76
  return;
76
77
  }
77
78
  setLoading(true);
78
- await manager.current.start();
79
+ let x = 0;
80
+ let y = 0;
81
+ const mouseOrTouchEvent = event.nativeEvent;
82
+ if (!mouseOrTouchEvent.isTrusted) {
83
+ } else if ("touches" in mouseOrTouchEvent && mouseOrTouchEvent.touches.length > 0 && mouseOrTouchEvent.touches[0]) {
84
+ x = mouseOrTouchEvent.touches[0].clientX;
85
+ y = mouseOrTouchEvent.touches[0].clientY;
86
+ } else if ("clientX" in mouseOrTouchEvent && "clientY" in mouseOrTouchEvent) {
87
+ x = mouseOrTouchEvent.clientX;
88
+ y = mouseOrTouchEvent.clientY;
89
+ }
90
+ await manager.current.start(x, y);
79
91
  setLoading(false);
80
92
  },
81
- theme,
82
93
  labelText: isTranslationReady ? t("WIDGET.I_AM_HUMAN") : "",
83
94
  error: state.error?.message,
84
95
  "aria-label": "human checkbox",
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProcaptchaWidget.js","sourceRoot":"","sources":["../../src/components/ProcaptchaWidget.tsx"],"names":[],"m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AC;gBACF,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;gBACzC,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YAC1C,CAAC;iBAAM,IACN,SAAS,IAAI,iBAAiB;gBAC9B,SAAS,IAAI,iBAAiB,EAC7B,CAAC;gBACF,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC;gBAC9B,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC;YAC/B,CAAC;YAED,MAAM,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAClC,UAAU,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC,EACD,SAAS,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE,EAC3D,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,gBAChB,gBAAgB,EAC3B,OAAO,EAAE,OAAO,GACf,CACF,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./components/ProcaptchaWidget.js";
2
+ export * from "./components/ProcaptchaPoW.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { type FrictionlessState, type ProcaptchaCallbacks, type ProcaptchaClientConfigInput, type ProcaptchaState, type ProcaptchaStateUpdateFn } from "@prosopo/types";
2
+ export declare const Manager: (configInput: ProcaptchaClientConfigInput, state: ProcaptchaState, onStateUpdate: ProcaptchaStateUpdateFn, callbacks: ProcaptchaCallbacks, frictionlessState?: FrictionlessState) => {
3
+ start: (x?: number, y?: number) => Promise<void>;
4
+ resetState: (frictionlessRestart?: () => void) => void;
5
+ };
6
+ //# sourceMappingURL=Manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Manager.d.ts","sourceRoot":"","sources":["../../src/services/Manager.ts"],"names":[],"mappings":"AAwBA,OAAO,EAGN,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAEhC,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAE5B,MAAM,gBAAgB,CAAC;AAKxB,eAAO,MAAM,OAAO,gBACN,2BAA2B,SACjC,eAAe,iBACP,uBAAuB,aAC3B,mBAAmB,sBACV,iBAAiB;;uCA+EK,MAAM,IAAI;CAqOpD,CAAC"}
@@ -3,7 +3,8 @@ import { ProviderApi } from "@prosopo/api";
3
3
  import { ProsopoEnvError } from "@prosopo/common";
4
4
  import { getDefaultEvents, buildUpdateState, providerRetry, ExtensionLoader, getProcaptchaRandomActiveProvider } from "@prosopo/procaptcha-common";
5
5
  import { ProcaptchaConfigSchema, ApiParams, encodeProcaptchaOutput } from "@prosopo/types";
6
- import { sleep, solvePoW } from "@prosopo/util";
6
+ import { sleep, solvePoW, embedData } from "@prosopo/util";
7
+ import { randomAsHex } from "@prosopo/util-crypto";
7
8
  const Manager = (configInput, state, onStateUpdate, callbacks, frictionlessState) => {
8
9
  const events = getDefaultEvents(callbacks);
9
10
  const defaultState = () => {
@@ -41,7 +42,6 @@ const Manager = (configInput, state, onStateUpdate, callbacks, frictionlessState
41
42
  userAccountAddress: configInput.userAccountAddress || "",
42
43
  ...configInput
43
44
  };
44
- console.log("Using config:", config);
45
45
  if (state.account) {
46
46
  config.userAccountAddress = state.account.account.address;
47
47
  }
@@ -82,7 +82,7 @@ const Manager = (configInput, state, onStateUpdate, callbacks, frictionlessState
82
82
  }, timeMillis);
83
83
  updateState({ successfullChallengeTimeout });
84
84
  };
85
- const start = async () => {
85
+ const start = async (x = 0, y = 0) => {
86
86
  await providerRetry(
87
87
  async () => {
88
88
  if (state.loading) {
@@ -105,7 +105,6 @@ const Manager = (configInput, state, onStateUpdate, callbacks, frictionlessState
105
105
  return ext.getAccount(config);
106
106
  };
107
107
  const user = await selectAccount();
108
- console.log("User", user);
109
108
  const userAccount = user.account.address;
110
109
  updateState({
111
110
  account: { account: { address: userAccount } }
@@ -143,7 +142,18 @@ const Manager = (configInput, state, onStateUpdate, callbacks, frictionlessState
143
142
  }
144
143
  });
145
144
  } else {
146
- const solution = solvePoW(challenge.challenge, challenge.difficulty);
145
+ const solution = await solvePoW(
146
+ challenge.challenge,
147
+ challenge.difficulty
148
+ );
149
+ let salt;
150
+ if (x !== void 0 && y !== void 0) {
151
+ const coords = [x, y];
152
+ const randomSalt = randomAsHex(
153
+ coords.map((coord) => coord.toString(16).length + 4).reduce((acc, curr) => acc + curr, 0)
154
+ );
155
+ salt = embedData(randomSalt, coords);
156
+ }
147
157
  const signer = user.extension?.signer;
148
158
  if (!signer || !signer.signRaw) {
149
159
  throw new ProsopoEnvError("GENERAL.CANT_FIND_KEYRINGPAIR", {
@@ -157,13 +167,31 @@ const Manager = (configInput, state, onStateUpdate, callbacks, frictionlessState
157
167
  data: stringToHex(challenge[ApiParams.timestamp].toString()),
158
168
  type: "bytes"
159
169
  });
170
+ let encryptedBehavioralData;
171
+ if (frictionlessState?.encryptBehavioralData && (frictionlessState?.behaviorCollector1 || frictionlessState?.behaviorCollector2 || frictionlessState?.behaviorCollector3)) {
172
+ try {
173
+ const behavioralData = {
174
+ collector1: frictionlessState.behaviorCollector1?.getData() || [],
175
+ collector2: frictionlessState.behaviorCollector2?.getData() || [],
176
+ collector3: frictionlessState.behaviorCollector3?.getData() || [],
177
+ deviceCapability: frictionlessState.deviceCapability || "unknown"
178
+ };
179
+ const dataToEncrypt = frictionlessState.packBehavioralData ? frictionlessState.packBehavioralData(behavioralData) : behavioralData;
180
+ encryptedBehavioralData = await frictionlessState.encryptBehavioralData(
181
+ JSON.stringify(dataToEncrypt)
182
+ );
183
+ } catch {
184
+ }
185
+ }
160
186
  const verifiedSolution = await providerApi.submitPowCaptchaSolution(
161
187
  challenge,
162
188
  getAccount().account.account.address,
163
189
  getDappAccount(),
164
190
  solution,
165
191
  userTimestampSignature.signature.toString(),
166
- config.captchas.pow.verifiedTimeout
192
+ config.captchas.pow.verifiedTimeout,
193
+ encryptedBehavioralData,
194
+ salt
167
195
  );
168
196
  if (verifiedSolution[ApiParams.verified]) {
169
197
  updateState({
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Manager.js","sourceRoot":"","sources":["../../src/services/Manager.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACN,eAAe,EACf,gBAAgB,EAChB,iCAAiC,EACjC,aAAa,GACb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAEN,SAAS,EAIT,sBAAsB,EAGtB,sBAAsB,GACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG,CACtB,WAAwC,EACxC,KAAsB,EACtB,aAAsC,EACtC,SAA8B,EAC9B,iBAAqC,EACpC,EAAE;IACH,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAE3C,MAAM,YAAY,GAAG,GAA6B,EA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,SAAS,CAAC,EAAE;4BACtB,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,QAAQ;4BAClD,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;gCACjB,CAAC,SAAS,CAAC,SAAS,CAAC,EACpB,sBAAsB,CAAC,SAAS,CAAC,QAAQ,EAAE;6BAC5C;yBACD;qBACD,CAAC,CACF,CAAC;oBACF,wBAAwB,EAAE,CAAC;gBAC5B,CAAC;qBAAM,CAAC;oBACP,QAAQ,EAAE,CAAC;gBACZ,CAAC;YACF,CAAC;QACF,CAAC,EACD,KAAK,EACL,GAAG,EAAE;YACJ,UAAU,EAAE,CAAC;QACd,CAAC,EACD,KAAK,CAAC,YAAY,EAClB,CAAC,CACD,CAAC;IACH,CAAC,CAAC;IAEF,OAAO;QACN,KAAK;QACL,UAAU;KACV,CAAC;AACH,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/procaptcha-pow",
3
- "version": "2.8.26",
3
+ "version": "2.8.31",
4
4
  "author": "PROSOPO LIMITED <info@prosopo.io>",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
@@ -21,7 +21,8 @@
21
21
  "source": "./src/index.ts",
22
22
  "scripts": {
23
23
  "clean": "del-cli --verbose dist tsconfig.tsbuildinfo",
24
- "build": "NODE_ENV=${NODE_ENV:-development}; vite build --config vite.esm.config.ts --mode $NODE_ENV",
24
+ "build": "npm run build:cross-env -- --mode ${NODE_ENV:-development}",
25
+ "build:cross-env": "vite build --config vite.esm.config.ts",
25
26
  "build:tsc": "tsc --build --verbose",
26
27
  "build:cjs": "NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV",
27
28
  "typecheck": "tsc --project tsconfig.types.json"
@@ -29,17 +30,18 @@
29
30
  "browserslist": ["> 0.5%, last 2 versions, not dead"],
30
31
  "dependencies": {
31
32
  "@polkadot/util": "13.5.7",
32
- "@prosopo/api": "3.1.36",
33
- "@prosopo/common": "3.1.25",
34
- "@prosopo/locale": "3.1.25",
35
- "@prosopo/procaptcha-common": "2.9.18",
36
- "@prosopo/types": "3.6.3",
37
- "@prosopo/util": "3.2.3",
38
- "@prosopo/widget-skeleton": "2.7.11",
33
+ "@prosopo/api": "3.1.41",
34
+ "@prosopo/common": "3.1.28",
35
+ "@prosopo/locale": "3.1.28",
36
+ "@prosopo/procaptcha-common": "2.9.23",
37
+ "@prosopo/types": "3.8.0",
38
+ "@prosopo/util": "3.2.5",
39
+ "@prosopo/util-crypto": "13.5.29",
40
+ "@prosopo/widget-skeleton": "2.7.13",
39
41
  "react": "18.3.1"
40
42
  },
41
43
  "devDependencies": {
42
- "@prosopo/config": "3.1.25",
44
+ "@prosopo/config": "3.3.0",
43
45
  "@emotion/react": "11.11.1",
44
46
  "@emotion/styled": "11.11.0",
45
47
  "@types/node": "22.10.2",
@@ -1,5 +1,5 @@
1
1
  import path from "node:path";
2
- // Copyright 2021-2025 Prosopo (UK) Ltd.
2
+ // Copyright 2021-2026 Prosopo (UK) Ltd.
3
3
  //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- // Copyright 2021-2025 Prosopo (UK) Ltd.
1
+ // Copyright 2021-2026 Prosopo (UK) Ltd.
2
2
  //
3
3
  // Licensed under the Apache License, Version 2.0 (the "License");
4
4
  // you may not use this file except in compliance with the License.