Skip to main content

Current Token Support

Privacy Cash EVM supports native ETH and selected ERC-20 pools per network.
NetworkChain IDSupported tokens
Base8453ETH, USDC
Ethereum1ETH, USDT

Working with Amounts

The SDK uses decimal token amounts throughout. Use ETH decimals for the native asset and token decimals for ERC-20 balances.
import { BASE_NETWORK, ETH_NETWORK, deposit, withdraw, getBalance } from 'privacycash-evm'

// Deposit 0.05 ETH on Ethereum
await deposit({
  depositAmountInput: 0.05,
  token: 'eth',
  network: ETH_NETWORK,
  keyBasePath,
  signature,
  address,
  txSender,
})

// Withdraw 10 USDC on Base
await withdraw({
  withdrawAmountInput: 10,
  token: 'usdc',
  network: BASE_NETWORK,
  recipient,
  keyBasePath,
  signature,
  address,
})

// Balance is returned as a string
const { balance } = await getBalance({
  token: 'usdt',
  network: ETH_NETWORK,
  signature,
  address,
})
console.log(balance) // "10.000000"

Converting to Wei

If you need to work in base units for UI display or comparison:
import { ethers } from 'ethers'

const ethWei = ethers.utils.parseEther('0.05')
const usdcUnits = ethers.utils.parseUnits('10', 6)

console.log('ETH in wei:', ethWei.toString())
console.log('USDC in base units:', usdcUnits.toString())

Passing an unsupported token/network pair throws an SDK error. Use Base ETH/USDC or Ethereum ETH/USDT.