Defined in the Base Account SDK
Builds a single revoke call that your app’s spender account can submit to
revoke a permission silently. This requires your app to control a spender
account with rights to revoke.
Parameters
The spend permission to revoke. This should be a SpendPermission object returned from requestSpendPermission
or fetched via fetchPermissions
. Show SpendPermission properties
Deterministic EIP-712 hash of the permission.
Signature for the EIP-712 payload.
Underlying permission fields. Unix timestamp (seconds).
Unix timestamp (seconds).
Returns
Call data for the revoke transaction.
Silent revoke via spender account
import { prepareRevokeCallData } from "@base-org/account/spend-permission" ;
const revokeCall = await prepareRevokeCallData ( permission );
await provider . request ({
method: "wallet_sendCalls" ,
params: [
{
version: "2.0" ,
atomicRequired: true ,
from: spender ,
calls: [ revokeCall ],
},
],
});
Error Handling
Always wrap the call in a try-catch block to handle these errors gracefully.