Skip to main content
The @zkp2p/contracts-v2/constants module provides network-specific protocol parameters and configuration values.

Import Constants

Import constants for a specific network:

Network-Specific Constants

Constants vary by network:

Available Constants

Token Addresses

string
Address of the USDC token contract on the network

Protocol Parameters

string
Time in seconds before an intent expires
number
Maximum number of intents allowed per deposit
string
Protocol fee charged to takers (in basis points)
string
Minimum amount threshold for escrow dust collection

Admin Addresses

string
Address of the protocol multisig wallet
string
Address that receives protocol taker fees
string
Address that receives dust from escrow contract

Verifier Addresses

string
Address of the witness service for off-chain verification
string
Address of the zkTLS attestor service

Using Constants in Your Code

Calculate Fees

Check Intent Expiration

Validate Deposit Intent Count

Import All Constants

Import all constants as a single object:

Direct JSON Import

For bundle size optimization:

Type Definitions

Constants are strongly typed:

Next Steps

Payment Methods

Work with payment method configurations

Utilities

Use protocol utility functions