@zkp2p/contracts-v2 0.0.1-rc3 → 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,23 +12,25 @@ yarn add @zkp2p/contracts-v2
12
12
  pnpm add @zkp2p/contracts-v2
13
13
  ```
14
14
 
15
- ## Quick Start (root import)
15
+ ## Quick Start (subpath imports)
16
16
 
17
17
  ```typescript
18
- import { addresses, abis, constants, paymentMethods, utils } 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
24
  // Create contract instance
22
25
  const provider = new ethers.providers.JsonRpcProvider('https://mainnet.base.org');
23
26
  const orchestrator = new ethers.Contract(
24
- addresses.base.Orchestrator,
25
- abis.base.Orchestrator,
27
+ baseAddresses.Orchestrator,
28
+ baseAbis.Orchestrator,
26
29
  provider
27
30
  );
28
31
 
29
- console.log('Intent expiration:', constants.base.INTENT_EXPIRATION_PERIOD);
30
- console.log('Venmo config:', paymentMethods.base.venmo);
31
- console.log('USD info:', utils.getCurrencyInfo(utils.Currency.USD));
32
+ console.log('Intent expiration:', baseConstants.INTENT_EXPIRATION_PERIOD);
33
+ console.log('Venmo config:', basePaymentMethods.venmo);
32
34
  ```
33
35
 
34
36
  ## Features
@@ -38,10 +40,11 @@ console.log('USD info:', utils.getCurrencyInfo(utils.Currency.USD));
38
40
  Pre-configured addresses for all deployed networks, exported per-network:
39
41
 
40
42
  ```typescript
41
- import { addresses } from '@zkp2p/contracts-v2';
42
- console.log(addresses.base.Orchestrator);
43
- console.log(addresses.base.Escrow);
44
- console.log(addresses.baseSepolia.UnifiedPaymentVerifier);
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);
45
48
  ```
46
49
 
47
50
  Supported networks:
@@ -53,9 +56,9 @@ Supported networks:
53
56
  Minimal ABIs extracted from on-chain deployments:
54
57
 
55
58
  ```typescript
56
- import { abis } from '@zkp2p/contracts-v2';
57
- const orchestratorABI = abis.base.Orchestrator;
58
- const escrowABI = abis.base.Escrow;
59
+ import * as baseAbis from '@zkp2p/contracts-v2/abis/base';
60
+ const orchestratorABI = baseAbis.Orchestrator;
61
+ const escrowABI = baseAbis.Escrow;
59
62
  ```
60
63
 
61
64
  ### 🔧 Network-Specific Protocol Constants
@@ -63,8 +66,8 @@ const escrowABI = abis.base.Escrow;
63
66
  All protocol parameters and configurations per network:
64
67
 
65
68
  ```typescript
66
- import { constants } from '@zkp2p/contracts-v2';
67
- const { INTENT_EXPIRATION_PERIOD, MAX_INTENTS_PER_DEPOSIT, DUST_THRESHOLD } = constants.base;
69
+ import { base as baseConstants } from '@zkp2p/contracts-v2/constants';
70
+ const { INTENT_EXPIRATION_PERIOD, MAX_INTENTS_PER_DEPOSIT, DUST_THRESHOLD } = baseConstants;
68
71
  ```
69
72
 
70
73
  ### 💳 Payment Methods with Provider Hashes
@@ -72,8 +75,8 @@ const { INTENT_EXPIRATION_PERIOD, MAX_INTENTS_PER_DEPOSIT, DUST_THRESHOLD } = co
72
75
  Unified payment method configurations including provider hashes from deployment:
73
76
 
74
77
  ```typescript
75
- import { paymentMethods } from '@zkp2p/contracts-v2';
76
- const venmoConfig = paymentMethods.base.venmo;
78
+ import { base as basePaymentMethods } from '@zkp2p/contracts-v2/paymentMethods';
79
+ const venmoConfig = basePaymentMethods.venmo;
77
80
  console.log('Payment Method Hash:', venmoConfig.paymentMethodHash);
78
81
  console.log('Provider Hashes:', venmoConfig.providerHashes);
79
82
  console.log('Currencies:', venmoConfig.currencies);
@@ -85,7 +88,7 @@ console.log('Timestamp Buffer:', venmoConfig.timestampBuffer);
85
88
  Protocol utility functions:
86
89
 
87
90
  ```typescript
88
- import { utils } from '@zkp2p/contracts-v2';
91
+ import * as utils from '@zkp2p/contracts-v2/utils';
89
92
  const usdInfo = utils.getCurrencyInfo(utils.Currency.USD);
90
93
  console.log('Currency code:', usdInfo.code);
91
94
  console.log('Decimals:', usdInfo.decimals);
@@ -96,8 +99,13 @@ console.log('Decimals:', usdInfo.decimals);
96
99
 
97
100
  ### Imports
98
101
 
99
- - Preferred (simple): `import { addresses, abis, constants, paymentMethods, utils } from '@zkp2p/contracts-v2'`
100
- - Advanced (fine-grained): subpath imports like `@zkp2p/contracts-v2/addresses/base.json` or `@zkp2p/contracts-v2/abis/base`
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`
101
109
 
102
110
  ## Development
103
111
 
@@ -15,6 +15,6 @@
15
15
  "ZelleCitiReclaimVerifier": "0x3128BadC46Dbe2E37BDd2d64F33fB3B3a639570E"
16
16
  },
17
17
  "meta": {
18
- "generatedAt": "2025-09-01T17:02:37.638Z"
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-01T17:02:37.798Z"
18
+ "generatedAt": "2025-09-01T17:30:55.330Z"
19
19
  }
20
20
  }