This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import web3 from "@solana/web3.js"; | |
import mmw from "@raydium-io/raydium-sdk"; | |
import QuickLRU from "quick-lru"; | |
////////////////////////////////////////////////// | |
export const OPAQUE_SIGNATURE = "1111111111111111111111111111111111111111111111111111111111111111"; | |
export const SIGNATURE_PROGRAM = "Program "; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import web3 from "@solana/web3.js"; | |
import * as BufferLayout from "@solana/buffer-layout"; | |
import bs58 from "bs58"; | |
////////////////////////////////////////////////// | |
class BorshString extends BufferLayout.Layout<string> { | |
constructor(property?: string) { | |
super(-1, property); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as web3 from "@solana/web3.js"; | |
import * as spl from "@solana/spl-token"; | |
import bs58 from "bs58"; | |
import GeyserClient, { | |
SubscribeRequest as GeyserSubscribeRequest, | |
SubscribeUpdate as GeyserSubscribeUpdate, | |
CommitmentLevel as GeyserCommitmentLevel, | |
} from "@triton-one/yellowstone-grpc"; | |
import { ClientDuplexStream } from "@grpc/grpc-js"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as web3 from "@solana/web3.js"; | |
import bs58 from "bs58"; | |
////////////////////////////////////////////////// | |
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); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as web3 from "@solana/web3.js"; | |
import { TOKEN_PROGRAM_ID, unpackMint, Mint } from "@solana/spl-token"; | |
////////////////////////////////////////////////// | |
async function getTokenInfo(conn: web3.Connection, tokenMint: web3.PublicKey): Promise<Mint | null> { | |
const info = await conn.getAccountInfo(tokenMint); | |
if (!info) return null; | |
try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as web3 from "@solana/web3.js"; | |
import { | |
MPL_TOKEN_METADATA_PROGRAM_ID, | |
MetadataAccountData as MplMetadataAccountData, | |
getMetadataAccountDataSerializer, | |
} from "@metaplex-foundation/mpl-token-metadata"; | |
////////////////////////////////////////////////// | |
const METAPLEX_PROGRAM_ID = new web3.PublicKey(MPL_TOKEN_METADATA_PROGRAM_ID); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.1.0", | |
"name": "pump", | |
"instructions": [ | |
{ | |
"name": "initialize", | |
"docs": [ "Creates the global state." ], | |
"accounts": [ | |
{ "name": "global" , "isMut": true , "isSigner": false }, | |
{ "name": "user" , "isMut": true , "isSigner": true }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as web3 from "@solana/web3.js"; | |
import bs58 from "bs58"; | |
////////////////////////////////////////////////// | |
function findInstructionsInTransaction( | |
tx: web3.ParsedTransactionWithMeta, | |
predicate?: (instruction: web3.ParsedInstruction | web3.PartiallyDecodedInstruction, outerInstruction: (web3.ParsedInstruction | web3.PartiallyDecodedInstruction) | null) => boolean, | |
): Array<web3.ParsedInstruction | web3.PartiallyDecodedInstruction> { | |
if (!tx || !tx.meta || !tx.transaction || !tx.transaction.message || !tx.transaction.message.instructions) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as raydium from "@raydium-io/raydium-sdk-v2"; | |
////////////////////////////////////////////////// | |
const RAYDIUM_CLMM_SOL_USDC_ID = "2QdhepnKRTLjjSqPL1PtKNwqrUkoLee5Gqs8bvZhRdMv"; | |
function normalizeRaydiumBetaPoolInfoResponse(response: raydium.ApiV3PoolInfoItem[] | raydium.ApiV3PageIns<raydium.ApiV3PoolInfoItem>): raydium.ApiV3PoolInfoItem[] { | |
if (response === null || typeof response !== "object") { | |
return []; | |
} |