File tree 1 file changed +14
-7
lines changed
1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
11
11
PublicKey ,
12
12
SendTransactionError ,
13
13
TransactionExpiredBlockheightExceededError ,
14
+ TransactionMessage ,
14
15
} from '@solana/web3.js' ;
15
16
import type {
16
17
Network ,
@@ -207,18 +208,24 @@ export class SolanaSendSigner<
207
208
for ( let i = 0 ; i < maxRetries ; i ++ ) {
208
209
try {
209
210
if ( isVersionedTransaction ( transaction ) ) {
211
+ if ( priorityFeeIx ) {
212
+ const msg = TransactionMessage . decompile ( transaction . message ) ;
213
+ msg . instructions . push ( ...priorityFeeIx ) ;
214
+ transaction . message = msg . compileToV0Message ( ) ;
215
+ }
216
+ transaction . message . recentBlockhash = blockhash ;
217
+ transaction . sign ( [ this . _keypair , ...( extraSigners ?? [ ] ) ] ) ;
210
218
} else {
211
219
if ( priorityFeeIx ) transaction . add ( ...priorityFeeIx ) ;
212
-
213
220
transaction . recentBlockhash = blockhash ;
214
221
transaction . partialSign ( this . _keypair , ...( extraSigners ?? [ ] ) ) ;
215
-
216
- const txid = await this . _rpc . sendRawTransaction (
217
- transaction . serialize ( ) ,
218
- this . _sendOpts ,
219
- ) ;
220
- txids . push ( txid ) ;
221
222
}
223
+
224
+ const txid = await this . _rpc . sendRawTransaction (
225
+ transaction . serialize ( ) ,
226
+ this . _sendOpts ,
227
+ ) ;
228
+ txids . push ( txid ) ;
222
229
break ;
223
230
} catch ( e ) {
224
231
// No point checking if retryable if we're on the last retry
You can’t perform that action at this time.
0 commit comments