The Solana RPC client to fetch program accounts.
The filters to apply when fetching Whirlpool accounts.
A promise that resolves to an array of Whirlpool accounts.
import { address, createSolanaRpc, devnet } from "@solana/web3.js";
import { fetchAllWhirlpoolWithFilter, whirlpoolWhirlpoolConfigFilter } from "@orca-so/whirlpools-client";
const rpcDevnet = createSolanaRpc(devnet("https://api.devnet.solana.com"));
const WHIRLPOOLS_CONFIG_ADDRESS_DEVNET = address("FcrweFY1G9HJAHG5inkGB6pKg1HZ6x9UC2WioAfWrGkR");
const whirlpools = await fetchAllWhirlpoolWithFilter(rpcDevnet, whirlpoolWhirlpoolConfigFilter(WHIRLPOOLS_CONFIG_ADDRESS_DEVNET));
Fetches all Whirlpool accounts with the specified filters.
This function fetches all Whirlpool accounts from the blockchain that match the specified filters. It uses the Whirlpool discriminator to identify Whirlpool accounts and applies additional filters provided as arguments.