- TS application listening port: 7777
|-- dist
|-- src
|-- .dockerignore
|-- Dockerfile
'use strict' | |
const web3 = require('@solana/web3.js') | |
const splToken = require('@solana/spl-token') | |
const bs = require('bs58') | |
const connection = new web3.Connection( | |
web3.clusterApiUrl('devnet'), | |
'confirmed', | |
) |
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) { |
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 []; | |
} |
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); |
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 { |
//SPDX-License-Identifier: Unlicense | |
pragma solidity ^0.8.0; | |
pragma abicoder v2; | |
import "@uniswap/v2-periphery/contracts/interfaces/IWETH.sol"; | |
import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol"; | |
import "@uniswap/v3-core/contracts/libraries/LowGasSafeMath.sol"; | |
import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol"; | |
import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol"; | |
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; |