Skip to content

Conversation

spencerstock
Copy link
Collaborator

@spencerstock spencerstock commented Aug 21, 2025

What changed? Why?

Added a new RPC method coinbase_fetchPermission and corresponding public utility function to fetch a single spend permission by its hash. This enables retrieving specific permission details when you have a permission hash identifier.

Key changes:

  • New RPC type definitions for coinbase_fetchPermission request and response
  • New public utility method fetchPermission that accepts a permission hash and optional provider
  • Integration in the Signer class to handle the new RPC method and store the fetched permission
  • Exports added to both browser and Node.js entry points for the spend permission utilities

How was this tested?

The changes follow the existing patterns for spend permission methods in the codebase. All existing tests continue to pass:

  • Linting passes with no new errors
  • Type checking passes
  • All unit tests pass (616 tests in account-sdk package)

How can reviewers manually test these changes?

  1. Import the new fetchPermission method from the spend-permission utilities
  2. Call it with a valid permission hash:
    • With a provider: await fetchPermission({ provider, permissionHash: '0x...' })
    • Without a provider: await fetchPermission({ permissionHash: '0x...' })
  3. Verify the method returns the expected SpendPermission object with permission details
  4. Confirm the permission is stored in the spend permissions store when it has a chainId

Demo/screenshots

@cb-heimdall
Copy link
Collaborator

cb-heimdall commented Aug 21, 2025

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@spencerstock spencerstock marked this pull request as ready for review August 21, 2025 14:35
Copy link
Collaborator

@stephancill stephancill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants