Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (14)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
There are now two names for the same shape: export interface TransferToAccountOptions extends InterfaceOptions {
wrap?: boolean;
programId?: PublicKey;
}
export type TransferOptions = TransferToAccountOptions;
Could we just drop
No public API change, one fewer type. |
|
Dead code: if (batches.length === 0) return [[ensureRecipientAtaIx]];
|
|
Redundant pre-conversion in const amountBigInt = BigInt(amount.toString()); // line 63The underlying builder ( |
|
Duplicate send loop and source validation in
Send loop (lines 82–93 and 142–153): const additionalSigners = dedupeSigner(payer, [owner]);
const { rest: loads, last: transferIxs } = sliceLast(batches);
await Promise.all(loads.map(async ixs => {
const { blockhash } = await rpc.getLatestBlockhash();
const tx = buildAndSignTx(ixs, payer, blockhash, additionalSigners);
return sendAndConfirmTx(rpc, tx, confirmOptions);
}));
const { blockhash } = await rpc.getLatestBlockhash();
const tx = buildAndSignTx(transferIxs, payer, blockhash, additionalSigners);
return sendAndConfirmTx(rpc, tx, confirmOptions);Source validation (lines 50–61 and 112–123): const effectiveOwner = options?.owner ?? owner.publicKey;
const expectedSource = getAssociatedTokenAddressInterface(mint, effectiveOwner, false, programId);
if (!source.equals(expectedSource)) {
throw new Error(`Source mismatch. Expected ${expectedSource.toBase58()}, got ${source.toBase58()}`);
}Both could be extracted into private helpers, e.g. |
Update transferDelegatedInterface and createTransferDelegatedInterfaceInstructions to accept a recipient wallet address instead of an explicit destination token account, matching the transferInterface convention from PR #2354. ATA derivation and idempotent creation now happen internally for all programId variants (light-token, SPL, Token-2022).
Update transferDelegatedInterface and createTransferDelegatedInterfaceInstructions to accept a recipient wallet address instead of an explicit destination token account, matching the transferInterface convention from PR #2354. ATA derivation and idempotent creation now happen internally for all programId variants (light-token, SPL, Token-2022).
* feat(compressed-token): add approve/revoke delegation for light-token ATAs Add TypeScript SDK functions to call the on-chain CTokenApprove (discriminator 4) and CTokenRevoke (discriminator 5) instruction handlers for light-token associated token accounts. New files: - instructions/approve-revoke.ts: sync instruction builders matching Rust SDK layout - actions/approve-interface.ts: async actions with cold loading + tx sending - tests/e2e/approve-revoke-light-token.test.ts: unit + E2E tests Also adds getLightTokenDelegate helper and extends FrozenOperation type. * fix(sdk): make decimals optional in unified approve/revoke wrappers Avoid unnecessary getMintInterface RPC call when caller provides decimals. * feat(sdk): add transferDelegated for light-token ATAs Add transferDelegatedInterface action and unified wrapper, completing the approve → transfer → revoke delegation flow for light-token ATAs. * add spl t22 support * refactor(sdk): align transferDelegated with wallet-recipient API Update transferDelegatedInterface and createTransferDelegatedInterfaceInstructions to accept a recipient wallet address instead of an explicit destination token account, matching the transferInterface convention from PR #2354. ATA derivation and idempotent creation now happen internally for all programId variants (light-token, SPL, Token-2022). * 1st batch commnets * docs(sdk): document load-all behavior in approve/revoke JSDoc; add owner==feePayer E2E test Add @remarks to approve/revoke functions documenting that for light-token mints, all cold (compressed) balances are loaded into the hot ATA regardless of the delegation amount. Add E2E test covering the owner==feePayer code path which was previously only tested at the unit level. * add regression tests * fixes * update changelog * upd changelog * fix: packedaccounts in js should not turn bool to number * cherry pick bool fix * bump versions again --------- Co-authored-by: tilo-14 <tilo@luminouslabs.com> Co-authored-by: Swenschaeferjohann <swen@lightprotocol.com>
No description provided.