File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -485,12 +485,16 @@ function App() {
485485 }
486486 }
487487
488- // Send L1 tx signed by the burner keypair (for steps where burner is the authorized signer)
488+ // Send L1 tx where Phantom pays fees but burner is also a signer (e.g. as submitter/claimer )
489489 async function sendL1WithBurner ( tx : Transaction ) : Promise < string > {
490- tx . feePayer = erBurner . publicKey
490+ if ( ! publicKey || ! signTransaction ) throw new Error ( 'Wallet not connected' )
491+ // Phantom pays the fee
492+ tx . feePayer = publicKey
491493 tx . recentBlockhash = ( await connection . getLatestBlockhash ( 'confirmed' ) ) . blockhash
492- tx . sign ( erBurner )
493- const raw = tx . serialize ( )
494+ // Burner signs first (as submitter), then Phantom signs (as fee payer)
495+ tx . partialSign ( erBurner )
496+ const phantomSigned = await signTransaction ( tx )
497+ const raw = phantomSigned . serialize ( )
494498 const sig = await connection . sendRawTransaction ( raw , { skipPreflight : true } )
495499 const timeout = new Promise < never > ( ( _ , reject ) =>
496500 setTimeout ( ( ) => reject ( new Error ( 'Confirmation timeout (30s)' ) ) , 30000 )
You can’t perform that action at this time.
0 commit comments