UNPKG

four-flap-meme-sdk

Version:

SDK for Flap bonding curve and four.meme TokenManager

31 lines (30 loc) 1.11 kB
import { JsonRpcProvider } from 'ethers'; export type FlapChain = 'BSC' | 'BASE' | 'XLAYER' | 'MORPH'; export type FetchMetaOptions = { ipfsGateway?: string; multicall3?: string; }; /** * 根据代币地址直接读取合约 metaURI()/meta()(IPFS CID),并拉取元数据 JSON。 */ export declare function getFlapMetaByAddress(chain: FlapChain, rpcUrl: string, tokenAddress: string, opts?: FetchMetaOptions): Promise<{ cid: string; data?: any; } | undefined>; export declare function getFlapMetasByAddresses(chain: FlapChain, rpcUrl: string, tokenAddresses: string[], opts?: FetchMetaOptions): Promise<Array<{ token: string; cid?: string; data?: any; imageUrl?: string; error?: string; }>>; /** * 使用 Multicall3 批量读取 metaURI()/meta(),metaURI 优先、meta 兜底。 */ export declare function getFlapMetaUrisWithMulticall(provider: JsonRpcProvider, chain: FlapChain, tokenAddresses: string[], multicall3?: string, ipfsGateway?: string): Promise<Array<{ token: string; cid?: string; data?: any; imageUrl?: string; error?: string; }>>;