ts: comment out, tsc complains

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
microwavedcola1 2022-10-07 14:05:49 +02:00
parent 8e919bb741
commit 8f6fa5134d
1 changed files with 10 additions and 16 deletions

View File

@ -4,7 +4,6 @@ import {
Transaction, Transaction,
TransactionInstruction, TransactionInstruction,
} from '@solana/web3.js'; } from '@solana/web3.js';
import { buildVersionedTx } from '../utils';
export async function sendTransaction( export async function sendTransaction(
provider: AnchorProvider, provider: AnchorProvider,
@ -17,22 +16,17 @@ export async function sendTransaction(
opts.preflightCommitment, opts.preflightCommitment,
); );
let tx: Transaction = new Transaction(); const payer = (provider as AnchorProvider).wallet;
const altsEnabled = false; // const tx = await buildVersionedTx(provider, ixs, opts.additionalSigners, alts);
if (altsEnabled) { const tx = new Transaction();
tx = await buildVersionedTx(provider, ixs, opts.additionalSigners, alts); tx.recentBlockhash = latestBlockhash.blockhash;
} else { tx.lastValidBlockHeight = latestBlockhash.lastValidBlockHeight;
const payer = (provider as AnchorProvider).wallet; tx.feePayer = payer.publicKey;
tx = new Transaction(); tx.add(...ixs);
tx.recentBlockhash = latestBlockhash.blockhash; if (opts.additionalSigners?.length > 0) {
tx.lastValidBlockHeight = latestBlockhash.lastValidBlockHeight; tx.partialSign(...opts.additionalSigners);
tx.feePayer = payer.publicKey;
tx.add(...ixs);
if (opts.additionalSigners?.length > 0) {
tx.partialSign(...opts.additionalSigners);
}
await payer.signTransaction(tx);
} }
await payer.signTransaction(tx);
const signature = await connection.sendRawTransaction(tx.serialize(), { const signature = await connection.sendRawTransaction(tx.serialize(), {
skipPreflight: true, skipPreflight: true,