This file contains 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"; | |
////////////////////////////////////////////////// | |
export class BorshBoolean extends BufferLayout.Layout<boolean> { | |
constructor(property?: string) { | |
super(1, property); | |
} |
This file contains 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
// --- `@solana/web3.js` v1 --- | |
import web3 from '@solana/web3.js'; | |
(async (rpcUrl: string) => { | |
const rpc = new web3.Connection(rpcUrl); | |
const subject = new web3.PublicKey('j1oAbxxiDUWvoHxEDhWE7THLjEkDQW2cSHYn2vttxTF'); | |
const signatures = await rpc.getSignaturesForAddress(subject, { | |
limit: 1000, | |
}, 'finalized'); |
This file contains 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 type { | |
Commitment, | |
TransactionForAccounts, | |
TransactionForFullBase58, | |
TransactionForFullBase64, | |
TransactionForFullJsonParsed, | |
} from '@solana/rpc-types'; | |
import type { TransactionVersion } from '@solana/transaction-messages'; | |
import type { Address } from '@solana/addresses'; | |
import type { Signature } from '@solana/keys'; |
This file contains 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 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 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 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 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 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 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 }, |
NewerOlder