@zkp2p/contracts-v2 0.0.1-rc2 → 0.0.1-rc4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,20 +12,15 @@ yarn add @zkp2p/contracts-v2
12
12
  pnpm add @zkp2p/contracts-v2
13
13
  ```
14
14
 
15
- ## Quick Start
15
+ ## Quick Start (subpath imports)
16
16
 
17
17
  ```typescript
18
- import { addresses, abis, constants, paymentMethods } from '@zkp2p/contracts-v2';
18
+ import baseAddresses from '@zkp2p/contracts-v2/addresses/base.json';
19
+ import * as baseAbis from '@zkp2p/contracts-v2/abis/base';
20
+ import { base as baseConstants } from '@zkp2p/contracts-v2/constants';
21
+ import { base as basePaymentMethods } from '@zkp2p/contracts-v2/paymentMethods';
19
22
  import { ethers } from 'ethers';
20
23
 
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
24
  // Create contract instance
30
25
  const provider = new ethers.providers.JsonRpcProvider('https://mainnet.base.org');
31
26
  const orchestrator = new ethers.Contract(
@@ -34,12 +29,7 @@ const orchestrator = new ethers.Contract(
34
29
  provider
35
30
  );
36
31
 
37
- // Use network-specific constants
38
- const baseConstants = constants.base;
39
32
  console.log('Intent expiration:', baseConstants.INTENT_EXPIRATION_PERIOD);
40
-
41
- // Access payment methods with provider hashes
42
- const basePaymentMethods = paymentMethods.base;
43
33
  console.log('Venmo config:', basePaymentMethods.venmo);
44
34
  ```
45
35
 
@@ -50,17 +40,11 @@ console.log('Venmo config:', basePaymentMethods.venmo);
50
40
  Pre-configured addresses for all deployed networks, exported per-network:
51
41
 
52
42
  ```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);
43
+ import base from '@zkp2p/contracts-v2/addresses/base.json';
44
+ import baseSepolia from '@zkp2p/contracts-v2/addresses/baseSepolia.json';
45
+ console.log(base.Orchestrator);
46
+ console.log(base.Escrow);
47
+ console.log(baseSepolia.UnifiedPaymentVerifier);
64
48
  ```
65
49
 
66
50
  Supported networks:
@@ -72,13 +56,7 @@ Supported networks:
72
56
  Minimal ABIs extracted from on-chain deployments:
73
57
 
74
58
  ```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
59
+ import * as baseAbis from '@zkp2p/contracts-v2/abis/base';
82
60
  const orchestratorABI = baseAbis.Orchestrator;
83
61
  const escrowABI = baseAbis.Escrow;
84
62
  ```
@@ -88,18 +66,8 @@ const escrowABI = baseAbis.Escrow;
88
66
  All protocol parameters and configurations per network:
89
67
 
90
68
  ```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;
69
+ import { base as baseConstants } from '@zkp2p/contracts-v2/constants';
70
+ const { INTENT_EXPIRATION_PERIOD, MAX_INTENTS_PER_DEPOSIT, DUST_THRESHOLD } = baseConstants;
103
71
  ```
104
72
 
105
73
  ### 💳 Payment Methods with Provider Hashes
@@ -107,15 +75,10 @@ const {
107
75
  Unified payment method configurations including provider hashes from deployment:
108
76
 
109
77
  ```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
78
+ import { base as basePaymentMethods } from '@zkp2p/contracts-v2/paymentMethods';
116
79
  const venmoConfig = basePaymentMethods.venmo;
117
- console.log('Payment ID:', venmoConfig.paymentId);
118
- console.log('Provider Hash:', venmoConfig.providerHash);
80
+ console.log('Payment Method Hash:', venmoConfig.paymentMethodHash);
81
+ console.log('Provider Hashes:', venmoConfig.providerHashes);
119
82
  console.log('Currencies:', venmoConfig.currencies);
120
83
  console.log('Timestamp Buffer:', venmoConfig.timestampBuffer);
