Skip to content
This repository was archived by the owner on Jul 28, 2026. It is now read-only.

Repository files navigation

@zkp2p/offramp-sdk

npm version License: MIT TypeScript

Offramp SDK by Peer - TypeScript SDK for deposit management, liquidity provision, and fiat off-ramping on Base.

Features

  • RPC-First Architecture: Instant on-chain queries via ProtocolViewer (no indexer lag)
  • Deposit Management: Create, configure, and manage liquidity deposits
  • Fund Operations: Add/remove funds, withdraw deposits
  • Intent System: Signal and fulfill payment intents
  • Multi-Platform Support: Wise, Venmo, Revolut, CashApp, PayPal, Zelle, Monzo, MercadoPago
  • 35+ Fiat Currencies: USD, EUR, GBP, and many more
  • React Hooks: Full suite of hooks for seamless integration
  • Type-Safe: Full TypeScript support with comprehensive type definitions
  • Advanced Indexer: Historical queries and filtering via client.indexer.*

Installation

npm install @zkp2p/offramp-sdk viem

Quick Start

import { OfframpClient, Currency } from '@zkp2p/offramp-sdk';
import { createWalletClient, custom } from 'viem';
import { base } from 'viem/chains';

const walletClient = createWalletClient({
  chain: base,
  transport: custom(window.ethereum),
});

const client = new OfframpClient({
  walletClient,
  chainId: base.id,
  apiKey: 'YOUR_API_KEY',
});

// Query deposits (RPC - instant, real-time)
const deposits = await client.getDeposits();
const deposit = await client.getDeposit(42n);

// Query intents (RPC - instant, real-time)
const intents = await client.getIntents();

// Create a deposit to provide liquidity
await client.createDeposit({
  token: '0xUSDC',
  amount: 10000000000n,
  intentAmountRange: { min: 100000n, max: 1000000000n },
  processorNames: ['wise', 'revolut'],
  depositData: [{ email: 'maker@example.com' }, { tag: '@maker' }],
  conversionRates: [[{ currency: Currency.USD, conversionRate: '1.02' }]],
});

// Advanced indexer queries (for historical/filtered data)
const activeDeposits = await client.indexer.getDeposits({ status: 'ACTIVE' });

React Hooks

import {
  useCreateDeposit,
  useAddFunds,
  useSetAcceptingIntents,
  useFulfillIntent,
} from '@zkp2p/offramp-sdk/react';

function DepositManager({ client }) {
  const { createDeposit, isLoading } = useCreateDeposit({ client });

  return (
    <button disabled={isLoading} onClick={() => createDeposit({ /* params */ })}>
      Create Deposit
    </button>
  );
}

Documentation

See packages/offramp-sdk/README.md for comprehensive documentation including:

  • Complete API reference
  • React hooks usage
  • Payment method configuration
  • Currency utilities
  • Error handling

Supported Platforms

Platform Key
Wise wise
Venmo venmo
Revolut revolut
CashApp cashapp
PayPal paypal
Zelle zelle
Monzo monzo
MercadoPago mercadopago

Supported Networks

Network Chain ID
Base Mainnet 8453
Base Sepolia 84532

Development

cd packages/offramp-sdk
npm install
npm run build
npm run test
npm run lint

License

MIT License - see LICENSE for details.

Links

About

Browser-first TypeScript SDK for ZKP2P - trustless fiat-to-crypto exchanges using zero-knowledge proofs

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages