Docs · guide · TypeScript
Solana web3.js with FlexYield
Connection with httpHeaders against the Solana mainnet slug.
Install
npm i @solana/web3.js
Connect and call
import { Connection } from "@solana/web3.js";
const connection = new Connection("https://flexyield.io/rpc/solana_mainnet", {
commitment: "confirmed",
httpHeaders: { Authorization: "Bearer fy_your_api_key" },
});
console.log(await connection.getSlot());
Replace fy_your_api_key with a key from your dashboard (free tier at registration). Chain slugs: eth_mainnet base_mainnet arbitrum_one optimism_mainnet polygon_pos solana_mainnet — each has its own measured page.
Notes
- getProgramAccounts is not offered (see /docs/methods/getProgramAccounts); getSignaturesForAddress and token account scans count 2 units.
All guides: integration guides · methods and limits · docs.