> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cdp.coinbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# getPermissionStatus

> Gets the current status of a Spend Permission

Defined in the [Coinbase Wallet SDK](https://github.com/base/account-sdk)

<Info>
  This helper method queries the blockchain to retrieve real-time information
  about a spend permission, including how much can still be spent in the current
  period, when the next period starts, and whether the permission is still active.

  The function automatically uses the appropriate blockchain client based on the
  permission's chain ID and calls multiple view functions on the SpendPermissionManager
  contract to gather comprehensive status information.
</Info>

## Parameters

<ParamField body="permission" type="SpendPermission" required>
  The spend permission object to check status for. This should be a SpendPermission object returned from [`requestSpendPermission`](/coinbase-wallet/reference/spend-permission-utilities/requestSpendPermission) or fetched via [`fetchPermissions`](/coinbase-wallet/reference/spend-permission-utilities/fetchPermissions).

  <Expandable title="SpendPermission Properties">
    <ParamField body="permissionHash" type="string">
      Deterministic EIP-712 hash of the permission.
    </ParamField>

    <ParamField body="signature" type="string">
      Signature for the EIP-712 payload.
    </ParamField>

    <ParamField body="chainId" type="number">
      Target chain ID.
    </ParamField>

    <ParamField body="permission" type="object">
      Underlying permission fields.

      <Expandable title="Permission Fields">
        <ParamField body="account" type="address" />

        <ParamField body="spender" type="address" />

        <ParamField body="token" type="address" />

        <ParamField body="allowance" type="bigint" />

        <ParamField body="period" type="number">Duration in seconds.</ParamField>
        <ParamField body="start" type="number">Unix timestamp (seconds).</ParamField>
        <ParamField body="end" type="number">Unix timestamp (seconds).</ParamField>

        <ParamField body="salt" type="string" />

        <ParamField body="extraData" type="string" />
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

## Returns

<ResponseField name="status" type="GetPermissionStatusResponseType">
  A promise that resolves to an object containing permission status details.

  <Expandable title="GetPermissionStatusResponseType Properties">
    <ResponseField name="remainingSpend" type="bigint">
      Remaining allowance in wei for the current period. Calculated as the difference between the allowance and the amount already spent in the current period.
    </ResponseField>

    <ResponseField name="nextPeriodStart" type="Date">
      When the next allowance period begins. This is calculated as one second after the current period ends.
    </ResponseField>

    <ResponseField name="isRevoked" type="boolean">
      True if the permission has been revoked on-chain.
    </ResponseField>

    <ResponseField name="isExpired" type="boolean">
      True if the current timestamp is past the permission's end time.
    </ResponseField>

    <ResponseField name="isActive" type="boolean">
      True if the permission is not revoked and not expired. A permission is active when it can still be used for spending.
    </ResponseField>

    <ResponseField name="currentPeriod" type="object">
      Information about the current spending period.

      <Expandable title="currentPeriod Properties">
        <ResponseField name="start" type="number">Unix timestamp (seconds) when the current period started.</ResponseField>
        <ResponseField name="end" type="number">Unix timestamp (seconds) when the current period ends.</ResponseField>
        <ResponseField name="spend" type="bigint">Amount already spent in the current period (in wei).</ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```typescript Check permission status lines wrap expandable theme={null}
  import { getPermissionStatus } from "@base-org/account/spend-permission";

  // Check the status of a permission (no client needed)
  const status = await getPermissionStatus(permission);

  console.log(`Remaining spend: ${status.remainingSpend} wei`);
  console.log(`Next period starts: ${status.nextPeriodStart}`);
  console.log(`Is revoked: ${status.isRevoked}`);
  console.log(`Is expired: ${status.isExpired}`);
  console.log(`Is active: ${status.isActive}`);

  if (status.isActive && status.remainingSpend > BigInt(0)) {
    console.log('Permission can be used for spending');
  }
  ```
</RequestExample>

<ResponseExample>
  ```typescript Example response lines wrap expandable theme={null}
  {
    remainingSpend: 1000000000000000000n,
    nextPeriodStart: new Date("2024-01-31T00:00:01Z"),
    isRevoked: false,
    isExpired: false,
    isActive: true,
    currentPeriod: {
      start: 1704067200,
      end: 1706659200,
      spend: 0n
    }
  }
  ```
</ResponseExample>

## Error Handling

Always wrap the call in a try-catch block to handle these errors gracefully.
