File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
1111 PublicKey ,
1212 Transaction ,
1313 TransactionInstruction ,
14+ sendAndConfirmRawTransaction ,
1415 sendAndConfirmTransaction ,
1516} from "@solana/web3.js" ;
1617import { LedgerNodeWallet } from "./ledger" ;
@@ -169,9 +170,14 @@ export async function executeOrPropose(
169170 ) ;
170171 } else {
171172 const tx = new Transaction ( ) . add ( instruction ) ;
172- const sig = await sendAndConfirmTransaction ( connection , tx , [
173- ( wallet as Wallet ) . payer ,
174- ] ) ;
173+ const { blockhash } = await connection . getLatestBlockhash ( ) ;
174+ tx . recentBlockhash = blockhash ;
175+ tx . feePayer = wallet . publicKey ;
176+ await wallet . signTransaction ( tx ) ;
177+ const sig = await sendAndConfirmRawTransaction (
178+ connection ,
179+ tx . serialize ( )
180+ ) ;
175181 console . log ( `Signature: ${ sig } ` ) ;
176182 }
177183 } catch ( err ) {
You can’t perform that action at this time.
0 commit comments