Skip to content

Commit f7de56e

Browse files
committed
fix: Phantom pays L1 fees, burner cosigns as submitter
sendL1WithBurner now uses dual-signer pattern: - Phantom = feePayer (has SOL) - Burner = partialSign (submitter/claimer) Burner signs first, then Phantom signs via wallet extension
1 parent 796c121 commit f7de56e

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

client/src/App.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)