MCPcopy Create free account
hub / github.com/cutupdev/Solana-Volume-Bot / build_bundle

Function build_bundle

executor/jito.ts:56–85  ·  view source on GitHub ↗
(
  search: SearcherClient,
  bundleTransactionLimit: number,
  txs: VersionedTransaction[],
  keypair: Keypair
)

Source from the content-addressed store, hash-verified

54
55
56async function build_bundle(
57 search: SearcherClient,
58 bundleTransactionLimit: number,
59 txs: VersionedTransaction[],
60 keypair: Keypair
61) {
62
63 const accounts = await search.getTipAccounts()
64 const _tipAccount = accounts[Math.min(Math.floor(Math.random() * accounts.length), 3)]
65 const tipAccount = new PublicKey(_tipAccount)
66
67 const bund = new Bundle([], bundleTransactionLimit)
68 const resp = await solanaConnection.getLatestBlockhash("processed")
69 bund.addTransactions(...txs)
70
71 let maybeBundle = bund.addTipTx(
72 keypair,
73 JITO_FEE,
74 tipAccount,
75 resp.blockhash
76 )
77
78 if (isError(maybeBundle)) {
79 throw maybeBundle
80 }
81 try {
82 await search.sendBundle(maybeBundle)
83 } catch (e) { }
84 return maybeBundle
85}
86
87export const onBundleResult = (c: SearcherClient): Promise<number> => {
88 let first = 0

Callers 1

bull_dozerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected