@p2pdotme/sdk 1.2.1 → 1.2.2

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
@@ -1469,6 +1469,32 @@ var reputationManagerAbi = [
1469
1469
  outputs: [],
1470
1470
  stateMutability: "nonpayable",
1471
1471
  type: "function"
1472
+ },
1473
+ {
1474
+ inputs: [
1475
+ { internalType: "bytes32", name: "nullifier", type: "bytes32" },
1476
+ { internalType: "uint256", name: "limit", type: "uint256" },
1477
+ { internalType: "uint256", name: "expiry", type: "uint256" },
1478
+ { internalType: "bytes", name: "signature", type: "bytes" }
1479
+ ],
1480
+ name: "submitKycAttestation",
1481
+ outputs: [],
1482
+ stateMutability: "nonpayable",
1483
+ type: "function"
1484
+ },
1485
+ {
1486
+ inputs: [],
1487
+ name: "kycRp",
1488
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1489
+ stateMutability: "view",
1490
+ type: "function"
1491
+ },
1492
+ {
1493
+ inputs: [{ internalType: "address", name: "", type: "address" }],
1494
+ name: "kycVerified",
1495
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1496
+ stateMutability: "view",
1497
+ type: "function"
1472
1498
  }
1473
1499
  ];
1474
1500
 
@@ -5800,6 +5826,20 @@ var ZodZkPassportRegisterParamsSchema = import_zod9.z.object({
5800
5826
  params: ZodSolidityVerifierParametersSchema,
5801
5827
  isIDCard: import_zod9.z.boolean()
5802
5828
  });
5829
+ var ZodSimpleKycSubmitParamsSchema = import_zod9.z.object({
5830
+ /** Per-(tenant, identity) Sybil nullifier (bytes32 hex). */
5831
+ nullifier: import_zod9.z.string().refine((v) => /^0x[a-fA-F0-9]{64}$/.test(v), {
5832
+ message: "nullifier must be a bytes32 hex string"
5833
+ }),
5834
+ /** Remaining limit in micro-USDC (part of the signed struct). */
5835
+ limit: import_zod9.z.bigint(),
5836
+ /** Attestation expiry (unix seconds). */
5837
+ expiry: import_zod9.z.bigint(),
5838
+ /** 65-byte secp256k1 signature (hex). */
5839
+ signature: import_zod9.z.string().refine((v) => /^0x[a-fA-F0-9]+$/.test(v), {
5840
+ message: "signature must be a hex string"
5841
+ })
5842
+ });
5803
5843
 
5804
5844
  // src/contracts/reputation-manager/writes.ts
5805
5845
  function prepareSocialVerify(reputationManagerAddress, params) {
@@ -5866,6 +5906,33 @@ function prepareSubmitAnonAadharProof(reputationManagerAddress, params) {
5866
5906
  )()
5867
5907
  );
5868
5908
  }
5909
+ function prepareSubmitKycAttestation(reputationManagerAddress, params) {
5910
+ return validate(
5911
+ ZodSimpleKycSubmitParamsSchema,
5912
+ params,
5913
+ (message, cause, data) => new ZkkycError(message, { code: "VALIDATION_ERROR", cause, context: { params: data } })
5914
+ ).andThen(
5915
+ (validated) => import_neverthrow12.Result.fromThrowable(
5916
+ () => ({
5917
+ to: reputationManagerAddress,
5918
+ data: (0, import_viem14.encodeFunctionData)({
5919
+ abi: ABIS.EXTERNAL.REPUTATION_MANAGER,
5920
+ functionName: "submitKycAttestation",
5921
+ args: [
5922
+ validated.nullifier,
5923
+ validated.limit,
5924
+ validated.expiry,
5925
+ validated.signature
5926
+ ]
5927
+ })
5928
+ }),
5929
+ (error) => new ZkkycError("Failed to encode submitKycAttestation", {
5930
+ code: "ENCODE_ERROR",
5931
+ cause: error
5932
+ })
5933
+ )()
5934
+ );
5935
+ }
5869
5936
  function prepareZkPassportRegister(reputationManagerAddress, params) {
5870
5937
  return validate(
5871
5938
  ZodZkPassportRegisterParamsSchema,
@@ -6957,7 +7024,8 @@ function createZkkyc(config) {
6957
7024
  return {
6958
7025
  prepareSocialVerify: (params) => prepareSocialVerify(reputationManagerAddress, params),
6959
7026
  prepareSubmitAnonAadharProof: (params) => prepareSubmitAnonAadharProof(reputationManagerAddress, params),
6960
- prepareZkPassportRegister: (params) => prepareZkPassportRegister(reputationManagerAddress, params)
7027
+ prepareZkPassportRegister: (params) => prepareZkPassportRegister(reputationManagerAddress, params),
7028
+ prepareSubmitKycAttestation: (params) => prepareSubmitKycAttestation(reputationManagerAddress, params)
6961
7029
  };
6962
7030
  }
6963
7031