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 * as nodeFetch from 'node-fetch'; | |
import fetch from 'fetch-retry' | |
import https from 'https'; | |
const _fetch = fetch(nodeFetch.default); | |
type FetchFn = typeof nodeFetch.default; | |
export type Fetcher = (...args: Parameters<FetchFn>) => ReturnType<FetchFn>; | |
export type FetcherWithCustomAgent = (agent: https.Agent) => Fetcher; | |
export const RetryFetcher: Fetcher = (...args) => { | |
const [url, init] = args; |
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 { RootDatabaseOptionsWithPath, open } from 'lmdb'; | |
import { addressLookupTableDBPath } from '../const'; | |
const addressLookupTableDBOptions: RootDatabaseOptionsWithPath = { | |
path: addressLookupTableDBPath, | |
cache: { // https://github.com/kriszyp/weak-lru-cache#weaklrucacheoptions-constructor | |
cacheSize: 16777216, // 16MB - maximum | |
clearKeptInterval: 100, | |
txnStartThreshold: 3 | |
}, |
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 { | |
Connection, | |
CreateNonceAccountParams, | |
Keypair, | |
NONCE_ACCOUNT_LENGTH, | |
PublicKey, | |
SystemProgram, | |
Transaction, | |
WithdrawNonceParams | |
} from "@solana/web3.js"; |
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 { Logs } from "@solana/web3.js"; | |
export default class Signatures { | |
private items: Logs[] = []; | |
private maxItems: number; | |
private signatureMap: Map<string, number>; | |
constructor(maxItems = 8192) { | |
this.maxItems = maxItems; | |
this.signatureMap = new Map(); |
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
pairs: # doesn't work well unless there is sufficient liquidity and the input token exists to swap | |
# FIAT | |
# NAME MARKETS LIST LAST UPDATE | |
- EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v # USDC 29.21k strict 2024-04-17 | |
- Ez2zVjw85tZan1ycnJ5PywNNxR6Gm4jbXQtZKyQNu3Lv # fUSDC 11 strict 2024-04-17 | |
- Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB # USDT 2.78k strict 2024-04-17 | |
- USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX # USDH 169 strict 2024-04-17 | |
- Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS # PAI 54 strict 2024-04-17 | |
#- A9mUU4qviSctJVPJdBJWkb28deg915LYJKrzQ19ji3FM # USDCet 19 strict 2024-04-17 | |
#- Dn4noZ5jgGfkntzcQSUZ8czkreiZ1ForXYoV2H8Dm7S1 # USDTet 8 strict 2024-04-17 |
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
try { | |
const signature = await connection.sendTransaction(tx, { | |
minContextSlot: blockAndContextInfoManager.minContextSlot, | |
maxRetries: 3, | |
skipPreflight: false | |
}); | |
await confirmTransaction(signature).then( | |
async => { | |
if (!knownSwapInstructions.has(routeHash)) { | |
knownSwapInstructions.set(routeHash, swapInfo); |
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
// By Pyro @ www.sexonsol.com | |
import { Console } from "node:console"; | |
/** Asynchronous Promise-based logger */ | |
export default class Logger extends Console { | |
public name: string; | |
constructor(name: string) { | |
super({ | |
stdout: process.stdout, | |
stderr: process.stderr, |
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
// By Pyro @ www.sexonsol.com | |
// Price class, basic types and interface for PriceManager provided for you: | |
import { QuoteResponse } from '@jup-ag/api'; | |
import { BigNumber } from 'bignumber.js'; | |
enum WellKnownTokenMint { | |
USDC = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", | |
USDCet = "A9mUU4qviSctJVPJdBJWkb28deg915LYJKrzQ19ji3FM", |
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 { | |
Instruction, | |
SwapInstructionsResponse | |
} from "@jup-ag/api"; | |
import { | |
AddressLookupTableAccount, | |
ComputeBudgetProgram, | |
Connection, | |
Keypair, | |
PublicKey, |
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
<# | |
.Synopsis | |
Automatically finds, runs and places Outlook into the system tray. | |
.Description | |
Automatically finds, runs and places Outlook into the system tray. | |
By default, Outlook will start full-screen even when you have the option to minimize tray enabled and start the app as minimized. |
NewerOlder