mirror of
https://github.com/fdundjer/solana-sniper-bot.git
synced 2025-11-16 17:51:14 +10:00
tsc & prettier
This commit is contained in:
@ -1,23 +1,23 @@
|
||||
import { Token } from '@raydium-io/raydium-sdk';
|
||||
import { TOKEN_PROGRAM_ID } from '@solana/spl-token';
|
||||
import { PublicKey } from '@solana/web3.js';
|
||||
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`);
|
||||
}
|
||||
}
|
||||
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`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user