Enable Backend Approval Before Executing Signed Transactions in Embedded Wallet

We are using an embedded wallet and would like to ask if there is a way to allow the end user to sign the transaction, but instead of executing the transfer immediately, have our backend approve the transaction first before proceeding with the transfer.

I tried using the TAP rule, but it causes the API signer to sign the transaction before the end user does. However, I want the end user to sign the transaction first. Then, based on my business logic, I want to decide whether to allow the transaction to be executed.

Desired Flow:

Step 1: The end user signs the transaction.
Step 2: The Term Structure backend approves the transaction.
Step 3: The transaction execution begins.

Would there be a way to achieve this flow?

Hi @patrice – as the signature signing step is the final step before a transaction is broadcasted on-chain, there isn’t a way of achieving this flow exactly. However, you can use an API Co-Signer paired with a callback handler, along with an “Approve By” action TAP rule, to require transaction approval prior to it being sent to the end user for signing. While it flips the approval logic, it would allow you to validate the signature request before it’s made available to sign by the end user.