@zkp2p/contracts-v2 0.0.1-rc1

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 (259) hide show
  1. package/README.md +199 -0
  2. package/abis/base/CashappReclaimVerifier.json +513 -0
  3. package/abis/base/Escrow.json +2315 -0
  4. package/abis/base/MercadoPagoReclaimVerifier.json +539 -0
  5. package/abis/base/NullifierRegistry.json +213 -0
  6. package/abis/base/RevolutReclaimVerifier.json +513 -0
  7. package/abis/base/VenmoReclaimVerifier.json +500 -0
  8. package/abis/base/WiseReclaimVerifier.json +513 -0
  9. package/abis/base/ZelleBaseVerifier.json +377 -0
  10. package/abis/base/ZelleBoAReclaimVerifier.json +424 -0
  11. package/abis/base/ZelleChaseReclaimVerifier.json +437 -0
  12. package/abis/base/ZelleCitiReclaimVerifier.json +424 -0
  13. package/abis/base/index.d.ts +11 -0
  14. package/abis/base/index.ts +11 -0
  15. package/abis/baseSepolia/Escrow.json +2222 -0
  16. package/abis/baseSepolia/EscrowRegistry.json +214 -0
  17. package/abis/baseSepolia/NullifierRegistry.json +213 -0
  18. package/abis/baseSepolia/Orchestrator.json +1121 -0
  19. package/abis/baseSepolia/PaymentVerifierRegistry.json +332 -0
  20. package/abis/baseSepolia/PostIntentHookRegistry.json +181 -0
  21. package/abis/baseSepolia/ProtocolViewer.json +1382 -0
  22. package/abis/baseSepolia/RelayerRegistry.json +162 -0
  23. package/abis/baseSepolia/SimpleAttestationVerifier.json +215 -0
  24. package/abis/baseSepolia/USDCMock.json +293 -0
  25. package/abis/baseSepolia/UnifiedPaymentVerifier.json +545 -0
  26. package/abis/baseSepolia/index.d.ts +11 -0
  27. package/abis/baseSepolia/index.ts +11 -0
  28. package/abis/index.d.ts +2 -0
  29. package/abis/index.ts +2 -0
  30. package/addresses/base.json +20 -0
  31. package/addresses/baseSepolia.json +20 -0
  32. package/addresses/index.d.ts +2 -0
  33. package/addresses/index.ts +2 -0
  34. package/constants/base.json +13 -0
  35. package/constants/baseSepolia.json +12 -0
  36. package/constants/baseStaging.json +13 -0
  37. package/constants/index.d.ts +3 -0
  38. package/constants/index.ts +3 -0
  39. package/dist/abis/base/CashappReclaimVerifier.json +513 -0
  40. package/dist/abis/base/Escrow.json +2315 -0
  41. package/dist/abis/base/MercadoPagoReclaimVerifier.json +539 -0
  42. package/dist/abis/base/NullifierRegistry.json +213 -0
  43. package/dist/abis/base/RevolutReclaimVerifier.json +513 -0
  44. package/dist/abis/base/VenmoReclaimVerifier.json +500 -0
  45. package/dist/abis/base/WiseReclaimVerifier.json +513 -0
  46. package/dist/abis/base/ZelleBaseVerifier.json +377 -0
  47. package/dist/abis/base/ZelleBoAReclaimVerifier.json +424 -0
  48. package/dist/abis/base/ZelleChaseReclaimVerifier.json +437 -0
  49. package/dist/abis/base/ZelleCitiReclaimVerifier.json +424 -0
  50. package/dist/abis/base/index.d.ts +12 -0
  51. package/dist/abis/base/index.d.ts.map +1 -0
  52. package/dist/abis/base/index.js +29 -0
  53. package/dist/abis/base/index.js.map +1 -0
  54. package/dist/abis/baseSepolia/Escrow.json +2222 -0
  55. package/dist/abis/baseSepolia/EscrowRegistry.json +214 -0
  56. package/dist/abis/baseSepolia/NullifierRegistry.json +213 -0
  57. package/dist/abis/baseSepolia/Orchestrator.json +1121 -0
  58. package/dist/abis/baseSepolia/PaymentVerifierRegistry.json +332 -0
  59. package/dist/abis/baseSepolia/PostIntentHookRegistry.json +181 -0
  60. package/dist/abis/baseSepolia/ProtocolViewer.json +1382 -0
  61. package/dist/abis/baseSepolia/RelayerRegistry.json +162 -0
  62. package/dist/abis/baseSepolia/SimpleAttestationVerifier.json +215 -0
  63. package/dist/abis/baseSepolia/USDCMock.json +293 -0
  64. package/dist/abis/baseSepolia/UnifiedPaymentVerifier.json +545 -0
  65. package/dist/abis/baseSepolia/index.d.ts +12 -0
  66. package/dist/abis/baseSepolia/index.d.ts.map +1 -0
  67. package/dist/abis/baseSepolia/index.js +29 -0
  68. package/dist/abis/baseSepolia/index.js.map +1 -0
  69. package/dist/abis/index.d.ts +3 -0
  70. package/dist/abis/index.d.ts.map +1 -0
  71. package/dist/abis/index.js +39 -0
  72. package/dist/abis/index.js.map +1 -0
  73. package/dist/addresses/base.json +20 -0
  74. package/dist/addresses/baseSepolia.json +20 -0
  75. package/dist/addresses/index.d.ts +3 -0
  76. package/dist/addresses/index.d.ts.map +1 -0
  77. package/dist/addresses/index.js +11 -0
  78. package/dist/addresses/index.js.map +1 -0
  79. package/dist/constants/base.json +13 -0
  80. package/dist/constants/baseSepolia.json +12 -0
  81. package/dist/constants/baseStaging.json +13 -0
  82. package/dist/constants/index.d.ts +4 -0
  83. package/dist/constants/index.d.ts.map +1 -0
  84. package/dist/constants/index.js +13 -0
  85. package/dist/constants/index.js.map +1 -0
  86. package/dist/index.esm.js +14491 -0
  87. package/dist/index.esm.js.map +1 -0
  88. package/dist/index.js +34 -0
  89. package/dist/index.js.map +1 -0
  90. package/dist/index.min.js +2 -0
  91. package/dist/index.min.js.map +1 -0
  92. package/dist/package.json +113 -0
  93. package/dist/paymentMethods/baseSepolia.json +234 -0
  94. package/dist/paymentMethods/index.d.ts +8 -0
  95. package/dist/paymentMethods/index.d.ts.map +1 -0
  96. package/dist/paymentMethods/index.js +27 -0
  97. package/dist/paymentMethods/index.js.map +1 -0
  98. package/dist/src/index.d.ts +16 -0
  99. package/dist/src/index.d.ts.map +1 -0
  100. package/dist/src/index.js +68 -0
  101. package/dist/src/index.js.map +1 -0
  102. package/dist/types/common.d.ts +23 -0
  103. package/dist/types/common.d.ts.map +1 -0
  104. package/dist/types/common.js +3 -0
  105. package/dist/types/common.js.map +1 -0
  106. package/dist/types/contracts/Escrow.d.ts +1278 -0
  107. package/dist/types/contracts/Escrow.d.ts.map +1 -0
  108. package/dist/types/contracts/Escrow.js +3 -0
  109. package/dist/types/contracts/Escrow.js.map +1 -0
  110. package/dist/types/contracts/Orchestrator.d.ts +662 -0
  111. package/dist/types/contracts/Orchestrator.d.ts.map +1 -0
  112. package/dist/types/contracts/Orchestrator.js +3 -0
  113. package/dist/types/contracts/Orchestrator.js.map +1 -0
  114. package/dist/types/contracts/ProtocolViewer.d.ts +301 -0
  115. package/dist/types/contracts/ProtocolViewer.d.ts.map +1 -0
  116. package/dist/types/contracts/ProtocolViewer.js +3 -0
  117. package/dist/types/contracts/ProtocolViewer.js.map +1 -0
  118. package/dist/types/contracts/index.d.ts +10 -0
  119. package/dist/types/contracts/index.d.ts.map +1 -0
  120. package/dist/types/contracts/index.js +3 -0
  121. package/dist/types/contracts/index.js.map +1 -0
  122. package/dist/types/contracts/interfaces/IAttestationVerifier.d.ts +49 -0
  123. package/dist/types/contracts/interfaces/IAttestationVerifier.d.ts.map +1 -0
  124. package/dist/types/contracts/interfaces/IAttestationVerifier.js +3 -0
  125. package/dist/types/contracts/interfaces/IAttestationVerifier.js.map +1 -0
  126. package/dist/types/contracts/interfaces/IEscrow.d.ts +698 -0
  127. package/dist/types/contracts/interfaces/IEscrow.d.ts.map +1 -0
  128. package/dist/types/contracts/interfaces/IEscrow.js +3 -0
  129. package/dist/types/contracts/interfaces/IEscrow.js.map +1 -0
  130. package/dist/types/contracts/interfaces/IEscrowRegistry.d.ts +59 -0
  131. package/dist/types/contracts/interfaces/IEscrowRegistry.d.ts.map +1 -0
  132. package/dist/types/contracts/interfaces/IEscrowRegistry.js +3 -0
  133. package/dist/types/contracts/interfaces/IEscrowRegistry.js.map +1 -0
  134. package/dist/types/contracts/interfaces/INullifierRegistry.d.ts +59 -0
  135. package/dist/types/contracts/interfaces/INullifierRegistry.d.ts.map +1 -0
  136. package/dist/types/contracts/interfaces/INullifierRegistry.js +3 -0
  137. package/dist/types/contracts/interfaces/INullifierRegistry.js.map +1 -0
  138. package/dist/types/contracts/interfaces/IOrchestrator.d.ts +383 -0
  139. package/dist/types/contracts/interfaces/IOrchestrator.d.ts.map +1 -0
  140. package/dist/types/contracts/interfaces/IOrchestrator.js +3 -0
  141. package/dist/types/contracts/interfaces/IOrchestrator.js.map +1 -0
  142. package/dist/types/contracts/interfaces/IPaymentVerifier.d.ts +99 -0
  143. package/dist/types/contracts/interfaces/IPaymentVerifier.d.ts.map +1 -0
  144. package/dist/types/contracts/interfaces/IPaymentVerifier.js +3 -0
  145. package/dist/types/contracts/interfaces/IPaymentVerifier.js.map +1 -0
  146. package/dist/types/contracts/interfaces/IPaymentVerifierRegistry.d.ts +75 -0
  147. package/dist/types/contracts/interfaces/IPaymentVerifierRegistry.d.ts.map +1 -0
  148. package/dist/types/contracts/interfaces/IPaymentVerifierRegistry.js +3 -0
  149. package/dist/types/contracts/interfaces/IPaymentVerifierRegistry.js.map +1 -0
  150. package/dist/types/contracts/interfaces/IPostIntentHook.d.ts +101 -0
  151. package/dist/types/contracts/interfaces/IPostIntentHook.d.ts.map +1 -0
  152. package/dist/types/contracts/interfaces/IPostIntentHook.js +3 -0
  153. package/dist/types/contracts/interfaces/IPostIntentHook.js.map +1 -0
  154. package/dist/types/contracts/interfaces/IPostIntentHookRegistry.d.ts +51 -0
  155. package/dist/types/contracts/interfaces/IPostIntentHookRegistry.d.ts.map +1 -0
  156. package/dist/types/contracts/interfaces/IPostIntentHookRegistry.js +3 -0
  157. package/dist/types/contracts/interfaces/IPostIntentHookRegistry.js.map +1 -0
  158. package/dist/types/contracts/interfaces/IProtocolViewer.d.ts +233 -0
  159. package/dist/types/contracts/interfaces/IProtocolViewer.d.ts.map +1 -0
  160. package/dist/types/contracts/interfaces/IProtocolViewer.js +3 -0
  161. package/dist/types/contracts/interfaces/IProtocolViewer.js.map +1 -0
  162. package/dist/types/contracts/interfaces/IRelayerRegistry.d.ts +51 -0
  163. package/dist/types/contracts/interfaces/IRelayerRegistry.d.ts.map +1 -0
  164. package/dist/types/contracts/interfaces/IRelayerRegistry.js +3 -0
  165. package/dist/types/contracts/interfaces/IRelayerRegistry.js.map +1 -0
  166. package/dist/types/contracts/interfaces/index.d.ts +12 -0
  167. package/dist/types/contracts/interfaces/index.d.ts.map +1 -0
  168. package/dist/types/contracts/interfaces/index.js +3 -0
  169. package/dist/types/contracts/interfaces/index.js.map +1 -0
  170. package/dist/types/contracts/registries/EscrowRegistry.d.ts +207 -0
  171. package/dist/types/contracts/registries/EscrowRegistry.d.ts.map +1 -0
  172. package/dist/types/contracts/registries/EscrowRegistry.js +3 -0
  173. package/dist/types/contracts/registries/EscrowRegistry.js.map +1 -0
  174. package/dist/types/contracts/registries/NullifierRegistry.d.ts +201 -0
  175. package/dist/types/contracts/registries/NullifierRegistry.d.ts.map +1 -0
  176. package/dist/types/contracts/registries/NullifierRegistry.js +3 -0
  177. package/dist/types/contracts/registries/NullifierRegistry.js.map +1 -0
  178. package/dist/types/contracts/registries/PaymentVerifierRegistry.d.ts +271 -0
  179. package/dist/types/contracts/registries/PaymentVerifierRegistry.d.ts.map +1 -0
  180. package/dist/types/contracts/registries/PaymentVerifierRegistry.js +3 -0
  181. package/dist/types/contracts/registries/PaymentVerifierRegistry.js.map +1 -0
  182. package/dist/types/contracts/registries/PostIntentHookRegistry.d.ts +176 -0
  183. package/dist/types/contracts/registries/PostIntentHookRegistry.d.ts.map +1 -0
  184. package/dist/types/contracts/registries/PostIntentHookRegistry.js +3 -0
  185. package/dist/types/contracts/registries/PostIntentHookRegistry.js.map +1 -0
  186. package/dist/types/contracts/registries/RelayerRegistry.d.ts +166 -0
  187. package/dist/types/contracts/registries/RelayerRegistry.d.ts.map +1 -0
  188. package/dist/types/contracts/registries/RelayerRegistry.js +3 -0
  189. package/dist/types/contracts/registries/RelayerRegistry.js.map +1 -0
  190. package/dist/types/contracts/registries/index.d.ts +6 -0
  191. package/dist/types/contracts/registries/index.d.ts.map +1 -0
  192. package/dist/types/contracts/registries/index.js +3 -0
  193. package/dist/types/contracts/registries/index.js.map +1 -0
  194. package/dist/types/contracts/unifiedVerifier/BaseUnifiedPaymentVerifier.d.ts +358 -0
  195. package/dist/types/contracts/unifiedVerifier/BaseUnifiedPaymentVerifier.d.ts.map +1 -0
  196. package/dist/types/contracts/unifiedVerifier/BaseUnifiedPaymentVerifier.js +3 -0
  197. package/dist/types/contracts/unifiedVerifier/BaseUnifiedPaymentVerifier.js.map +1 -0
  198. package/dist/types/contracts/unifiedVerifier/SimpleAttestationVerifier.d.ts +197 -0
  199. package/dist/types/contracts/unifiedVerifier/SimpleAttestationVerifier.d.ts.map +1 -0
  200. package/dist/types/contracts/unifiedVerifier/SimpleAttestationVerifier.js +3 -0
  201. package/dist/types/contracts/unifiedVerifier/SimpleAttestationVerifier.js.map +1 -0
  202. package/dist/types/contracts/unifiedVerifier/UnifiedPaymentVerifier.d.ts +430 -0
  203. package/dist/types/contracts/unifiedVerifier/UnifiedPaymentVerifier.d.ts.map +1 -0
  204. package/dist/types/contracts/unifiedVerifier/UnifiedPaymentVerifier.js +3 -0
  205. package/dist/types/contracts/unifiedVerifier/UnifiedPaymentVerifier.js.map +1 -0
  206. package/dist/types/contracts/unifiedVerifier/index.d.ts +4 -0
  207. package/dist/types/contracts/unifiedVerifier/index.d.ts.map +1 -0
  208. package/dist/types/contracts/unifiedVerifier/index.js +3 -0
  209. package/dist/types/contracts/unifiedVerifier/index.js.map +1 -0
  210. package/dist/types/index.d.ts +2 -0
  211. package/dist/types/index.d.ts.map +1 -0
  212. package/dist/types/index.js +41 -0
  213. package/dist/types/index.js.map +1 -0
  214. package/dist/utils/index.d.ts +3 -0
  215. package/dist/utils/index.d.ts.map +1 -0
  216. package/dist/utils/index.js +27 -0
  217. package/dist/utils/index.js.map +1 -0
  218. package/dist/utils/protocolUtils.d.ts +31 -0
  219. package/dist/utils/protocolUtils.d.ts.map +1 -0
  220. package/dist/utils/protocolUtils.js +49 -0
  221. package/dist/utils/protocolUtils.js.map +1 -0
  222. package/package.json +113 -0
  223. package/paymentMethods/baseSepolia.json +234 -0
  224. package/paymentMethods/index.d.ts +7 -0
  225. package/paymentMethods/index.json +6 -0
  226. package/paymentMethods/index.ts +23 -0
  227. package/paymentMethods/types.d.ts +15 -0
  228. package/types/common.ts +46 -0
  229. package/types/contracts/Escrow.ts +2688 -0
  230. package/types/contracts/Orchestrator.ts +1290 -0
  231. package/types/contracts/ProtocolViewer.ts +527 -0
  232. package/types/contracts/index.ts +12 -0
  233. package/types/contracts/interfaces/IAttestationVerifier.ts +114 -0
  234. package/types/contracts/interfaces/IEscrow.ts +1434 -0
  235. package/types/contracts/interfaces/IEscrowRegistry.ts +150 -0
  236. package/types/contracts/interfaces/INullifierRegistry.ts +141 -0
  237. package/types/contracts/interfaces/IOrchestrator.ts +704 -0
  238. package/types/contracts/interfaces/IPaymentVerifier.ts +154 -0
  239. package/types/contracts/interfaces/IPaymentVerifierRegistry.ts +233 -0
  240. package/types/contracts/interfaces/IPostIntentHook.ts +165 -0
  241. package/types/contracts/interfaces/IPostIntentHookRegistry.ts +126 -0
  242. package/types/contracts/interfaces/IProtocolViewer.ts +334 -0
  243. package/types/contracts/interfaces/IRelayerRegistry.ts +126 -0
  244. package/types/contracts/interfaces/index.ts +14 -0
  245. package/types/contracts/registries/EscrowRegistry.ts +463 -0
  246. package/types/contracts/registries/NullifierRegistry.ts +447 -0
  247. package/types/contracts/registries/PaymentVerifierRegistry.ts +657 -0
  248. package/types/contracts/registries/PostIntentHookRegistry.ts +414 -0
  249. package/types/contracts/registries/RelayerRegistry.ts +371 -0
  250. package/types/contracts/registries/index.ts +8 -0
  251. package/types/contracts/unifiedVerifier/BaseUnifiedPaymentVerifier.ts +828 -0
  252. package/types/contracts/unifiedVerifier/SimpleAttestationVerifier.ts +415 -0
  253. package/types/contracts/unifiedVerifier/UnifiedPaymentVerifier.ts +931 -0
  254. package/types/contracts/unifiedVerifier/index.ts +6 -0
  255. package/types/index.ts +4 -0
  256. package/utils/index.d.ts +2 -0
  257. package/utils/index.ts +12 -0
  258. package/utils/protocolUtils.d.ts +30 -0
  259. package/utils/protocolUtils.ts +57 -0
