UNPKG

@bitte-ai/agent-sdk

Version:

Agent SDK for Bitte Protocol

13 lines (12 loc) 436 B
import * as chains from "viem/chains"; export const getShortDateTime = () => { return new Date().toISOString().slice(0, 16); }; const CHAINS_BY_CHAIN_ID = Object.fromEntries(Object.values(chains).map((chain) => [chain.id, chain])); export function getChainById(chainId) { const chain = CHAINS_BY_CHAIN_ID[chainId]; if (!chain) { throw new Error(`Could not find chain with ID: ${chainId}`); } return chain; }