@p2pdotme/sdk 1.1.8 → 1.1.9

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/stake/index.ts","../src/contracts/p2p-stake/index.ts","../src/validation/errors.validation.ts","../src/validation/schemas.validation.ts","../src/country/currency.ts","../src/stake/errors.ts","../src/stake/validation.ts","../src/contracts/abis/index.ts","../src/contracts/abis/order-flow-facet.ts","../src/contracts/abis/order-processor-facet.ts","../src/contracts/abis/p2p-config-facet.ts","../src/contracts/abis/p2p-stake-boost-facet.ts","../src/contracts/abis/reputation-manager.ts","../src/stake/actions/claim-unstake.ts","../src/stake/tx.ts","../src/stake/actions/request-unstake.ts","../src/stake/actions/stake.ts","../src/stake/actions/top-up.ts","../src/stake/normalize.ts","../src/stake/client.ts"],"sourcesContent":["// ── Main entry point ────────────────────────────────────────────────────\n\nexport { createStake, type StakeClient } from \"./client\";\n\n// ── Types ───────────────────────────────────────────────────────────────\n\nexport type {\n\tExecuteBase,\n\tGetP2pTokenBalanceParams,\n\tGetStakeBoostConfigParams,\n\tGetUserStakeParams,\n\tPreparedTx,\n\tRawStakeBoostGlobals,\n\tRawUserStake,\n\tStakeBoostConfig,\n\tStakeBoostGlobals,\n\tStakeConfig,\n\tStakeParams,\n\tStakeStatus,\n\tTopUpParams,\n\tTxResult,\n\tUserStake,\n} from \"./types\";\n\n// ── Errors ──────────────────────────────────────────────────────────────\n\nexport { StakeError, type StakeErrorCode } from \"./errors\";\n","import { ResultAsync } from \"neverthrow\";\nimport { type Address, stringToHex } from \"viem\";\nimport { StakeError } from \"../../stake/errors\";\nimport type { RawStakeBoostGlobals, RawUserStake, StakeBoostConfig } from \"../../stake/types\";\nimport type {\n\tGetP2pTokenBalanceParams,\n\tGetStakeBoostConfigParams,\n\tGetUserStakeParams,\n} from \"../../stake/validation\";\nimport {\n\tZodGetP2pTokenBalanceParamsSchema,\n\tZodGetStakeBoostConfigParamsSchema,\n\tZodGetUserStakeParamsSchema,\n} from \"../../stake/validation\";\nimport type { PublicClientLike } from \"../../types\";\nimport { validate } from \"../../validation\";\nimport { ABIS } from \"../abis\";\n\n/**\n * Reads the on-chain stake record for a user — `stakedAmount`, `cooldownEnd`,\n * and `status` from the P2P stake boost facet.\n */\nexport function getUserStake(\n\tpublicClient: PublicClientLike,\n\tdiamondAddress: Address,\n\tparams: GetUserStakeParams,\n): ResultAsync<RawUserStake, StakeError> {\n\treturn validate(\n\t\tZodGetUserStakeParamsSchema,\n\t\tparams,\n\t\t(message, cause, data) =>\n\t\t\tnew StakeError(message, {\n\t\t\t\tcode: \"VALIDATION_ERROR\",\n\t\t\t\tcause,\n\t\t\t\tcontext: { params: data },\n\t\t\t}),\n\t).asyncAndThen((validated) =>\n\t\tResultAsync.fromPromise(\n\t\t\tpublicClient.readContract({\n\t\t\t\taddress: diamondAddress,\n\t\t\t\tabi: ABIS.FACETS.STAKE,\n\t\t\t\tfunctionName: \"getUserStake\",\n\t\t\t\targs: [validated.user],\n\t\t\t}) as Promise<RawUserStake>,\n\t\t\t(error) =>\n\t\t\t\tnew StakeError(\"Failed to read user stake\", {\n\t\t\t\t\tcode: \"CONTRACT_READ_ERROR\",\n\t\t\t\t\tcause: error,\n\t\t\t\t\tcontext: { user: validated.user, diamondAddress },\n\t\t\t\t}),\n\t\t),\n\t);\n}\n\n/**\n * Reads the per-currency stake boost config — tokens-per-USD ratio and the\n * maximum USD boost a stake can unlock.\n */\nexport function getStakeBoostConfig(\n\tpublicClient: PublicClientLike,\n\tdiamondAddress: Address,\n\tparams: GetStakeBoostConfigParams,\n): ResultAsync<StakeBoostConfig, StakeError> {\n\treturn validate(\n\t\tZodGetStakeBoostConfigParamsSchema,\n\t\tparams,\n\t\t(message, cause, data) =>\n\t\t\tnew StakeError(message, {\n\t\t\t\tcode: \"VALIDATION_ERROR\",\n\t\t\t\tcause,\n\t\t\t\tcontext: { params: data },\n\t\t\t}),\n\t).asyncAndThen((validated) =>\n\t\tResultAsync.fromPromise(\n\t\t\tpublicClient.readContract({\n\t\t\t\taddress: diamondAddress,\n\t\t\t\tabi: ABIS.FACETS.STAKE,\n\t\t\t\tfunctionName: \"getStakeBoostConfig\",\n\t\t\t\targs: [stringToHex(validated.currency, { size: 32 })],\n\t\t\t}) as Promise<StakeBoostConfig>,\n\t\t\t(error) =>\n\t\t\t\tnew StakeError(\"Failed to read stake boost config\", {\n\t\t\t\t\tcode: \"CONTRACT_READ_ERROR\",\n\t\t\t\t\tcause: error,\n\t\t\t\t\tcontext: { currency: validated.currency, diamondAddress },\n\t\t\t\t}),\n\t\t),\n\t);\n}\n\n/**\n * Reads the global stake boost configuration — p2p token address, fraud reserve,\n * cooldown durations, token decimals, and total staked across all users.\n */\nexport function getStakeBoostGlobals(\n\tpublicClient: PublicClientLike,\n\tdiamondAddress: Address,\n): ResultAsync<RawStakeBoostGlobals, StakeError> {\n\treturn ResultAsync.fromPromise(\n\t\tpublicClient.readContract({\n\t\t\taddress: diamondAddress,\n\t\t\tabi: ABIS.FACETS.STAKE,\n\t\t\tfunctionName: \"getStakeBoostGlobals\",\n\t\t\targs: [],\n\t\t}) as Promise<RawStakeBoostGlobals>,\n\t\t(error) =>\n\t\t\tnew StakeError(\"Failed to read stake boost globals\", {\n\t\t\t\tcode: \"CONTRACT_READ_ERROR\",\n\t\t\t\tcause: error,\n\t\t\t\tcontext: { diamondAddress },\n\t\t\t}),\n\t);\n}\n\n/** Reads the P2P token (ERC20) balance for a given address. */\nexport function getP2pTokenBalance(\n\tpublicClient: PublicClientLike,\n\tp2pTokenAddress: Address,\n\tparams: GetP2pTokenBalanceParams,\n): ResultAsync<bigint, StakeError> {\n\treturn validate(\n\t\tZodGetP2pTokenBalanceParamsSchema,\n\t\tparams,\n\t\t(message, cause, data) =>\n\t\t\tnew StakeError(message, {\n\t\t\t\tcode: \"VALIDATION_ERROR\",\n\t\t\t\tcause,\n\t\t\t\tcontext: { params: data },\n\t\t\t}),\n\t).asyncAndThen((validated) =>\n\t\tResultAsync.fromPromise(\n\t\t\tpublicClient.readContract({\n\t\t\t\taddress: p2pTokenAddress,\n\t\t\t\tabi: ABIS.EXTERNAL.USDC,\n\t\t\t\tfunctionName: \"balanceOf\",\n\t\t\t\targs: [validated.address],\n\t\t\t}) as Promise<bigint>,\n\t\t\t(error) =>\n\t\t\t\tnew StakeError(\"Failed to read P2P token balance\", {\n\t\t\t\t\tcode: \"CONTRACT_READ_ERROR\",\n\t\t\t\t\tcause: error,\n\t\t\t\t\tcontext: { address: validated.address, p2pTokenAddress },\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 StakeErrorCode =\n\t| \"VALIDATION_ERROR\"\n\t| \"CONTRACT_READ_ERROR\"\n\t| \"TX_SUBMISSION_FAILED\"\n\t| \"RECEIPT_TIMEOUT\"\n\t| \"TX_REVERTED\";\n\nexport class StakeError extends SdkError<StakeErrorCode> {\n\tconstructor(\n\t\tmessage: string,\n\t\toptions: {\n\t\t\tcode: StakeErrorCode;\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 = \"StakeError\";\n\t}\n}\n","import { z } from \"zod\";\nimport { ZodAddressSchema, ZodCurrencySchema } from \"../validation\";\n\n// ── Read params ─────────────────────────────────────────────────────────\n\nexport const ZodGetUserStakeParamsSchema = z.object({\n\tuser: ZodAddressSchema,\n});\n\nexport type GetUserStakeParams = z.infer<typeof ZodGetUserStakeParamsSchema>;\n\nexport const ZodGetStakeBoostConfigParamsSchema = z.object({\n\tcurrency: ZodCurrencySchema,\n});\n\nexport type GetStakeBoostConfigParams = z.infer<typeof ZodGetStakeBoostConfigParamsSchema>;\n\nexport const ZodGetP2pTokenBalanceParamsSchema = z.object({\n\taddress: ZodAddressSchema,\n});\n\nexport type GetP2pTokenBalanceParams = z.infer<typeof ZodGetP2pTokenBalanceParamsSchema>;\n\n// ── Write params ────────────────────────────────────────────────────────\n\nexport const ZodStakeParamsSchema = z.object({\n\ttokens: z.bigint().positive(),\n});\nexport type StakeParams = z.infer<typeof ZodStakeParamsSchema>;\n\nexport const ZodTopUpParamsSchema = z.object({\n\ttokens: z.bigint().positive(),\n});\nexport type TopUpParams = z.infer<typeof ZodTopUpParamsSchema>;\n","import { erc20Abi } from \"viem\";\nimport { orderFlowFacetAbi } from \"./order-flow-facet\";\nimport { orderProcessorFacetAbi } from \"./order-processor-facet\";\nimport { p2pConfigFacetAbi } from \"./p2p-config-facet\";\nimport { p2pStakeBoostFacetAbi } from \"./p2p-stake-boost-facet\";\nimport { reputationManagerAbi } from \"./reputation-manager\";\n\nconst DIAMOND_ABI = [\n\t...orderFlowFacetAbi,\n\t...orderProcessorFacetAbi,\n\t...p2pConfigFacetAbi,\n\t...p2pStakeBoostFacetAbi,\n] as const;\n\nexport const ABIS = {\n\tDIAMOND: DIAMOND_ABI,\n\tFACETS: {\n\t\tORDER_FLOW: orderFlowFacetAbi,\n\t\tORDER_PROCESSOR: orderProcessorFacetAbi,\n\t\tCONFIG: p2pConfigFacetAbi,\n\t\tSTAKE: p2pStakeBoostFacetAbi,\n\t},\n\tEXTERNAL: {\n\t\tUSDC: erc20Abi,\n\t\tREPUTATION_MANAGER: reputationManagerAbi,\n\t},\n} as const;\n","export const orderFlowFacetAbi = [\n\t{\n\t\tinputs: [\n\t\t\t{ internalType: \"uint256\", name: \"circleId\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"assignUpto\", type: \"uint256\" },\n\t\t\t{ internalType: \"bytes32\", name: \"currency\", type: \"bytes32\" },\n\t\t\t{ internalType: \"address\", name: \"user\", type: \"address\" },\n\t\t\t{ internalType: \"uint256\", name: \"usdtAmount\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t{ internalType: \"int256\", name: \"orderType\", type: \"int256\" },\n\t\t\t{ internalType: \"uint256\", name: \"preferredPCConfigId\", type: \"uint256\" },\n\t\t],\n\t\tname: \"getAssignableMerchantsFromCircle\",\n\t\toutputs: [{ internalType: \"address[]\", name: \"\", type: \"address[]\" }],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{ internalType: \"address\", name: \"_user\", type: \"address\" },\n\t\t\t{ internalType: \"bytes32\", name: \"_nativeCurrency\", type: \"bytes32\" },\n\t\t],\n\t\tname: \"userTxLimit\",\n\t\toutputs: [\n\t\t\t{ internalType: \"uint256\", name: \"\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"\", type: \"uint256\" },\n\t\t],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{ internalType: \"string\", name: \"_pubKey\", type: \"string\" },\n\t\t\t{ internalType: \"uint256\", name: \"_amount\", type: \"uint256\" },\n\t\t\t{ internalType: \"address\", name: \"_recipientAddr\", type: \"address\" },\n\t\t\t{ internalType: \"uint8\", name: \"_orderType\", type: \"uint8\" },\n\t\t\t{ internalType: \"string\", name: \"_userUpi\", type: \"string\" },\n\t\t\t{ internalType: \"string\", name: \"_userPubKey\", type: \"string\" },\n\t\t\t{ internalType: \"bytes32\", name: \"_currency\", type: \"bytes32\" },\n\t\t\t{ internalType: \"uint256\", name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"_circleId\", type: \"uint256\" },\n\t\t\t{ internalType: \"uint256\", name: \"_fiatAmountLimit\", type: \"uint256\" },\n\t\t],\n\t\tname: \"placeOrder\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [{ internalType: \"uint256\", name: \"_orderId\", type: \"uint256\" }],\n\t\tname: \"cancelOrder\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{ internalType: \"uint256\", name: \"_orderId\", type: \"uint256\" },\n\t\t\t{ internalType: \"string\", name: \"_userEncUpi\", type: \"string\" },\n\t\t\t{ internalType: \"uint256\", name: \"_updatedAmount\", type: \"uint256\" },\n\t\t],\n\t\tname: \"setSellOrderUpi\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\ttype: \"event\",\n\t\tname: \"OrderPlaced\",\n\t\tanonymous: false,\n\t\tinputs: [\n\t\t\t{ indexed: true, name: \"orderId\", type: \"uint256\" },\n\t\t\t{ indexed: true, name: \"user\", type: \"address\" },\n\t\t\t{ indexed: true, name: \"merchant\", type: \"address\" },\n\t\t\t{ indexed: false, name: \"amount\", type: \"uint256\" },\n\t\t\t{ indexed: false, name: \"orderType\", type: \"uint8\" },\n\t\t\t{ indexed: false, name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t{\n\t\t\t\tindexed: false,\n\t\t\t\tname: \"_order\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"amount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userCompletedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"acceptedMerchant\", type: \"address\" },\n\t\t\t\t\t{ name: \"user\", type: \"address\" },\n\t\t\t\t\t{ name: \"recipientAddr\", type: \"address\" },\n\t\t\t\t\t{ name: \"pubkey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"userCompleted\", type: \"bool\" },\n\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t{ name: \"orderType\", type: \"uint8\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"disputeInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{ name: \"raisedBy\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t\t\t\t\t\t{ name: \"accountNumber\", type: \"uint256\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{ name: \"id\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userPubKey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encMerchantUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"acceptedAccountNo\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"assignedAccountNos\", type: \"uint256[]\" },\n\t\t\t\t\t{ name: \"currency\", type: \"bytes32\" },\n\t\t\t\t\t{ name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"circleId\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: \"event\",\n\t\tname: \"OrderAccepted\",\n\t\tanonymous: false,\n\t\tinputs: [\n\t\t\t{ indexed: true, name: \"orderId\", type: \"uint256\" },\n\t\t\t{ indexed: true, name: \"merchant\", type: \"address\" },\n\t\t\t{ indexed: false, name: \"pubKey\", type: \"string\" },\n\t\t\t{\n\t\t\t\tindexed: false,\n\t\t\t\tname: \"_order\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"amount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userCompletedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"acceptedMerchant\", type: \"address\" },\n\t\t\t\t\t{ name: \"user\", type: \"address\" },\n\t\t\t\t\t{ name: \"recipientAddr\", type: \"address\" },\n\t\t\t\t\t{ name: \"pubkey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"userCompleted\", type: \"bool\" },\n\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t{ name: \"orderType\", type: \"uint8\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"disputeInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{ name: \"raisedBy\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t\t\t\t\t\t{ name: \"accountNumber\", type: \"uint256\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{ name: \"id\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userPubKey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encMerchantUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"acceptedAccountNo\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"assignedAccountNos\", type: \"uint256[]\" },\n\t\t\t\t\t{ name: \"currency\", type: \"bytes32\" },\n\t\t\t\t\t{ name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"circleId\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: \"event\",\n\t\tname: \"BuyOrderPaid\",\n\t\tanonymous: false,\n\t\tinputs: [\n\t\t\t{ indexed: true, name: \"orderId\", type: \"uint256\" },\n\t\t\t{ indexed: true, name: \"user\", type: \"address\" },\n\t\t\t{\n\t\t\t\tindexed: false,\n\t\t\t\tname: \"_order\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"amount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userCompletedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"acceptedMerchant\", type: \"address\" },\n\t\t\t\t\t{ name: \"user\", type: \"address\" },\n\t\t\t\t\t{ name: \"recipientAddr\", type: \"address\" },\n\t\t\t\t\t{ name: \"pubkey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"userCompleted\", type: \"bool\" },\n\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t{ name: \"orderType\", type: \"uint8\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"disputeInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{ name: \"raisedBy\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t\t\t\t\t\t{ name: \"accountNumber\", type: \"uint256\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{ name: \"id\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userPubKey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encMerchantUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"acceptedAccountNo\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"assignedAccountNos\", type: \"uint256[]\" },\n\t\t\t\t\t{ name: \"currency\", type: \"bytes32\" },\n\t\t\t\t\t{ name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"circleId\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: \"event\",\n\t\tname: \"OrderCompleted\",\n\t\tanonymous: false,\n\t\tinputs: [\n\t\t\t{ indexed: true, name: \"orderId\", type: \"uint256\" },\n\t\t\t{ indexed: true, name: \"user\", type: \"address\" },\n\t\t\t{ indexed: false, name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t{\n\t\t\t\tindexed: false,\n\t\t\t\tname: \"_order\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"amount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userCompletedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"acceptedMerchant\", type: \"address\" },\n\t\t\t\t\t{ name: \"user\", type: \"address\" },\n\t\t\t\t\t{ name: \"recipientAddr\", type: \"address\" },\n\t\t\t\t\t{ name: \"pubkey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"userCompleted\", type: \"bool\" },\n\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t{ name: \"orderType\", type: \"uint8\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"disputeInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{ name: \"raisedBy\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t\t\t\t\t\t{ name: \"accountNumber\", type: \"uint256\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{ name: \"id\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userPubKey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encMerchantUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"acceptedAccountNo\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"assignedAccountNos\", type: \"uint256[]\" },\n\t\t\t\t\t{ name: \"currency\", type: \"bytes32\" },\n\t\t\t\t\t{ name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"circleId\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: \"event\",\n\t\tname: \"CancelledOrders\",\n\t\tanonymous: false,\n\t\tinputs: [\n\t\t\t{ indexed: true, name: \"orderId\", type: \"uint256\" },\n\t\t\t{\n\t\t\t\tindexed: false,\n\t\t\t\tname: \"_order\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"amount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userCompletedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"acceptedMerchant\", type: \"address\" },\n\t\t\t\t\t{ name: \"user\", type: \"address\" },\n\t\t\t\t\t{ name: \"recipientAddr\", type: \"address\" },\n\t\t\t\t\t{ name: \"pubkey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"userCompleted\", type: \"bool\" },\n\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t{ name: \"orderType\", type: \"uint8\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"disputeInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{ name: \"raisedBy\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t\t\t\t\t\t{ name: \"accountNumber\", type: \"uint256\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{ name: \"id\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userPubKey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encMerchantUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"acceptedAccountNo\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"assignedAccountNos\", type: \"uint256[]\" },\n\t\t\t\t\t{ name: \"currency\", type: \"bytes32\" },\n\t\t\t\t\t{ name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"circleId\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n] as const;\n","/**\n * Minimal ABI fragments for reads on OrderProcessor storage via the Diamond.\n * `getOrdersById`, `getAdditionalOrderDetails`, and the per-currency small-order\n * fee config getters (`getSmallOrderThreshold`, `getSmallOrderFixedFee`).\n */\nexport const orderProcessorFacetAbi = [\n\t{\n\t\ttype: \"function\",\n\t\tname: \"getOrdersById\",\n\t\tstateMutability: \"view\",\n\t\tinputs: [{ name: \"orderId\", type: \"uint256\" }],\n\t\toutputs: [\n\t\t\t{\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"amount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"fiatAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"placedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"completedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userCompletedTimestamp\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"acceptedMerchant\", type: \"address\" },\n\t\t\t\t\t{ name: \"user\", type: \"address\" },\n\t\t\t\t\t{ name: \"recipientAddr\", type: \"address\" },\n\t\t\t\t\t{ name: \"pubkey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"userCompleted\", type: \"bool\" },\n\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t{ name: \"orderType\", type: \"uint8\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tname: \"disputeInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{ name: \"raisedBy\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"status\", type: \"uint8\" },\n\t\t\t\t\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t\t\t\t\t\t{ name: \"accountNumber\", type: \"uint256\" },\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\t{ name: \"id\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"userPubKey\", type: \"string\" },\n\t\t\t\t\t{ name: \"encMerchantUpi\", type: \"string\" },\n\t\t\t\t\t{ name: \"acceptedAccountNo\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"assignedAccountNos\", type: \"uint256[]\" },\n\t\t\t\t\t{ name: \"currency\", type: \"bytes32\" },\n\t\t\t\t\t{ name: \"preferredPaymentChannelConfigId\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"circleId\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: \"function\",\n\t\tname: \"getAdditionalOrderDetails\",\n\t\tstateMutability: \"view\",\n\t\tinputs: [{ name: \"orderId\", type: \"uint256\" }],\n\t\toutputs: [\n\t\t\t{\n\t\t\t\ttype: \"tuple\",\n\t\t\t\tcomponents: [\n\t\t\t\t\t{ name: \"fixedFeePaid\", type: \"uint64\" },\n\t\t\t\t\t{ name: \"tipsPaid\", type: \"uint64\" },\n\t\t\t\t\t{ name: \"acceptedTimestamp\", type: \"uint128\" },\n\t\t\t\t\t{ name: \"paidTimestamp\", type: \"uint128\" },\n\t\t\t\t\t{ name: \"reserved2\", type: \"uint128\" },\n\t\t\t\t\t{ name: \"actualUsdtAmount\", type: \"uint256\" },\n\t\t\t\t\t{ name: \"actualFiatAmount\", type: \"uint256\" },\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\ttype: \"function\",\n\t\tname: \"getSmallOrderThreshold\",\n\t\tstateMutability: \"view\",\n\t\tinputs: [{ name: \"currency\", type: \"bytes32\" }],\n\t\toutputs: [{ name: \"\", type: \"uint256\" }],\n\t},\n\t{\n\t\ttype: \"function\",\n\t\tname: \"getSmallOrderFixedFee\",\n\t\tstateMutability: \"view\",\n\t\tinputs: [{ name: \"currency\", type: \"bytes32\" }],\n\t\toutputs: [{ name: \"\", type: \"uint256\" }],\n\t},\n\t{\n\t\ttype: \"function\",\n\t\tname: \"raiseDispute\",\n\t\tstateMutability: \"nonpayable\",\n\t\tinputs: [\n\t\t\t{ name: \"_orderId\", type: \"uint256\" },\n\t\t\t{ name: \"redactTransId\", type: \"uint256\" },\n\t\t],\n\t\toutputs: [],\n\t},\n\t{\n\t\ttype: \"function\",\n\t\tname: \"paidBuyOrder\",\n\t\tstateMutability: \"nonpayable\",\n\t\tinputs: [{ name: \"_orderId\", type: \"uint256\" }],\n\t\toutputs: [],\n\t},\n] as const;\n","export const p2pConfigFacetAbi = [\n\t{\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tinternalType: \"bytes32\",\n\t\t\t\tname: \"_currency\",\n\t\t\t\ttype: \"bytes32\",\n\t\t\t},\n\t\t],\n\t\tname: \"getPriceConfig\",\n\t\toutputs: [\n\t\t\t{\n\t\t\t\tcomponents: [\n\t\t\t\t\t{\n\t\t\t\t\t\tinternalType: \"uint256\",\n\t\t\t\t\t\tname: \"buyPrice\",\n\t\t\t\t\t\ttype: \"uint256\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tinternalType: \"uint256\",\n\t\t\t\t\t\tname: \"sellPrice\",\n\t\t\t\t\t\ttype: \"uint256\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tinternalType: \"int256\",\n\t\t\t\t\t\tname: \"buyPriceOffset\",\n\t\t\t\t\t\ttype: \"int256\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tinternalType: \"uint256\",\n\t\t\t\t\t\tname: \"baseSpread\",\n\t\t\t\t\t\ttype: \"uint256\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tinternalType: \"struct P2pConfigStorage.PriceConfig\",\n\t\t\t\tname: \"\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t},\n\t\t],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tinternalType: \"bytes32\",\n\t\t\t\tname: \"_nativeCurrency\",\n\t\t\t\ttype: \"bytes32\",\n\t\t\t},\n\t\t],\n\t\tname: \"getRpPerUsdtLimitRational\",\n\t\toutputs: [\n\t\t\t{\n\t\t\t\tinternalType: \"uint256\",\n\t\t\t\tname: \"numerator\",\n\t\t\t\ttype: \"uint256\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"uint256\",\n\t\t\t\tname: \"denominator\",\n\t\t\t\ttype: \"uint256\",\n\t\t\t},\n\t\t],\n\t\tstateMutability: \"view\",\n\t\ttype: \"function\",\n\t},\n] as const;\n","export const p2pStakeBoostFacetAbi = [\n {\n inputs: [{ internalType: \"uint256\", name: \"tokens\", type: \"uint256\" }],\n name: \"p2pBoostStake\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"uint256\", name: \"tokens\", type: \"uint256\" }],\n name: \"p2pBoostTopUp\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"p2pBoostRequestUnstake\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"p2pBoostClaimUnstake\",\n outputs: [],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"address\", name: \"user\", type: \"address\" }],\n name: \"getUserStake\",\n outputs: [\n {\n components: [\n { internalType: \"uint128\", name: \"stakedAmount\", type: \"uint128\" },\n { internalType: \"uint64\", name: \"cooldownEnd\", type: \"uint64\" },\n { internalType: \"uint8\", name: \"status\", type: \"uint8\" },\n ],\n internalType: \"struct P2PStakeBoostStorage.UserStake\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"bytes32\", name: \"currency\", type: \"bytes32\" }],\n name: \"getStakeBoostConfig\",\n outputs: [\n {\n components: [\n {\n internalType: \"uint256\",\n name: \"tokensPerUsdNumerator\",\n type: \"uint256\",\n },\n {\n internalType: \"uint256\",\n name: \"tokensPerUsdDenominator\",\n type: \"uint256\",\n },\n { internalType: \"uint256\", name: \"maxBoostUsd\", type: \"uint256\" },\n ],\n internalType: \"struct P2PStakeBoostStorage.BoostConfig\",\n name: \"\",\n type: \"tuple\",\n },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"getStakeBoostGlobals\",\n outputs: [\n { internalType: \"address\", name: \"p2pToken\", type: \"address\" },\n { internalType: \"address\", name: \"fraudReserve\", type: \"address\" },\n { internalType: \"uint256\", name: \"maxStakeTokens\", type: \"uint256\" },\n { internalType: \"uint256\", name: \"normalCooldown\", type: \"uint256\" },\n { internalType: \"uint256\", name: \"blacklistCooldown\", type: \"uint256\" },\n { internalType: \"uint8\", name: \"tokenDecimals\", type: \"uint8\" },\n { internalType: \"uint256\", name: \"totalStaked\", type: \"uint256\" },\n ],\n stateMutability: \"view\",\n type: \"function\",\n },\n] as const;\n","export const reputationManagerAbi = [\n\t{\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tinternalType: \"string\",\n\t\t\t\tname: \"_socialName\",\n\t\t\t\ttype: \"string\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tcomponents: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"string\",\n\t\t\t\t\t\t\t\tname: \"provider\",\n\t\t\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"string\",\n\t\t\t\t\t\t\t\tname: \"parameters\",\n\t\t\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"string\",\n\t\t\t\t\t\t\t\tname: \"context\",\n\t\t\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tinternalType: \"struct IReclaimSDK.ClaimInfo\",\n\t\t\t\t\t\tname: \"claimInfo\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tinternalType: \"bytes32\",\n\t\t\t\t\t\t\t\t\t\tname: \"identifier\",\n\t\t\t\t\t\t\t\t\t\ttype: \"bytes32\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tinternalType: \"address\",\n\t\t\t\t\t\t\t\t\t\tname: \"owner\",\n\t\t\t\t\t\t\t\t\t\ttype: \"address\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tinternalType: \"uint32\",\n\t\t\t\t\t\t\t\t\t\tname: \"timestampS\",\n\t\t\t\t\t\t\t\t\t\ttype: \"uint32\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tinternalType: \"uint32\",\n\t\t\t\t\t\t\t\t\t\tname: \"epoch\",\n\t\t\t\t\t\t\t\t\t\ttype: \"uint32\",\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tinternalType: \"struct IReclaimSDK.CompleteClaimData\",\n\t\t\t\t\t\t\t\tname: \"claim\",\n\t\t\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"bytes[]\",\n\t\t\t\t\t\t\t\tname: \"signatures\",\n\t\t\t\t\t\t\t\ttype: \"bytes[]\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tinternalType: \"struct IReclaimSDK.SignedClaim\",\n\t\t\t\t\t\tname: \"signedClaim\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tinternalType: \"struct IReclaimSDK.Proof[]\",\n\t\t\t\tname: \"proofs\",\n\t\t\t\ttype: \"tuple[]\",\n\t\t\t},\n\t\t],\n\t\tname: \"socialVerify\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tinternalType: \"uint256\",\n\t\t\t\tname: \"nullifierSeed\",\n\t\t\t\ttype: \"uint256\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"uint256\",\n\t\t\t\tname: \"nullifier\",\n\t\t\t\ttype: \"uint256\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"uint256\",\n\t\t\t\tname: \"timestamp\",\n\t\t\t\ttype: \"uint256\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"uint256\",\n\t\t\t\tname: \"signal\",\n\t\t\t\ttype: \"uint256\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"uint256[4]\",\n\t\t\t\tname: \"revealArray\",\n\t\t\t\ttype: \"uint256[4]\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"uint256[8]\",\n\t\t\t\tname: \"groth16Proof\",\n\t\t\t\ttype: \"uint256[8]\",\n\t\t\t},\n\t\t],\n\t\tname: \"submitAnonAadharProof\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n\t{\n\t\tinputs: [\n\t\t\t{\n\t\t\t\tcomponents: [\n\t\t\t\t\t{\n\t\t\t\t\t\tinternalType: \"bytes32\",\n\t\t\t\t\t\tname: \"version\",\n\t\t\t\t\t\ttype: \"bytes32\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"bytes32\",\n\t\t\t\t\t\t\t\tname: \"vkeyHash\",\n\t\t\t\t\t\t\t\ttype: \"bytes32\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"bytes\",\n\t\t\t\t\t\t\t\tname: \"proof\",\n\t\t\t\t\t\t\t\ttype: \"bytes\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"bytes32[]\",\n\t\t\t\t\t\t\t\tname: \"publicInputs\",\n\t\t\t\t\t\t\t\ttype: \"bytes32[]\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tinternalType: \"struct ProofVerificationData\",\n\t\t\t\t\t\tname: \"proofVerificationData\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tinternalType: \"bytes\",\n\t\t\t\t\t\tname: \"committedInputs\",\n\t\t\t\t\t\ttype: \"bytes\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tcomponents: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"uint256\",\n\t\t\t\t\t\t\t\tname: \"validityPeriodInSeconds\",\n\t\t\t\t\t\t\t\ttype: \"uint256\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"string\",\n\t\t\t\t\t\t\t\tname: \"domain\",\n\t\t\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"string\",\n\t\t\t\t\t\t\t\tname: \"scope\",\n\t\t\t\t\t\t\t\ttype: \"string\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tinternalType: \"bool\",\n\t\t\t\t\t\t\t\tname: \"devMode\",\n\t\t\t\t\t\t\t\ttype: \"bool\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tinternalType: \"struct ServiceConfig\",\n\t\t\t\t\t\tname: \"serviceConfig\",\n\t\t\t\t\t\ttype: \"tuple\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tinternalType: \"struct ProofVerificationParams\",\n\t\t\t\tname: \"params\",\n\t\t\t\ttype: \"tuple\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tinternalType: \"bool\",\n\t\t\t\tname: \"isIDCard\",\n\t\t\t\ttype: \"bool\",\n\t\t\t},\n\t\t],\n\t\tname: \"zkPassportRegister\",\n\t\toutputs: [],\n\t\tstateMutability: \"nonpayable\",\n\t\ttype: \"function\",\n\t},\n] as const;\n","import { okAsync, type ResultAsync } from \"neverthrow\";\nimport { type Address, encodeFunctionData } from \"viem\";\nimport { ABIS } from \"../../contracts/abis\";\nimport type { PublicClientLike } from \"../../types\";\nimport { StakeError } from \"../errors\";\nimport { submitPreparedTx } from \"../tx\";\nimport type { ExecuteBase, PreparedTx, TxResult } from \"../types\";\n\nexport interface ClaimUnstakeAction {\n\tprepare(): ResultAsync<PreparedTx, StakeError>;\n\texecute(params: ExecuteBase): ResultAsync<TxResult, StakeError>;\n}\n\nexport interface CreateClaimUnstakeInput {\n\treadonly publicClient: PublicClientLike;\n\treadonly diamondAddress: Address;\n}\n\n/**\n * Creates a claimUnstake action that encodes `p2pBoostClaimUnstake()` in\n * `prepare` and submits it via the consumer's WalletClient in `execute`.\n * Claimable only after the cooldown period has elapsed.\n */\nexport function createClaimUnstakeAction(input: CreateClaimUnstakeInput): ClaimUnstakeAction {\n\tconst { publicClient, diamondAddress } = input;\n\n\tconst prepareFn = (): ResultAsync<PreparedTx, StakeError> =>\n\t\tokAsync<PreparedTx, StakeError>({\n\t\t\tto: diamondAddress,\n\t\t\tdata: encodeFunctionData({\n\t\t\t\tabi: ABIS.FACETS.STAKE,\n\t\t\t\tfunctionName: \"p2pBoostClaimUnstake\",\n\t\t\t\targs: [],\n\t\t\t}),\n\t\t\tvalue: 0n,\n\t\t});\n\n\treturn {\n\t\tprepare() {\n\t\t\treturn prepareFn();\n\t\t},\n\t\texecute({ walletClient, waitForReceipt }) {\n\t\t\treturn prepareFn().andThen((prepared) =>\n\t\t\t\tsubmitPreparedTx({ prepared, walletClient, publicClient, waitForReceipt }),\n\t\t\t);\n\t\t},\n\t};\n}\n","import { errAsync, okAsync, ResultAsync } from \"neverthrow\";\nimport type { Account, Chain, Hash, TransactionReceipt, WalletClient } from \"viem\";\nimport type { PublicClientLike } from \"../types\";\nimport { StakeError } from \"./errors\";\nimport type { PreparedTx, TxResult } from \"./types\";\n\n/**\n * Submits a prepared tx through the consumer's WalletClient and, if requested,\n * waits for its receipt. Maps viem rejections to `TX_SUBMISSION_FAILED`, timeouts\n * to `RECEIPT_TIMEOUT`, and non-success receipts to `TX_REVERTED`.\n */\nexport function submitPreparedTx(input: {\n\treadonly prepared: PreparedTx;\n\treadonly walletClient: WalletClient;\n\treadonly publicClient: PublicClientLike;\n\treadonly waitForReceipt?: boolean;\n}): ResultAsync<TxResult, StakeError> {\n\tconst { prepared, walletClient, publicClient, waitForReceipt } = input;\n\n\tconst account = walletClient.account as Account | undefined;\n\tif (!account) {\n\t\treturn errAsync(\n\t\t\tnew StakeError(\"WalletClient is missing an account\", {\n\t\t\t\tcode: \"TX_SUBMISSION_FAILED\",\n\t\t\t}),\n\t\t);\n\t}\n\n\tconst chain = walletClient.chain as Chain | undefined;\n\n\treturn ResultAsync.fromPromise(\n\t\twalletClient.sendTransaction({\n\t\t\taccount,\n\t\t\tchain,\n\t\t\tto: prepared.to,\n\t\t\tdata: prepared.data,\n\t\t\tvalue: prepared.value,\n\t\t}),\n\t\t(cause) =>\n\t\t\tnew StakeError(\"walletClient.sendTransaction rejected\", {\n\t\t\t\tcode: \"TX_SUBMISSION_FAILED\",\n\t\t\t\tcause,\n\t\t\t}),\n\t).andThen((hash: Hash) => {\n\t\tif (!waitForReceipt) {\n\t\t\treturn okAsync<TxResult, StakeError>({ hash });\n\t\t}\n\n\t\treturn ResultAsync.fromPromise(\n\t\t\t(\n\t\t\t\tpublicClient as unknown as {\n\t\t\t\t\twaitForTransactionReceipt: (args: { hash: Hash }) => Promise<TransactionReceipt>;\n\t\t\t\t}\n\t\t\t).waitForTransactionReceipt({ hash }),\n\t\t\t(cause) =>\n\t\t\t\tnew StakeError(\"waitForTransactionReceipt failed\", {\n\t\t\t\t\tcode: \"RECEIPT_TIMEOUT\",\n\t\t\t\t\tcause,\n\t\t\t\t}),\n\t\t).andThen((receipt) => {\n\t\t\tif (receipt.status !== \"success\") {\n\t\t\t\treturn errAsync(\n\t\t\t\t\tnew StakeError(\"Transaction reverted\", {\n\t\t\t\t\t\tcode: \"TX_REVERTED\",\n\t\t\t\t\t\tcontext: { hash, blockNumber: receipt.blockNumber.toString() },\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn okAsync<TxResult, StakeError>({ hash, receipt });\n\t\t});\n\t});\n}\n","import { okAsync, type ResultAsync } from \"neverthrow\";\nimport { type Address, encodeFunctionData } from \"viem\";\nimport { ABIS } from \"../../contracts/abis\";\nimport type { PublicClientLike } from \"../../types\";\nimport { StakeError } from \"../errors\";\nimport { submitPreparedTx } from \"../tx\";\nimport type { ExecuteBase, PreparedTx, TxResult } from \"../types\";\n\nexport interface RequestUnstakeAction {\n\tprepare(): ResultAsync<PreparedTx, StakeError>;\n\texecute(params: ExecuteBase): ResultAsync<TxResult, StakeError>;\n}\n\nexport interface CreateRequestUnstakeInput {\n\treadonly publicClient: PublicClientLike;\n\treadonly diamondAddress: Address;\n}\n\n/**\n * Creates a requestUnstake action that encodes `p2pBoostRequestUnstake()` in\n * `prepare` and submits it via the consumer's WalletClient in `execute`.\n * Starts the unstake cooldown for the caller's active stake.\n */\nexport function createRequestUnstakeAction(\n\tinput: CreateRequestUnstakeInput,\n): RequestUnstakeAction {\n\tconst { publicClient, diamondAddress } = input;\n\n\tconst prepareFn = (): ResultAsync<PreparedTx, StakeError> =>\n\t\tokAsync<PreparedTx, StakeError>({\n\t\t\tto: diamondAddress,\n\t\t\tdata: encodeFunctionData({\n\t\t\t\tabi: ABIS.FACETS.STAKE,\n\t\t\t\tfunctionName: \"p2pBoostRequestUnstake\",\n\t\t\t\targs: [],\n\t\t\t}),\n\t\t\tvalue: 0n,\n\t\t});\n\n\treturn {\n\t\tprepare() {\n\t\t\treturn prepareFn();\n\t\t},\n\t\texecute({ walletClient, waitForReceipt }) {\n\t\t\treturn prepareFn().andThen((prepared) =>\n\t\t\t\tsubmitPreparedTx({ prepared, walletClient, publicClient, waitForReceipt }),\n\t\t\t);\n\t\t},\n\t};\n}\n","import type { ResultAsync } from \"neverthrow\";\nimport { type Address, encodeFunctionData } from \"viem\";\nimport { ABIS } from \"../../contracts/abis\";\nimport type { PublicClientLike } from \"../../types\";\nimport { validate } from \"../../validation\";\nimport { StakeError } from \"../errors\";\nimport { submitPreparedTx } from \"../tx\";\nimport type { ExecuteBase, PreparedTx, TxResult } from \"../types\";\nimport { type StakeParams, ZodStakeParamsSchema } from \"../validation\";\n\nexport interface StakeAction {\n\tprepare(params: StakeParams): ResultAsync<PreparedTx, StakeError>;\n\texecute(params: StakeParams & ExecuteBase): ResultAsync<TxResult, StakeError>;\n}\n\nexport interface CreateStakeInput {\n\treadonly publicClient: PublicClientLike;\n\treadonly diamondAddress: Address;\n}\n\n/**\n * Creates a stake action that encodes `p2pBoostStake(tokens)` in `prepare` and\n * submits it via the consumer's WalletClient in `execute`.\n */\nexport function createStakeAction(input: CreateStakeInput): StakeAction {\n\tconst { publicClient, diamondAddress } = input;\n\n\tconst prepareFn = (params: StakeParams) =>\n\t\tvalidate(\n\t\t\tZodStakeParamsSchema,\n\t\t\tparams,\n\t\t\t(message, cause, data) =>\n\t\t\t\tnew StakeError(message, {\n\t\t\t\t\tcode: \"VALIDATION_ERROR\",\n\t\t\t\t\tcause,\n\t\t\t\t\tcontext: { data },\n\t\t\t\t}),\n\t\t).map<PreparedTx>(({ tokens }) => ({\n\t\t\tto: diamondAddress,\n\t\t\tdata: encodeFunctionData({\n\t\t\t\tabi: ABIS.FACETS.STAKE,\n\t\t\t\tfunctionName: \"p2pBoostStake\",\n\t\t\t\targs: [tokens],\n\t\t\t}),\n\t\t\tvalue: 0n,\n\t\t}));\n\n\treturn {\n\t\tprepare(params) {\n\t\t\treturn prepareFn(params).asyncMap(async (tx) => tx);\n\t\t},\n\t\texecute({ walletClient, waitForReceipt, ...params }) {\n\t\t\treturn prepareFn(params).asyncAndThen((prepared) =>\n\t\t\t\tsubmitPreparedTx({ prepared, walletClient, publicClient, waitForReceipt }),\n\t\t\t);\n\t\t},\n\t};\n}\n","import type { ResultAsync } from \"neverthrow\";\nimport { type Address, encodeFunctionData } from \"viem\";\nimport { ABIS } from \"../../contracts/abis\";\nimport type { PublicClientLike } from \"../../types\";\nimport { validate } from \"../../validation\";\nimport { StakeError } from \"../errors\";\nimport { submitPreparedTx } from \"../tx\";\nimport type { ExecuteBase, PreparedTx, TxResult } from \"../types\";\nimport { type TopUpParams, ZodTopUpParamsSchema } from \"../validation\";\n\nexport interface TopUpAction {\n\tprepare(params: TopUpParams): ResultAsync<PreparedTx, StakeError>;\n\texecute(params: TopUpParams & ExecuteBase): ResultAsync<TxResult, StakeError>;\n}\n\nexport interface CreateTopUpInput {\n\treadonly publicClient: PublicClientLike;\n\treadonly diamondAddress: Address;\n}\n\n/**\n * Creates a topUp action that encodes `p2pBoostTopUp(tokens)` in `prepare` and\n * submits it via the consumer's WalletClient in `execute`.\n */\nexport function createTopUpAction(input: CreateTopUpInput): TopUpAction {\n\tconst { publicClient, diamondAddress } = input;\n\n\tconst prepareFn = (params: TopUpParams) =>\n\t\tvalidate(\n\t\t\tZodTopUpParamsSchema,\n\t\t\tparams,\n\t\t\t(message, cause, data) =>\n\t\t\t\tnew StakeError(message, {\n\t\t\t\t\tcode: \"VALIDATION_ERROR\",\n\t\t\t\t\tcause,\n\t\t\t\t\tcontext: { data },\n\t\t\t\t}),\n\t\t).map<PreparedTx>(({ tokens }) => ({\n\t\t\tto: diamondAddress,\n\t\t\tdata: encodeFunctionData({\n\t\t\t\tabi: ABIS.FACETS.STAKE,\n\t\t\t\tfunctionName: \"p2pBoostTopUp\",\n\t\t\t\targs: [tokens],\n\t\t\t}),\n\t\t\tvalue: 0n,\n\t\t}));\n\n\treturn {\n\t\tprepare(params) {\n\t\t\treturn prepareFn(params).asyncMap(async (tx) => tx);\n\t\t},\n\t\texecute({ walletClient, waitForReceipt, ...params }) {\n\t\t\treturn prepareFn(params).asyncAndThen((prepared) =>\n\t\t\t\tsubmitPreparedTx({ prepared, walletClient, publicClient, waitForReceipt }),\n\t\t\t);\n\t\t},\n\t};\n}\n","import type {\n\tRawStakeBoostGlobals,\n\tRawUserStake,\n\tStakeBoostGlobals,\n\tStakeStatus,\n\tUserStake,\n} from \"./types\";\n\nconst STATUS_MAP: Record<number, StakeStatus> = {\n\t0: \"none\",\n\t1: \"active\",\n\t2: \"cooldown\",\n\t3: \"seized\",\n};\n\n/** Normalizes the raw on-chain stake tuple into a typed `UserStake`. */\nexport function normalizeUserStake(raw: RawUserStake): UserStake {\n\treturn {\n\t\tstakedAmount: raw.stakedAmount,\n\t\tcooldownEnd: raw.cooldownEnd,\n\t\tstatus: STATUS_MAP[raw.status] ?? \"none\",\n\t};\n}\n\n/** Normalizes the raw positional tuple from `getStakeBoostGlobals` into a struct. */\nexport function normalizeStakeBoostGlobals(raw: RawStakeBoostGlobals): StakeBoostGlobals {\n\tconst [\n\t\tp2pToken,\n\t\tfraudReserve,\n\t\tmaxStakeTokens,\n\t\tnormalCooldown,\n\t\tblacklistCooldown,\n\t\ttokenDecimals,\n\t\ttotalStaked,\n\t] = raw;\n\treturn {\n\t\tp2pToken,\n\t\tfraudReserve,\n\t\tmaxStakeTokens,\n\t\tnormalCooldown,\n\t\tblacklistCooldown,\n\t\ttokenDecimals,\n\t\ttotalStaked,\n\t};\n}\n","import type { ResultAsync } from \"neverthrow\";\nimport {\n\tgetP2pTokenBalance,\n\tgetStakeBoostConfig,\n\tgetStakeBoostGlobals,\n\tgetUserStake,\n} from \"../contracts/p2p-stake\";\nimport { type ClaimUnstakeAction, createClaimUnstakeAction } from \"./actions/claim-unstake\";\nimport {\n\tcreateRequestUnstakeAction,\n\ttype RequestUnstakeAction,\n} from \"./actions/request-unstake\";\nimport { createStakeAction, type StakeAction } from \"./actions/stake\";\nimport { createTopUpAction, type TopUpAction } from \"./actions/top-up\";\nimport type { StakeError } from \"./errors\";\nimport { normalizeStakeBoostGlobals, normalizeUserStake } from \"./normalize\";\nimport type { StakeBoostConfig, StakeBoostGlobals, StakeConfig, UserStake } from \"./types\";\nimport type {\n\tGetP2pTokenBalanceParams,\n\tGetStakeBoostConfigParams,\n\tGetUserStakeParams,\n} from \"./validation\";\n\nexport interface StakeClient {\n\t// ── Reads ───────────────────────────────────────────────────────────\n\n\t/** Reads the on-chain stake record for a user (stakedAmount, cooldownEnd, status). */\n\tgetUserStake(params: GetUserStakeParams): ResultAsync<UserStake, StakeError>;\n\n\t/** Reads the per-currency stake boost config (tokens-per-USD, max boost). */\n\tgetStakeBoostConfig(\n\t\tparams: GetStakeBoostConfigParams,\n\t): ResultAsync<StakeBoostConfig, StakeError>;\n\n\t/** Reads global stake boost configuration (token addr, cooldowns, totals). */\n\tgetStakeBoostGlobals(): ResultAsync<StakeBoostGlobals, StakeError>;\n\n\t/** Reads the P2P token (ERC20) balance for a given address (raw bigint). */\n\tgetP2pTokenBalance(params: GetP2pTokenBalanceParams): ResultAsync<bigint, StakeError>;\n\n\t// ── Writes (layered prepare/execute) ────────────────────────────────\n\n\treadonly stake: StakeAction;\n\treadonly topUp: TopUpAction;\n\treadonly requestUnstake: RequestUnstakeAction;\n\treadonly claimUnstake: ClaimUnstakeAction;\n}\n\n/**\n * Creates the P2P token stake client — exposes a read for the user's stake and\n * prepare/execute write pairs for stake, topUp, requestUnstake, and claimUnstake.\n */\nexport function createStake(config: StakeConfig): StakeClient {\n\tconst { publicClient, diamondAddress, p2pTokenAddress } = config;\n\n\treturn {\n\t\tgetUserStake: (params) =>\n\t\t\tgetUserStake(publicClient, diamondAddress, params).map(normalizeUserStake),\n\n\t\tgetStakeBoostConfig: (params) => getStakeBoostConfig(publicClient, diamondAddress, params),\n\n\t\tgetStakeBoostGlobals: () =>\n\t\t\tgetStakeBoostGlobals(publicClient, diamondAddress).map(normalizeStakeBoostGlobals),\n\n\t\tgetP2pTokenBalance: (params) => getP2pTokenBalance(publicClient, p2pTokenAddress, params),\n\n\t\tstake: createStakeAction({ publicClient, diamondAddress }),\n\t\ttopUp: createTopUpAction({ publicClient, diamondAddress }),\n\t\trequestUnstake: createRequestUnstakeAction({ publicClient, diamondAddress }),\n\t\tclaimUnstake: createClaimUnstakeAction({ publicClient, diamondAddress }),\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,qBAA4B;AAC5B,IA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ACzD,OAAO,kBAAkB,EAAE,cAAc,eAAe,CAAC;AAAA,IACzD,gBAAgB,2BAA2B,EAAE,cAAc,eAAe,CAAC;AAAA,IAC3E,cAAc,yBAAyB,EAAE,cAAc,eAAe,CAAC;AAAA,EACxE;AACD;","names":["import_neverthrow","import_viem","import_zod","import_viem","import_neverthrow","import_viem","import_neverthrow","import_neverthrow","import_viem","import_viem","import_viem"]}
@@ -0,0 +1,191 @@
1
+ import { ResultAsync } from 'neverthrow';
2
+ import { Address, WalletClient, TransactionReceipt } from 'viem';
3
+ import { z } from 'zod';
4
+
5
+ /**
6
+ * Minimal viem PublicClient interface — consumers pass their own client.
7
+ * The SDK uses `readContract` for single reads and `multicall` where available
8
+ * to batch multiple reads into one RPC round-trip.
9
+ */
10
+ interface PublicClientLike {
11
+ readContract(args: {
12
+ address: Address;
13
+ abi: readonly unknown[];
14
+ functionName: string;
15
+ args: readonly unknown[];
16
+ }): Promise<unknown>;
17
+ multicall?(args: {
18
+ contracts: readonly {
19
+ address: Address;
20
+ abi: readonly unknown[];
21
+ functionName: string;
22
+ args?: readonly unknown[];
23
+ }[];
24
+ allowFailure?: boolean;
25
+ }): Promise<readonly unknown[]>;
26
+ }
27
+
28
+ declare class SdkError<TCode extends string = string> extends Error {
29
+ readonly code: TCode;
30
+ readonly cause?: unknown;
31
+ readonly context?: Record<string, unknown>;
32
+ constructor(message: string, options: {
33
+ code: TCode;
34
+ cause?: unknown;
35
+ context?: Record<string, unknown>;
36
+ });
37
+ }
38
+
39
+ type StakeErrorCode = "VALIDATION_ERROR" | "CONTRACT_READ_ERROR" | "TX_SUBMISSION_FAILED" | "RECEIPT_TIMEOUT" | "TX_REVERTED";
40
+ declare class StakeError extends SdkError<StakeErrorCode> {
41
+ constructor(message: string, options: {
42
+ code: StakeErrorCode;
43
+ cause?: unknown;
44
+ context?: Record<string, unknown>;
45
+ });
46
+ }
47
+
48
+ declare const ZodGetUserStakeParamsSchema: z.ZodObject<{
49
+ user: z.ZodString & z.ZodType<`0x${string}`, string, z.core.$ZodTypeInternals<`0x${string}`, string>>;
50
+ }, z.core.$strip>;
51
+ type GetUserStakeParams = z.infer<typeof ZodGetUserStakeParamsSchema>;
52
+ declare const ZodGetStakeBoostConfigParamsSchema: z.ZodObject<{
53
+ currency: z.ZodEnum<{
54
+ IDR: "IDR";
55
+ INR: "INR";
56
+ BRL: "BRL";
57
+ ARS: "ARS";
58
+ MEX: "MEX";
59
+ VEN: "VEN";
60
+ EUR: "EUR";
61
+ NGN: "NGN";
62
+ USD: "USD";
63
+ COP: "COP";
64
+ }>;
65
+ }, z.core.$strip>;
66
+ type GetStakeBoostConfigParams = z.infer<typeof ZodGetStakeBoostConfigParamsSchema>;
67
+ declare const ZodGetP2pTokenBalanceParamsSchema: z.ZodObject<{
68
+ address: z.ZodString & z.ZodType<`0x${string}`, string, z.core.$ZodTypeInternals<`0x${string}`, string>>;
69
+ }, z.core.$strip>;
70
+ type GetP2pTokenBalanceParams = z.infer<typeof ZodGetP2pTokenBalanceParamsSchema>;
71
+ declare const ZodStakeParamsSchema: z.ZodObject<{
72
+ tokens: z.ZodBigInt;
73
+ }, z.core.$strip>;
74
+ type StakeParams = z.infer<typeof ZodStakeParamsSchema>;
75
+ declare const ZodTopUpParamsSchema: z.ZodObject<{
76
+ tokens: z.ZodBigInt;
77
+ }, z.core.$strip>;
78
+ type TopUpParams = z.infer<typeof ZodTopUpParamsSchema>;
79
+
80
+ interface StakeConfig {
81
+ readonly publicClient: PublicClientLike;
82
+ readonly diamondAddress: Address;
83
+ readonly p2pTokenAddress: Address;
84
+ }
85
+ /**
86
+ * Stake lifecycle state for a user.
87
+ * 0 — None: no active stake.
88
+ * 1 — Active: stake is live.
89
+ * 2 — CooldownRequested: unstake requested; awaiting cooldown end.
90
+ * 3 — Seized: stake was forcefully seized.
91
+ */
92
+ type StakeStatus = "none" | "active" | "cooldown" | "seized";
93
+ /** Normalized on-chain stake record for a user. */
94
+ interface UserStake {
95
+ /** Currently staked token amount (raw bigint, token decimals). */
96
+ readonly stakedAmount: bigint;
97
+ /** Unix seconds when cooldown ends (0 if not in cooldown). */
98
+ readonly cooldownEnd: bigint;
99
+ /** Lifecycle status decoded from the on-chain enum. */
100
+ readonly status: StakeStatus;
101
+ }
102
+ /** Raw tuple returned by `getUserStake` before normalization. */
103
+ interface RawUserStake {
104
+ readonly stakedAmount: bigint;
105
+ readonly cooldownEnd: bigint;
106
+ readonly status: number;
107
+ }
108
+ /**
109
+ * Per-currency boost config — how many tokens map to 1 USD of boost, and the
110
+ * cap on USD-denominated boost a stake can unlock.
111
+ */
112
+ interface StakeBoostConfig {
113
+ readonly tokensPerUsdNumerator: bigint;
114
+ readonly tokensPerUsdDenominator: bigint;
115
+ readonly maxBoostUsd: bigint;
116
+ }
117
+ /** Global stake boost configuration shared across all users. */
118
+ interface StakeBoostGlobals {
119
+ readonly p2pToken: Address;
120
+ readonly fraudReserve: Address;
121
+ readonly maxStakeTokens: bigint;
122
+ readonly normalCooldown: bigint;
123
+ readonly blacklistCooldown: bigint;
124
+ readonly tokenDecimals: number;
125
+ readonly totalStaked: bigint;
126
+ }
127
+ /** Raw tuple returned by `getStakeBoostGlobals` before normalization. */
128
+ type RawStakeBoostGlobals = readonly [
129
+ Address,
130
+ Address,
131
+ bigint,
132
+ bigint,
133
+ bigint,
134
+ number,
135
+ bigint
136
+ ];
137
+ interface PreparedTx {
138
+ readonly to: `0x${string}`;
139
+ readonly data: `0x${string}`;
140
+ readonly value: bigint;
141
+ }
142
+ interface TxResult {
143
+ readonly hash: `0x${string}`;
144
+ readonly receipt?: TransactionReceipt;
145
+ }
146
+ interface ExecuteBase {
147
+ readonly walletClient: WalletClient;
148
+ readonly waitForReceipt?: boolean;
149
+ }
150
+
151
+ interface ClaimUnstakeAction {
152
+ prepare(): ResultAsync<PreparedTx, StakeError>;
153
+ execute(params: ExecuteBase): ResultAsync<TxResult, StakeError>;
154
+ }
155
+
156
+ interface RequestUnstakeAction {
157
+ prepare(): ResultAsync<PreparedTx, StakeError>;
158
+ execute(params: ExecuteBase): ResultAsync<TxResult, StakeError>;
159
+ }
160
+
161
+ interface StakeAction {
162
+ prepare(params: StakeParams): ResultAsync<PreparedTx, StakeError>;
163
+ execute(params: StakeParams & ExecuteBase): ResultAsync<TxResult, StakeError>;
164
+ }
165
+
166
+ interface TopUpAction {
167
+ prepare(params: TopUpParams): ResultAsync<PreparedTx, StakeError>;
168
+ execute(params: TopUpParams & ExecuteBase): ResultAsync<TxResult, StakeError>;
169
+ }
170
+
171
+ interface StakeClient {
172
+ /** Reads the on-chain stake record for a user (stakedAmount, cooldownEnd, status). */
173
+ getUserStake(params: GetUserStakeParams): ResultAsync<UserStake, StakeError>;
174
+ /** Reads the per-currency stake boost config (tokens-per-USD, max boost). */
175
+ getStakeBoostConfig(params: GetStakeBoostConfigParams): ResultAsync<StakeBoostConfig, StakeError>;
176
+ /** Reads global stake boost configuration (token addr, cooldowns, totals). */
177
+ getStakeBoostGlobals(): ResultAsync<StakeBoostGlobals, StakeError>;
178
+ /** Reads the P2P token (ERC20) balance for a given address (raw bigint). */
179
+ getP2pTokenBalance(params: GetP2pTokenBalanceParams): ResultAsync<bigint, StakeError>;
180
+ readonly stake: StakeAction;
181
+ readonly topUp: TopUpAction;
182
+ readonly requestUnstake: RequestUnstakeAction;
183
+ readonly claimUnstake: ClaimUnstakeAction;
184
+ }
185
+ /**
186
+ * Creates the P2P token stake client — exposes a read for the user's stake and
187
+ * prepare/execute write pairs for stake, topUp, requestUnstake, and claimUnstake.
188
+ */
189
+ declare function createStake(config: StakeConfig): StakeClient;
190
+
191
+ export { type ExecuteBase, type GetP2pTokenBalanceParams, type GetStakeBoostConfigParams, type GetUserStakeParams, type PreparedTx, type RawStakeBoostGlobals, type RawUserStake, type StakeBoostConfig, type StakeBoostGlobals, type StakeClient, type StakeConfig, StakeError, type StakeErrorCode, type StakeParams, type StakeStatus, type TopUpParams, type TxResult, type UserStake, createStake };
@@ -0,0 +1,191 @@
1
+ import { ResultAsync } from 'neverthrow';
2
+ import { Address, WalletClient, TransactionReceipt } from 'viem';
3
+ import { z } from 'zod';
4
+
5
+ /**
6
+ * Minimal viem PublicClient interface — consumers pass their own client.
7
+ * The SDK uses `readContract` for single reads and `multicall` where available
8
+ * to batch multiple reads into one RPC round-trip.
9
+ */
10
+ interface PublicClientLike {
11
+ readContract(args: {
12
+ address: Address;
13
+ abi: readonly unknown[];
14
+ functionName: string;
15
+ args: readonly unknown[];
16
+ }): Promise<unknown>;
17
+ multicall?(args: {
18
+ contracts: readonly {
19
+ address: Address;
20
+ abi: readonly unknown[];
21
+ functionName: string;
22
+ args?: readonly unknown[];
23
+ }[];
24
+ allowFailure?: boolean;
25
+ }): Promise<readonly unknown[]>;
26
+ }
27
+
28
+ declare class SdkError<TCode extends string = string> extends Error {
29
+ readonly code: TCode;
30
+ readonly cause?: unknown;
31
+ readonly context?: Record<string, unknown>;
32
+ constructor(message: string, options: {
33
+ code: TCode;
34
+ cause?: unknown;
35
+ context?: Record<string, unknown>;
36
+ });
37
+ }
38
+
39
+ type StakeErrorCode = "VALIDATION_ERROR" | "CONTRACT_READ_ERROR" | "TX_SUBMISSION_FAILED" | "RECEIPT_TIMEOUT" | "TX_REVERTED";
40
+ declare class StakeError extends SdkError<StakeErrorCode> {
41
+ constructor(message: string, options: {
42
+ code: StakeErrorCode;
43
+ cause?: unknown;
44
+ context?: Record<string, unknown>;
45
+ });
46
+ }
47
+
48
+ declare const ZodGetUserStakeParamsSchema: z.ZodObject<{
49
+ user: z.ZodString & z.ZodType<`0x${string}`, string, z.core.$ZodTypeInternals<`0x${string}`, string>>;
50
+ }, z.core.$strip>;
51
+ type GetUserStakeParams = z.infer<typeof ZodGetUserStakeParamsSchema>;
52
+ declare const ZodGetStakeBoostConfigParamsSchema: z.ZodObject<{
53
+ currency: z.ZodEnum<{
54
+ IDR: "IDR";
55
+ INR: "INR";
56
+ BRL: "BRL";
57
+ ARS: "ARS";
58
+ MEX: "MEX";
59
+ VEN: "VEN";
60
+ EUR: "EUR";
61
+ NGN: "NGN";
62
+ USD: "USD";
63
+ COP: "COP";
64
+ }>;
65
+ }, z.core.$strip>;
66
+ type GetStakeBoostConfigParams = z.infer<typeof ZodGetStakeBoostConfigParamsSchema>;
67
+ declare const ZodGetP2pTokenBalanceParamsSchema: z.ZodObject<{
68
+ address: z.ZodString & z.ZodType<`0x${string}`, string, z.core.$ZodTypeInternals<`0x${string}`, string>>;
69
+ }, z.core.$strip>;
70
+ type GetP2pTokenBalanceParams = z.infer<typeof ZodGetP2pTokenBalanceParamsSchema>;
71
+ declare const ZodStakeParamsSchema: z.ZodObject<{
72
+ tokens: z.ZodBigInt;
73
+ }, z.core.$strip>;
74
+ type StakeParams = z.infer<typeof ZodStakeParamsSchema>;
75
+ declare const ZodTopUpParamsSchema: z.ZodObject<{
76
+ tokens: z.ZodBigInt;
77
+ }, z.core.$strip>;
78
+ type TopUpParams = z.infer<typeof ZodTopUpParamsSchema>;
79
+
80
+ interface StakeConfig {
81
+ readonly publicClient: PublicClientLike;
82
+ readonly diamondAddress: Address;
83
+ readonly p2pTokenAddress: Address;
84
+ }
85
+ /**
86
+ * Stake lifecycle state for a user.
87
+ * 0 — None: no active stake.
88
+ * 1 — Active: stake is live.
89
+ * 2 — CooldownRequested: unstake requested; awaiting cooldown end.
90
+ * 3 — Seized: stake was forcefully seized.
91
+ */
92
+ type StakeStatus = "none" | "active" | "cooldown" | "seized";
93
+ /** Normalized on-chain stake record for a user. */
94
+ interface UserStake {
95
+ /** Currently staked token amount (raw bigint, token decimals). */
96
+ readonly stakedAmount: bigint;
97
+ /** Unix seconds when cooldown ends (0 if not in cooldown). */
98
+ readonly cooldownEnd: bigint;
99
+ /** Lifecycle status decoded from the on-chain enum. */
100
+ readonly status: StakeStatus;
101
+ }
102
+ /** Raw tuple returned by `getUserStake` before normalization. */
103
+ interface RawUserStake {
104
+ readonly stakedAmount: bigint;
105
+ readonly cooldownEnd: bigint;
106
+ readonly status: number;
107
+ }
108
+ /**
109
+ * Per-currency boost config — how many tokens map to 1 USD of boost, and the
110
+ * cap on USD-denominated boost a stake can unlock.
111
+ */
112
+ interface StakeBoostConfig {
113
+ readonly tokensPerUsdNumerator: bigint;
114
+ readonly tokensPerUsdDenominator: bigint;
115
+ readonly maxBoostUsd: bigint;
116
+ }
117
+ /** Global stake boost configuration shared across all users. */
118
+ interface StakeBoostGlobals {
119
+ readonly p2pToken: Address;
120
+ readonly fraudReserve: Address;
121
+ readonly maxStakeTokens: bigint;
122
+ readonly normalCooldown: bigint;
123
+ readonly blacklistCooldown: bigint;
124
+ readonly tokenDecimals: number;
125
+ readonly totalStaked: bigint;
126
+ }
127
+ /** Raw tuple returned by `getStakeBoostGlobals` before normalization. */
128
+ type RawStakeBoostGlobals = readonly [
129
+ Address,
130
+ Address,
131
+ bigint,
132
+ bigint,
133
+ bigint,
134
+ number,
135
+ bigint
136
+ ];
137
+ interface PreparedTx {
138
+ readonly to: `0x${string}`;
139
+ readonly data: `0x${string}`;
140
+ readonly value: bigint;
141
+ }
142
+ interface TxResult {
143
+ readonly hash: `0x${string}`;
144
+ readonly receipt?: TransactionReceipt;
145
+ }
146
+ interface ExecuteBase {
147
+ readonly walletClient: WalletClient;
148
+ readonly waitForReceipt?: boolean;
149
+ }
150
+
151
+ interface ClaimUnstakeAction {
152
+ prepare(): ResultAsync<PreparedTx, StakeError>;
153
+ execute(params: ExecuteBase): ResultAsync<TxResult, StakeError>;
154
+ }
155
+
156
+ interface RequestUnstakeAction {
157
+ prepare(): ResultAsync<PreparedTx, StakeError>;
158
+ execute(params: ExecuteBase): ResultAsync<TxResult, StakeError>;
159
+ }
160
+
161
+ interface StakeAction {
162
+ prepare(params: StakeParams): ResultAsync<PreparedTx, StakeError>;
163
+ execute(params: StakeParams & ExecuteBase): ResultAsync<TxResult, StakeError>;
164
+ }
165
+
166
+ interface TopUpAction {
167
+ prepare(params: TopUpParams): ResultAsync<PreparedTx, StakeError>;
168
+ execute(params: TopUpParams & ExecuteBase): ResultAsync<TxResult, StakeError>;
169
+ }
170
+
171
+ interface StakeClient {
172
+ /** Reads the on-chain stake record for a user (stakedAmount, cooldownEnd, status). */
173
+ getUserStake(params: GetUserStakeParams): ResultAsync<UserStake, StakeError>;
174
+ /** Reads the per-currency stake boost config (tokens-per-USD, max boost). */
175
+ getStakeBoostConfig(params: GetStakeBoostConfigParams): ResultAsync<StakeBoostConfig, StakeError>;
176
+ /** Reads global stake boost configuration (token addr, cooldowns, totals). */
177
+ getStakeBoostGlobals(): ResultAsync<StakeBoostGlobals, StakeError>;
178
+ /** Reads the P2P token (ERC20) balance for a given address (raw bigint). */
179
+ getP2pTokenBalance(params: GetP2pTokenBalanceParams): ResultAsync<bigint, StakeError>;
180
+ readonly stake: StakeAction;
181
+ readonly topUp: TopUpAction;
182
+ readonly requestUnstake: RequestUnstakeAction;
183
+ readonly claimUnstake: ClaimUnstakeAction;
184
+ }
185
+ /**
186
+ * Creates the P2P token stake client — exposes a read for the user's stake and
187
+ * prepare/execute write pairs for stake, topUp, requestUnstake, and claimUnstake.
188
+ */
189
+ declare function createStake(config: StakeConfig): StakeClient;
190
+
191
+ export { type ExecuteBase, type GetP2pTokenBalanceParams, type GetStakeBoostConfigParams, type GetUserStakeParams, type PreparedTx, type RawStakeBoostGlobals, type RawUserStake, type StakeBoostConfig, type StakeBoostGlobals, type StakeClient, type StakeConfig, StakeError, type StakeErrorCode, type StakeParams, type StakeStatus, type TopUpParams, type TxResult, type UserStake, createStake };