This file contains hidden or 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
use web3::types::{H160, U256}; | |
use web3::contract::{Contract, Options}; | |
use std::str::FromStr; | |
use std::time::Duration; | |
use tokio::time; | |
// Define DEX struct | |
struct DEX { | |
name: String, | |
router_address: H160, |
This file contains hidden or 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
from adbkit import ADBTools | |
from kthread_sleep import sleep | |
from mydevice import deviceserial | |
def get_uiautomator_frame(screenshotfolder='c:\\ttscreenshots'): | |
if screenshotfolder: | |
adb.aa_update_screenshot() | |
df = adb.aa_get_all_displayed_items_from_uiautomator( | |
screenshotfolder=screenshotfolder, # screenshots will be saved here | |
max_variation_percent_x=10, |
This file contains hidden or 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
from web3 import Web3 | |
import os | |
from dotenv import load_dotenv | |
from web3.middleware import geth_poa_middleware | |
# from web3.middleware import ( | |
# async_geth_poa_middleware, | |
# ) | |
import asyncio | |
# Load environment variables |
This file contains hidden or 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
const fetchTokenPrice = async () => { | |
const tokenAddress = '0xB96D0f29a0aC9AF4a32835e90EC6531389765089'; | |
const tokenAddress2 = '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c'; | |
const data1 = await publicClient.readContract({ | |
address: '0x93accdaf2a9bb95d83d28cd19bc00d08be8741f9', | |
abi: pancakePairAbi, | |
functionName: 'getReserves', | |
}); |
This file contains hidden or 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 asyncio | |
import time | |
from web3 import Web3 | |
from web3.middleware import geth_poa_middleware | |
import aiohttp | |
from colorama import Fore, Style, init | |
import ssl | |
import certifi | |
from decimal import Decimal |
This file contains hidden or 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 asyncio | |
import aiohttp | |
from web3 import Web3 | |
from web3.middleware import geth_poa_middleware | |
from colorama import Fore, Back, Style, init | |
# Initialize colorama | |
init(autoreset=True) | |
# กำหนดค่าการเชื่อมต่อกับ Polygon network |
This file contains hidden or 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
const ethers = require('ethers'); | |
const { ChainId, Token, Fetcher, Route, Trade, TokenAmount, TradeType, Percent } = require('@uniswap/sdk'); | |
const { abi: IUniswapV2PairABI } = require('@uniswap/v2-core/build/IUniswapV2Pair.json'); | |
const { abi: IUniswapV2Router02ABI } = require('@uniswap/v2-periphery/build/IUniswapV2Router02.json'); | |
// Configuration | |
const ALCHEMY_URL = 'https://eth-mainnet.g.alchemy.com/v2/jssjArgnoSmS2Uv5RMVwQAySLhkBsOnJ'; | |
//const ALCHEMY_URL_TESTNET = 'https://eth-sepolia.g.alchemy.com/v2/jssjArgnoSmS2Uv5RMVwQAySLhkBsOnJ'; | |
const DAI_ADDRESS = '0x6B175474E89094C44Da98b954EedeAC495271d0F'; | |
const WETH_ADDRESS = '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2'; |
This file contains hidden or 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
const ccxt = require('ccxt'); | |
const ethers = require('ethers'); | |
const Web3 = require('web3'); | |
// Configuration | |
const config = { | |
bybit: { | |
apiKey: 'YOUR_BYBIT_API_KEY', | |
secret: 'YOUR_BYBIT_SECRET', | |
}, |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<Context> | |
<!-- database configurations --> | |
<Parameter name="JDBC.driver" value="org.postgresql.Driver"/> | |
<Parameter name="JDBC.url" value="jdbc:postgresql://localhost:5432/hmdm"/> | |
<Parameter name="JDBC.username" value="postgres"/> | |
<Parameter name="JDBC.password" value="new_password"/> | |
<!-- This directory is used to as a base directory to store app data --> | |
<Parameter name="base.directory" value="/var/lib/tomcat9/work"/> |
This file contains hidden or 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
let pancakeSwapAbi = [ | |
{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsOut","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"}, | |
]; | |
let tokenAbi = [ | |
{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}, | |
]; | |
const Web3 = require('web3'); | |
/* | |
Required Node.js |