Skip to content

Instantly share code, notes, and snippets.

View stegaBOB's full-sized avatar

Sammy Harris stegaBOB

View GitHub Profile
@stegaBOB
stegaBOB / optimalTransaction.ts
Last active April 22, 2024 15:42
Gets an optimal transaction with priority fees and minimum CU limits in parallel with Promise.all
async function getPriorityFees(instructions: TransactionInstruction[]): Promise<number> {
// replace with real function
return 426;
}
async function getSimulationUnits(
connection: Connection,
instructions: TransactionInstruction[],
payer: PublicKey,
lookupTables: AddressLookupTableAccount[]
@waylan
waylan / foo.sh
Created November 15, 2012 18:39
Simple bash subcommands. Each subcommand is implemented as a function. For example, `sub_funcname` is called for `funcname` subcommand.
#!/bin/sh
ProgName=$(basename $0)
sub_help(){
echo "Usage: $ProgName <subcommand> [options]\n"
echo "Subcommands:"
echo " bar Do bar"
echo " baz Run baz"
echo ""