This file contains 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 os | |
import schedule | |
import time | |
import tweepy | |
import textwrap | |
from dotenv import load_dotenv | |
from random import randint | |
from openai import OpenAI | |
This file contains 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
TELEGRAM_BOT_TOKEN=your-telegram-bot-token | |
PRIVATE_KEY=your-wallet-private-key | |
SOLANA_RPC_ENDPOINT=https://api.mainnet-beta.solana.com | |
FIXED_AMOUNT=1 # Replace with the fixed amount you want to buy every time |
This file contains 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
// SOL to SPL token price | |
use anyhow::{format_err, Result}; | |
use reqwest::Client; | |
use serde::{Deserialize, Serialize}; | |
use serde_json::Value; | |
use std::collections::HashMap; | |
use std::error::Error as StdError; | |
use std::time::{SystemTime, UNIX_EPOCH}; | |
// Constants |
This file contains 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
// get_address_from_txid.rs | |
use bdk::bitcoin::{Txid, Network}; | |
use bdk::bitcoin::util::address::Address; | |
use bdk::electrum_client::Client as ElectrumClient; | |
use bdk::bitcoin::consensus::encode::deserialize; | |
use bdk::bitcoin::Transaction as BitcoinTransaction; | |
use bdk::electrum_client::ElectrumApi; | |
use bdk::bitcoin::psbt::serialize::Serialize; | |
use std::str::FromStr; |
This file contains 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
[package] | |
name = "juptest" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
tokio = { version = "1", features = ["full"] } | |
solana-sdk = "1.16" | |
jupiter-swap-api-client = "0.1.0" | |
reqwest = "0.11.10" # Use a compatible version of reqwest |
This file contains 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
[package] | |
name = "raytest" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
anyhow = "1.0" | |
reqwest = { version = "0.11", features = ["blocking", "json"] } | |
serde = { version = "1.0", features = ["derive"] } | |
serde_json = "1.0" |
This file contains 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 solana_sdk::{signature::Keypair, signer::Signer}; | |
use bs58; | |
fn main() { | |
let wallet = Keypair::new(); | |
let public_key_base58 = bs58::encode(wallet.pubkey().to_bytes()).into_string(); | |
let secret_key_base58 = bs58::encode(wallet.to_bytes()).into_string(); | |
println!("Public Key (Base58): {}\nSecret Key (Base58): {}\n", public_key_base58, secret_key_base58); | |
} |
This file contains 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
#!/bin/bash | |
# Function to export variables from .env file | |
export_env_vars() { | |
local env_file=$1 | |
if [ ! -f "$env_file" ]; then | |
echo "The file $env_file does not exist." | |
return 1 | |
fi |
This file contains 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
// A server that receives POST data that is printed to the console for debugging purposes | |
const http = require('http'); | |
const server = http.createServer((req, res) => { | |
if (req.method === 'POST') { | |
let data = ''; | |
req.on('data', (chunk) => { | |
data += chunk; | |
}); |
This file contains 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 TELEGRAM_BOT_TOKEN = BOT_TOKEN; | |
const TELEGRAM_CHAT_ID = CHAT_ID; | |
const HELIUS_API_KEY = API_KEY; | |
const HELIUS_RPC_URL = `https://mainnet.helius-rpc.com/?api-key=${HELIUS_API_KEY}`; | |
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request)); | |
}); | |
async function handleRequest(request) { |
NewerOlder