@solana/subscriptions 0.4.0-rc.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +7 -3
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -28,7 +28,7 @@ const client = createClient()
28
28
  // 1. Initialize the SubscriptionAuthority for a user's token account (once per mint)
29
29
  await client.subscriptions.instructions
30
30
  .initSubscriptionAuthority({
31
- tokenMint: address('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'),
31
+ tokenMint: address('TokenMintAddress...'),
32
32
  userAta: address('...'),
33
33
  tokenProgram: address('TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'),
34
34
  })
@@ -37,7 +37,7 @@ await client.subscriptions.instructions
37
37
  // 2. Create a fixed delegation (e.g., allow spending 1,000,000 tokens)
38
38
  await client.subscriptions.instructions
39
39
  .createFixedDelegation({
40
- tokenMint: address('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'),
40
+ tokenMint: address('TokenMintAddress...'),
41
41
  delegatee: address('DelegateeAddress...'),
42
42
  nonce: 0n,
43
43
  amount: 1_000_000n,
@@ -62,6 +62,8 @@ For custom wallet flows, use the exported `get*OverlayInstruction*` functions. T
62
62
  | `revokeSubscription` / `getRevokeSubscriptionOverlayInstruction` | Close a subscription delegation PDA (requires `planPda`) and reclaim rent |
63
63
  | `revokeSubscriptionAuthority` / `getRevokeSubscriptionAuthorityOverlayInstructionAsync` | Revoke the per-mint SPL delegate and close the SubscriptionAuthority PDA, reclaiming rent (pass `receiver` when a sponsor funded it) |
64
64
 
65
+ Abandoned delegation and subscription PDAs (Subscription Authority closed or re-initialized) can be closed by the recorded payer via the generated `getRevokeAbandonedDelegationInstruction` / `getRevokeAbandonedSubscriptionInstruction` builders (no overlay wrapper).
66
+
65
67
  ### Transfers
66
68
 
67
69
  | Plugin instruction / builder | Description |
@@ -70,6 +72,8 @@ For custom wallet flows, use the exported `get*OverlayInstruction*` functions. T
70
72
  | `transferRecurring` / `getTransferRecurringOverlayInstructionAsync` | Pull tokens from a recurring delegation |
71
73
  | `transferSubscription` / `getTransferSubscriptionOverlayInstructionAsync` | Pull tokens from a subscription delegation |
72
74
 
75
+ For Token-2022 mints with a configured transfer hook, the plugin resolves and appends the hook accounts automatically. For standalone overlay usage, call `resolveTransferHookAccounts` and pass the result as `transferHookAccounts`.
76
+
73
77
  ### Subscription Plans
74
78
 
75
79
  | Plugin instruction / builder | Description |
@@ -107,7 +111,7 @@ seed is the constant `"event_authority"`).
107
111
 
108
112
  ## API Reference
109
113
 
110
- Full API documentation is generated from source with [TypeDoc](https://typedoc.org/). Run `npx typedoc` to generate locally, or browse `./docs/`.
114
+ Full API documentation is generated from source with [TypeDoc](https://typedoc.org/). Run `npx typedoc` to generate the reference into `./docs/` locally.
111
115
 
112
116
  ## Development
113
117
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/subscriptions",
3
- "version": "0.4.0-rc.2",
3
+ "version": "0.4.0",
4
4
  "description": "TypeScript SDK and @solana/kit plugin for the Subscriptions Solana program: token delegations, recurring payments, and subscription plans.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -48,7 +48,7 @@
48
48
  "@solana/web3.js": "^1.98.4",
49
49
  "@sqds/multisig": "^2.1.4",
50
50
  "@swig-wallet/kit": "^2.1.0",
51
- "@types/node": "^25.7.0",
51
+ "@types/node": "^26.0.1",
52
52
  "litesvm": "1.1.0",
53
53
  "tsup": "^8.3.0",
54
54
  "tweetnacl": "^1.0.3",