@p2pdotme/sdk 1.2.6 → 1.2.7

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
@@ -1497,6 +1497,38 @@ var reputationManagerAbi = [
1497
1497
  outputs: [{ internalType: "bool", name: "", type: "bool" }],
1498
1498
  stateMutability: "view",
1499
1499
  type: "function"
1500
+ },
1501
+ // ── BVN (Nigerian Bank Verification Number) attestation ─────────────────
1502
+ { inputs: [], name: "BvnSignerNotSet", type: "error" },
1503
+ { inputs: [], name: "BvnAttestationExpired", type: "error" },
1504
+ { inputs: [], name: "BvnNullifierAlreadySpent", type: "error" },
1505
+ { inputs: [], name: "BvnAlreadyVerified", type: "error" },
1506
+ { inputs: [], name: "BvnInvalidSignature", type: "error" },
1507
+ {
1508
+ inputs: [
1509
+ { internalType: "bytes32", name: "nullifier", type: "bytes32" },
1510
+ { internalType: "uint256", name: "limit", type: "uint256" },
1511
+ { internalType: "uint256", name: "expiry", type: "uint256" },
1512
+ { internalType: "bytes", name: "signature", type: "bytes" }
1513
+ ],
1514
+ name: "submitBvnAttestation",
1515
+ outputs: [],
1516
+ stateMutability: "nonpayable",
1517
+ type: "function"
1518
+ },
1519
+ {
1520
+ inputs: [],
1521
+ name: "bvnRp",
1522
+ outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
1523
+ stateMutability: "view",
1524
+ type: "function"
1525
+ },
1526
+ {
1527
+ inputs: [{ internalType: "address", name: "", type: "address" }],
1528
+ name: "bvnVerified",
1529
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
1530
+ stateMutability: "view",
1531
+ type: "function"
1500
1532
  }
1501
1533
  ];
1502
1534
 
@@ -5842,6 +5874,20 @@ var ZodSimpleKycSubmitParamsSchema = import_zod9.z.object({
5842
5874
  message: "signature must be a hex string"
5843
5875
  })
5844
5876
  });
5877
+ var ZodBvnSubmitParamsSchema = import_zod9.z.object({
5878
+ /** Per-(tenant, identity) Sybil nullifier (bytes32 hex). */
5879
+ nullifier: import_zod9.z.string().refine((v) => /^0x[a-fA-F0-9]{64}$/.test(v), {
5880
+ message: "nullifier must be a bytes32 hex string"
5881
+ }),
5882
+ /** Remaining limit in micro-USDC (part of the signed struct). */
5883
+ limit: import_zod9.z.bigint(),
5884
+ /** Attestation expiry (unix seconds). */
5885
+ expiry: import_zod9.z.bigint(),
5886
+ /** 65-byte secp256k1 signature (hex). */
5887
+ signature: import_zod9.z.string().refine((v) => /^0x[a-fA-F0-9]+$/.test(v), {
5888
+ message: "signature must be a hex string"
5889
+ })
5890
+ });
5845
5891
 
5846
5892
  // src/contracts/reputation-manager/writes.ts
5847
5893
  function prepareSocialVerify(reputationManagerAddress, params) {
@@ -5935,6 +5981,33 @@ function prepareSubmitKycAttestation(reputationManagerAddress, params) {
5935
5981
  )()
5936
5982
  );
5937
5983
  }
5984
+ function prepareSubmitBvnAttestation(reputationManagerAddress, params) {
5985
+ return validate(
5986
+ ZodBvnSubmitParamsSchema,
5987
+ params,
5988
+ (message, cause, data) => new ZkkycError(message, { code: "VALIDATION_ERROR", cause, context: { params: data } })
5989
+ ).andThen(
5990
+ (validated) => import_neverthrow12.Result.fromThrowable(
5991
+ () => ({
5992
+ to: reputationManagerAddress,
5993
+ data: (0, import_viem14.encodeFunctionData)({
5994
+ abi: ABIS.EXTERNAL.REPUTATION_MANAGER,
5995
+ functionName: "submitBvnAttestation",
5996
+ args: [
5997
+ validated.nullifier,
5998
+ validated.limit,
5999
+ validated.expiry,
6000
+ validated.signature
6001
+ ]
6002
+ })
6003
+ }),
6004
+ (error) => new ZkkycError("Failed to encode submitBvnAttestation", {
6005
+ code: "ENCODE_ERROR",
6006
+ cause: error
6007
+ })
6008
+ )()
6009
+ );
6010
+ }
5938
6011
  function prepareZkPassportRegister(reputationManagerAddress, params) {
5939
6012
  return validate(
5940
6013
  ZodZkPassportRegisterParamsSchema,
@@ -7027,7 +7100,8 @@ function createZkkyc(config) {
7027
7100
  prepareSocialVerify: (params) => prepareSocialVerify(reputationManagerAddress, params),
7028
7101
  prepareSubmitAnonAadharProof: (params) => prepareSubmitAnonAadharProof(reputationManagerAddress, params),
7029
7102
  prepareZkPassportRegister: (params) => prepareZkPassportRegister(reputationManagerAddress, params),
7030
- prepareSubmitKycAttestation: (params) => prepareSubmitKycAttestation(reputationManagerAddress, params)
7103
+ prepareSubmitKycAttestation: (params) => prepareSubmitKycAttestation(reputationManagerAddress, params),
7104
+ prepareSubmitBvnAttestation: (params) => prepareSubmitBvnAttestation(reputationManagerAddress, params)
7031
7105
  };
7032
7106
  }
7033
7107