package/README.md ADDED
@@ -0,0 +1,199 @@
1
+ # @zkp2p/contracts-v2
2
+
3
+ Official npm package for ZKP2P V2 smart contract interfaces, ABIs, addresses, and utilities.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @zkp2p/contracts-v2
9
+ # or
10
+ yarn add @zkp2p/contracts-v2
11
+ # or
12
+ pnpm add @zkp2p/contracts-v2
13
+ ```
14
+
15
+ ## Quick Start
16
+
17
+ ```typescript
18
+ import { addresses, abis, constants, paymentMethods } from '@zkp2p/contracts-v2';
19
+ import { ethers } from 'ethers';
20
+
21
+ // Get contract addresses for Base mainnet
22
+ const baseAddresses = addresses.base;
23
+ console.log('Orchestrator:', baseAddresses.Orchestrator);
24
+ console.log('Escrow:', baseAddresses.Escrow);
25
+
26
+ // Get ABIs for Base mainnet
27
+ const baseAbis = abis.base;
28
+
29
+ // Create contract instance
30
+ const provider = new ethers.providers.JsonRpcProvider('https://mainnet.base.org');
31
+ const orchestrator = new ethers.Contract(
32
+ baseAddresses.Orchestrator,
33
+ baseAbis.Orchestrator,
34
+ provider
35
+ );
36
+
37
+ // Use network-specific constants
38
+ const baseConstants = constants.base;
39
+ console.log('Intent expiration:', baseConstants.INTENT_EXPIRATION_PERIOD);
40
+
41
+ // Access payment methods with provider hashes
42
+ const basePaymentMethods = paymentMethods.base;
43
+ console.log('Venmo config:', basePaymentMethods.venmo);
44
+ ```
45
+
46
+ ## Features
47
+
48
+ ### 📍 Network-Specific Contract Addresses
49
+
50
+ Pre-configured addresses for all deployed networks, exported per-network:
51
+
52
+ ```typescript
53
+ import { addresses } from '@zkp2p/contracts-v2';
54
+
55
+ // Network-specific addresses
56
+ const baseAddresses = addresses.base;
57
+ const baseSepoliaAddresses = addresses.baseSepolia;
58
+
59
+ // Access individual contracts
60
+ console.log(baseAddresses.Orchestrator);
61
+ console.log(baseAddresses.Escrow);
62
+ console.log(baseAddresses.UnifiedPaymentVerifier);
63
+ console.log(baseAddresses.SimpleAttestationVerifier);
64
+ ```
65
+
66
+ Supported networks:
67
+ - Base (`base`)
68
+ - Base Sepolia (`baseSepolia`)
69
+
70
+ ### 📜 Network-Specific Contract ABIs
71
+
72
+ Minimal ABIs extracted from on-chain deployments:
73
+
74
+ ```typescript
75
+ import { abis } from '@zkp2p/contracts-v2';
76
+
77
+ // Network-specific ABIs
78
+ const baseAbis = abis.base;
79
+ const baseSepoliaAbis = abis.baseSepolia;
80
+
81
+ // Individual contract ABIs
82
+ const orchestratorABI = baseAbis.Orchestrator;
83
+ const escrowABI = baseAbis.Escrow;
84
+ ```
85
+
86
+ ### 🔧 Network-Specific Protocol Constants
87
+
88
+ All protocol parameters and configurations per network:
89
+
90
+ ```typescript
91
+ import { constants } from '@zkp2p/contracts-v2';
92
+
93
+ // Network-specific constants
94
+ const baseConstants = constants.base;
95
+
96
+ // Protocol parameters
97
+ const {
98
+ INTENT_EXPIRATION_PERIOD,
99
+ MAX_INTENTS_PER_DEPOSIT,
100
+ DUST_THRESHOLD,
101
+ PARTIAL_MANUAL_RELEASE_DELAY
102
+ } = baseConstants;
103
+ ```
104
+
105
+ ### 💳 Payment Methods with Provider Hashes
106
+
107
+ Unified payment method configurations including provider hashes from deployment:
108
+
109
+ ```typescript
110
+ import { paymentMethods } from '@zkp2p/contracts-v2';
111
+
112
+ // Network-specific payment methods
113
+ const basePaymentMethods = paymentMethods.base;
114
+
115
+ // Access payment method configuration
116
+ const venmoConfig = basePaymentMethods.venmo;
117
+ console.log('Payment ID:', venmoConfig.paymentId);
118
+ console.log('Provider Hash:', venmoConfig.providerHash);
119
+ console.log('Currencies:', venmoConfig.currencies);
120
+ console.log('Timestamp Buffer:', venmoConfig.timestampBuffer);
121
+ ```
122
+
123
+ ### 🛠️ Utility Functions
124
+
125
+ Protocol utility functions:
126
+
127
+ ```typescript
128
+ import { utils } from '@zkp2p/contracts-v2';
129
+ import { Currency, getCurrencyInfo, getPaymentMethodId } from '@zkp2p/contracts-v2';
130
+
131
+ // Currency utilities
132
+ const usdInfo = getCurrencyInfo(Currency.USD);
133
+ console.log('Currency code:', usdInfo.code);
134
+ console.log('Decimals:', usdInfo.decimals);
135
+
136
+ // Payment method utilities
137
+ const venmoId = getPaymentMethodId('venmo');
138
+ ```
139
+
140
+
141
+ ## API Reference
142
+
143
+ ### Main Exports
144
+
145
+ | Export | Type | Description |
146
+ |--------|------|-------------|
147
+ | `addresses` | Object | Network-specific contract addresses |
148
+ | `abis` | Object | Network-specific contract ABIs |
149
+ | `constants` | Object | Network-specific protocol constants |
150
+ | `paymentMethods` | Object | Network-specific payment method configs |
151
+ | `utils` | Object | Protocol utility functions |
152
+ | `Currency` | Enum | Currency enumeration |
153
+ | `getCurrencyInfo` | Function | Get currency details |
154
+ | `getPaymentMethodId` | Function | Get payment method identifier |
155
+
156
+ ### Package Exports
157
+
158
+ The package provides multiple entry points:
159
+
160
+ ```json
161
+ {
162
+ "@zkp2p/contracts-v2": "Main package exports",
163
+ "@zkp2p/contracts-v2/addresses": "Address exports only",
164
+ "@zkp2p/contracts-v2/addresses/*": "Network-specific addresses",
165
+ "@zkp2p/contracts-v2/abis/*": "Network-specific ABIs",
166
+ "@zkp2p/contracts-v2/constants": "Constants exports",
167
+ "@zkp2p/contracts-v2/constants/*": "Network-specific constants",
168
+ "@zkp2p/contracts-v2/paymentMethods": "Payment method configs",
169
+ "@zkp2p/contracts-v2/paymentMethods/*": "Network-specific payment methods",
170
+ "@zkp2p/contracts-v2/types": "TypeChain types",
171
+ "@zkp2p/contracts-v2/utils": "Utility functions"
172
+ }
173
+ ```
174
+
175
+ ## Development
176
+
177
+ ### Package Scripts
178
+
179
+ From the root directory:
180
+ - `yarn package:extract` - Extract addresses, ABIs, and constants from deployments
181
+ - `yarn package:build` - Build the package for distribution
182
+
183
+ From the package directory (`packages/contracts`):
184
+ - `yarn extract` - Extract data from deployments
185
+ - `yarn build` - Build package for distribution
186
+ - `yarn clean` - Clean generated files
187
+ - `yarn test` - Run package tests
188
+
189
+ This ensures the package always reflects the actual deployed state of the protocol.
190
+
191
+ ## License
192
+
193
+ MIT
194
+
195
+ ## Links
196
+
197
+ - [GitHub Repository](https://github.com/zkp2p/zkp2p-v2-contracts)
198
+ - [Documentation](https://docs.zkp2p.xyz)
199
+ - [Website](https://zkp2p.xyz)
@@ -0,0 +1,513 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ {
5
+ "internalType": "address",
6
+ "name": "_escrow",
7
+ "type": "address"
8
+ },
9
+ {
10
+ "internalType": "contract INullifierRegistry",
11
+ "name": "_nullifierRegistry",
12
+ "type": "address"
13
+ },
14
+ {
15
+ "internalType": "uint256",
16
+ "name": "_timestampBuffer",
17
+ "type": "uint256"
18
+ },
19
+ {
20
+ "internalType": "bytes32[]",
21
+ "name": "_currencies",
22
+ "type": "bytes32[]"
23
+ },
24
+ {
25
+ "internalType": "string[]",
26
+ "name": "_providerHashes",
27
+ "type": "string[]"
28
+ }
29
+ ],
30
+ "stateMutability": "nonpayable",
31
+ "type": "constructor"
32
+ },
33
+ {
34
+ "anonymous": false,
35
+ "inputs": [
36
+ {
37
+ "indexed": false,
38
+ "internalType": "bytes32",
39
+ "name": "currencyCode",
40
+ "type": "bytes32"
41
+ }
42
+ ],
43
+ "name": "CurrencyAdded",
44
+ "type": "event"
45
+ },
46
+ {
47
+ "anonymous": false,
48
+ "inputs": [
49
+ {
50
+ "indexed": false,
51
+ "internalType": "bytes32",
52
+ "name": "currencyCode",
53
+ "type": "bytes32"
54
+ }
55
+ ],
56
+ "name": "CurrencyRemoved",
57
+ "type": "event"
58
+ },
59
+ {
60
+ "anonymous": false,
61
+ "inputs": [
62
+ {
63
+ "indexed": true,
64
+ "internalType": "address",
65
+ "name": "previousOwner",
66
+ "type": "address"
67
+ },
68
+ {
69
+ "indexed": true,
70
+ "internalType": "address",
71
+ "name": "newOwner",
72
+ "type": "address"
73
+ }
74
+ ],
75
+ "name": "OwnershipTransferred",
76
+ "type": "event"
77
+ },
78
+ {
79
+ "anonymous": false,
80
+ "inputs": [
81
+ {
82
+ "indexed": false,
83
+ "internalType": "string",
84
+ "name": "providerHash",
85
+ "type": "string"
86
+ }
87
+ ],
88
+ "name": "ProviderHashAdded",
89
+ "type": "event"
90
+ },
91
+ {
92
+ "anonymous": false,
93
+ "inputs": [
94
+ {
95
+ "indexed": false,
96
+ "internalType": "string",
97
+ "name": "providerHash",
98
+ "type": "string"
99
+ }
100
+ ],
101
+ "name": "ProviderHashRemoved",
102
+ "type": "event"
103
+ },
104
+ {
105
+ "anonymous": false,
106
+ "inputs": [
107
+ {
108
+ "indexed": false,
109
+ "internalType": "uint256",
110
+ "name": "timestampBuffer",
111
+ "type": "uint256"
112
+ }
113
+ ],
114
+ "name": "TimestampBufferSet",
115
+ "type": "event"
116
+ },
117
+ {
118
+ "inputs": [],
119
+ "name": "COMPLETE_PAYMENT_STATUS",
120
+ "outputs": [
121
+ {
122
+ "internalType": "bytes32",
123
+ "name": "",
124
+ "type": "bytes32"
125
+ }
126
+ ],
127
+ "stateMutability": "view",
128
+ "type": "function"
129
+ },
130
+ {
131
+ "inputs": [
132
+ {
133
+ "internalType": "bytes32",
134
+ "name": "_currencyCode",
135
+ "type": "bytes32"
136
+ }
137
+ ],
138
+ "name": "addCurrency",
139
+ "outputs": [],
140
+ "stateMutability": "nonpayable",
141
+ "type": "function"
142
+ },
143
+ {
144
+ "inputs": [
145
+ {
146
+ "internalType": "string",
147
+ "name": "_newProviderHash",
148
+ "type": "string"
149
+ }
150
+ ],
151
+ "name": "addProviderHash",
152
+ "outputs": [],
153
+ "stateMutability": "nonpayable",
154
+ "type": "function"
155
+ },
156
+ {
157
+ "inputs": [],
158
+ "name": "escrow",
159
+ "outputs": [
160
+ {
161
+ "internalType": "address",
162
+ "name": "",
163
+ "type": "address"
164
+ }
165
+ ],
166
+ "stateMutability": "view",
167
+ "type": "function"
168
+ },
169
+ {
170
+ "inputs": [],
171
+ "name": "getCurrencies",
172
+ "outputs": [
173
+ {
174
+ "internalType": "bytes32[]",
175
+ "name": "",
176
+ "type": "bytes32[]"
177
+ }
178
+ ],
179
+ "stateMutability": "view",
180
+ "type": "function"
181
+ },
182
+ {
183
+ "inputs": [],
184
+ "name": "getProviderHashes",
185
+ "outputs": [
186
+ {
187
+ "internalType": "string[]",
188
+ "name": "",
189
+ "type": "string[]"
190
+ }
191
+ ],
192
+ "stateMutability": "view",
193
+ "type": "function"
194
+ },
195
+ {
196
+ "inputs": [
197
+ {
198
+ "internalType": "bytes32",
199
+ "name": "",
200
+ "type": "bytes32"
201
+ }
202
+ ],
203
+ "name": "isCurrency",
204
+ "outputs": [
205
+ {
206
+ "internalType": "bool",
207
+ "name": "",
208
+ "type": "bool"
209
+ }
210
+ ],
211
+ "stateMutability": "view",
212
+ "type": "function"
213
+ },
214
+ {
215
+ "inputs": [
216
+ {
217
+ "internalType": "string",
218
+ "name": "",
219
+ "type": "string"
220
+ }
221
+ ],
222
+ "name": "isProviderHash",
223
+ "outputs": [
224
+ {
225
+ "internalType": "bool",
226
+ "name": "",
227
+ "type": "bool"
228
+ }
229
+ ],
230
+ "stateMutability": "view",
231
+ "type": "function"
232
+ },
233
+ {
234
+ "inputs": [],
235
+ "name": "nullifierRegistry",
236
+ "outputs": [
237
+ {
238
+ "internalType": "contract INullifierRegistry",
239
+ "name": "",
240
+ "type": "address"
241
+ }
242
+ ],
243
+ "stateMutability": "view",
244
+ "type": "function"
245
+ },
246
+ {
247
+ "inputs": [],
248
+ "name": "owner",
249
+ "outputs": [
250
+ {
251
+ "internalType": "address",
252
+ "name": "",
253
+ "type": "address"
254
+ }
255
+ ],
256
+ "stateMutability": "view",
257
+ "type": "function"
258
+ },
259
+ {
260
+ "inputs": [
261
+ {
262
+ "internalType": "uint256",
263
+ "name": "",
264
+ "type": "uint256"
265
+ }
266
+ ],
267
+ "name": "providerHashes",
268
+ "outputs": [
269
+ {
270
+ "internalType": "string",
271
+ "name": "",
272
+ "type": "string"
273
+ }
274
+ ],
275
+ "stateMutability": "view",
276
+ "type": "function"
277
+ },
278
+ {
279
+ "inputs": [
280
+ {
281
+ "internalType": "bytes32",
282
+ "name": "_currencyCode",
283
+ "type": "bytes32"
284
+ }
285
+ ],
286
+ "name": "removeCurrency",
287
+ "outputs": [],
288
+ "stateMutability": "nonpayable",
289
+ "type": "function"
290
+ },
291
+ {
292
+ "inputs": [
293
+ {
294
+ "internalType": "string",
295
+ "name": "_removeProviderHash",
296
+ "type": "string"
297
+ }
298
+ ],
299
+ "name": "removeProviderHash",
300
+ "outputs": [],
301
+ "stateMutability": "nonpayable",
302
+ "type": "function"
303
+ },
304
+ {
305
+ "inputs": [],
306
+ "name": "renounceOwnership",
307
+ "outputs": [],
308
+ "stateMutability": "nonpayable",
309
+ "type": "function"
310
+ },
311
+ {
312
+ "inputs": [
313
+ {
314
+ "internalType": "uint256",
315
+ "name": "_timestampBuffer",
316
+ "type": "uint256"
317
+ }
318
+ ],
319
+ "name": "setTimestampBuffer",
320
+ "outputs": [],
321
+ "stateMutability": "nonpayable",
322
+ "type": "function"
323
+ },
324
+ {
325
+ "inputs": [],
326
+ "name": "timestampBuffer",
327
+ "outputs": [
328
+ {
329
+ "internalType": "uint256",
330
+ "name": "",
331
+ "type": "uint256"
332
+ }
333
+ ],
334
+ "stateMutability": "view",
335
+ "type": "function"
336
+ },
337
+ {
338
+ "inputs": [
339
+ {
340
+ "internalType": "address",
341
+ "name": "newOwner",
342
+ "type": "address"
343
+ }
344
+ ],
345
+ "name": "transferOwnership",
346
+ "outputs": [],
347
+ "stateMutability": "nonpayable",
348
+ "type": "function"
349
+ },
350
+ {
351
+ "inputs": [
352
+ {
353
+ "components": [
354
+ {
355
+ "internalType": "bytes",
356
+ "name": "paymentProof",
357
+ "type": "bytes"
358
+ },
359
+ {
360
+ "internalType": "address",
361
+ "name": "depositToken",
362
+ "type": "address"
363
+ },
364
+ {
365
+ "internalType": "uint256",
366
+ "name": "intentAmount",
367
+ "type": "uint256"
368
+ },
369
+ {
370
+ "internalType": "uint256",
371
+ "name": "intentTimestamp",
372
+ "type": "uint256"
373
+ },
374
+ {
375
+ "internalType": "string",
376
+ "name": "payeeDetails",
377
+ "type": "string"
378
+ },
379
+ {
380
+ "internalType": "bytes32",
381
+ "name": "fiatCurrency",
382
+ "type": "bytes32"
383
+ },
384
+ {
385
+ "internalType": "uint256",
386
+ "name": "conversionRate",
387
+ "type": "uint256"
388
+ },
389
+ {
390
+ "internalType": "bytes",
391
+ "name": "data",
392
+ "type": "bytes"
393
+ }
394
+ ],
395
+ "internalType": "struct IPaymentVerifier.VerifyPaymentData",
396
+ "name": "_verifyPaymentData",
397
+ "type": "tuple"
398
+ }
399
+ ],
400
+ "name": "verifyPayment",
401
+ "outputs": [
402
+ {
403
+ "internalType": "bool",
404
+ "name": "",
405
+ "type": "bool"
406
+ },
407
+ {
408
+ "internalType": "bytes32",
409
+ "name": "",
410
+ "type": "bytes32"
411
+ }
412
+ ],
413
+ "stateMutability": "nonpayable",
414
+ "type": "function"
415
+ },
416
+ {
417
+ "inputs": [
418
+ {
419
+ "components": [
420
+ {
421
+ "components": [
422
+ {
423
+ "internalType": "string",
424
+ "name": "provider",
425
+ "type": "string"
426
+ },
427
+ {
428
+ "internalType": "string",
429
+ "name": "parameters",
430
+ "type": "string"
431
+ },
432
+ {
433
+ "internalType": "string",
434
+ "name": "context",
435
+ "type": "string"
436
+ }
437
+ ],
438
+ "internalType": "struct Claims.ClaimInfo",
439
+ "name": "claimInfo",
440
+ "type": "tuple"
441
+ },
442
+ {
443
+ "components": [
444
+ {
445
+ "components": [
446
+ {
447
+ "internalType": "bytes32",
448
+ "name": "identifier",
449
+ "type": "bytes32"
450
+ },
451
+ {
452
+ "internalType": "address",
453
+ "name": "owner",
454
+ "type": "address"
455
+ },
456
+ {
457
+ "internalType": "uint32",
458
+ "name": "timestampS",
459
+ "type": "uint32"
460
+ },
461
+ {
462
+ "internalType": "uint32",
463
+ "name": "epoch",
464
+ "type": "uint32"
465
+ }
466
+ ],
467
+ "internalType": "struct Claims.CompleteClaimData",
468
+ "name": "claim",
469
+ "type": "tuple"
470
+ },
471
+ {
472
+ "internalType": "bytes[]",
473
+ "name": "signatures",
474
+ "type": "bytes[]"
475
+ }
476
+ ],
477
+ "internalType": "struct Claims.SignedClaim",
478
+ "name": "signedClaim",
479
+ "type": "tuple"
480
+ },
481
+ {
482
+ "internalType": "bool",
483
+ "name": "isAppclipProof",
484
+ "type": "bool"
485
+ }
486
+ ],
487
+ "internalType": "struct IReclaimVerifier.ReclaimProof",
488
+ "name": "proof",
489
+ "type": "tuple"
490
+ },
491
+ {
492
+ "internalType": "address[]",
493
+ "name": "_witnesses",
494
+ "type": "address[]"
495
+ },
496
+ {
497
+ "internalType": "uint256",
498
+ "name": "_requiredThreshold",
499
+ "type": "uint256"
500
+ }
501
+ ],
502
+ "name": "verifyProofSignatures",
503
+ "outputs": [
504
+ {
505
+ "internalType": "bool",
506
+ "name": "",
507
+ "type": "bool"
508
+ }
509
+ ],
510
+ "stateMutability": "pure",
511
+ "type": "function"
512
+ }
513
+ ]