mirror of
https://github.com/fdundjer/solana-sniper-bot.git
synced 2025-11-09 20:12:06 +10:00
24 lines
535 B
TypeScript
24 lines
535 B
TypeScript
import { Token } from "@raydium-io/raydium-sdk";
|
|
import { TOKEN_PROGRAM_ID } from "@solana/spl-token";
|
|
import { PublicKey } from "@solana/web3.js";
|
|
|
|
export function getToken(token: string) {
|
|
switch (token) {
|
|
case "WSOL": {
|
|
return Token.WSOL;
|
|
}
|
|
case "USDC": {
|
|
return new Token(
|
|
TOKEN_PROGRAM_ID,
|
|
new PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),
|
|
6,
|
|
"USDC",
|
|
"USDC",
|
|
);
|
|
}
|
|
default: {
|
|
throw new Error(`Unsupported quote mint "${token}". Supported values are USDC and WSOL`);
|
|
}
|
|
}
|
|
}
|