Skip to main content
Defined in the Base Account SDK
Returns a single spend permission by its unique hash identifier. This is useful when you have a permission hash from a previous operation and need to retrieve its current details.

Parameters

permissionHash
string
required
The unique hash identifier of the permission to retrieve.
provider
EIP1193Provider
Optional. EIP-1193 compliant Ethereum provider instance. Get this from sdk.getProvider(). If not provided, uses the default SDK provider.

Returns

permission
SpendPermission | null
The spend permission matching the hash, or null if not found.

Error Handling

The function returns null if the permission is not found rather than throwing an error. Always check for null values:

Usage Notes

This function is particularly useful when:
  • You have a permission hash from a previous operation (e.g., from requestSpendPermission)
  • You want to verify the current state of a specific permission
  • You need to look up permission details without knowing the account or spender information
  • You’re tracking specific permissions across sessions
Unlike fetchPermissions, this function:
  • Returns a single permission instead of an array
  • Does not require account, chain, or spender parameters
  • Provides direct access via the permission’s unique identifier
  • Returns null instead of an empty array when no permission is found