From c41346f12f524a7013d8c58dd49d2df1824616bc Mon Sep 17 00:00:00 2001 From: ananas Date: Tue, 7 Oct 2025 17:29:20 +0100 Subject: [PATCH 1/7] chore: add address merkle tree pubkey print to light program test output --- sdk-libs/program-test/src/logging/decoder.rs | 82 ++++++++++++++----- .../program-test/src/logging/formatter.rs | 54 ++++++------ sdk-libs/program-test/src/logging/types.rs | 2 + 3 files changed, 92 insertions(+), 46 deletions(-) diff --git a/sdk-libs/program-test/src/logging/decoder.rs b/sdk-libs/program-test/src/logging/decoder.rs index dd62ab0de1..91706c189b 100644 --- a/sdk-libs/program-test/src/logging/decoder.rs +++ b/sdk-libs/program-test/src/logging/decoder.rs @@ -249,13 +249,22 @@ fn parse_invoke_instruction(data: &[u8], accounts: &[AccountMeta]) -> Instructio instruction_data .new_address_params .iter() - .map(|param| super::types::AddressParam { - seed: param.seed, - address_queue_index: Some(param.address_queue_account_index), - merkle_tree_index: Some(param.address_merkle_tree_account_index), - root_index: Some(param.address_merkle_tree_root_index), - derived_address: None, - assigned_account_index: super::types::AddressAssignment::V1, + .map(|param| { + let tree_idx = Some(param.address_merkle_tree_account_index); + let queue_idx = Some(param.address_queue_account_index); + let (tree_pubkey, queue_pubkey) = + resolve_tree_and_queue_pubkeys(accounts, tree_idx, queue_idx); + + super::types::AddressParam { + seed: param.seed, + address_queue_index: queue_idx, + address_queue_pubkey: queue_pubkey, + merkle_tree_index: tree_idx, + address_merkle_tree_pubkey: tree_pubkey, + root_index: Some(param.address_merkle_tree_root_index), + derived_address: None, + assigned_account_index: super::types::AddressAssignment::V1, + } }) .collect(), ) @@ -394,13 +403,22 @@ fn parse_invoke_cpi_instruction(data: &[u8], accounts: &[AccountMeta]) -> Instru instruction_data .new_address_params .iter() - .map(|param| super::types::AddressParam { - seed: param.seed, - address_queue_index: Some(param.address_queue_account_index), - merkle_tree_index: Some(param.address_merkle_tree_account_index), - root_index: Some(param.address_merkle_tree_root_index), - derived_address: None, - assigned_account_index: super::types::AddressAssignment::V1, + .map(|param| { + let tree_idx = Some(param.address_merkle_tree_account_index); + let queue_idx = Some(param.address_queue_account_index); + let (tree_pubkey, queue_pubkey) = + resolve_tree_and_queue_pubkeys(accounts, tree_idx, queue_idx); + + super::types::AddressParam { + seed: param.seed, + address_queue_index: queue_idx, + address_queue_pubkey: queue_pubkey, + merkle_tree_index: tree_idx, + address_merkle_tree_pubkey: tree_pubkey, + root_index: Some(param.address_merkle_tree_root_index), + derived_address: None, + assigned_account_index: super::types::AddressAssignment::V1, + } }) .collect(), ) @@ -534,10 +552,17 @@ fn parse_invoke_cpi_readonly_instruction( // Add new address parameters with actual values for param in &instruction_data.new_address_params { + let tree_idx = Some(param.address_merkle_tree_account_index); + let queue_idx = Some(param.address_queue_account_index); + let (tree_pubkey, queue_pubkey) = + resolve_tree_and_queue_pubkeys(accounts, tree_idx, queue_idx); + address_params.push(super::types::AddressParam { seed: param.seed, - address_queue_index: Some(param.address_queue_account_index), - merkle_tree_index: Some(param.address_merkle_tree_account_index), + address_queue_index: queue_idx, + address_queue_pubkey: queue_pubkey, + merkle_tree_index: tree_idx, + address_merkle_tree_pubkey: tree_pubkey, root_index: Some(param.address_merkle_tree_root_index), derived_address: None, assigned_account_index: if param.assigned_to_account { @@ -550,10 +575,15 @@ fn parse_invoke_cpi_readonly_instruction( // Add readonly address parameters for readonly_addr in &instruction_data.read_only_addresses { + let tree_idx = Some(readonly_addr.address_merkle_tree_account_index); + let (tree_pubkey, _queue_pubkey) = resolve_tree_and_queue_pubkeys(accounts, tree_idx, None); + address_params.push(super::types::AddressParam { seed: [0; 32], // ReadOnly addresses don't have seeds in the same way address_queue_index: None, - merkle_tree_index: Some(readonly_addr.address_merkle_tree_account_index), + address_queue_pubkey: None, + merkle_tree_index: tree_idx, + address_merkle_tree_pubkey: tree_pubkey, root_index: Some(readonly_addr.address_merkle_tree_root_index), derived_address: Some(readonly_addr.address), assigned_account_index: super::types::AddressAssignment::None, @@ -686,10 +716,17 @@ fn parse_invoke_cpi_account_info_instruction( // Add new address parameters with actual values for param in &instruction_data.new_address_params { + let tree_idx = Some(param.address_merkle_tree_account_index); + let queue_idx = Some(param.address_queue_account_index); + let (tree_pubkey, queue_pubkey) = + resolve_tree_and_queue_pubkeys(accounts, tree_idx, queue_idx); + address_params.push(super::types::AddressParam { seed: param.seed, - address_queue_index: Some(param.address_queue_account_index), - merkle_tree_index: Some(param.address_merkle_tree_account_index), + address_queue_index: queue_idx, + address_queue_pubkey: queue_pubkey, + merkle_tree_index: tree_idx, + address_merkle_tree_pubkey: tree_pubkey, root_index: Some(param.address_merkle_tree_root_index), derived_address: None, assigned_account_index: if param.assigned_to_account { @@ -702,10 +739,15 @@ fn parse_invoke_cpi_account_info_instruction( // Add readonly address parameters for readonly_addr in &instruction_data.read_only_addresses { + let tree_idx = Some(readonly_addr.address_merkle_tree_account_index); + let (tree_pubkey, _queue_pubkey) = resolve_tree_and_queue_pubkeys(accounts, tree_idx, None); + address_params.push(super::types::AddressParam { seed: [0; 32], // ReadOnly addresses don't have seeds in the same way address_queue_index: None, - merkle_tree_index: Some(readonly_addr.address_merkle_tree_account_index), + address_queue_pubkey: None, + merkle_tree_index: tree_idx, + address_merkle_tree_pubkey: tree_pubkey, root_index: Some(readonly_addr.address_merkle_tree_root_index), derived_address: Some(readonly_addr.address), assigned_account_index: super::types::AddressAssignment::None, diff --git a/sdk-libs/program-test/src/logging/formatter.rs b/sdk-libs/program-test/src/logging/formatter.rs index 063085c563..fbb8339858 100644 --- a/sdk-libs/program-test/src/logging/formatter.rs +++ b/sdk-libs/program-test/src/logging/formatter.rs @@ -878,39 +878,41 @@ impl TransactionFormatter { addr_param.seed, self.colors.reset )?; - if let Some(queue_idx) = addr_param.address_queue_index { - writeln!( - output, - "{} {}queue_idx: {}{}{}", - indent, - self.colors.gray, - self.colors.cyan, - queue_idx, - self.colors.reset - )?; - } - if let Some(tree_idx) = addr_param.merkle_tree_index { + + // Check if v2 by comparing tree and queue pubkeys + let is_v2 = addr_param.address_merkle_tree_pubkey + == addr_param.address_queue_pubkey; + + // Display address tree + if let Some(tree_pubkey) = addr_param.address_merkle_tree_pubkey { writeln!( output, - "{} {}tree_idx: {}{}{}", + "{} {}tree[{}]: {}{}{}", indent, self.colors.gray, - self.colors.cyan, - tree_idx, + addr_param.merkle_tree_index.unwrap_or(0), + self.colors.yellow, + tree_pubkey, self.colors.reset )?; } - if let Some(root_idx) = addr_param.root_index { - writeln!( - output, - "{} {}root_idx: {}{}{}", - indent, - self.colors.gray, - self.colors.cyan, - root_idx, - self.colors.reset - )?; + + // Only display queue for v1 trees (when different from tree) + if !is_v2 { + if let Some(queue_pubkey) = addr_param.address_queue_pubkey { + writeln!( + output, + "{} {}queue[{}]: {}{}{}", + indent, + self.colors.gray, + addr_param.address_queue_index.unwrap_or(0), + self.colors.yellow, + queue_pubkey, + self.colors.reset + )?; + } } + if let Some(ref derived_addr) = addr_param.derived_address { writeln!( output, @@ -931,7 +933,7 @@ impl TransactionFormatter { }; writeln!( output, - "{} {}assigned_to_output_account: {}{}{}", + "{} {}assigned: {}{}{}", indent, self.colors.gray, self.colors.yellow, diff --git a/sdk-libs/program-test/src/logging/types.rs b/sdk-libs/program-test/src/logging/types.rs index ec67e6b2b3..29ec42dcc8 100644 --- a/sdk-libs/program-test/src/logging/types.rs +++ b/sdk-libs/program-test/src/logging/types.rs @@ -122,7 +122,9 @@ pub enum AddressAssignment { pub struct AddressParam { pub seed: [u8; 32], pub address_queue_index: Option, + pub address_queue_pubkey: Option, pub merkle_tree_index: Option, + pub address_merkle_tree_pubkey: Option, pub root_index: Option, pub derived_address: Option<[u8; 32]>, pub assigned_account_index: AddressAssignment, From 8ccb9dee3d9acae47f9ab8846372436df28f182c Mon Sep 17 00:00:00 2001 From: ananas Date: Wed, 8 Oct 2025 03:18:37 +0100 Subject: [PATCH 2/7] feat: statelessjs add PackedAccounts v1 and v2 --- .github/workflows/js-v2.yml | 7 + js/stateless.js/src/rpc.ts | 15 + .../src/test-helpers/test-rpc/test-rpc.ts | 15 + js/stateless.js/src/utils/index.ts | 1 + js/stateless.js/src/utils/instruction.ts | 256 ++++++ pnpm-lock.yaml | 824 +++++++++++++----- pnpm-workspace.yaml | 1 + scripts/install.sh | 2 +- sdk-tests/sdk-anchor-test/Anchor.toml | 9 +- sdk-tests/sdk-anchor-test/package.json | 24 +- .../programs/sdk-anchor-test/Cargo.toml | 2 +- .../programs/sdk-anchor-test/src/lib.rs | 99 +++ sdk-tests/sdk-anchor-test/tests/test_v1.ts | 335 +++++++ sdk-tests/sdk-anchor-test/tests/test_v2.ts | 343 ++++++++ sdk-tests/sdk-anchor-test/tsconfig.json | 3 +- 15 files changed, 1706 insertions(+), 230 deletions(-) create mode 100644 js/stateless.js/src/utils/instruction.ts create mode 100644 sdk-tests/sdk-anchor-test/tests/test_v1.ts create mode 100644 sdk-tests/sdk-anchor-test/tests/test_v2.ts diff --git a/.github/workflows/js-v2.yml b/.github/workflows/js-v2.yml index e6ecbc8f89..8b1df26cd7 100644 --- a/.github/workflows/js-v2.yml +++ b/.github/workflows/js-v2.yml @@ -85,6 +85,13 @@ jobs: source ./scripts/devenv.sh npx nx test @lightprotocol/compressed-token + - name: Run sdk-anchor-test TypeScript tests with V2 + run: | + source ./scripts/devenv.sh + cd sdk-tests/sdk-anchor-test + anchor build + npm run test-ts + - name: Display prover logs on failure if: failure() run: | diff --git a/js/stateless.js/src/rpc.ts b/js/stateless.js/src/rpc.ts index d0b08b26c6..1f120f2905 100644 --- a/js/stateless.js/src/rpc.ts +++ b/js/stateless.js/src/rpc.ts @@ -74,6 +74,7 @@ import { defaultStateTreeLookupTables, versionedEndpoint, featureFlags, + batchAddressTree, } from './constants'; import BN from 'bn.js'; import { toCamelCase, toHex } from './utils/conversion'; @@ -702,6 +703,20 @@ export class Rpc extends Connection implements CompressionApiInterface { } } + /** + * Get a V2 address tree info. + */ + async getAddressTreeInfoV2(): Promise { + const tree = new PublicKey(batchAddressTree); + return { + tree, + queue: tree, + cpiContext: PublicKey.default, + treeType: TreeType.AddressV2, + nextTreeInfo: null, + }; + } + /** * Fetch the compressed account for the specified account address or hash */ diff --git a/js/stateless.js/src/test-helpers/test-rpc/test-rpc.ts b/js/stateless.js/src/test-helpers/test-rpc/test-rpc.ts index 3b206a7285..ac11d2d23d 100644 --- a/js/stateless.js/src/test-helpers/test-rpc/test-rpc.ts +++ b/js/stateless.js/src/test-helpers/test-rpc/test-rpc.ts @@ -15,6 +15,7 @@ import { getParsedEvents } from './get-parsed-events'; import { defaultTestStateTreeAccounts, localTestActiveStateTreeInfos, + batchAddressTree, } from '../../constants'; import { AddressWithTree, @@ -179,6 +180,20 @@ export class TestRpc extends Connection implements CompressionApiInterface { throw new Error('doFetch not supported in test-rpc'); } + /** + * Get a V2 address tree info. + */ + async getAddressTreeInfoV2(): Promise { + const tree = new PublicKey(batchAddressTree); + return { + tree, + queue: tree, + cpiContext: PublicKey.default, + treeType: TreeType.AddressV2, + nextTreeInfo: null, + }; + } + /** * Fetch the compressed account for the specified account hash */ diff --git a/js/stateless.js/src/utils/index.ts b/js/stateless.js/src/utils/index.ts index 1135d41f81..618974d044 100644 --- a/js/stateless.js/src/utils/index.ts +++ b/js/stateless.js/src/utils/index.ts @@ -3,6 +3,7 @@ export * from './airdrop'; export * from './calculate-compute-unit-price'; export * from './conversion'; export * from './dedupe-signer'; +export * from './instruction'; export * from './parse-validity-proof'; export * from './pipe'; export * from './send-and-confirm'; diff --git a/js/stateless.js/src/utils/instruction.ts b/js/stateless.js/src/utils/instruction.ts new file mode 100644 index 0000000000..54a9f6f27e --- /dev/null +++ b/js/stateless.js/src/utils/instruction.ts @@ -0,0 +1,256 @@ +import { AccountMeta, PublicKey, SystemProgram } from '@solana/web3.js'; +import { defaultStaticAccountsStruct } from '../constants'; +import { LightSystemProgram } from '../programs'; + +export class PackedAccounts { + private preAccounts: AccountMeta[] = []; + private systemAccounts: AccountMeta[] = []; + private nextIndex: number = 0; + private map: Map = new Map(); + + static newWithSystemAccounts( + config: SystemAccountMetaConfig, + ): PackedAccounts { + const instance = new PackedAccounts(); + instance.addSystemAccounts(config); + return instance; + } + + static newWithSystemAccountsV2( + config: SystemAccountMetaConfig, + ): PackedAccounts { + const instance = new PackedAccounts(); + instance.addSystemAccountsV2(config); + return instance; + } + + addPreAccountsSigner(pubkey: PublicKey): void { + this.preAccounts.push({ pubkey, isSigner: true, isWritable: false }); + } + + addPreAccountsSignerMut(pubkey: PublicKey): void { + this.preAccounts.push({ pubkey, isSigner: true, isWritable: true }); + } + + addPreAccountsMeta(accountMeta: AccountMeta): void { + this.preAccounts.push(accountMeta); + } + + addSystemAccounts(config: SystemAccountMetaConfig): void { + this.systemAccounts.push(...getLightSystemAccountMetas(config)); + } + + addSystemAccountsV2(config: SystemAccountMetaConfig): void { + this.systemAccounts.push(...getLightSystemAccountMetasV2(config)); + } + + insertOrGet(pubkey: PublicKey): number { + return this.insertOrGetConfig(pubkey, false, true); + } + + insertOrGetReadOnly(pubkey: PublicKey): number { + return this.insertOrGetConfig(pubkey, false, false); + } + + insertOrGetConfig( + pubkey: PublicKey, + isSigner: boolean, + isWritable: boolean, + ): number { + const entry = this.map.get(pubkey); + if (entry) { + return entry[0]; + } + const index = this.nextIndex++; + const meta: AccountMeta = { pubkey, isSigner, isWritable }; + this.map.set(pubkey, [index, meta]); + return index; + } + + private hashSetAccountsToMetas(): AccountMeta[] { + const entries = Array.from(this.map.entries()); + entries.sort((a, b) => a[1][0] - b[1][0]); + return entries.map(([, [, meta]]) => meta); + } + + private getOffsets(): [number, number] { + const systemStart = this.preAccounts.length; + const packedStart = systemStart + this.systemAccounts.length; + return [systemStart, packedStart]; + } + + toAccountMetas(): { + remainingAccounts: AccountMeta[]; + systemStart: number; + packedStart: number; + } { + const packed = this.hashSetAccountsToMetas(); + const [systemStart, packedStart] = this.getOffsets(); + return { + remainingAccounts: [ + ...this.preAccounts, + ...this.systemAccounts, + ...packed, + ], + systemStart, + packedStart, + }; + } +} + +export class SystemAccountMetaConfig { + selfProgram: PublicKey; + cpiContext?: PublicKey; + solCompressionRecipient?: PublicKey; + solPoolPda?: PublicKey; + + private constructor( + selfProgram: PublicKey, + cpiContext?: PublicKey, + solCompressionRecipient?: PublicKey, + solPoolPda?: PublicKey, + ) { + this.selfProgram = selfProgram; + this.cpiContext = cpiContext; + this.solCompressionRecipient = solCompressionRecipient; + this.solPoolPda = solPoolPda; + } + + static new(selfProgram: PublicKey): SystemAccountMetaConfig { + return new SystemAccountMetaConfig(selfProgram); + } + + static newWithCpiContext( + selfProgram: PublicKey, + cpiContext: PublicKey, + ): SystemAccountMetaConfig { + return new SystemAccountMetaConfig(selfProgram, cpiContext); + } +} + +export function getLightSystemAccountMetas( + config: SystemAccountMetaConfig, +): AccountMeta[] { + let signerSeed = new TextEncoder().encode('cpi_authority'); + const cpiSigner = PublicKey.findProgramAddressSync( + [signerSeed], + config.selfProgram, + )[0]; + const defaults = defaultStaticAccountsStruct(); + const noopProgram = new PublicKey( + 'noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV', + ); + const metas: AccountMeta[] = [ + { + pubkey: LightSystemProgram.programId, + isSigner: false, + isWritable: false, + }, + { pubkey: cpiSigner, isSigner: false, isWritable: false }, + { + pubkey: defaults.registeredProgramPda, + isSigner: false, + isWritable: false, + }, + { pubkey: noopProgram, isSigner: false, isWritable: false }, + { + pubkey: defaults.accountCompressionAuthority, + isSigner: false, + isWritable: false, + }, + { + pubkey: defaults.accountCompressionProgram, + isSigner: false, + isWritable: false, + }, + { pubkey: config.selfProgram, isSigner: false, isWritable: false }, + ]; + if (config.solPoolPda) { + metas.push({ + pubkey: config.solPoolPda, + isSigner: false, + isWritable: true, + }); + } + if (config.solCompressionRecipient) { + metas.push({ + pubkey: config.solCompressionRecipient, + isSigner: false, + isWritable: true, + }); + } + metas.push({ + pubkey: SystemProgram.programId, + isSigner: false, + isWritable: false, + }); + if (config.cpiContext) { + metas.push({ + pubkey: config.cpiContext, + isSigner: false, + isWritable: true, + }); + } + return metas; +} + +export function getLightSystemAccountMetasV2( + config: SystemAccountMetaConfig, +): AccountMeta[] { + let signerSeed = new TextEncoder().encode('cpi_authority'); + const cpiSigner = PublicKey.findProgramAddressSync( + [signerSeed], + config.selfProgram, + )[0]; + const defaults = defaultStaticAccountsStruct(); + const metas: AccountMeta[] = [ + { + pubkey: LightSystemProgram.programId, + isSigner: false, + isWritable: false, + }, + { pubkey: cpiSigner, isSigner: false, isWritable: false }, + { + pubkey: defaults.registeredProgramPda, + isSigner: false, + isWritable: false, + }, + { + pubkey: defaults.accountCompressionAuthority, + isSigner: false, + isWritable: false, + }, + { + pubkey: defaults.accountCompressionProgram, + isSigner: false, + isWritable: false, + }, + { + pubkey: SystemProgram.programId, + isSigner: false, + isWritable: false, + }, + ]; + if (config.solPoolPda) { + metas.push({ + pubkey: config.solPoolPda, + isSigner: false, + isWritable: true, + }); + } + if (config.solCompressionRecipient) { + metas.push({ + pubkey: config.solCompressionRecipient, + isSigner: false, + isWritable: true, + }); + } + if (config.cpiContext) { + metas.push({ + pubkey: config.cpiContext, + isSigner: false, + isWritable: true, + }); + } + return metas; +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3f04407711..8900116f9f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,16 +25,16 @@ importers: version: 0.7.5 syncpack: specifier: ^13.0.4 - version: 13.0.4(typescript@5.9.3) + version: 13.0.4(typescript@5.9.2) typescript: - specifier: ^5.9.3 - version: 5.9.3 + specifier: ^5.9.2 + version: 5.9.2 cli: dependencies: '@coral-xyz/anchor': specifier: 0.29.0 - version: 0.29.0(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10) + version: 0.29.0(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) '@lightprotocol/compressed-token': specifier: workspace:* version: link:../js/compressed-token @@ -64,7 +64,7 @@ importers: version: 0.4.14(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@solana/web3.js': specifier: 1.98.4 - version: 1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10) + version: 1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) axios: specifier: 1.12.2 version: 1.12.2 @@ -116,7 +116,7 @@ importers: version: 4.1.14(@oclif/core@4.5.4) '@solana/spl-token': specifier: ^0.3.11 - version: 0.3.11(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@5.0.10) + version: 0.3.11(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2)(utf-8-validate@5.0.10) '@types/bn.js': specifier: ^5.1.5 version: 5.2.0 @@ -143,10 +143,10 @@ importers: version: 3.0.4 '@typescript-eslint/eslint-plugin': specifier: ^8.44.0 - version: 8.44.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.3))(eslint@9.36.0)(typescript@5.9.3) + version: 8.44.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.2))(eslint@9.36.0)(typescript@5.9.2) '@typescript-eslint/parser': specifier: ^8.44.0 - version: 8.44.0(eslint@9.36.0)(typescript@5.9.3) + version: 8.44.0(eslint@9.36.0)(typescript@5.9.2) chai: specifier: ^6.0.1 version: 6.0.1 @@ -179,7 +179,7 @@ importers: version: 4.20.5 typescript: specifier: ^5.9.2 - version: 5.9.3 + version: 5.9.2 forester: devDependencies: @@ -191,7 +191,7 @@ importers: dependencies: '@coral-xyz/borsh': specifier: ^0.29.0 - version: 0.29.0(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10)) + version: 0.29.0(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10)) '@lightprotocol/stateless.js': specifier: workspace:* version: link:../stateless.js @@ -204,7 +204,7 @@ importers: devDependencies: '@coral-xyz/anchor': specifier: ^0.29.0 - version: 0.29.0(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10) + version: 0.29.0(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) '@esbuild-plugins/node-globals-polyfill': specifier: ^0.2.3 version: 0.2.3(esbuild@0.25.10) @@ -240,13 +240,13 @@ importers: version: 0.4.4(rollup@4.21.3) '@rollup/plugin-typescript': specifier: ^11.1.6 - version: 11.1.6(rollup@4.21.3)(tslib@2.7.0)(typescript@5.9.3) + version: 11.1.6(rollup@4.21.3)(tslib@2.7.0)(typescript@5.9.2) '@solana/spl-token': specifier: 0.4.8 - version: 0.4.8(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@5.0.10) + version: 0.4.8(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2)(utf-8-validate@5.0.10) '@solana/web3.js': specifier: 1.98.4 - version: 1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10) + version: 1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) '@types/bn.js': specifier: ^5.1.5 version: 5.2.0 @@ -255,10 +255,10 @@ importers: version: 22.16.5 '@typescript-eslint/eslint-plugin': specifier: ^8.44.0 - version: 8.44.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.3))(eslint@9.36.0)(typescript@5.9.3) + version: 8.44.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.2))(eslint@9.36.0)(typescript@5.9.2) '@typescript-eslint/parser': specifier: ^8.44.0 - version: 8.44.0(eslint@9.36.0)(typescript@5.9.3) + version: 8.44.0(eslint@9.36.0)(typescript@5.9.2) add: specifier: ^2.0.6 version: 2.0.6 @@ -270,7 +270,7 @@ importers: version: 9.36.0 eslint-plugin-import: specifier: ^2.30.0 - version: 2.30.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.3))(eslint@9.36.0) + version: 2.30.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.2))(eslint@9.36.0) eslint-plugin-n: specifier: ^17.10.2 version: 17.10.2(eslint@9.36.0) @@ -279,7 +279,7 @@ importers: version: 7.1.0(eslint@9.36.0) eslint-plugin-vitest: specifier: ^0.5.4 - version: 0.5.4(@typescript-eslint/eslint-plugin@8.44.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.3))(eslint@9.36.0)(typescript@5.9.3))(eslint@9.36.0)(typescript@5.9.3)(vitest@2.1.1(@types/node@22.16.5)(terser@5.43.1)) + version: 0.5.4(@typescript-eslint/eslint-plugin@8.44.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.2))(eslint@9.36.0)(typescript@5.9.2))(eslint@9.36.0)(typescript@5.9.2)(vitest@2.1.1(@types/node@22.16.5)(terser@5.43.1)) prettier: specifier: ^3.3.3 version: 3.6.2 @@ -294,7 +294,7 @@ importers: version: 3.5.0 rollup-plugin-dts: specifier: ^6.1.1 - version: 6.1.1(rollup@4.21.3)(typescript@5.9.3) + version: 6.1.1(rollup@4.21.3)(typescript@5.9.2) rollup-plugin-polyfill-node: specifier: ^0.13.0 version: 0.13.0(rollup@4.21.3) @@ -303,13 +303,13 @@ importers: version: 5.12.0(rollup@4.21.3) ts-node: specifier: ^10.9.2 - version: 10.9.2(@types/node@22.16.5)(typescript@5.9.3) + version: 10.9.2(@types/node@22.16.5)(typescript@5.9.2) tslib: specifier: ^2.7.0 version: 2.7.0 typescript: specifier: ^5.6.2 - version: 5.9.3 + version: 5.9.2 vitest: specifier: ^2.1.1 version: 2.1.1(@types/node@22.16.5)(terser@5.43.1) @@ -318,7 +318,7 @@ importers: dependencies: '@coral-xyz/borsh': specifier: ^0.29.0 - version: 0.29.0(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10)) + version: 0.29.0(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10)) '@noble/hashes': specifier: 1.5.0 version: 1.5.0 @@ -346,7 +346,7 @@ importers: devDependencies: '@coral-xyz/anchor': specifier: 0.29.0 - version: 0.29.0(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10) + version: 0.29.0(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) '@esbuild-plugins/node-globals-polyfill': specifier: ^0.2.3 version: 0.2.3(esbuild@0.25.10) @@ -382,10 +382,10 @@ importers: version: 0.4.4(rollup@4.21.3) '@rollup/plugin-typescript': specifier: ^11.1.6 - version: 11.1.6(rollup@4.21.3)(tslib@2.7.0)(typescript@5.9.3) + version: 11.1.6(rollup@4.21.3)(tslib@2.7.0)(typescript@5.9.2) '@solana/web3.js': specifier: 1.98.4 - version: 1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10) + version: 1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) '@types/bn.js': specifier: ^5.1.5 version: 5.2.0 @@ -394,10 +394,10 @@ importers: version: 22.16.5 '@typescript-eslint/eslint-plugin': specifier: ^8.44.0 - version: 8.44.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.3))(eslint@9.36.0)(typescript@5.9.3) + version: 8.44.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.2))(eslint@9.36.0)(typescript@5.9.2) '@typescript-eslint/parser': specifier: ^8.44.0 - version: 8.44.0(eslint@9.36.0)(typescript@5.9.3) + version: 8.44.0(eslint@9.36.0)(typescript@5.9.2) eslint: specifier: ^9.36.0 version: 9.36.0 @@ -409,7 +409,7 @@ importers: version: 7.1.0(eslint@9.36.0) eslint-plugin-vitest: specifier: ^0.5.4 - version: 0.5.4(@typescript-eslint/eslint-plugin@8.44.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.3))(eslint@9.36.0)(typescript@5.9.3))(eslint@9.36.0)(typescript@5.9.3)(vitest@2.1.1(@types/node@22.16.5)(terser@5.43.1)) + version: 0.5.4(@typescript-eslint/eslint-plugin@8.44.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.2))(eslint@9.36.0)(typescript@5.9.2))(eslint@9.36.0)(typescript@5.9.2)(vitest@2.1.1(@types/node@22.16.5)(terser@5.43.1)) http-server: specifier: ^14.1.1 version: 14.1.1 @@ -427,13 +427,13 @@ importers: version: 4.21.3 rollup-plugin-dts: specifier: ^6.1.1 - version: 6.1.1(rollup@4.21.3)(typescript@5.9.3) + version: 6.1.1(rollup@4.21.3)(typescript@5.9.2) rollup-plugin-polyfill-node: specifier: ^0.13.0 version: 0.13.0(rollup@4.21.3) ts-node: specifier: ^10.9.2 - version: 10.9.2(@types/node@22.16.5)(typescript@5.9.3) + version: 10.9.2(@types/node@22.16.5)(typescript@5.9.2) tslib: specifier: ^2.7.0 version: 2.7.0 @@ -442,7 +442,7 @@ importers: version: 1.0.3 typescript: specifier: ^5.6.2 - version: 5.9.3 + version: 5.9.2 vitest: specifier: ^2.1.1 version: 2.1.1(@types/node@22.16.5)(terser@5.43.1) @@ -451,6 +451,43 @@ importers: programs: {} + sdk-tests/sdk-anchor-test: + dependencies: + '@coral-xyz/anchor': + specifier: ^0.31.1 + version: 0.31.1(bufferutil@4.0.8)(typescript@4.9.5)(utf-8-validate@5.0.10) + '@lightprotocol/stateless.js': + specifier: workspace:* + version: link:../../js/stateless.js + devDependencies: + '@lightprotocol/zk-compression-cli': + specifier: workspace:* + version: link:../../cli + '@types/bn.js': + specifier: ^5.1.0 + version: 5.2.0 + '@types/chai': + specifier: ^4.3.0 + version: 4.3.20 + '@types/mocha': + specifier: ^9.0.0 + version: 9.1.1 + chai: + specifier: ^4.3.4 + version: 4.5.0 + mocha: + specifier: ^9.0.3 + version: 9.2.2 + prettier: + specifier: ^2.6.2 + version: 2.8.8 + ts-mocha: + specifier: ^10.1.0 + version: 10.1.0(mocha@9.2.2) + typescript: + specifier: ^4.3.5 + version: 4.9.5 + tsconfig: {} packages: @@ -721,16 +758,30 @@ packages: resolution: {integrity: sha512-bkFqkLhh3pMBUQQkpVgWDWq/lqzc2678eUyDlTBhRqhCHFguYYGM0Efga7tYk4TogG/3x0EEl66/OQ+WGbWB/Q==} engines: {node: '>=6.9.0'} + '@coral-xyz/anchor-errors@0.31.1': + resolution: {integrity: sha512-NhNEku4F3zzUSBtrYz84FzYWm48+9OvmT1Hhnwr6GnPQry2dsEqH/ti/7ASjjpoFTWRnPXrjAIT1qM6Isop+LQ==} + engines: {node: '>=10'} + '@coral-xyz/anchor@0.29.0': resolution: {integrity: sha512-eny6QNG0WOwqV0zQ7cs/b1tIuzZGmP7U7EcH+ogt4Gdbl8HDmIYVMh/9aTmYZPaFWjtUaI8qSn73uYEXWfATdA==} engines: {node: '>=11'} + '@coral-xyz/anchor@0.31.1': + resolution: {integrity: sha512-QUqpoEK+gi2S6nlYc2atgT2r41TT3caWr/cPUEL8n8Md9437trZ68STknq897b82p5mW0XrTBNOzRbmIRJtfsA==} + engines: {node: '>=17'} + '@coral-xyz/borsh@0.29.0': resolution: {integrity: sha512-s7VFVa3a0oqpkuRloWVPdCK7hMbAMY270geZOGfCnaqexrP5dTIpbEHL33req6IYPPJ0hYa71cdvJ1h6V55/oQ==} engines: {node: '>=10'} peerDependencies: '@solana/web3.js': ^1.68.0 + '@coral-xyz/borsh@0.31.1': + resolution: {integrity: sha512-9N8AU9F0ubriKfNE3g1WF0/4dtlGXoBN/hd1PvbNBamBNwRgHxH4P+o3Zt7rSEloW1HUs6LfZEchlx9fW7POYw==} + engines: {node: '>=10'} + peerDependencies: + '@solana/web3.js': ^1.69.0 + '@cspotcode/source-map-support@0.8.1': resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} @@ -2076,6 +2127,9 @@ packages: '@types/bn.js@5.2.0': resolution: {integrity: sha512-DLbJ1BPqxvQhIGbeu8VbUC1DiAiahHtAYvA0ZEAa4P31F7IaArc8z3C3BRQdWX4mtLQuABG4yzp76ZrS02Ui1Q==} + '@types/chai@4.3.20': + resolution: {integrity: sha512-/pC9HAB5I/xMlc5FP77qjCnI16ChlJfW0tGa0IUcFn38VJrTV6DeZ60NU5KZBtaOZqjdpwTWohz5HU1RrhiYxQ==} + '@types/chai@5.2.2': resolution: {integrity: sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==} @@ -2115,6 +2169,9 @@ packages: '@types/mocha@10.0.10': resolution: {integrity: sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==} + '@types/mocha@9.1.1': + resolution: {integrity: sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==} + '@types/mute-stream@0.0.4': resolution: {integrity: sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==} @@ -2243,6 +2300,9 @@ packages: resolution: {integrity: sha512-zaz9u8EJ4GBmnehlrpoKvj/E3dNbuQ7q0ucyZImm3cLqJ8INTc970B1qEqDX/Rzq65r3TvVTN7kHWPBoyW7DWw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@ungap/promise-all-settled@1.1.2': + resolution: {integrity: sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==} + '@vitest/expect@2.1.1': resolution: {integrity: sha512-YeueunS0HiHiQxk+KEOnq/QMzlUuOzbU1Go+PgAsHvvv3tUkJPm9xWt+6ITNTlzsMXUjmgm5T+U7KBPK2qQV6w==} @@ -2317,6 +2377,10 @@ packages: ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + ansi-colors@4.1.1: + resolution: {integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==} + engines: {node: '>=6'} + ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} @@ -2357,6 +2421,10 @@ packages: resolution: {integrity: sha512-0qWUglt9JEqLFr3w1I1pbrChn1grhaiAR2ocX1PP/flRmxgtwTzPFFFnfIlD6aMOLQZgSuCRlidD70lvx8yhzg==} engines: {node: '>=14'} + anymatch@3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + arg@4.1.3: resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} @@ -2416,6 +2484,9 @@ packages: asn1.js@4.10.1: resolution: {integrity: sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==} + assertion-error@1.1.0: + resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} + assertion-error@2.0.1: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} @@ -2469,8 +2540,8 @@ packages: base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - baseline-browser-mapping@2.8.12: - resolution: {integrity: sha512-vAPMQdnyKCBtkmQA6FMCBvU9qFIppS3nzyXnEM+Lo2IAhG4Mpjv9cCxMudhgV3YdNNJv6TNqXy97dfRVL2LmaQ==} + baseline-browser-mapping@2.8.9: + resolution: {integrity: sha512-hY/u2lxLrbecMEWSB0IpGzGyDyeoMFQhCvZd2jGFSE5I17Fh01sYUBPCJtkWERw7zrac9+cIghxm/ytJa2X8iA==} hasBin: true basic-auth@2.0.1: @@ -2488,6 +2559,10 @@ packages: bignumber.js@9.1.2: resolution: {integrity: sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==} + binary-extensions@2.3.0: + resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} + engines: {node: '>=8'} + bindings@1.5.0: resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} @@ -2547,8 +2622,8 @@ packages: resolution: {integrity: sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw==} engines: {node: '>= 0.12'} - browserslist@4.26.3: - resolution: {integrity: sha512-lAUU+02RFBuCKQPj/P6NgjlbCnLBMp4UtgTx7vNHd3XSIJF87s9a5rA3aH2yw3GS9DqZAUbOtZdCCiZeVRqt0w==} + browserslist@4.26.2: + resolution: {integrity: sha512-ECFzp6uFOSB+dcZ5BK/IBaGWssbSYBHvuMeMt3MMFyhI0Z8SqGgEkBLARgpRH3hutIgPVsALcMwbDrJqPxQ65A==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true @@ -2632,8 +2707,8 @@ packages: resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==} engines: {node: '>=16'} - caniuse-lite@1.0.30001748: - resolution: {integrity: sha512-5P5UgAr0+aBmNiplks08JLw+AW/XG/SurlgZLgB1dDLfAw7EfRGxIwzPHxdSCGY/BTKDqIVyJL87cCN6s0ZR0w==} + caniuse-lite@1.0.30001745: + resolution: {integrity: sha512-ywt6i8FzvdgrrrGbr1jZVObnVv6adj+0if2/omv9cmR2oiZs30zL4DIyaptKcbOrBdOIc74QTMoJvSE2QHh5UQ==} capital-case@1.0.4: resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==} @@ -2642,6 +2717,10 @@ packages: resolution: {integrity: sha512-zlOQ80VrQ2Ue+ymH5OuM/DlDq64mEm+B9UTdHULv5osUMD6HalNTblf2b1u/m6QecjsnOkBpqVZ+XPwIVsy7Ng==} engines: {node: '>=12.13'} + chai@4.5.0: + resolution: {integrity: sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==} + engines: {node: '>=4'} + chai@5.2.1: resolution: {integrity: sha512-5nFxhUrX0PqtyogoYOA8IPswy5sZFTOsBFl/9bNsmDLgsxYTzSZQJDPppDnZPTQbzSEm0hqGjWPzRemQCYbD6A==} engines: {node: '>=18'} @@ -2675,6 +2754,9 @@ packages: chardet@2.1.0: resolution: {integrity: sha512-bNFETTG/pM5ryzQ9Ad0lJOTa6HWD/YsScAR3EnCPZRPlQh77JocYktSHOUHelyhm8IARL+o4c4F1bP5KVOjiRA==} + check-error@1.0.3: + resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} + check-error@2.1.1: resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} engines: {node: '>= 16'} @@ -2682,6 +2764,10 @@ packages: check-types@11.2.3: resolution: {integrity: sha512-+67P1GkJRaxQD6PKK0Et9DhwQB+vGg3PM5+aavopCpZT1lj9jeqfvpgTLAWErNj8qApkkmXlu/Ug74kmhagkXg==} + chokidar@3.5.3: + resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} + engines: {node: '>= 8.10.0'} + chokidar@4.0.3: resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} engines: {node: '>= 14.16.0'} @@ -2737,6 +2823,9 @@ packages: resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} engines: {node: '>= 12'} + cliui@7.0.4: + resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} + cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} @@ -2892,6 +2981,15 @@ packages: supports-color: optional: true + debug@4.3.3: + resolution: {integrity: sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -2927,6 +3025,10 @@ packages: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} engines: {node: '>=10'} + deep-eql@4.1.4: + resolution: {integrity: sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==} + engines: {node: '>=6'} + deep-eql@5.0.2: resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} engines: {node: '>=6'} @@ -2992,6 +3094,10 @@ packages: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} + diff@5.0.0: + resolution: {integrity: sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==} + engines: {node: '>=0.3.1'} + diff@7.0.0: resolution: {integrity: sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==} engines: {node: '>=0.3.1'} @@ -3033,8 +3139,8 @@ packages: engines: {node: '>=0.10.0'} hasBin: true - electron-to-chromium@1.5.230: - resolution: {integrity: sha512-A6A6Fd3+gMdaed9wX83CvHYJb4UuapPD5X5SLq72VZJzxHSY0/LUweGXRWmQlh2ln7KV7iw7jnwXK7dlPoOnHQ==} + electron-to-chromium@1.5.227: + resolution: {integrity: sha512-ITxuoPfJu3lsNWUi2lBM2PaBPYgH3uqmxut5vmBxgYvyI4AlJ6P3Cai1O76mOrkJCBzq0IxWg/NtqOrpu/0gKA==} elliptic@6.5.4: resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} @@ -3532,6 +3638,9 @@ packages: resolution: {integrity: sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==} engines: {node: '>=18'} + get-func-name@2.0.2: + resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} + get-intrinsic@1.2.1: resolution: {integrity: sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==} @@ -3600,6 +3709,10 @@ packages: engines: {node: 20 || >=22} hasBin: true + glob@7.2.0: + resolution: {integrity: sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==} + deprecated: Glob versions prior to v9 are no longer supported + glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Glob versions prior to v9 are no longer supported @@ -3652,6 +3765,10 @@ packages: graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} + growl@1.10.5: + resolution: {integrity: sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==} + engines: {node: '>=4.x'} + has-bigints@1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} @@ -3877,6 +3994,10 @@ packages: resolution: {integrity: sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==} engines: {node: '>= 0.4'} + is-binary-path@2.1.0: + resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + engines: {node: '>=8'} + is-boolean-object@1.1.2: resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} engines: {node: '>= 0.4'} @@ -4257,6 +4378,9 @@ packages: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true + loupe@2.3.7: + resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} + loupe@3.2.0: resolution: {integrity: sha512-2NCfZcT5VGVNX9mSZIxLRkEAegDGBpuQZBy13desuHeVORmBDyAET4TkJr4SjqQy3A8JDofMN6LpkK8Xcm/dlw==} @@ -4356,6 +4480,10 @@ packages: minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + minimatch@4.2.1: + resolution: {integrity: sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==} + engines: {node: '>=10'} + minimatch@5.1.6: resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} engines: {node: '>=10'} @@ -4397,6 +4525,11 @@ packages: engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true + mocha@9.2.2: + resolution: {integrity: sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==} + engines: {node: '>= 12.0.0'} + hasBin: true + ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} @@ -4414,6 +4547,11 @@ packages: nanoassert@2.0.0: resolution: {integrity: sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA==} + nanoid@3.3.1: + resolution: {integrity: sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + nanoid@3.3.8: resolution: {integrity: sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -4454,13 +4592,17 @@ packages: node-machine-id@1.1.12: resolution: {integrity: sha512-QNABxbrPa3qEIfrE6GOJ7BYIuignnJw7iQ2YPbc3Nla1HzRJjXzZOiikfF8m7eAMfichLt3M4VgLOetqgDmgGQ==} - node-releases@2.0.23: - resolution: {integrity: sha512-cCmFDMSm26S6tQSDpBCg/NR8NENrVPhAJSf+XbxBG4rPFaaonlEoE9wHQmun+cls499TQGSb7ZyPBRlzgKfpeg==} + node-releases@2.0.21: + resolution: {integrity: sha512-5b0pgg78U3hwXkCM8Z9b2FJdPZlr9Psr9V2gQPESdGHqbntyFJKFW4r5TeWGFzafGY3hzs1JC62VEQMbl1JFkw==} normalize-package-data@6.0.2: resolution: {integrity: sha512-V6gygoYb/5EmNI+MEGrWkC+e6+Rr7mTmfHrxDbLzxQogBkgzo76rkok0Am6thgSF7Mv2nLOajAJj5vDJZEFn7g==} engines: {node: ^16.14.0 || >=18.0.0} + normalize-path@3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + normalize-url@8.0.1: resolution: {integrity: sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==} engines: {node: '>=14.16'} @@ -4746,6 +4888,9 @@ packages: pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} + pathval@1.1.1: + resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} + pathval@2.0.1: resolution: {integrity: sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==} engines: {node: '>= 14.16'} @@ -4809,6 +4954,11 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} + prettier@2.8.8: + resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} + engines: {node: '>=10.13.0'} + hasBin: true + prettier@3.6.2: resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==} engines: {node: '>=14'} @@ -4897,6 +5047,10 @@ packages: resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} engines: {node: '>= 6'} + readdirp@3.6.0: + resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} + engines: {node: '>=8.10.0'} + readdirp@4.1.2: resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} engines: {node: '>= 14.18.0'} @@ -5091,6 +5245,9 @@ packages: sentence-case@3.0.4: resolution: {integrity: sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==} + serialize-javascript@6.0.0: + resolution: {integrity: sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==} + serialize-javascript@6.0.2: resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==} @@ -5491,6 +5648,10 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} + type-detect@4.1.0: + resolution: {integrity: sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==} + engines: {node: '>=4'} + type-fest@0.21.3: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} @@ -5546,8 +5707,13 @@ packages: resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==} engines: {node: '>= 0.4'} - typescript@5.9.3: - resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + typescript@4.9.5: + resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} + engines: {node: '>=4.2.0'} + hasBin: true + + typescript@5.9.2: + resolution: {integrity: sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==} engines: {node: '>=14.17'} hasBin: true @@ -5774,6 +5940,9 @@ packages: wordwrap@1.0.0: resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} + workerpool@6.2.0: + resolution: {integrity: sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==} + workerpool@9.3.3: resolution: {integrity: sha512-slxCaKbYjEdFT/o2rH9xS1hf4uRDch1w7Uo+apxhZ+sf/1d9e0ZVkn42kPNGP2dgjIx6YFvSevj0zHvbWe2jdw==} @@ -5836,6 +6005,10 @@ packages: engines: {node: '>= 14'} hasBin: true + yargs-parser@20.2.4: + resolution: {integrity: sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==} + engines: {node: '>=10'} + yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} @@ -5844,6 +6017,10 @@ packages: resolution: {integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==} engines: {node: '>=10'} + yargs@16.2.0: + resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} + engines: {node: '>=10'} + yargs@17.7.2: resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} engines: {node: '>=12'} @@ -6447,7 +6624,7 @@ snapshots: dependencies: '@babel/compat-data': 7.28.4 '@babel/helper-validator-option': 7.27.1 - browserslist: 4.26.3 + browserslist: 4.26.2 lru-cache: 5.1.1 semver: 6.3.1 @@ -6536,11 +6713,13 @@ snapshots: '@babel/helper-string-parser': 7.27.1 '@babel/helper-validator-identifier': 7.27.1 - '@coral-xyz/anchor@0.29.0(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10)': + '@coral-xyz/anchor-errors@0.31.1': {} + + '@coral-xyz/anchor@0.29.0(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10)': dependencies: - '@coral-xyz/borsh': 0.29.0(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10)) + '@coral-xyz/borsh': 0.29.0(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10)) '@noble/hashes': 1.5.0 - '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10) + '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) bn.js: 5.2.1 bs58: 4.0.1 buffer-layout: 1.2.2 @@ -6558,9 +6737,36 @@ snapshots: - typescript - utf-8-validate - '@coral-xyz/borsh@0.29.0(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10))': + '@coral-xyz/anchor@0.31.1(bufferutil@4.0.8)(typescript@4.9.5)(utf-8-validate@5.0.10)': dependencies: - '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10) + '@coral-xyz/anchor-errors': 0.31.1 + '@coral-xyz/borsh': 0.31.1(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@4.9.5)(utf-8-validate@5.0.10)) + '@noble/hashes': 1.5.0 + '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@4.9.5)(utf-8-validate@5.0.10) + bn.js: 5.2.1 + bs58: 4.0.1 + buffer-layout: 1.2.2 + camelcase: 6.3.0 + cross-fetch: 3.1.8 + eventemitter3: 4.0.7 + pako: 2.1.0 + superstruct: 0.15.5 + toml: 3.0.0 + transitivePeerDependencies: + - bufferutil + - encoding + - typescript + - utf-8-validate + + '@coral-xyz/borsh@0.29.0(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10))': + dependencies: + '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) + bn.js: 5.2.1 + buffer-layout: 1.2.2 + + '@coral-xyz/borsh@0.31.1(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@4.9.5)(utf-8-validate@5.0.10))': + dependencies: + '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@4.9.5)(utf-8-validate@5.0.10) bn.js: 5.2.1 buffer-layout: 1.2.2 @@ -7281,11 +7487,11 @@ snapshots: optionalDependencies: rollup: 4.21.3 - '@rollup/plugin-typescript@11.1.6(rollup@4.21.3)(tslib@2.7.0)(typescript@5.9.3)': + '@rollup/plugin-typescript@11.1.6(rollup@4.21.3)(tslib@2.7.0)(typescript@5.9.2)': dependencies: '@rollup/pluginutils': 5.1.0(rollup@4.21.3) resolve: 1.22.8 - typescript: 5.9.3 + typescript: 5.9.2 optionalDependencies: rollup: 4.21.3 tslib: 2.7.0 @@ -7698,10 +7904,10 @@ snapshots: '@smithy/types': 4.5.0 tslib: 2.8.1 - '@solana/buffer-layout-utils@0.2.0(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10)': + '@solana/buffer-layout-utils@0.2.0(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10)': dependencies: '@solana/buffer-layout': 4.0.1 - '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10) + '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) bigint-buffer: 1.1.5 bignumber.js: 9.1.2 transitivePeerDependencies: @@ -7716,61 +7922,72 @@ snapshots: '@solana/codecs-core@2.0.0-experimental.8618508': {} - '@solana/codecs-core@2.0.0-preview.4(typescript@5.9.3)': + '@solana/codecs-core@2.0.0-preview.4(typescript@5.9.2)': dependencies: - '@solana/errors': 2.0.0-preview.4(typescript@5.9.3) - typescript: 5.9.3 + '@solana/errors': 2.0.0-preview.4(typescript@5.9.2) + typescript: 5.9.2 - '@solana/codecs-core@2.0.0-rc.1(typescript@5.9.3)': + '@solana/codecs-core@2.0.0-rc.1(typescript@5.9.2)': dependencies: - '@solana/errors': 2.0.0-rc.1(typescript@5.9.3) - typescript: 5.9.3 + '@solana/errors': 2.0.0-rc.1(typescript@5.9.2) + typescript: 5.9.2 - '@solana/codecs-core@2.3.0(typescript@5.9.3)': + '@solana/codecs-core@2.3.0(typescript@4.9.5)': dependencies: - '@solana/errors': 2.3.0(typescript@5.9.3) - typescript: 5.9.3 + '@solana/errors': 2.3.0(typescript@4.9.5) + typescript: 4.9.5 + + '@solana/codecs-core@2.3.0(typescript@5.9.2)': + dependencies: + '@solana/errors': 2.3.0(typescript@5.9.2) + typescript: 5.9.2 '@solana/codecs-data-structures@2.0.0-experimental.8618508': dependencies: '@solana/codecs-core': 2.0.0-experimental.8618508 '@solana/codecs-numbers': 2.0.0-experimental.8618508 - '@solana/codecs-data-structures@2.0.0-preview.4(typescript@5.9.3)': + '@solana/codecs-data-structures@2.0.0-preview.4(typescript@5.9.2)': dependencies: - '@solana/codecs-core': 2.0.0-preview.4(typescript@5.9.3) - '@solana/codecs-numbers': 2.0.0-preview.4(typescript@5.9.3) - '@solana/errors': 2.0.0-preview.4(typescript@5.9.3) - typescript: 5.9.3 + '@solana/codecs-core': 2.0.0-preview.4(typescript@5.9.2) + '@solana/codecs-numbers': 2.0.0-preview.4(typescript@5.9.2) + '@solana/errors': 2.0.0-preview.4(typescript@5.9.2) + typescript: 5.9.2 - '@solana/codecs-data-structures@2.0.0-rc.1(typescript@5.9.3)': + '@solana/codecs-data-structures@2.0.0-rc.1(typescript@5.9.2)': dependencies: - '@solana/codecs-core': 2.0.0-rc.1(typescript@5.9.3) - '@solana/codecs-numbers': 2.0.0-rc.1(typescript@5.9.3) - '@solana/errors': 2.0.0-rc.1(typescript@5.9.3) - typescript: 5.9.3 + '@solana/codecs-core': 2.0.0-rc.1(typescript@5.9.2) + '@solana/codecs-numbers': 2.0.0-rc.1(typescript@5.9.2) + '@solana/errors': 2.0.0-rc.1(typescript@5.9.2) + typescript: 5.9.2 '@solana/codecs-numbers@2.0.0-experimental.8618508': dependencies: '@solana/codecs-core': 2.0.0-experimental.8618508 - '@solana/codecs-numbers@2.0.0-preview.4(typescript@5.9.3)': + '@solana/codecs-numbers@2.0.0-preview.4(typescript@5.9.2)': + dependencies: + '@solana/codecs-core': 2.0.0-preview.4(typescript@5.9.2) + '@solana/errors': 2.0.0-preview.4(typescript@5.9.2) + typescript: 5.9.2 + + '@solana/codecs-numbers@2.0.0-rc.1(typescript@5.9.2)': dependencies: - '@solana/codecs-core': 2.0.0-preview.4(typescript@5.9.3) - '@solana/errors': 2.0.0-preview.4(typescript@5.9.3) - typescript: 5.9.3 + '@solana/codecs-core': 2.0.0-rc.1(typescript@5.9.2) + '@solana/errors': 2.0.0-rc.1(typescript@5.9.2) + typescript: 5.9.2 - '@solana/codecs-numbers@2.0.0-rc.1(typescript@5.9.3)': + '@solana/codecs-numbers@2.3.0(typescript@4.9.5)': dependencies: - '@solana/codecs-core': 2.0.0-rc.1(typescript@5.9.3) - '@solana/errors': 2.0.0-rc.1(typescript@5.9.3) - typescript: 5.9.3 + '@solana/codecs-core': 2.3.0(typescript@4.9.5) + '@solana/errors': 2.3.0(typescript@4.9.5) + typescript: 4.9.5 - '@solana/codecs-numbers@2.3.0(typescript@5.9.3)': + '@solana/codecs-numbers@2.3.0(typescript@5.9.2)': dependencies: - '@solana/codecs-core': 2.3.0(typescript@5.9.3) - '@solana/errors': 2.3.0(typescript@5.9.3) - typescript: 5.9.3 + '@solana/codecs-core': 2.3.0(typescript@5.9.2) + '@solana/errors': 2.3.0(typescript@5.9.2) + typescript: 5.9.2 '@solana/codecs-strings@2.0.0-experimental.8618508(fastestsmallesttextencoderdecoder@1.0.22)': dependencies: @@ -7778,99 +7995,105 @@ snapshots: '@solana/codecs-numbers': 2.0.0-experimental.8618508 fastestsmallesttextencoderdecoder: 1.0.22 - '@solana/codecs-strings@2.0.0-preview.4(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + '@solana/codecs-strings@2.0.0-preview.4(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2)': dependencies: - '@solana/codecs-core': 2.0.0-preview.4(typescript@5.9.3) - '@solana/codecs-numbers': 2.0.0-preview.4(typescript@5.9.3) - '@solana/errors': 2.0.0-preview.4(typescript@5.9.3) + '@solana/codecs-core': 2.0.0-preview.4(typescript@5.9.2) + '@solana/codecs-numbers': 2.0.0-preview.4(typescript@5.9.2) + '@solana/errors': 2.0.0-preview.4(typescript@5.9.2) fastestsmallesttextencoderdecoder: 1.0.22 - typescript: 5.9.3 + typescript: 5.9.2 - '@solana/codecs-strings@2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + '@solana/codecs-strings@2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2)': dependencies: - '@solana/codecs-core': 2.0.0-rc.1(typescript@5.9.3) - '@solana/codecs-numbers': 2.0.0-rc.1(typescript@5.9.3) - '@solana/errors': 2.0.0-rc.1(typescript@5.9.3) + '@solana/codecs-core': 2.0.0-rc.1(typescript@5.9.2) + '@solana/codecs-numbers': 2.0.0-rc.1(typescript@5.9.2) + '@solana/errors': 2.0.0-rc.1(typescript@5.9.2) fastestsmallesttextencoderdecoder: 1.0.22 - typescript: 5.9.3 + typescript: 5.9.2 - '@solana/codecs@2.0.0-preview.4(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + '@solana/codecs@2.0.0-preview.4(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2)': dependencies: - '@solana/codecs-core': 2.0.0-preview.4(typescript@5.9.3) - '@solana/codecs-data-structures': 2.0.0-preview.4(typescript@5.9.3) - '@solana/codecs-numbers': 2.0.0-preview.4(typescript@5.9.3) - '@solana/codecs-strings': 2.0.0-preview.4(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) - '@solana/options': 2.0.0-preview.4(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) - typescript: 5.9.3 + '@solana/codecs-core': 2.0.0-preview.4(typescript@5.9.2) + '@solana/codecs-data-structures': 2.0.0-preview.4(typescript@5.9.2) + '@solana/codecs-numbers': 2.0.0-preview.4(typescript@5.9.2) + '@solana/codecs-strings': 2.0.0-preview.4(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2) + '@solana/options': 2.0.0-preview.4(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2) + typescript: 5.9.2 transitivePeerDependencies: - fastestsmallesttextencoderdecoder - '@solana/codecs@2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + '@solana/codecs@2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2)': dependencies: - '@solana/codecs-core': 2.0.0-rc.1(typescript@5.9.3) - '@solana/codecs-data-structures': 2.0.0-rc.1(typescript@5.9.3) - '@solana/codecs-numbers': 2.0.0-rc.1(typescript@5.9.3) - '@solana/codecs-strings': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) - '@solana/options': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) - typescript: 5.9.3 + '@solana/codecs-core': 2.0.0-rc.1(typescript@5.9.2) + '@solana/codecs-data-structures': 2.0.0-rc.1(typescript@5.9.2) + '@solana/codecs-numbers': 2.0.0-rc.1(typescript@5.9.2) + '@solana/codecs-strings': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2) + '@solana/options': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2) + typescript: 5.9.2 transitivePeerDependencies: - fastestsmallesttextencoderdecoder - '@solana/errors@2.0.0-preview.4(typescript@5.9.3)': + '@solana/errors@2.0.0-preview.4(typescript@5.9.2)': dependencies: chalk: 5.4.1 commander: 12.1.0 - typescript: 5.9.3 + typescript: 5.9.2 - '@solana/errors@2.0.0-rc.1(typescript@5.9.3)': + '@solana/errors@2.0.0-rc.1(typescript@5.9.2)': dependencies: chalk: 5.4.1 commander: 12.1.0 - typescript: 5.9.3 + typescript: 5.9.2 - '@solana/errors@2.3.0(typescript@5.9.3)': + '@solana/errors@2.3.0(typescript@4.9.5)': dependencies: chalk: 5.4.1 commander: 14.0.1 - typescript: 5.9.3 + typescript: 4.9.5 + + '@solana/errors@2.3.0(typescript@5.9.2)': + dependencies: + chalk: 5.4.1 + commander: 14.0.1 + typescript: 5.9.2 '@solana/options@2.0.0-experimental.8618508': dependencies: '@solana/codecs-core': 2.0.0-experimental.8618508 '@solana/codecs-numbers': 2.0.0-experimental.8618508 - '@solana/options@2.0.0-preview.4(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + '@solana/options@2.0.0-preview.4(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2)': dependencies: - '@solana/codecs-core': 2.0.0-preview.4(typescript@5.9.3) - '@solana/codecs-data-structures': 2.0.0-preview.4(typescript@5.9.3) - '@solana/codecs-numbers': 2.0.0-preview.4(typescript@5.9.3) - '@solana/codecs-strings': 2.0.0-preview.4(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) - '@solana/errors': 2.0.0-preview.4(typescript@5.9.3) - typescript: 5.9.3 + '@solana/codecs-core': 2.0.0-preview.4(typescript@5.9.2) + '@solana/codecs-data-structures': 2.0.0-preview.4(typescript@5.9.2) + '@solana/codecs-numbers': 2.0.0-preview.4(typescript@5.9.2) + '@solana/codecs-strings': 2.0.0-preview.4(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2) + '@solana/errors': 2.0.0-preview.4(typescript@5.9.2) + typescript: 5.9.2 transitivePeerDependencies: - fastestsmallesttextencoderdecoder - '@solana/options@2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + '@solana/options@2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2)': dependencies: - '@solana/codecs-core': 2.0.0-rc.1(typescript@5.9.3) - '@solana/codecs-data-structures': 2.0.0-rc.1(typescript@5.9.3) - '@solana/codecs-numbers': 2.0.0-rc.1(typescript@5.9.3) - '@solana/codecs-strings': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) - '@solana/errors': 2.0.0-rc.1(typescript@5.9.3) - typescript: 5.9.3 + '@solana/codecs-core': 2.0.0-rc.1(typescript@5.9.2) + '@solana/codecs-data-structures': 2.0.0-rc.1(typescript@5.9.2) + '@solana/codecs-numbers': 2.0.0-rc.1(typescript@5.9.2) + '@solana/codecs-strings': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2) + '@solana/errors': 2.0.0-rc.1(typescript@5.9.2) + typescript: 5.9.2 transitivePeerDependencies: - fastestsmallesttextencoderdecoder - '@solana/spl-token-group@0.0.5(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + '@solana/spl-token-group@0.0.5(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2)': dependencies: - '@solana/codecs': 2.0.0-preview.4(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs': 2.0.0-preview.4(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2) '@solana/spl-type-length-value': 0.1.0 - '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10) + '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) transitivePeerDependencies: - fastestsmallesttextencoderdecoder - typescript - '@solana/spl-token-metadata@0.1.2(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)': + '@solana/spl-token-metadata@0.1.2(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)': dependencies: '@solana/codecs-core': 2.0.0-experimental.8618508 '@solana/codecs-data-structures': 2.0.0-experimental.8618508 @@ -7878,25 +8101,25 @@ snapshots: '@solana/codecs-strings': 2.0.0-experimental.8618508(fastestsmallesttextencoderdecoder@1.0.22) '@solana/options': 2.0.0-experimental.8618508 '@solana/spl-type-length-value': 0.1.0 - '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10) + '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) transitivePeerDependencies: - fastestsmallesttextencoderdecoder - '@solana/spl-token-metadata@0.1.5(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)': + '@solana/spl-token-metadata@0.1.5(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2)': dependencies: - '@solana/codecs': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) + '@solana/codecs': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2) '@solana/spl-type-length-value': 0.1.0 - '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10) + '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) transitivePeerDependencies: - fastestsmallesttextencoderdecoder - typescript - '@solana/spl-token@0.3.11(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@5.0.10)': + '@solana/spl-token@0.3.11(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2)(utf-8-validate@5.0.10)': dependencies: '@solana/buffer-layout': 4.0.1 - '@solana/buffer-layout-utils': 0.2.0(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10) - '@solana/spl-token-metadata': 0.1.2(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22) - '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10) + '@solana/buffer-layout-utils': 0.2.0(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) + '@solana/spl-token-metadata': 0.1.2(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22) + '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) buffer: 6.0.3 transitivePeerDependencies: - bufferutil @@ -7905,13 +8128,13 @@ snapshots: - typescript - utf-8-validate - '@solana/spl-token@0.4.8(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3)(utf-8-validate@5.0.10)': + '@solana/spl-token@0.4.8(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2)(utf-8-validate@5.0.10)': dependencies: '@solana/buffer-layout': 4.0.1 - '@solana/buffer-layout-utils': 0.2.0(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10) - '@solana/spl-token-group': 0.0.5(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) - '@solana/spl-token-metadata': 0.1.5(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.3) - '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10) + '@solana/buffer-layout-utils': 0.2.0(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) + '@solana/spl-token-group': 0.0.5(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2) + '@solana/spl-token-metadata': 0.1.5(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.9.2) + '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) buffer: 6.0.3 transitivePeerDependencies: - bufferutil @@ -7924,13 +8147,36 @@ snapshots: dependencies: buffer: 6.0.3 - '@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.3)(utf-8-validate@5.0.10)': + '@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@4.9.5)(utf-8-validate@5.0.10)': + dependencies: + '@babel/runtime': 7.25.6 + '@noble/curves': 1.4.2 + '@noble/hashes': 1.5.0 + '@solana/buffer-layout': 4.0.1 + '@solana/codecs-numbers': 2.3.0(typescript@4.9.5) + agentkeepalive: 4.5.0 + bn.js: 5.2.1 + borsh: 0.7.0 + bs58: 4.0.1 + buffer: 6.0.3 + fast-stable-stringify: 1.0.0 + jayson: 4.1.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) + node-fetch: 2.7.0 + rpc-websockets: 9.0.2 + superstruct: 2.0.2 + transitivePeerDependencies: + - bufferutil + - encoding + - typescript + - utf-8-validate + + '@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10)': dependencies: '@babel/runtime': 7.25.6 '@noble/curves': 1.4.2 '@noble/hashes': 1.5.0 '@solana/buffer-layout': 4.0.1 - '@solana/codecs-numbers': 2.3.0(typescript@5.9.3) + '@solana/codecs-numbers': 2.3.0(typescript@5.9.2) agentkeepalive: 4.5.0 bn.js: 5.2.1 borsh: 0.7.0 @@ -7973,6 +8219,8 @@ snapshots: dependencies: '@types/node': 22.16.5 + '@types/chai@4.3.20': {} + '@types/chai@5.2.2': dependencies: '@types/deep-eql': 4.0.2 @@ -8010,6 +8258,8 @@ snapshots: '@types/mocha@10.0.10': {} + '@types/mocha@9.1.1': {} + '@types/mute-stream@0.0.4': dependencies: '@types/node': 22.16.5 @@ -8054,41 +8304,41 @@ snapshots: dependencies: '@types/node': 22.16.5 - '@typescript-eslint/eslint-plugin@8.44.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.3))(eslint@9.36.0)(typescript@5.9.3)': + '@typescript-eslint/eslint-plugin@8.44.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.2))(eslint@9.36.0)(typescript@5.9.2)': dependencies: '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.44.0(eslint@9.36.0)(typescript@5.9.3) + '@typescript-eslint/parser': 8.44.0(eslint@9.36.0)(typescript@5.9.2) '@typescript-eslint/scope-manager': 8.44.0 - '@typescript-eslint/type-utils': 8.44.0(eslint@9.36.0)(typescript@5.9.3) - '@typescript-eslint/utils': 8.44.0(eslint@9.36.0)(typescript@5.9.3) + '@typescript-eslint/type-utils': 8.44.0(eslint@9.36.0)(typescript@5.9.2) + '@typescript-eslint/utils': 8.44.0(eslint@9.36.0)(typescript@5.9.2) '@typescript-eslint/visitor-keys': 8.44.0 eslint: 9.36.0 graphemer: 1.4.0 ignore: 7.0.5 natural-compare: 1.4.0 - ts-api-utils: 2.1.0(typescript@5.9.3) - typescript: 5.9.3 + ts-api-utils: 2.1.0(typescript@5.9.2) + typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.3)': + '@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.2)': dependencies: '@typescript-eslint/scope-manager': 8.44.0 '@typescript-eslint/types': 8.44.0 - '@typescript-eslint/typescript-estree': 8.44.0(typescript@5.9.3) + '@typescript-eslint/typescript-estree': 8.44.0(typescript@5.9.2) '@typescript-eslint/visitor-keys': 8.44.0 debug: 4.4.3(supports-color@8.1.1) eslint: 9.36.0 - typescript: 5.9.3 + typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.44.0(typescript@5.9.3)': + '@typescript-eslint/project-service@8.44.0(typescript@5.9.2)': dependencies: - '@typescript-eslint/tsconfig-utils': 8.44.0(typescript@5.9.3) + '@typescript-eslint/tsconfig-utils': 8.44.0(typescript@5.9.2) '@typescript-eslint/types': 8.44.0 debug: 4.4.3(supports-color@8.1.1) - typescript: 5.9.3 + typescript: 5.9.2 transitivePeerDependencies: - supports-color @@ -8102,19 +8352,19 @@ snapshots: '@typescript-eslint/types': 8.44.0 '@typescript-eslint/visitor-keys': 8.44.0 - '@typescript-eslint/tsconfig-utils@8.44.0(typescript@5.9.3)': + '@typescript-eslint/tsconfig-utils@8.44.0(typescript@5.9.2)': dependencies: - typescript: 5.9.3 + typescript: 5.9.2 - '@typescript-eslint/type-utils@8.44.0(eslint@9.36.0)(typescript@5.9.3)': + '@typescript-eslint/type-utils@8.44.0(eslint@9.36.0)(typescript@5.9.2)': dependencies: '@typescript-eslint/types': 8.44.0 - '@typescript-eslint/typescript-estree': 8.44.0(typescript@5.9.3) - '@typescript-eslint/utils': 8.44.0(eslint@9.36.0)(typescript@5.9.3) + '@typescript-eslint/typescript-estree': 8.44.0(typescript@5.9.2) + '@typescript-eslint/utils': 8.44.0(eslint@9.36.0)(typescript@5.9.2) debug: 4.4.3(supports-color@8.1.1) eslint: 9.36.0 - ts-api-utils: 2.1.0(typescript@5.9.3) - typescript: 5.9.3 + ts-api-utils: 2.1.0(typescript@5.9.2) + typescript: 5.9.2 transitivePeerDependencies: - supports-color @@ -8122,7 +8372,7 @@ snapshots: '@typescript-eslint/types@8.44.0': {} - '@typescript-eslint/typescript-estree@7.13.1(typescript@5.9.3)': + '@typescript-eslint/typescript-estree@7.13.1(typescript@5.9.2)': dependencies: '@typescript-eslint/types': 7.13.1 '@typescript-eslint/visitor-keys': 7.13.1 @@ -8131,16 +8381,16 @@ snapshots: is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.6.3 - ts-api-utils: 1.3.0(typescript@5.9.3) + ts-api-utils: 1.3.0(typescript@5.9.2) optionalDependencies: - typescript: 5.9.3 + typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/typescript-estree@8.44.0(typescript@5.9.3)': + '@typescript-eslint/typescript-estree@8.44.0(typescript@5.9.2)': dependencies: - '@typescript-eslint/project-service': 8.44.0(typescript@5.9.3) - '@typescript-eslint/tsconfig-utils': 8.44.0(typescript@5.9.3) + '@typescript-eslint/project-service': 8.44.0(typescript@5.9.2) + '@typescript-eslint/tsconfig-utils': 8.44.0(typescript@5.9.2) '@typescript-eslint/types': 8.44.0 '@typescript-eslint/visitor-keys': 8.44.0 debug: 4.4.3(supports-color@8.1.1) @@ -8148,30 +8398,30 @@ snapshots: is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.7.2 - ts-api-utils: 2.1.0(typescript@5.9.3) - typescript: 5.9.3 + ts-api-utils: 2.1.0(typescript@5.9.2) + typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@7.13.1(eslint@9.36.0)(typescript@5.9.3)': + '@typescript-eslint/utils@7.13.1(eslint@9.36.0)(typescript@5.9.2)': dependencies: '@eslint-community/eslint-utils': 4.7.0(eslint@9.36.0) '@typescript-eslint/scope-manager': 7.13.1 '@typescript-eslint/types': 7.13.1 - '@typescript-eslint/typescript-estree': 7.13.1(typescript@5.9.3) + '@typescript-eslint/typescript-estree': 7.13.1(typescript@5.9.2) eslint: 9.36.0 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/utils@8.44.0(eslint@9.36.0)(typescript@5.9.3)': + '@typescript-eslint/utils@8.44.0(eslint@9.36.0)(typescript@5.9.2)': dependencies: '@eslint-community/eslint-utils': 4.9.0(eslint@9.36.0) '@typescript-eslint/scope-manager': 8.44.0 '@typescript-eslint/types': 8.44.0 - '@typescript-eslint/typescript-estree': 8.44.0(typescript@5.9.3) + '@typescript-eslint/typescript-estree': 8.44.0(typescript@5.9.2) eslint: 9.36.0 - typescript: 5.9.3 + typescript: 5.9.2 transitivePeerDependencies: - supports-color @@ -8185,6 +8435,8 @@ snapshots: '@typescript-eslint/types': 8.44.0 eslint-visitor-keys: 4.2.1 + '@ungap/promise-all-settled@1.1.2': {} + '@vitest/expect@2.1.1': dependencies: '@vitest/spy': 2.1.1 @@ -8264,6 +8516,8 @@ snapshots: json-schema-traverse: 0.4.1 uri-js: 4.4.1 + ansi-colors@4.1.1: {} + ansi-colors@4.1.3: {} ansi-escapes@4.3.2: @@ -8293,6 +8547,11 @@ snapshots: ansis@3.17.0: {} + anymatch@3.1.3: + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + arg@4.1.3: {} argparse@1.0.10: @@ -8389,6 +8648,8 @@ snapshots: inherits: 2.0.4 minimalistic-assert: 1.0.1 + assertion-error@1.1.0: {} + assertion-error@2.0.1: {} async-function@1.0.0: {} @@ -8441,7 +8702,7 @@ snapshots: base64-js@1.5.1: {} - baseline-browser-mapping@2.8.12: {} + baseline-browser-mapping@2.8.9: {} basic-auth@2.0.1: dependencies: @@ -8461,6 +8722,8 @@ snapshots: bignumber.js@9.1.2: {} + binary-extensions@2.3.0: {} + bindings@1.5.0: dependencies: file-uri-to-path: 1.0.0 @@ -8551,13 +8814,13 @@ snapshots: readable-stream: 2.3.8 safe-buffer: 5.2.1 - browserslist@4.26.3: + browserslist@4.26.2: dependencies: - baseline-browser-mapping: 2.8.12 - caniuse-lite: 1.0.30001748 - electron-to-chromium: 1.5.230 - node-releases: 2.0.23 - update-browserslist-db: 1.1.3(browserslist@4.26.3) + baseline-browser-mapping: 2.8.9 + caniuse-lite: 1.0.30001745 + electron-to-chromium: 1.5.227 + node-releases: 2.0.21 + update-browserslist-db: 1.1.3(browserslist@4.26.2) bs58@4.0.1: dependencies: @@ -8652,7 +8915,7 @@ snapshots: camelcase@8.0.0: {} - caniuse-lite@1.0.30001748: {} + caniuse-lite@1.0.30001745: {} capital-case@1.0.4: dependencies: @@ -8662,6 +8925,16 @@ snapshots: case-anything@2.1.13: {} + chai@4.5.0: + dependencies: + assertion-error: 1.1.0 + check-error: 1.0.3 + deep-eql: 4.1.4 + get-func-name: 2.0.2 + loupe: 2.3.7 + pathval: 1.1.1 + type-detect: 4.1.0 + chai@5.2.1: dependencies: assertion-error: 2.0.1 @@ -8709,10 +8982,26 @@ snapshots: chardet@2.1.0: {} + check-error@1.0.3: + dependencies: + get-func-name: 2.0.2 + check-error@2.1.1: {} check-types@11.2.3: {} + chokidar@3.5.3: + dependencies: + anymatch: 3.1.3 + braces: 3.0.3 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 + chokidar@4.0.3: dependencies: readdirp: 4.1.2 @@ -8761,6 +9050,12 @@ snapshots: cli-width@4.1.0: {} + cliui@7.0.4: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + cliui@8.0.1: dependencies: string-width: 4.2.3 @@ -8828,14 +9123,14 @@ snapshots: corser@2.0.1: {} - cosmiconfig@9.0.0(typescript@5.9.3): + cosmiconfig@9.0.0(typescript@5.9.2): dependencies: env-paths: 2.2.1 import-fresh: 3.3.1 js-yaml: 4.1.0 parse-json: 5.2.0 optionalDependencies: - typescript: 5.9.3 + typescript: 5.9.2 create-ecdh@4.0.4: dependencies: @@ -8933,6 +9228,12 @@ snapshots: dependencies: ms: 2.1.3 + debug@4.3.3(supports-color@8.1.1): + dependencies: + ms: 2.1.2 + optionalDependencies: + supports-color: 8.1.1 + debug@4.3.4: dependencies: ms: 2.1.2 @@ -8953,6 +9254,10 @@ snapshots: dependencies: mimic-response: 3.1.0 + deep-eql@4.1.4: + dependencies: + type-detect: 4.1.0 + deep-eql@5.0.2: {} deep-is@0.1.4: {} @@ -9004,6 +9309,8 @@ snapshots: diff@4.0.2: {} + diff@5.0.0: {} + diff@7.0.0: {} diffie-hellman@5.0.3: @@ -9048,7 +9355,7 @@ snapshots: dependencies: jake: 10.9.2 - electron-to-chromium@1.5.230: {} + electron-to-chromium@1.5.227: {} elliptic@6.5.4: dependencies: @@ -9396,11 +9703,11 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.11.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.3))(eslint-import-resolver-node@0.3.9)(eslint@9.36.0): + eslint-module-utils@2.11.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint@9.36.0): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 8.44.0(eslint@9.36.0)(typescript@5.9.3) + '@typescript-eslint/parser': 8.44.0(eslint@9.36.0)(typescript@5.9.2) eslint: 9.36.0 eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: @@ -9413,7 +9720,7 @@ snapshots: eslint: 9.36.0 eslint-compat-utils: 0.5.1(eslint@9.36.0) - eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.3))(eslint@9.36.0): + eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.2))(eslint@9.36.0): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 @@ -9424,7 +9731,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.36.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.11.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.3))(eslint-import-resolver-node@0.3.9)(eslint@9.36.0) + eslint-module-utils: 2.11.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint@9.36.0) hasown: 2.0.2 is-core-module: 2.15.1 is-glob: 4.0.3 @@ -9435,7 +9742,7 @@ snapshots: semver: 6.3.1 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 8.44.0(eslint@9.36.0)(typescript@5.9.3) + '@typescript-eslint/parser': 8.44.0(eslint@9.36.0)(typescript@5.9.2) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -9457,12 +9764,12 @@ snapshots: dependencies: eslint: 9.36.0 - eslint-plugin-vitest@0.5.4(@typescript-eslint/eslint-plugin@8.44.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.3))(eslint@9.36.0)(typescript@5.9.3))(eslint@9.36.0)(typescript@5.9.3)(vitest@2.1.1(@types/node@22.16.5)(terser@5.43.1)): + eslint-plugin-vitest@0.5.4(@typescript-eslint/eslint-plugin@8.44.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.2))(eslint@9.36.0)(typescript@5.9.2))(eslint@9.36.0)(typescript@5.9.2)(vitest@2.1.1(@types/node@22.16.5)(terser@5.43.1)): dependencies: - '@typescript-eslint/utils': 7.13.1(eslint@9.36.0)(typescript@5.9.3) + '@typescript-eslint/utils': 7.13.1(eslint@9.36.0)(typescript@5.9.2) eslint: 9.36.0 optionalDependencies: - '@typescript-eslint/eslint-plugin': 8.44.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.3))(eslint@9.36.0)(typescript@5.9.3) + '@typescript-eslint/eslint-plugin': 8.44.0(@typescript-eslint/parser@8.44.0(eslint@9.36.0)(typescript@5.9.2))(eslint@9.36.0)(typescript@5.9.2) vitest: 2.1.1(@types/node@22.16.5)(terser@5.43.1) transitivePeerDependencies: - supports-color @@ -9762,6 +10069,8 @@ snapshots: get-east-asian-width@1.4.0: {} + get-func-name@2.0.2: {} + get-intrinsic@1.2.1: dependencies: function-bind: 1.1.2 @@ -9856,6 +10165,15 @@ snapshots: package-json-from-dist: 1.0.0 path-scurry: 2.0.0 + glob@7.2.0: + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + glob@7.2.3: dependencies: fs.realpath: 1.0.0 @@ -9933,6 +10251,8 @@ snapshots: graphemer@1.4.0: {} + growl@1.10.5: {} + has-bigints@1.0.2: {} has-bigints@1.1.0: {} @@ -10196,6 +10516,10 @@ snapshots: dependencies: has-bigints: 1.1.0 + is-binary-path@2.1.0: + dependencies: + binary-extensions: 2.3.0 + is-boolean-object@1.1.2: dependencies: call-bind: 1.0.8 @@ -10552,6 +10876,10 @@ snapshots: dependencies: js-tokens: 4.0.0 + loupe@2.3.7: + dependencies: + get-func-name: 2.0.2 + loupe@3.2.0: {} lower-case@2.0.2: @@ -10633,6 +10961,10 @@ snapshots: dependencies: brace-expansion: 1.1.11 + minimatch@4.2.1: + dependencies: + brace-expansion: 1.1.11 + minimatch@5.1.6: dependencies: brace-expansion: 2.0.2 @@ -10684,6 +11016,33 @@ snapshots: yargs-parser: 21.1.1 yargs-unparser: 2.0.0 + mocha@9.2.2: + dependencies: + '@ungap/promise-all-settled': 1.1.2 + ansi-colors: 4.1.1 + browser-stdout: 1.3.1 + chokidar: 3.5.3 + debug: 4.3.3(supports-color@8.1.1) + diff: 5.0.0 + escape-string-regexp: 4.0.0 + find-up: 5.0.0 + glob: 7.2.0 + growl: 1.10.5 + he: 1.2.0 + js-yaml: 4.1.0 + log-symbols: 4.1.0 + minimatch: 4.2.1 + ms: 2.1.3 + nanoid: 3.3.1 + serialize-javascript: 6.0.0 + strip-json-comments: 3.1.1 + supports-color: 8.1.1 + which: 2.0.2 + workerpool: 6.2.0 + yargs: 16.2.0 + yargs-parser: 20.2.4 + yargs-unparser: 2.0.0 + ms@2.1.2: {} ms@2.1.3: {} @@ -10694,6 +11053,8 @@ snapshots: nanoassert@2.0.0: {} + nanoid@3.3.1: {} + nanoid@3.3.8: {} natural-compare@1.4.0: {} @@ -10722,7 +11083,7 @@ snapshots: node-machine-id@1.1.12: {} - node-releases@2.0.23: {} + node-releases@2.0.21: {} normalize-package-data@6.0.2: dependencies: @@ -10730,6 +11091,8 @@ snapshots: semver: 7.7.2 validate-npm-package-license: 3.0.4 + normalize-path@3.0.0: {} + normalize-url@8.0.1: {} npm-package-arg@11.0.3: @@ -11042,6 +11405,8 @@ snapshots: pathe@1.1.2: {} + pathval@1.1.1: {} + pathval@2.0.1: {} pbkdf2@3.1.2: @@ -11096,6 +11461,8 @@ snapshots: prelude-ls@1.2.1: {} + prettier@2.8.8: {} + prettier@3.6.2: {} pretty-format@29.7.0: @@ -11191,6 +11558,10 @@ snapshots: string_decoder: 1.3.0 util-deprecate: 1.0.2 + readdirp@3.6.0: + dependencies: + picomatch: 2.3.1 + readdirp@4.1.2: {} rechoir@0.6.2: @@ -11307,11 +11678,11 @@ snapshots: globby: 10.0.1 is-plain-object: 3.0.1 - rollup-plugin-dts@6.1.1(rollup@4.21.3)(typescript@5.9.3): + rollup-plugin-dts@6.1.1(rollup@4.21.3)(typescript@5.9.2): dependencies: magic-string: 0.30.11 rollup: 4.21.3 - typescript: 5.9.3 + typescript: 5.9.2 optionalDependencies: '@babel/code-frame': 7.24.2 @@ -11431,6 +11802,10 @@ snapshots: tslib: 2.8.1 upper-case-first: 2.0.2 + serialize-javascript@6.0.0: + dependencies: + randombytes: 2.1.0 + serialize-javascript@6.0.2: dependencies: randombytes: 2.1.0 @@ -11718,12 +12093,12 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - syncpack@13.0.4(typescript@5.9.3): + syncpack@13.0.4(typescript@5.9.2): dependencies: chalk: 5.4.1 chalk-template: 1.1.0 commander: 13.1.0 - cosmiconfig: 9.0.0(typescript@5.9.3) + cosmiconfig: 9.0.0(typescript@5.9.2) effect: 3.15.0 enquirer: 2.4.1 fast-check: 3.23.2 @@ -11811,13 +12186,13 @@ snapshots: tryer@1.0.1: {} - ts-api-utils@1.3.0(typescript@5.9.3): + ts-api-utils@1.3.0(typescript@5.9.2): dependencies: - typescript: 5.9.3 + typescript: 5.9.2 - ts-api-utils@2.1.0(typescript@5.9.3): + ts-api-utils@2.1.0(typescript@5.9.2): dependencies: - typescript: 5.9.3 + typescript: 5.9.2 ts-mocha@10.1.0(mocha@11.7.2): dependencies: @@ -11826,7 +12201,14 @@ snapshots: optionalDependencies: tsconfig-paths: 3.15.0 - ts-node@10.9.2(@types/node@22.16.5)(typescript@5.9.3): + ts-mocha@10.1.0(mocha@9.2.2): + dependencies: + mocha: 9.2.2 + ts-node: 7.0.1 + optionalDependencies: + tsconfig-paths: 3.15.0 + + ts-node@10.9.2(@types/node@22.16.5)(typescript@5.9.2): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.9 @@ -11840,7 +12222,7 @@ snapshots: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.9.3 + typescript: 5.9.2 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 @@ -11895,6 +12277,8 @@ snapshots: dependencies: prelude-ls: 1.2.1 + type-detect@4.1.0: {} + type-fest@0.21.3: {} type-fest@4.35.0: {} @@ -11991,7 +12375,9 @@ snapshots: possible-typed-array-names: 1.1.0 reflect.getprototypeof: 1.0.10 - typescript@5.9.3: {} + typescript@4.9.5: {} + + typescript@5.9.2: {} unbox-primitive@1.0.2: dependencies: @@ -12019,9 +12405,9 @@ snapshots: universalify@0.1.2: {} - update-browserslist-db@1.1.3(browserslist@4.26.3): + update-browserslist-db@1.1.3(browserslist@4.26.2): dependencies: - browserslist: 4.26.3 + browserslist: 4.26.2 escalade: 3.2.0 picocolors: 1.1.1 @@ -12249,6 +12635,8 @@ snapshots: wordwrap@1.0.0: {} + workerpool@6.2.0: {} + workerpool@9.3.3: {} wrap-ansi@6.2.0: @@ -12295,6 +12683,8 @@ snapshots: yaml@2.7.1: {} + yargs-parser@20.2.4: {} + yargs-parser@21.1.1: {} yargs-unparser@2.0.0: @@ -12304,6 +12694,16 @@ snapshots: flat: 5.0.2 is-plain-obj: 2.1.0 + yargs@16.2.0: + dependencies: + cliui: 7.0.4 + escalade: 3.2.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 20.2.4 + yargs@17.7.2: dependencies: cliui: 8.0.1 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 974314d2d4..5d63266e35 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -5,6 +5,7 @@ packages: - "cli/**" - "account-compression/programs/**" - "sdk/**" + - "sdk-tests/**" - "js/stateless.js/**" - "js/compressed-token/**" - "examples/**" diff --git a/scripts/install.sh b/scripts/install.sh index 98350e48b7..33550ca51f 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -11,7 +11,7 @@ VERSIONS=( "node:22.16.0" "pnpm:10.12.1" "solana:2.2.15" - "anchor:anchor-v0.29.0" + "anchor:anchor-v0.31.1" "jq:jq-1.8.0" "photon:0.51.0" "redis:8.0.1" diff --git a/sdk-tests/sdk-anchor-test/Anchor.toml b/sdk-tests/sdk-anchor-test/Anchor.toml index a443e6fb8c..de2fecf56f 100644 --- a/sdk-tests/sdk-anchor-test/Anchor.toml +++ b/sdk-tests/sdk-anchor-test/Anchor.toml @@ -4,15 +4,14 @@ seeds = false skip-lint = false -[programs.localnet] -sdk_test = "2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt" [registry] url = "https://api.apr.dev" +[programs.localnet] +sdk_anchor_test = "2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt" + + [provider] cluster = "Localnet" wallet = "~/.config/solana/id.json" - -[scripts] -test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" diff --git a/sdk-tests/sdk-anchor-test/package.json b/sdk-tests/sdk-anchor-test/package.json index f69a01a509..4f214266cd 100644 --- a/sdk-tests/sdk-anchor-test/package.json +++ b/sdk-tests/sdk-anchor-test/package.json @@ -1,19 +1,23 @@ { "scripts": { - "test": "cargo test-sbf -p sdk-native-test" + "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w", + "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check", + "test": "cargo test-sbf -p sdk-native-test", + "test-ts": "light test-validator --sbf-program 2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt ../../target/deploy/sdk_anchor_test.so && ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" }, "dependencies": { - "@coral-xyz/anchor": "^0.29.0" + "@coral-xyz/anchor": "^0.31.1", + "@lightprotocol/stateless.js": "workspace:*" }, "devDependencies": { "@lightprotocol/zk-compression-cli": "workspace:*", - "chai": "^5.2.0", - "mocha": "^11.7.1", - "ts-mocha": "^11.1.0", - "@types/bn.js": "^5.2.0", - "@types/chai": "^5.2.2", - "@types/mocha": "^10.0.10", - "typescript": "^5.9.2", - "prettier": "^3.6.2" + "@types/bn.js": "^5.1.0", + "@types/chai": "^4.3.0", + "@types/mocha": "^9.0.0", + "chai": "^4.3.4", + "mocha": "^9.0.3", + "prettier": "^2.6.2", + "ts-mocha": "^10.1.0", + "typescript": "^4.3.5" } } diff --git a/sdk-tests/sdk-anchor-test/programs/sdk-anchor-test/Cargo.toml b/sdk-tests/sdk-anchor-test/programs/sdk-anchor-test/Cargo.toml index 574f53df9a..2a9192b9fd 100644 --- a/sdk-tests/sdk-anchor-test/programs/sdk-anchor-test/Cargo.toml +++ b/sdk-tests/sdk-anchor-test/programs/sdk-anchor-test/Cargo.toml @@ -15,7 +15,7 @@ no-entrypoint = [] no-idl = [] no-log-ix-name = [] cpi = ["no-entrypoint"] -default = ["idl-build"] +default = [] test-sbf = [] bench-sbf = [] idl-build = ["anchor-lang/idl-build", "light-sdk/idl-build"] diff --git a/sdk-tests/sdk-anchor-test/programs/sdk-anchor-test/src/lib.rs b/sdk-tests/sdk-anchor-test/programs/sdk-anchor-test/src/lib.rs index 7191e50466..12da4847da 100644 --- a/sdk-tests/sdk-anchor-test/programs/sdk-anchor-test/src/lib.rs +++ b/sdk-tests/sdk-anchor-test/programs/sdk-anchor-test/src/lib.rs @@ -177,6 +177,105 @@ pub mod sdk_anchor_test { ctx.accounts.my_regular_account.name = name; Ok(()) } + + // V2 Instructions + pub fn create_compressed_account_v2<'info>( + ctx: Context<'_, '_, '_, 'info, WithNestedData<'info>>, + proof: ValidityProof, + address_tree_info: PackedAddressTreeInfo, + output_tree_index: u8, + name: String, + ) -> Result<()> { + use light_sdk::address::v2::*; + msg!("hwew"); + let light_cpi_accounts = light_sdk_types::cpi_accounts::v2::CpiAccounts::new( + ctx.accounts.signer.as_ref(), + ctx.remaining_accounts, + crate::LIGHT_CPI_SIGNER, + ); + msg!("hwew1"); + msg!("address_tree_info {:?}", address_tree_info); + msg!("output_tree_index {:?}", output_tree_index); + + let (address, address_seed) = derive_address( + &[b"compressed", name.as_bytes()], + &address_tree_info + .get_tree_pubkey(&light_cpi_accounts) + .map_err(|_| ErrorCode::AccountNotEnoughKeys)?, + &crate::ID, + ); + let new_address_params = + address_tree_info.into_new_address_params_assigned_packed(address_seed, Some(0)); + + let mut my_compressed_account = LightAccount::<'_, MyCompressedAccount>::new_init( + &crate::ID, + Some(address), + output_tree_index, + ); + msg!("hwew2"); + + my_compressed_account.name = name; + my_compressed_account.nested = NestedData::default(); + + InstructionDataInvokeCpiWithReadOnly::new_cpi(LIGHT_CPI_SIGNER, proof) + .with_light_account(my_compressed_account)? + .with_new_addresses(&[new_address_params]) + .invoke(light_cpi_accounts)?; + + Ok(()) + } + + pub fn update_compressed_account_v2<'info>( + ctx: Context<'_, '_, '_, 'info, UpdateNestedData<'info>>, + proof: ValidityProof, + my_compressed_account: MyCompressedAccount, + account_meta: CompressedAccountMeta, + nested_data: NestedData, + ) -> Result<()> { + let mut my_compressed_account = LightAccount::<'_, MyCompressedAccount>::new_mut( + &crate::ID, + &account_meta, + my_compressed_account, + )?; + + my_compressed_account.nested = nested_data; + + let light_cpi_accounts = light_sdk::cpi::v2::CpiAccounts::new( + ctx.accounts.signer.as_ref(), + ctx.remaining_accounts, + crate::LIGHT_CPI_SIGNER, + ); + InstructionDataInvokeCpiWithReadOnly::new_cpi(LIGHT_CPI_SIGNER, proof) + .with_light_account(my_compressed_account)? + .invoke(light_cpi_accounts)?; + + Ok(()) + } + + pub fn close_compressed_account_v2<'info>( + ctx: Context<'_, '_, '_, 'info, UpdateNestedData<'info>>, + proof: ValidityProof, + my_compressed_account: MyCompressedAccount, + account_meta: CompressedAccountMeta, + ) -> Result<()> { + let my_compressed_account = LightAccount::<'_, MyCompressedAccount>::new_close( + &crate::ID, + &account_meta, + my_compressed_account, + )?; + + let light_cpi_accounts = light_sdk::cpi::v2::CpiAccounts::new( + ctx.accounts.signer.as_ref(), + ctx.remaining_accounts, + crate::LIGHT_CPI_SIGNER, + ); + + InstructionDataInvokeCpiWithReadOnly::new_cpi(LIGHT_CPI_SIGNER, proof) + .with_light_account(my_compressed_account)? + .invoke(light_cpi_accounts)?; + + Ok(()) + } } #[event] diff --git a/sdk-tests/sdk-anchor-test/tests/test_v1.ts b/sdk-tests/sdk-anchor-test/tests/test_v1.ts new file mode 100644 index 0000000000..d63067e521 --- /dev/null +++ b/sdk-tests/sdk-anchor-test/tests/test_v1.ts @@ -0,0 +1,335 @@ +import * as anchor from "@coral-xyz/anchor"; +import { Program, web3 } from "@coral-xyz/anchor"; +import idl from "../target/idl/sdk_anchor_test.json"; +import { + bn, + CompressedAccountWithMerkleContext, + createRpc, + defaultTestStateTreeAccounts, + deriveAddressSeed, + deriveAddress, + PackedAccounts, + Rpc, + sleep, + SystemAccountMetaConfig, +} from "@lightprotocol/stateless.js"; +const path = require("path"); +const os = require("os"); +require("dotenv").config(); + +const anchorWalletPath = path.join(os.homedir(), ".config/solana/id.json"); +process.env.ANCHOR_WALLET = anchorWalletPath; +process.env.ANCHOR_PROVIDER_URL = "http://localhost:8899"; + +describe("sdk-anchor-test-v1", () => { + const provider = anchor.AnchorProvider.env(); + anchor.setProvider(provider); + const programId = new web3.PublicKey( + "2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt", + ); + const program = anchor.workspace.sdkAnchorTest; + const coder = new anchor.BorshCoder(idl as anchor.Idl); + + it("create, update, and close compressed account (v1)", async () => { + let signer = new web3.Keypair(); + let rpc = createRpc( + "http://127.0.0.1:8899", + "http://127.0.0.1:8784", + "http://127.0.0.1:3001", + { + commitment: "confirmed", + }, + ); + + let lamports = web3.LAMPORTS_PER_SOL; + await rpc.requestAirdrop(signer.publicKey, lamports); + await sleep(2000); + + const outputQueue = defaultTestStateTreeAccounts().merkleTree; + const addressTree = defaultTestStateTreeAccounts().addressTree; + const addressQueue = defaultTestStateTreeAccounts().addressQueue; + + const name = "test-account"; + const accountSeed = new TextEncoder().encode("compressed"); + const nameSeed = new TextEncoder().encode(name); + const seed = deriveAddressSeed( + [accountSeed, nameSeed], + program.programId, + ); + const address = deriveAddress(seed, addressTree); + + console.log("Creating compressed account with name:", name); + await createCompressedAccount( + rpc, + addressTree, + addressQueue, + address, + program, + outputQueue, + signer, + name, + ); + await sleep(2000); + + let compressedAccount = await rpc.getCompressedAccount( + bn(address.toBytes()), + ); + console.log("Created account:", compressedAccount); + + // Update the account with new nested data + const newNestedData = { + one: 10, + two: 20, + three: 30, + four: 40, + five: 50, + six: 60, + seven: 70, + eight: 80, + nine: 90, + ten: 100, + eleven: 110, + twelve: 120, + }; + + console.log("Updating compressed account with new nested data"); + await updateCompressedAccount( + rpc, + compressedAccount, + program, + outputQueue, + signer, + coder, + newNestedData, + ); + await sleep(2000); + + compressedAccount = await rpc.getCompressedAccount(bn(address.toBytes())); + console.log("Updated account:", compressedAccount); + + // Close the account + console.log("Closing compressed account"); + await closeCompressedAccount( + rpc, + compressedAccount, + program, + outputQueue, + signer, + coder, + ); + await sleep(2000); + + const closedAccount = await rpc.getCompressedAccount(bn(address.toBytes())); + console.log("Closed account:", closedAccount); + }); +}); + +async function createCompressedAccount( + rpc: Rpc, + addressTree: web3.PublicKey, + addressQueue: web3.PublicKey, + address: web3.PublicKey, + program: Program, + outputMerkleTree: web3.PublicKey, + signer: web3.Keypair, + name: string, +) { + const proofRpcResult = await rpc.getValidityProofV0( + [], + [ + { + tree: addressTree, + queue: addressQueue, + address: bn(address.toBytes()), + }, + ], + ); + const systemAccountConfig = SystemAccountMetaConfig.new(program.programId); + let remainingAccounts = + PackedAccounts.newWithSystemAccounts(systemAccountConfig); + + const addressMerkleTreePubkeyIndex = + remainingAccounts.insertOrGet(addressTree); + const addressQueuePubkeyIndex = remainingAccounts.insertOrGet(addressQueue); + const packedAddressTreeInfo = { + addressMerkleTreePubkeyIndex, + addressQueuePubkeyIndex, + rootIndex: proofRpcResult.rootIndices[0], + }; + const outputMerkleTreeIndex = remainingAccounts.insertOrGet(outputMerkleTree); + + let proof = { + 0: proofRpcResult.compressedProof, + }; + const computeBudgetIx = web3.ComputeBudgetProgram.setComputeUnitLimit({ + units: 1000000, + }); + let tx = await program.methods + .createCompressedAccount( + proof, + packedAddressTreeInfo, + outputMerkleTreeIndex, + name, + ) + .accounts({ + signer: signer.publicKey, + }) + .preInstructions([computeBudgetIx]) + .remainingAccounts(remainingAccounts.toAccountMetas().remainingAccounts) + .signers([signer]) + .transaction(); + tx.recentBlockhash = (await rpc.getRecentBlockhash()).blockhash; + tx.sign(signer); + console.log("tx ", tx.instructions[1].keys); + const sig = await rpc.sendTransaction(tx, [signer]); + await rpc.confirmTransaction(sig); + console.log("Created compressed account", sig); +} + +async function updateCompressedAccount( + rpc: Rpc, + compressedAccount: CompressedAccountWithMerkleContext, + program: Program, + outputMerkleTree: web3.PublicKey, + signer: web3.Keypair, + coder: anchor.BorshCoder, + name: string, + nestedData: any, +) { + const proofRpcResult = await rpc.getValidityProofV0( + [ + { + hash: compressedAccount.hash, + tree: compressedAccount.treeInfo.tree, + queue: compressedAccount.treeInfo.queue, + }, + ], + [], + ); + const systemAccountConfig = SystemAccountMetaConfig.new(program.programId); + let remainingAccounts = + PackedAccounts.newWithSystemAccounts(systemAccountConfig); + + const merkleTreePubkeyIndex = remainingAccounts.insertOrGet( + compressedAccount.treeInfo.tree, + ); + const queuePubkeyIndex = remainingAccounts.insertOrGet( + compressedAccount.treeInfo.queue, + ); + const outputMerkleTreeIndex = remainingAccounts.insertOrGet(outputMerkleTree); + const compressedAccountMeta = { + treeInfo: { + rootIndex: proofRpcResult.rootIndices[0], + proveByIndex: proofRpcResult.proveByIndices[0], + merkleTreePubkeyIndex, + queuePubkeyIndex, + leafIndex: compressedAccount.leafIndex, + }, + address: compressedAccount.address, + outputStateTreeIndex: outputMerkleTreeIndex, + }; + + // Decode current account state + const myCompressedAccount = coder.types.decode( + "MyCompressedAccount", + compressedAccount.data.data, + ); + + let proof = { + 0: proofRpcResult.compressedProof, + }; + const computeBudgetIx = web3.ComputeBudgetProgram.setComputeUnitLimit({ + units: 1000000, + }); + let tx = await program.methods + .updateCompressedAccount( + proof, + myCompressedAccount, + compressedAccountMeta, + nestedData, + ) + .accounts({ + signer: signer.publicKey, + }) + .preInstructions([computeBudgetIx]) + .remainingAccounts(remainingAccounts.toAccountMetas().remainingAccounts) + .signers([signer]) + .transaction(); + tx.recentBlockhash = (await rpc.getRecentBlockhash()).blockhash; + tx.sign(signer); + + const sig = await rpc.sendTransaction(tx, [signer]); + await rpc.confirmTransaction(sig); + console.log("Updated compressed account", sig); +} + +async function closeCompressedAccount( + rpc: Rpc, + compressedAccount: CompressedAccountWithMerkleContext, + program: Program, + outputMerkleTree: web3.PublicKey, + signer: web3.Keypair, + coder: anchor.BorshCoder, +) { + const proofRpcResult = await rpc.getValidityProofV0( + [ + { + hash: compressedAccount.hash, + tree: compressedAccount.treeInfo.tree, + queue: compressedAccount.treeInfo.queue, + }, + ], + [], + ); + const systemAccountConfig = SystemAccountMetaConfig.new(program.programId); + let remainingAccounts = + PackedAccounts.newWithSystemAccounts(systemAccountConfig); + + const merkleTreePubkeyIndex = remainingAccounts.insertOrGet( + compressedAccount.treeInfo.tree, + ); + const queuePubkeyIndex = remainingAccounts.insertOrGet( + compressedAccount.treeInfo.queue, + ); + const outputMerkleTreeIndex = remainingAccounts.insertOrGet(outputMerkleTree); + + const compressedAccountMeta = { + treeInfo: { + rootIndex: proofRpcResult.rootIndices[0], + proveByIndex: proofRpcResult.proveByIndices[0], + merkleTreePubkeyIndex, + queuePubkeyIndex, + leafIndex: compressedAccount.leafIndex, + }, + address: compressedAccount.address, + outputStateTreeIndex: outputMerkleTreeIndex, + }; + + // Decode current account state + const myCompressedAccount = coder.types.decode( + "MyCompressedAccount", + compressedAccount.data.data, + ); + + let proof = { + 0: proofRpcResult.compressedProof, + }; + const computeBudgetIx = web3.ComputeBudgetProgram.setComputeUnitLimit({ + units: 1000000, + }); + let tx = await program.methods + .closeCompressedAccount(proof, myCompressedAccount, compressedAccountMeta) + .accounts({ + signer: signer.publicKey, + }) + .preInstructions([computeBudgetIx]) + .remainingAccounts(remainingAccounts.toAccountMetas().remainingAccounts) + .signers([signer]) + .transaction(); + tx.recentBlockhash = (await rpc.getRecentBlockhash()).blockhash; + tx.sign(signer); + + const sig = await rpc.sendTransaction(tx, [signer]); + await rpc.confirmTransaction(sig); + console.log("Closed compressed account", sig); +} diff --git a/sdk-tests/sdk-anchor-test/tests/test_v2.ts b/sdk-tests/sdk-anchor-test/tests/test_v2.ts new file mode 100644 index 0000000000..a7dd36ecae --- /dev/null +++ b/sdk-tests/sdk-anchor-test/tests/test_v2.ts @@ -0,0 +1,343 @@ +import * as anchor from "@coral-xyz/anchor"; +import { Program, web3 } from "@coral-xyz/anchor"; +import idl from "../target/idl/sdk_anchor_test.json"; +import { + bn, + CompressedAccountWithMerkleContext, + createRpc, + deriveAddressSeedV2, + deriveAddressV2, + PackedAccounts, + Rpc, + sleep, + SystemAccountMetaConfig, +} from "@lightprotocol/stateless.js"; +const path = require("path"); +const os = require("os"); +require("dotenv").config(); + +const anchorWalletPath = path.join(os.homedir(), ".config/solana/id.json"); +process.env.ANCHOR_WALLET = anchorWalletPath; +process.env.ANCHOR_PROVIDER_URL = "http://localhost:8899"; + +describe("sdk-anchor-test-v2", () => { + const provider = anchor.AnchorProvider.env(); + anchor.setProvider(provider); + const programId = new web3.PublicKey( + "2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt", + ); + const program = anchor.workspace.sdkAnchorTest; + const coder = new anchor.BorshCoder(idl as anchor.Idl); + + it("create, update, and close compressed account (v2)", async () => { + let signer = new web3.Keypair(); + let rpc = createRpc( + "http://127.0.0.1:8899", + "http://127.0.0.1:8784", + "http://127.0.0.1:3001", + { + commitment: "confirmed", + }, + ); + + // Get existing tree infos + const existingTreeInfos = await rpc.getStateTreeInfos(); + console.log("Available tree infos:"); + existingTreeInfos.forEach((info) => { + console.log(` Tree: ${info.tree.toBase58()}, Type: ${info.treeType}`); + }); + + let lamports = web3.LAMPORTS_PER_SOL; + await rpc.requestAirdrop(signer.publicKey, lamports); + await sleep(2000); + + // Use an actual existing state tree from the environment + const stateTreeInfo = existingTreeInfos.find( + (info) => info.treeType === 2 || info.treeType === 3, + ); // StateV1 or StateV2 + if (!stateTreeInfo) { + throw new Error("No state tree available"); + } + const outputQueue = stateTreeInfo.queue; + + const addressTreeInfo = await rpc.getAddressTreeInfoV2(); + const addressTree = addressTreeInfo.tree; + + const name = "test-account"; + const accountSeed = new TextEncoder().encode("compressed"); + const nameSeed = new TextEncoder().encode(name); + const seed = deriveAddressSeedV2([accountSeed, nameSeed]); + const address = deriveAddressV2(seed, addressTree, program.programId); + + console.log("Creating compressed account with name:", name); + await createCompressedAccount( + rpc, + addressTree, + address, + program, + outputQueue, + signer, + name, + ); + await sleep(2000); + + let compressedAccount = await rpc.getCompressedAccount( + bn(address.toBytes()), + ); + console.log("Created account:", compressedAccount); + + // Update the account with new nested data + const newNestedData = { + one: 10, + two: 20, + three: 30, + four: 40, + five: 50, + six: 60, + seven: 70, + eight: 80, + nine: 90, + ten: 100, + eleven: 110, + twelve: 120, + }; + + console.log("Updating compressed account with new nested data"); + await updateCompressedAccount( + rpc, + compressedAccount, + program, + outputQueue, + signer, + coder, + newNestedData, + ); + await sleep(2000); + + compressedAccount = await rpc.getCompressedAccount(bn(address.toBytes())); + console.log("Updated account:", compressedAccount); + + // Close the account + console.log("Closing compressed account"); + await closeCompressedAccount( + rpc, + compressedAccount, + program, + outputQueue, + signer, + coder, + ); + await sleep(2000); + + const closedAccount = await rpc.getCompressedAccount(bn(address.toBytes())); + console.log("Closed account:", closedAccount); + }); +}); + +async function createCompressedAccount( + rpc: Rpc, + addressTree: web3.PublicKey, + address: web3.PublicKey, + program: Program, + outputMerkleTree: web3.PublicKey, + signer: web3.Keypair, + name: string, +) { + const proofRpcResult = await rpc.getValidityProofV0( + [], + [ + { + tree: addressTree, + queue: addressTree, + address: bn(address.toBytes()), + }, + ], + ); + const systemAccountConfig = SystemAccountMetaConfig.new(program.programId); + let remainingAccounts = + PackedAccounts.newWithSystemAccountsV2(systemAccountConfig); + + const addressMerkleTreePubkeyIndex = + remainingAccounts.insertOrGet(addressTree); + const packedAddressTreeInfo = { + addressMerkleTreePubkeyIndex, + addressQueuePubkeyIndex: addressMerkleTreePubkeyIndex, + rootIndex: proofRpcResult.rootIndices[0], + }; + const outputMerkleTreeIndex = remainingAccounts.insertOrGet(outputMerkleTree); + + let proof = { + 0: proofRpcResult.compressedProof, + }; + const computeBudgetIx = web3.ComputeBudgetProgram.setComputeUnitLimit({ + units: 1000000, + }); + let tx = await program.methods + .createCompressedAccountV2( + proof, + packedAddressTreeInfo, + outputMerkleTreeIndex, + name, + ) + .accounts({ + signer: signer.publicKey, + }) + .preInstructions([computeBudgetIx]) + .remainingAccounts(remainingAccounts.toAccountMetas().remainingAccounts) + .signers([signer]) + .transaction(); + tx.recentBlockhash = (await rpc.getRecentBlockhash()).blockhash; + tx.sign(signer); + console.log("tx ", tx.instructions[1].keys); + const sig = await rpc.sendTransaction(tx, [signer]); + await rpc.confirmTransaction(sig); + console.log("Created compressed account", sig); +} + +async function updateCompressedAccount( + rpc: Rpc, + compressedAccount: CompressedAccountWithMerkleContext, + program: Program, + outputMerkleTree: web3.PublicKey, + signer: web3.Keypair, + coder: anchor.BorshCoder, + name: string, + nestedData: any, +) { + const proofRpcResult = await rpc.getValidityProofV0( + [ + { + hash: compressedAccount.hash, + tree: compressedAccount.treeInfo.tree, + queue: compressedAccount.treeInfo.queue, + }, + ], + [], + ); + const systemAccountConfig = SystemAccountMetaConfig.new(program.programId); + let remainingAccounts = + PackedAccounts.newWithSystemAccountsV2(systemAccountConfig); + + const merkleTreePubkeyIndex = remainingAccounts.insertOrGet( + compressedAccount.treeInfo.tree, + ); + const queuePubkeyIndex = remainingAccounts.insertOrGet( + compressedAccount.treeInfo.queue, + ); + const outputMerkleTreeIndex = remainingAccounts.insertOrGet(outputMerkleTree); + const compressedAccountMeta = { + treeInfo: { + rootIndex: proofRpcResult.rootIndices[0], + proveByIndex: proofRpcResult.proveByIndices[0], + merkleTreePubkeyIndex, + queuePubkeyIndex, + leafIndex: compressedAccount.leafIndex, + }, + address: compressedAccount.address, + outputStateTreeIndex: outputMerkleTreeIndex, + }; + + // Decode current account state + const myCompressedAccount = coder.types.decode( + "MyCompressedAccount", + compressedAccount.data.data, + ); + + let proof = { + 0: proofRpcResult.compressedProof, + }; + const computeBudgetIx = web3.ComputeBudgetProgram.setComputeUnitLimit({ + units: 1000000, + }); + let tx = await program.methods + .updateCompressedAccountV2( + proof, + myCompressedAccount, + compressedAccountMeta, + nestedData, + ) + .accounts({ + signer: signer.publicKey, + }) + .preInstructions([computeBudgetIx]) + .remainingAccounts(remainingAccounts.toAccountMetas().remainingAccounts) + .signers([signer]) + .transaction(); + tx.recentBlockhash = (await rpc.getRecentBlockhash()).blockhash; + tx.sign(signer); + + const sig = await rpc.sendTransaction(tx, [signer]); + await rpc.confirmTransaction(sig); + console.log("Updated compressed account", sig); +} + +async function closeCompressedAccount( + rpc: Rpc, + compressedAccount: CompressedAccountWithMerkleContext, + program: Program, + outputMerkleTree: web3.PublicKey, + signer: web3.Keypair, + coder: anchor.BorshCoder, +) { + const proofRpcResult = await rpc.getValidityProofV0( + [ + { + hash: compressedAccount.hash, + tree: compressedAccount.treeInfo.tree, + queue: compressedAccount.treeInfo.queue, + }, + ], + [], + ); + const systemAccountConfig = SystemAccountMetaConfig.new(program.programId); + let remainingAccounts = + PackedAccounts.newWithSystemAccountsV2(systemAccountConfig); + + const merkleTreePubkeyIndex = remainingAccounts.insertOrGet( + compressedAccount.treeInfo.tree, + ); + const queuePubkeyIndex = remainingAccounts.insertOrGet( + compressedAccount.treeInfo.queue, + ); + const outputMerkleTreeIndex = remainingAccounts.insertOrGet(outputMerkleTree); + + const compressedAccountMeta = { + treeInfo: { + rootIndex: proofRpcResult.rootIndices[0], + proveByIndex: proofRpcResult.proveByIndices[0], + merkleTreePubkeyIndex, + queuePubkeyIndex, + leafIndex: compressedAccount.leafIndex, + }, + address: compressedAccount.address, + outputStateTreeIndex: outputMerkleTreeIndex, + }; + + // Decode current account state + const myCompressedAccount = coder.types.decode( + "MyCompressedAccount", + compressedAccount.data.data, + ); + + let proof = { + 0: proofRpcResult.compressedProof, + }; + const computeBudgetIx = web3.ComputeBudgetProgram.setComputeUnitLimit({ + units: 1000000, + }); + let tx = await program.methods + .closeCompressedAccountV2(proof, myCompressedAccount, compressedAccountMeta) + .accounts({ + signer: signer.publicKey, + }) + .preInstructions([computeBudgetIx]) + .remainingAccounts(remainingAccounts.toAccountMetas().remainingAccounts) + .signers([signer]) + .transaction(); + tx.recentBlockhash = (await rpc.getRecentBlockhash()).blockhash; + tx.sign(signer); + + const sig = await rpc.sendTransaction(tx, [signer]); + await rpc.confirmTransaction(sig); + console.log("Closed compressed account", sig); +} diff --git a/sdk-tests/sdk-anchor-test/tsconfig.json b/sdk-tests/sdk-anchor-test/tsconfig.json index cd5d2e3d06..247d160aac 100644 --- a/sdk-tests/sdk-anchor-test/tsconfig.json +++ b/sdk-tests/sdk-anchor-test/tsconfig.json @@ -5,6 +5,7 @@ "lib": ["es2015"], "module": "commonjs", "target": "es6", - "esModuleInterop": true + "esModuleInterop": true, + "resolveJsonModule": true } } From 217564e669f57a8668e8cf25b9c90a887d063b56 Mon Sep 17 00:00:00 2001 From: ananas Date: Wed, 8 Oct 2025 03:37:02 +0100 Subject: [PATCH 3/7] get address tree pubkey --- pnpm-lock.yaml | 45 +++++++++++-------- sdk-libs/sdk-types/src/cpi_accounts/mod.rs | 8 ++++ sdk-libs/sdk-types/src/cpi_accounts/v1.rs | 8 +++- sdk-libs/sdk-types/src/cpi_accounts/v2.rs | 8 +++- .../sdk-types/src/instruction/tree_info.rs | 6 +-- sdk-tests/sdk-anchor-test/package.json | 4 +- sdk-tests/sdk-anchor-test/tests/test_v1.ts | 45 +++++++++---------- sdk-tests/sdk-anchor-test/tests/test_v2.ts | 42 ++++++++--------- 8 files changed, 94 insertions(+), 72 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8900116f9f..5f23514200 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,10 +25,10 @@ importers: version: 0.7.5 syncpack: specifier: ^13.0.4 - version: 13.0.4(typescript@5.9.2) + version: 13.0.4(typescript@5.9.3) typescript: - specifier: ^5.9.2 - version: 5.9.2 + specifier: ^5.9.3 + version: 5.9.3 cli: dependencies: @@ -455,7 +455,7 @@ importers: dependencies: '@coral-xyz/anchor': specifier: ^0.31.1 - version: 0.31.1(bufferutil@4.0.8)(typescript@4.9.5)(utf-8-validate@5.0.10) + version: 0.31.1(typescript@4.9.5) '@lightprotocol/stateless.js': specifier: workspace:* version: link:../../js/stateless.js @@ -5717,6 +5717,11 @@ packages: engines: {node: '>=14.17'} hasBin: true + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + engines: {node: '>=14.17'} + hasBin: true + unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} @@ -6737,12 +6742,12 @@ snapshots: - typescript - utf-8-validate - '@coral-xyz/anchor@0.31.1(bufferutil@4.0.8)(typescript@4.9.5)(utf-8-validate@5.0.10)': + '@coral-xyz/anchor@0.31.1(typescript@4.9.5)': dependencies: '@coral-xyz/anchor-errors': 0.31.1 - '@coral-xyz/borsh': 0.31.1(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@4.9.5)(utf-8-validate@5.0.10)) + '@coral-xyz/borsh': 0.31.1(@solana/web3.js@1.98.4(typescript@4.9.5)) '@noble/hashes': 1.5.0 - '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@4.9.5)(utf-8-validate@5.0.10) + '@solana/web3.js': 1.98.4(typescript@4.9.5) bn.js: 5.2.1 bs58: 4.0.1 buffer-layout: 1.2.2 @@ -6764,9 +6769,9 @@ snapshots: bn.js: 5.2.1 buffer-layout: 1.2.2 - '@coral-xyz/borsh@0.31.1(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@4.9.5)(utf-8-validate@5.0.10))': + '@coral-xyz/borsh@0.31.1(@solana/web3.js@1.98.4(typescript@4.9.5))': dependencies: - '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@4.9.5)(utf-8-validate@5.0.10) + '@solana/web3.js': 1.98.4(typescript@4.9.5) bn.js: 5.2.1 buffer-layout: 1.2.2 @@ -8147,13 +8152,13 @@ snapshots: dependencies: buffer: 6.0.3 - '@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@4.9.5)(utf-8-validate@5.0.10)': + '@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10)': dependencies: '@babel/runtime': 7.25.6 '@noble/curves': 1.4.2 '@noble/hashes': 1.5.0 '@solana/buffer-layout': 4.0.1 - '@solana/codecs-numbers': 2.3.0(typescript@4.9.5) + '@solana/codecs-numbers': 2.3.0(typescript@5.9.2) agentkeepalive: 4.5.0 bn.js: 5.2.1 borsh: 0.7.0 @@ -8170,13 +8175,13 @@ snapshots: - typescript - utf-8-validate - '@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10)': + '@solana/web3.js@1.98.4(typescript@4.9.5)': dependencies: '@babel/runtime': 7.25.6 '@noble/curves': 1.4.2 '@noble/hashes': 1.5.0 '@solana/buffer-layout': 4.0.1 - '@solana/codecs-numbers': 2.3.0(typescript@5.9.2) + '@solana/codecs-numbers': 2.3.0(typescript@4.9.5) agentkeepalive: 4.5.0 bn.js: 5.2.1 borsh: 0.7.0 @@ -9123,14 +9128,14 @@ snapshots: corser@2.0.1: {} - cosmiconfig@9.0.0(typescript@5.9.2): + cosmiconfig@9.0.0(typescript@5.9.3): dependencies: env-paths: 2.2.1 import-fresh: 3.3.1 js-yaml: 4.1.0 parse-json: 5.2.0 optionalDependencies: - typescript: 5.9.2 + typescript: 5.9.3 create-ecdh@4.0.4: dependencies: @@ -10723,7 +10728,7 @@ snapshots: isexe@3.1.1: {} - isomorphic-ws@4.0.1(ws@7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10)): + isomorphic-ws@4.0.1(ws@7.5.10): dependencies: ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) @@ -10756,7 +10761,7 @@ snapshots: delay: 5.0.0 es6-promisify: 5.0.0 eyes: 0.1.8 - isomorphic-ws: 4.0.1(ws@7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10)) + isomorphic-ws: 4.0.1(ws@7.5.10) json-stringify-safe: 5.0.1 uuid: 8.3.2 ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) @@ -12093,12 +12098,12 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - syncpack@13.0.4(typescript@5.9.2): + syncpack@13.0.4(typescript@5.9.3): dependencies: chalk: 5.4.1 chalk-template: 1.1.0 commander: 13.1.0 - cosmiconfig: 9.0.0(typescript@5.9.2) + cosmiconfig: 9.0.0(typescript@5.9.3) effect: 3.15.0 enquirer: 2.4.1 fast-check: 3.23.2 @@ -12379,6 +12384,8 @@ snapshots: typescript@5.9.2: {} + typescript@5.9.3: {} + unbox-primitive@1.0.2: dependencies: call-bind: 1.0.8 diff --git a/sdk-libs/sdk-types/src/cpi_accounts/mod.rs b/sdk-libs/sdk-types/src/cpi_accounts/mod.rs index 52dca7c578..47637d3ff7 100644 --- a/sdk-libs/sdk-types/src/cpi_accounts/mod.rs +++ b/sdk-libs/sdk-types/src/cpi_accounts/mod.rs @@ -4,3 +4,11 @@ pub mod v1; pub mod v2; pub use config::CpiAccountsConfig; +use light_account_checks::AccountInfoTrait; + +use crate::error::Result; + +/// Trait for CPI accounts that provide access to tree accounts +pub trait TreeAccounts { + fn get_tree_account_info(&self, tree_index: usize) -> Result<&T>; +} diff --git a/sdk-libs/sdk-types/src/cpi_accounts/v1.rs b/sdk-libs/sdk-types/src/cpi_accounts/v1.rs index 20f6f8bb92..bb6bfe7f12 100644 --- a/sdk-libs/sdk-types/src/cpi_accounts/v1.rs +++ b/sdk-libs/sdk-types/src/cpi_accounts/v1.rs @@ -1,7 +1,7 @@ use light_account_checks::AccountInfoTrait; use crate::{ - cpi_accounts::CpiAccountsConfig, + cpi_accounts::{CpiAccountsConfig, TreeAccounts}, error::{LightSdkTypesError, Result}, CpiSigner, CPI_CONTEXT_ACCOUNT_2_DISCRIMINATOR, LIGHT_SYSTEM_PROGRAM_ID, SOL_POOL_PDA, }; @@ -257,3 +257,9 @@ impl<'a, T: AccountInfoTrait + Clone> CpiAccounts<'a, T> { account_infos } } + +impl<'a, T: AccountInfoTrait + Clone> TreeAccounts for CpiAccounts<'a, T> { + fn get_tree_account_info(&self, tree_index: usize) -> Result<&T> { + self.get_tree_account_info(tree_index) + } +} diff --git a/sdk-libs/sdk-types/src/cpi_accounts/v2.rs b/sdk-libs/sdk-types/src/cpi_accounts/v2.rs index 473e8362da..6f423b43dd 100644 --- a/sdk-libs/sdk-types/src/cpi_accounts/v2.rs +++ b/sdk-libs/sdk-types/src/cpi_accounts/v2.rs @@ -3,7 +3,7 @@ use light_account_checks::AccountInfoTrait; #[cfg(feature = "cpi-context")] use crate::cpi_context_write::CpiContextWriteAccounts; use crate::{ - cpi_accounts::CpiAccountsConfig, + cpi_accounts::{CpiAccountsConfig, TreeAccounts}, error::{LightSdkTypesError, Result}, CpiSigner, }; @@ -224,3 +224,9 @@ impl<'a, T: AccountInfoTrait + Clone> CpiAccounts<'a, T> { .collect::>()) } } + +impl<'a, T: AccountInfoTrait + Clone> TreeAccounts for CpiAccounts<'a, T> { + fn get_tree_account_info(&self, tree_index: usize) -> Result<&T> { + self.get_tree_account_info(tree_index) + } +} diff --git a/sdk-libs/sdk-types/src/instruction/tree_info.rs b/sdk-libs/sdk-types/src/instruction/tree_info.rs index 93546dda23..b4f79c1f7c 100644 --- a/sdk-libs/sdk-types/src/instruction/tree_info.rs +++ b/sdk-libs/sdk-types/src/instruction/tree_info.rs @@ -4,9 +4,7 @@ use light_compressed_account::{ instruction_data::data::{NewAddressParamsAssignedPacked, NewAddressParamsPacked}, }; -use crate::{ - address::AddressSeed, cpi_accounts::v1::CpiAccounts, AnchorDeserialize, AnchorSerialize, -}; +use crate::{address::AddressSeed, cpi_accounts::TreeAccounts, AnchorDeserialize, AnchorSerialize}; #[derive(Debug, Clone, Copy, AnchorDeserialize, AnchorSerialize, PartialEq, Default)] pub struct PackedStateTreeInfo { @@ -62,7 +60,7 @@ impl PackedAddressTreeInfo { pub fn get_tree_pubkey( &self, - cpi_accounts: &CpiAccounts<'_, T>, + cpi_accounts: &impl TreeAccounts, ) -> Result { let account = cpi_accounts.get_tree_account_info(self.address_merkle_tree_pubkey_index as usize)?; diff --git a/sdk-tests/sdk-anchor-test/package.json b/sdk-tests/sdk-anchor-test/package.json index 4f214266cd..591c8441f5 100644 --- a/sdk-tests/sdk-anchor-test/package.json +++ b/sdk-tests/sdk-anchor-test/package.json @@ -1,7 +1,7 @@ { "scripts": { - "lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w", - "lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check", + "lint:fix": "prettier \"**/*.ts\" -w", + "lint": "prettier \"**/*.ts\" --check", "test": "cargo test-sbf -p sdk-native-test", "test-ts": "light test-validator --sbf-program 2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt ../../target/deploy/sdk_anchor_test.so && ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" }, diff --git a/sdk-tests/sdk-anchor-test/tests/test_v1.ts b/sdk-tests/sdk-anchor-test/tests/test_v1.ts index d63067e521..45cecdc7e2 100644 --- a/sdk-tests/sdk-anchor-test/tests/test_v1.ts +++ b/sdk-tests/sdk-anchor-test/tests/test_v1.ts @@ -25,7 +25,7 @@ describe("sdk-anchor-test-v1", () => { const provider = anchor.AnchorProvider.env(); anchor.setProvider(provider); const programId = new web3.PublicKey( - "2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt", + "2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt" ); const program = anchor.workspace.sdkAnchorTest; const coder = new anchor.BorshCoder(idl as anchor.Idl); @@ -38,7 +38,7 @@ describe("sdk-anchor-test-v1", () => { "http://127.0.0.1:3001", { commitment: "confirmed", - }, + } ); let lamports = web3.LAMPORTS_PER_SOL; @@ -52,10 +52,7 @@ describe("sdk-anchor-test-v1", () => { const name = "test-account"; const accountSeed = new TextEncoder().encode("compressed"); const nameSeed = new TextEncoder().encode(name); - const seed = deriveAddressSeed( - [accountSeed, nameSeed], - program.programId, - ); + const seed = deriveAddressSeed([accountSeed, nameSeed], program.programId); const address = deriveAddress(seed, addressTree); console.log("Creating compressed account with name:", name); @@ -67,12 +64,12 @@ describe("sdk-anchor-test-v1", () => { program, outputQueue, signer, - name, + name ); await sleep(2000); let compressedAccount = await rpc.getCompressedAccount( - bn(address.toBytes()), + bn(address.toBytes()) ); console.log("Created account:", compressedAccount); @@ -100,7 +97,7 @@ describe("sdk-anchor-test-v1", () => { outputQueue, signer, coder, - newNestedData, + newNestedData ); await sleep(2000); @@ -115,7 +112,7 @@ describe("sdk-anchor-test-v1", () => { program, outputQueue, signer, - coder, + coder ); await sleep(2000); @@ -132,7 +129,7 @@ async function createCompressedAccount( program: Program, outputMerkleTree: web3.PublicKey, signer: web3.Keypair, - name: string, + name: string ) { const proofRpcResult = await rpc.getValidityProofV0( [], @@ -142,7 +139,7 @@ async function createCompressedAccount( queue: addressQueue, address: bn(address.toBytes()), }, - ], + ] ); const systemAccountConfig = SystemAccountMetaConfig.new(program.programId); let remainingAccounts = @@ -169,7 +166,7 @@ async function createCompressedAccount( proof, packedAddressTreeInfo, outputMerkleTreeIndex, - name, + name ) .accounts({ signer: signer.publicKey, @@ -194,7 +191,7 @@ async function updateCompressedAccount( signer: web3.Keypair, coder: anchor.BorshCoder, name: string, - nestedData: any, + nestedData: any ) { const proofRpcResult = await rpc.getValidityProofV0( [ @@ -204,17 +201,17 @@ async function updateCompressedAccount( queue: compressedAccount.treeInfo.queue, }, ], - [], + [] ); const systemAccountConfig = SystemAccountMetaConfig.new(program.programId); let remainingAccounts = PackedAccounts.newWithSystemAccounts(systemAccountConfig); const merkleTreePubkeyIndex = remainingAccounts.insertOrGet( - compressedAccount.treeInfo.tree, + compressedAccount.treeInfo.tree ); const queuePubkeyIndex = remainingAccounts.insertOrGet( - compressedAccount.treeInfo.queue, + compressedAccount.treeInfo.queue ); const outputMerkleTreeIndex = remainingAccounts.insertOrGet(outputMerkleTree); const compressedAccountMeta = { @@ -232,7 +229,7 @@ async function updateCompressedAccount( // Decode current account state const myCompressedAccount = coder.types.decode( "MyCompressedAccount", - compressedAccount.data.data, + compressedAccount.data.data ); let proof = { @@ -246,7 +243,7 @@ async function updateCompressedAccount( proof, myCompressedAccount, compressedAccountMeta, - nestedData, + nestedData ) .accounts({ signer: signer.publicKey, @@ -269,7 +266,7 @@ async function closeCompressedAccount( program: Program, outputMerkleTree: web3.PublicKey, signer: web3.Keypair, - coder: anchor.BorshCoder, + coder: anchor.BorshCoder ) { const proofRpcResult = await rpc.getValidityProofV0( [ @@ -279,17 +276,17 @@ async function closeCompressedAccount( queue: compressedAccount.treeInfo.queue, }, ], - [], + [] ); const systemAccountConfig = SystemAccountMetaConfig.new(program.programId); let remainingAccounts = PackedAccounts.newWithSystemAccounts(systemAccountConfig); const merkleTreePubkeyIndex = remainingAccounts.insertOrGet( - compressedAccount.treeInfo.tree, + compressedAccount.treeInfo.tree ); const queuePubkeyIndex = remainingAccounts.insertOrGet( - compressedAccount.treeInfo.queue, + compressedAccount.treeInfo.queue ); const outputMerkleTreeIndex = remainingAccounts.insertOrGet(outputMerkleTree); @@ -308,7 +305,7 @@ async function closeCompressedAccount( // Decode current account state const myCompressedAccount = coder.types.decode( "MyCompressedAccount", - compressedAccount.data.data, + compressedAccount.data.data ); let proof = { diff --git a/sdk-tests/sdk-anchor-test/tests/test_v2.ts b/sdk-tests/sdk-anchor-test/tests/test_v2.ts index a7dd36ecae..6ea92125cb 100644 --- a/sdk-tests/sdk-anchor-test/tests/test_v2.ts +++ b/sdk-tests/sdk-anchor-test/tests/test_v2.ts @@ -24,7 +24,7 @@ describe("sdk-anchor-test-v2", () => { const provider = anchor.AnchorProvider.env(); anchor.setProvider(provider); const programId = new web3.PublicKey( - "2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt", + "2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt" ); const program = anchor.workspace.sdkAnchorTest; const coder = new anchor.BorshCoder(idl as anchor.Idl); @@ -37,7 +37,7 @@ describe("sdk-anchor-test-v2", () => { "http://127.0.0.1:3001", { commitment: "confirmed", - }, + } ); // Get existing tree infos @@ -53,7 +53,7 @@ describe("sdk-anchor-test-v2", () => { // Use an actual existing state tree from the environment const stateTreeInfo = existingTreeInfos.find( - (info) => info.treeType === 2 || info.treeType === 3, + (info) => info.treeType === 2 || info.treeType === 3 ); // StateV1 or StateV2 if (!stateTreeInfo) { throw new Error("No state tree available"); @@ -77,12 +77,12 @@ describe("sdk-anchor-test-v2", () => { program, outputQueue, signer, - name, + name ); await sleep(2000); let compressedAccount = await rpc.getCompressedAccount( - bn(address.toBytes()), + bn(address.toBytes()) ); console.log("Created account:", compressedAccount); @@ -110,7 +110,7 @@ describe("sdk-anchor-test-v2", () => { outputQueue, signer, coder, - newNestedData, + newNestedData ); await sleep(2000); @@ -125,7 +125,7 @@ describe("sdk-anchor-test-v2", () => { program, outputQueue, signer, - coder, + coder ); await sleep(2000); @@ -141,7 +141,7 @@ async function createCompressedAccount( program: Program, outputMerkleTree: web3.PublicKey, signer: web3.Keypair, - name: string, + name: string ) { const proofRpcResult = await rpc.getValidityProofV0( [], @@ -151,7 +151,7 @@ async function createCompressedAccount( queue: addressTree, address: bn(address.toBytes()), }, - ], + ] ); const systemAccountConfig = SystemAccountMetaConfig.new(program.programId); let remainingAccounts = @@ -177,7 +177,7 @@ async function createCompressedAccount( proof, packedAddressTreeInfo, outputMerkleTreeIndex, - name, + name ) .accounts({ signer: signer.publicKey, @@ -202,7 +202,7 @@ async function updateCompressedAccount( signer: web3.Keypair, coder: anchor.BorshCoder, name: string, - nestedData: any, + nestedData: any ) { const proofRpcResult = await rpc.getValidityProofV0( [ @@ -212,17 +212,17 @@ async function updateCompressedAccount( queue: compressedAccount.treeInfo.queue, }, ], - [], + [] ); const systemAccountConfig = SystemAccountMetaConfig.new(program.programId); let remainingAccounts = PackedAccounts.newWithSystemAccountsV2(systemAccountConfig); const merkleTreePubkeyIndex = remainingAccounts.insertOrGet( - compressedAccount.treeInfo.tree, + compressedAccount.treeInfo.tree ); const queuePubkeyIndex = remainingAccounts.insertOrGet( - compressedAccount.treeInfo.queue, + compressedAccount.treeInfo.queue ); const outputMerkleTreeIndex = remainingAccounts.insertOrGet(outputMerkleTree); const compressedAccountMeta = { @@ -240,7 +240,7 @@ async function updateCompressedAccount( // Decode current account state const myCompressedAccount = coder.types.decode( "MyCompressedAccount", - compressedAccount.data.data, + compressedAccount.data.data ); let proof = { @@ -254,7 +254,7 @@ async function updateCompressedAccount( proof, myCompressedAccount, compressedAccountMeta, - nestedData, + nestedData ) .accounts({ signer: signer.publicKey, @@ -277,7 +277,7 @@ async function closeCompressedAccount( program: Program, outputMerkleTree: web3.PublicKey, signer: web3.Keypair, - coder: anchor.BorshCoder, + coder: anchor.BorshCoder ) { const proofRpcResult = await rpc.getValidityProofV0( [ @@ -287,17 +287,17 @@ async function closeCompressedAccount( queue: compressedAccount.treeInfo.queue, }, ], - [], + [] ); const systemAccountConfig = SystemAccountMetaConfig.new(program.programId); let remainingAccounts = PackedAccounts.newWithSystemAccountsV2(systemAccountConfig); const merkleTreePubkeyIndex = remainingAccounts.insertOrGet( - compressedAccount.treeInfo.tree, + compressedAccount.treeInfo.tree ); const queuePubkeyIndex = remainingAccounts.insertOrGet( - compressedAccount.treeInfo.queue, + compressedAccount.treeInfo.queue ); const outputMerkleTreeIndex = remainingAccounts.insertOrGet(outputMerkleTree); @@ -316,7 +316,7 @@ async function closeCompressedAccount( // Decode current account state const myCompressedAccount = coder.types.decode( "MyCompressedAccount", - compressedAccount.data.data, + compressedAccount.data.data ); let proof = { From 66e578b5dbd5c78e8061d1b0ee71ed2f1269881a Mon Sep 17 00:00:00 2001 From: ananas Date: Wed, 8 Oct 2025 04:25:19 +0100 Subject: [PATCH 4/7] fix feedback --- Cargo.toml | 2 +- anchor-programs/system/Cargo.toml | 2 +- cli/package.json | 2 +- js/compressed-token/package.json | 2 +- js/stateless.js/package.json | 2 +- js/stateless.js/src/rpc.ts | 3 +- .../src/test-helpers/test-rpc/test-rpc.ts | 2 +- js/stateless.js/src/utils/instruction.ts | 5 +-- pnpm-lock.yaml | 35 ++++++++----------- sdk-tests/sdk-anchor-test/tests/test_v1.ts | 1 - sdk-tests/sdk-anchor-test/tests/test_v2.ts | 1 - 11 files changed, 23 insertions(+), 34 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e985b974dc..8f00a2d73e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -114,7 +114,7 @@ pinocchio-pubkey = { version = "0.3.0" } bs58 = "^0.5.1" litesvm = "0.7" # Anchor -anchor-lang = { version = "=0.31.1", features = ["idl-build"] } +anchor-lang = { version = "=0.31.1" } anchor-spl = "=0.31.1" # Anchor compatibility diff --git a/anchor-programs/system/Cargo.toml b/anchor-programs/system/Cargo.toml index fedfdba10b..f6934a0909 100644 --- a/anchor-programs/system/Cargo.toml +++ b/anchor-programs/system/Cargo.toml @@ -13,7 +13,7 @@ name = "light_system_program" [features] no-entrypoint = [] cpi = ["no-entrypoint"] -default = ["idl-build"] +default = [] idl-build = ["anchor-lang/idl-build"] test-sbf = [] diff --git a/cli/package.json b/cli/package.json index 12d48a5719..bb745062c5 100644 --- a/cli/package.json +++ b/cli/package.json @@ -44,7 +44,7 @@ "/oclif.manifest.json" ], "dependencies": { - "@coral-xyz/anchor": "0.29.0", + "@coral-xyz/anchor": "^0.31.1", "@lightprotocol/compressed-token": "workspace:*", "@lightprotocol/hasher.rs": "0.2.1", "@lightprotocol/stateless.js": "workspace:*", diff --git a/js/compressed-token/package.json b/js/compressed-token/package.json index 664f916e91..d433e6683b 100644 --- a/js/compressed-token/package.json +++ b/js/compressed-token/package.json @@ -39,7 +39,7 @@ "buffer": "6.0.3" }, "devDependencies": { - "@coral-xyz/anchor": "^0.29.0", + "@coral-xyz/anchor": "^0.31.1", "@esbuild-plugins/node-globals-polyfill": "^0.2.3", "@eslint/js": "9.36.0", "@lightprotocol/hasher.rs": "0.2.1", diff --git a/js/stateless.js/package.json b/js/stateless.js/package.json index 3e2d985645..e6a4fe6844 100644 --- a/js/stateless.js/package.json +++ b/js/stateless.js/package.json @@ -49,7 +49,7 @@ "superstruct": "2.0.2" }, "devDependencies": { - "@coral-xyz/anchor": "0.29.0", + "@coral-xyz/anchor": "^0.31.1", "@coral-xyz/borsh": "^0.29.0", "@esbuild-plugins/node-globals-polyfill": "^0.2.3", "@eslint/js": "9.36.0", diff --git a/js/stateless.js/src/rpc.ts b/js/stateless.js/src/rpc.ts index 1f120f2905..9ec26b2b4b 100644 --- a/js/stateless.js/src/rpc.ts +++ b/js/stateless.js/src/rpc.ts @@ -64,7 +64,6 @@ import { ValidityProof, TreeType, AddressTreeInfo, - CompressedAccount, } from './state'; import { array, create, nullable } from 'superstruct'; import { @@ -711,7 +710,7 @@ export class Rpc extends Connection implements CompressionApiInterface { return { tree, queue: tree, - cpiContext: PublicKey.default, + cpiContext: undefined, treeType: TreeType.AddressV2, nextTreeInfo: null, }; diff --git a/js/stateless.js/src/test-helpers/test-rpc/test-rpc.ts b/js/stateless.js/src/test-helpers/test-rpc/test-rpc.ts index ac11d2d23d..a915ce0f4a 100644 --- a/js/stateless.js/src/test-helpers/test-rpc/test-rpc.ts +++ b/js/stateless.js/src/test-helpers/test-rpc/test-rpc.ts @@ -188,7 +188,7 @@ export class TestRpc extends Connection implements CompressionApiInterface { return { tree, queue: tree, - cpiContext: PublicKey.default, + cpiContext: undefined, treeType: TreeType.AddressV2, nextTreeInfo: null, }; diff --git a/js/stateless.js/src/utils/instruction.ts b/js/stateless.js/src/utils/instruction.ts index 54a9f6f27e..0e2b10e373 100644 --- a/js/stateless.js/src/utils/instruction.ts +++ b/js/stateless.js/src/utils/instruction.ts @@ -137,9 +137,6 @@ export function getLightSystemAccountMetas( config.selfProgram, )[0]; const defaults = defaultStaticAccountsStruct(); - const noopProgram = new PublicKey( - 'noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV', - ); const metas: AccountMeta[] = [ { pubkey: LightSystemProgram.programId, @@ -152,7 +149,7 @@ export function getLightSystemAccountMetas( isSigner: false, isWritable: false, }, - { pubkey: noopProgram, isSigner: false, isWritable: false }, + { pubkey: defaults.noopProgram, isSigner: false, isWritable: false }, { pubkey: defaults.accountCompressionAuthority, isSigner: false, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5f23514200..21052a3e9b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -33,8 +33,8 @@ importers: cli: dependencies: '@coral-xyz/anchor': - specifier: 0.29.0 - version: 0.29.0(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) + specifier: ^0.31.1 + version: 0.31.1(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) '@lightprotocol/compressed-token': specifier: workspace:* version: link:../js/compressed-token @@ -203,8 +203,8 @@ importers: version: 6.0.3 devDependencies: '@coral-xyz/anchor': - specifier: ^0.29.0 - version: 0.29.0(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) + specifier: ^0.31.1 + version: 0.31.1(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) '@esbuild-plugins/node-globals-polyfill': specifier: ^0.2.3 version: 0.2.3(esbuild@0.25.10) @@ -345,8 +345,8 @@ importers: version: 2.0.2 devDependencies: '@coral-xyz/anchor': - specifier: 0.29.0 - version: 0.29.0(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) + specifier: ^0.31.1 + version: 0.31.1(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) '@esbuild-plugins/node-globals-polyfill': specifier: ^0.2.3 version: 0.2.3(esbuild@0.25.10) @@ -762,10 +762,6 @@ packages: resolution: {integrity: sha512-NhNEku4F3zzUSBtrYz84FzYWm48+9OvmT1Hhnwr6GnPQry2dsEqH/ti/7ASjjpoFTWRnPXrjAIT1qM6Isop+LQ==} engines: {node: '>=10'} - '@coral-xyz/anchor@0.29.0': - resolution: {integrity: sha512-eny6QNG0WOwqV0zQ7cs/b1tIuzZGmP7U7EcH+ogt4Gdbl8HDmIYVMh/9aTmYZPaFWjtUaI8qSn73uYEXWfATdA==} - engines: {node: '>=11'} - '@coral-xyz/anchor@0.31.1': resolution: {integrity: sha512-QUqpoEK+gi2S6nlYc2atgT2r41TT3caWr/cPUEL8n8Md9437trZ68STknq897b82p5mW0XrTBNOzRbmIRJtfsA==} engines: {node: '>=17'} @@ -2938,10 +2934,6 @@ packages: crypto-browserify@3.12.0: resolution: {integrity: sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==} - crypto-hash@1.3.0: - resolution: {integrity: sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg==} - engines: {node: '>=8'} - csstype@3.1.3: resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} @@ -6720,9 +6712,10 @@ snapshots: '@coral-xyz/anchor-errors@0.31.1': {} - '@coral-xyz/anchor@0.29.0(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10)': + '@coral-xyz/anchor@0.31.1(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10)': dependencies: - '@coral-xyz/borsh': 0.29.0(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10)) + '@coral-xyz/anchor-errors': 0.31.1 + '@coral-xyz/borsh': 0.31.1(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10)) '@noble/hashes': 1.5.0 '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) bn.js: 5.2.1 @@ -6730,10 +6723,8 @@ snapshots: buffer-layout: 1.2.2 camelcase: 6.3.0 cross-fetch: 3.1.8 - crypto-hash: 1.3.0 eventemitter3: 4.0.7 pako: 2.1.0 - snake-case: 3.0.4 superstruct: 0.15.5 toml: 3.0.0 transitivePeerDependencies: @@ -6769,6 +6760,12 @@ snapshots: bn.js: 5.2.1 buffer-layout: 1.2.2 + '@coral-xyz/borsh@0.31.1(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10))': + dependencies: + '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) + bn.js: 5.2.1 + buffer-layout: 1.2.2 + '@coral-xyz/borsh@0.31.1(@solana/web3.js@1.98.4(typescript@4.9.5))': dependencies: '@solana/web3.js': 1.98.4(typescript@4.9.5) @@ -9187,8 +9184,6 @@ snapshots: randombytes: 2.1.0 randomfill: 1.0.4 - crypto-hash@1.3.0: {} - csstype@3.1.3: {} data-uri-to-buffer@4.0.1: {} diff --git a/sdk-tests/sdk-anchor-test/tests/test_v1.ts b/sdk-tests/sdk-anchor-test/tests/test_v1.ts index 45cecdc7e2..b757a2f911 100644 --- a/sdk-tests/sdk-anchor-test/tests/test_v1.ts +++ b/sdk-tests/sdk-anchor-test/tests/test_v1.ts @@ -190,7 +190,6 @@ async function updateCompressedAccount( outputMerkleTree: web3.PublicKey, signer: web3.Keypair, coder: anchor.BorshCoder, - name: string, nestedData: any ) { const proofRpcResult = await rpc.getValidityProofV0( diff --git a/sdk-tests/sdk-anchor-test/tests/test_v2.ts b/sdk-tests/sdk-anchor-test/tests/test_v2.ts index 6ea92125cb..afae29805a 100644 --- a/sdk-tests/sdk-anchor-test/tests/test_v2.ts +++ b/sdk-tests/sdk-anchor-test/tests/test_v2.ts @@ -201,7 +201,6 @@ async function updateCompressedAccount( outputMerkleTree: web3.PublicKey, signer: web3.Keypair, coder: anchor.BorshCoder, - name: string, nestedData: any ) { const proofRpcResult = await rpc.getValidityProofV0( From c094fdd5a1eab1743856269d588dc8dc68ab12ee Mon Sep 17 00:00:00 2001 From: ananas Date: Wed, 8 Oct 2025 04:31:57 +0100 Subject: [PATCH 5/7] fix: ts sdk anchor test --- .github/workflows/js-v2.yml | 1 - .gitignore | 1 + sdk-tests/sdk-anchor-test/.gitignore | 1 - .../target/idl/sdk_anchor_test.json | 726 +++++++++++++++++ .../target/types/sdk_anchor_test.ts | 732 ++++++++++++++++++ 5 files changed, 1459 insertions(+), 2 deletions(-) create mode 100644 sdk-tests/sdk-anchor-test/target/idl/sdk_anchor_test.json create mode 100644 sdk-tests/sdk-anchor-test/target/types/sdk_anchor_test.ts diff --git a/.github/workflows/js-v2.yml b/.github/workflows/js-v2.yml index 8b1df26cd7..43796e0fee 100644 --- a/.github/workflows/js-v2.yml +++ b/.github/workflows/js-v2.yml @@ -89,7 +89,6 @@ jobs: run: | source ./scripts/devenv.sh cd sdk-tests/sdk-anchor-test - anchor build npm run test-ts - name: Display prover logs on failure diff --git a/.gitignore b/.gitignore index 8fa4a89ce0..191d6aee62 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ # Rust **/target/ +!sdk-tests/sdk-anchor-test/target/ **/dist/ diff --git a/sdk-tests/sdk-anchor-test/.gitignore b/sdk-tests/sdk-anchor-test/.gitignore index 2e0446b07f..3fa94f459c 100644 --- a/sdk-tests/sdk-anchor-test/.gitignore +++ b/sdk-tests/sdk-anchor-test/.gitignore @@ -1,6 +1,5 @@ .anchor .DS_Store -target **/*.rs.bk node_modules test-ledger diff --git a/sdk-tests/sdk-anchor-test/target/idl/sdk_anchor_test.json b/sdk-tests/sdk-anchor-test/target/idl/sdk_anchor_test.json new file mode 100644 index 0000000000..0e4e427c40 --- /dev/null +++ b/sdk-tests/sdk-anchor-test/target/idl/sdk_anchor_test.json @@ -0,0 +1,726 @@ +{ + "address": "2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt", + "metadata": { + "name": "sdk_anchor_test", + "version": "0.7.0", + "spec": "0.1.0", + "description": "Test program for Light SDK and Light Macros" + }, + "instructions": [ + { + "name": "close_compressed_account", + "discriminator": [ + 55, + 108, + 99, + 108, + 119, + 228, + 247, + 203 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "ValidityProof" + } + } + }, + { + "name": "my_compressed_account", + "type": { + "defined": { + "name": "MyCompressedAccount" + } + } + }, + { + "name": "account_meta", + "type": { + "defined": { + "name": "CompressedAccountMeta" + } + } + } + ] + }, + { + "name": "close_compressed_account_permanent", + "discriminator": [ + 117, + 145, + 242, + 98, + 46, + 187, + 118, + 125 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "ValidityProof" + } + } + }, + { + "name": "account_meta", + "type": { + "defined": { + "name": "CompressedAccountMetaBurn" + } + } + } + ] + }, + { + "name": "close_compressed_account_v2", + "discriminator": [ + 12, + 21, + 104, + 30, + 185, + 99, + 10, + 30 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "ValidityProof" + } + } + }, + { + "name": "my_compressed_account", + "type": { + "defined": { + "name": "MyCompressedAccount" + } + } + }, + { + "name": "account_meta", + "type": { + "defined": { + "name": "CompressedAccountMeta" + } + } + } + ] + }, + { + "name": "create_compressed_account", + "discriminator": [ + 74, + 87, + 131, + 150, + 204, + 209, + 66, + 94 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "ValidityProof" + } + } + }, + { + "name": "address_tree_info", + "type": { + "defined": { + "name": "PackedAddressTreeInfo" + } + } + }, + { + "name": "output_tree_index", + "type": "u8" + }, + { + "name": "name", + "type": "string" + } + ] + }, + { + "name": "create_compressed_account_v2", + "discriminator": [ + 16, + 69, + 137, + 87, + 207, + 37, + 81, + 138 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "ValidityProof" + } + } + }, + { + "name": "address_tree_info", + "type": { + "defined": { + "name": "PackedAddressTreeInfo" + } + } + }, + { + "name": "output_tree_index", + "type": "u8" + }, + { + "name": "name", + "type": "string" + } + ] + }, + { + "name": "reinit_closed_account", + "discriminator": [ + 100, + 26, + 249, + 27, + 243, + 0, + 206, + 64 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "ValidityProof" + } + } + }, + { + "name": "account_meta", + "type": { + "defined": { + "name": "CompressedAccountMeta" + } + } + } + ] + }, + { + "name": "update_compressed_account", + "discriminator": [ + 3, + 98, + 6, + 60, + 116, + 45, + 88, + 166 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "ValidityProof" + } + } + }, + { + "name": "my_compressed_account", + "type": { + "defined": { + "name": "MyCompressedAccount" + } + } + }, + { + "name": "account_meta", + "type": { + "defined": { + "name": "CompressedAccountMeta" + } + } + }, + { + "name": "nested_data", + "type": { + "defined": { + "name": "NestedData" + } + } + } + ] + }, + { + "name": "update_compressed_account_v2", + "discriminator": [ + 100, + 134, + 47, + 184, + 220, + 7, + 96, + 236 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "ValidityProof" + } + } + }, + { + "name": "my_compressed_account", + "type": { + "defined": { + "name": "MyCompressedAccount" + } + } + }, + { + "name": "account_meta", + "type": { + "defined": { + "name": "CompressedAccountMeta" + } + } + }, + { + "name": "nested_data", + "type": { + "defined": { + "name": "NestedData" + } + } + } + ] + }, + { + "name": "without_compressed_account", + "discriminator": [ + 68, + 84, + 81, + 196, + 24, + 131, + 208, + 209 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "my_regular_account", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 99, + 111, + 109, + 112, + 114, + 101, + 115, + 115, + 101, + 100 + ] + }, + { + "kind": "arg", + "path": "name" + } + ] + } + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "name", + "type": "string" + } + ] + } + ], + "accounts": [ + { + "name": "MyRegularAccount", + "discriminator": [ + 186, + 181, + 76, + 117, + 61, + 130, + 63, + 14 + ] + } + ], + "events": [ + { + "name": "MyCompressedAccount", + "discriminator": [ + 147, + 40, + 99, + 80, + 53, + 44, + 10, + 210 + ] + } + ], + "types": [ + { + "name": "CompressedAccountMeta", + "type": { + "kind": "struct", + "fields": [ + { + "name": "tree_info", + "docs": [ + "Merkle tree context." + ], + "type": { + "defined": { + "name": "PackedStateTreeInfo" + } + } + }, + { + "name": "address", + "docs": [ + "Address." + ], + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "output_state_tree_index", + "docs": [ + "Output merkle tree index." + ], + "type": "u8" + } + ] + } + }, + { + "name": "CompressedAccountMetaBurn", + "type": { + "kind": "struct", + "fields": [ + { + "name": "tree_info", + "docs": [ + "State Merkle tree context." + ], + "type": { + "defined": { + "name": "PackedStateTreeInfo" + } + } + }, + { + "name": "address", + "docs": [ + "Address." + ], + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "CompressedProof", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "a", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "b", + "type": { + "array": [ + "u8", + 64 + ] + } + }, + { + "name": "c", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "MyCompressedAccount", + "type": { + "kind": "struct", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "nested", + "type": { + "defined": { + "name": "NestedData" + } + } + } + ] + } + }, + { + "name": "MyRegularAccount", + "type": { + "kind": "struct", + "fields": [ + { + "name": "name", + "type": "string" + } + ] + } + }, + { + "name": "NestedData", + "type": { + "kind": "struct", + "fields": [ + { + "name": "one", + "type": "u16" + }, + { + "name": "two", + "type": "u16" + }, + { + "name": "three", + "type": "u16" + }, + { + "name": "four", + "type": "u16" + }, + { + "name": "five", + "type": "u16" + }, + { + "name": "six", + "type": "u16" + }, + { + "name": "seven", + "type": "u16" + }, + { + "name": "eight", + "type": "u16" + }, + { + "name": "nine", + "type": "u16" + }, + { + "name": "ten", + "type": "u16" + }, + { + "name": "eleven", + "type": "u16" + }, + { + "name": "twelve", + "type": "u16" + } + ] + } + }, + { + "name": "PackedAddressTreeInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "address_merkle_tree_pubkey_index", + "type": "u8" + }, + { + "name": "address_queue_pubkey_index", + "type": "u8" + }, + { + "name": "root_index", + "type": "u16" + } + ] + } + }, + { + "name": "PackedStateTreeInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "root_index", + "type": "u16" + }, + { + "name": "prove_by_index", + "type": "bool" + }, + { + "name": "merkle_tree_pubkey_index", + "type": "u8" + }, + { + "name": "queue_pubkey_index", + "type": "u8" + }, + { + "name": "leaf_index", + "type": "u32" + } + ] + } + }, + { + "name": "ValidityProof", + "type": { + "kind": "struct", + "fields": [ + { + "option": { + "defined": { + "name": "CompressedProof" + } + } + } + ] + } + } + ] +} \ No newline at end of file diff --git a/sdk-tests/sdk-anchor-test/target/types/sdk_anchor_test.ts b/sdk-tests/sdk-anchor-test/target/types/sdk_anchor_test.ts new file mode 100644 index 0000000000..e805730cc1 --- /dev/null +++ b/sdk-tests/sdk-anchor-test/target/types/sdk_anchor_test.ts @@ -0,0 +1,732 @@ +/** + * Program IDL in camelCase format in order to be used in JS/TS. + * + * Note that this is only a type helper and is not the actual IDL. The original + * IDL can be found at `target/idl/sdk_anchor_test.json`. + */ +export type SdkAnchorTest = { + "address": "2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt", + "metadata": { + "name": "sdkAnchorTest", + "version": "0.7.0", + "spec": "0.1.0", + "description": "Test program for Light SDK and Light Macros" + }, + "instructions": [ + { + "name": "closeCompressedAccount", + "discriminator": [ + 55, + 108, + 99, + 108, + 119, + 228, + 247, + 203 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "validityProof" + } + } + }, + { + "name": "myCompressedAccount", + "type": { + "defined": { + "name": "myCompressedAccount" + } + } + }, + { + "name": "accountMeta", + "type": { + "defined": { + "name": "compressedAccountMeta" + } + } + } + ] + }, + { + "name": "closeCompressedAccountPermanent", + "discriminator": [ + 117, + 145, + 242, + 98, + 46, + 187, + 118, + 125 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "validityProof" + } + } + }, + { + "name": "accountMeta", + "type": { + "defined": { + "name": "compressedAccountMetaBurn" + } + } + } + ] + }, + { + "name": "closeCompressedAccountV2", + "discriminator": [ + 12, + 21, + 104, + 30, + 185, + 99, + 10, + 30 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "validityProof" + } + } + }, + { + "name": "myCompressedAccount", + "type": { + "defined": { + "name": "myCompressedAccount" + } + } + }, + { + "name": "accountMeta", + "type": { + "defined": { + "name": "compressedAccountMeta" + } + } + } + ] + }, + { + "name": "createCompressedAccount", + "discriminator": [ + 74, + 87, + 131, + 150, + 204, + 209, + 66, + 94 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "validityProof" + } + } + }, + { + "name": "addressTreeInfo", + "type": { + "defined": { + "name": "packedAddressTreeInfo" + } + } + }, + { + "name": "outputTreeIndex", + "type": "u8" + }, + { + "name": "name", + "type": "string" + } + ] + }, + { + "name": "createCompressedAccountV2", + "discriminator": [ + 16, + 69, + 137, + 87, + 207, + 37, + 81, + 138 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "validityProof" + } + } + }, + { + "name": "addressTreeInfo", + "type": { + "defined": { + "name": "packedAddressTreeInfo" + } + } + }, + { + "name": "outputTreeIndex", + "type": "u8" + }, + { + "name": "name", + "type": "string" + } + ] + }, + { + "name": "reinitClosedAccount", + "discriminator": [ + 100, + 26, + 249, + 27, + 243, + 0, + 206, + 64 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "validityProof" + } + } + }, + { + "name": "accountMeta", + "type": { + "defined": { + "name": "compressedAccountMeta" + } + } + } + ] + }, + { + "name": "updateCompressedAccount", + "discriminator": [ + 3, + 98, + 6, + 60, + 116, + 45, + 88, + 166 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "validityProof" + } + } + }, + { + "name": "myCompressedAccount", + "type": { + "defined": { + "name": "myCompressedAccount" + } + } + }, + { + "name": "accountMeta", + "type": { + "defined": { + "name": "compressedAccountMeta" + } + } + }, + { + "name": "nestedData", + "type": { + "defined": { + "name": "nestedData" + } + } + } + ] + }, + { + "name": "updateCompressedAccountV2", + "discriminator": [ + 100, + 134, + 47, + 184, + 220, + 7, + 96, + 236 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + } + ], + "args": [ + { + "name": "proof", + "type": { + "defined": { + "name": "validityProof" + } + } + }, + { + "name": "myCompressedAccount", + "type": { + "defined": { + "name": "myCompressedAccount" + } + } + }, + { + "name": "accountMeta", + "type": { + "defined": { + "name": "compressedAccountMeta" + } + } + }, + { + "name": "nestedData", + "type": { + "defined": { + "name": "nestedData" + } + } + } + ] + }, + { + "name": "withoutCompressedAccount", + "discriminator": [ + 68, + 84, + 81, + 196, + 24, + 131, + 208, + 209 + ], + "accounts": [ + { + "name": "signer", + "writable": true, + "signer": true + }, + { + "name": "myRegularAccount", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [ + 99, + 111, + 109, + 112, + 114, + 101, + 115, + 115, + 101, + 100 + ] + }, + { + "kind": "arg", + "path": "name" + } + ] + } + }, + { + "name": "systemProgram", + "address": "11111111111111111111111111111111" + } + ], + "args": [ + { + "name": "name", + "type": "string" + } + ] + } + ], + "accounts": [ + { + "name": "myRegularAccount", + "discriminator": [ + 186, + 181, + 76, + 117, + 61, + 130, + 63, + 14 + ] + } + ], + "events": [ + { + "name": "myCompressedAccount", + "discriminator": [ + 147, + 40, + 99, + 80, + 53, + 44, + 10, + 210 + ] + } + ], + "types": [ + { + "name": "compressedAccountMeta", + "type": { + "kind": "struct", + "fields": [ + { + "name": "treeInfo", + "docs": [ + "Merkle tree context." + ], + "type": { + "defined": { + "name": "packedStateTreeInfo" + } + } + }, + { + "name": "address", + "docs": [ + "Address." + ], + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "outputStateTreeIndex", + "docs": [ + "Output merkle tree index." + ], + "type": "u8" + } + ] + } + }, + { + "name": "compressedAccountMetaBurn", + "type": { + "kind": "struct", + "fields": [ + { + "name": "treeInfo", + "docs": [ + "State Merkle tree context." + ], + "type": { + "defined": { + "name": "packedStateTreeInfo" + } + } + }, + { + "name": "address", + "docs": [ + "Address." + ], + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "compressedProof", + "repr": { + "kind": "c" + }, + "type": { + "kind": "struct", + "fields": [ + { + "name": "a", + "type": { + "array": [ + "u8", + 32 + ] + } + }, + { + "name": "b", + "type": { + "array": [ + "u8", + 64 + ] + } + }, + { + "name": "c", + "type": { + "array": [ + "u8", + 32 + ] + } + } + ] + } + }, + { + "name": "myCompressedAccount", + "type": { + "kind": "struct", + "fields": [ + { + "name": "name", + "type": "string" + }, + { + "name": "nested", + "type": { + "defined": { + "name": "nestedData" + } + } + } + ] + } + }, + { + "name": "myRegularAccount", + "type": { + "kind": "struct", + "fields": [ + { + "name": "name", + "type": "string" + } + ] + } + }, + { + "name": "nestedData", + "type": { + "kind": "struct", + "fields": [ + { + "name": "one", + "type": "u16" + }, + { + "name": "two", + "type": "u16" + }, + { + "name": "three", + "type": "u16" + }, + { + "name": "four", + "type": "u16" + }, + { + "name": "five", + "type": "u16" + }, + { + "name": "six", + "type": "u16" + }, + { + "name": "seven", + "type": "u16" + }, + { + "name": "eight", + "type": "u16" + }, + { + "name": "nine", + "type": "u16" + }, + { + "name": "ten", + "type": "u16" + }, + { + "name": "eleven", + "type": "u16" + }, + { + "name": "twelve", + "type": "u16" + } + ] + } + }, + { + "name": "packedAddressTreeInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "addressMerkleTreePubkeyIndex", + "type": "u8" + }, + { + "name": "addressQueuePubkeyIndex", + "type": "u8" + }, + { + "name": "rootIndex", + "type": "u16" + } + ] + } + }, + { + "name": "packedStateTreeInfo", + "type": { + "kind": "struct", + "fields": [ + { + "name": "rootIndex", + "type": "u16" + }, + { + "name": "proveByIndex", + "type": "bool" + }, + { + "name": "merkleTreePubkeyIndex", + "type": "u8" + }, + { + "name": "queuePubkeyIndex", + "type": "u8" + }, + { + "name": "leafIndex", + "type": "u32" + } + ] + } + }, + { + "name": "validityProof", + "type": { + "kind": "struct", + "fields": [ + { + "option": { + "defined": { + "name": "compressedProof" + } + } + } + ] + } + } + ] +}; From c53986da267f559083486b31bd5d8561b7c24a35 Mon Sep 17 00:00:00 2001 From: ananas Date: Wed, 8 Oct 2025 13:52:29 +0100 Subject: [PATCH 6/7] revert: anchor dev dep bump --- cli/package.json | 2 +- js/compressed-token/package.json | 2 +- js/stateless.js/package.json | 2 +- pnpm-lock.yaml | 35 ++++++++++++++++++-------------- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/cli/package.json b/cli/package.json index bb745062c5..d53ab27813 100644 --- a/cli/package.json +++ b/cli/package.json @@ -44,7 +44,7 @@ "/oclif.manifest.json" ], "dependencies": { - "@coral-xyz/anchor": "^0.31.1", + "@coral-xyz/anchor": "^0.29.0", "@lightprotocol/compressed-token": "workspace:*", "@lightprotocol/hasher.rs": "0.2.1", "@lightprotocol/stateless.js": "workspace:*", diff --git a/js/compressed-token/package.json b/js/compressed-token/package.json index d433e6683b..664f916e91 100644 --- a/js/compressed-token/package.json +++ b/js/compressed-token/package.json @@ -39,7 +39,7 @@ "buffer": "6.0.3" }, "devDependencies": { - "@coral-xyz/anchor": "^0.31.1", + "@coral-xyz/anchor": "^0.29.0", "@esbuild-plugins/node-globals-polyfill": "^0.2.3", "@eslint/js": "9.36.0", "@lightprotocol/hasher.rs": "0.2.1", diff --git a/js/stateless.js/package.json b/js/stateless.js/package.json index e6a4fe6844..1776502509 100644 --- a/js/stateless.js/package.json +++ b/js/stateless.js/package.json @@ -49,7 +49,7 @@ "superstruct": "2.0.2" }, "devDependencies": { - "@coral-xyz/anchor": "^0.31.1", + "@coral-xyz/anchor": "^0.29.0", "@coral-xyz/borsh": "^0.29.0", "@esbuild-plugins/node-globals-polyfill": "^0.2.3", "@eslint/js": "9.36.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 21052a3e9b..a291499d2c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -33,8 +33,8 @@ importers: cli: dependencies: '@coral-xyz/anchor': - specifier: ^0.31.1 - version: 0.31.1(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) + specifier: ^0.29.0 + version: 0.29.0(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) '@lightprotocol/compressed-token': specifier: workspace:* version: link:../js/compressed-token @@ -203,8 +203,8 @@ importers: version: 6.0.3 devDependencies: '@coral-xyz/anchor': - specifier: ^0.31.1 - version: 0.31.1(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) + specifier: ^0.29.0 + version: 0.29.0(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) '@esbuild-plugins/node-globals-polyfill': specifier: ^0.2.3 version: 0.2.3(esbuild@0.25.10) @@ -345,8 +345,8 @@ importers: version: 2.0.2 devDependencies: '@coral-xyz/anchor': - specifier: ^0.31.1 - version: 0.31.1(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) + specifier: ^0.29.0 + version: 0.29.0(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) '@esbuild-plugins/node-globals-polyfill': specifier: ^0.2.3 version: 0.2.3(esbuild@0.25.10) @@ -762,6 +762,10 @@ packages: resolution: {integrity: sha512-NhNEku4F3zzUSBtrYz84FzYWm48+9OvmT1Hhnwr6GnPQry2dsEqH/ti/7ASjjpoFTWRnPXrjAIT1qM6Isop+LQ==} engines: {node: '>=10'} + '@coral-xyz/anchor@0.29.0': + resolution: {integrity: sha512-eny6QNG0WOwqV0zQ7cs/b1tIuzZGmP7U7EcH+ogt4Gdbl8HDmIYVMh/9aTmYZPaFWjtUaI8qSn73uYEXWfATdA==} + engines: {node: '>=11'} + '@coral-xyz/anchor@0.31.1': resolution: {integrity: sha512-QUqpoEK+gi2S6nlYc2atgT2r41TT3caWr/cPUEL8n8Md9437trZ68STknq897b82p5mW0XrTBNOzRbmIRJtfsA==} engines: {node: '>=17'} @@ -2934,6 +2938,10 @@ packages: crypto-browserify@3.12.0: resolution: {integrity: sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==} + crypto-hash@1.3.0: + resolution: {integrity: sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg==} + engines: {node: '>=8'} + csstype@3.1.3: resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} @@ -6712,10 +6720,9 @@ snapshots: '@coral-xyz/anchor-errors@0.31.1': {} - '@coral-xyz/anchor@0.31.1(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10)': + '@coral-xyz/anchor@0.29.0(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10)': dependencies: - '@coral-xyz/anchor-errors': 0.31.1 - '@coral-xyz/borsh': 0.31.1(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10)) + '@coral-xyz/borsh': 0.29.0(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10)) '@noble/hashes': 1.5.0 '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) bn.js: 5.2.1 @@ -6723,8 +6730,10 @@ snapshots: buffer-layout: 1.2.2 camelcase: 6.3.0 cross-fetch: 3.1.8 + crypto-hash: 1.3.0 eventemitter3: 4.0.7 pako: 2.1.0 + snake-case: 3.0.4 superstruct: 0.15.5 toml: 3.0.0 transitivePeerDependencies: @@ -6760,12 +6769,6 @@ snapshots: bn.js: 5.2.1 buffer-layout: 1.2.2 - '@coral-xyz/borsh@0.31.1(@solana/web3.js@1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10))': - dependencies: - '@solana/web3.js': 1.98.4(bufferutil@4.0.8)(typescript@5.9.2)(utf-8-validate@5.0.10) - bn.js: 5.2.1 - buffer-layout: 1.2.2 - '@coral-xyz/borsh@0.31.1(@solana/web3.js@1.98.4(typescript@4.9.5))': dependencies: '@solana/web3.js': 1.98.4(typescript@4.9.5) @@ -9184,6 +9187,8 @@ snapshots: randombytes: 2.1.0 randomfill: 1.0.4 + crypto-hash@1.3.0: {} + csstype@3.1.3: {} data-uri-to-buffer@4.0.1: {} From cd3f226ffdea49d328d8276455958016e6c9070e Mon Sep 17 00:00:00 2001 From: ananas Date: Wed, 8 Oct 2025 15:33:46 +0100 Subject: [PATCH 7/7] build anchor sdk test program for ci --- .github/workflows/js-v2.yml | 1 + sdk-tests/sdk-anchor-test/package.json | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/js-v2.yml b/.github/workflows/js-v2.yml index 43796e0fee..a89621b6d4 100644 --- a/.github/workflows/js-v2.yml +++ b/.github/workflows/js-v2.yml @@ -88,6 +88,7 @@ jobs: - name: Run sdk-anchor-test TypeScript tests with V2 run: | source ./scripts/devenv.sh + npx nx build @lightprotocol/sdk-anchor-test cd sdk-tests/sdk-anchor-test npm run test-ts diff --git a/sdk-tests/sdk-anchor-test/package.json b/sdk-tests/sdk-anchor-test/package.json index 591c8441f5..c49ece5b0f 100644 --- a/sdk-tests/sdk-anchor-test/package.json +++ b/sdk-tests/sdk-anchor-test/package.json @@ -1,9 +1,13 @@ { + "name": "@lightprotocol/sdk-anchor-test", + "version": "0.1.0", + "license": "Apache-2.0", "scripts": { "lint:fix": "prettier \"**/*.ts\" -w", "lint": "prettier \"**/*.ts\" --check", "test": "cargo test-sbf -p sdk-native-test", - "test-ts": "light test-validator --sbf-program 2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt ../../target/deploy/sdk_anchor_test.so && ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" + "test-ts": "light test-validator --sbf-program 2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt ../../target/deploy/sdk_anchor_test.so && ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts", + "build": "cd programs/sdk-anchor-test && cargo build-sbf" }, "dependencies": { "@coral-xyz/anchor": "^0.31.1",