Defined in the Base Account SDK
Prompts the user to approve revoking the specified spend permission. Requires
user interaction via their Base Account wallet UI.
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
Transaction hash of the revoke operation.
import { requestRevoke } from "@base-org/account/spend-permission";
try {
const hash = await requestRevoke(permission);
console.log("Revoke succeeded", hash);
} catch (err) {
console.warn("Revoke was rejected or failed", err);
}
Error Handling
Always wrap the call in a try-catch block to handle these errors gracefully.