Skip to content

Commit 9fc111a

Browse files
committed
docs(subscriptions): note token program choice for Token-2022 mints in revoke examples
1 parent 28eeb28 commit 9fc111a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

apps/docs/content/docs/en/payments/subscriptions/close-subscription-authority.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ user's token account. It calls the token program's `Revoke`, signed by the user,
8484
so it works whether or not the Subscription Authority still exists. Send it
8585
standalone or alongside `CloseSubscriptionAuthority`.
8686

87+
Pass the token program that owns the mint: `TOKEN_PROGRAM_ADDRESS` for SPL Token
88+
mints, or `TOKEN_2022_PROGRAM_ADDRESS` (from `@solana-program/token-2022`) for
89+
Token-2022 mints.
90+
8791
<Tabs items={["TypeScript", "Rust"]}>
8892
<Tab value="TypeScript">
8993
```ts
@@ -93,6 +97,7 @@ standalone or alongside `CloseSubscriptionAuthority`.
9397
.revokeSubscriptionAuthority({
9498
user: userSigner,
9599
tokenMint,
100+
// Use TOKEN_2022_PROGRAM_ADDRESS for Token-2022 mints.
96101
tokenProgram: TOKEN_PROGRAM_ADDRESS,
97102
})
98103
.sendTransaction();
@@ -105,6 +110,7 @@ standalone or alongside `CloseSubscriptionAuthority`.
105110
use solana_address::{address, Address};
106111
use subscriptions::{generated::instructions::*, SUBSCRIPTIONS_ID};
107112

113+
// For Token-2022 mints use TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb.
108114
const TOKEN_PROGRAM_ID: Address = address!("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
109115

110116
let user: Address = address!("USER_WALLET_ADDRESS_HERE");

0 commit comments

Comments
 (0)