Close Subscription Authority

A Subscription Authority is the PDA that the program uses as the SPL Token delegate for a user's token account. Close it when the user no longer has active fixed delegations, recurring delegations, or subscription delegations for that mint.

Closing the account returns its rent to the account's lamport funder and revokes the token delegate approval owned by the program. The funder is usually the user, but it can be any payer that funded the Subscription Authority account. If any active delegation still depends on the authority, close those delegations first.

Close The Authority

import { address, createClient } from '@solana/kit';
import { solanaLocalRpc } from '@solana/kit-plugin-rpc';
import { signer } from '@solana/kit-plugin-signer';
import {
findSubscriptionAuthorityPda,
subscriptionsProgram,
} from '@solana/subscriptions';
const client = createClient()
.use(signer(userSigner))
.use(solanaLocalRpc({ rpcUrl: 'http://127.0.0.1:8899' }))
.use(subscriptionsProgram());
const tokenMint = address('TOKEN_MINT_ADDRESS_HERE');
const [subscriptionAuthorityPda] = await findSubscriptionAuthorityPda({
user: userSigner.address,
tokenMint,
});
await client.subscriptions.instructions
.closeSubscriptionAuthority({
user: userSigner,
tokenMint,
// Include this only when a sponsor funded the Subscription Authority.
receiver: sponsorSigner.address,
})
.sendTransaction();

Notes

  • The user signs the close transaction.
  • If a sponsor funded the Subscription Authority, pass that sponsor account as receiver so rent returns to the recorded payer.
  • Close fixed, recurring, and subscription delegation PDAs before closing the Subscription Authority.
  • If the user creates a new delegation later, initialize a new Subscription Authority for the same mint.

Is this page helpful?

Πίνακας Περιεχομένων

Επεξεργασία Σελίδας

Διαχειρίζεται από

© 2026 Ίδρυμα Solana.
Με επιφύλαξη παντός δικαιώματος.
Συνδεθείτε
Close Subscription Authority | Solana