@p2pdotme/sdk 1.2.11 → 1.2.13

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/dist/react.cjs CHANGED
@@ -1532,6 +1532,39 @@ var reputationManagerAbi = [
1532
1532
  outputs: [{ internalType: "bool", name: "", type: "bool" }],
1533
1533
  stateMutability: "view",
1534
1534
  type: "function"
1535
+ },
1536
+ // ── Liveness (face-only, no document) attestation ───────────────────────
1537
+ { inputs: [], name: "LivenessSignerNotSet", type: "error" },
1538
+ { inputs: [], name: "LivenessAttestationExpired", type: "error" },
1539
+ { inputs: [], name: "LivenessNullifierZero", type: "error" },
1540
+ { inputs: [], name: "LivenessNullifierAlreadySpent", type: "error" },
1541
+ { inputs: [], name: "LivenessAlreadyVerified", type: "error" },
1542
+ { inputs: [], name: "LivenessInvalidSignature", type: "error" },
1543
+ {
1544
+ inputs: [
1545
+ { internalType: "bytes32", name: "nullifier", type: "bytes32" },
1546
+ { internalType: "uint256", name: "limit", type: "uint256" },
1547
+ { internalType: "uint256", name: "expiry", type: "uint256" },
1548
+ { internalType: "bytes", name: "signature", type: "bytes" }
1549
+ ],
1550
+ name: "submitLivenessAttestation",
1551
+ outputs: [],
1552
+ stateMutability: "nonpayable",
1553
+ type: "function"
1554
+ },
1555
+ {
1556
+ inputs: [],
1557
+ name: "livenessRp",
1558
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1559
+ stateMutability: "view",
1560
+ type: "function"
1561
+ },
1562
+ {
1563
+ inputs: [{ internalType: "address", name: "", type: "address" }],
1564
+ name: "livenessVerified",
1565
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1566
+ stateMutability: "view",
1567
+ type: "function"
1535
1568
  }
1536
1569
  ];
1537
1570
 
@@ -5891,6 +5924,20 @@ var ZodBvnSubmitParamsSchema = import_zod9.z.object({
5891
5924
  message: "signature must be a hex string"
5892
5925
  })
5893
5926
  });
5927
+ var ZodLivenessSubmitParamsSchema = import_zod9.z.object({
5928
+ /** Per-(tenant, identity) Sybil nullifier (bytes32 hex). */
5929
+ nullifier: import_zod9.z.string().refine((v) => /^0x[a-fA-F0-9]{64}$/.test(v), {
5930
+ message: "nullifier must be a bytes32 hex string"
5931
+ }),
5932
+ /** Remaining limit in micro-USDC (part of the signed struct). */
5933
+ limit: import_zod9.z.bigint(),
5934
+ /** Attestation expiry (unix seconds). */
5935
+ expiry: import_zod9.z.bigint(),
5936
+ /** 65-byte secp256k1 signature (hex). */
5937
+ signature: import_zod9.z.string().refine((v) => /^0x[a-fA-F0-9]+$/.test(v), {
5938
+ message: "signature must be a hex string"
5939
+ })
5940
+ });
5894
5941
 
5895
5942
  // src/contracts/reputation-manager/writes.ts
5896
5943
  function prepareSocialVerify(reputationManagerAddress, params) {
@@ -6011,6 +6058,33 @@ function prepareSubmitBvnAttestation(reputationManagerAddress, params) {
6011
6058
  )()
6012
6059
  );
6013
6060
  }
6061
+ function prepareSubmitLivenessAttestation(reputationManagerAddress, params) {
6062
+ return validate(
6063
+ ZodLivenessSubmitParamsSchema,
6064
+ params,
6065
+ (message, cause, data) => new ZkkycError(message, { code: "VALIDATION_ERROR", cause, context: { params: data } })
6066
+ ).andThen(
6067
+ (validated) => import_neverthrow12.Result.fromThrowable(
6068
+ () => ({
6069
+ to: reputationManagerAddress,
6070
+ data: (0, import_viem14.encodeFunctionData)({
6071
+ abi: ABIS.EXTERNAL.REPUTATION_MANAGER,
6072
+ functionName: "submitLivenessAttestation",
6073
+ args: [
6074
+ validated.nullifier,
6075
+ validated.limit,
6076
+ validated.expiry,
6077
+ validated.signature
6078
+ ]
6079
+ })
6080
+ }),
6081
+ (error) => new ZkkycError("Failed to encode submitLivenessAttestation", {
6082
+ code: "ENCODE_ERROR",
6083
+ cause: error
6084
+ })
6085
+ )()
6086
+ );
6087
+ }
6014
6088
  function prepareZkPassportRegister(reputationManagerAddress, params) {
6015
6089
  return validate(
6016
6090
  ZodZkPassportRegisterParamsSchema,
@@ -7104,7 +7178,8 @@ function createZkkyc(config) {
7104
7178
  prepareSubmitAnonAadharProof: (params) => prepareSubmitAnonAadharProof(reputationManagerAddress, params),
7105
7179
  prepareZkPassportRegister: (params) => prepareZkPassportRegister(reputationManagerAddress, params),
7106
7180
  prepareSubmitKycAttestation: (params) => prepareSubmitKycAttestation(reputationManagerAddress, params),
7107
- prepareSubmitBvnAttestation: (params) => prepareSubmitBvnAttestation(reputationManagerAddress, params)
7181
+ prepareSubmitBvnAttestation: (params) => prepareSubmitBvnAttestation(reputationManagerAddress, params),
7182
+ prepareSubmitLivenessAttestation: (params) => prepareSubmitLivenessAttestation(reputationManagerAddress, params)
7108
7183
  };
7109
7184
  }
7110
7185