Skip to content

Instantly share code, notes, and snippets.

View ruiqic's full-sized avatar
🇺🇬
expect the unexpectable

Rui Qi Chen ruiqic

🇺🇬
expect the unexpectable
View GitHub Profile
@ruiqic
ruiqic / transfer_spl_token.py
Last active January 8, 2025 22:04
Simple python script to transfer an SPL token using solana-py library. Keypair for Pub and Private key are to generated/derived using bip_utils library.
from solana.rpc.async_api import AsyncClient
from solana.transaction import Transaction
from spl.token.instructions import get_associated_token_address, transfer_checked, TransferCheckedParams
from spl.token.constants import TOKEN_PROGRAM_ID
from solders.pubkey import Pubkey
from solders.keypair import Keypair
from solders.compute_budget import set_compute_unit_limit, set_compute_unit_price
from bip_utils import Bip44
import asyncio