お試しください。
Installethers with pnpm install ethers or yarn add ethers
Ensure to choose a network handle from our network options
And acquire a Sequence Builder access key to authenticate your connection and append to the endpoint
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
ethers with pnpm install ethers or yarn add ethers
Ensure to choose a network handle from our network options
And acquire a Sequence Builder access key to authenticate your connection and append to the endpoint
// Import the ethers library
import { ethers } from "ethers";
// Function to create a provider and fetch the latest block
async function getLatestBlock() {
// Replace the following URL with your actual RPC endpoint
const rpcUrl =
"https://nodes.sequence.app/<chain_handle>/<project_access_key>";
// Create a provider using the RPC URL
const provider = new ethers.providers.JsonRpcProvider(rpcUrl);
// Fetch the latest block
const latestBlock = await provider.getBlock("latest");
console.log("Latest Block:", latestBlock);
}
// Call the function to get the latest block
getLatestBlock().catch(console.error);
このページは役に立ちましたか?