Comprehensive guides, API references, and examples to integrate trust-verified presentment into your applications.
# Install the SOVR Empire SDK npm install @sovr/empire-sdk ethers # Or with yarn yarn add @sovr/empire-sdk ethers
The SDK provides TypeScript support out of the box and works with any web3 provider.
import { SovrEmpire } from '@sovr/empire-sdk'; import { ethers } from 'ethers'; // Initialize with your API key and preferred network const empire = new SovrEmpire({ network: 'polygon', // or 'polygon-mumbai' for testnet apiKey: process.env.SOVR_API_KEY, provider: new ethers.JsonRpcProvider('YOUR_RPC_URL') }); // Verify connection const isConnected = await empire.isConnected(); console.log('Connected to SOVR Empire:', isConnected);
API Key Required: Sign up for a developer account to get your API key. Testnet keys are available for free development.
// Process a trust-verified payment const paymentResult = await empire.processPayment({ merchant: '0x742d35Cc6634C0532925a3b8D71C4A8CC1A0c35D', amount: ethers.parseUnits('100.00', 18), // 100 SOVRCRV1 trustRules: { maxAmount: ethers.parseUnits('1000.00', 18), purpose: 'merchant_payment', beneficiaries: ['0xYourBeneficiaryAddress'] }, metadata: { invoiceId: 'INV-2024-001', description: 'Product purchase' } }); console.log('Payment processed:', paymentResult.transactionHash); console.log('Settlement ID:', paymentResult.settlementId);
This example shows a basic payment with trust rules enforcement. The system will validate spending limits and beneficiary rules before processing.
Join our developer community or schedule a technical consultation with our team.