Skip to content

Commit

Permalink
Merge pull request #83 from DarkFlorist/🦫
Browse files Browse the repository at this point in the history
change to 🦫 and fix text
  • Loading branch information
KillariDev authored Jan 29, 2024
2 parents 1c6cdbf + 694746a commit 43dc728
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/ts/components/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const SettingsModal = ({ display, appSettings }: { display: Signal<boolea
<input onInput={(e: JSX.TargetedEvent<HTMLInputElement>) => validateSimulationRelayEndpointInput(e.currentTarget.value)} value={simulationRelayEndpointInput.value.value} type='text' className='bg-transparent outline-none placeholder:text-gray-600' placeholder='https://' />
</div>
<div className={`flex flex-col justify-center border h-16 outline-none px-4 focus-within:bg-white/5 bg-transparent ${!submissionRelayEndpointInput.value.valid ? 'border-red-400' : 'border-white/50 focus-within:border-white/80'}`}>
<span className='text-sm text-gray-500'>Bundle Submit Relay URL</span>
<span className='text-sm text-gray-500'>Bundle Submission Relay URL</span>
<input onInput={(e: JSX.TargetedEvent<HTMLInputElement>) => validateAndSetSubmissionRelayEndpointInput(e.currentTarget.value)} value={submissionRelayEndpointInput.value.value} type='text' className='bg-transparent outline-none placeholder:text-gray-600' placeholder='https://' />
</div>
<div className={`flex flex-col justify-center border h-16 outline-none px-4 focus-within:bg-white/5 bg-transparent ${!priorityFeeInput.value.valid ? 'border-red-400' : 'border-white/50 focus-within:border-white/80'}`}>
Expand Down
8 changes: 7 additions & 1 deletion app/ts/library/flashbots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export async function simulateBundle(
}
}

let bundleId = 1
export async function sendBundle(bundle: Bundle, targetBlock: bigint, fundingAmountMin: bigint, provider: ProviderStore, signers: Signers, blockInfo: BlockInfo, appSettings: AppSettings) {
if (appSettings.blocksInFuture <= 0n) throw new Error('Blocks in future is negative or zero')

Expand All @@ -105,7 +106,12 @@ export async function sendBundle(bundle: Bundle, targetBlock: bigint, fundingAmo
maxBaseFee,
)

const payload = JSON.stringify({ jsonrpc: '2.0', method: 'eth_sendBundle', params: [{ txs, blockNumber: `0x${targetBlock.toString(16)}`, revertingTxHashes: [] }] })
const payload = JSON.stringify({
jsonrpc: '2.0',
method: 'eth_sendBundle',
id: bundleId++,
params: [{ txs, blockNumber: `0x${targetBlock.toString(16)}`, revertingTxHashes: [] }]
})
const flashbotsSig = `${await provider.authSigner.getAddress()}:${await provider.authSigner.signMessage(id(payload))}`
const request = await fetch(appSettings.submissionRelayEndpoint,
{ method: 'POST', body: payload, headers: { 'Content-Type': 'application/json', 'X-Flashbots-Signature': flashbotsSig } }
Expand Down

0 comments on commit 43dc728

Please sign in to comment.