Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
联系支持
了解如何将 Tenderly Node RPC 配置为 wagmi transport:在 React dapp 中通过 createConfig 设置 chains、connectors 与各链的 HTTPS 端点,用可靠的节点连接驱动钱包、智能合约与交易相关的 React Hooks,附完整配置示例。
transports
import { createConfig, http } from 'wagmi' import { mainnet, base, baseSepolia, optimism } from 'wagmi/chains' import { injected, walletConnect, metaMask, safe } from 'wagmi/connectors' const projectId = '<WALLETCONNECT_PROJECT_ID>' export const config = createConfig({ chains: [mainnet, base, baseSepolia, optimism], connectors: [ injected(), walletConnect({ projectId }), metaMask(), safe(), ], transports: { [mainnet.id]: http(`https://mainnet.gateway.tenderly.co/${process.env.NEXT_PUBLIC_TENDERLY_NODE_ACCESS_KEY_MAINNET}`), [base.id]: http(`https://base.gateway.tenderly.co/${process.env.NEXT_PUBLIC_TENDERLY_NODE_ACCESS_KEY_BASE}`), [baseSepolia.id]: http(`https://base-sepolia.gateway.tenderly.co/${process.env.NEXT_PUBLIC_TENDERLY_NODE_ACCESS_KEY_BASE_SEPOLIA}`), [optimism.id]: http(`https://optimism.gateway.tenderly.co/${process.env.NEXT_PUBLIC_TENDERLY_NODE_ACCESS_KEY_OPTIMISM}`), }, })
const queryClient = new QueryClient(); export function App() { return ( <WagmiProvider config={config}> <QueryClientProvider client={queryClient}> <Home /> </QueryClientProvider> </WagmiProvider> ) }