signTempoTransaction from @dynamic-labs-sdk/tempo/waas produces the sender’s half: it signs with an embedded Tempo wallet and returns the signed transaction without broadcasting it.
The SDK signs for the sender only. Your app provides the sponsor that adds its signature and broadcasts the transaction. This guide covers the sender’s side.
Sign a transaction that awaits a fee payer
SetawaitingFeePayer to true. The wallet signs the transaction as one whose fee a sponsor will pay, and the function returns the serialized signed transaction in signedTransaction.
signedTransaction to your sponsor service. It is a signed Tempo transaction that still needs the fee payer’s signature, so it cannot be broadcast as it is.
Parameters
signTempoTransaction accepts the same Tempo fields as sendTempoTransaction, plus awaitingFeePayer.
Leave
awaitingFeePayer out and signTempoTransaction returns a signed transaction that the sender pays for, which you can broadcast yourself.
Returns
Promise<{ signedTransaction: string }>. The value is the serialized signed transaction. Nothing is sent to the network.
Rules
The sponsor chooses the fee token, so a transaction that awaits a fee payer cannot name one. PassingawaitingFeePayer together with feeToken throws TempoTransactionValidationError before the wallet signs, and so does an awaitingFeePayer value other than true.
A transaction that awaits a fee payer cannot be broadcast by the sender. sendTempoTransaction throws TempoTransactionValidationError when awaitingFeePayer is set, and so does the viem sendTransaction of the Tempo wallet client. Use signTempoTransaction for these transactions.
Errors
Related
- Pay fees with a TIP-20 token covers the case where the sender pays the fee.
- Tempo covers setup, transfers, and
sendTempoTransaction.