121
84
  ```
@@ -125,68 +88,35 @@ console.log('Timestamp Buffer:', venmoConfig.timestampBuffer);
125
88
  Protocol utility functions:
126
89
 
127
90
  ```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);
91
+ import * as utils from '@zkp2p/contracts-v2/utils';
92
+ const usdInfo = utils.getCurrencyInfo(utils.Currency.USD);
133
93
  console.log('Currency code:', usdInfo.code);
134
94
  console.log('Decimals:', usdInfo.decimals);
135
-
136
- // Payment method utilities
137
- const venmoId = getPaymentMethodId('venmo');
138
95
  ```
139
96
 
140
97
 
141
98
  ## API Reference
142
99
 
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
- ```
100
+ ### Imports
174
101
 
175
- ## Development
102
+ - Prefer subpaths for clarity and smaller bundles:
103
+ - `@zkp2p/contracts-v2/addresses` and `@zkp2p/contracts-v2/addresses/*.json`
104
+ - `@zkp2p/contracts-v2/abis/<network>`
105
+ - `@zkp2p/contracts-v2/constants`
106
+ - `@zkp2p/contracts-v2/paymentMethods`
107
+ - `@zkp2p/contracts-v2/utils`
108
+ - `@zkp2p/contracts-v2/types`
176
109
 
177
- ### Package Scripts
110
+ ## Development
178
111
 
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
112
+ ### Build & Publish
182
113
 
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
114
+ From `packages/contracts`:
115
+ - `yarn build` Clean, extract, and bundle to `dist/`
116
+ - `npm pack` Preview tarball contents
117
+ - `npm publish --access public` Publish (runs prepublishOnly)
188
118
 
189
- This ensures the package always reflects the actual deployed state of the protocol.
119
+ Note: The package publishes `dist/` only. Tests and config files are excluded.
190
120
 
191
121
  ## License
192
122
 
@@ -196,4 +126,4 @@ MIT
196
126
 
197
127
  - [GitHub Repository](https://github.com/zkp2p/zkp2p-v2-contracts)
198
128
  - [Documentation](https://docs.zkp2p.xyz)
199
- - [Website](https://zkp2p.xyz)
129
+ - [Website](https://zkp2p.xyz)
@@ -15,6 +15,6 @@
15
15
  "ZelleCitiReclaimVerifier": "0x3128BadC46Dbe2E37BDd2d64F33fB3B3a639570E"
16
16
  },
17
17
  "meta": {
18
- "generatedAt": "2025-09-01T16:36:28.469Z"
18
+ "generatedAt": "2025-09-01T17:30:55.247Z"
19
19
  }
20
20
  }
@@ -15,6 +15,6 @@
15
15
  "UnifiedPaymentVerifier": "0x09618E223f22652e3d83B98614A745D12A7ae991"
16
16
  },
17
17
  "meta": {
18
- "generatedAt": "2025-09-01T16:36:28.557Z"
18
+ "generatedAt": "2025-09-01T17:30:55.330Z"
19
19
  }
20
20
  }
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- var version = "0.0.1-rc2";
1
+ var version = "0.0.1-rc4";
2
2
 
3
3
  export { version };
4
4
  //# sourceMappingURL=index.esm.js.map
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "0.0.1-rc2";
3
+ var version = "0.0.1-rc4";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "network": "base_sepolia",
3
- "generatedAt": "2025-09-01T16:36:29.437Z",
3
+ "generatedAt": "2025-09-01T17:30:56.218Z",
4
4
  "methods": {
5
5
  "venmo": {
6
6
  "paymentMethodHash": "0x90262a3db0edd0be2369c6b28f9e8511ec0bac7136cefbada0880602f87e7268",
@@ -2,5 +2,5 @@
2
2
  "networks": [
3
3
  "baseSepolia"
4
4
  ],
5
- "generatedAt": "2025-09-01T16:36:29.438Z"
5
+ "generatedAt": "2025-09-01T17:30:56.218Z"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zkp2p/contracts-v2",
3
- "version": "0.0.1-rc2",
3
+ "version": "0.0.1-rc4",
4
4
  "description": "ZKP2P V2 smart contract interfaces and utilities",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",