signAndSendTransactionMessageWithSigners
signAndSendTransactionMessageWithSigners<
TTransactionMessage
>(transaction
,config?
):Promise
<SignatureBytes
>
Extracts all TransactionSigners inside the provided transaction message and uses them to sign it before sending it immediately to the blockchain.
It returns the signature of the sent transaction (i.e. its identifier) as bytes.
Type Parameters
Type Parameter | Description |
---|---|
TTransactionMessage extends Readonly <{ instructions : readonly Instruction <string , readonly (AccountLookupMeta <string , string > | AccountMeta <string >)[]>[]; version : TransactionVersion ; }> & TransactionMessageWithFeePayer<string> & TransactionMessageWithSigners | The inferred type of the transaction message provided. |
Parameters
Parameter | Type |
---|---|
transaction | TTransactionMessage |
config? | BaseTransactionSignerConfig |
Returns
Promise
<SignatureBytes
>
Example
Remarks
Similarly to the partiallySignTransactionMessageWithSigners function, 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:
- TransactionSendingSigner, if no other TransactionSendingSigner exists.
- TransactionModifyingSigner, if no other TransactionModifyingSigner exists.
- TransactionPartialSigner, otherwise.
The provided transaction must contain exactly one TransactionSendingSigner inside its account metas. 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.
If you'd like to assert that a transaction makes use of exactly one TransactionSendingSigner before calling this function, you may use the assertIsTransactionMessageWithSingleSendingSigner function.
Alternatively, you may use the isTransactionMessageWithSingleSendingSigner function to provide a fallback in case the transaction does not contain any sending signer.