@p2pdotme/sdk 1.0.5 → 1.1.1

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.
Files changed (66) hide show
  1. package/README.md +103 -41
  2. package/dist/country.cjs +9 -2
  3. package/dist/country.cjs.map +1 -1
  4. package/dist/country.d.cts +35 -10
  5. package/dist/country.d.ts +35 -10
  6. package/dist/country.mjs +6 -2
  7. package/dist/country.mjs.map +1 -1
  8. package/dist/fraud-engine.cjs +52 -48
  9. package/dist/fraud-engine.cjs.map +1 -1
  10. package/dist/fraud-engine.mjs +46 -42
  11. package/dist/fraud-engine.mjs.map +1 -1
  12. package/dist/index.cjs +4 -14
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.cts +41 -36
  15. package/dist/index.d.ts +41 -36
  16. package/dist/index.mjs +4 -12
  17. package/dist/index.mjs.map +1 -1
  18. package/dist/orders.cjs +5961 -0
  19. package/dist/orders.cjs.map +1 -0
  20. package/dist/orders.d.cts +620 -0
  21. package/dist/orders.d.ts +620 -0
  22. package/dist/orders.mjs +5911 -0
  23. package/dist/orders.mjs.map +1 -0
  24. package/dist/prices.cjs +1432 -0
  25. package/dist/prices.cjs.map +1 -0
  26. package/dist/prices.d.cts +109 -0
  27. package/dist/prices.d.ts +109 -0
  28. package/dist/prices.mjs +1404 -0
  29. package/dist/prices.mjs.map +1 -0
  30. package/dist/profile.cjs +899 -69
  31. package/dist/profile.cjs.map +1 -1
  32. package/dist/profile.d.cts +39 -27
  33. package/dist/profile.d.ts +39 -27
  34. package/dist/profile.mjs +892 -62
  35. package/dist/profile.mjs.map +1 -1
  36. package/dist/qr-parsers.cjs +88 -7
  37. package/dist/qr-parsers.cjs.map +1 -1
  38. package/dist/qr-parsers.d.cts +38 -16
  39. package/dist/qr-parsers.d.ts +38 -16
  40. package/dist/qr-parsers.mjs +88 -7
  41. package/dist/qr-parsers.mjs.map +1 -1
  42. package/dist/react.cjs +2955 -1105
  43. package/dist/react.cjs.map +1 -1
  44. package/dist/react.d.cts +384 -104
  45. package/dist/react.d.ts +384 -104
  46. package/dist/react.mjs +2841 -992
  47. package/dist/react.mjs.map +1 -1
  48. package/dist/zkkyc.cjs +405 -24
  49. package/dist/zkkyc.cjs.map +1 -1
  50. package/dist/zkkyc.d.cts +14 -9
  51. package/dist/zkkyc.d.ts +14 -9
  52. package/dist/zkkyc.mjs +405 -24
  53. package/dist/zkkyc.mjs.map +1 -1
  54. package/package.json +12 -12
  55. package/dist/order-routing.cjs +0 -888
  56. package/dist/order-routing.cjs.map +0 -1
  57. package/dist/order-routing.d.cts +0 -68
  58. package/dist/order-routing.d.ts +0 -68
  59. package/dist/order-routing.mjs +0 -860
  60. package/dist/order-routing.mjs.map +0 -1
  61. package/dist/payload.cjs +0 -3168
  62. package/dist/payload.cjs.map +0 -1
  63. package/dist/payload.d.cts +0 -147
  64. package/dist/payload.d.ts +0 -147
  65. package/dist/payload.mjs +0 -3124
  66. package/dist/payload.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/contracts/reputation-manager/writes.ts","../src/validation/errors.validation.ts","../src/validation/schemas.validation.ts","../src/constants/currencies.constant.ts","../src/zkkyc/errors.ts","../src/zkkyc/validation.ts","../src/contracts/abis/index.ts","../src/contracts/abis/order-flow-facet.ts","../src/contracts/abis/p2p-config-facet.ts","../src/contracts/abis/reputation-manager.ts","../src/zkkyc/client.ts","../src/zkkyc/orchestrators/constants.ts","../src/zkkyc/orchestrators/reclaim.ts","../src/zkkyc/orchestrators/types.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\tSocialVerifyParams,\n\tZkPassportRegisterParams,\n} from \"../../zkkyc/validation\";\nimport {\n\tZodAnonAadharProofParamsSchema,\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 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 } from \"../constants\";\n\nexport const ZodAddressSchema = z\n\t.string()\n\t.refine((s) => isAddress(s), { message: \"Invalid Ethereum address\" });\n\nexport const ZodCurrencySchema = z.enum(Object.values(CURRENCY) as [string, ...string[]]);\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","/** All supported currency symbols. Single source of truth for the SDK. */\nexport const CURRENCY = {\n\tIDR: \"IDR\",\n\tINR: \"INR\",\n\tBRL: \"BRL\",\n\tARS: \"ARS\",\n\tMEX: \"MEX\",\n\tVEN: \"VEN\",\n\tEUR: \"EUR\",\n\tNGN: \"NGN\",\n\tUSD: \"USD\",\n\tCOP: \"COP\",\n} as const;\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| \"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","import { erc20Abi } from \"viem\";\nimport { orderFlowFacetAbi } from \"./order-flow-facet\";\nimport { p2pConfigFacetAbi } from \"./p2p-config-facet\";\nimport { reputationManagerAbi } from \"./reputation-manager\";\n\nconst DIAMOND_ABI = [...orderFlowFacetAbi, ...p2pConfigFacetAbi] as const;\n\nexport const ABIS = {\n\tDIAMOND: DIAMOND_ABI,\n\tFACETS: {\n\t\tORDER_FLOW: orderFlowFacetAbi,\n\t\tCONFIG: p2pConfigFacetAbi,\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] 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 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] as const;\n","import type { Result } from \"neverthrow\";\nimport type { Address } from \"viem\";\nimport {\n\tprepareSocialVerify,\n\tprepareSubmitAnonAadharProof,\n\tprepareZkPassportRegister,\n} from \"../contracts/reputation-manager/writes\";\nimport type { ZkkycError } from \"./errors\";\nimport type { ZkkycConfig } from \"./types\";\nimport type {\n\tAnonAadharProofParams,\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}\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};\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};\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","import { ResultAsync } from \"neverthrow\";\nimport { ZkkycError } from \"../errors\";\nimport type { ReclaimConfig, ReclaimFlowOptions, ReclaimProofResult } from \"./types\";\nimport { SOCIAL_PLATFORM_NAMES } from \"./types\";\n\nconst RECLAIM_SESSION_API = \"https://api.reclaimprotocol.org/api/sdk/session\";\n\n/** Runs the Reclaim social verification flow and returns proof data for on-chain submission. */\nexport function createReclaimFlow(\n\tconfig: ReclaimConfig,\n\toptions: ReclaimFlowOptions,\n): ResultAsync<ReclaimProofResult, 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\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} = options;\n\n\t\t\tconst socialName = SOCIAL_PLATFORM_NAMES[platform];\n\t\t\tconst providerId = config.providerIds[platform];\n\n\t\t\tlet sessionId: string;\n\n\t\t\tif (existingSessionId) {\n\t\t\t\tsessionId = existingSessionId;\n\t\t\t} else {\n\t\t\t\tconst reclaimProofRequest = await ReclaimProofRequest.init(\n\t\t\t\t\tconfig.appId,\n\t\t\t\t\tconfig.appSecret,\n\t\t\t\t\tproviderId,\n\t\t\t\t\t{ launchOptions: { canUseDeferredDeepLinksFlow: 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\tconst requestUrl = await reclaimProofRequest.getRequestUrl();\n\n\t\t\t\tonStatus?.({ type: \"session_created\", sessionId, requestUrl });\n\n\t\t\t\tif (typeof window !== \"undefined\") {\n\t\t\t\t\treclaimProofRequest.triggerReclaimFlow();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tonStatus?.({ type: \"polling_started\", sessionId });\n\n\t\t\twhile (true) {\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\tthrow new ZkkycError(\"Reclaim polling aborted\", {\n\t\t\t\t\t\tcode: \"RECLAIM_POLLING_ABORTED\",\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tconst response = await fetch(`${RECLAIM_SESSION_API}/${sessionId}`);\n\t\t\t\tconst data = await response.json();\n\n\t\t\t\tif (data?.session?.proofs?.length > 0) {\n\t\t\t\t\tconst proofs = data.session.proofs;\n\t\t\t\t\tonStatus?.({ type: \"proof_received\" });\n\n\t\t\t\t\tif (platform === \"github\" && proofs.length > 0) {\n\t\t\t\t\t\tconst first = proofs[0] as { publicData?: Record<string, unknown> };\n\t\t\t\t\t\tif (first?.publicData && Object.keys(first.publicData).length === 0) {\n\t\t\t\t\t\t\tthrow new ZkkycError(\"GitHub verification eligibility criteria not met\", {\n\t\t\t\t\t\t\t\tcode: \"RECLAIM_PROOF_INVALID\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tconst transformedProofs = proofs.map((proof: unknown) => transformForOnchain(proof));\n\n\t\t\t\t\tonStatus?.({ type: \"proof_transformed\" });\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\t_socialName: socialName,\n\t\t\t\t\t\tproofs: transformedProofs,\n\t\t\t\t\t\tsessionId,\n\t\t\t\t\t} as ReclaimProofResult;\n\t\t\t\t}\n\n\t\t\t\tif (data?.message?.includes(\"Session not found\")) {\n\t\t\t\t\tthrow new ZkkycError(\"Reclaim session not found\", {\n\t\t\t\t\t\tcode: \"RECLAIM_SESSION_NOT_FOUND\",\n\t\t\t\t\t\tcontext: { sessionId },\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (data?.session?.statusV2 === \"PROOF_GENERATION_FAILED\") {\n\t\t\t\t\tthrow new ZkkycError(\"Reclaim proof generation failed\", {\n\t\t\t\t\t\tcode: \"RECLAIM_PROOF_GENERATION_FAILED\",\n\t\t\t\t\t\tcontext: { sessionId },\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, pollingIntervalMs));\n\t\t\t}\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\";\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};\n\n// ── Reclaim (Social Verification) ────────────────────────────────────────────\n\nexport interface ReclaimConfig {\n\treadonly appId: string;\n\treadonly appSecret: string;\n\treadonly providerIds: Record<SocialPlatform, string>;\n}\n\nexport interface ReclaimFlowOptions {\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\n// ── ZK Passport ──────────────────────────────────────────────────────────────\n\nexport interface ZkPassportConfig {\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\nexport interface ZkPassportFlowOptions {\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","import { ResultAsync } from \"neverthrow\";\nimport { ZkkycError } from \"../errors\";\nimport type {\n\tZkPassportConfig,\n\tZkPassportFlowOptions,\n\tZkPassportProofResult,\n\tZkPassportSession,\n} from \"./types\";\n\n/** Initializes a ZK Passport verification flow and returns a session. */\nexport function createZkPassportFlow(\n\tconfig: ZkPassportConfig,\n\toptions: ZkPassportFlowOptions,\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(config.domain);\n\n\t\t\tconst queryBuilder = await zkPassport.request({\n\t\t\t\tname: config.name ?? \"ZKPassport\",\n\t\t\t\tlogo: config.logo,\n\t\t\t\tpurpose: config.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\", options.walletAddress)\n\t\t\t\t.done();\n\n\t\t\toptions.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\toptions.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\toptions.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\toptions.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\toptions.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\toptions.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,SAAK,QAAQ,QAAQ;AACrB,SAAK,UAAU,QAAQ;AAAA,EACxB;AACD;;;ACnBA,SAAS,KAAK,UAAuB;AACrC,SAAS,iBAAiB;AAC1B,SAAS,SAAS;;;ACDX,IAAM,WAAW;AAAA,EACvB,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AACN;;;ADPO,IAAM,mBAAmB,EAC9B,OAAO,EACP,OAAO,CAAC,MAAM,UAAU,CAAC,GAAG,EAAE,SAAS,2BAA2B,CAAC;AAE9D,IAAM,oBAAoB,EAAE,KAAK,OAAO,OAAO,QAAQ,CAA0B;AAEjF,SAAS,SACf,QACA,MACA,SACwB;AACxB,QAAM,SAAS,OAAO,UAAU,IAAI;AACpC,MAAI,OAAO,SAAS;AACnB,WAAO,GAAG,OAAO,IAAkB;AAAA,EACpC;AACA,SAAO,IAAI,QAAQ,EAAE,cAAc,OAAO,KAAK,GAAG,OAAO,OAAO,IAAI,CAAC;AACtE;;;AEJO,IAAM,aAAN,cAAyB,SAAyB;AAAA,EACxD,YACC,SACA,SAKC;AACD,UAAM,SAAS,OAAO;AACtB,SAAK,OAAO;AAAA,EACb;AACD;;;AC7BA,SAAS,KAAAA,UAAS;AAKX,I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AC;AAAA,UACF;AAAA,QACD,CAAC;AAED,gBAAQ,CAAC,UAAmB;AAC3B;AAAA,YACC,IAAI,WAAW,OAAO,UAAU,WAAW,QAAQ,kCAAkC;AAAA,cACpF,MAAM;AAAA,cACN,OAAO;AAAA,YACR,CAAC;AAAA,UACF;AAAA,QACD,CAAC;AAAA,MACF,CAAC;AAED,YAAM,UAA6B;AAAA,QAClC;AAAA,QACA,QAAQA,aAAY,YAAY,eAAe,CAAC,UAAU;AACzD,cAAI,iBAAiB,WAAY,QAAO;AACxC,iBAAO,IAAI,WAAW,2BAA2B;AAAA,YAChD,MAAM;AAAA,YACN,OAAO;AAAA,UACR,CAAC;AAAA,QACF,CAAC;AAAA,QACD,OAAO,MAAM;AACZ,oBAAU;AAAA,QACX;AAAA,MACD;AAEA,aAAO;AAAA,IACR,GAAG;AAAA,IACH,CAAC,UAAU;AACV,UAAI,iBAAiB,WAAY,QAAO;AACxC,aAAO,IAAI,WAAW,oCAAoC;AAAA,QACzD,MAAM;AAAA,QACN,OAAO;AAAA,MACR,CAAC;AAAA,IACF;AAAA,EACD;AACD;","names":["z","z","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/reputation-manager.ts","../src/zkkyc/client.ts","../src/zkkyc/orchestrators/constants.ts","../src/zkkyc/orchestrators/reclaim.ts","../src/zkkyc/orchestrators/types.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\tSocialVerifyParams,\n\tZkPassportRegisterParams,\n} from \"../../zkkyc/validation\";\nimport {\n\tZodAnonAadharProofParamsSchema,\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 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\tEUR: \"EUR\",\n\tNGN: \"NGN\",\n\tUSD: \"USD\",\n\tCOP: \"COP\",\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| \"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","import { erc20Abi } from \"viem\";\nimport { orderFlowFacetAbi } from \"./order-flow-facet\";\nimport { orderProcessorFacetAbi } from \"./order-processor-facet\";\nimport { p2pConfigFacetAbi } from \"./p2p-config-facet\";\nimport { reputationManagerAbi } from \"./reputation-manager\";\n\nconst DIAMOND_ABI = [\n\t...orderFlowFacetAbi,\n\t...orderProcessorFacetAbi,\n\t...p2pConfigFacetAbi,\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},\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 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] as const;\n","import type { Result } from \"neverthrow\";\nimport type { Address } from \"viem\";\nimport {\n\tprepareSocialVerify,\n\tprepareSubmitAnonAadharProof,\n\tprepareZkPassportRegister,\n} from \"../contracts/reputation-manager/writes\";\nimport type { ZkkycError } from \"./errors\";\nimport type { ZkkycConfig } from \"./types\";\nimport type {\n\tAnonAadharProofParams,\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}\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};\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};\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","import { ResultAsync } from \"neverthrow\";\nimport { ZkkycError } from \"../errors\";\nimport type { ReclaimFlowParams, ReclaimProofResult } from \"./types\";\nimport { SOCIAL_PLATFORM_NAMES } from \"./types\";\n\nconst RECLAIM_SESSION_API = \"https://api.reclaimprotocol.org/api/sdk/session\";\n\n/** Runs the Reclaim social verification flow and returns proof data for on-chain submission. */\nexport function createReclaimFlow(\n\tparams: ReclaimFlowParams,\n): ResultAsync<ReclaimProofResult, 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\tlet sessionId: string;\n\n\t\t\tif (existingSessionId) {\n\t\t\t\tsessionId = existingSessionId;\n\t\t\t} else {\n\t\t\t\tconst reclaimProofRequest = await ReclaimProofRequest.init(appId, appSecret, providerId, {\n\t\t\t\t\tlaunchOptions: { canUseDeferredDeepLinksFlow: 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\tconst requestUrl = await reclaimProofRequest.getRequestUrl();\n\n\t\t\t\tonStatus?.({ type: \"session_created\", sessionId, requestUrl });\n\n\t\t\t\tif (typeof window !== \"undefined\") {\n\t\t\t\t\treclaimProofRequest.triggerReclaimFlow();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tonStatus?.({ type: \"polling_started\", sessionId });\n\n\t\t\twhile (true) {\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\tthrow new ZkkycError(\"Reclaim polling aborted\", {\n\t\t\t\t\t\tcode: \"RECLAIM_POLLING_ABORTED\",\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tconst response = await fetch(`${RECLAIM_SESSION_API}/${sessionId}`);\n\t\t\t\tconst data = await response.json();\n\n\t\t\t\tif (data?.session?.proofs?.length > 0) {\n\t\t\t\t\tconst proofs = data.session.proofs;\n\t\t\t\t\tonStatus?.({ type: \"proof_received\" });\n\n\t\t\t\t\tif (platform === \"github\" && proofs.length > 0) {\n\t\t\t\t\t\tconst first = proofs[0] as { publicData?: Record<string, unknown> };\n\t\t\t\t\t\tif (first?.publicData && Object.keys(first.publicData).length === 0) {\n\t\t\t\t\t\t\tthrow new ZkkycError(\"GitHub verification eligibility criteria not met\", {\n\t\t\t\t\t\t\t\tcode: \"RECLAIM_PROOF_INVALID\",\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tconst transformedProofs = proofs.map((proof: unknown) => transformForOnchain(proof));\n\n\t\t\t\t\tonStatus?.({ type: \"proof_transformed\" });\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\t_socialName: socialName,\n\t\t\t\t\t\tproofs: transformedProofs,\n\t\t\t\t\t\tsessionId,\n\t\t\t\t\t} as ReclaimProofResult;\n\t\t\t\t}\n\n\t\t\t\tif (data?.message?.includes(\"Session not found\")) {\n\t\t\t\t\tthrow new ZkkycError(\"Reclaim session not found\", {\n\t\t\t\t\t\tcode: \"RECLAIM_SESSION_NOT_FOUND\",\n\t\t\t\t\t\tcontext: { sessionId },\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (data?.session?.statusV2 === \"PROOF_GENERATION_FAILED\") {\n\t\t\t\t\tthrow new ZkkycError(\"Reclaim proof generation failed\", {\n\t\t\t\t\t\tcode: \"RECLAIM_PROOF_GENERATION_FAILED\",\n\t\t\t\t\t\tcontext: { sessionId },\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, pollingIntervalMs));\n\t\t\t}\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\";\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};\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\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","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,cA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AAO,eAAe,UAAU,WAAW;AAE5D,sBAAQ,EAAE,QAAQ,gBAAgB,SAAS,CAAC;AAAA,YAC7C,SAAS,OAAO;AACf;AAAA,gBACC,IAAI,WAAW,qDAAqD;AAAA,kBACnE,MAAM;AAAA,kBACN,OAAO;AAAA,gBACR,CAAC;AAAA,cACF;AAAA,YACD;AAAA,UACD;AAAA,QACD;AAEA,iBAAS,MAAM;AACd,iBAAO,WAAW,EAAE,MAAM,WAAW,CAAC;AACtC;AAAA,YACC,IAAI,WAAW,0CAA0C;AAAA,cACxD,MAAM;AAAA,YACP,CAAC;AAAA,UACF;AAAA,QACD,CAAC;AAED,gBAAQ,CAAC,UAAmB;AAC3B;AAAA,YACC,IAAI,WAAW,OAAO,UAAU,WAAW,QAAQ,kCAAkC;AAAA,cACpF,MAAM;AAAA,cACN,OAAO;AAAA,YACR,CAAC;AAAA,UACF;AAAA,QACD,CAAC;AAAA,MACF,CAAC;AAED,YAAM,UAA6B;AAAA,QAClC;AAAA,QACA,QAAQA,aAAY,YAAY,eAAe,CAAC,UAAU;AACzD,cAAI,iBAAiB,WAAY,QAAO;AACxC,iBAAO,IAAI,WAAW,2BAA2B;AAAA,YAChD,MAAM;AAAA,YACN,OAAO;AAAA,UACR,CAAC;AAAA,QACF,CAAC;AAAA,QACD,OAAO,MAAM;AACZ,oBAAU;AAAA,QACX;AAAA,MACD;AAEA,aAAO;AAAA,IACR,GAAG;AAAA,IACH,CAAC,UAAU;AACV,UAAI,iBAAiB,WAAY,QAAO;AACxC,aAAO,IAAI,WAAW,oCAAoC;AAAA,QACzD,MAAM;AAAA,QACN,OAAO;AAAA,MACR,CAAC;AAAA,IACF;AAAA,EACD;AACD;","names":["z","z","ResultAsync","ResultAsync"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@p2pdotme/sdk",
3
- "version": "1.0.5",
3
+ "version": "1.1.1",
4
4
  "description": "P2P.me SDK",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -14,10 +14,10 @@
14
14
  "import": "./dist/index.mjs",
15
15
  "require": "./dist/index.cjs"
16
16
  },
17
- "./order-routing": {
18
- "types": "./dist/order-routing.d.ts",
19
- "import": "./dist/order-routing.mjs",
20
- "require": "./dist/order-routing.cjs"
17
+ "./orders": {
18
+ "types": "./dist/orders.d.ts",
19
+ "import": "./dist/orders.mjs",
20
+ "require": "./dist/orders.cjs"
21
21
  },
22
22
  "./react": {
23
23
  "types": "./dist/react.d.ts",
@@ -34,16 +34,16 @@
34
34
  "import": "./dist/fraud-engine.mjs",
35
35
  "require": "./dist/fraud-engine.cjs"
36
36
  },
37
- "./payload": {
38
- "types": "./dist/payload.d.ts",
39
- "import": "./dist/payload.mjs",
40
- "require": "./dist/payload.cjs"
41
- },
42
37
  "./profile": {
43
38
  "types": "./dist/profile.d.ts",
44
39
  "import": "./dist/profile.mjs",
45
40
  "require": "./dist/profile.cjs"
46
41
  },
42
+ "./prices": {
43
+ "types": "./dist/prices.d.ts",
44
+ "import": "./dist/prices.mjs",
45
+ "require": "./dist/prices.cjs"
46
+ },
47
47
  "./country": {
48
48
  "types": "./dist/country.d.ts",
49
49
  "import": "./dist/country.mjs",
@@ -58,12 +58,12 @@
58
58
  "typesVersions": {
59
59
  "*": {
60
60
  ".": ["./dist/index.d.ts"],
61
- "order-routing": ["./dist/order-routing.d.ts"],
61
+ "orders": ["./dist/orders.d.ts"],
62
62
  "react": ["./dist/react.d.ts"],
63
63
  "qr-parsers": ["./dist/qr-parsers.d.ts"],
64
64
  "fraud-engine": ["./dist/fraud-engine.d.ts"],
65
- "payload": ["./dist/payload.d.ts"],
66
65
  "profile": ["./dist/profile.d.ts"],
66
+ "prices": ["./dist/prices.d.ts"],
67
67
  "country": ["./dist/country.d.ts"],
68
68
  "zkkyc": ["./dist/zkkyc.d.ts"]
69
69
  }