Defined in the Base Account SDK
Validates a permission against current time and revocation state and returns
remaining spend and next period start.
Parameters
Signed permission to evaluate.
Returns
status
GetPermissionStatusResponse
Status details for the permission.Show GetPermissionStatusResponse properties
Remaining allowance in wei for the current period.
When the next allowance period begins.
True if approved and not revoked or expired.
import { getPermissionStatus } from "@base-org/account/spend-permission";
const { isActive, remainingSpend } = await getPermissionStatus(permission);
{
remainingSpend: 1000000000000000000n,
nextPeriodStart: new Date("2024-01-31T00:00:00Z"),
isActive: true
}
Error Handling
Always wrap the call in a try-catch block to handle these errors gracefully.