@p2pdotme/sdk 1.2.21 → 1.2.23

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 +1 @@
1
- {"version":3,"sources":["../src/contracts/reputation-manager/writes.ts","../src/validation/errors.validation.ts","../src/validation/schemas.validation.ts","../src/country/currency.ts","../src/zkkyc/errors.ts","../src/zkkyc/validation.ts","../src/contracts/abis/index.ts","../src/contracts/abis/order-flow-facet.ts","../src/contracts/abis/order-processor-facet.ts","../src/contracts/abis/p2p-config-facet.ts","../src/contracts/abis/p2p-stake-boost-facet.ts","../src/contracts/abis/reputation-manager.ts","../src/zkkyc/client.ts","../src/zkkyc/orchestrators/bvn.ts","../src/zkkyc/orchestrators/constants.ts","../src/zkkyc/orchestrators/liveness.ts","../src/zkkyc/orchestrators/reclaim.ts","../src/zkkyc/orchestrators/types.ts","../src/zkkyc/orchestrators/simple-kyc.ts","../src/zkkyc/orchestrators/zk-passport.ts"],"sourcesContent":["import { Result } from \"neverthrow\";\nimport { type Address, encodeFunctionData } from \"viem\";\nimport { validate } from \"../../validation\";\nimport { ZkkycError } from \"../../zkkyc/errors\";\nimport type {\n\tAnonAadharProofParams,\n\tBvnSubmitParams,\n\tLivenessSubmitParams,\n\tSimpleKycSubmitParams,\n\tSocialVerifyParams,\n\tZkPassportRegisterParams,\n} from \"../../zkkyc/validation\";\nimport {\n\tZodAnonAadharProofParamsSchema,\n\tZodBvnSubmitParamsSchema,\n\tZodLivenessSubmitParamsSchema,\n\tZodSimpleKycSubmitParamsSchema,\n\tZodSocialVerifyParamsSchema,\n\tZodZkPassportRegisterParamsSchema,\n} from \"../../zkkyc/validation\";\nimport { ABIS } from \"../abis\";\n\n/** Prepares a social verification transaction. */\nexport function prepareSocialVerify(\n\treputationManagerAddress: Address,\n\tparams: SocialVerifyParams,\n): Result<{ to: Address; data: `0x${string}` }, ZkkycError> {\n\treturn validate(\n\t\tZodSocialVerifyParamsSchema,\n\t\tparams,\n\t\t(message, cause, data) =>\n\t\t\tnew ZkkycError(message, { code: \"VALIDATION_ERROR\", cause, context: { params: data } }),\n\t).andThen((validated) =>\n\t\tResult.fromThrowable(\n\t\t\t() => ({\n\t\t\t\tto: reputationManagerAddress,\n\t\t\t\tdata: encodeFunctionData({\n\t\t\t\t\tabi: ABIS.EXTERNAL.REPUTATION_MANAGER,\n\t\t\t\t\tfunctionName: \"socialVerify\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tvalidated._socialName,\n\t\t\t\t\t\tvalidated.proofs.map((proof) => ({\n\t\t\t\t\t\t\t...proof,\n\t\t\t\t\t\t\tsignedClaim: {\n\t\t\t\t\t\t\t\t...proof.signedClaim,\n\t\t\t\t\t\t\t\tclaim: {\n\t\t\t\t\t\t\t\t\t...proof.signedClaim.claim,\n\t\t\t\t\t\t\t\t\tidentifier: proof.signedClaim.claim.identifier as `0x${string}`,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tsignatures: proof.signedClaim.signatures as readonly `0x${string}`[],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t})),\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t}),\n\t\t\t(error) =>\n\t\t\t\tnew ZkkycError(\"Failed to encode socialVerify\", {\n\t\t\t\t\tcode: \"ENCODE_ERROR\",\n\t\t\t\t\tcause: error,\n\t\t\t\t}),\n\t\t)(),\n\t);\n}\n\n/** Prepares a submit anon Aadhaar proof transaction. */\nexport function prepareSubmitAnonAadharProof(\n\treputationManagerAddress: Address,\n\tparams: AnonAadharProofParams,\n): Result<{ to: Address; data: `0x${string}` }, ZkkycError> {\n\treturn validate(\n\t\tZodAnonAadharProofParamsSchema,\n\t\tparams,\n\t\t(message, cause, data) =>\n\t\t\tnew ZkkycError(message, { code: \"VALIDATION_ERROR\", cause, context: { params: data } }),\n\t).andThen((validated) =>\n\t\tResult.fromThrowable(\n\t\t\t() => ({\n\t\t\t\tto: reputationManagerAddress,\n\t\t\t\tdata: encodeFunctionData({\n\t\t\t\t\tabi: ABIS.EXTERNAL.REPUTATION_MANAGER,\n\t\t\t\t\tfunctionName: \"submitAnonAadharProof\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tvalidated.nullifierSeed,\n\t\t\t\t\t\tvalidated.nullifier,\n\t\t\t\t\t\tvalidated.timestamp,\n\t\t\t\t\t\tvalidated.signal,\n\t\t\t\t\t\tvalidated.revealArray,\n\t\t\t\t\t\tvalidated.packedGroth16Proof,\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t}),\n\t\t\t(error) =>\n\t\t\t\tnew ZkkycError(\"Failed to encode submitAnonAadharProof\", {\n\t\t\t\t\tcode: \"ENCODE_ERROR\",\n\t\t\t\t\tcause: error,\n\t\t\t\t}),\n\t\t)(),\n\t);\n}\n\n/** Prepares a simple-kyc EIP-712 attestation submission (awards KYC rp). */\nexport function prepareSubmitKycAttestation(\n\treputationManagerAddress: Address,\n\tparams: SimpleKycSubmitParams,\n): Result<{ to: Address; data: `0x${string}` }, ZkkycError> {\n\treturn validate(\n\t\tZodSimpleKycSubmitParamsSchema,\n\t\tparams,\n\t\t(message, cause, data) =>\n\t\t\tnew ZkkycError(message, { code: \"VALIDATION_ERROR\", cause, context: { params: data } }),\n\t).andThen((validated) =>\n\t\tResult.fromThrowable(\n\t\t\t() => ({\n\t\t\t\tto: reputationManagerAddress,\n\t\t\t\tdata: encodeFunctionData({\n\t\t\t\t\tabi: ABIS.EXTERNAL.REPUTATION_MANAGER,\n\t\t\t\t\tfunctionName: \"submitKycAttestation\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tvalidated.nullifier as `0x${string}`,\n\t\t\t\t\t\tvalidated.limit,\n\t\t\t\t\t\tvalidated.expiry,\n\t\t\t\t\t\tvalidated.signature as `0x${string}`,\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t}),\n\t\t\t(error) =>\n\t\t\t\tnew ZkkycError(\"Failed to encode submitKycAttestation\", {\n\t\t\t\t\tcode: \"ENCODE_ERROR\",\n\t\t\t\t\tcause: error,\n\t\t\t\t}),\n\t\t)(),\n\t);\n}\n\n/** Prepares a BVN EIP-712 attestation submission (awards BVN rp). */\nexport function prepareSubmitBvnAttestation(\n\treputationManagerAddress: Address,\n\tparams: BvnSubmitParams,\n): Result<{ to: Address; data: `0x${string}` }, ZkkycError> {\n\treturn validate(\n\t\tZodBvnSubmitParamsSchema,\n\t\tparams,\n\t\t(message, cause, data) =>\n\t\t\tnew ZkkycError(message, { code: \"VALIDATION_ERROR\", cause, context: { params: data } }),\n\t).andThen((validated) =>\n\t\tResult.fromThrowable(\n\t\t\t() => ({\n\t\t\t\tto: reputationManagerAddress,\n\t\t\t\tdata: encodeFunctionData({\n\t\t\t\t\tabi: ABIS.EXTERNAL.REPUTATION_MANAGER,\n\t\t\t\t\tfunctionName: \"submitBvnAttestation\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tvalidated.nullifier as `0x${string}`,\n\t\t\t\t\t\tvalidated.limit,\n\t\t\t\t\t\tvalidated.expiry,\n\t\t\t\t\t\tvalidated.signature as `0x${string}`,\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t}),\n\t\t\t(error) =>\n\t\t\t\tnew ZkkycError(\"Failed to encode submitBvnAttestation\", {\n\t\t\t\t\tcode: \"ENCODE_ERROR\",\n\t\t\t\t\tcause: error,\n\t\t\t\t}),\n\t\t)(),\n\t);\n}\n\n/** Prepares a liveness EIP-712 attestation submission (awards liveness rp).\n *\n * Same struct shape as the KYC one but a different on-chain function: the\n * liveness verifier is a separate service with its own EIP-712 domain and its\n * own nullifier set, so the two attestations are not interchangeable.\n */\nexport function prepareSubmitLivenessAttestation(\n\treputationManagerAddress: Address,\n\tparams: LivenessSubmitParams,\n): Result<{ to: Address; data: `0x${string}` }, ZkkycError> {\n\treturn validate(\n\t\tZodLivenessSubmitParamsSchema,\n\t\tparams,\n\t\t(message, cause, data) =>\n\t\t\tnew ZkkycError(message, { code: \"VALIDATION_ERROR\", cause, context: { params: data } }),\n\t).andThen((validated) =>\n\t\tResult.fromThrowable(\n\t\t\t() => ({\n\t\t\t\tto: reputationManagerAddress,\n\t\t\t\tdata: encodeFunctionData({\n\t\t\t\t\tabi: ABIS.EXTERNAL.REPUTATION_MANAGER,\n\t\t\t\t\tfunctionName: \"submitLivenessAttestation\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tvalidated.nullifier as `0x${string}`,\n\t\t\t\t\t\tvalidated.limit,\n\t\t\t\t\t\tvalidated.expiry,\n\t\t\t\t\t\tvalidated.signature as `0x${string}`,\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t}),\n\t\t\t(error) =>\n\t\t\t\tnew ZkkycError(\"Failed to encode submitLivenessAttestation\", {\n\t\t\t\t\tcode: \"ENCODE_ERROR\",\n\t\t\t\t\tcause: error,\n\t\t\t\t}),\n\t\t)(),\n\t);\n}\n\n/** Prepares a zkPassport registration transaction. */\nexport function prepareZkPassportRegister(\n\treputationManagerAddress: Address,\n\tparams: ZkPassportRegisterParams,\n): Result<{ to: Address; data: `0x${string}` }, ZkkycError> {\n\treturn validate(\n\t\tZodZkPassportRegisterParamsSchema,\n\t\tparams,\n\t\t(message, cause, data) =>\n\t\t\tnew ZkkycError(message, { code: \"VALIDATION_ERROR\", cause, context: { params: data } }),\n\t).andThen((validated) =>\n\t\tResult.fromThrowable(\n\t\t\t() => {\n\t\t\t\tconst { proofVerificationData, serviceConfig, committedInputs, version } = validated.params;\n\n\t\t\t\tconst proofVerificationParams = {\n\t\t\t\t\tversion: version as `0x${string}`,\n\t\t\t\t\tproofVerificationData: {\n\t\t\t\t\t\tvkeyHash: proofVerificationData.vkeyHash as `0x${string}`,\n\t\t\t\t\t\tproof: proofVerificationData.proof as `0x${string}`,\n\t\t\t\t\t\tpublicInputs: proofVerificationData.publicInputs as `0x${string}`[],\n\t\t\t\t\t},\n\t\t\t\t\tcommittedInputs: committedInputs as `0x${string}`,\n\t\t\t\t\tserviceConfig: {\n\t\t\t\t\t\tvalidityPeriodInSeconds: BigInt(serviceConfig.validityPeriodInSeconds),\n\t\t\t\t\t\tdomain: serviceConfig.domain,\n\t\t\t\t\t\tscope: serviceConfig.scope,\n\t\t\t\t\t\tdevMode: serviceConfig.devMode,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\treturn {\n\t\t\t\t\tto: reputationManagerAddress,\n\t\t\t\t\tdata: encodeFunctionData({\n\t\t\t\t\t\tabi: ABIS.EXTERNAL.REPUTATION_MANAGER,\n\t\t\t\t\t\tfunctionName: \"zkPassportRegister\",\n\t\t\t\t\t\targs: [proofVerificationParams, validated.isIDCard],\n\t\t\t\t\t}),\n\t\t\t\t};\n\t\t\t},\n\t\t\t(error) =>\n\t\t\t\tnew ZkkycError(\"Failed to encode zkPassportRegister\", {\n\t\t\t\t\tcode: \"ENCODE_ERROR\",\n\t\t\t\t\tcause: error,\n\t\t\t\t}),\n\t\t)(),\n\t);\n}\n","export class SdkError<TCode extends string = string> extends Error {\n\treadonly code: TCode;\n\treadonly cause?: unknown;\n\treadonly context?: Record<string, unknown>;\n\n\tconstructor(\n\t\tmessage: string,\n\t\toptions: {\n\t\t\tcode: TCode;\n\t\t\tcause?: unknown;\n\t\t\tcontext?: Record<string, unknown>;\n\t\t},\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"SdkError\";\n\t\tthis.code = options.code;\n\t\tthis.cause = options.cause;\n\t\tthis.context = options.context;\n\t}\n}\n","import { err, ok, type Result } from \"neverthrow\";\nimport { isAddress } from \"viem\";\nimport { z } from \"zod\";\nimport { CURRENCY_CODES } from \"../country/currency\";\n\nexport const ZodAddressSchema = z\n\t.string()\n\t.refine((s) => isAddress(s), { message: \"Invalid Ethereum address\" });\n\nexport const ZodCurrencySchema = z.enum(CURRENCY_CODES);\n\nexport function validate<S extends z.ZodType, E>(\n\tschema: S,\n\tdata: unknown,\n\ttoError: (message: string, cause: unknown, data: unknown) => E,\n): Result<z.infer<S>, E> {\n\tconst result = schema.safeParse(data);\n\tif (result.success) {\n\t\treturn ok(result.data as z.infer<S>);\n\t}\n\treturn err(toError(z.prettifyError(result.error), result.error, data));\n}\n","/**\n * All supported currency symbols. Single source of truth for the SDK.\n *\n * Lives alongside the country metadata so that adding a currency is a\n * single-folder operation: drop a new file in `currencies/<code>.ts`, add it\n * to this map, and both `COUNTRY_OPTIONS` and `ZodCurrencySchema` pick it up.\n */\nexport const CURRENCY = {\n\tIDR: \"IDR\",\n\tINR: \"INR\",\n\tBRL: \"BRL\",\n\tARS: \"ARS\",\n\tMEX: \"MEX\",\n\tVEN: \"VEN\",\n\tBOB: \"BOB\",\n\tEUR: \"EUR\",\n\tNGN: \"NGN\",\n\tUSD: \"USD\",\n\tCOP: \"COP\",\n\tCUP: \"CUP\",\n\tECU: \"ECU\",\n\tPEN: \"PEN\",\n\tPHP: \"PHP\",\n} as const;\n\n/** Union of supported currency codes. */\nexport type CurrencyCode = (typeof CURRENCY)[keyof typeof CURRENCY];\n\n/**\n * Tuple form of the currency codes — used by `z.enum(...)` in the shared\n * validation layer. Narrow tuple type required by Zod.\n */\nexport const CURRENCY_CODES = Object.values(CURRENCY) as [CurrencyCode, ...CurrencyCode[]];\n","import { SdkError } from \"../validation\";\n\nexport type ZkkycErrorCode =\n\t| \"VALIDATION_ERROR\"\n\t| \"CONTRACT_READ_ERROR\"\n\t| \"ENCODE_ERROR\"\n\t| \"RECLAIM_INIT_FAILED\"\n\t| \"RECLAIM_SESSION_NOT_FOUND\"\n\t| \"RECLAIM_PROOF_GENERATION_FAILED\"\n\t| \"RECLAIM_PROOF_INVALID\"\n\t| \"RECLAIM_POLLING_ABORTED\"\n\t| \"ZK_PASSPORT_INIT_FAILED\"\n\t| \"ZK_PASSPORT_REJECTED\"\n\t| \"ZK_PASSPORT_VERIFICATION_FAILED\"\n\t| \"ZK_PASSPORT_ABORTED\"\n\t| \"SIMPLE_KYC_SESSION_FAILED\"\n\t| \"SIMPLE_KYC_REDEEM_FAILED\"\n\t| \"LIVENESS_SESSION_FAILED\"\n\t| \"LIVENESS_REDEEM_FAILED\"\n\t| \"BVN_ONBOARD_FAILED\"\n\t| \"BVN_SUBMIT_FAILED\"\n\t| \"BVN_OTP_SEND_FAILED\"\n\t| \"BVN_OTP_CONFIRM_FAILED\"\n\t| \"BVN_ATTESTATION_FAILED\"\n\t| \"BVN_SESSION_EXPIRED\"\n\t| \"PEER_DEPENDENCY_MISSING\";\n\nexport class ZkkycError extends SdkError<ZkkycErrorCode> {\n\tconstructor(\n\t\tmessage: string,\n\t\toptions: {\n\t\t\tcode: ZkkycErrorCode;\n\t\t\tcause?: unknown;\n\t\t\tcontext?: Record<string, unknown>;\n\t\t},\n\t) {\n\t\tsuper(message, options);\n\t\tthis.name = \"ZkkycError\";\n\t}\n}\n","import { z } from \"zod\";\nimport { ZodAddressSchema } from \"../validation\";\n\n// ── Write param schemas ──────────────────────────────────────────────────────\n\nexport const ZodAnonAadharProofParamsSchema = z.object({\n\tnullifierSeed: z.bigint(),\n\tnullifier: z.bigint(),\n\ttimestamp: z.bigint(),\n\tsignal: z.bigint(),\n\trevealArray: z.tuple([z.bigint(), z.bigint(), z.bigint(), z.bigint()]),\n\tpackedGroth16Proof: z.tuple([\n\t\tz.bigint(),\n\t\tz.bigint(),\n\t\tz.bigint(),\n\t\tz.bigint(),\n\t\tz.bigint(),\n\t\tz.bigint(),\n\t\tz.bigint(),\n\t\tz.bigint(),\n\t]),\n});\n\nexport type AnonAadharProofParams = z.infer<typeof ZodAnonAadharProofParamsSchema>;\n\nexport const ZodSocialVerifyParamsSchema = z.object({\n\t_socialName: z.string(),\n\tproofs: z.array(\n\t\tz.object({\n\t\t\tclaimInfo: z.object({\n\t\t\t\tprovider: z.string(),\n\t\t\t\tparameters: z.string(),\n\t\t\t\tcontext: z.string(),\n\t\t\t}),\n\t\t\tsignedClaim: z.object({\n\t\t\t\tclaim: z.object({\n\t\t\t\t\tidentifier: z.string(),\n\t\t\t\t\towner: ZodAddressSchema,\n\t\t\t\t\ttimestampS: z.number(),\n\t\t\t\t\tepoch: z.number(),\n\t\t\t\t}),\n\t\t\t\tsignatures: z.array(z.string()),\n\t\t\t}),\n\t\t}),\n\t),\n});\n\nexport type SocialVerifyParams = z.infer<typeof ZodSocialVerifyParamsSchema>;\n\n// Schema matching SolidityVerifierParameters from @zkpassport/sdk (structural definition)\nexport const ZodSolidityVerifierParametersSchema = z.object({\n\tversion: z.string().refine((val) => val.startsWith(\"0x\"), {\n\t\tmessage: \"Version must be a hex string\",\n\t}),\n\tproofVerificationData: z.object({\n\t\tvkeyHash: z.string().refine((val) => /^0x[a-fA-F0-9]{64}$/.test(val), {\n\t\t\tmessage: \"Invalid bytes32 hex string\",\n\t\t}),\n\t\tproof: z.string().refine((val) => val.startsWith(\"0x\"), {\n\t\t\tmessage: \"Proof must be a hex string\",\n\t\t}),\n\t\tpublicInputs: z.array(\n\t\t\tz.string().refine((val) => /^0x[a-fA-F0-9]{64}$/.test(val), {\n\t\t\t\tmessage: \"Each public input must be a valid bytes32 hex string\",\n\t\t\t}),\n\t\t),\n\t}),\n\tcommittedInputs: z.string().refine((val) => val.startsWith(\"0x\"), {\n\t\tmessage: \"Committed inputs must be a hex string\",\n\t}),\n\tserviceConfig: z.object({\n\t\tvalidityPeriodInSeconds: z.number().int().nonnegative(),\n\t\tdomain: z.string(),\n\t\tscope: z.string(),\n\t\tdevMode: z.boolean(),\n\t}),\n});\n\nexport type SolidityVerifierParameters = z.infer<typeof ZodSolidityVerifierParametersSchema>;\n\nexport const ZodZkPassportRegisterParamsSchema = z.object({\n\tparams: ZodSolidityVerifierParametersSchema,\n\tisIDCard: z.boolean(),\n});\n\nexport type ZkPassportRegisterParams = z.infer<typeof ZodZkPassportRegisterParamsSchema>;\n\n// ── simple-kyc EIP-712 attestation ───────────────────────────────────────────\n\nexport const ZodSimpleKycSubmitParamsSchema = z.object({\n\t/** Per-(tenant, identity) Sybil nullifier (bytes32 hex). */\n\tnullifier: z.string().refine((v) => /^0x[a-fA-F0-9]{64}$/.test(v), {\n\t\tmessage: \"nullifier must be a bytes32 hex string\",\n\t}),\n\t/** Remaining limit in micro-USDC (part of the signed struct). */\n\tlimit: z.bigint(),\n\t/** Attestation expiry (unix seconds). */\n\texpiry: z.bigint(),\n\t/** 65-byte secp256k1 signature (hex). */\n\tsignature: z.string().refine((v) => /^0x[a-fA-F0-9]+$/.test(v), {\n\t\tmessage: \"signature must be a hex string\",\n\t}),\n});\n\nexport type SimpleKycSubmitParams = z.infer<typeof ZodSimpleKycSubmitParamsSchema>;\n\n// ── BVN EIP-712 attestation ──────────────────────────────────────────────────\n\nexport const ZodBvnSubmitParamsSchema = z.object({\n\t/** Per-(tenant, identity) Sybil nullifier (bytes32 hex). */\n\tnullifier: z.string().refine((v) => /^0x[a-fA-F0-9]{64}$/.test(v), {\n\t\tmessage: \"nullifier must be a bytes32 hex string\",\n\t}),\n\t/** Remaining limit in micro-USDC (part of the signed struct). */\n\tlimit: z.bigint(),\n\t/** Attestation expiry (unix seconds). */\n\texpiry: z.bigint(),\n\t/** 65-byte secp256k1 signature (hex). */\n\tsignature: z.string().refine((v) => /^0x[a-fA-F0-9]+$/.test(v), {\n\t\tmessage: \"signature must be a hex string\",\n\t}),\n});\n\nexport type BvnSubmitParams = z.infer<typeof ZodBvnSubmitParamsSchema>;\n\n// ── Liveness EIP-712 attestation ─────────────────────────────────────────────\n\nexport const ZodLivenessSubmitParamsSchema = z.object({\n\t/** Per-(tenant, identity) Sybil nullifier (bytes32 hex). */\n\tnullifier: z.string().refine((v) => /^0x[a-fA-F0-9]{64}$/.test(v), {\n\t\tmessage: \"nullifier must be a bytes32 hex string\",\n\t}),\n\t/** Remaining limit in micro-USDC (part of the signed struct). */\n\tlimit: z.bigint(),\n\t/** Attestation expiry (unix seconds). */\n\texpiry: z.bigint(),\n\t/** 65-byte secp256k1 signature (hex). */\n\tsignature: z.string().refine((v) => /^0x[a-fA-F0-9]+$/.test(v), {\n\t\tmessage: \"signature must be a hex string\",\n\t}),\n});\n\nexport type LivenessSubmitParams = z.infer<typeof ZodLivenessSubmitParamsSchema>;\n","import { erc20Abi } from \"viem\";\nimport { orderFlowFacetAbi } from \"./order-flow-facet\";\nimport { orderProcessorFacetAbi } from \"./order-processor-facet\";\nimport { p2pConfigFacetAbi } from \"./p2p-config-facet\";\nimport { p2pStakeBoostFacetAbi } from \"./p2p-stake-boost-facet\";\nimport { reputationManagerAbi } from \"./reputation-manager\";\n\nconst DIAMOND_ABI = [\n\t...orderFlowFacetAbi,\n\t...orderProcessorFacetAbi,\n\t...p2pConfigFacetAbi,\n\t...p2pStakeBoostFacetAbi,\n] as const;\n\nexport const ABIS = {\n\tDIAMOND: DIAMOND_ABI,\n\tFACETS: {\n\t\tORDER_FLOW: orderFlowFacetAbi,\n\t\tORDER_PROCESSOR: orderProcessorFacetAbi,\n\t\tCONFIG: p2pConfigFacetAbi,\n\t\tSTAKE: p2pStakeBoostFacetAbi,\n\t},\n\tEXTERNAL: {\n\t\tUSDC: erc20Abi,\n\t\tREPUTATION_MANAGER: reputationManagerAbi,\n\t},\n} as const;\n","export const orderFlowFacetAbi = [\n\t{\n\t\tinputs: [\n\t\t\t{ internalType: \"uint256\", name: \"circleId\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"assignUpto\", type: \"uint256\" },\n\t\t\t{ internalType: \"bytes32\", name: \"currency\", type: \"bytes32\" },\n\t\t\t{ internalType: \"address\", name: \"user\", type: \"address\" },\n\t\t\t{ internalType: \"uint256\", name: \"usdtAmount\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t{ internalType: \"int256\", name: \"orderType\", type: \"int256\" },\n\t\t\t{ internalType: \"uint256\", name: \"preferredPCConfigId\", type: \"uint256\" },\n\t\t],\n\t\tname: \"getAssignableMerchantsFromCircle\",\n\t\toutputs: [{ internalType: \"address[]\", name: \"\", type: \"address[]\" }],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{ internalType: \"address\", name: \"_user\", type: \"address\" },\n\t\t\t{ internalType: \"bytes32\", name: \"_nativeCurrency\", type: \"bytes32\" },\n\t\t],\n\t\tname: \"userTxLimit\",\n\t\toutputs: [\n\t\t\t{ internalType: \"uint256\", name: \"\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"\", type: \"uint256\" },\n\t\t],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{ internalType: \"string\", name: \"_pubKey\", type: \"string\" },\n\t\t\t{ internalType: \"uint256\", name: \"_amount\", type: \"uint256\" },\n\t\t\t{ internalType: \"address\", name: \"_recipientAddr\", type: \"address\" },\n\t\t\t{ internalType: \"uint8\", name: \"_orderType\", type: \"uint8\" },\n\t\t\t{ internalType: \"string\", name: \"_userUpi\", type: \"string\" },\n\t\t\t{ internalType: \"string\", name: \"_userPubKey\", type: \"string\" },\n\t\t\t{ internalType: \"bytes32\", name: \"_currency\", type: \"bytes32\" },\n\t\t\t{ internalType: \"uint256\", name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"_circleId\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"_fiatAmountLimit\", type: \"uint256\" },\n\t\t],\n\t\tname: \"placeOrder\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [{ internalType: \"uint256\", name: \"_orderId\", type: \"uint256\" }],\n\t\tname: \"cancelOrder\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{ internalType: \"uint256\", name: \"_orderId\", type: \"uint256\" },\n\t\t\t{ internalType: \"string\", name: \"_userEncUpi\", type: \"string\" },\n\t\t\t{ internalType: \"uint256\", name: \"_updatedAmount\", type: \"uint256\" },\n\t\t],\n\t\tname: \"setSellOrderUpi\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\ttype: \"event\",\n\t\tname: \"OrderPlaced\",\n\t\tanonymous: false,\n\t\tinputs: [\n\t\t\t{ indexed: true, name: \"orderId\", type: \"uint256\" },\n\t\t\t{ indexed: true, name: \"user\", type: \"address\" },\n\t\t\t{ indexed: true, name: \"merchant\", type: \"address\" },\n\t\t\t{ indexed: false, name: \"amount\", type: \"uint256\" },\n\t\t\t{ indexed: false, name: \"orderType\", type: \"uint8\" },\n\t\t\t{ indexed: false, name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t{\n\t\t\t\tindexed: false,\n\t\t\t\tname: \"_order\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"amount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userCompletedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"acceptedMerchant\", type: \"address\" },\n\t\t\t\t\t{ name: \"user\", type: \"address\" },\n\t\t\t\t\t{ name: \"recipientAddr\", type: \"address\" },\n\t\t\t\t\t{ name: \"pubkey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"userCompleted\", type: \"bool\" },\n\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t{ name: \"orderType\", type: \"uint8\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"disputeInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{ name: \"raisedBy\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t\t\t\t\t\t{ name: \"accountNumber\", type: \"uint256\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{ name: \"id\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userPubKey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encMerchantUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"acceptedAccountNo\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"assignedAccountNos\", type: \"uint256[]\" },\n\t\t\t\t\t{ name: \"currency\", type: \"bytes32\" },\n\t\t\t\t\t{ name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"circleId\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: \"event\",\n\t\tname: \"OrderAccepted\",\n\t\tanonymous: false,\n\t\tinputs: [\n\t\t\t{ indexed: true, name: \"orderId\", type: \"uint256\" },\n\t\t\t{ indexed: true, name: \"merchant\", type: \"address\" },\n\t\t\t{ indexed: false, name: \"pubKey\", type: \"string\" },\n\t\t\t{\n\t\t\t\tindexed: false,\n\t\t\t\tname: \"_order\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"amount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userCompletedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"acceptedMerchant\", type: \"address\" },\n\t\t\t\t\t{ name: \"user\", type: \"address\" },\n\t\t\t\t\t{ name: \"recipientAddr\", type: \"address\" },\n\t\t\t\t\t{ name: \"pubkey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"userCompleted\", type: \"bool\" },\n\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t{ name: \"orderType\", type: \"uint8\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"disputeInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{ name: \"raisedBy\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t\t\t\t\t\t{ name: \"accountNumber\", type: \"uint256\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{ name: \"id\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userPubKey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encMerchantUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"acceptedAccountNo\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"assignedAccountNos\", type: \"uint256[]\" },\n\t\t\t\t\t{ name: \"currency\", type: \"bytes32\" },\n\t\t\t\t\t{ name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"circleId\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: \"event\",\n\t\tname: \"BuyOrderPaid\",\n\t\tanonymous: false,\n\t\tinputs: [\n\t\t\t{ indexed: true, name: \"orderId\", type: \"uint256\" },\n\t\t\t{ indexed: true, name: \"user\", type: \"address\" },\n\t\t\t{\n\t\t\t\tindexed: false,\n\t\t\t\tname: \"_order\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"amount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userCompletedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"acceptedMerchant\", type: \"address\" },\n\t\t\t\t\t{ name: \"user\", type: \"address\" },\n\t\t\t\t\t{ name: \"recipientAddr\", type: \"address\" },\n\t\t\t\t\t{ name: \"pubkey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"userCompleted\", type: \"bool\" },\n\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t{ name: \"orderType\", type: \"uint8\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"disputeInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{ name: \"raisedBy\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t\t\t\t\t\t{ name: \"accountNumber\", type: \"uint256\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{ name: \"id\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userPubKey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encMerchantUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"acceptedAccountNo\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"assignedAccountNos\", type: \"uint256[]\" },\n\t\t\t\t\t{ name: \"currency\", type: \"bytes32\" },\n\t\t\t\t\t{ name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"circleId\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: \"event\",\n\t\tname: \"OrderCompleted\",\n\t\tanonymous: false,\n\t\tinputs: [\n\t\t\t{ indexed: true, name: \"orderId\", type: \"uint256\" },\n\t\t\t{ indexed: true, name: \"user\", type: \"address\" },\n\t\t\t{ indexed: false, name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t{\n\t\t\t\tindexed: false,\n\t\t\t\tname: \"_order\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"amount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userCompletedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"acceptedMerchant\", type: \"address\" },\n\t\t\t\t\t{ name: \"user\", type: \"address\" },\n\t\t\t\t\t{ name: \"recipientAddr\", type: \"address\" },\n\t\t\t\t\t{ name: \"pubkey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"userCompleted\", type: \"bool\" },\n\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t{ name: \"orderType\", type: \"uint8\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"disputeInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{ name: \"raisedBy\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t\t\t\t\t\t{ name: \"accountNumber\", type: \"uint256\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{ name: \"id\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userPubKey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encMerchantUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"acceptedAccountNo\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"assignedAccountNos\", type: \"uint256[]\" },\n\t\t\t\t\t{ name: \"currency\", type: \"bytes32\" },\n\t\t\t\t\t{ name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"circleId\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: \"event\",\n\t\tname: \"CancelledOrders\",\n\t\tanonymous: false,\n\t\tinputs: [\n\t\t\t{ indexed: true, name: \"orderId\", type: \"uint256\" },\n\t\t\t{\n\t\t\t\tindexed: false,\n\t\t\t\tname: \"_order\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"amount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userCompletedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"acceptedMerchant\", type: \"address\" },\n\t\t\t\t\t{ name: \"user\", type: \"address\" },\n\t\t\t\t\t{ name: \"recipientAddr\", type: \"address\" },\n\t\t\t\t\t{ name: \"pubkey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"userCompleted\", type: \"bool\" },\n\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t{ name: \"orderType\", type: \"uint8\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"disputeInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{ name: \"raisedBy\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t\t\t\t\t\t{ name: \"accountNumber\", type: \"uint256\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{ name: \"id\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userPubKey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encMerchantUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"acceptedAccountNo\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"assignedAccountNos\", type: \"uint256[]\" },\n\t\t\t\t\t{ name: \"currency\", type: \"bytes32\" },\n\t\t\t\t\t{ name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"circleId\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n] as const;\n","/**\n * Minimal ABI fragments for reads on OrderProcessor storage via the Diamond.\n * `getOrdersById`, `getAdditionalOrderDetails`, and the per-currency small-order\n * fee config getters (`getSmallOrderThreshold`, `getSmallOrderFixedFee`).\n */\nexport const orderProcessorFacetAbi = [\n\t{\n\t\ttype: \"function\",\n\t\tname: \"getOrdersById\",\n\t\tstateMutability: \"view\",\n\t\tinputs: [{ name: \"orderId\", type: \"uint256\" }],\n\t\toutputs: [\n\t\t\t{\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"amount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userCompletedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"acceptedMerchant\", type: \"address\" },\n\t\t\t\t\t{ name: \"user\", type: \"address\" },\n\t\t\t\t\t{ name: \"recipientAddr\", type: \"address\" },\n\t\t\t\t\t{ name: \"pubkey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"userCompleted\", type: \"bool\" },\n\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t{ name: \"orderType\", type: \"uint8\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"disputeInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{ name: \"raisedBy\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t\t\t\t\t\t{ name: \"accountNumber\", type: \"uint256\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{ name: \"id\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userPubKey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encMerchantUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"acceptedAccountNo\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"assignedAccountNos\", type: \"uint256[]\" },\n\t\t\t\t\t{ name: \"currency\", type: \"bytes32\" },\n\t\t\t\t\t{ name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"circleId\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: \"function\",\n\t\tname: \"getAdditionalOrderDetails\",\n\t\tstateMutability: \"view\",\n\t\tinputs: [{ name: \"orderId\", type: \"uint256\" }],\n\t\toutputs: [\n\t\t\t{\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"fixedFeePaid\", type: \"uint64\" },\n\t\t\t\t\t{ name: \"tipsPaid\", type: \"uint64\" },\n\t\t\t\t\t{ name: \"acceptedTimestamp\", type: \"uint128\" },\n\t\t\t\t\t{ name: \"paidTimestamp\", type: \"uint128\" },\n\t\t\t\t\t{ name: \"reserved2\", type: \"uint128\" },\n\t\t\t\t\t{ name: \"actualUsdtAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"actualFiatAmount\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: \"function\",\n\t\tname: \"getSmallOrderThreshold\",\n\t\tstateMutability: \"view\",\n\t\tinputs: [{ name: \"currency\", type: \"bytes32\" }],\n\t\toutputs: [{ name: \"\", type: \"uint256\" }],\n\t},\n\t{\n\t\ttype: \"function\",\n\t\tname: \"getSmallOrderFixedFee\",\n\t\tstateMutability: \"view\",\n\t\tinputs: [{ name: \"currency\", type: \"bytes32\" }],\n\t\toutputs: [{ name: \"\", type: \"uint256\" }],\n\t},\n\t{\n\t\ttype: \"function\",\n\t\tname: \"raiseDispute\",\n\t\tstateMutability: \"nonpayable\",\n\t\tinputs: [\n\t\t\t{ name: \"_orderId\", type: \"uint256\" },\n\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t],\n\t\toutputs: [],\n\t},\n\t{\n\t\ttype: \"function\",\n\t\tname: \"paidBuyOrder\",\n\t\tstateMutability: \"nonpayable\",\n\t\tinputs: [{ name: \"_orderId\", type: \"uint256\" }],\n\t\toutputs: [],\n\t},\n] as const;\n","export const p2pConfigFacetAbi = [\n\t{\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tinternalType: \"bytes32\",\n\t\t\t\tname: \"_currency\",\n\t\t\t\ttype: \"bytes32\",\n\t\t\t},\n\t\t],\n\t\tname: \"getPriceConfig\",\n\t\toutputs: [\n\t\t\t{\n\t\t\t\tcomponents: [\n\t\t\t\t\t{\n\t\t\t\t\t\tinternalType: \"uint256\",\n\t\t\t\t\t\tname: \"buyPrice\",\n\t\t\t\t\t\ttype: \"uint256\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tinternalType: \"uint256\",\n\t\t\t\t\t\tname: \"sellPrice\",\n\t\t\t\t\t\ttype: \"uint256\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tinternalType: \"int256\",\n\t\t\t\t\t\tname: \"buyPriceOffset\",\n\t\t\t\t\t\ttype: \"int256\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tinternalType: \"uint256\",\n\t\t\t\t\t\tname: \"baseSpread\",\n\t\t\t\t\t\ttype: \"uint256\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tinternalType: \"struct P2pConfigStorage.PriceConfig\",\n\t\t\t\tname: \"\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t},\n\t\t],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tinternalType: \"bytes32\",\n\t\t\t\tname: \"_nativeCurrency\",\n\t\t\t\ttype: \"bytes32\",\n\t\t\t},\n\t\t],\n\t\tname: \"getRpPerUsdtLimitRational\",\n\t\toutputs: [\n\t\t\t{\n\t\t\t\tinternalType: \"uint256\",\n\t\t\t\tname: \"numerator\",\n\t\t\t\ttype: \"uint256\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"uint256\",\n\t\t\t\tname: \"denominator\",\n\t\t\t\ttype: \"uint256\",\n\t\t\t},\n\t\t],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n] as const;\n","export const p2pStakeBoostFacetAbi = [\n {\n inputs: [{ internalType: \"uint256\", name: \"tokens\", type: \"uint256\" }],\n name: \"p2pBoostStake\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"uint256\", name: \"tokens\", type: \"uint256\" }],\n name: \"p2pBoostTopUp\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"p2pBoostRequestUnstake\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"p2pBoostClaimUnstake\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"p2pBoostCancelUnstake\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"address\", name: \"user\", type: \"address\" }],\n name: \"getUserStake\",\n outputs: [\n {\n components: [\n { internalType: \"uint128\", name: \"stakedAmount\", type: \"uint128\" },\n { internalType: \"uint64\", name: \"cooldownEnd\", type: \"uint64\" },\n { internalType: \"uint8\", name: \"status\", type: \"uint8\" },\n ],\n internalType: \"struct P2PStakeBoostStorage.UserStake\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"bytes32\", name: \"currency\", type: \"bytes32\" }],\n name: \"getStakeBoostConfig\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint256\",\n name: \"tokensPerUsdNumerator\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"tokensPerUsdDenominator\",\n type: \"uint256\",\n },\n { internalType: \"uint256\", name: \"maxBoostUsd\", type: \"uint256\" },\n ],\n internalType: \"struct P2PStakeBoostStorage.BoostConfig\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"getStakeBoostGlobals\",\n outputs: [\n { internalType: \"address\", name: \"p2pToken\", type: \"address\" },\n { internalType: \"address\", name: \"fraudReserve\", type: \"address\" },\n { internalType: \"uint256\", name: \"maxStakeTokens\", type: \"uint256\" },\n { internalType: \"uint256\", name: \"normalCooldown\", type: \"uint256\" },\n { internalType: \"uint256\", name: \"blacklistCooldown\", type: \"uint256\" },\n { internalType: \"uint8\", name: \"tokenDecimals\", type: \"uint8\" },\n { internalType: \"uint256\", name: \"totalStaked\", type: \"uint256\" },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n] as const;\n","export const reputationManagerAbi = [\n\t{\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tinternalType: \"string\",\n\t\t\t\tname: \"_socialName\",\n\t\t\t\ttype: \"string\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tcomponents: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"string\",\n\t\t\t\t\t\t\t\tname: \"provider\",\n\t\t\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"string\",\n\t\t\t\t\t\t\t\tname: \"parameters\",\n\t\t\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"string\",\n\t\t\t\t\t\t\t\tname: \"context\",\n\t\t\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tinternalType: \"struct IReclaimSDK.ClaimInfo\",\n\t\t\t\t\t\tname: \"claimInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tinternalType: \"bytes32\",\n\t\t\t\t\t\t\t\t\t\tname: \"identifier\",\n\t\t\t\t\t\t\t\t\t\ttype: \"bytes32\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tinternalType: \"address\",\n\t\t\t\t\t\t\t\t\t\tname: \"owner\",\n\t\t\t\t\t\t\t\t\t\ttype: \"address\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tinternalType: \"uint32\",\n\t\t\t\t\t\t\t\t\t\tname: \"timestampS\",\n\t\t\t\t\t\t\t\t\t\ttype: \"uint32\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tinternalType: \"uint32\",\n\t\t\t\t\t\t\t\t\t\tname: \"epoch\",\n\t\t\t\t\t\t\t\t\t\ttype: \"uint32\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tinternalType: \"struct IReclaimSDK.CompleteClaimData\",\n\t\t\t\t\t\t\t\tname: \"claim\",\n\t\t\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"bytes[]\",\n\t\t\t\t\t\t\t\tname: \"signatures\",\n\t\t\t\t\t\t\t\ttype: \"bytes[]\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tinternalType: \"struct IReclaimSDK.SignedClaim\",\n\t\t\t\t\t\tname: \"signedClaim\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tinternalType: \"struct IReclaimSDK.Proof[]\",\n\t\t\t\tname: \"proofs\",\n\t\t\t\ttype: \"tuple[]\",\n\t\t\t},\n\t\t],\n\t\tname: \"socialVerify\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tinternalType: \"uint256\",\n\t\t\t\tname: \"nullifierSeed\",\n\t\t\t\ttype: \"uint256\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"uint256\",\n\t\t\t\tname: \"nullifier\",\n\t\t\t\ttype: \"uint256\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"uint256\",\n\t\t\t\tname: \"timestamp\",\n\t\t\t\ttype: \"uint256\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"uint256\",\n\t\t\t\tname: \"signal\",\n\t\t\t\ttype: \"uint256\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"uint256[4]\",\n\t\t\t\tname: \"revealArray\",\n\t\t\t\ttype: \"uint256[4]\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"uint256[8]\",\n\t\t\t\tname: \"groth16Proof\",\n\t\t\t\ttype: \"uint256[8]\",\n\t\t\t},\n\t\t],\n\t\tname: \"submitAnonAadharProof\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tcomponents: [\n\t\t\t\t\t{\n\t\t\t\t\t\tinternalType: \"bytes32\",\n\t\t\t\t\t\tname: \"version\",\n\t\t\t\t\t\ttype: \"bytes32\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"bytes32\",\n\t\t\t\t\t\t\t\tname: \"vkeyHash\",\n\t\t\t\t\t\t\t\ttype: \"bytes32\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"bytes\",\n\t\t\t\t\t\t\t\tname: \"proof\",\n\t\t\t\t\t\t\t\ttype: \"bytes\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"bytes32[]\",\n\t\t\t\t\t\t\t\tname: \"publicInputs\",\n\t\t\t\t\t\t\t\ttype: \"bytes32[]\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tinternalType: \"struct ProofVerificationData\",\n\t\t\t\t\t\tname: \"proofVerificationData\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tinternalType: \"bytes\",\n\t\t\t\t\t\tname: \"committedInputs\",\n\t\t\t\t\t\ttype: \"bytes\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"uint256\",\n\t\t\t\t\t\t\t\tname: \"validityPeriodInSeconds\",\n\t\t\t\t\t\t\t\ttype: \"uint256\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"string\",\n\t\t\t\t\t\t\t\tname: \"domain\",\n\t\t\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"string\",\n\t\t\t\t\t\t\t\tname: \"scope\",\n\t\t\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"bool\",\n\t\t\t\t\t\t\t\tname: \"devMode\",\n\t\t\t\t\t\t\t\ttype: \"bool\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tinternalType: \"struct ServiceConfig\",\n\t\t\t\t\t\tname: \"serviceConfig\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tinternalType: \"struct ProofVerificationParams\",\n\t\t\t\tname: \"params\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"bool\",\n\t\t\t\tname: \"isIDCard\",\n\t\t\t\ttype: \"bool\",\n\t\t\t},\n\t\t],\n\t\tname: \"zkPassportRegister\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{ internalType: \"bytes32\", name: \"nullifier\", type: \"bytes32\" },\n\t\t\t{ internalType: \"uint256\", name: \"limit\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"expiry\", type: \"uint256\" },\n\t\t\t{ internalType: \"bytes\", name: \"signature\", type: \"bytes\" },\n\t\t],\n\t\tname: \"submitKycAttestation\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [],\n\t\tname: \"kycRp\",\n\t\toutputs: [{ internalType: \"uint256\", name: \"\", type: \"uint256\" }],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [{ internalType: \"address\", name: \"\", type: \"address\" }],\n\t\tname: \"kycVerified\",\n\t\toutputs: [{ internalType: \"bool\", name: \"\", type: \"bool\" }],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n\t// ── BVN (Nigerian Bank Verification Number) attestation ─────────────────\n\t{ inputs: [], name: \"BvnSignerNotSet\", type: \"error\" },\n\t{ inputs: [], name: \"BvnAttestationExpired\", type: \"error\" },\n\t{ inputs: [], name: \"BvnNullifierAlreadySpent\", type: \"error\" },\n\t{ inputs: [], name: \"BvnAlreadyVerified\", type: \"error\" },\n\t{ inputs: [], name: \"BvnInvalidSignature\", type: \"error\" },\n\t{\n\t\tinputs: [\n\t\t\t{ internalType: \"bytes32\", name: \"nullifier\", type: \"bytes32\" },\n\t\t\t{ internalType: \"uint256\", name: \"limit\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"expiry\", type: \"uint256\" },\n\t\t\t{ internalType: \"bytes\", name: \"signature\", type: \"bytes\" },\n\t\t],\n\t\tname: \"submitBvnAttestation\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [],\n\t\tname: \"bvnRp\",\n\t\toutputs: [{ internalType: \"uint256\", name: \"\", type: \"uint256\" }],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [{ internalType: \"address\", name: \"\", type: \"address\" }],\n\t\tname: \"bvnVerified\",\n\t\toutputs: [{ internalType: \"bool\", name: \"\", type: \"bool\" }],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n\t// ── Liveness (face-only, no document) attestation ───────────────────────\n\t{ inputs: [], name: \"LivenessSignerNotSet\", type: \"error\" },\n\t{ inputs: [], name: \"LivenessAttestationExpired\", type: \"error\" },\n\t{ inputs: [], name: \"LivenessNullifierZero\", type: \"error\" },\n\t{ inputs: [], name: \"LivenessNullifierAlreadySpent\", type: \"error\" },\n\t{ inputs: [], name: \"LivenessAlreadyVerified\", type: \"error\" },\n\t{ inputs: [], name: \"LivenessInvalidSignature\", type: \"error\" },\n\t{\n\t\tinputs: [\n\t\t\t{ internalType: \"bytes32\", name: \"nullifier\", type: \"bytes32\" },\n\t\t\t{ internalType: \"uint256\", name: \"limit\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"expiry\", type: \"uint256\" },\n\t\t\t{ internalType: \"bytes\", name: \"signature\", type: \"bytes\" },\n\t\t],\n\t\tname: \"submitLivenessAttestation\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [],\n\t\tname: \"livenessRp\",\n\t\toutputs: [{ internalType: \"uint256\", name: \"\", type: \"uint256\" }],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [{ internalType: \"address\", name: \"\", type: \"address\" }],\n\t\tname: \"livenessVerified\",\n\t\toutputs: [{ internalType: \"bool\", name: \"\", type: \"bool\" }],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n] as const;\n","import type { Result } from \"neverthrow\";\nimport type { Address } from \"viem\";\nimport {\n\tprepareSocialVerify,\n\tprepareSubmitAnonAadharProof,\n\tprepareSubmitBvnAttestation,\n\tprepareSubmitKycAttestation,\n\tprepareSubmitLivenessAttestation,\n\tprepareZkPassportRegister,\n} from \"../contracts/reputation-manager/writes\";\nimport type { ZkkycError } from \"./errors\";\nimport type { ZkkycConfig } from \"./types\";\nimport type {\n\tAnonAadharProofParams,\n\tBvnSubmitParams,\n\tLivenessSubmitParams,\n\tSimpleKycSubmitParams,\n\tSocialVerifyParams,\n\tZkPassportRegisterParams,\n} from \"./validation\";\n\nexport interface Zkkyc {\n\tprepareSocialVerify(\n\t\tparams: SocialVerifyParams,\n\t): Result<{ to: Address; data: `0x${string}` }, ZkkycError>;\n\tprepareSubmitAnonAadharProof(\n\t\tparams: AnonAadharProofParams,\n\t): Result<{ to: Address; data: `0x${string}` }, ZkkycError>;\n\tprepareZkPassportRegister(\n\t\tparams: ZkPassportRegisterParams,\n\t): Result<{ to: Address; data: `0x${string}` }, ZkkycError>;\n\tprepareSubmitKycAttestation(\n\t\tparams: SimpleKycSubmitParams,\n\t): Result<{ to: Address; data: `0x${string}` }, ZkkycError>;\n\tprepareSubmitBvnAttestation(\n\t\tparams: BvnSubmitParams,\n\t): Result<{ to: Address; data: `0x${string}` }, ZkkycError>;\n\tprepareSubmitLivenessAttestation(\n\t\tparams: LivenessSubmitParams,\n\t): Result<{ to: Address; data: `0x${string}` }, ZkkycError>;\n}\n\n/**\n * Creates a Zkkyc client that binds a reputation manager address,\n * exposing write-preparation methods for social verify, Aadhaar, and ZK Passport.\n */\nexport function createZkkyc(config: ZkkycConfig): Zkkyc {\n\tconst { reputationManagerAddress } = config;\n\treturn {\n\t\tprepareSocialVerify: (params) => prepareSocialVerify(reputationManagerAddress, params),\n\t\tprepareSubmitAnonAadharProof: (params) =>\n\t\t\tprepareSubmitAnonAadharProof(reputationManagerAddress, params),\n\t\tprepareZkPassportRegister: (params) =>\n\t\t\tprepareZkPassportRegister(reputationManagerAddress, params),\n\t\tprepareSubmitKycAttestation: (params) =>\n\t\t\tprepareSubmitKycAttestation(reputationManagerAddress, params),\n\t\tprepareSubmitBvnAttestation: (params) =>\n\t\t\tprepareSubmitBvnAttestation(reputationManagerAddress, params),\n\t\tprepareSubmitLivenessAttestation: (params) =>\n\t\t\tprepareSubmitLivenessAttestation(reputationManagerAddress, params),\n\t};\n}\n","import { ResultAsync } from \"neverthrow\";\nimport { ZkkycError, type ZkkycErrorCode } from \"../errors\";\nimport type {\n\tBvnAttestation,\n\tBvnDecision,\n\tBvnFlow,\n\tBvnFlowConfig,\n\tBvnMethod,\n\tBvnOnboardParams,\n\tBvnSendOtpParams,\n\tBvnSession,\n} from \"./types\";\n\n/**\n * Drives the BVN (Nigerian Bank Verification Number) on-chain attestation flow.\n *\n * The SDK talks only to a backend proxy — the single party that holds the Mono\n * secret + the EIP-712 attestor key. Every response uses the `{ ok, data }`\n * envelope. On approval, `getAttestation` returns a signed attestation shaped\n * for `zkkyc.prepareSubmitBvnAttestation`, which the app submits on-chain from\n * the same wallet.\n *\n * Flow: onboard → submitBvn → sendOtp → confirmOtp → getAttestation.\n */\nexport function createBvnFlow(config: BvnFlowConfig): BvnFlow {\n\tconst { baseUrl, tenant } = config;\n\n\tasync function request<T>(\n\t\tpath: string,\n\t\tfailureCode: ZkkycErrorCode,\n\t\tinit: RequestInit | undefined,\n\t\tparse: (data: unknown) => T,\n\t): Promise<T> {\n\t\tconst response = await fetch(`${baseUrl}${path}`, init);\n\t\tconst body: unknown = await response.json().catch(() => null);\n\t\tconst envelope =\n\t\t\tbody && typeof body === \"object\" ? (body as Record<string, unknown>) : {};\n\n\t\tif (!response.ok || envelope.ok === false) {\n\t\t\tconst code = typeof envelope.error === \"string\" ? envelope.error : \"request_failed\";\n\t\t\tconst message =\n\t\t\t\ttypeof envelope.message === \"string\"\n\t\t\t\t\t? envelope.message\n\t\t\t\t\t: `BVN request failed (${response.status})`;\n\t\t\t// A rejected session token means the run must restart from onboard.\n\t\t\tconst isSessionExpired = response.status === 401 || code === \"unauthorized\";\n\t\t\tthrow new ZkkycError(message, {\n\t\t\t\tcode: isSessionExpired ? \"BVN_SESSION_EXPIRED\" : failureCode,\n\t\t\t\tcontext: { status: response.status, backendError: code, path },\n\t\t\t});\n\t\t}\n\n\t\treturn parse(envelope.data);\n\t}\n\n\tfunction run<T>(\n\t\tfailureCode: ZkkycErrorCode,\n\t\tfn: () => Promise<T>,\n\t): ResultAsync<T, ZkkycError> {\n\t\treturn ResultAsync.fromPromise(fn(), (error) => {\n\t\t\tif (error instanceof ZkkycError) return error;\n\t\t\treturn new ZkkycError(\"BVN request failed\", { code: failureCode, cause: error });\n\t\t});\n\t}\n\n\tfunction authHeaders(token: string): Record<string, string> {\n\t\treturn { \"content-type\": \"application/json\", \"x-session-token\": token };\n\t}\n\n\treturn {\n\t\tonboard(params: BvnOnboardParams): ResultAsync<BvnSession, ZkkycError> {\n\t\t\treturn run(\"BVN_ONBOARD_FAILED\", () =>\n\t\t\t\trequest(\n\t\t\t\t\t\"/v1/onboard\",\n\t\t\t\t\t\"BVN_ONBOARD_FAILED\",\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\t\t\ttenant,\n\t\t\t\t\t\t\twallet: params.walletAddress,\n\t\t\t\t\t\t\tscope: params.scope ?? \"identity\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t\t(data) => {\n\t\t\t\t\t\tconst d = data as { session_id: number; session_token: string };\n\t\t\t\t\t\treturn { sessionId: d.session_id, sessionToken: d.session_token };\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t);\n\t\t},\n\n\t\tsubmitBvn(session: BvnSession, bvn: string): ResultAsync<BvnMethod[], ZkkycError> {\n\t\t\treturn run(\"BVN_SUBMIT_FAILED\", () =>\n\t\t\t\trequest(\n\t\t\t\t\t`/v1/sessions/${session.sessionId}/bvn`,\n\t\t\t\t\t\"BVN_SUBMIT_FAILED\",\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\t\theaders: authHeaders(session.sessionToken),\n\t\t\t\t\t\tbody: JSON.stringify({ bvn }),\n\t\t\t\t\t},\n\t\t\t\t\t(data) => (data as { methods: BvnMethod[] }).methods,\n\t\t\t\t),\n\t\t\t);\n\t\t},\n\n\t\tsendOtp(session: BvnSession, params: BvnSendOtpParams): ResultAsync<boolean, ZkkycError> {\n\t\t\treturn run(\"BVN_OTP_SEND_FAILED\", () =>\n\t\t\t\trequest(\n\t\t\t\t\t`/v1/sessions/${session.sessionId}/otp`,\n\t\t\t\t\t\"BVN_OTP_SEND_FAILED\",\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\t\theaders: authHeaders(session.sessionToken),\n\t\t\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\t\t\tmethod: params.method,\n\t\t\t\t\t\t\t...(params.method === \"alternate_phone\" && params.phoneNumber\n\t\t\t\t\t\t\t\t? { phone_number: params.phoneNumber }\n\t\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t\t(data) => (data as { sent: boolean }).sent,\n\t\t\t\t),\n\t\t\t);\n\t\t},\n\n\t\tconfirmOtp(session: BvnSession, otp: string): ResultAsync<BvnDecision, ZkkycError> {\n\t\t\treturn run(\"BVN_OTP_CONFIRM_FAILED\", () =>\n\t\t\t\trequest(\n\t\t\t\t\t`/v1/sessions/${session.sessionId}/otp/confirm`,\n\t\t\t\t\t\"BVN_OTP_CONFIRM_FAILED\",\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\t\theaders: authHeaders(session.sessionToken),\n\t\t\t\t\t\tbody: JSON.stringify({ otp }),\n\t\t\t\t\t},\n\t\t\t\t\t(data) => {\n\t\t\t\t\t\tconst d = data as { decision: \"approve\" | \"reject\"; reason?: string };\n\t\t\t\t\t\treturn { decision: d.decision, reason: d.reason };\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t);\n\t\t},\n\n\t\tgetAttestation(session: BvnSession): ResultAsync<BvnAttestation, ZkkycError> {\n\t\t\treturn run(\"BVN_ATTESTATION_FAILED\", () =>\n\t\t\t\trequest(\n\t\t\t\t\t`/v1/sessions/${session.sessionId}/attestation`,\n\t\t\t\t\t\"BVN_ATTESTATION_FAILED\",\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\t\theaders: { \"x-session-token\": session.sessionToken },\n\t\t\t\t\t},\n\t\t\t\t\t(data) => {\n\t\t\t\t\t\tconst d = data as {\n\t\t\t\t\t\t\tsignature: string;\n\t\t\t\t\t\t\tmessage: {\n\t\t\t\t\t\t\t\twallet: string;\n\t\t\t\t\t\t\t\tnullifier: string;\n\t\t\t\t\t\t\t\tlimit: string | number;\n\t\t\t\t\t\t\t\texpiry: string | number;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tnullifier: d.message.nullifier as `0x${string}`,\n\t\t\t\t\t\t\tlimit: BigInt(d.message.limit),\n\t\t\t\t\t\t\texpiry: BigInt(d.message.expiry),\n\t\t\t\t\t\t\tsignature: d.signature as `0x${string}`,\n\t\t\t\t\t\t\twallet: d.message.wallet,\n\t\t\t\t\t\t} satisfies BvnAttestation;\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t);\n\t\t},\n\n\t\tgetAttestor(): ResultAsync<{ address: string }, ZkkycError> {\n\t\t\treturn run(\"BVN_ATTESTATION_FAILED\", () =>\n\t\t\t\trequest(\n\t\t\t\t\t\"/v1/attestor\",\n\t\t\t\t\t\"BVN_ATTESTATION_FAILED\",\n\t\t\t\t\tundefined,\n\t\t\t\t\t(data) => data as { address: string },\n\t\t\t\t),\n\t\t\t);\n\t\t},\n\t};\n}\n","import type { SocialPlatform } from \"./types\";\n\n/** Default Reclaim provider IDs for each social platform. */\nexport const DEFAULT_RECLAIM_PROVIDER_IDS: Record<SocialPlatform, string> = {\n\tlinkedin: \"6a86edbe-a0fe-420b-8db2-3155220cc949\",\n\tgithub: \"033f0c06-2eb3-48c8-894c-5599c3356d1c\",\n\tx: \"aad95818-f726-4a34-be97-8d1f47631b03\",\n\tinstagram: \"7e5b59a9-56c5-490c-a169-82a443f9b507\",\n\tfacebook: \"2701510b-c835-4820-84f0-d9e74569656b\",\n\tbinance: \"7e40c007-f432-4d47-ac00-3e0762f8a7a0\",\n};\n\n/** ZK Passport app store links. */\nexport const ZK_PASSPORT_APP_LINKS = {\n\tIOS: \"https://apps.apple.com/us/app/zkpassport/id6477371975\",\n\tANDROID: \"https://play.google.com/store/apps/details?id=app.zkpassport.zkpassport\",\n} as const;\n\n/** Reclaim Protocol app store links. */\nexport const RECLAIM_APP_LINKS = {\n\tANDROID: \"https://play.google.com/store/apps/details?id=org.reclaimprotocol.app\",\n} as const;\n\n/** Default tenant slug for the P2P reputation contract on the simple-kyc service. */\nexport const SIMPLE_KYC_DEFAULT_TENANT = \"p2p-reputation\";\n\n/**\n * Default tenant slug for the P2P reputation contract on the **liveness**\n * service. Distinct registry from simple-kyc's — the two services keep separate\n * databases, so a slug existing on one says nothing about the other.\n */\nexport const LIVENESS_DEFAULT_TENANT = \"p2p-reputation-liveness\";\n\n/** OTP delivery channels the BVN backend (Mono) exposes. */\nexport const BVN_OTP_METHODS = [\"email\", \"phone\", \"phone_1\", \"alternate_phone\"] as const;\n","import { ResultAsync } from \"neverthrow\";\nimport { ZkkycError } from \"../errors\";\nimport type { LivenessAttestation, LivenessFlowParams, LivenessSession } from \"./types\";\n\n/**\n * Starts the hosted liveness wizard flow. Creates a browser-initiable widget\n * session (no API key in the browser — `baseUrl` points at the liveness proxy,\n * which injects the key and whose tenant allowlist validates the redirect_uri),\n * then returns the wizard URL to navigate to.\n *\n * The wizard runs onboard → active liveness challenge → face embed → 1:N dedup\n * and, on approval, redirects back to `redirectUrl` with `?code=<code>&state=<state>`.\n * Call `resumeLivenessFlow({ baseUrl, code })` on return to fetch the attestation.\n *\n * Deliberately separate from `createSimpleKycFlow`: the liveness verifier is a\n * different service with its own database, its own attestor key and its own\n * EIP-712 domain (`LivenessVerifier`, vs the passport wizard's `KycVerifier`).\n * Pointing one flow at the other's base URL yields a signature the contract\n * rejects. The one API-shape difference is that liveness takes **no `country`** —\n * it reads no document, so there is no issuing market to prebind.\n */\nexport function createLivenessFlow(\n\tparams: LivenessFlowParams,\n): ResultAsync<LivenessSession, ZkkycError> {\n\tconst { baseUrl, walletAddress, tenant, redirectUrl, state, onStatus } = params;\n\treturn ResultAsync.fromPromise(\n\t\t(async () => {\n\t\t\tconst res = await fetch(`${baseUrl}/v1/widget/public-sessions`, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\twallet_pubkey: walletAddress,\n\t\t\t\t\tredirect_uri: redirectUrl,\n\t\t\t\t\ttenant,\n\t\t\t\t\tstate,\n\t\t\t\t}),\n\t\t\t});\n\t\t\tif (!res.ok) {\n\t\t\t\tconst body = await res.text();\n\t\t\t\tthrow new ZkkycError(`liveness session creation failed: ${res.status} ${body}`, {\n\t\t\t\t\tcode: \"LIVENESS_SESSION_FAILED\",\n\t\t\t\t\tcontext: { status: res.status },\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst data = (await res.json()) as { widget_url: string };\n\t\t\tconst widgetUrl = data.widget_url;\n\t\t\tonStatus?.({ type: \"session_created\", widgetUrl });\n\t\t\treturn {\n\t\t\t\twidgetUrl,\n\t\t\t\tredirect: () => {\n\t\t\t\t\tif (typeof window !== \"undefined\") {\n\t\t\t\t\t\tonStatus?.({ type: \"redirecting\", widgetUrl });\n\t\t\t\t\t\twindow.location.href = widgetUrl;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t} satisfies LivenessSession;\n\t\t})(),\n\t\t(error) => {\n\t\t\tif (error instanceof ZkkycError) return error;\n\t\t\treturn new ZkkycError(\"liveness flow failed to start\", {\n\t\t\t\tcode: \"LIVENESS_SESSION_FAILED\",\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t},\n\t);\n}\n\n/**\n * Redeems the one-time `code` from the wizard's redirect for the EIP-712\n * attestation. The result feeds straight into `zkkyc.prepareSubmitLivenessAttestation`.\n * The endpoint returns only the (non-PII, self-verifying) attestation.\n */\nexport function resumeLivenessFlow(args: {\n\tbaseUrl: string;\n\tcode: string;\n}): ResultAsync<LivenessAttestation, ZkkycError> {\n\treturn ResultAsync.fromPromise(\n\t\t(async () => {\n\t\t\tconst res = await fetch(`${args.baseUrl}/v1/widget/attestation`, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\t\tbody: JSON.stringify({ code: args.code }),\n\t\t\t});\n\t\t\tif (!res.ok) {\n\t\t\t\tconst body = await res.text();\n\t\t\t\tthrow new ZkkycError(`liveness attestation redemption failed: ${res.status} ${body}`, {\n\t\t\t\t\tcode: \"LIVENESS_REDEEM_FAILED\",\n\t\t\t\t\tcontext: { status: res.status },\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst d = (await res.json()) as {\n\t\t\t\tnullifier: string;\n\t\t\t\tlimit: string | number;\n\t\t\t\texpiry: string | number;\n\t\t\t\tsignature: string;\n\t\t\t\tidentity_hash?: string;\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tnullifier: d.nullifier as `0x${string}`,\n\t\t\t\tlimit: BigInt(d.limit),\n\t\t\t\texpiry: BigInt(d.expiry),\n\t\t\t\tsignature: d.signature as `0x${string}`,\n\t\t\t\tidentityHash: d.identity_hash,\n\t\t\t} satisfies LivenessAttestation;\n\t\t})(),\n\t\t(error) => {\n\t\t\tif (error instanceof ZkkycError) return error;\n\t\t\treturn new ZkkycError(\"liveness attestation redemption failed\", {\n\t\t\t\tcode: \"LIVENESS_REDEEM_FAILED\",\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t},\n\t);\n}\n","import { ResultAsync } from \"neverthrow\";\nimport { ZkkycError } from \"../errors\";\nimport type { ReclaimFlowParams, ReclaimProofResult, ReclaimSession } from \"./types\";\nimport { SOCIAL_PLATFORM_NAMES } from \"./types\";\n\nconst RECLAIM_SESSION_API = \"https://api.reclaimprotocol.org/api/sdk/session\";\n\n/**\n * Initializes a Reclaim social verification flow and returns a session. `init()`\n * runs eagerly here, so call this on page load; the returned session's `start()`\n * triggers the in-app flow and polls for the proof, so call that on user action.\n */\nexport function createReclaimFlow(\n\tparams: ReclaimFlowParams,\n): ResultAsync<ReclaimSession, ZkkycError> {\n\treturn ResultAsync.fromPromise(\n\t\t(async () => {\n\t\t\t// biome-ignore lint/suspicious/noExplicitAny: optional peer dependency\n\t\t\tconst mod: any = await import(\"@reclaimprotocol/js-sdk\").catch(() => {\n\t\t\t\tthrow new ZkkycError(\n\t\t\t\t\t\"Missing peer dependency: @reclaimprotocol/js-sdk. Install it with: npm install @reclaimprotocol/js-sdk\",\n\t\t\t\t\t{ code: \"PEER_DEPENDENCY_MISSING\" },\n\t\t\t\t);\n\t\t\t});\n\t\t\tconst { ReclaimProofRequest, transformForOnchain } = mod;\n\n\t\t\tconst {\n\t\t\t\tappId,\n\t\t\t\tappSecret,\n\t\t\t\tproviderIds,\n\t\t\t\tplatform,\n\t\t\t\twalletAddress,\n\t\t\t\tredirectUrl,\n\t\t\t\tsessionId: existingSessionId,\n\t\t\t\tcontextDescription,\n\t\t\t\tonStatus,\n\t\t\t\tsignal,\n\t\t\t\tpollingIntervalMs = 5000,\n\t\t\t} = params;\n\n\t\t\tconst socialName = SOCIAL_PLATFORM_NAMES[platform];\n\t\t\tconst providerId = providerIds[platform];\n\n\t\t\t// biome-ignore lint/suspicious/noExplicitAny: optional peer dependency\n\t\t\tlet reclaimProofRequest: any = null;\n\t\t\tlet sessionId: string;\n\t\t\tlet requestUrl = \"\";\n\n\t\t\tif (existingSessionId) {\n\t\t\t\tsessionId = existingSessionId;\n\t\t\t} else {\n\t\t\t\treclaimProofRequest = await ReclaimProofRequest.init(appId, appSecret, providerId, {\n\t\t\t\t\tlaunchOptions: {\n\t\t\t\t\t\tcanUseDeferredDeepLinksFlow: true,\n\t\t\t\t\t\tverificationMode: \"app\",\n\t\t\t\t\t},\n\t\t\t\t\tuseAppClip: true,\n\t\t\t\t\tlog: true,\n\t\t\t\t});\n\n\t\t\t\tconst statusUrl = reclaimProofRequest.getStatusUrl();\n\t\t\t\tsessionId = statusUrl.split(\"/\").pop() || \"\";\n\n\t\t\t\tif (redirectUrl) {\n\t\t\t\t\tconst separator = redirectUrl.includes(\"?\") ? \"&\" : \"?\";\n\t\t\t\t\treclaimProofRequest.setRedirectUrl(\n\t\t\t\t\t\t`${redirectUrl}${separator}sessionId=${sessionId}&socialPlatform=${socialName}`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treclaimProofRequest.addContext(\n\t\t\t\t\twalletAddress,\n\t\t\t\t\tcontextDescription ?? `Social verification for ${socialName}`,\n\t\t\t\t);\n\n\t\t\t\trequestUrl = await reclaimProofRequest.getRequestUrl();\n\n\t\t\t\tonStatus?.({ type: \"session_created\", sessionId, requestUrl });\n\t\t\t}\n\n\t\t\tlet aborted = false;\n\n\t\t\tconst pollForProof = async (): Promise<ReclaimProofResult> => {\n\t\t\t\tif (reclaimProofRequest && typeof window !== \"undefined\") {\n\t\t\t\t\treclaimProofRequest.triggerReclaimFlow({ verificationMode: \"app\" });\n\t\t\t\t}\n\n\t\t\t\tonStatus?.({ type: \"polling_started\", sessionId });\n\n\t\t\t\twhile (true) {\n\t\t\t\t\tif (aborted || signal?.aborted) {\n\t\t\t\t\t\tthrow new ZkkycError(\"Reclaim polling aborted\", {\n\t\t\t\t\t\t\tcode: \"RECLAIM_POLLING_ABORTED\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tconst response = await fetch(`${RECLAIM_SESSION_API}/${sessionId}`);\n\t\t\t\t\tconst data = await response.json();\n\n\t\t\t\t\tif (data?.session?.proofs?.length > 0) {\n\t\t\t\t\t\tconst proofs = data.session.proofs;\n\t\t\t\t\t\tonStatus?.({ type: \"proof_received\" });\n\n\t\t\t\t\t\tif (platform === \"github\" && proofs.length > 0) {\n\t\t\t\t\t\t\tconst first = proofs[0] as { publicData?: Record<string, unknown> };\n\t\t\t\t\t\t\tif (first?.publicData && Object.keys(first.publicData).length === 0) {\n\t\t\t\t\t\t\t\tthrow new ZkkycError(\"GitHub verification eligibility criteria not met\", {\n\t\t\t\t\t\t\t\t\tcode: \"RECLAIM_PROOF_INVALID\",\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst transformedProofs = proofs.map((proof: unknown) => transformForOnchain(proof));\n\n\t\t\t\t\t\tonStatus?.({ type: \"proof_transformed\" });\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t_socialName: socialName,\n\t\t\t\t\t\t\tproofs: transformedProofs,\n\t\t\t\t\t\t\tsessionId,\n\t\t\t\t\t\t} as ReclaimProofResult;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (data?.message?.includes(\"Session not found\")) {\n\t\t\t\t\t\tthrow new ZkkycError(\"Reclaim session not found\", {\n\t\t\t\t\t\t\tcode: \"RECLAIM_SESSION_NOT_FOUND\",\n\t\t\t\t\t\t\tcontext: { sessionId },\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (data?.session?.statusV2 === \"PROOF_GENERATION_FAILED\") {\n\t\t\t\t\t\tthrow new ZkkycError(\"Reclaim proof generation failed\", {\n\t\t\t\t\t\t\tcode: \"RECLAIM_PROOF_GENERATION_FAILED\",\n\t\t\t\t\t\t\tcontext: { sessionId },\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, pollingIntervalMs));\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst session: ReclaimSession = {\n\t\t\t\tsessionId,\n\t\t\t\trequestUrl,\n\t\t\t\tstart: () =>\n\t\t\t\t\tResultAsync.fromPromise(pollForProof(), (error) => {\n\t\t\t\t\t\tif (error instanceof ZkkycError) return error;\n\t\t\t\t\t\treturn new ZkkycError(\"Reclaim verification flow failed\", {\n\t\t\t\t\t\t\tcode: \"RECLAIM_INIT_FAILED\",\n\t\t\t\t\t\t\tcause: error,\n\t\t\t\t\t\t});\n\t\t\t\t\t}),\n\t\t\t\tabort: () => {\n\t\t\t\t\taborted = true;\n\t\t\t\t},\n\t\t\t};\n\n\t\t\treturn session;\n\t\t})(),\n\t\t(error) => {\n\t\t\tif (error instanceof ZkkycError) return error;\n\t\t\treturn new ZkkycError(\"Reclaim verification flow failed\", {\n\t\t\t\tcode: \"RECLAIM_INIT_FAILED\",\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t},\n\t);\n}\n","import type { ResultAsync } from \"neverthrow\";\nimport type { Address } from \"viem\";\nimport type { ZkkycError } from \"../errors\";\nimport type { SolidityVerifierParameters } from \"../validation\";\n\n// ── Social Platform ──────────────────────────────────────────────────────────\n\nexport type SocialPlatform = \"linkedin\" | \"github\" | \"x\" | \"instagram\" | \"facebook\" | \"binance\";\n\n/** Maps SocialPlatform to the capitalized name the contract expects for _socialName. */\nexport const SOCIAL_PLATFORM_NAMES: Record<SocialPlatform, string> = {\n\tlinkedin: \"LinkedIn\",\n\tgithub: \"GitHub\",\n\tx: \"X\",\n\tinstagram: \"Instagram\",\n\tfacebook: \"Facebook\",\n\tbinance: \"Binance\",\n};\n\n// ── Reclaim (Social Verification) ────────────────────────────────────────────\n\n/**\n * Single-object params for `createReclaimFlow`. Merges the app-level config\n * (appId, appSecret, providerIds) with the per-call options (platform,\n * walletAddress, callbacks, …) into one argument.\n */\nexport interface ReclaimFlowParams {\n\t// ── App-level config ──────────────────────────────────────────────\n\treadonly appId: string;\n\treadonly appSecret: string;\n\treadonly providerIds: Record<SocialPlatform, string>;\n\n\t// ── Per-call options ──────────────────────────────────────────────\n\treadonly platform: SocialPlatform;\n\treadonly walletAddress: Address;\n\t/** Base URL for redirect after Reclaim flow. SDK appends ?sessionId={id}&socialPlatform={Name}. */\n\treadonly redirectUrl?: string;\n\t/** Resume polling for an existing session (redirect-back case). */\n\treadonly sessionId?: string;\n\t/** Description added to Reclaim context. */\n\treadonly contextDescription?: string;\n\t/** Called with status updates during the flow. */\n\treadonly onStatus?: (status: ReclaimStatus) => void;\n\t/** AbortSignal to cancel polling. */\n\treadonly signal?: AbortSignal;\n\t/** Polling interval in ms. Defaults to 5000. */\n\treadonly pollingIntervalMs?: number;\n}\n\nexport type ReclaimStatus =\n\t| { type: \"session_created\"; sessionId: string; requestUrl: string }\n\t| { type: \"polling_started\"; sessionId: string }\n\t| { type: \"proof_received\" }\n\t| { type: \"proof_transformed\" };\n\nexport interface ReclaimProofResult {\n\treadonly _socialName: string;\n\treadonly proofs: readonly {\n\t\tclaimInfo: { provider: string; parameters: string; context: string };\n\t\tsignedClaim: {\n\t\t\tclaim: { identifier: string; owner: string; timestampS: number; epoch: number };\n\t\t\tsignatures: string[];\n\t\t};\n\t}[];\n\treadonly sessionId: string;\n}\n\nexport interface ReclaimSession {\n\t/** The Reclaim session id (empty until known when resuming). */\n\treadonly sessionId: string;\n\t/** URL to display as a QR code or open as a deep link. Empty when resuming an existing session. */\n\treadonly requestUrl: string;\n\t/** Triggers the in-app Reclaim flow (browser only) and polls until the proof is ready. Call on user action (e.g. button click). */\n\treadonly start: () => ResultAsync<ReclaimProofResult, ZkkycError>;\n\t/** Aborts an in-flight polling loop started by `start`. */\n\treadonly abort: () => void;\n}\n\n// ── ZK Passport ──────────────────────────────────────────────────────────────\n\n/**\n * Single-object params for `createZkPassportFlow`. Merges app-level config\n * (domain, name, logo, purpose) with per-call options (walletAddress, onStatus).\n */\nexport interface ZkPassportFlowParams {\n\t// ── App-level config ──────────────────────────────────────────────\n\t/** Domain for ZKPassport initialization (e.g. \"app.yourproject.com\"). Required — no default is provided to avoid impersonating another app. */\n\treadonly domain: string;\n\t/** App name shown in ZKPassport UI. Defaults to \"ZKPassport\". */\n\treadonly name?: string;\n\t/** Logo URL shown in ZKPassport UI. */\n\treadonly logo?: string;\n\t/** Purpose text shown in ZKPassport UI. Defaults to \"Prove your personhood\". */\n\treadonly purpose?: string;\n\n\t// ── Per-call options ──────────────────────────────────────────────\n\treadonly walletAddress: Address;\n\t/** Called with status updates during the flow. */\n\treadonly onStatus?: (status: ZkPassportStatus) => void;\n}\n\nexport type ZkPassportStatus =\n\t| { type: \"request_created\"; url: string }\n\t| { type: \"request_received\" }\n\t| { type: \"generating_proof\" }\n\t| { type: \"proof_generated\" }\n\t| { type: \"result_received\" }\n\t| { type: \"rejected\" };\n\nexport interface ZkPassportProofResult {\n\treadonly params: SolidityVerifierParameters;\n\treadonly isIDCard: boolean;\n}\n\nexport interface ZkPassportSession {\n\t/** URL to display as QR code or open as deeplink. */\n\treadonly url: string;\n\t/** Resolves when the full flow completes (proof verified). */\n\treadonly result: ResultAsync<ZkPassportProofResult, ZkkycError>;\n\t/** Aborts the flow. The result promise will reject with ZK_PASSPORT_ABORTED. */\n\treadonly abort: () => void;\n}\n\n// ── simple-kyc (hosted passport + liveness wizard) ────────────────────────────\n\n/**\n * Params for `createSimpleKycFlow`. The app opens the hosted simple-kyc wizard,\n * which runs onboard → passport → liveness → face match/dedup and, on approval,\n * redirects back to `redirectUrl` with `?code=<code>&state=<state>`. The app\n * then calls `resumeSimpleKycFlow` to redeem the code for the EIP-712 attestation.\n */\nexport interface SimpleKycFlowParams {\n\t/**\n\t * Base URL exposing the browser-facing `/v1/widget/public-sessions` and\n\t * `/v1/widget/attestation` endpoints — the `kyc-proxy` in a client-only setup\n\t * (e.g. http://localhost:8787). The proxy holds the X-API-Key and forwards to\n\t * simple-kyc's key-gated endpoints.\n\t */\n\treadonly baseUrl: string;\n\t/** The user's EVM wallet — bound into the attestation and credited on-chain. */\n\treadonly walletAddress: Address;\n\t/** Tenant slug (one per consuming contract), e.g. \"p2p-reputation\". */\n\treadonly tenant: string;\n\t/** Return URL — pass `${window.location.origin}<route>` so each app self-routes. */\n\treadonly redirectUrl: string;\n\t/**\n\t * ISO-2 country code (e.g. \"IN\"). Required — the embedded wizard skips the\n\t * country step, so the app must prebind it. Must be one of simple-kyc's\n\t * supported markets (IN, NG, BR, MX, CO, AR, VE, ID).\n\t */\n\treadonly country: string;\n\t/** Opaque state round-tripped back to the app (CSRF/nonce + page to restore). */\n\treadonly state?: string;\n\t/** Status callback. */\n\treadonly onStatus?: (status: SimpleKycStatus) => void;\n}\n\nexport type SimpleKycStatus =\n\t| { type: \"session_created\"; widgetUrl: string }\n\t| { type: \"redirecting\"; widgetUrl: string };\n\nexport interface SimpleKycSession {\n\t/** The hosted wizard URL to navigate to. */\n\treadonly widgetUrl: string;\n\t/** Convenience: navigate the browser to the wizard (no-op outside the browser). */\n\treadonly redirect: () => void;\n}\n\n/** The on-chain-ready attestation, shaped for `prepareSubmitKycAttestation`. */\nexport interface SimpleKycAttestation {\n\treadonly nullifier: `0x${string}`;\n\treadonly limit: bigint;\n\treadonly expiry: bigint;\n\treadonly signature: `0x${string}`;\n\t/** The opaque unique-human handle (no PII), for app-side bookkeeping. */\n\treadonly identityHash?: string;\n}\n\n// ── liveness (hosted face-only wizard, no document) ───────────────────────────\n\n/**\n * Params for `createLivenessFlow`. The app opens the hosted liveness wizard,\n * which runs onboard → active liveness challenge → face embed → 1:N dedup and,\n * on approval, redirects back to `redirectUrl` with `?code=<code>&state=<state>`.\n * The app then calls `resumeLivenessFlow` to redeem the code for the EIP-712\n * attestation.\n *\n * Identical to `SimpleKycFlowParams` minus `country`: liveness reads no\n * document, so there is no issuing market to prebind.\n */\nexport interface LivenessFlowParams {\n\t/**\n\t * Base URL exposing the browser-facing `/v1/widget/public-sessions` and\n\t * `/v1/widget/attestation` endpoints — the liveness proxy in a client-only\n\t * setup (e.g. https://liveness-proxy.p2p.cool). The proxy holds the\n\t * X-API-Key and forwards to the liveness service's key-gated endpoints.\n\t * This is **not** the same host as the passport (`simple-kyc`) proxy.\n\t */\n\treadonly baseUrl: string;\n\t/** The user's EVM wallet — bound into the attestation and credited on-chain. */\n\treadonly walletAddress: Address;\n\t/** Tenant slug (one per consuming contract), e.g. \"p2p-reputation-liveness\". */\n\treadonly tenant: string;\n\t/** Return URL — pass `${window.location.origin}<route>` so each app self-routes. */\n\treadonly redirectUrl: string;\n\t/** Opaque state round-tripped back to the app (CSRF/nonce + page to restore). */\n\treadonly state?: string;\n\t/** Status callback. */\n\treadonly onStatus?: (status: LivenessStatus) => void;\n}\n\nexport type LivenessStatus =\n\t| { type: \"session_created\"; widgetUrl: string }\n\t| { type: \"redirecting\"; widgetUrl: string };\n\nexport interface LivenessSession {\n\t/** The hosted wizard URL to navigate to. */\n\treadonly widgetUrl: string;\n\t/** Convenience: navigate the browser to the wizard (no-op outside the browser). */\n\treadonly redirect: () => void;\n}\n\n/** The on-chain-ready attestation, shaped for `prepareSubmitLivenessAttestation`. */\nexport interface LivenessAttestation {\n\treadonly nullifier: `0x${string}`;\n\treadonly limit: bigint;\n\treadonly expiry: bigint;\n\treadonly signature: `0x${string}`;\n\t/** The opaque unique-human handle (no PII), for app-side bookkeeping. */\n\treadonly identityHash?: string;\n}\n\n// ── BVN (Nigerian Bank Verification Number) ──────────────────────────────────\n\n/** OTP delivery channels the BVN backend exposes. `alternate_phone` needs a number. */\nexport type BvnOtpMethod = \"email\" | \"phone\" | \"phone_1\" | \"alternate_phone\";\n\n/** BVN identity scope requested during onboard. */\nexport type BvnScope = \"identity\" | \"bank_accounts\";\n\n/**\n * Shared config for every BVN step. `baseUrl` points at the backend proxy — the\n * only party holding the Mono secret + the EIP-712 attestor key — using the\n * `{ ok, data }` envelope.\n */\nexport interface BvnFlowConfig {\n\t/** Backend proxy base URL (e.g. https://ngn-bvn-verify-production.up.railway.app). */\n\treadonly baseUrl: string;\n\t/** Tenant slug registered on the backend, mapping to one on-chain contract. */\n\treadonly tenant: string;\n}\n\n/** An active BVN backend session. Carry this between steps. */\nexport interface BvnSession {\n\treadonly sessionId: number;\n\treadonly sessionToken: string;\n}\n\n/** An available OTP delivery method returned after submitting the BVN. */\nexport interface BvnMethod {\n\treadonly method: string;\n\treadonly hint?: string;\n}\n\n/** The confirm-OTP decision. `reject` may carry a reason (e.g. \"bvn_reused\"). */\nexport interface BvnDecision {\n\treadonly decision: \"approve\" | \"reject\";\n\treadonly reason?: string;\n}\n\n/** The on-chain-ready attestation, shaped for `prepareSubmitBvnAttestation`. */\nexport interface BvnAttestation {\n\treadonly nullifier: `0x${string}`;\n\treadonly limit: bigint;\n\treadonly expiry: bigint;\n\treadonly signature: `0x${string}`;\n\t/** The wallet the attestation is bound to. */\n\treadonly wallet?: string;\n}\n\n/** Params for `bvnOnboard`. */\nexport interface BvnOnboardParams {\n\t/** The user's EVM wallet — bound into the attestation and credited on-chain. */\n\treadonly walletAddress: Address;\n\t/** Identity scope. Defaults to \"identity\". */\n\treadonly scope?: BvnScope;\n}\n\n/** Params for `bvnSendOtp`. */\nexport interface BvnSendOtpParams {\n\treadonly method: BvnOtpMethod;\n\t/** Required only when `method` is \"alternate_phone\". */\n\treadonly phoneNumber?: string;\n}\n\n/** The full BVN flow bound to a config — mirrors the `Zkkyc` client shape. */\nexport interface BvnFlow {\n\t/** Step 1 — start a session bound to the wallet + tenant. */\n\tonboard(params: BvnOnboardParams): ResultAsync<BvnSession, ZkkycError>;\n\t/** Step 2 — submit the 11-digit BVN, get available OTP methods. */\n\tsubmitBvn(session: BvnSession, bvn: string): ResultAsync<BvnMethod[], ZkkycError>;\n\t/** Step 3 — request an OTP over the chosen channel. */\n\tsendOtp(session: BvnSession, params: BvnSendOtpParams): ResultAsync<boolean, ZkkycError>;\n\t/** Step 4 — confirm the OTP; returns approve/reject (never any PII). */\n\tconfirmOtp(session: BvnSession, otp: string): ResultAsync<BvnDecision, ZkkycError>;\n\t/** Step 5 — mint the signed EIP-712 attestation for an approved session. */\n\tgetAttestation(session: BvnSession): ResultAsync<BvnAttestation, ZkkycError>;\n\t/** Optional — the address the tenant contract must trust as its signer. */\n\tgetAttestor(): ResultAsync<{ address: string }, ZkkycError>;\n}\n","import { ResultAsync } from \"neverthrow\";\nimport { ZkkycError } from \"../errors\";\nimport type { SimpleKycAttestation, SimpleKycFlowParams, SimpleKycSession } from \"./types\";\n\n/**\n * Starts the hosted simple-kyc wizard flow. Creates a browser-initiable widget\n * session (no API key in the browser — `baseUrl` points at the kyc-proxy, which\n * injects the key and whose tenant allowlist validates the redirect_uri), then\n * returns the wizard URL to navigate to.\n *\n * The wizard runs passport → liveness → face match/dedup and, on approval,\n * redirects back to `redirectUrl` with `?code=<code>&state=<state>`. Call\n * `resumeSimpleKycFlow({ baseUrl, code })` on return to fetch the attestation.\n */\nexport function createSimpleKycFlow(\n\tparams: SimpleKycFlowParams,\n): ResultAsync<SimpleKycSession, ZkkycError> {\n\tconst { baseUrl, walletAddress, tenant, redirectUrl, country, state, onStatus } = params;\n\treturn ResultAsync.fromPromise(\n\t\t(async () => {\n\t\t\tconst res = await fetch(`${baseUrl}/v1/widget/public-sessions`, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\twallet_pubkey: walletAddress,\n\t\t\t\t\tredirect_uri: redirectUrl,\n\t\t\t\t\ttenant,\n\t\t\t\t\tcountry,\n\t\t\t\t\tstate,\n\t\t\t\t}),\n\t\t\t});\n\t\t\tif (!res.ok) {\n\t\t\t\tconst body = await res.text();\n\t\t\t\tthrow new ZkkycError(`simple-kyc session creation failed: ${res.status} ${body}`, {\n\t\t\t\t\tcode: \"SIMPLE_KYC_SESSION_FAILED\",\n\t\t\t\t\tcontext: { status: res.status },\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst data = (await res.json()) as { widget_url: string };\n\t\t\tconst widgetUrl = data.widget_url;\n\t\t\tonStatus?.({ type: \"session_created\", widgetUrl });\n\t\t\treturn {\n\t\t\t\twidgetUrl,\n\t\t\t\tredirect: () => {\n\t\t\t\t\tif (typeof window !== \"undefined\") {\n\t\t\t\t\t\tonStatus?.({ type: \"redirecting\", widgetUrl });\n\t\t\t\t\t\twindow.location.href = widgetUrl;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t} satisfies SimpleKycSession;\n\t\t})(),\n\t\t(error) => {\n\t\t\tif (error instanceof ZkkycError) return error;\n\t\t\treturn new ZkkycError(\"simple-kyc flow failed to start\", {\n\t\t\t\tcode: \"SIMPLE_KYC_SESSION_FAILED\",\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t},\n\t);\n}\n\n/**\n * Redeems the one-time `kyc_code` from the wizard's redirect for the EIP-712\n * attestation. The result feeds straight into `zkkyc.prepareSubmitKycAttestation`.\n * The endpoint returns only the (non-PII, self-verifying) attestation.\n */\nexport function resumeSimpleKycFlow(args: {\n\tbaseUrl: string;\n\tcode: string;\n}): ResultAsync<SimpleKycAttestation, ZkkycError> {\n\treturn ResultAsync.fromPromise(\n\t\t(async () => {\n\t\t\tconst res = await fetch(`${args.baseUrl}/v1/widget/attestation`, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\t\tbody: JSON.stringify({ code: args.code }),\n\t\t\t});\n\t\t\tif (!res.ok) {\n\t\t\t\tconst body = await res.text();\n\t\t\t\tthrow new ZkkycError(`simple-kyc attestation redemption failed: ${res.status} ${body}`, {\n\t\t\t\t\tcode: \"SIMPLE_KYC_REDEEM_FAILED\",\n\t\t\t\t\tcontext: { status: res.status },\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst d = (await res.json()) as {\n\t\t\t\tnullifier: string;\n\t\t\t\tlimit: string | number;\n\t\t\t\texpiry: string | number;\n\t\t\t\tsignature: string;\n\t\t\t\tidentity_hash?: string;\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tnullifier: d.nullifier as `0x${string}`,\n\t\t\t\tlimit: BigInt(d.limit),\n\t\t\t\texpiry: BigInt(d.expiry),\n\t\t\t\tsignature: d.signature as `0x${string}`,\n\t\t\t\tidentityHash: d.identity_hash,\n\t\t\t} satisfies SimpleKycAttestation;\n\t\t})(),\n\t\t(error) => {\n\t\t\tif (error instanceof ZkkycError) return error;\n\t\t\treturn new ZkkycError(\"simple-kyc attestation redemption failed\", {\n\t\t\t\tcode: \"SIMPLE_KYC_REDEEM_FAILED\",\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t},\n\t);\n}\n","import { ResultAsync } from \"neverthrow\";\nimport { ZkkycError } from \"../errors\";\nimport type { ZkPassportFlowParams, ZkPassportProofResult, ZkPassportSession } from \"./types\";\n\n/** Initializes a ZK Passport verification flow and returns a session. */\nexport function createZkPassportFlow(\n\tparams: ZkPassportFlowParams,\n): ResultAsync<ZkPassportSession, ZkkycError> {\n\treturn ResultAsync.fromPromise(\n\t\t(async () => {\n\t\t\t// biome-ignore lint/suspicious/noExplicitAny: optional peer dependency\n\t\t\tconst mod: any = await import(\"@zkpassport/sdk\").catch(() => {\n\t\t\t\tthrow new ZkkycError(\n\t\t\t\t\t\"Missing peer dependency: @zkpassport/sdk. Install it with: npm install @zkpassport/sdk\",\n\t\t\t\t\t{ code: \"PEER_DEPENDENCY_MISSING\" },\n\t\t\t\t);\n\t\t\t});\n\t\t\tconst { ZKPassport } = mod;\n\n\t\t\tconst zkPassport = new ZKPassport(params.domain);\n\n\t\t\tconst queryBuilder = await zkPassport.request({\n\t\t\t\tname: params.name ?? \"ZKPassport\",\n\t\t\t\tlogo: params.logo,\n\t\t\t\tpurpose: params.purpose ?? \"Prove your personhood\",\n\t\t\t\tscope: \"personhood\",\n\t\t\t\tmode: \"compressed-evm\",\n\t\t\t});\n\n\t\t\tconst {\n\t\t\t\turl,\n\t\t\t\tonRequestReceived,\n\t\t\t\tonGeneratingProof,\n\t\t\t\tonProofGenerated,\n\t\t\t\tonResult,\n\t\t\t\tonReject,\n\t\t\t\tonError,\n\t\t\t} = queryBuilder\n\t\t\t\t.gte(\"age\", 18)\n\t\t\t\t.disclose(\"document_type\")\n\t\t\t\t.disclose(\"nationality\")\n\t\t\t\t.bind(\"user_address\", params.walletAddress)\n\t\t\t\t.done();\n\n\t\t\tparams.onStatus?.({ type: \"request_created\", url });\n\n\t\t\tlet aborted = false;\n\n\t\t\tconst resultPromise = new Promise<ZkPassportProofResult>((resolve, reject) => {\n\t\t\t\tlet proof: unknown = null;\n\n\t\t\t\tonRequestReceived(() => {\n\t\t\t\t\tif (aborted) return;\n\t\t\t\t\tparams.onStatus?.({ type: \"request_received\" });\n\t\t\t\t});\n\n\t\t\t\tonGeneratingProof(() => {\n\t\t\t\t\tif (aborted) return;\n\t\t\t\t\tparams.onStatus?.({ type: \"generating_proof\" });\n\t\t\t\t});\n\n\t\t\t\tonProofGenerated(async (result: unknown) => {\n\t\t\t\t\tif (aborted) return;\n\t\t\t\t\tparams.onStatus?.({ type: \"proof_generated\" });\n\t\t\t\t\tproof = result;\n\t\t\t\t});\n\n\t\t\t\tonResult(\n\t\t\t\t\tasync ({\n\t\t\t\t\t\tresult,\n\t\t\t\t\t\tuniqueIdentifier,\n\t\t\t\t\t\tverified,\n\t\t\t\t\t}: {\n\t\t\t\t\t\tresult: Record<string, { disclose?: { result?: string } }>;\n\t\t\t\t\t\tuniqueIdentifier: string | null;\n\t\t\t\t\t\tverified: boolean;\n\t\t\t\t\t}) => {\n\t\t\t\t\t\tif (aborted) return;\n\t\t\t\t\t\tparams.onStatus?.({ type: \"result_received\" });\n\n\t\t\t\t\t\tif (!verified || !proof || !uniqueIdentifier) {\n\t\t\t\t\t\t\treject(\n\t\t\t\t\t\t\t\tnew ZkkycError(\"ZK Passport verification failed\", {\n\t\t\t\t\t\t\t\t\tcode: \"ZK_PASSPORT_VERIFICATION_FAILED\",\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst verifierParams = zkPassport.getSolidityVerifierParameters({\n\t\t\t\t\t\t\t\tproof,\n\t\t\t\t\t\t\t\tscope: \"personhood\",\n\t\t\t\t\t\t\t\tdevMode: false,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tconst isIDCard = result.document_type?.disclose?.result !== \"passport\";\n\n\t\t\t\t\t\t\tresolve({ params: verifierParams, isIDCard });\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treject(\n\t\t\t\t\t\t\t\tnew ZkkycError(\"Failed to extract ZK Passport verifier parameters\", {\n\t\t\t\t\t\t\t\t\tcode: \"ZK_PASSPORT_VERIFICATION_FAILED\",\n\t\t\t\t\t\t\t\t\tcause: error,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t);\n\n\t\t\t\tonReject(() => {\n\t\t\t\t\tparams.onStatus?.({ type: \"rejected\" });\n\t\t\t\t\treject(\n\t\t\t\t\t\tnew ZkkycError(\"User rejected ZK Passport verification\", {\n\t\t\t\t\t\t\tcode: \"ZK_PASSPORT_REJECTED\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t});\n\n\t\t\t\tonError((error: unknown) => {\n\t\t\t\t\treject(\n\t\t\t\t\t\tnew ZkkycError(typeof error === \"string\" ? error : \"ZK Passport verification error\", {\n\t\t\t\t\t\t\tcode: \"ZK_PASSPORT_VERIFICATION_FAILED\",\n\t\t\t\t\t\t\tcause: error,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tconst session: ZkPassportSession = {\n\t\t\t\turl,\n\t\t\t\tresult: ResultAsync.fromPromise(resultPromise, (error) => {\n\t\t\t\t\tif (error instanceof ZkkycError) return error;\n\t\t\t\t\treturn new ZkkycError(\"ZK Passport flow failed\", {\n\t\t\t\t\t\tcode: \"ZK_PASSPORT_VERIFICATION_FAILED\",\n\t\t\t\t\t\tcause: error,\n\t\t\t\t\t});\n\t\t\t\t}),\n\t\t\t\tabort: () => {\n\t\t\t\t\taborted = true;\n\t\t\t\t},\n\t\t\t};\n\n\t\t\treturn session;\n\t\t})(),\n\t\t(error) => {\n\t\t\tif (error instanceof ZkkycError) return error;\n\t\t\treturn new ZkkycError(\"Failed to initialize ZK Passport\", {\n\t\t\t\tcode: \"ZK_PASSPORT_INIT_FAILED\",\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t},\n\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ResultAsync","ResultAsync","ResultAsync","ResultAsync","ResultAsync","ResultAsync","ResultAsync"]}
1
+ {"version":3,"sources":["../src/contracts/reputation-manager/writes.ts","../src/validation/errors.validation.ts","../src/validation/schemas.validation.ts","../src/country/currency.ts","../src/zkkyc/errors.ts","../src/zkkyc/validation.ts","../src/contracts/abis/index.ts","../src/contracts/abis/order-flow-facet.ts","../src/contracts/abis/order-processor-facet.ts","../src/contracts/abis/p2p-config-facet.ts","../src/contracts/abis/p2p-stake-boost-facet.ts","../src/contracts/abis/reputation-manager.ts","../src/zkkyc/client.ts","../src/zkkyc/orchestrators/bvn.ts","../src/zkkyc/orchestrators/constants.ts","../src/zkkyc/orchestrators/liveness.ts","../src/zkkyc/orchestrators/reclaim.ts","../src/zkkyc/orchestrators/types.ts","../src/zkkyc/orchestrators/simple-kyc.ts","../src/zkkyc/orchestrators/zk-passport.ts"],"sourcesContent":["import { Result } from \"neverthrow\";\nimport { type Address, encodeFunctionData } from \"viem\";\nimport { validate } from \"../../validation\";\nimport { ZkkycError } from \"../../zkkyc/errors\";\nimport type {\n\tAnonAadharProofParams,\n\tBvnSubmitParams,\n\tLivenessSubmitParams,\n\tSimpleKycSubmitParams,\n\tSocialVerifyParams,\n\tZkPassportRegisterParams,\n} from \"../../zkkyc/validation\";\nimport {\n\tZodAnonAadharProofParamsSchema,\n\tZodBvnSubmitParamsSchema,\n\tZodLivenessSubmitParamsSchema,\n\tZodSimpleKycSubmitParamsSchema,\n\tZodSocialVerifyParamsSchema,\n\tZodZkPassportRegisterParamsSchema,\n} from \"../../zkkyc/validation\";\nimport { ABIS } from \"../abis\";\n\n/** Prepares a social verification transaction. */\nexport function prepareSocialVerify(\n\treputationManagerAddress: Address,\n\tparams: SocialVerifyParams,\n): Result<{ to: Address; data: `0x${string}` }, ZkkycError> {\n\treturn validate(\n\t\tZodSocialVerifyParamsSchema,\n\t\tparams,\n\t\t(message, cause, data) =>\n\t\t\tnew ZkkycError(message, { code: \"VALIDATION_ERROR\", cause, context: { params: data } }),\n\t).andThen((validated) =>\n\t\tResult.fromThrowable(\n\t\t\t() => ({\n\t\t\t\tto: reputationManagerAddress,\n\t\t\t\tdata: encodeFunctionData({\n\t\t\t\t\tabi: ABIS.EXTERNAL.REPUTATION_MANAGER,\n\t\t\t\t\tfunctionName: \"socialVerify\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tvalidated._socialName,\n\t\t\t\t\t\tvalidated.proofs.map((proof) => ({\n\t\t\t\t\t\t\t...proof,\n\t\t\t\t\t\t\tsignedClaim: {\n\t\t\t\t\t\t\t\t...proof.signedClaim,\n\t\t\t\t\t\t\t\tclaim: {\n\t\t\t\t\t\t\t\t\t...proof.signedClaim.claim,\n\t\t\t\t\t\t\t\t\tidentifier: proof.signedClaim.claim.identifier as `0x${string}`,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tsignatures: proof.signedClaim.signatures as readonly `0x${string}`[],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t})),\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t}),\n\t\t\t(error) =>\n\t\t\t\tnew ZkkycError(\"Failed to encode socialVerify\", {\n\t\t\t\t\tcode: \"ENCODE_ERROR\",\n\t\t\t\t\tcause: error,\n\t\t\t\t}),\n\t\t)(),\n\t);\n}\n\n/** Prepares a submit anon Aadhaar proof transaction. */\nexport function prepareSubmitAnonAadharProof(\n\treputationManagerAddress: Address,\n\tparams: AnonAadharProofParams,\n): Result<{ to: Address; data: `0x${string}` }, ZkkycError> {\n\treturn validate(\n\t\tZodAnonAadharProofParamsSchema,\n\t\tparams,\n\t\t(message, cause, data) =>\n\t\t\tnew ZkkycError(message, { code: \"VALIDATION_ERROR\", cause, context: { params: data } }),\n\t).andThen((validated) =>\n\t\tResult.fromThrowable(\n\t\t\t() => ({\n\t\t\t\tto: reputationManagerAddress,\n\t\t\t\tdata: encodeFunctionData({\n\t\t\t\t\tabi: ABIS.EXTERNAL.REPUTATION_MANAGER,\n\t\t\t\t\tfunctionName: \"submitAnonAadharProof\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tvalidated.nullifierSeed,\n\t\t\t\t\t\tvalidated.nullifier,\n\t\t\t\t\t\tvalidated.timestamp,\n\t\t\t\t\t\tvalidated.signal,\n\t\t\t\t\t\tvalidated.revealArray,\n\t\t\t\t\t\tvalidated.packedGroth16Proof,\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t}),\n\t\t\t(error) =>\n\t\t\t\tnew ZkkycError(\"Failed to encode submitAnonAadharProof\", {\n\t\t\t\t\tcode: \"ENCODE_ERROR\",\n\t\t\t\t\tcause: error,\n\t\t\t\t}),\n\t\t)(),\n\t);\n}\n\n/** Prepares a simple-kyc EIP-712 attestation submission (awards KYC rp). */\nexport function prepareSubmitKycAttestation(\n\treputationManagerAddress: Address,\n\tparams: SimpleKycSubmitParams,\n): Result<{ to: Address; data: `0x${string}` }, ZkkycError> {\n\treturn validate(\n\t\tZodSimpleKycSubmitParamsSchema,\n\t\tparams,\n\t\t(message, cause, data) =>\n\t\t\tnew ZkkycError(message, { code: \"VALIDATION_ERROR\", cause, context: { params: data } }),\n\t).andThen((validated) =>\n\t\tResult.fromThrowable(\n\t\t\t() => ({\n\t\t\t\tto: reputationManagerAddress,\n\t\t\t\tdata: encodeFunctionData({\n\t\t\t\t\tabi: ABIS.EXTERNAL.REPUTATION_MANAGER,\n\t\t\t\t\tfunctionName: \"submitKycAttestation\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tvalidated.nullifier as `0x${string}`,\n\t\t\t\t\t\tvalidated.limit,\n\t\t\t\t\t\tvalidated.expiry,\n\t\t\t\t\t\tvalidated.signature as `0x${string}`,\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t}),\n\t\t\t(error) =>\n\t\t\t\tnew ZkkycError(\"Failed to encode submitKycAttestation\", {\n\t\t\t\t\tcode: \"ENCODE_ERROR\",\n\t\t\t\t\tcause: error,\n\t\t\t\t}),\n\t\t)(),\n\t);\n}\n\n/** Prepares a BVN EIP-712 attestation submission (awards BVN rp). */\nexport function prepareSubmitBvnAttestation(\n\treputationManagerAddress: Address,\n\tparams: BvnSubmitParams,\n): Result<{ to: Address; data: `0x${string}` }, ZkkycError> {\n\treturn validate(\n\t\tZodBvnSubmitParamsSchema,\n\t\tparams,\n\t\t(message, cause, data) =>\n\t\t\tnew ZkkycError(message, { code: \"VALIDATION_ERROR\", cause, context: { params: data } }),\n\t).andThen((validated) =>\n\t\tResult.fromThrowable(\n\t\t\t() => ({\n\t\t\t\tto: reputationManagerAddress,\n\t\t\t\tdata: encodeFunctionData({\n\t\t\t\t\tabi: ABIS.EXTERNAL.REPUTATION_MANAGER,\n\t\t\t\t\tfunctionName: \"submitBvnAttestation\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tvalidated.nullifier as `0x${string}`,\n\t\t\t\t\t\tvalidated.limit,\n\t\t\t\t\t\tvalidated.expiry,\n\t\t\t\t\t\tvalidated.signature as `0x${string}`,\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t}),\n\t\t\t(error) =>\n\t\t\t\tnew ZkkycError(\"Failed to encode submitBvnAttestation\", {\n\t\t\t\t\tcode: \"ENCODE_ERROR\",\n\t\t\t\t\tcause: error,\n\t\t\t\t}),\n\t\t)(),\n\t);\n}\n\n/** Prepares a liveness EIP-712 attestation submission (awards liveness rp).\n *\n * Same struct shape as the KYC one but a different on-chain function: the\n * liveness verifier is a separate service with its own EIP-712 domain and its\n * own nullifier set, so the two attestations are not interchangeable.\n */\nexport function prepareSubmitLivenessAttestation(\n\treputationManagerAddress: Address,\n\tparams: LivenessSubmitParams,\n): Result<{ to: Address; data: `0x${string}` }, ZkkycError> {\n\treturn validate(\n\t\tZodLivenessSubmitParamsSchema,\n\t\tparams,\n\t\t(message, cause, data) =>\n\t\t\tnew ZkkycError(message, { code: \"VALIDATION_ERROR\", cause, context: { params: data } }),\n\t).andThen((validated) =>\n\t\tResult.fromThrowable(\n\t\t\t() => ({\n\t\t\t\tto: reputationManagerAddress,\n\t\t\t\tdata: encodeFunctionData({\n\t\t\t\t\tabi: ABIS.EXTERNAL.REPUTATION_MANAGER,\n\t\t\t\t\tfunctionName: \"submitLivenessAttestation\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\tvalidated.nullifier as `0x${string}`,\n\t\t\t\t\t\tvalidated.limit,\n\t\t\t\t\t\tvalidated.expiry,\n\t\t\t\t\t\tvalidated.signature as `0x${string}`,\n\t\t\t\t\t],\n\t\t\t\t}),\n\t\t\t}),\n\t\t\t(error) =>\n\t\t\t\tnew ZkkycError(\"Failed to encode submitLivenessAttestation\", {\n\t\t\t\t\tcode: \"ENCODE_ERROR\",\n\t\t\t\t\tcause: error,\n\t\t\t\t}),\n\t\t)(),\n\t);\n}\n\n/** Prepares a zkPassport registration transaction. */\nexport function prepareZkPassportRegister(\n\treputationManagerAddress: Address,\n\tparams: ZkPassportRegisterParams,\n): Result<{ to: Address; data: `0x${string}` }, ZkkycError> {\n\treturn validate(\n\t\tZodZkPassportRegisterParamsSchema,\n\t\tparams,\n\t\t(message, cause, data) =>\n\t\t\tnew ZkkycError(message, { code: \"VALIDATION_ERROR\", cause, context: { params: data } }),\n\t).andThen((validated) =>\n\t\tResult.fromThrowable(\n\t\t\t() => {\n\t\t\t\tconst { proofVerificationData, serviceConfig, committedInputs, version } = validated.params;\n\n\t\t\t\tconst proofVerificationParams = {\n\t\t\t\t\tversion: version as `0x${string}`,\n\t\t\t\t\tproofVerificationData: {\n\t\t\t\t\t\tvkeyHash: proofVerificationData.vkeyHash as `0x${string}`,\n\t\t\t\t\t\tproof: proofVerificationData.proof as `0x${string}`,\n\t\t\t\t\t\tpublicInputs: proofVerificationData.publicInputs as `0x${string}`[],\n\t\t\t\t\t},\n\t\t\t\t\tcommittedInputs: committedInputs as `0x${string}`,\n\t\t\t\t\tserviceConfig: {\n\t\t\t\t\t\tvalidityPeriodInSeconds: BigInt(serviceConfig.validityPeriodInSeconds),\n\t\t\t\t\t\tdomain: serviceConfig.domain,\n\t\t\t\t\t\tscope: serviceConfig.scope,\n\t\t\t\t\t\tdevMode: serviceConfig.devMode,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\treturn {\n\t\t\t\t\tto: reputationManagerAddress,\n\t\t\t\t\tdata: encodeFunctionData({\n\t\t\t\t\t\tabi: ABIS.EXTERNAL.REPUTATION_MANAGER,\n\t\t\t\t\t\tfunctionName: \"zkPassportRegister\",\n\t\t\t\t\t\targs: [proofVerificationParams, validated.isIDCard],\n\t\t\t\t\t}),\n\t\t\t\t};\n\t\t\t},\n\t\t\t(error) =>\n\t\t\t\tnew ZkkycError(\"Failed to encode zkPassportRegister\", {\n\t\t\t\t\tcode: \"ENCODE_ERROR\",\n\t\t\t\t\tcause: error,\n\t\t\t\t}),\n\t\t)(),\n\t);\n}\n","export class SdkError<TCode extends string = string> extends Error {\n\treadonly code: TCode;\n\treadonly cause?: unknown;\n\treadonly context?: Record<string, unknown>;\n\n\tconstructor(\n\t\tmessage: string,\n\t\toptions: {\n\t\t\tcode: TCode;\n\t\t\tcause?: unknown;\n\t\t\tcontext?: Record<string, unknown>;\n\t\t},\n\t) {\n\t\tsuper(message);\n\t\tthis.name = \"SdkError\";\n\t\tthis.code = options.code;\n\t\tthis.cause = options.cause;\n\t\tthis.context = options.context;\n\t}\n}\n","import { err, ok, type Result } from \"neverthrow\";\nimport { isAddress } from \"viem\";\nimport { z } from \"zod\";\nimport { CURRENCY_CODES } from \"../country/currency\";\n\nexport const ZodAddressSchema = z\n\t.string()\n\t.refine((s) => isAddress(s), { message: \"Invalid Ethereum address\" });\n\nexport const ZodCurrencySchema = z.enum(CURRENCY_CODES);\n\nexport function validate<S extends z.ZodType, E>(\n\tschema: S,\n\tdata: unknown,\n\ttoError: (message: string, cause: unknown, data: unknown) => E,\n): Result<z.infer<S>, E> {\n\tconst result = schema.safeParse(data);\n\tif (result.success) {\n\t\treturn ok(result.data as z.infer<S>);\n\t}\n\treturn err(toError(z.prettifyError(result.error), result.error, data));\n}\n","/**\n * All supported currency symbols. Single source of truth for the SDK.\n *\n * Lives alongside the country metadata so that adding a currency is a\n * single-folder operation: drop a new file in `currencies/<code>.ts`, add it\n * to this map, and both `COUNTRY_OPTIONS` and `ZodCurrencySchema` pick it up.\n */\nexport const CURRENCY = {\n\tIDR: \"IDR\",\n\tINR: \"INR\",\n\tBRL: \"BRL\",\n\tARS: \"ARS\",\n\tMEX: \"MEX\",\n\tVEN: \"VEN\",\n\tBOB: \"BOB\",\n\tEUR: \"EUR\",\n\tNGN: \"NGN\",\n\tUSD: \"USD\",\n\tCOP: \"COP\",\n\tCUP: \"CUP\",\n\tECU: \"ECU\",\n\tPEN: \"PEN\",\n\tPHP: \"PHP\",\n} as const;\n\n/** Union of supported currency codes. */\nexport type CurrencyCode = (typeof CURRENCY)[keyof typeof CURRENCY];\n\n/**\n * Tuple form of the currency codes — used by `z.enum(...)` in the shared\n * validation layer. Narrow tuple type required by Zod.\n */\nexport const CURRENCY_CODES = Object.values(CURRENCY) as [CurrencyCode, ...CurrencyCode[]];\n","import { SdkError } from \"../validation\";\n\nexport type ZkkycErrorCode =\n\t| \"VALIDATION_ERROR\"\n\t| \"CONTRACT_READ_ERROR\"\n\t| \"ENCODE_ERROR\"\n\t| \"RECLAIM_INIT_FAILED\"\n\t| \"RECLAIM_SESSION_ENDPOINT_FAILED\"\n\t| \"RECLAIM_SESSION_NOT_FOUND\"\n\t| \"RECLAIM_PROOF_GENERATION_FAILED\"\n\t| \"RECLAIM_PROOF_INVALID\"\n\t| \"RECLAIM_POLLING_ABORTED\"\n\t| \"ZK_PASSPORT_INIT_FAILED\"\n\t| \"ZK_PASSPORT_REJECTED\"\n\t| \"ZK_PASSPORT_VERIFICATION_FAILED\"\n\t| \"ZK_PASSPORT_ABORTED\"\n\t| \"SIMPLE_KYC_SESSION_FAILED\"\n\t| \"SIMPLE_KYC_REDEEM_FAILED\"\n\t| \"LIVENESS_SESSION_FAILED\"\n\t| \"LIVENESS_REDEEM_FAILED\"\n\t| \"BVN_ONBOARD_FAILED\"\n\t| \"BVN_SUBMIT_FAILED\"\n\t| \"BVN_OTP_SEND_FAILED\"\n\t| \"BVN_OTP_CONFIRM_FAILED\"\n\t| \"BVN_ATTESTATION_FAILED\"\n\t| \"BVN_SESSION_EXPIRED\"\n\t| \"PEER_DEPENDENCY_MISSING\";\n\nexport class ZkkycError extends SdkError<ZkkycErrorCode> {\n\tconstructor(\n\t\tmessage: string,\n\t\toptions: {\n\t\t\tcode: ZkkycErrorCode;\n\t\t\tcause?: unknown;\n\t\t\tcontext?: Record<string, unknown>;\n\t\t},\n\t) {\n\t\tsuper(message, options);\n\t\tthis.name = \"ZkkycError\";\n\t}\n}\n","import { z } from \"zod\";\nimport { ZodAddressSchema } from \"../validation\";\n\n// ── Write param schemas ──────────────────────────────────────────────────────\n\nexport const ZodAnonAadharProofParamsSchema = z.object({\n\tnullifierSeed: z.bigint(),\n\tnullifier: z.bigint(),\n\ttimestamp: z.bigint(),\n\tsignal: z.bigint(),\n\trevealArray: z.tuple([z.bigint(), z.bigint(), z.bigint(), z.bigint()]),\n\tpackedGroth16Proof: z.tuple([\n\t\tz.bigint(),\n\t\tz.bigint(),\n\t\tz.bigint(),\n\t\tz.bigint(),\n\t\tz.bigint(),\n\t\tz.bigint(),\n\t\tz.bigint(),\n\t\tz.bigint(),\n\t]),\n});\n\nexport type AnonAadharProofParams = z.infer<typeof ZodAnonAadharProofParamsSchema>;\n\nexport const ZodSocialVerifyParamsSchema = z.object({\n\t_socialName: z.string(),\n\tproofs: z.array(\n\t\tz.object({\n\t\t\tclaimInfo: z.object({\n\t\t\t\tprovider: z.string(),\n\t\t\t\tparameters: z.string(),\n\t\t\t\tcontext: z.string(),\n\t\t\t}),\n\t\t\tsignedClaim: z.object({\n\t\t\t\tclaim: z.object({\n\t\t\t\t\tidentifier: z.string(),\n\t\t\t\t\towner: ZodAddressSchema,\n\t\t\t\t\ttimestampS: z.number(),\n\t\t\t\t\tepoch: z.number(),\n\t\t\t\t}),\n\t\t\t\tsignatures: z.array(z.string()),\n\t\t\t}),\n\t\t}),\n\t),\n});\n\nexport type SocialVerifyParams = z.infer<typeof ZodSocialVerifyParamsSchema>;\n\n// Schema matching SolidityVerifierParameters from @zkpassport/sdk (structural definition)\nexport const ZodSolidityVerifierParametersSchema = z.object({\n\tversion: z.string().refine((val) => val.startsWith(\"0x\"), {\n\t\tmessage: \"Version must be a hex string\",\n\t}),\n\tproofVerificationData: z.object({\n\t\tvkeyHash: z.string().refine((val) => /^0x[a-fA-F0-9]{64}$/.test(val), {\n\t\t\tmessage: \"Invalid bytes32 hex string\",\n\t\t}),\n\t\tproof: z.string().refine((val) => val.startsWith(\"0x\"), {\n\t\t\tmessage: \"Proof must be a hex string\",\n\t\t}),\n\t\tpublicInputs: z.array(\n\t\t\tz.string().refine((val) => /^0x[a-fA-F0-9]{64}$/.test(val), {\n\t\t\t\tmessage: \"Each public input must be a valid bytes32 hex string\",\n\t\t\t}),\n\t\t),\n\t}),\n\tcommittedInputs: z.string().refine((val) => val.startsWith(\"0x\"), {\n\t\tmessage: \"Committed inputs must be a hex string\",\n\t}),\n\tserviceConfig: z.object({\n\t\tvalidityPeriodInSeconds: z.number().int().nonnegative(),\n\t\tdomain: z.string(),\n\t\tscope: z.string(),\n\t\tdevMode: z.boolean(),\n\t}),\n});\n\nexport type SolidityVerifierParameters = z.infer<typeof ZodSolidityVerifierParametersSchema>;\n\nexport const ZodZkPassportRegisterParamsSchema = z.object({\n\tparams: ZodSolidityVerifierParametersSchema,\n\tisIDCard: z.boolean(),\n});\n\nexport type ZkPassportRegisterParams = z.infer<typeof ZodZkPassportRegisterParamsSchema>;\n\n// ── simple-kyc EIP-712 attestation ───────────────────────────────────────────\n\nexport const ZodSimpleKycSubmitParamsSchema = z.object({\n\t/** Per-(tenant, identity) Sybil nullifier (bytes32 hex). */\n\tnullifier: z.string().refine((v) => /^0x[a-fA-F0-9]{64}$/.test(v), {\n\t\tmessage: \"nullifier must be a bytes32 hex string\",\n\t}),\n\t/** Remaining limit in micro-USDC (part of the signed struct). */\n\tlimit: z.bigint(),\n\t/** Attestation expiry (unix seconds). */\n\texpiry: z.bigint(),\n\t/** 65-byte secp256k1 signature (hex). */\n\tsignature: z.string().refine((v) => /^0x[a-fA-F0-9]+$/.test(v), {\n\t\tmessage: \"signature must be a hex string\",\n\t}),\n});\n\nexport type SimpleKycSubmitParams = z.infer<typeof ZodSimpleKycSubmitParamsSchema>;\n\n// ── BVN EIP-712 attestation ──────────────────────────────────────────────────\n\nexport const ZodBvnSubmitParamsSchema = z.object({\n\t/** Per-(tenant, identity) Sybil nullifier (bytes32 hex). */\n\tnullifier: z.string().refine((v) => /^0x[a-fA-F0-9]{64}$/.test(v), {\n\t\tmessage: \"nullifier must be a bytes32 hex string\",\n\t}),\n\t/** Remaining limit in micro-USDC (part of the signed struct). */\n\tlimit: z.bigint(),\n\t/** Attestation expiry (unix seconds). */\n\texpiry: z.bigint(),\n\t/** 65-byte secp256k1 signature (hex). */\n\tsignature: z.string().refine((v) => /^0x[a-fA-F0-9]+$/.test(v), {\n\t\tmessage: \"signature must be a hex string\",\n\t}),\n});\n\nexport type BvnSubmitParams = z.infer<typeof ZodBvnSubmitParamsSchema>;\n\n// ── Liveness EIP-712 attestation ─────────────────────────────────────────────\n\nexport const ZodLivenessSubmitParamsSchema = z.object({\n\t/** Per-(tenant, identity) Sybil nullifier (bytes32 hex). */\n\tnullifier: z.string().refine((v) => /^0x[a-fA-F0-9]{64}$/.test(v), {\n\t\tmessage: \"nullifier must be a bytes32 hex string\",\n\t}),\n\t/** Remaining limit in micro-USDC (part of the signed struct). */\n\tlimit: z.bigint(),\n\t/** Attestation expiry (unix seconds). */\n\texpiry: z.bigint(),\n\t/** 65-byte secp256k1 signature (hex). */\n\tsignature: z.string().refine((v) => /^0x[a-fA-F0-9]+$/.test(v), {\n\t\tmessage: \"signature must be a hex string\",\n\t}),\n});\n\nexport type LivenessSubmitParams = z.infer<typeof ZodLivenessSubmitParamsSchema>;\n","import { erc20Abi } from \"viem\";\nimport { orderFlowFacetAbi } from \"./order-flow-facet\";\nimport { orderProcessorFacetAbi } from \"./order-processor-facet\";\nimport { p2pConfigFacetAbi } from \"./p2p-config-facet\";\nimport { p2pStakeBoostFacetAbi } from \"./p2p-stake-boost-facet\";\nimport { reputationManagerAbi } from \"./reputation-manager\";\n\nconst DIAMOND_ABI = [\n\t...orderFlowFacetAbi,\n\t...orderProcessorFacetAbi,\n\t...p2pConfigFacetAbi,\n\t...p2pStakeBoostFacetAbi,\n] as const;\n\nexport const ABIS = {\n\tDIAMOND: DIAMOND_ABI,\n\tFACETS: {\n\t\tORDER_FLOW: orderFlowFacetAbi,\n\t\tORDER_PROCESSOR: orderProcessorFacetAbi,\n\t\tCONFIG: p2pConfigFacetAbi,\n\t\tSTAKE: p2pStakeBoostFacetAbi,\n\t},\n\tEXTERNAL: {\n\t\tUSDC: erc20Abi,\n\t\tREPUTATION_MANAGER: reputationManagerAbi,\n\t},\n} as const;\n","export const orderFlowFacetAbi = [\n\t{\n\t\tinputs: [\n\t\t\t{ internalType: \"uint256\", name: \"circleId\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"assignUpto\", type: \"uint256\" },\n\t\t\t{ internalType: \"bytes32\", name: \"currency\", type: \"bytes32\" },\n\t\t\t{ internalType: \"address\", name: \"user\", type: \"address\" },\n\t\t\t{ internalType: \"uint256\", name: \"usdtAmount\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t{ internalType: \"int256\", name: \"orderType\", type: \"int256\" },\n\t\t\t{ internalType: \"uint256\", name: \"preferredPCConfigId\", type: \"uint256\" },\n\t\t],\n\t\tname: \"getAssignableMerchantsFromCircle\",\n\t\toutputs: [{ internalType: \"address[]\", name: \"\", type: \"address[]\" }],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{ internalType: \"address\", name: \"_user\", type: \"address\" },\n\t\t\t{ internalType: \"bytes32\", name: \"_nativeCurrency\", type: \"bytes32\" },\n\t\t],\n\t\tname: \"userTxLimit\",\n\t\toutputs: [\n\t\t\t{ internalType: \"uint256\", name: \"\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"\", type: \"uint256\" },\n\t\t],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{ internalType: \"string\", name: \"_pubKey\", type: \"string\" },\n\t\t\t{ internalType: \"uint256\", name: \"_amount\", type: \"uint256\" },\n\t\t\t{ internalType: \"address\", name: \"_recipientAddr\", type: \"address\" },\n\t\t\t{ internalType: \"uint8\", name: \"_orderType\", type: \"uint8\" },\n\t\t\t{ internalType: \"string\", name: \"_userUpi\", type: \"string\" },\n\t\t\t{ internalType: \"string\", name: \"_userPubKey\", type: \"string\" },\n\t\t\t{ internalType: \"bytes32\", name: \"_currency\", type: \"bytes32\" },\n\t\t\t{ internalType: \"uint256\", name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"_circleId\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"_fiatAmountLimit\", type: \"uint256\" },\n\t\t],\n\t\tname: \"placeOrder\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [{ internalType: \"uint256\", name: \"_orderId\", type: \"uint256\" }],\n\t\tname: \"cancelOrder\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{ internalType: \"uint256\", name: \"_orderId\", type: \"uint256\" },\n\t\t\t{ internalType: \"string\", name: \"_userEncUpi\", type: \"string\" },\n\t\t\t{ internalType: \"uint256\", name: \"_updatedAmount\", type: \"uint256\" },\n\t\t],\n\t\tname: \"setSellOrderUpi\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\ttype: \"event\",\n\t\tname: \"OrderPlaced\",\n\t\tanonymous: false,\n\t\tinputs: [\n\t\t\t{ indexed: true, name: \"orderId\", type: \"uint256\" },\n\t\t\t{ indexed: true, name: \"user\", type: \"address\" },\n\t\t\t{ indexed: true, name: \"merchant\", type: \"address\" },\n\t\t\t{ indexed: false, name: \"amount\", type: \"uint256\" },\n\t\t\t{ indexed: false, name: \"orderType\", type: \"uint8\" },\n\t\t\t{ indexed: false, name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t{\n\t\t\t\tindexed: false,\n\t\t\t\tname: \"_order\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"amount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userCompletedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"acceptedMerchant\", type: \"address\" },\n\t\t\t\t\t{ name: \"user\", type: \"address\" },\n\t\t\t\t\t{ name: \"recipientAddr\", type: \"address\" },\n\t\t\t\t\t{ name: \"pubkey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"userCompleted\", type: \"bool\" },\n\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t{ name: \"orderType\", type: \"uint8\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"disputeInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{ name: \"raisedBy\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t\t\t\t\t\t{ name: \"accountNumber\", type: \"uint256\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{ name: \"id\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userPubKey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encMerchantUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"acceptedAccountNo\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"assignedAccountNos\", type: \"uint256[]\" },\n\t\t\t\t\t{ name: \"currency\", type: \"bytes32\" },\n\t\t\t\t\t{ name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"circleId\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: \"event\",\n\t\tname: \"OrderAccepted\",\n\t\tanonymous: false,\n\t\tinputs: [\n\t\t\t{ indexed: true, name: \"orderId\", type: \"uint256\" },\n\t\t\t{ indexed: true, name: \"merchant\", type: \"address\" },\n\t\t\t{ indexed: false, name: \"pubKey\", type: \"string\" },\n\t\t\t{\n\t\t\t\tindexed: false,\n\t\t\t\tname: \"_order\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"amount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userCompletedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"acceptedMerchant\", type: \"address\" },\n\t\t\t\t\t{ name: \"user\", type: \"address\" },\n\t\t\t\t\t{ name: \"recipientAddr\", type: \"address\" },\n\t\t\t\t\t{ name: \"pubkey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"userCompleted\", type: \"bool\" },\n\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t{ name: \"orderType\", type: \"uint8\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"disputeInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{ name: \"raisedBy\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t\t\t\t\t\t{ name: \"accountNumber\", type: \"uint256\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{ name: \"id\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userPubKey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encMerchantUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"acceptedAccountNo\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"assignedAccountNos\", type: \"uint256[]\" },\n\t\t\t\t\t{ name: \"currency\", type: \"bytes32\" },\n\t\t\t\t\t{ name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"circleId\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: \"event\",\n\t\tname: \"BuyOrderPaid\",\n\t\tanonymous: false,\n\t\tinputs: [\n\t\t\t{ indexed: true, name: \"orderId\", type: \"uint256\" },\n\t\t\t{ indexed: true, name: \"user\", type: \"address\" },\n\t\t\t{\n\t\t\t\tindexed: false,\n\t\t\t\tname: \"_order\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"amount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userCompletedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"acceptedMerchant\", type: \"address\" },\n\t\t\t\t\t{ name: \"user\", type: \"address\" },\n\t\t\t\t\t{ name: \"recipientAddr\", type: \"address\" },\n\t\t\t\t\t{ name: \"pubkey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"userCompleted\", type: \"bool\" },\n\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t{ name: \"orderType\", type: \"uint8\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"disputeInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{ name: \"raisedBy\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t\t\t\t\t\t{ name: \"accountNumber\", type: \"uint256\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{ name: \"id\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userPubKey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encMerchantUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"acceptedAccountNo\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"assignedAccountNos\", type: \"uint256[]\" },\n\t\t\t\t\t{ name: \"currency\", type: \"bytes32\" },\n\t\t\t\t\t{ name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"circleId\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: \"event\",\n\t\tname: \"OrderCompleted\",\n\t\tanonymous: false,\n\t\tinputs: [\n\t\t\t{ indexed: true, name: \"orderId\", type: \"uint256\" },\n\t\t\t{ indexed: true, name: \"user\", type: \"address\" },\n\t\t\t{ indexed: false, name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t{\n\t\t\t\tindexed: false,\n\t\t\t\tname: \"_order\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"amount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userCompletedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"acceptedMerchant\", type: \"address\" },\n\t\t\t\t\t{ name: \"user\", type: \"address\" },\n\t\t\t\t\t{ name: \"recipientAddr\", type: \"address\" },\n\t\t\t\t\t{ name: \"pubkey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"userCompleted\", type: \"bool\" },\n\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t{ name: \"orderType\", type: \"uint8\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"disputeInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{ name: \"raisedBy\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t\t\t\t\t\t{ name: \"accountNumber\", type: \"uint256\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{ name: \"id\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userPubKey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encMerchantUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"acceptedAccountNo\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"assignedAccountNos\", type: \"uint256[]\" },\n\t\t\t\t\t{ name: \"currency\", type: \"bytes32\" },\n\t\t\t\t\t{ name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"circleId\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: \"event\",\n\t\tname: \"CancelledOrders\",\n\t\tanonymous: false,\n\t\tinputs: [\n\t\t\t{ indexed: true, name: \"orderId\", type: \"uint256\" },\n\t\t\t{\n\t\t\t\tindexed: false,\n\t\t\t\tname: \"_order\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"amount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userCompletedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"acceptedMerchant\", type: \"address\" },\n\t\t\t\t\t{ name: \"user\", type: \"address\" },\n\t\t\t\t\t{ name: \"recipientAddr\", type: \"address\" },\n\t\t\t\t\t{ name: \"pubkey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"userCompleted\", type: \"bool\" },\n\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t{ name: \"orderType\", type: \"uint8\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"disputeInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{ name: \"raisedBy\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t\t\t\t\t\t{ name: \"accountNumber\", type: \"uint256\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{ name: \"id\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userPubKey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encMerchantUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"acceptedAccountNo\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"assignedAccountNos\", type: \"uint256[]\" },\n\t\t\t\t\t{ name: \"currency\", type: \"bytes32\" },\n\t\t\t\t\t{ name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"circleId\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n] as const;\n","/**\n * Minimal ABI fragments for reads on OrderProcessor storage via the Diamond.\n * `getOrdersById`, `getAdditionalOrderDetails`, and the per-currency small-order\n * fee config getters (`getSmallOrderThreshold`, `getSmallOrderFixedFee`).\n */\nexport const orderProcessorFacetAbi = [\n\t{\n\t\ttype: \"function\",\n\t\tname: \"getOrdersById\",\n\t\tstateMutability: \"view\",\n\t\tinputs: [{ name: \"orderId\", type: \"uint256\" }],\n\t\toutputs: [\n\t\t\t{\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"amount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userCompletedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"acceptedMerchant\", type: \"address\" },\n\t\t\t\t\t{ name: \"user\", type: \"address\" },\n\t\t\t\t\t{ name: \"recipientAddr\", type: \"address\" },\n\t\t\t\t\t{ name: \"pubkey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"userCompleted\", type: \"bool\" },\n\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t{ name: \"orderType\", type: \"uint8\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"disputeInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{ name: \"raisedBy\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t\t\t\t\t\t{ name: \"accountNumber\", type: \"uint256\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{ name: \"id\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userPubKey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encMerchantUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"acceptedAccountNo\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"assignedAccountNos\", type: \"uint256[]\" },\n\t\t\t\t\t{ name: \"currency\", type: \"bytes32\" },\n\t\t\t\t\t{ name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"circleId\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: \"function\",\n\t\tname: \"getAdditionalOrderDetails\",\n\t\tstateMutability: \"view\",\n\t\tinputs: [{ name: \"orderId\", type: \"uint256\" }],\n\t\toutputs: [\n\t\t\t{\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"fixedFeePaid\", type: \"uint64\" },\n\t\t\t\t\t{ name: \"tipsPaid\", type: \"uint64\" },\n\t\t\t\t\t{ name: \"acceptedTimestamp\", type: \"uint128\" },\n\t\t\t\t\t{ name: \"paidTimestamp\", type: \"uint128\" },\n\t\t\t\t\t{ name: \"reserved2\", type: \"uint128\" },\n\t\t\t\t\t{ name: \"actualUsdtAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"actualFiatAmount\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: \"function\",\n\t\tname: \"getSmallOrderThreshold\",\n\t\tstateMutability: \"view\",\n\t\tinputs: [{ name: \"currency\", type: \"bytes32\" }],\n\t\toutputs: [{ name: \"\", type: \"uint256\" }],\n\t},\n\t{\n\t\ttype: \"function\",\n\t\tname: \"getSmallOrderFixedFee\",\n\t\tstateMutability: \"view\",\n\t\tinputs: [{ name: \"currency\", type: \"bytes32\" }],\n\t\toutputs: [{ name: \"\", type: \"uint256\" }],\n\t},\n\t{\n\t\ttype: \"function\",\n\t\tname: \"raiseDispute\",\n\t\tstateMutability: \"nonpayable\",\n\t\tinputs: [\n\t\t\t{ name: \"_orderId\", type: \"uint256\" },\n\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t],\n\t\toutputs: [],\n\t},\n\t{\n\t\ttype: \"function\",\n\t\tname: \"paidBuyOrder\",\n\t\tstateMutability: \"nonpayable\",\n\t\tinputs: [{ name: \"_orderId\", type: \"uint256\" }],\n\t\toutputs: [],\n\t},\n] as const;\n","export const p2pConfigFacetAbi = [\n\t{\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tinternalType: \"bytes32\",\n\t\t\t\tname: \"_currency\",\n\t\t\t\ttype: \"bytes32\",\n\t\t\t},\n\t\t],\n\t\tname: \"getPriceConfig\",\n\t\toutputs: [\n\t\t\t{\n\t\t\t\tcomponents: [\n\t\t\t\t\t{\n\t\t\t\t\t\tinternalType: \"uint256\",\n\t\t\t\t\t\tname: \"buyPrice\",\n\t\t\t\t\t\ttype: \"uint256\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tinternalType: \"uint256\",\n\t\t\t\t\t\tname: \"sellPrice\",\n\t\t\t\t\t\ttype: \"uint256\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tinternalType: \"int256\",\n\t\t\t\t\t\tname: \"buyPriceOffset\",\n\t\t\t\t\t\ttype: \"int256\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tinternalType: \"uint256\",\n\t\t\t\t\t\tname: \"baseSpread\",\n\t\t\t\t\t\ttype: \"uint256\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tinternalType: \"struct P2pConfigStorage.PriceConfig\",\n\t\t\t\tname: \"\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t},\n\t\t],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tinternalType: \"bytes32\",\n\t\t\t\tname: \"_nativeCurrency\",\n\t\t\t\ttype: \"bytes32\",\n\t\t\t},\n\t\t],\n\t\tname: \"getRpPerUsdtLimitRational\",\n\t\toutputs: [\n\t\t\t{\n\t\t\t\tinternalType: \"uint256\",\n\t\t\t\tname: \"numerator\",\n\t\t\t\ttype: \"uint256\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"uint256\",\n\t\t\t\tname: \"denominator\",\n\t\t\t\ttype: \"uint256\",\n\t\t\t},\n\t\t],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n] as const;\n","export const p2pStakeBoostFacetAbi = [\n {\n inputs: [{ internalType: \"uint256\", name: \"tokens\", type: \"uint256\" }],\n name: \"p2pBoostStake\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"uint256\", name: \"tokens\", type: \"uint256\" }],\n name: \"p2pBoostTopUp\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"p2pBoostRequestUnstake\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"p2pBoostClaimUnstake\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"p2pBoostCancelUnstake\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"address\", name: \"user\", type: \"address\" }],\n name: \"getUserStake\",\n outputs: [\n {\n components: [\n { internalType: \"uint128\", name: \"stakedAmount\", type: \"uint128\" },\n { internalType: \"uint64\", name: \"cooldownEnd\", type: \"uint64\" },\n { internalType: \"uint8\", name: \"status\", type: \"uint8\" },\n ],\n internalType: \"struct P2PStakeBoostStorage.UserStake\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"bytes32\", name: \"currency\", type: \"bytes32\" }],\n name: \"getStakeBoostConfig\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint256\",\n name: \"tokensPerUsdNumerator\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"tokensPerUsdDenominator\",\n type: \"uint256\",\n },\n { internalType: \"uint256\", name: \"maxBoostUsd\", type: \"uint256\" },\n ],\n internalType: \"struct P2PStakeBoostStorage.BoostConfig\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"getStakeBoostGlobals\",\n outputs: [\n { internalType: \"address\", name: \"p2pToken\", type: \"address\" },\n { internalType: \"address\", name: \"fraudReserve\", type: \"address\" },\n { internalType: \"uint256\", name: \"maxStakeTokens\", type: \"uint256\" },\n { internalType: \"uint256\", name: \"normalCooldown\", type: \"uint256\" },\n { internalType: \"uint256\", name: \"blacklistCooldown\", type: \"uint256\" },\n { internalType: \"uint8\", name: \"tokenDecimals\", type: \"uint8\" },\n { internalType: \"uint256\", name: \"totalStaked\", type: \"uint256\" },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n] as const;\n","export const reputationManagerAbi = [\n\t{\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tinternalType: \"string\",\n\t\t\t\tname: \"_socialName\",\n\t\t\t\ttype: \"string\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tcomponents: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"string\",\n\t\t\t\t\t\t\t\tname: \"provider\",\n\t\t\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"string\",\n\t\t\t\t\t\t\t\tname: \"parameters\",\n\t\t\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"string\",\n\t\t\t\t\t\t\t\tname: \"context\",\n\t\t\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tinternalType: \"struct IReclaimSDK.ClaimInfo\",\n\t\t\t\t\t\tname: \"claimInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tinternalType: \"bytes32\",\n\t\t\t\t\t\t\t\t\t\tname: \"identifier\",\n\t\t\t\t\t\t\t\t\t\ttype: \"bytes32\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tinternalType: \"address\",\n\t\t\t\t\t\t\t\t\t\tname: \"owner\",\n\t\t\t\t\t\t\t\t\t\ttype: \"address\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tinternalType: \"uint32\",\n\t\t\t\t\t\t\t\t\t\tname: \"timestampS\",\n\t\t\t\t\t\t\t\t\t\ttype: \"uint32\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tinternalType: \"uint32\",\n\t\t\t\t\t\t\t\t\t\tname: \"epoch\",\n\t\t\t\t\t\t\t\t\t\ttype: \"uint32\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tinternalType: \"struct IReclaimSDK.CompleteClaimData\",\n\t\t\t\t\t\t\t\tname: \"claim\",\n\t\t\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"bytes[]\",\n\t\t\t\t\t\t\t\tname: \"signatures\",\n\t\t\t\t\t\t\t\ttype: \"bytes[]\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tinternalType: \"struct IReclaimSDK.SignedClaim\",\n\t\t\t\t\t\tname: \"signedClaim\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tinternalType: \"struct IReclaimSDK.Proof[]\",\n\t\t\t\tname: \"proofs\",\n\t\t\t\ttype: \"tuple[]\",\n\t\t\t},\n\t\t],\n\t\tname: \"socialVerify\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tinternalType: \"uint256\",\n\t\t\t\tname: \"nullifierSeed\",\n\t\t\t\ttype: \"uint256\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"uint256\",\n\t\t\t\tname: \"nullifier\",\n\t\t\t\ttype: \"uint256\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"uint256\",\n\t\t\t\tname: \"timestamp\",\n\t\t\t\ttype: \"uint256\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"uint256\",\n\t\t\t\tname: \"signal\",\n\t\t\t\ttype: \"uint256\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"uint256[4]\",\n\t\t\t\tname: \"revealArray\",\n\t\t\t\ttype: \"uint256[4]\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"uint256[8]\",\n\t\t\t\tname: \"groth16Proof\",\n\t\t\t\ttype: \"uint256[8]\",\n\t\t\t},\n\t\t],\n\t\tname: \"submitAnonAadharProof\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tcomponents: [\n\t\t\t\t\t{\n\t\t\t\t\t\tinternalType: \"bytes32\",\n\t\t\t\t\t\tname: \"version\",\n\t\t\t\t\t\ttype: \"bytes32\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"bytes32\",\n\t\t\t\t\t\t\t\tname: \"vkeyHash\",\n\t\t\t\t\t\t\t\ttype: \"bytes32\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"bytes\",\n\t\t\t\t\t\t\t\tname: \"proof\",\n\t\t\t\t\t\t\t\ttype: \"bytes\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"bytes32[]\",\n\t\t\t\t\t\t\t\tname: \"publicInputs\",\n\t\t\t\t\t\t\t\ttype: \"bytes32[]\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tinternalType: \"struct ProofVerificationData\",\n\t\t\t\t\t\tname: \"proofVerificationData\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tinternalType: \"bytes\",\n\t\t\t\t\t\tname: \"committedInputs\",\n\t\t\t\t\t\ttype: \"bytes\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"uint256\",\n\t\t\t\t\t\t\t\tname: \"validityPeriodInSeconds\",\n\t\t\t\t\t\t\t\ttype: \"uint256\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"string\",\n\t\t\t\t\t\t\t\tname: \"domain\",\n\t\t\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"string\",\n\t\t\t\t\t\t\t\tname: \"scope\",\n\t\t\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"bool\",\n\t\t\t\t\t\t\t\tname: \"devMode\",\n\t\t\t\t\t\t\t\ttype: \"bool\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tinternalType: \"struct ServiceConfig\",\n\t\t\t\t\t\tname: \"serviceConfig\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tinternalType: \"struct ProofVerificationParams\",\n\t\t\t\tname: \"params\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"bool\",\n\t\t\t\tname: \"isIDCard\",\n\t\t\t\ttype: \"bool\",\n\t\t\t},\n\t\t],\n\t\tname: \"zkPassportRegister\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{ internalType: \"bytes32\", name: \"nullifier\", type: \"bytes32\" },\n\t\t\t{ internalType: \"uint256\", name: \"limit\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"expiry\", type: \"uint256\" },\n\t\t\t{ internalType: \"bytes\", name: \"signature\", type: \"bytes\" },\n\t\t],\n\t\tname: \"submitKycAttestation\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [],\n\t\tname: \"kycRp\",\n\t\toutputs: [{ internalType: \"uint256\", name: \"\", type: \"uint256\" }],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [{ internalType: \"address\", name: \"\", type: \"address\" }],\n\t\tname: \"kycVerified\",\n\t\toutputs: [{ internalType: \"bool\", name: \"\", type: \"bool\" }],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n\t// ── BVN (Nigerian Bank Verification Number) attestation ─────────────────\n\t{ inputs: [], name: \"BvnSignerNotSet\", type: \"error\" },\n\t{ inputs: [], name: \"BvnAttestationExpired\", type: \"error\" },\n\t{ inputs: [], name: \"BvnNullifierAlreadySpent\", type: \"error\" },\n\t{ inputs: [], name: \"BvnAlreadyVerified\", type: \"error\" },\n\t{ inputs: [], name: \"BvnInvalidSignature\", type: \"error\" },\n\t{\n\t\tinputs: [\n\t\t\t{ internalType: \"bytes32\", name: \"nullifier\", type: \"bytes32\" },\n\t\t\t{ internalType: \"uint256\", name: \"limit\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"expiry\", type: \"uint256\" },\n\t\t\t{ internalType: \"bytes\", name: \"signature\", type: \"bytes\" },\n\t\t],\n\t\tname: \"submitBvnAttestation\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [],\n\t\tname: \"bvnRp\",\n\t\toutputs: [{ internalType: \"uint256\", name: \"\", type: \"uint256\" }],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [{ internalType: \"address\", name: \"\", type: \"address\" }],\n\t\tname: \"bvnVerified\",\n\t\toutputs: [{ internalType: \"bool\", name: \"\", type: \"bool\" }],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n\t// ── Liveness (face-only, no document) attestation ───────────────────────\n\t{ inputs: [], name: \"LivenessSignerNotSet\", type: \"error\" },\n\t{ inputs: [], name: \"LivenessAttestationExpired\", type: \"error\" },\n\t{ inputs: [], name: \"LivenessNullifierZero\", type: \"error\" },\n\t{ inputs: [], name: \"LivenessNullifierAlreadySpent\", type: \"error\" },\n\t{ inputs: [], name: \"LivenessAlreadyVerified\", type: \"error\" },\n\t{ inputs: [], name: \"LivenessInvalidSignature\", type: \"error\" },\n\t{\n\t\tinputs: [\n\t\t\t{ internalType: \"bytes32\", name: \"nullifier\", type: \"bytes32\" },\n\t\t\t{ internalType: \"uint256\", name: \"limit\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"expiry\", type: \"uint256\" },\n\t\t\t{ internalType: \"bytes\", name: \"signature\", type: \"bytes\" },\n\t\t],\n\t\tname: \"submitLivenessAttestation\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [],\n\t\tname: \"livenessRp\",\n\t\toutputs: [{ internalType: \"uint256\", name: \"\", type: \"uint256\" }],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [{ internalType: \"address\", name: \"\", type: \"address\" }],\n\t\tname: \"livenessVerified\",\n\t\toutputs: [{ internalType: \"bool\", name: \"\", type: \"bool\" }],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n] as const;\n","import type { Result } from \"neverthrow\";\nimport type { Address } from \"viem\";\nimport {\n\tprepareSocialVerify,\n\tprepareSubmitAnonAadharProof,\n\tprepareSubmitBvnAttestation,\n\tprepareSubmitKycAttestation,\n\tprepareSubmitLivenessAttestation,\n\tprepareZkPassportRegister,\n} from \"../contracts/reputation-manager/writes\";\nimport type { ZkkycError } from \"./errors\";\nimport type { ZkkycConfig } from \"./types\";\nimport type {\n\tAnonAadharProofParams,\n\tBvnSubmitParams,\n\tLivenessSubmitParams,\n\tSimpleKycSubmitParams,\n\tSocialVerifyParams,\n\tZkPassportRegisterParams,\n} from \"./validation\";\n\nexport interface Zkkyc {\n\tprepareSocialVerify(\n\t\tparams: SocialVerifyParams,\n\t): Result<{ to: Address; data: `0x${string}` }, ZkkycError>;\n\tprepareSubmitAnonAadharProof(\n\t\tparams: AnonAadharProofParams,\n\t): Result<{ to: Address; data: `0x${string}` }, ZkkycError>;\n\tprepareZkPassportRegister(\n\t\tparams: ZkPassportRegisterParams,\n\t): Result<{ to: Address; data: `0x${string}` }, ZkkycError>;\n\tprepareSubmitKycAttestation(\n\t\tparams: SimpleKycSubmitParams,\n\t): Result<{ to: Address; data: `0x${string}` }, ZkkycError>;\n\tprepareSubmitBvnAttestation(\n\t\tparams: BvnSubmitParams,\n\t): Result<{ to: Address; data: `0x${string}` }, ZkkycError>;\n\tprepareSubmitLivenessAttestation(\n\t\tparams: LivenessSubmitParams,\n\t): Result<{ to: Address; data: `0x${string}` }, ZkkycError>;\n}\n\n/**\n * Creates a Zkkyc client that binds a reputation manager address,\n * exposing write-preparation methods for social verify, Aadhaar, and ZK Passport.\n */\nexport function createZkkyc(config: ZkkycConfig): Zkkyc {\n\tconst { reputationManagerAddress } = config;\n\treturn {\n\t\tprepareSocialVerify: (params) => prepareSocialVerify(reputationManagerAddress, params),\n\t\tprepareSubmitAnonAadharProof: (params) =>\n\t\t\tprepareSubmitAnonAadharProof(reputationManagerAddress, params),\n\t\tprepareZkPassportRegister: (params) =>\n\t\t\tprepareZkPassportRegister(reputationManagerAddress, params),\n\t\tprepareSubmitKycAttestation: (params) =>\n\t\t\tprepareSubmitKycAttestation(reputationManagerAddress, params),\n\t\tprepareSubmitBvnAttestation: (params) =>\n\t\t\tprepareSubmitBvnAttestation(reputationManagerAddress, params),\n\t\tprepareSubmitLivenessAttestation: (params) =>\n\t\t\tprepareSubmitLivenessAttestation(reputationManagerAddress, params),\n\t};\n}\n","import { ResultAsync } from \"neverthrow\";\nimport { ZkkycError, type ZkkycErrorCode } from \"../errors\";\nimport type {\n\tBvnAttestation,\n\tBvnDecision,\n\tBvnFlow,\n\tBvnFlowConfig,\n\tBvnMethod,\n\tBvnOnboardParams,\n\tBvnSendOtpParams,\n\tBvnSession,\n} from \"./types\";\n\n/**\n * Drives the BVN (Nigerian Bank Verification Number) on-chain attestation flow.\n *\n * The SDK talks only to a backend proxy — the single party that holds the Mono\n * secret + the EIP-712 attestor key. Every response uses the `{ ok, data }`\n * envelope. On approval, `getAttestation` returns a signed attestation shaped\n * for `zkkyc.prepareSubmitBvnAttestation`, which the app submits on-chain from\n * the same wallet.\n *\n * Flow: onboard → submitBvn → sendOtp → confirmOtp → getAttestation.\n */\nexport function createBvnFlow(config: BvnFlowConfig): BvnFlow {\n\tconst { baseUrl, tenant } = config;\n\n\tasync function request<T>(\n\t\tpath: string,\n\t\tfailureCode: ZkkycErrorCode,\n\t\tinit: RequestInit | undefined,\n\t\tparse: (data: unknown) => T,\n\t): Promise<T> {\n\t\tconst response = await fetch(`${baseUrl}${path}`, init);\n\t\tconst body: unknown = await response.json().catch(() => null);\n\t\tconst envelope =\n\t\t\tbody && typeof body === \"object\" ? (body as Record<string, unknown>) : {};\n\n\t\tif (!response.ok || envelope.ok === false) {\n\t\t\tconst code = typeof envelope.error === \"string\" ? envelope.error : \"request_failed\";\n\t\t\tconst message =\n\t\t\t\ttypeof envelope.message === \"string\"\n\t\t\t\t\t? envelope.message\n\t\t\t\t\t: `BVN request failed (${response.status})`;\n\t\t\t// A rejected session token means the run must restart from onboard.\n\t\t\tconst isSessionExpired = response.status === 401 || code === \"unauthorized\";\n\t\t\tthrow new ZkkycError(message, {\n\t\t\t\tcode: isSessionExpired ? \"BVN_SESSION_EXPIRED\" : failureCode,\n\t\t\t\tcontext: { status: response.status, backendError: code, path },\n\t\t\t});\n\t\t}\n\n\t\treturn parse(envelope.data);\n\t}\n\n\tfunction run<T>(\n\t\tfailureCode: ZkkycErrorCode,\n\t\tfn: () => Promise<T>,\n\t): ResultAsync<T, ZkkycError> {\n\t\treturn ResultAsync.fromPromise(fn(), (error) => {\n\t\t\tif (error instanceof ZkkycError) return error;\n\t\t\treturn new ZkkycError(\"BVN request failed\", { code: failureCode, cause: error });\n\t\t});\n\t}\n\n\tfunction authHeaders(token: string): Record<string, string> {\n\t\treturn { \"content-type\": \"application/json\", \"x-session-token\": token };\n\t}\n\n\treturn {\n\t\tonboard(params: BvnOnboardParams): ResultAsync<BvnSession, ZkkycError> {\n\t\t\treturn run(\"BVN_ONBOARD_FAILED\", () =>\n\t\t\t\trequest(\n\t\t\t\t\t\"/v1/onboard\",\n\t\t\t\t\t\"BVN_ONBOARD_FAILED\",\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\t\t\ttenant,\n\t\t\t\t\t\t\twallet: params.walletAddress,\n\t\t\t\t\t\t\tscope: params.scope ?? \"identity\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t\t(data) => {\n\t\t\t\t\t\tconst d = data as { session_id: number; session_token: string };\n\t\t\t\t\t\treturn { sessionId: d.session_id, sessionToken: d.session_token };\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t);\n\t\t},\n\n\t\tsubmitBvn(session: BvnSession, bvn: string): ResultAsync<BvnMethod[], ZkkycError> {\n\t\t\treturn run(\"BVN_SUBMIT_FAILED\", () =>\n\t\t\t\trequest(\n\t\t\t\t\t`/v1/sessions/${session.sessionId}/bvn`,\n\t\t\t\t\t\"BVN_SUBMIT_FAILED\",\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\t\theaders: authHeaders(session.sessionToken),\n\t\t\t\t\t\tbody: JSON.stringify({ bvn }),\n\t\t\t\t\t},\n\t\t\t\t\t(data) => (data as { methods: BvnMethod[] }).methods,\n\t\t\t\t),\n\t\t\t);\n\t\t},\n\n\t\tsendOtp(session: BvnSession, params: BvnSendOtpParams): ResultAsync<boolean, ZkkycError> {\n\t\t\treturn run(\"BVN_OTP_SEND_FAILED\", () =>\n\t\t\t\trequest(\n\t\t\t\t\t`/v1/sessions/${session.sessionId}/otp`,\n\t\t\t\t\t\"BVN_OTP_SEND_FAILED\",\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\t\theaders: authHeaders(session.sessionToken),\n\t\t\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\t\t\tmethod: params.method,\n\t\t\t\t\t\t\t...(params.method === \"alternate_phone\" && params.phoneNumber\n\t\t\t\t\t\t\t\t? { phone_number: params.phoneNumber }\n\t\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t\t(data) => (data as { sent: boolean }).sent,\n\t\t\t\t),\n\t\t\t);\n\t\t},\n\n\t\tconfirmOtp(session: BvnSession, otp: string): ResultAsync<BvnDecision, ZkkycError> {\n\t\t\treturn run(\"BVN_OTP_CONFIRM_FAILED\", () =>\n\t\t\t\trequest(\n\t\t\t\t\t`/v1/sessions/${session.sessionId}/otp/confirm`,\n\t\t\t\t\t\"BVN_OTP_CONFIRM_FAILED\",\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\t\theaders: authHeaders(session.sessionToken),\n\t\t\t\t\t\tbody: JSON.stringify({ otp }),\n\t\t\t\t\t},\n\t\t\t\t\t(data) => {\n\t\t\t\t\t\tconst d = data as { decision: \"approve\" | \"reject\"; reason?: string };\n\t\t\t\t\t\treturn { decision: d.decision, reason: d.reason };\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t);\n\t\t},\n\n\t\tgetAttestation(session: BvnSession): ResultAsync<BvnAttestation, ZkkycError> {\n\t\t\treturn run(\"BVN_ATTESTATION_FAILED\", () =>\n\t\t\t\trequest(\n\t\t\t\t\t`/v1/sessions/${session.sessionId}/attestation`,\n\t\t\t\t\t\"BVN_ATTESTATION_FAILED\",\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\t\theaders: { \"x-session-token\": session.sessionToken },\n\t\t\t\t\t},\n\t\t\t\t\t(data) => {\n\t\t\t\t\t\tconst d = data as {\n\t\t\t\t\t\t\tsignature: string;\n\t\t\t\t\t\t\tmessage: {\n\t\t\t\t\t\t\t\twallet: string;\n\t\t\t\t\t\t\t\tnullifier: string;\n\t\t\t\t\t\t\t\tlimit: string | number;\n\t\t\t\t\t\t\t\texpiry: string | number;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t};\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tnullifier: d.message.nullifier as `0x${string}`,\n\t\t\t\t\t\t\tlimit: BigInt(d.message.limit),\n\t\t\t\t\t\t\texpiry: BigInt(d.message.expiry),\n\t\t\t\t\t\t\tsignature: d.signature as `0x${string}`,\n\t\t\t\t\t\t\twallet: d.message.wallet,\n\t\t\t\t\t\t} satisfies BvnAttestation;\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t);\n\t\t},\n\n\t\tgetAttestor(): ResultAsync<{ address: string }, ZkkycError> {\n\t\t\treturn run(\"BVN_ATTESTATION_FAILED\", () =>\n\t\t\t\trequest(\n\t\t\t\t\t\"/v1/attestor\",\n\t\t\t\t\t\"BVN_ATTESTATION_FAILED\",\n\t\t\t\t\tundefined,\n\t\t\t\t\t(data) => data as { address: string },\n\t\t\t\t),\n\t\t\t);\n\t\t},\n\t};\n}\n","import type { SocialPlatform } from \"./types\";\n\n/** Default Reclaim provider IDs for each social platform. */\nexport const DEFAULT_RECLAIM_PROVIDER_IDS: Record<SocialPlatform, string> = {\n\tlinkedin: \"6a86edbe-a0fe-420b-8db2-3155220cc949\",\n\tgithub: \"033f0c06-2eb3-48c8-894c-5599c3356d1c\",\n\tx: \"aad95818-f726-4a34-be97-8d1f47631b03\",\n\tinstagram: \"7e5b59a9-56c5-490c-a169-82a443f9b507\",\n\tfacebook: \"2701510b-c835-4820-84f0-d9e74569656b\",\n\tbinance: \"7e40c007-f432-4d47-ac00-3e0762f8a7a0\",\n};\n\n/** ZK Passport app store links. */\nexport const ZK_PASSPORT_APP_LINKS = {\n\tIOS: \"https://apps.apple.com/us/app/zkpassport/id6477371975\",\n\tANDROID: \"https://play.google.com/store/apps/details?id=app.zkpassport.zkpassport\",\n} as const;\n\n/** Reclaim Protocol app store links. */\nexport const RECLAIM_APP_LINKS = {\n\tANDROID: \"https://play.google.com/store/apps/details?id=org.reclaimprotocol.app\",\n} as const;\n\n/** Default tenant slug for the P2P reputation contract on the simple-kyc service. */\nexport const SIMPLE_KYC_DEFAULT_TENANT = \"p2p-reputation\";\n\n/**\n * Default tenant slug for the P2P reputation contract on the **liveness**\n * service. Distinct registry from simple-kyc's — the two services keep separate\n * databases, so a slug existing on one says nothing about the other.\n */\nexport const LIVENESS_DEFAULT_TENANT = \"p2p-reputation-liveness\";\n\n/** OTP delivery channels the BVN backend (Mono) exposes. */\nexport const BVN_OTP_METHODS = [\"email\", \"phone\", \"phone_1\", \"alternate_phone\"] as const;\n","import { ResultAsync } from \"neverthrow\";\nimport { ZkkycError } from \"../errors\";\nimport type { LivenessAttestation, LivenessFlowParams, LivenessSession } from \"./types\";\n\n/**\n * Starts the hosted liveness wizard flow. Creates a browser-initiable widget\n * session (no API key in the browser — `baseUrl` points at the liveness proxy,\n * which injects the key and whose tenant allowlist validates the redirect_uri),\n * then returns the wizard URL to navigate to.\n *\n * The wizard runs onboard → active liveness challenge → face embed → 1:N dedup\n * and, on approval, redirects back to `redirectUrl` with `?code=<code>&state=<state>`.\n * Call `resumeLivenessFlow({ baseUrl, code })` on return to fetch the attestation.\n *\n * Deliberately separate from `createSimpleKycFlow`: the liveness verifier is a\n * different service with its own database, its own attestor key and its own\n * EIP-712 domain (`LivenessVerifier`, vs the passport wizard's `KycVerifier`).\n * Pointing one flow at the other's base URL yields a signature the contract\n * rejects. The one API-shape difference is that liveness takes **no `country`** —\n * it reads no document, so there is no issuing market to prebind.\n */\nexport function createLivenessFlow(\n\tparams: LivenessFlowParams,\n): ResultAsync<LivenessSession, ZkkycError> {\n\tconst { baseUrl, walletAddress, tenant, redirectUrl, state, onStatus } = params;\n\treturn ResultAsync.fromPromise(\n\t\t(async () => {\n\t\t\tconst res = await fetch(`${baseUrl}/v1/widget/public-sessions`, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\twallet_pubkey: walletAddress,\n\t\t\t\t\tredirect_uri: redirectUrl,\n\t\t\t\t\ttenant,\n\t\t\t\t\tstate,\n\t\t\t\t}),\n\t\t\t});\n\t\t\tif (!res.ok) {\n\t\t\t\tconst body = await res.text();\n\t\t\t\tthrow new ZkkycError(`liveness session creation failed: ${res.status} ${body}`, {\n\t\t\t\t\tcode: \"LIVENESS_SESSION_FAILED\",\n\t\t\t\t\tcontext: { status: res.status },\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst data = (await res.json()) as { widget_url: string };\n\t\t\tconst widgetUrl = data.widget_url;\n\t\t\tonStatus?.({ type: \"session_created\", widgetUrl });\n\t\t\treturn {\n\t\t\t\twidgetUrl,\n\t\t\t\tredirect: () => {\n\t\t\t\t\tif (typeof window !== \"undefined\") {\n\t\t\t\t\t\tonStatus?.({ type: \"redirecting\", widgetUrl });\n\t\t\t\t\t\twindow.location.href = widgetUrl;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t} satisfies LivenessSession;\n\t\t})(),\n\t\t(error) => {\n\t\t\tif (error instanceof ZkkycError) return error;\n\t\t\treturn new ZkkycError(\"liveness flow failed to start\", {\n\t\t\t\tcode: \"LIVENESS_SESSION_FAILED\",\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t},\n\t);\n}\n\n/**\n * Redeems the one-time `code` from the wizard's redirect for the EIP-712\n * attestation. The result feeds straight into `zkkyc.prepareSubmitLivenessAttestation`.\n * The endpoint returns only the (non-PII, self-verifying) attestation.\n */\nexport function resumeLivenessFlow(args: {\n\tbaseUrl: string;\n\tcode: string;\n}): ResultAsync<LivenessAttestation, ZkkycError> {\n\treturn ResultAsync.fromPromise(\n\t\t(async () => {\n\t\t\tconst res = await fetch(`${args.baseUrl}/v1/widget/attestation`, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\t\tbody: JSON.stringify({ code: args.code }),\n\t\t\t});\n\t\t\tif (!res.ok) {\n\t\t\t\tconst body = await res.text();\n\t\t\t\tthrow new ZkkycError(`liveness attestation redemption failed: ${res.status} ${body}`, {\n\t\t\t\t\tcode: \"LIVENESS_REDEEM_FAILED\",\n\t\t\t\t\tcontext: { status: res.status },\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst d = (await res.json()) as {\n\t\t\t\tnullifier: string;\n\t\t\t\tlimit: string | number;\n\t\t\t\texpiry: string | number;\n\t\t\t\tsignature: string;\n\t\t\t\tidentity_hash?: string;\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tnullifier: d.nullifier as `0x${string}`,\n\t\t\t\tlimit: BigInt(d.limit),\n\t\t\t\texpiry: BigInt(d.expiry),\n\t\t\t\tsignature: d.signature as `0x${string}`,\n\t\t\t\tidentityHash: d.identity_hash,\n\t\t\t} satisfies LivenessAttestation;\n\t\t})(),\n\t\t(error) => {\n\t\t\tif (error instanceof ZkkycError) return error;\n\t\t\treturn new ZkkycError(\"liveness attestation redemption failed\", {\n\t\t\t\tcode: \"LIVENESS_REDEEM_FAILED\",\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t},\n\t);\n}\n","import { ResultAsync } from \"neverthrow\";\nimport { ZkkycError } from \"../errors\";\nimport type { ReclaimFlowParams, ReclaimProofResult, ReclaimSession } from \"./types\";\nimport { SOCIAL_PLATFORM_NAMES } from \"./types\";\n\nconst RECLAIM_SESSION_API = \"https://api.reclaimprotocol.org/api/sdk/session\";\n\n/** Shape returned by reclaim-session-service's POST /v1/reclaim/sessions. */\ninterface SessionServiceResponse {\n\t/** `ReclaimProofRequest.toJsonString()` — carries the signature, never the app secret. */\n\tconfig: string;\n\tsessionId: string;\n}\n\n/**\n * Initializes a Reclaim social verification flow and returns a session. The\n * proof request is minted by reclaim-session-service (which holds the app\n * secret) and rebuilt here with `fromJsonString`, so the secret never reaches\n * the browser. That network call runs eagerly, so call this on page load; the\n * returned session's `start()` triggers the in-app flow and polls for the proof,\n * so call that on user action.\n */\nexport function createReclaimFlow(\n\tparams: ReclaimFlowParams,\n): ResultAsync<ReclaimSession, ZkkycError> {\n\treturn ResultAsync.fromPromise(\n\t\t(async () => {\n\t\t\t// biome-ignore lint/suspicious/noExplicitAny: optional peer dependency\n\t\t\tconst mod: any = await import(\"@reclaimprotocol/js-sdk\").catch(() => {\n\t\t\t\tthrow new ZkkycError(\n\t\t\t\t\t\"Missing peer dependency: @reclaimprotocol/js-sdk. Install it with: npm install @reclaimprotocol/js-sdk\",\n\t\t\t\t\t{ code: \"PEER_DEPENDENCY_MISSING\" },\n\t\t\t\t);\n\t\t\t});\n\t\t\tconst { ReclaimProofRequest, transformForOnchain } = mod;\n\n\t\t\tconst {\n\t\t\t\tsessionEndpoint,\n\t\t\t\ttenant,\n\t\t\t\tplatform,\n\t\t\t\twalletAddress,\n\t\t\t\tredirectUrl,\n\t\t\t\tsessionId: existingSessionId,\n\t\t\t\tlocale,\n\t\t\t\tonStatus,\n\t\t\t\tsignal,\n\t\t\t\tpollingIntervalMs = 5000,\n\t\t\t} = params;\n\n\t\t\tconst socialName = SOCIAL_PLATFORM_NAMES[platform];\n\n\t\t\t// biome-ignore lint/suspicious/noExplicitAny: optional peer dependency\n\t\t\tlet reclaimProofRequest: any = null;\n\t\t\tlet sessionId: string;\n\t\t\tlet requestUrl = \"\";\n\n\t\t\tif (existingSessionId) {\n\t\t\t\t// Resuming after the redirect back: the proof already exists on\n\t\t\t\t// Reclaim's side, so we only need to poll. No session to mint.\n\t\t\t\tsessionId = existingSessionId;\n\t\t\t} else {\n\t\t\t\tif (!redirectUrl) {\n\t\t\t\t\tthrow new ZkkycError(\"redirectUrl is required to start a Reclaim session\", {\n\t\t\t\t\t\tcode: \"VALIDATION_ERROR\",\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// The service maps platform -> providerId, renders the context\n\t\t\t\t// message, and signs the request with the app secret. It also\n\t\t\t\t// validates redirectUrl against its own host allowlist.\n\t\t\t\tconst response = await fetch(`${sessionEndpoint.replace(/\\/$/, \"\")}/v1/reclaim/sessions`, {\n\t\t\t\t\tmethod: \"POST\",\n\t\t\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\t\t\tbody: JSON.stringify({ tenant, platform, walletAddress, redirectUrl, locale }),\n\t\t\t\t\tsignal,\n\t\t\t\t});\n\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tconst body = await response.text().catch(() => \"\");\n\t\t\t\t\tthrow new ZkkycError(`Reclaim session creation failed: ${response.status} ${body}`, {\n\t\t\t\t\t\tcode: \"RECLAIM_SESSION_ENDPOINT_FAILED\",\n\t\t\t\t\t\tcontext: { status: response.status, platform },\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tconst data = (await response.json()) as SessionServiceResponse;\n\t\t\t\tif (!data?.config || !data?.sessionId) {\n\t\t\t\t\tthrow new ZkkycError(\"Reclaim session service returned an incomplete response\", {\n\t\t\t\t\t\tcode: \"RECLAIM_SESSION_ENDPOINT_FAILED\",\n\t\t\t\t\t\tcontext: { platform },\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treclaimProofRequest = await ReclaimProofRequest.fromJsonString(data.config);\n\t\t\t\tsessionId = data.sessionId;\n\n\t\t\t\trequestUrl = await reclaimProofRequest.getRequestUrl();\n\n\t\t\t\tonStatus?.({ type: \"session_created\", sessionId, requestUrl });\n\t\t\t}\n\n\t\t\tlet aborted = false;\n\n\t\t\tconst pollForProof = async (): Promise<ReclaimProofResult> => {\n\t\t\t\tif (reclaimProofRequest && typeof window !== \"undefined\") {\n\t\t\t\t\treclaimProofRequest.triggerReclaimFlow({ verificationMode: \"app\" });\n\t\t\t\t}\n\n\t\t\t\tonStatus?.({ type: \"polling_started\", sessionId });\n\n\t\t\t\twhile (true) {\n\t\t\t\t\tif (aborted || signal?.aborted) {\n\t\t\t\t\t\tthrow new ZkkycError(\"Reclaim polling aborted\", {\n\t\t\t\t\t\t\tcode: \"RECLAIM_POLLING_ABORTED\",\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tconst response = await fetch(`${RECLAIM_SESSION_API}/${sessionId}`);\n\t\t\t\t\tconst data = await response.json();\n\n\t\t\t\t\tif (data?.session?.proofs?.length > 0) {\n\t\t\t\t\t\tconst proofs = data.session.proofs;\n\t\t\t\t\t\tonStatus?.({ type: \"proof_received\" });\n\n\t\t\t\t\t\tif (platform === \"github\" && proofs.length > 0) {\n\t\t\t\t\t\t\tconst first = proofs[0] as { publicData?: Record<string, unknown> };\n\t\t\t\t\t\t\tif (first?.publicData && Object.keys(first.publicData).length === 0) {\n\t\t\t\t\t\t\t\tthrow new ZkkycError(\"GitHub verification eligibility criteria not met\", {\n\t\t\t\t\t\t\t\t\tcode: \"RECLAIM_PROOF_INVALID\",\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst transformedProofs = proofs.map((proof: unknown) => transformForOnchain(proof));\n\n\t\t\t\t\t\tonStatus?.({ type: \"proof_transformed\" });\n\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t_socialName: socialName,\n\t\t\t\t\t\t\tproofs: transformedProofs,\n\t\t\t\t\t\t\tsessionId,\n\t\t\t\t\t\t} as ReclaimProofResult;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (data?.message?.includes(\"Session not found\")) {\n\t\t\t\t\t\tthrow new ZkkycError(\"Reclaim session not found\", {\n\t\t\t\t\t\t\tcode: \"RECLAIM_SESSION_NOT_FOUND\",\n\t\t\t\t\t\t\tcontext: { sessionId },\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (data?.session?.statusV2 === \"PROOF_GENERATION_FAILED\") {\n\t\t\t\t\t\tthrow new ZkkycError(\"Reclaim proof generation failed\", {\n\t\t\t\t\t\t\tcode: \"RECLAIM_PROOF_GENERATION_FAILED\",\n\t\t\t\t\t\t\tcontext: { sessionId },\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, pollingIntervalMs));\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst session: ReclaimSession = {\n\t\t\t\tsessionId,\n\t\t\t\trequestUrl,\n\t\t\t\tstart: () =>\n\t\t\t\t\tResultAsync.fromPromise(pollForProof(), (error) => {\n\t\t\t\t\t\tif (error instanceof ZkkycError) return error;\n\t\t\t\t\t\treturn new ZkkycError(\"Reclaim verification flow failed\", {\n\t\t\t\t\t\t\tcode: \"RECLAIM_INIT_FAILED\",\n\t\t\t\t\t\t\tcause: error,\n\t\t\t\t\t\t});\n\t\t\t\t\t}),\n\t\t\t\tabort: () => {\n\t\t\t\t\taborted = true;\n\t\t\t\t},\n\t\t\t};\n\n\t\t\treturn session;\n\t\t})(),\n\t\t(error) => {\n\t\t\tif (error instanceof ZkkycError) return error;\n\t\t\treturn new ZkkycError(\"Reclaim verification flow failed\", {\n\t\t\t\tcode: \"RECLAIM_INIT_FAILED\",\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t},\n\t);\n}\n","import type { ResultAsync } from \"neverthrow\";\nimport type { Address } from \"viem\";\nimport type { ZkkycError } from \"../errors\";\nimport type { SolidityVerifierParameters } from \"../validation\";\n\n// ── Social Platform ──────────────────────────────────────────────────────────\n\nexport type SocialPlatform = \"linkedin\" | \"github\" | \"x\" | \"instagram\" | \"facebook\" | \"binance\";\n\n/** Maps SocialPlatform to the capitalized name the contract expects for _socialName. */\nexport const SOCIAL_PLATFORM_NAMES: Record<SocialPlatform, string> = {\n\tlinkedin: \"LinkedIn\",\n\tgithub: \"GitHub\",\n\tx: \"X\",\n\tinstagram: \"Instagram\",\n\tfacebook: \"Facebook\",\n\tbinance: \"Binance\",\n};\n\n// ── Reclaim (Social Verification) ────────────────────────────────────────────\n\n/** Locales the session service can render the Reclaim context message in. */\nexport type ReclaimLocale = \"en\" | \"es\" | \"hi\" | \"id\" | \"pt\";\n\n/** Tenants the session service knows, one per consuming app. */\nexport type ReclaimTenant = \"p2p\" | \"coinsme\";\n\n/**\n * Single-object params for `createReclaimFlow`. Merges the app-level config\n * (sessionEndpoint, tenant) with the per-call options (platform, walletAddress,\n * callbacks, …) into one argument.\n */\nexport interface ReclaimFlowParams {\n\t// ── App-level config ──────────────────────────────────────────────\n\t/**\n\t * Base URL of the reclaim-session-service, which holds the Reclaim app\n\t * secret and mints proof-request configs (e.g. https://reclaim.p2p.me).\n\t *\n\t * The secret must never reach the browser: it is a private key whose address\n\t * is the appId, and bundlers inline build-time env vars into shipped JS.\n\t */\n\treadonly sessionEndpoint: string;\n\t/** Selects the app's branding/copy on the session service. */\n\treadonly tenant: ReclaimTenant;\n\n\t// ── Per-call options ──────────────────────────────────────────────\n\treadonly platform: SocialPlatform;\n\treadonly walletAddress: Address;\n\t/** Base URL for redirect after Reclaim flow. Service appends ?sessionId={id}&socialPlatform={Name}. */\n\treadonly redirectUrl?: string;\n\t/** Resume polling for an existing session (redirect-back case). */\n\treadonly sessionId?: string;\n\t/**\n\t * Locale for the message shown inside the Reclaim Verifier app. The wording\n\t * itself is owned by the service — that string renders under our app\n\t * identity, so callers choose a language, not the words.\n\t */\n\treadonly locale?: ReclaimLocale;\n\t/** Called with status updates during the flow. */\n\treadonly onStatus?: (status: ReclaimStatus) => void;\n\t/** AbortSignal to cancel polling. */\n\treadonly signal?: AbortSignal;\n\t/** Polling interval in ms. Defaults to 5000. */\n\treadonly pollingIntervalMs?: number;\n}\n\nexport type ReclaimStatus =\n\t| { type: \"session_created\"; sessionId: string; requestUrl: string }\n\t| { type: \"polling_started\"; sessionId: string }\n\t| { type: \"proof_received\" }\n\t| { type: \"proof_transformed\" };\n\nexport interface ReclaimProofResult {\n\treadonly _socialName: string;\n\treadonly proofs: readonly {\n\t\tclaimInfo: { provider: string; parameters: string; context: string };\n\t\tsignedClaim: {\n\t\t\tclaim: { identifier: string; owner: string; timestampS: number; epoch: number };\n\t\t\tsignatures: string[];\n\t\t};\n\t}[];\n\treadonly sessionId: string;\n}\n\nexport interface ReclaimSession {\n\t/** The Reclaim session id (empty until known when resuming). */\n\treadonly sessionId: string;\n\t/** URL to display as a QR code or open as a deep link. Empty when resuming an existing session. */\n\treadonly requestUrl: string;\n\t/** Triggers the in-app Reclaim flow (browser only) and polls until the proof is ready. Call on user action (e.g. button click). */\n\treadonly start: () => ResultAsync<ReclaimProofResult, ZkkycError>;\n\t/** Aborts an in-flight polling loop started by `start`. */\n\treadonly abort: () => void;\n}\n\n// ── ZK Passport ──────────────────────────────────────────────────────────────\n\n/**\n * Single-object params for `createZkPassportFlow`. Merges app-level config\n * (domain, name, logo, purpose) with per-call options (walletAddress, onStatus).\n */\nexport interface ZkPassportFlowParams {\n\t// ── App-level config ──────────────────────────────────────────────\n\t/** Domain for ZKPassport initialization (e.g. \"app.yourproject.com\"). Required — no default is provided to avoid impersonating another app. */\n\treadonly domain: string;\n\t/** App name shown in ZKPassport UI. Defaults to \"ZKPassport\". */\n\treadonly name?: string;\n\t/** Logo URL shown in ZKPassport UI. */\n\treadonly logo?: string;\n\t/** Purpose text shown in ZKPassport UI. Defaults to \"Prove your personhood\". */\n\treadonly purpose?: string;\n\n\t// ── Per-call options ──────────────────────────────────────────────\n\treadonly walletAddress: Address;\n\t/** Called with status updates during the flow. */\n\treadonly onStatus?: (status: ZkPassportStatus) => void;\n}\n\nexport type ZkPassportStatus =\n\t| { type: \"request_created\"; url: string }\n\t| { type: \"request_received\" }\n\t| { type: \"generating_proof\" }\n\t| { type: \"proof_generated\" }\n\t| { type: \"result_received\" }\n\t| { type: \"rejected\" };\n\nexport interface ZkPassportProofResult {\n\treadonly params: SolidityVerifierParameters;\n\treadonly isIDCard: boolean;\n}\n\nexport interface ZkPassportSession {\n\t/** URL to display as QR code or open as deeplink. */\n\treadonly url: string;\n\t/** Resolves when the full flow completes (proof verified). */\n\treadonly result: ResultAsync<ZkPassportProofResult, ZkkycError>;\n\t/** Aborts the flow. The result promise will reject with ZK_PASSPORT_ABORTED. */\n\treadonly abort: () => void;\n}\n\n// ── simple-kyc (hosted passport + liveness wizard) ────────────────────────────\n\n/**\n * Params for `createSimpleKycFlow`. The app opens the hosted simple-kyc wizard,\n * which runs onboard → passport → liveness → face match/dedup and, on approval,\n * redirects back to `redirectUrl` with `?code=<code>&state=<state>`. The app\n * then calls `resumeSimpleKycFlow` to redeem the code for the EIP-712 attestation.\n */\nexport interface SimpleKycFlowParams {\n\t/**\n\t * Base URL exposing the browser-facing `/v1/widget/public-sessions` and\n\t * `/v1/widget/attestation` endpoints — the `kyc-proxy` in a client-only setup\n\t * (e.g. http://localhost:8787). The proxy holds the X-API-Key and forwards to\n\t * simple-kyc's key-gated endpoints.\n\t */\n\treadonly baseUrl: string;\n\t/** The user's EVM wallet — bound into the attestation and credited on-chain. */\n\treadonly walletAddress: Address;\n\t/** Tenant slug (one per consuming contract), e.g. \"p2p-reputation\". */\n\treadonly tenant: string;\n\t/** Return URL — pass `${window.location.origin}<route>` so each app self-routes. */\n\treadonly redirectUrl: string;\n\t/**\n\t * ISO-2 country code (e.g. \"IN\"). Required — the embedded wizard skips the\n\t * country step, so the app must prebind it. Must be one of simple-kyc's\n\t * supported markets (IN, NG, BR, MX, CO, AR, VE, ID).\n\t */\n\treadonly country: string;\n\t/** Opaque state round-tripped back to the app (CSRF/nonce + page to restore). */\n\treadonly state?: string;\n\t/** Status callback. */\n\treadonly onStatus?: (status: SimpleKycStatus) => void;\n}\n\nexport type SimpleKycStatus =\n\t| { type: \"session_created\"; widgetUrl: string }\n\t| { type: \"redirecting\"; widgetUrl: string };\n\nexport interface SimpleKycSession {\n\t/** The hosted wizard URL to navigate to. */\n\treadonly widgetUrl: string;\n\t/** Convenience: navigate the browser to the wizard (no-op outside the browser). */\n\treadonly redirect: () => void;\n}\n\n/** The on-chain-ready attestation, shaped for `prepareSubmitKycAttestation`. */\nexport interface SimpleKycAttestation {\n\treadonly nullifier: `0x${string}`;\n\treadonly limit: bigint;\n\treadonly expiry: bigint;\n\treadonly signature: `0x${string}`;\n\t/** The opaque unique-human handle (no PII), for app-side bookkeeping. */\n\treadonly identityHash?: string;\n}\n\n// ── liveness (hosted face-only wizard, no document) ───────────────────────────\n\n/**\n * Params for `createLivenessFlow`. The app opens the hosted liveness wizard,\n * which runs onboard → active liveness challenge → face embed → 1:N dedup and,\n * on approval, redirects back to `redirectUrl` with `?code=<code>&state=<state>`.\n * The app then calls `resumeLivenessFlow` to redeem the code for the EIP-712\n * attestation.\n *\n * Identical to `SimpleKycFlowParams` minus `country`: liveness reads no\n * document, so there is no issuing market to prebind.\n */\nexport interface LivenessFlowParams {\n\t/**\n\t * Base URL exposing the browser-facing `/v1/widget/public-sessions` and\n\t * `/v1/widget/attestation` endpoints — the liveness proxy in a client-only\n\t * setup (e.g. https://liveness-proxy.p2p.cool). The proxy holds the\n\t * X-API-Key and forwards to the liveness service's key-gated endpoints.\n\t * This is **not** the same host as the passport (`simple-kyc`) proxy.\n\t */\n\treadonly baseUrl: string;\n\t/** The user's EVM wallet — bound into the attestation and credited on-chain. */\n\treadonly walletAddress: Address;\n\t/** Tenant slug (one per consuming contract), e.g. \"p2p-reputation-liveness\". */\n\treadonly tenant: string;\n\t/** Return URL — pass `${window.location.origin}<route>` so each app self-routes. */\n\treadonly redirectUrl: string;\n\t/** Opaque state round-tripped back to the app (CSRF/nonce + page to restore). */\n\treadonly state?: string;\n\t/** Status callback. */\n\treadonly onStatus?: (status: LivenessStatus) => void;\n}\n\nexport type LivenessStatus =\n\t| { type: \"session_created\"; widgetUrl: string }\n\t| { type: \"redirecting\"; widgetUrl: string };\n\nexport interface LivenessSession {\n\t/** The hosted wizard URL to navigate to. */\n\treadonly widgetUrl: string;\n\t/** Convenience: navigate the browser to the wizard (no-op outside the browser). */\n\treadonly redirect: () => void;\n}\n\n/** The on-chain-ready attestation, shaped for `prepareSubmitLivenessAttestation`. */\nexport interface LivenessAttestation {\n\treadonly nullifier: `0x${string}`;\n\treadonly limit: bigint;\n\treadonly expiry: bigint;\n\treadonly signature: `0x${string}`;\n\t/** The opaque unique-human handle (no PII), for app-side bookkeeping. */\n\treadonly identityHash?: string;\n}\n\n// ── BVN (Nigerian Bank Verification Number) ──────────────────────────────────\n\n/** OTP delivery channels the BVN backend exposes. `alternate_phone` needs a number. */\nexport type BvnOtpMethod = \"email\" | \"phone\" | \"phone_1\" | \"alternate_phone\";\n\n/** BVN identity scope requested during onboard. */\nexport type BvnScope = \"identity\" | \"bank_accounts\";\n\n/**\n * Shared config for every BVN step. `baseUrl` points at the backend proxy — the\n * only party holding the Mono secret + the EIP-712 attestor key — using the\n * `{ ok, data }` envelope.\n */\nexport interface BvnFlowConfig {\n\t/** Backend proxy base URL (e.g. https://ngn-bvn-verify-production.up.railway.app). */\n\treadonly baseUrl: string;\n\t/** Tenant slug registered on the backend, mapping to one on-chain contract. */\n\treadonly tenant: string;\n}\n\n/** An active BVN backend session. Carry this between steps. */\nexport interface BvnSession {\n\treadonly sessionId: number;\n\treadonly sessionToken: string;\n}\n\n/** An available OTP delivery method returned after submitting the BVN. */\nexport interface BvnMethod {\n\treadonly method: string;\n\treadonly hint?: string;\n}\n\n/** The confirm-OTP decision. `reject` may carry a reason (e.g. \"bvn_reused\"). */\nexport interface BvnDecision {\n\treadonly decision: \"approve\" | \"reject\";\n\treadonly reason?: string;\n}\n\n/** The on-chain-ready attestation, shaped for `prepareSubmitBvnAttestation`. */\nexport interface BvnAttestation {\n\treadonly nullifier: `0x${string}`;\n\treadonly limit: bigint;\n\treadonly expiry: bigint;\n\treadonly signature: `0x${string}`;\n\t/** The wallet the attestation is bound to. */\n\treadonly wallet?: string;\n}\n\n/** Params for `bvnOnboard`. */\nexport interface BvnOnboardParams {\n\t/** The user's EVM wallet — bound into the attestation and credited on-chain. */\n\treadonly walletAddress: Address;\n\t/** Identity scope. Defaults to \"identity\". */\n\treadonly scope?: BvnScope;\n}\n\n/** Params for `bvnSendOtp`. */\nexport interface BvnSendOtpParams {\n\treadonly method: BvnOtpMethod;\n\t/** Required only when `method` is \"alternate_phone\". */\n\treadonly phoneNumber?: string;\n}\n\n/** The full BVN flow bound to a config — mirrors the `Zkkyc` client shape. */\nexport interface BvnFlow {\n\t/** Step 1 — start a session bound to the wallet + tenant. */\n\tonboard(params: BvnOnboardParams): ResultAsync<BvnSession, ZkkycError>;\n\t/** Step 2 — submit the 11-digit BVN, get available OTP methods. */\n\tsubmitBvn(session: BvnSession, bvn: string): ResultAsync<BvnMethod[], ZkkycError>;\n\t/** Step 3 — request an OTP over the chosen channel. */\n\tsendOtp(session: BvnSession, params: BvnSendOtpParams): ResultAsync<boolean, ZkkycError>;\n\t/** Step 4 — confirm the OTP; returns approve/reject (never any PII). */\n\tconfirmOtp(session: BvnSession, otp: string): ResultAsync<BvnDecision, ZkkycError>;\n\t/** Step 5 — mint the signed EIP-712 attestation for an approved session. */\n\tgetAttestation(session: BvnSession): ResultAsync<BvnAttestation, ZkkycError>;\n\t/** Optional — the address the tenant contract must trust as its signer. */\n\tgetAttestor(): ResultAsync<{ address: string }, ZkkycError>;\n}\n","import { ResultAsync } from \"neverthrow\";\nimport { ZkkycError } from \"../errors\";\nimport type { SimpleKycAttestation, SimpleKycFlowParams, SimpleKycSession } from \"./types\";\n\n/**\n * Starts the hosted simple-kyc wizard flow. Creates a browser-initiable widget\n * session (no API key in the browser — `baseUrl` points at the kyc-proxy, which\n * injects the key and whose tenant allowlist validates the redirect_uri), then\n * returns the wizard URL to navigate to.\n *\n * The wizard runs passport → liveness → face match/dedup and, on approval,\n * redirects back to `redirectUrl` with `?code=<code>&state=<state>`. Call\n * `resumeSimpleKycFlow({ baseUrl, code })` on return to fetch the attestation.\n */\nexport function createSimpleKycFlow(\n\tparams: SimpleKycFlowParams,\n): ResultAsync<SimpleKycSession, ZkkycError> {\n\tconst { baseUrl, walletAddress, tenant, redirectUrl, country, state, onStatus } = params;\n\treturn ResultAsync.fromPromise(\n\t\t(async () => {\n\t\t\tconst res = await fetch(`${baseUrl}/v1/widget/public-sessions`, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\twallet_pubkey: walletAddress,\n\t\t\t\t\tredirect_uri: redirectUrl,\n\t\t\t\t\ttenant,\n\t\t\t\t\tcountry,\n\t\t\t\t\tstate,\n\t\t\t\t}),\n\t\t\t});\n\t\t\tif (!res.ok) {\n\t\t\t\tconst body = await res.text();\n\t\t\t\tthrow new ZkkycError(`simple-kyc session creation failed: ${res.status} ${body}`, {\n\t\t\t\t\tcode: \"SIMPLE_KYC_SESSION_FAILED\",\n\t\t\t\t\tcontext: { status: res.status },\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst data = (await res.json()) as { widget_url: string };\n\t\t\tconst widgetUrl = data.widget_url;\n\t\t\tonStatus?.({ type: \"session_created\", widgetUrl });\n\t\t\treturn {\n\t\t\t\twidgetUrl,\n\t\t\t\tredirect: () => {\n\t\t\t\t\tif (typeof window !== \"undefined\") {\n\t\t\t\t\t\tonStatus?.({ type: \"redirecting\", widgetUrl });\n\t\t\t\t\t\twindow.location.href = widgetUrl;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t} satisfies SimpleKycSession;\n\t\t})(),\n\t\t(error) => {\n\t\t\tif (error instanceof ZkkycError) return error;\n\t\t\treturn new ZkkycError(\"simple-kyc flow failed to start\", {\n\t\t\t\tcode: \"SIMPLE_KYC_SESSION_FAILED\",\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t},\n\t);\n}\n\n/**\n * Redeems the one-time `kyc_code` from the wizard's redirect for the EIP-712\n * attestation. The result feeds straight into `zkkyc.prepareSubmitKycAttestation`.\n * The endpoint returns only the (non-PII, self-verifying) attestation.\n */\nexport function resumeSimpleKycFlow(args: {\n\tbaseUrl: string;\n\tcode: string;\n}): ResultAsync<SimpleKycAttestation, ZkkycError> {\n\treturn ResultAsync.fromPromise(\n\t\t(async () => {\n\t\t\tconst res = await fetch(`${args.baseUrl}/v1/widget/attestation`, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\t\tbody: JSON.stringify({ code: args.code }),\n\t\t\t});\n\t\t\tif (!res.ok) {\n\t\t\t\tconst body = await res.text();\n\t\t\t\tthrow new ZkkycError(`simple-kyc attestation redemption failed: ${res.status} ${body}`, {\n\t\t\t\t\tcode: \"SIMPLE_KYC_REDEEM_FAILED\",\n\t\t\t\t\tcontext: { status: res.status },\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst d = (await res.json()) as {\n\t\t\t\tnullifier: string;\n\t\t\t\tlimit: string | number;\n\t\t\t\texpiry: string | number;\n\t\t\t\tsignature: string;\n\t\t\t\tidentity_hash?: string;\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tnullifier: d.nullifier as `0x${string}`,\n\t\t\t\tlimit: BigInt(d.limit),\n\t\t\t\texpiry: BigInt(d.expiry),\n\t\t\t\tsignature: d.signature as `0x${string}`,\n\t\t\t\tidentityHash: d.identity_hash,\n\t\t\t} satisfies SimpleKycAttestation;\n\t\t})(),\n\t\t(error) => {\n\t\t\tif (error instanceof ZkkycError) return error;\n\t\t\treturn new ZkkycError(\"simple-kyc attestation redemption failed\", {\n\t\t\t\tcode: \"SIMPLE_KYC_REDEEM_FAILED\",\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t},\n\t);\n}\n","import { ResultAsync } from \"neverthrow\";\nimport { ZkkycError } from \"../errors\";\nimport type { ZkPassportFlowParams, ZkPassportProofResult, ZkPassportSession } from \"./types\";\n\n/** Initializes a ZK Passport verification flow and returns a session. */\nexport function createZkPassportFlow(\n\tparams: ZkPassportFlowParams,\n): ResultAsync<ZkPassportSession, ZkkycError> {\n\treturn ResultAsync.fromPromise(\n\t\t(async () => {\n\t\t\t// biome-ignore lint/suspicious/noExplicitAny: optional peer dependency\n\t\t\tconst mod: any = await import(\"@zkpassport/sdk\").catch(() => {\n\t\t\t\tthrow new ZkkycError(\n\t\t\t\t\t\"Missing peer dependency: @zkpassport/sdk. Install it with: npm install @zkpassport/sdk\",\n\t\t\t\t\t{ code: \"PEER_DEPENDENCY_MISSING\" },\n\t\t\t\t);\n\t\t\t});\n\t\t\tconst { ZKPassport } = mod;\n\n\t\t\tconst zkPassport = new ZKPassport(params.domain);\n\n\t\t\tconst queryBuilder = await zkPassport.request({\n\t\t\t\tname: params.name ?? \"ZKPassport\",\n\t\t\t\tlogo: params.logo,\n\t\t\t\tpurpose: params.purpose ?? \"Prove your personhood\",\n\t\t\t\tscope: \"personhood\",\n\t\t\t\tmode: \"compressed-evm\",\n\t\t\t});\n\n\t\t\tconst {\n\t\t\t\turl,\n\t\t\t\tonRequestReceived,\n\t\t\t\tonGeneratingProof,\n\t\t\t\tonProofGenerated,\n\t\t\t\tonResult,\n\t\t\t\tonReject,\n\t\t\t\tonError,\n\t\t\t} = queryBuilder\n\t\t\t\t.gte(\"age\", 18)\n\t\t\t\t.disclose(\"document_type\")\n\t\t\t\t.disclose(\"nationality\")\n\t\t\t\t.bind(\"user_address\", params.walletAddress)\n\t\t\t\t.done();\n\n\t\t\tparams.onStatus?.({ type: \"request_created\", url });\n\n\t\t\tlet aborted = false;\n\n\t\t\tconst resultPromise = new Promise<ZkPassportProofResult>((resolve, reject) => {\n\t\t\t\tlet proof: unknown = null;\n\n\t\t\t\tonRequestReceived(() => {\n\t\t\t\t\tif (aborted) return;\n\t\t\t\t\tparams.onStatus?.({ type: \"request_received\" });\n\t\t\t\t});\n\n\t\t\t\tonGeneratingProof(() => {\n\t\t\t\t\tif (aborted) return;\n\t\t\t\t\tparams.onStatus?.({ type: \"generating_proof\" });\n\t\t\t\t});\n\n\t\t\t\tonProofGenerated(async (result: unknown) => {\n\t\t\t\t\tif (aborted) return;\n\t\t\t\t\tparams.onStatus?.({ type: \"proof_generated\" });\n\t\t\t\t\tproof = result;\n\t\t\t\t});\n\n\t\t\t\tonResult(\n\t\t\t\t\tasync ({\n\t\t\t\t\t\tresult,\n\t\t\t\t\t\tuniqueIdentifier,\n\t\t\t\t\t\tverified,\n\t\t\t\t\t}: {\n\t\t\t\t\t\tresult: Record<string, { disclose?: { result?: string } }>;\n\t\t\t\t\t\tuniqueIdentifier: string | null;\n\t\t\t\t\t\tverified: boolean;\n\t\t\t\t\t}) => {\n\t\t\t\t\t\tif (aborted) return;\n\t\t\t\t\t\tparams.onStatus?.({ type: \"result_received\" });\n\n\t\t\t\t\t\tif (!verified || !proof || !uniqueIdentifier) {\n\t\t\t\t\t\t\treject(\n\t\t\t\t\t\t\t\tnew ZkkycError(\"ZK Passport verification failed\", {\n\t\t\t\t\t\t\t\t\tcode: \"ZK_PASSPORT_VERIFICATION_FAILED\",\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst verifierParams = zkPassport.getSolidityVerifierParameters({\n\t\t\t\t\t\t\t\tproof,\n\t\t\t\t\t\t\t\tscope: \"personhood\",\n\t\t\t\t\t\t\t\tdevMode: false,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tconst isIDCard = result.document_type?.disclose?.result !== \"passport\";\n\n\t\t\t\t\t\t\tresolve({ params: verifierParams, isIDCard });\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treject(\n\t\t\t\t\t\t\t\tnew ZkkycError(\"Failed to extract ZK Passport verifier parameters\", {\n\t\t\t\t\t\t\t\t\tcode: \"ZK_PASSPORT_VERIFICATION_FAILED\",\n\t\t\t\t\t\t\t\t\tcause: error,\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t);\n\n\t\t\t\tonReject(() => {\n\t\t\t\t\tparams.onStatus?.({ type: \"rejected\" });\n\t\t\t\t\treject(\n\t\t\t\t\t\tnew ZkkycError(\"User rejected ZK Passport verification\", {\n\t\t\t\t\t\t\tcode: \"ZK_PASSPORT_REJECTED\",\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t});\n\n\t\t\t\tonError((error: unknown) => {\n\t\t\t\t\treject(\n\t\t\t\t\t\tnew ZkkycError(typeof error === \"string\" ? error : \"ZK Passport verification error\", {\n\t\t\t\t\t\t\tcode: \"ZK_PASSPORT_VERIFICATION_FAILED\",\n\t\t\t\t\t\t\tcause: error,\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tconst session: ZkPassportSession = {\n\t\t\t\turl,\n\t\t\t\tresult: ResultAsync.fromPromise(resultPromise, (error) => {\n\t\t\t\t\tif (error instanceof ZkkycError) return error;\n\t\t\t\t\treturn new ZkkycError(\"ZK Passport flow failed\", {\n\t\t\t\t\t\tcode: \"ZK_PASSPORT_VERIFICATION_FAILED\",\n\t\t\t\t\t\tcause: error,\n\t\t\t\t\t});\n\t\t\t\t}),\n\t\t\t\tabort: () => {\n\t\t\t\t\taborted = true;\n\t\t\t\t},\n\t\t\t};\n\n\t\t\treturn session;\n\t\t})(),\n\t\t(error) => {\n\t\t\tif (error instanceof ZkkycError) return error;\n\t\t\treturn new ZkkycError(\"Failed to initialize ZK Passport\", {\n\t\t\t\tcode: \"ZK_PASSPORT_INIT_FAILED\",\n\t\t\t\tcause: error,\n\t\t\t});\n\t\t},\n\t);\n}\n"],"mappings":";AAAA,SAAS,cAAc;AACvB,SAAuB,0BAA0B;;;ACD1C,IAAM,WAAN,cAAsD,MAAM;AAAA,EACzD;AAAA,EACA;AAAA,EACA;AAAA,EAET,YACC,SACA,SAKC;AACD,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,OAAO,QAAQ;AACpB,S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CAAoC;AAAA,QACzD,MAAM;AAAA,QACN,OAAO;AAAA,MACR,CAAC;AAAA,IACF;AAAA,EACD;AACD;","names":["z","z","ResultAsync","ResultAsync","ResultAsync","ResultAsync","ResultAsync","ResultAsync","ResultAsync","ResultAsync"]}