Skip to content

Commit 1f2a50d

Browse files
chore: bump release (#2358)
* wrap options * wip * upd changelog
1 parent 0bd606e commit 1f2a50d

44 files changed

Lines changed: 405 additions & 500 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

js/compressed-token/CHANGELOG.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,24 @@
55
- **Delegate approval and revocation** for SPL Token, Token-2022, and light-token, aligned with existing interface helpers:
66
- **Actions:** `approveInterface`, `revokeInterface`.
77
- **Instruction builders:** `createApproveInterfaceInstructions`, `createRevokeInterfaceInstructions` — each inner array is one transaction’s instructions (same batching style as other interface instruction builders).
8-
- **Program-level helpers:** `createLightTokenApproveInstruction`, `createLightTokenRevokeInstruction`
8+
- **Program-level helpers:** `createLightTokenApproveInstruction`, `createLightTokenRevokeInstruction`
99
- **Shared options:** approve/revoke accept optional `InterfaceOptions` (same type as `transferInterface`), including `splInterfaceInfos` when you need to supply SPL interface pool accounts explicitly.
1010

1111
### Changed
1212

1313
- **`approveInterface` / `revokeInterface`:** optional `options?: InterfaceOptions` and `decimals?: number` after `wrap`. For SPL or Token-2022 with `wrap: false`, the SDK skips an extra mint fetch used only for decimals on that path (you can still pass `decimals` when your flow requires it).
1414
- **`@lightprotocol/compressed-token/unified`:** approve/revoke APIs accept the same optional `options` and `decimals`; unified entrypoints keep their existing default wrapping behavior (`wrap: true`).
15+
- **Interface API normalization:** `programId` is now flat on transfer interface helpers/instruction builders (SPL-style), while `wrap` is consistently nested under `InterfaceOptions` across transfer/approve/revoke/load interface methods and their unified/root wrappers.
16+
17+
### Breaking Changes
18+
19+
- **Transfer interface owner/authority split:** `transferInterface`, `transferToAccountInterface`, and the unified wrappers now take the token-account owner pubkey and the signing authority separately.
20+
- **Action:** `transferInterface(rpc, payer, source, mint, recipient, owner, authority, amount, ...)`
21+
- **Action:** `transferToAccountInterface(rpc, payer, source, mint, destination, owner, authority, amount, ...)`
22+
- Owner-signed flows now pass `owner.publicKey, owner`; delegated flows pass `ownerPublicKey, delegateSigner`.
23+
- **`InterfaceOptions.owner` removed:** transfer interface helpers no longer accept the account owner inside `InterfaceOptions`.
24+
- Instruction builders keep flat `owner` as the canonical account owner.
25+
- Delegated instruction planning must use `options.delegatePubkey`.
1526

1627
### Fixed
1728

@@ -22,7 +33,7 @@
2233
### Breaking Changes
2334

2435
- **`transferInterface` and `createTransferInterfaceInstructions`** now take a recipient wallet address and ensure recipient ATA internally.
25-
- **Action:** `transferInterface(rpc, payer, source, mint, recipient, owner, amount, ...)``recipient` is the wallet public key.
36+
- **Action:** `transferInterface(rpc, payer, source, mint, recipient, owner, authority, amount, ...)``recipient` is the wallet public key.
2637
- **Instruction builder:** `createTransferInterfaceInstructions(rpc, payer, mint, amount, sender, recipient, decimals, options?)` — derives destination ATA and inserts idempotent ATA-create internally.
2738
- **Advanced explicit-account path:** use `transferToAccountInterface(...)` and `createTransferToAccountInterfaceInstructions(...)` for destination token-account routing (program-owned/custom accounts), preserving the previous destination-account behavior.
2839
- **`decimals` is required** on v3 action-level instruction builders. Fetch with `getMintInterface(rpc, mint).mint.decimals` if not already threaded.

js/compressed-token/package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@
9292
"test": "vitest run tests/unit && if [ \"$LIGHT_PROTOCOL_VERSION\" = \"V1\" ]; then pnpm test:e2e:legacy:all; else pnpm test:e2e:lighttoken:all; fi",
9393
"test-ci": "pnpm test:v1 && pnpm test:v2",
9494
"test:v1": "pnpm build:v1 && LIGHT_PROTOCOL_VERSION=V1 vitest run tests/unit && LIGHT_PROTOCOL_VERSION=V1 pnpm test:e2e:legacy:all",
95-
"test:v2": "pnpm build:v2 && LIGHT_PROTOCOL_VERSION=V2 vitest run tests/unit && LIGHT_PROTOCOL_VERSION=V2 LIGHT_PROTOCOL_BETA=true pnpm test:e2e:lighttoken:all",
96-
"test:v2:lighttoken": "pnpm build:v2 && LIGHT_PROTOCOL_VERSION=V2 LIGHT_PROTOCOL_BETA=true pnpm test:e2e:lighttoken:all",
95+
"test:v2": "pnpm build:v2 && LIGHT_PROTOCOL_VERSION=V2 vitest run tests/unit && LIGHT_PROTOCOL_VERSION=V2 pnpm test:e2e:lighttoken:all",
96+
"test:v2:lighttoken": "pnpm build:v2 && LIGHT_PROTOCOL_VERSION=V2 pnpm test:e2e:lighttoken:all",
9797
"test-all": "vitest run",
9898
"test:unit:all": "EXCLUDE_E2E=true vitest run",
9999
"test:unit:all:v1": "LIGHT_PROTOCOL_VERSION=V1 vitest run tests/unit --reporter=verbose",
@@ -107,7 +107,7 @@
107107
"test:e2e:create-associated-light-token": "pnpm test-validator && vitest run tests/e2e/create-associated-light-token.test.ts --reporter=verbose",
108108
"test:e2e:mint-to-light-token": "pnpm test-validator && vitest run tests/e2e/mint-to-light-token.test.ts --reporter=verbose",
109109
"test:e2e:mint-to-compressed": "pnpm test-validator && vitest run tests/e2e/mint-to-compressed.test.ts --reporter=verbose",
110-
"test:e2e:mint-to-interface": "pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/mint-to-interface.test.ts --reporter=verbose",
110+
"test:e2e:mint-to-interface": "pnpm test-validator && vitest run tests/e2e/mint-to-interface.test.ts --reporter=verbose",
111111
"test:e2e:mint-workflow": "pnpm test-validator && vitest run tests/e2e/mint-workflow.test.ts --reporter=verbose",
112112
"test:e2e:update-mint": "pnpm test-validator && vitest run tests/e2e/update-mint.test.ts --reporter=verbose",
113113
"test:e2e:update-metadata": "pnpm test-validator && vitest run tests/e2e/update-metadata.test.ts --reporter=verbose",
@@ -130,21 +130,21 @@
130130
"test:e2e:rpc-multi-trees": "pnpm test-validator && vitest run tests/e2e/rpc-multi-trees.test.ts --reporter=verbose",
131131
"test:e2e:multi-pool": "pnpm test-validator && vitest run tests/e2e/multi-pool.test.ts --reporter=verbose",
132132
"test:e2e:legacy:all": "pnpm test-validator && vitest run tests/e2e/create-mint.test.ts && vitest run tests/e2e/mint-to.test.ts && vitest run tests/e2e/transfer.test.ts && vitest run tests/e2e/delegate.test.ts && vitest run tests/e2e/transfer-delegated.test.ts && vitest run tests/e2e/multi-pool.test.ts && vitest run tests/e2e/decompress-delegated.test.ts && vitest run tests/e2e/merge-token-accounts.test.ts && pnpm test-validator-skip-prover && vitest run tests/e2e/compress.test.ts && vitest run tests/e2e/compress-spl-token-account.test.ts && vitest run tests/e2e/decompress.test.ts && vitest run tests/e2e/create-token-pool.test.ts && vitest run tests/e2e/approve-and-mint-to.test.ts && vitest run tests/e2e/rpc-token-interop.test.ts && vitest run tests/e2e/rpc-multi-trees.test.ts && vitest run tests/e2e/layout.test.ts && vitest run tests/e2e/select-accounts.test.ts",
133-
"test:e2e:wrap": "pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/wrap.test.ts --reporter=verbose",
134-
"test:e2e:interface:all": "pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/create-mint-interface.test.ts tests/e2e/create-ata-interface.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/transfer-interface.test.ts tests/e2e/wrap.test.ts tests/e2e/unwrap.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/get-or-create-ata-interface.test.ts --bail=1",
135-
"test:e2e:get-mint-interface": "pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/get-mint-interface.test.ts --reporter=verbose",
136-
"test:e2e:get-or-create-ata-interface": "pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/get-or-create-ata-interface.test.ts --reporter=verbose",
137-
"test:e2e:get-account-interface": "pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/get-account-interface.test.ts --reporter=verbose",
138-
"test:e2e:load-ata-standard": "pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/load-ata-standard.test.ts --reporter=verbose",
139-
"test:e2e:load-ata-unified": "pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/load-ata-unified.test.ts --reporter=verbose",
140-
"test:e2e:load-ata-combined": "pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/load-ata-combined.test.ts --reporter=verbose",
141-
"test:e2e:load-ata-spl-t22": "pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/load-ata-spl-t22.test.ts --reporter=verbose",
142-
"test:e2e:multi-cold-inputs-batching": "pnpm test-validator && LIGHT_PROTOCOL_VERSION=V2 LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/multi-cold-inputs-batching.test.ts -t \"instruction-level|hash uniqueness|ensureRecipientAta\" --reporter=verbose && pnpm test-validator && LIGHT_PROTOCOL_VERSION=V2 LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/multi-cold-inputs-batching.test.ts -t \"parallel multi-tx\" --reporter=verbose",
143-
"test:e2e:load-ata:all": "pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/load-ata-standard.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/load-ata-unified.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/load-ata-combined.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/load-ata-spl-t22.test.ts --bail=1",
144-
"test:e2e:freeze-thaw-light-token": "pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/freeze-thaw-light-token.test.ts --reporter=verbose",
145-
"test:e2e:load-ata-freeze": "pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/load-ata-freeze.test.ts --reporter=verbose",
146-
"test:e2e:review-fixes": "pnpm build:v2 && pnpm test-validator && LIGHT_PROTOCOL_VERSION=V2 LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/create-associated-light-token.test.ts tests/e2e/mint-to-light-token.test.ts tests/e2e/freeze-thaw-light-token.test.ts tests/e2e/load-ata-freeze.test.ts tests/e2e/decompress2.test.ts --reporter=verbose --bail=1",
147-
"test:e2e:lighttoken:all": "pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/create-compressed-mint.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/create-associated-light-token.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/mint-to-light-token.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/mint-to-compressed.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/mint-to-interface.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/mint-workflow.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/update-mint.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/update-metadata.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/compressible-load.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/wrap.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/get-mint-interface.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/get-account-interface.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/create-mint-interface.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/create-ata-interface.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/get-or-create-ata-interface.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/transfer-interface.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/unwrap.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/decompress2.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/freeze-thaw-light-token.test.ts --bail=1 && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/payment-flows.test.ts --bail=1 && pnpm test-validator && vitest run tests/e2e/v1-v2-migration.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/load-ata-standard.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/load-ata-unified.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/load-ata-combined.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/load-ata-freeze.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/load-ata-spl-t22.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_VERSION=V2 LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/multi-cold-inputs-batching.test.ts -t \"instruction-level|hash uniqueness|ensureRecipientAta\" --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_VERSION=V2 LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/multi-cold-inputs-batching.test.ts -t \"parallel multi-tx\" --bail=1",
133+
"test:e2e:wrap": "pnpm test-validator && vitest run tests/e2e/wrap.test.ts --reporter=verbose",
134+
"test:e2e:interface:all": "pnpm test-validator && vitest run tests/e2e/create-mint-interface.test.ts tests/e2e/create-ata-interface.test.ts --bail=1 && pnpm test-validator && vitest run tests/e2e/transfer-interface.test.ts tests/e2e/wrap.test.ts tests/e2e/unwrap.test.ts --bail=1 && pnpm test-validator && vitest run tests/e2e/get-or-create-ata-interface.test.ts --bail=1",
135+
"test:e2e:get-mint-interface": "pnpm test-validator && vitest run tests/e2e/get-mint-interface.test.ts --reporter=verbose",
136+
"test:e2e:get-or-create-ata-interface": "pnpm test-validator && vitest run tests/e2e/get-or-create-ata-interface.test.ts --reporter=verbose",
137+
"test:e2e:get-account-interface": "pnpm test-validator && vitest run tests/e2e/get-account-interface.test.ts --reporter=verbose",
138+
"test:e2e:load-ata-standard": "pnpm test-validator && vitest run tests/e2e/load-ata-standard.test.ts --reporter=verbose",
139+
"test:e2e:load-ata-unified": "pnpm test-validator && vitest run tests/e2e/load-ata-unified.test.ts --reporter=verbose",
140+
"test:e2e:load-ata-combined": "pnpm test-validator && vitest run tests/e2e/load-ata-combined.test.ts --reporter=verbose",
141+
"test:e2e:load-ata-spl-t22": "pnpm test-validator && vitest run tests/e2e/load-ata-spl-t22.test.ts --reporter=verbose",
142+
"test:e2e:multi-cold-inputs-batching": "pnpm test-validator && LIGHT_PROTOCOL_VERSION=V2 vitest run tests/e2e/multi-cold-inputs-batching.test.ts -t \"instruction-level|hash uniqueness|ensureRecipientAta\" --reporter=verbose && pnpm test-validator && LIGHT_PROTOCOL_VERSION=V2 vitest run tests/e2e/multi-cold-inputs-batching.test.ts -t \"parallel multi-tx\" --reporter=verbose",
143+
"test:e2e:load-ata:all": "pnpm test-validator && vitest run tests/e2e/load-ata-standard.test.ts --bail=1 && pnpm test-validator && vitest run tests/e2e/load-ata-unified.test.ts --bail=1 && pnpm test-validator && vitest run tests/e2e/load-ata-combined.test.ts --bail=1 && pnpm test-validator && vitest run tests/e2e/load-ata-spl-t22.test.ts --bail=1",
144+
"test:e2e:freeze-thaw-light-token": "pnpm test-validator && vitest run tests/e2e/freeze-thaw-light-token.test.ts --reporter=verbose",
145+
"test:e2e:load-ata-freeze": "pnpm test-validator && vitest run tests/e2e/load-ata-freeze.test.ts --reporter=verbose",
146+
"test:e2e:review-fixes": "pnpm build:v2 && pnpm test-validator && LIGHT_PROTOCOL_VERSION=V2 vitest run tests/e2e/create-associated-light-token.test.ts tests/e2e/mint-to-light-token.test.ts tests/e2e/freeze-thaw-light-token.test.ts tests/e2e/load-ata-freeze.test.ts tests/e2e/decompress2.test.ts --reporter=verbose --bail=1",
147+
"test:e2e:lighttoken:all": "pnpm test-validator && vitest run tests/e2e/create-compressed-mint.test.ts --bail=1 && vitest run tests/e2e/create-associated-light-token.test.ts --bail=1 && vitest run tests/e2e/mint-to-light-token.test.ts --bail=1 && pnpm test-validator && vitest run tests/e2e/mint-to-compressed.test.ts --bail=1 && vitest run tests/e2e/mint-to-interface.test.ts --bail=1 && vitest run tests/e2e/mint-workflow.test.ts --bail=1 && pnpm test-validator && vitest run tests/e2e/update-mint.test.ts --bail=1 && vitest run tests/e2e/update-metadata.test.ts --bail=1 && vitest run tests/e2e/compressible-load.test.ts --bail=1 && pnpm test-validator && vitest run tests/e2e/wrap.test.ts --bail=1 && vitest run tests/e2e/get-mint-interface.test.ts --bail=1 && vitest run tests/e2e/get-account-interface.test.ts --bail=1 && pnpm test-validator && vitest run tests/e2e/create-mint-interface.test.ts --bail=1 && vitest run tests/e2e/create-ata-interface.test.ts --bail=1 && pnpm test-validator && vitest run tests/e2e/get-or-create-ata-interface.test.ts --bail=1 && vitest run tests/e2e/transfer-interface.test.ts --bail=1 && pnpm test-validator && vitest run tests/e2e/unwrap.test.ts --bail=1 && vitest run tests/e2e/decompress2.test.ts --bail=1 && vitest run tests/e2e/freeze-thaw-light-token.test.ts --bail=1 && vitest run tests/e2e/payment-flows.test.ts --bail=1 && pnpm test-validator && vitest run tests/e2e/v1-v2-migration.test.ts --bail=1 && pnpm test-validator && vitest run tests/e2e/load-ata-standard.test.ts --bail=1 && pnpm test-validator && vitest run tests/e2e/load-ata-unified.test.ts --bail=1 && pnpm test-validator && vitest run tests/e2e/load-ata-combined.test.ts --bail=1 && pnpm test-validator && vitest run tests/e2e/load-ata-freeze.test.ts --bail=1 && pnpm test-validator && vitest run tests/e2e/load-ata-spl-t22.test.ts --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_VERSION=V2 vitest run tests/e2e/multi-cold-inputs-batching.test.ts -t \"instruction-level|hash uniqueness|ensureRecipientAta\" --bail=1 && pnpm test-validator && LIGHT_PROTOCOL_VERSION=V2 vitest run tests/e2e/multi-cold-inputs-batching.test.ts -t \"parallel multi-tx\" --bail=1",
148148
"test:e2e:all": "pnpm test:e2e:legacy:all && pnpm test:e2e:lighttoken:all",
149149
"pull-idl": "../../scripts/push-compressed-token-idl.sh",
150150
"build": "if [ \"$LIGHT_PROTOCOL_VERSION\" = \"V1\" ]; then LIGHT_PROTOCOL_VERSION=V1 pnpm build:bundle; else LIGHT_PROTOCOL_VERSION=V2 pnpm build:bundle; fi",

js/compressed-token/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ export async function createLoadAtaInstructions(
182182
mintInterface.mint.decimals,
183183
payer,
184184
options,
185-
false,
186185
);
187186
}
188187

@@ -216,7 +215,6 @@ export async function loadAta(
216215
payer,
217216
confirmOptions,
218217
interfaceOptions,
219-
false,
220218
decimals,
221219
);
222220
}

0 commit comments

Comments
 (0)