TransactionSendingSigner
TransactionSendingSigner<
TAddress
> =Readonly
<{address
:Address
<TAddress
>;signAndSendTransactions
:Promise
<readonlySignatureBytes
[]>; }>
A signer interface that signs one or multiple transactions before sending them immediately to the blockchain.
It defines a TransactionSendingSignerConfig#signAndSendTransactions | signAndSendTransactions function that returns the transaction signature (i.e. its identifier) for each provided CompilableTransaction.
This interface is required for PDA wallets and other types of wallets that don't provide an interface for signing transactions without sending them.
Note that it is also possible for such signers to modify the provided transactions before signing and sending them. This enables use cases where the modified transactions cannot be shared with the app and thus must be sent directly.
Type Parameters
Type Parameter | Default type | Description |
---|---|---|
TAddress extends string | string | Supply a string literal to define a signer having a particular address. |
Example
Remarks
Here are the main characteristics of this signer interface:
- Single signer. Since this signer also sends the provided transactions, we can only use a single TransactionSendingSigner for a given set of transactions.
- Last signer. Trivially, that signer must also be the last one used.
- Potential conflicts. Since signers may decide to modify the given transactions before sending them, they may invalidate previous signatures. However, signers may decide not to modify a transaction based on the existence of signatures for that transaction.
- Potential confirmation. Whilst this is not required by this interface,
it is also worth noting that most wallets will also wait for the transaction
to be confirmed (typically with a
confirmed
commitment) before notifying the app that they are done.