USIC Logo
Loading $USI token data...

CDP Integration

Coinbase Developer Platform SDK for automated payouts and gasless transactions

Overview

USIC integrates with Coinbase Developer Platform (CDP) SDK to provide enhanced blockchain operations including automated artist payouts, gasless transactions, and efficient batch operations on Base network.

Key Features

Automated Payouts

Automatically process artist earnings and send USDC payments in batches using server-side wallets.

Gasless Transactions

Sponsor transactions for users via Paymaster, eliminating gas fees for better UX.

Batch Operations

Efficiently process multiple payouts in a single operation, reducing costs and complexity.

Secure Wallet Management

Server-side wallet with secure key management for automated operations.

Setup

1. Get CDP API Credentials

Visit the Coinbase Developer Platform portal to create a project and generate API credentials.

Open CDP Portal

2. Configure Environment Variables

CDP_API_KEY_NAME=your_api_key_name
CDP_API_KEY_PRIVATE_KEY=your_private_key
CDP_SERVER_WALLET_DATA={...}

3. Initialize Server Wallet

On first run, the system will create a server wallet. Copy the wallet data from logs and add it to your environment variables.

curl -X POST /api/admin/payouts

4. Fund Server Wallet

Transfer USDC to the server wallet address to enable automated payouts.

API Endpoints

POST/api/admin/payouts

Triggers artist payout processing. Should be called via cron job or admin panel.

GET/api/admin/payouts

Returns CDP configuration status and readiness.

Code Examples

Process All Payouts

import { processArtistPayouts } from "@/lib/cdp/payouts"

const result = await processArtistPayouts()
// Returns: { success: 10, failed: 0, totalAmount: "1250.50" }

Payout Single Artist

import { payoutArtist } from "@/lib/cdp/payouts"

const result = await payoutArtist("0x1234...")
console.log(`Paid ${result.amount} USDC, tx: ${result.txHash}`)

Batch Send Tokens

import { batchSendTokens } from "@/lib/cdp/client"

const recipients = [
  { address: "0x1234...", amount: "100.50" },
  { address: "0x5678...", amount: "250.75" }
]

const txHashes = await batchSendTokens(recipients, "usdc")

Resources