Offramp SDK by Peer - TypeScript SDK for deposit management, liquidity provision, and fiat off-ramping on Base.
- 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.*
npm install @zkp2p/offramp-sdk viemimport { 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' });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>
);
}See packages/offramp-sdk/README.md for comprehensive documentation including:
- Complete API reference
- React hooks usage
- Payment method configuration
- Currency utilities
- Error handling
| Platform | Key |
|---|---|
| Wise | wise |
| Venmo | venmo |
| Revolut | revolut |
| CashApp | cashapp |
| PayPal | paypal |
| Zelle | zelle |
| Monzo | monzo |
| MercadoPago | mercadopago |
| Network | Chain ID |
|---|---|
| Base Mainnet | 8453 |
| Base Sepolia | 84532 |
cd packages/offramp-sdk
npm install
npm run build
npm run test
npm run lintMIT License - see LICENSE for details.