Skip to content

API Reference

OffshoreCash

Constructor

typescript
new OffshoreCash(config: {
  rpcUrl: string;       // Ethereum Mainnet RPC URL
  chainId: 1;           // Only chainId 1 (Mainnet) is supported
  mainPoolAddress?: string; // Default: 0x7dc44f4d7d13853a14b26169c8479bec3939649d
})

Methods

createDeposit(options)

Creates a deposit commitment and note.

ParameterTypeDescription
amountstringDeposit amount in ETH
tokenstringToken symbol (currently only 'ETH')

Returns: { commitment, note, secret, nullifier }

deposit(options)

Creates and submits a deposit transaction.

withdraw(options)

Generates a ZK proof and submits withdrawal via relayer.

ParameterTypeDescription
notestringDeposit note
recipientstringWithdrawal address
amount?stringPartial amount (optional)
relayerUrlstringRelayer endpoint URL

Returns: { txHash, changeNote? }

getDepositStatus(note)

Checks if a deposit exists in the Merkle tree.

Returns: { found, leafIndex, amount, token }

Open source privacy technology