signAndSendTransactionWithSigners

function signAndSendTransactionWithSigners(
    signers,
    transaction,
    config?,
): Promise<SignatureBytes>;

Signs a transaction using the provided signers and sends it immediately to the blockchain.

It returns the signature of the sent transaction (i.e. its identifier) as bytes.

Similarly to partiallySignTransactionWithSigners, it first uses all TransactionModifyingSigners sequentially before using all TransactionPartialSigners in parallel. It then sends the transaction using the TransactionSendingSigner it identified.

Composite transaction signers are treated such that at least one sending signer is used if any. When a TransactionSigner implements more than one interface, we use it as a:

The provided signers must contain exactly one TransactionSendingSigner that can be unambiguously resolved. If more than one composite signers implement the TransactionSendingSigner interface, one of them will be selected as the sending signer. Otherwise, if multiple TransactionSendingSigners must be selected, the function will throw an error.

Parameters

ParameterTypeDescription
signersreadonly TransactionSigner[]The signers to use. Must contain at least one resolvable TransactionSendingSigner.
transactionTransactionThe compiled transaction to sign and send.
config?BaseTransactionSignerConfigOptional configuration including an AbortSignal.

Returns

Promise<SignatureBytes>

The signature of the sent transaction as bytes.

Example

const transactionSignature = await signAndSendTransactionWithSigners(mySigners, compiledTransaction);
 
// With additional config.
const transactionSignature = await signAndSendTransactionWithSigners(mySigners, compiledTransaction, {
    abortSignal: myAbortController.signal,
});

See

On this page