-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Description
Mainnet connnection code :
import {
Connection,
Keypair,
PublicKey,
Transaction,
sendAndConfirmTransaction,
} from '@solana/web3.js';
import DLMM from '@meteora-ag/dlmm';
import { BN } from '@coral-xyz/anchor';
import * as fs from 'fs';
// Connections for both mainnet and local Surfpool
const mainnetConnection = new Connection('https://api.mainnet-beta.solana.com', 'confirmed');
const localConnection = new Connection('http://localhost:8899', 'confirmed');
console.log("🌐 Connections initialized");
// Load wallet
const wallet = Keypair.fromSecretKey(
Uint8Array.from(JSON.parse(fs.readFileSync("wallet-keypair.json", "utf-8")))
);
console.log("✅ Wallet loaded:", wallet.publicKey.toString());
async function fetchPoolData() {
console.log("🔍 Fetching pool data from mainnet...");
const POOL_ID = '7LLrF1cVVmE1oBAqTezHPByu3JD5t9X7qcv9jSv6FMzv';
console.log("staring the pool fetch from mainnet");
const dlmmPool = await DLMM.create(mainnetConnection, new PublicKey(POOL_ID));
console.log("✅ Successfully fetched pool data");
}
// Run the example
fetchPoolData();Metadata
Metadata
Assignees
Labels
No labels