@alchemy/ 常见
这是被其他Alchemy包所消耗的低等包.
安装
npm install @alchemy/common viem
密钥导出
alchemyTransport- 用于Alchemy API(支持 API 密钥、 JWT 或直接 URL 认证) 的相容 HTTP 传输- 链式登记册 - 说吧
getAlchemyRpcUrl, (中文(简体) ),isChainSupported, (中文(简体) ),getSupportedChainIds - 自定义链 (通过)
@alchemy/common/chains——尚未入围的铁链 AlchemyRestClient- 非JSON-RPC Alchemy API的 REST 客户端- 错误类别 - 说吧
BaseError, (中文(简体) ),ChainNotFoundError, (中文(简体) ),AccountNotFoundError, (中文(简体) ),ConnectionConfigError等 (中文(简体) ). - 日志 - 说吧
createLogger, (中文(简体) ),setGlobalLoggerConfig, (中文(简体) ),LogLevel - 公用事业 - 说吧
bigIntMultiply, (中文(简体) ),bigIntMax, (中文(简体) ),lowerAddress, (中文(简体) ),assertNever
使用量
import { alchemyTransport } from "@alchemy/common";
import { sepolia } from "viem/chains";
import { createPublicClient } from "viem";
const client = createPublicClient({
chain: sepolia,
transport: alchemyTransport({ apiKey: "YOUR_API_KEY" }),
});
许可证
麻省理工学院