Skip to content

Instantly share code, notes, and snippets.

View lainhathoang's full-sized avatar
Farming

lainhathoang

Farming
View GitHub Profile
{
"tokenLedgerInstruction": null,
"computeBudgetInstructions": [
{
"programId": "ComputeBudget111111111111111111111111111111",
"accounts": [],
"data": "ApxABgA="
}
],
"setupInstructions": [
import { Connection, Keypair, VersionedTransaction } from '@solana/web3.js';
import axios from 'axios';
import * as fs from 'fs';
const connection = new Connection(
'https://mainnet.helius-rpc.com/?api-key=8f8d35ff-50fa-4538-b033-ee1de0785ac0',
);
const keypair = Keypair.fromSecretKey(
Uint8Array.from(
@lainhathoang
lainhathoang / jupiter-full-js-example.js
Created November 5, 2024 16:44 — forked from NotoriousPyro/jupiter-full-js-example.js
Full example of how to swap tokens with jupiter
const { Connection, Keypair, VersionedTransaction } = require ('@solana/web3.js');
const bs58 = require ('bs58');
const axios = require('axios');
// It is recommended that you use your own RPC endpoint.
// This RPC endpoint is only for demonstration purposes so that this example will run.
const connection = new Connection('');
const keypair = Keypair.fromSecretKey(bs58.decode(''));
import { Wallet } from '@project-serum/anchor';
import {
AddressLookupTableAccount,
Connection,
Keypair,
PublicKey,
TransactionInstruction,
TransactionMessage,
VersionedTransaction,
} from '@solana/web3.js';
{
"name": "USDC",
"symbol": "USDC",
"description": "$USDC TOKEN",
"image": "https://cryptologos.cc/logos/usd-coin-usdc-logo.png"
}
{
"name": "Hau bu",
"symbol": "HAU",
"description": "HAU BUUBUBUBUBUBUBUBUBUBU",
"image": "https://bqn.1cdn.vn/2020/04/19/images.baoquangnam.vn-storage-newsportal-2020-4-17-87061-_sua-ong-tho1.jpg",
"attributes": [
{
"trait_type": "Sua",
"value": "1 hop"
},
@lainhathoang
lainhathoang / swap.ts
Last active September 18, 2024 03:28
import { ApiV3PoolInfoStandardItem, AmmV4Keys, AmmRpcData } from '@raydium-io/raydium-sdk-v2'
import { initSdk, txVersion } from '../config'
import BN from 'bn.js'
import { isValidAmm } from './utils'
import Decimal from 'decimal.js'
import { NATIVE_MINT } from '@solana/spl-token'
export const swap = async () => {
const raydium = await initSdk()
// const amountIn = 0.05 * 10 ** 9
{
"name": "TEST X Token",
"symbol": "TXT",
"description": "$TEST X Token",
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTuajzjd8b7PNaEpkYgYgWYA-IjIsRMHta1UQ&s"
}
@lainhathoang
lainhathoang / multiple_ssh_setting.md
Created August 30, 2024 06:45 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
{
"name": "DONE Token",
"symbol": "DONE",
"description": "$DONE Token",
"image": "https://gray-capitalist-cephalopod-696.mypinata.cloud/ipfs/Qmf9gDiVV2eioW7kveUkGbiQaXc8zJwzzYzuQVDr7WvrGt"
}