mirror of
https://github.com/fdundjer/solana-sniper-bot.git
synced 2025-11-15 09:11:18 +10:00
tsc & prettier
This commit is contained in:
20
helpers/token.js
Normal file
20
helpers/token.js
Normal file
@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getToken = void 0;
|
||||
const raydium_sdk_1 = require("@raydium-io/raydium-sdk");
|
||||
const spl_token_1 = require("@solana/spl-token");
|
||||
const web3_js_1 = require("@solana/web3.js");
|
||||
function getToken(token) {
|
||||
switch (token) {
|
||||
case "WSOL": {
|
||||
return raydium_sdk_1.Token.WSOL;
|
||||
}
|
||||
case "USDC": {
|
||||
return new raydium_sdk_1.Token(spl_token_1.TOKEN_PROGRAM_ID, new web3_js_1.PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"), 6, "USDC", "USDC");
|
||||
}
|
||||
default: {
|
||||
throw new Error(`Unsupported quote mint "${token}". Supported values are USDC and WSOL`);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.getToken = getToken;
|
||||
Reference in New Issue
Block a user