Skip to content

Commit 3fd0f0a

Browse files
docs: 0.23.x stable installs, transferInterface owner+authority, drop manual V2
- Replace @beta SDK installs with ^0.23.0; CLI installs without @beta dist-tag - Add sdk-install-0.23.0.mdx; remove beta-tagged SDK snippet - Update transferInterface and createTransferInterfaceInstructions examples (delegate: delegatePubkey) - Remove Force V2 featureFlags from Anchor TS snippets; refresh migration-v1-to-v2 guidance Made-with: Cursor
1 parent 637f339 commit 3fd0f0a

29 files changed

Lines changed: 88 additions & 117 deletions

api-reference/solana-to-light-comparison.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ const tx = await transferInterface(
549549
sourceAta,
550550
mint,
551551
recipient,
552+
owner.publicKey,
552553
owner,
553554
amount
554555
);
@@ -913,11 +914,9 @@ const tx = await transferInterface(
913914
sourceAta,
914915
mint,
915916
recipient,
917+
owner.publicKey,
916918
delegate,
917-
amount,
918-
undefined,
919-
undefined,
920-
{ owner: owner.publicKey }
919+
amount
921920
);
922921
```
923922
```typescript title="SPL"

light-token/payments/spend-permissions.mdx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ When you approve a delegate, you're authorizing a specific account to transfer t
4141
<tr>
4242
<td>**Delegated Transfer**</td>
4343
<td>transfer() (delegate signs)</td>
44-
<td>transferInterface({ owner })</td>
44+
<td>transferInterface(..., ownerPubkey, delegateSigner, ...)</td>
4545
</tr>
4646
<tr>
4747
<td>**Revoke**</td>
@@ -124,7 +124,7 @@ console.log("Delegated amount:", account.parsed.delegatedAmount.toString());
124124

125125
Once approved, the delegate can transfer tokens on behalf of the owner. The delegate is the transaction authority. Only the delegate and fee payer sign; the owner's signature is not required.
126126

127-
`transferInterface` takes a recipient wallet address and creates the recipient's associated token account internally. Pass `{ owner }` to transfer as a delegate instead of the owner.
127+
`transferInterface` takes a recipient wallet address and creates the recipient's associated token account internally. For delegated transfers, pass the **source token-account owner** as **`owner`** (pubkey) and the **delegate** as **`authority`** (signer). Do not use removed **`InterfaceOptions.owner`** — there is no `{ owner: ... }` options bag for this flow.
128128

