Skip to main content
The approve() and revoke() functions grant and remove delegate spending authority for compressed tokens. Only the token owner can perform these instructions.

Full Code Example

1

Prerequisites

Make sure you have dependencies and developer environment set up!
Dependencies
Developer Environment
By default, all guides use Localnet.
2

Approve / Revoke Delegates

Run these scripts to approve / revoke delegate authority!
Approve delegate authority for compressed tokens. The delegate can spend up to the approved amount.
approve-delegates.ts
Before we approve or revoke delegates, we need:
  • compressed token accounts to delegate or revoke delegation from, and
  • an SPL mint with a token pool for compression. This token pool can be created for new SPL mints via createMint() or added to existing SPL mints via createTokenPool().

Troubleshooting

Attempting to revoke non-delegated accounts.

Advanced Configuration

Next Steps

Check out the advanced guides for airdrops, combining multiple instructions in one transaction, and client examples.