Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

1.0 KB
Raw Blame
// Normalize a stored tip/payout network identifier to the chain key the club
// payout senders and dancer-wallet columns are keyed on.
//
// club_tips.network is written from the x402 requirement, so a SETTLED tip
// carries a CAIP-2 chain id ('solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp',
// 'eip155:8453'), while a BYPASS (free-pass) ticket carries the bare chain key
// ('solana', 'base'). Both forms denote the same chain. The sweep compares
// `network === 'solana'` to choose the recipient column and per-network sender,
// so without this collapse every settled Solana tip falls through to the EVM
// branch and is skipped as "no wallet" even when a Solana address is registered.
//
// Unknown values pass through unchanged so they surface as an explicit
// "unsupported network" downstream rather than being silently mis-routed.
export function chainOf(network) {
	const n = String(network || '').trim().toLowerCase();
	if (n === 'solana' || n.startsWith('solana:')) return 'solana';
	if (n === 'base' || n === 'eip155:8453') return 'base';
	return n;
}