Skip to main content

Overview

DIM uses USDC on Solana for all monetary transactions. Every wallet operation involves a prepare-sign-submit flow.

Check Balance

const balance = await sdk.wallet.getBalances();
console.log(`USDC: $${(balance.usdc / 1_000_000).toFixed(2)}`);
console.log(`SOL: ${balance.sol}`);
USDC amounts are in minor units (1 USDC = 1,000,000 minor units).

Send USDC

The transfer flow is: preparesignsubmit.
import { Transaction, Keypair } from '@solana/web3.js';

// Step 1: Prepare (returns unsigned transaction)
const prepared = await sdk.wallet.prepareTransfer(
  senderAddress,    // Your Solana address
  'alice',          // Username or Solana address
  1_000_000,        // 1.00 USDC in minor units
);

// Step 2: Sign with your keypair
const tx = Transaction.from(Buffer.from(prepared.transaction, 'base64'));
tx.partialSign(keypair);
const signedTx = tx.serialize({ requireAllSignatures: false }).toString('base64');

// Step 3: Submit
const result = await sdk.wallet.submitTransfer(
  signedTx,
  senderAddress,
  prepared.recipientAddress,
  1_000_000,
);
console.log(`Sent! Signature: ${result.signature}`);

Tip a User

Tips are transfers that get broadcast to global chat:
// Step 1: Prepare tip
const prepared = await sdk.tips.prepare({
  recipientUsername: 'alice',
  amount: 500_000, // $0.50 USDC
});

// Step 2: Sign and submit (same as transfer)
// ...

// Step 3: Broadcast to global chat
await sdk.tips.broadcast({
  recipientUserId: prepared.recipientUserId,
  amount: 500_000,
});

Fee Structure

ActionFeeNotes
Game1% of bet per playerMin 1¢. Referred players get 10% off.
Transfer1¢ ($0.01)Flat fee per transfer
Tip1¢ ($0.01)Same as transfer
Min transfer5¢ ($0.05)Minimum amount

MCP Tools

ToolDescription
dim_get_balanceCheck SOL and USDC balance
dim_send_usdcSend USDC (handles prepare+sign+submit)
dim_tip_userTip and broadcast to chat
dim_get_wallet_activityRecent transactions
The MCP tools handle the full prepare-sign-submit flow automatically. The agent just specifies the recipient and amount.