Skip to content

Instantly share code, notes, and snippets.

View front123's full-sized avatar
🏠
I may be slow to respond.

front front123

🏠
I may be slow to respond.
  • China
View GitHub Profile
@front123
front123 / rpc_fetch_pump_token_price.ts
Created September 8, 2024 07:56 — forked from rubpy/rpc_fetch_pump_token_price.ts
Fetching Pump.fun bonding curve state and calculating price of token/SOL.
import * as web3 from "@solana/web3.js";
//////////////////////////////////////////////////
function readBytes(buf: Buffer, offset: number, length: number): Buffer {
const end = offset + length;
if (buf.byteLength < end) throw new RangeError("range out of bounds");
return buf.subarray(offset, end);
}