129129
```typescript
130130
import { transferInterface } from "@lightprotocol/compressed-token/unified";
@@ -135,11 +135,9 @@ const tx = await transferInterface(
135135
senderAta,
136136
mint,
137137
recipient.publicKey, // recipient wallet (associated token account created internally)
138+
owner.publicKey, // source account owner (does not sign)
138139
delegate, // delegate authority (signer)
139-
200_000, // must be within approved cap
140-
undefined,
141-
undefined,
142-
{ owner: owner.publicKey } // owner (does not sign)
140+
200_000 // must be within approved cap
143141
);
144142

145143
console.log("Delegated transfer:", tx);
@@ -153,7 +151,7 @@ console.log("Delegated transfer:", tx);
153151

154152
<Accordion title="Instruction-level builder">
155153

156-
`createTransferInterfaceInstructions` returns `TransactionInstruction[][]` for manual transaction control. Pass `owner` to transfer as a delegate.
154+
`createTransferInterfaceInstructions` returns `TransactionInstruction[][]` for manual transaction control. Pass the **token-account owner** pubkey as the flat **`owner`** argument; for delegate-signed transactions, set **`options.delegatePubkey`**.
157155

158156
```typescript
159157
import {
@@ -167,10 +165,10 @@ const instructions = await createTransferInterfaceInstructions(
167165
payer.publicKey,
168166
mint,
169167
200_000,
170-
delegate.publicKey,
168+
owner.publicKey,
171169
recipient.publicKey,
172170
9, // decimals
173-
{ owner: owner.publicKey }
171+
{ delegatePubkey: delegate.publicKey }
174172
);
175173

176174
for (const ixs of instructions) {

light-token/wallets/overview.mdx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,16 @@ import {
248248
const sourceAta = getAssociatedTokenAddressInterface(mint, owner.publicKey);
249249

250250
// Handles loading, creates recipient ATA, transfers.
251-
await transferInterface(rpc, payer, sourceAta, mint, recipient, owner, amount);
251+
await transferInterface(
252+
rpc,
253+
payer,
254+
sourceAta,
255+
mint,
256+
recipient,
257+
owner.publicKey,
258+
owner,
259+
amount
260+
);
252261
```
253262

254263
<Accordion title="Compare to SPL">

pda/compressed-pdas/nullifier-pda.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ light-client = "0.23.0"
4646
<Tab title="TS">
4747

4848
```bash
49-
npm install @lightprotocol/nullifier-program @lightprotocol/stateless.js@beta
49+
npm install @lightprotocol/nullifier-program @lightprotocol/stateless.js@^0.23.0
5050
```
5151

5252
</Tab>

resources/migration-v1-to-v2.mdx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -242,20 +242,14 @@ import {
242242
deriveAddressSeedV2,
243243
batchAddressTree,
244244
PackedAccounts,
245-
featureFlags,
246-
VERSION,
247245
} from "@lightprotocol/stateless.js";
248246
```
249247

250-
### Enable v2 mode
248+
### V2 mode (TypeScript)
251249

252-
Set the feature flag before making any calls:
250+
Published **`@lightprotocol/stateless.js@^0.23.0`** defaults to **V2** — you do **not** need to set **`LIGHT_PROTOCOL_VERSION=V2`** in application code.
253251

254-
```typescript
255-
import { featureFlags, VERSION } from "@lightprotocol/stateless.js";
256-
257-
(featureFlags as any).version = VERSION.V2;
258-
```
252+
If you **build `stateless.js` from source** and need V1 artifacts, set **`LIGHT_PROTOCOL_VERSION=V1`** for that build. For rare runtime overrides in custom bundles, you can still assign **`featureFlags.version`** before other imports run (advanced; prefer matching published versions instead).
259253

260254
### Update address derivation
261255

snippets/ai-prompts/toolkits/nullifiers.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Key APIs:
4646
4747
### 5. Implement
4848
- For Rust: Bash \`cargo add light-nullifier-program@0.1 light-client@0.23\`
49-
- For TypeScript: Bash \`npm install @lightprotocol/nullifier-program @lightprotocol/stateless.js@beta\`
49+
- For TypeScript: Bash \`npm install @lightprotocol/nullifier-program @lightprotocol/stateless.js@^0.23.0\`
5050
- Follow the guide and the approved plan
5151
- Write/Edit to create or modify files
5252
- TaskUpdate to mark each step done
@@ -111,7 +111,7 @@ Key APIs:
111111
112112
### 5. Implement
113113
- For Rust: Bash `cargo add light-nullifier-program@0.1 light-client@0.23`
114-
- For TypeScript: Bash `npm install @lightprotocol/nullifier-program @lightprotocol/stateless.js@beta`
114+
- For TypeScript: Bash `npm install @lightprotocol/nullifier-program @lightprotocol/stateless.js@^0.23.0`
115115
- Follow the guide and the approved plan
116116
- Write/Edit to create or modify files
117117
- TaskUpdate to mark each step done

snippets/ai-prompts/toolkits/payments.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ SPL → Light Token API mapping:
1818
| Operation | SPL | Light Token |
1919
| Receive | getOrCreateAssociatedTokenAccount() | createLoadAtaInstructions() / loadAta() |
2020
| Transfer | createTransferInstruction() | createTransferInterfaceInstructions() |
21-
| Delegated Transfer | transfer() (delegate signs) | transferInterface({ owner }) |
21+
| Delegated Transfer | transfer() (delegate signs) | transferInterface(..., ownerPubkey, delegateSigner, ...) |
2222
| Get Balance | getAccount() | getAtaInterface() |
2323
| Tx History | getSignaturesForAddress() | getSignaturesForOwnerInterface() |
2424
| Wrap SPL | N/A | createWrapInstruction() / wrap() |
@@ -123,7 +123,7 @@ SPL → Light Token API mapping:
123123
| Operation | SPL | Light Token |
124124
| Receive | getOrCreateAssociatedTokenAccount() | createLoadAtaInstructions() / loadAta() |
125125
| Transfer | createTransferInstruction() | createTransferInterfaceInstructions() |
126-
| Delegated Transfer | transfer() (delegate signs) | transferInterface({ owner }) |
126+
| Delegated Transfer | transfer() (delegate signs) | transferInterface(..., ownerPubkey, delegateSigner, ...) |
127127
| Get Balance | getAccount() | getAtaInterface() |
128128
| Tx History | getSignaturesForAddress() | getSignaturesForOwnerInterface() |
129129
| Wrap SPL | N/A | createWrapInstruction() / wrap() |

snippets/ai-prompts/ts-cookbook/transfer-interface.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Context:
1313
- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
1414
1515
transferInterface() transfers tokens in a single call. The recipient parameter is a wallet public key.
16+
Pass the source token-account owner pubkey and the signing authority separately: owner-signed flows use (owner.publicKey, owner); delegated flows use (owner.publicKey, delegate). Do not use removed InterfaceOptions.owner.
1617
The SDK derives and creates the destination ATA internally. All transfers use transferChecked under the hood.
1718
- Light Token → Light Token: transfers between Light Token accounts
1819
- SPL → Light Token: locks SPL tokens in interface PDA, mints to Light Token account
@@ -76,6 +77,7 @@ Context:
7677
- Packages: @lightprotocol/compressed-token, @lightprotocol/stateless.js
7778
7879
transferInterface() transfers tokens in a single call. The recipient parameter is a wallet public key.
80+
Pass the source token-account owner pubkey and the signing authority separately: owner-signed flows use (owner.publicKey, owner); delegated flows use (owner.publicKey, delegate). Do not use removed InterfaceOptions.owner.
7981
The SDK derives and creates the destination ATA internally. All transfers use transferChecked under the hood.
8082
- Light Token → Light Token: transfers between Light Token accounts
8183
- SPL → Light Token: locks SPL tokens in interface PDA, mints to Light Token account

snippets/code-snippets/burn/typescript-client.mdx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,11 @@ import {
1515
Rpc,
1616
sleep,
1717
SystemAccountMetaConfig,
18-
featureFlags,
19-
VERSION,
2018
selectStateTreeInfo,
2119
TreeInfo,
2220
} from "@lightprotocol/stateless.js";
2321
import * as assert from "assert";
2422

25-
// Force V2 mode
26-
(featureFlags as any).version = VERSION.V2;
27-
2823
const path = require("path");
2924
const os = require("os");
3025
require("dotenv").config();

snippets/code-snippets/close/typescript-client.mdx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,11 @@ import {
1515
Rpc,
1616
sleep,
1717
SystemAccountMetaConfig,
18-
featureFlags,
19-
VERSION,
2018
selectStateTreeInfo,
2119
TreeInfo,
2220
} from "@lightprotocol/stateless.js";
2321
import * as assert from "assert";
2422

25-
// Force V2 mode
26-
(featureFlags as any).version = VERSION.V2;
27-
2823
const path = require("path");
2924
const os = require("os");
3025
require("dotenv").config();

0 commit comments

Comments
 (0)