diff --git a/js/compressed-token/package.json b/js/compressed-token/package.json index 986e7f88b..c483112f5 100644 --- a/js/compressed-token/package.json +++ b/js/compressed-token/package.json @@ -1,6 +1,6 @@ { "name": "@lightprotocol/compressed-token", - "version": "0.17.1", + "version": "0.17.2-alpha.0", "description": "JS client to interact with the compressed-token program", "sideEffects": false, "main": "dist/cjs/node/index.cjs", @@ -30,11 +30,11 @@ "license": "Apache-2.0", "peerDependencies": { "@lightprotocol/stateless.js": "workspace:*", - "@solana/web3.js": ">=1.73.5" + "@solana/web3.js": ">=1.73.5", + "@solana/spl-token": ">=0.3.9" }, "dependencies": { "@coral-xyz/borsh": "^0.29.0", - "@solana/spl-token": "0.4.8", "bn.js": "^5.2.1", "buffer": "6.0.3" }, @@ -51,6 +51,7 @@ "@rollup/plugin-terser": "^0.4.4", "@rollup/plugin-typescript": "^11.1.6", "@solana/web3.js": "1.98.0", + "@solana/spl-token": "0.4.8", "@types/bn.js": "^5.1.5", "@types/node": "^22.5.5", "@typescript-eslint/eslint-plugin": "^7.13.1", @@ -80,7 +81,7 @@ "test:unit:all": "EXCLUDE_E2E=true vitest run", "test-all:verbose": "vitest run --reporter=verbose", "test-validator": "./../../cli/test_bin/run test-validator --prover-run-mode rpc", - "test:e2e:create-mint": "pnpm test-validator && vitest run tests/e2e/create-mint.test.ts", + "test:e2e:create-mint": "pnpm test-validator && NODE_OPTIONS='--trace-deprecation' vitest run tests/e2e/create-mint.test.ts --reporter=verbose", "test:e2e:layout": "vitest run tests/e2e/layout.test.ts --reporter=verbose", "test:e2e:create-token-pool": "pnpm test-validator && vitest run tests/e2e/create-token-pool.test.ts", "test:e2e:mint-to": "pnpm test-validator && vitest run tests/e2e/mint-to.test.ts --reporter=verbose", diff --git a/js/compressed-token/src/program.ts b/js/compressed-token/src/program.ts index f77da8a55..ccae5ea00 100644 --- a/js/compressed-token/src/program.ts +++ b/js/compressed-token/src/program.ts @@ -6,6 +6,7 @@ import { AddressLookupTableProgram, AccountMeta, } from '@solana/web3.js'; +import { Buffer } from 'buffer'; import BN from 'bn.js'; import { CompressedProof, diff --git a/js/compressed-token/tests/e2e/create-mint.test.ts b/js/compressed-token/tests/e2e/create-mint.test.ts index 4489c2b26..e10579042 100644 --- a/js/compressed-token/tests/e2e/create-mint.test.ts +++ b/js/compressed-token/tests/e2e/create-mint.test.ts @@ -44,6 +44,7 @@ async function assertCreateMint( expect(unpackedPoolAccount.delegate).toBe(null); } +console.log('TEST_TOKEN_DECIMALS'); const TEST_TOKEN_DECIMALS = 2; describe('createMint', () => { let rpc: Rpc; @@ -52,12 +53,16 @@ describe('createMint', () => { let mintAuthority: Keypair; beforeAll(async () => { + console.log('beforeAll'); const lightWasm = await WasmFactory.getInstance(); + console.log('lightWasm', lightWasm); rpc = await getTestRpc(lightWasm); + console.log('TESTrpc', rpc); payer = await newAccountWithLamports(rpc, 1e9); + console.log('payer', payer); }); - it('should create mint', async () => { + it.only('should create mint', async () => { mintAuthority = Keypair.generate(); const mintKeypair = Keypair.generate(); diff --git a/js/stateless.js/package.json b/js/stateless.js/package.json index f783f7f9d..42a4a1954 100644 --- a/js/stateless.js/package.json +++ b/js/stateless.js/package.json @@ -1,7 +1,7 @@ { "name": "@lightprotocol/stateless.js", "version": "0.17.2-alpha.1", - "description": "JavaScript API for Light and ZK Compression", + "description": "JavaScript API for Light & ZK Compression", "sideEffects": false, "main": "dist/cjs/node/index.cjs", "type": "module", @@ -38,7 +38,7 @@ "@solana/web3.js": ">=1.73.5" }, "dependencies": { - "@coral-xyz/borsh": "^0.30.1", + "@coral-xyz/borsh": "^0.29.0", "@noble/hashes": "1.5.0", "bn.js": "^5.2.1", "bs58": "^6.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5665b29b4..e45e7f730 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -243,7 +243,7 @@ importers: dependencies: '@coral-xyz/anchor': specifier: ^0.29.0 - version: 0.29.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) + version: 0.29.0 devDependencies: '@lightprotocol/zk-compression-cli': specifier: workspace:* @@ -296,7 +296,7 @@ importers: dependencies: '@coral-xyz/anchor': specifier: 0.29.0 - version: 0.29.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) + version: 0.29.0 devDependencies: '@types/bn.js': specifier: ^5.1.6 @@ -333,13 +333,10 @@ importers: dependencies: '@coral-xyz/borsh': specifier: ^0.29.0 - version: 0.29.0(@solana/web3.js@1.95.5) + version: 0.29.0(@solana/web3.js@1.98.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)) '@lightprotocol/stateless.js': specifier: workspace:* version: link:../stateless.js - '@solana/spl-token': - specifier: 0.4.8 - version: 0.4.8(@solana/web3.js@1.95.5(bufferutil@4.0.8)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.2)(utf-8-validate@5.0.10) bn.js: specifier: ^5.2.1 version: 5.2.1 @@ -380,9 +377,12 @@ importers: '@rollup/plugin-typescript': specifier: ^11.1.6 version: 11.1.6(rollup@4.21.3)(tslib@2.7.0)(typescript@5.6.2) + '@solana/spl-token': + specifier: 0.4.8 + version: 0.4.8(@solana/web3.js@1.98.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.2)(utf-8-validate@5.0.10) '@solana/web3.js': - specifier: 1.95.5 - version: 1.95.5(bufferutil@4.0.8)(utf-8-validate@5.0.10) + specifier: 1.98.0 + version: 1.98.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) '@types/bn.js': specifier: ^5.1.5 version: 5.1.5 @@ -453,8 +453,8 @@ importers: js/stateless.js: dependencies: '@coral-xyz/borsh': - specifier: ^0.30.1 - version: 0.30.1(@solana/web3.js@1.98.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)) + specifier: ^0.29.0 + version: 0.29.0(@solana/web3.js@1.98.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)) '@noble/hashes': specifier: 1.5.0 version: 1.5.0 @@ -582,7 +582,7 @@ importers: dependencies: '@coral-xyz/anchor': specifier: ^0.29.0 - version: 0.29.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) + version: 0.29.0 devDependencies: '@lightprotocol/zk-compression-cli': specifier: workspace:* @@ -9373,7 +9373,7 @@ snapshots: '@babel/helper-validator-identifier': 7.24.5 to-fast-properties: 2.0.0 - '@coral-xyz/anchor@0.29.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)': + '@coral-xyz/anchor@0.29.0': dependencies: '@coral-xyz/borsh': 0.29.0(@solana/web3.js@1.95.5) '@noble/hashes': 1.5.0 @@ -9394,6 +9394,27 @@ snapshots: - encoding - utf-8-validate + '@coral-xyz/anchor@0.29.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)': + dependencies: + '@coral-xyz/borsh': 0.29.0(@solana/web3.js@1.95.5(bufferutil@4.0.8)(utf-8-validate@5.0.10)) + '@noble/hashes': 1.5.0 + '@solana/web3.js': 1.95.5(bufferutil@4.0.8)(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 + 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: + - bufferutil + - encoding + - utf-8-validate + '@coral-xyz/anchor@0.30.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)': dependencies: '@coral-xyz/borsh': 0.30.1(@solana/web3.js@1.95.5(bufferutil@4.0.8)(utf-8-validate@5.0.10)) @@ -9415,24 +9436,30 @@ snapshots: - encoding - utf-8-validate - '@coral-xyz/borsh@0.29.0(@solana/web3.js@1.95.5)': + '@coral-xyz/borsh@0.29.0(@solana/web3.js@1.95.5(bufferutil@4.0.8)(utf-8-validate@5.0.10))': dependencies: '@solana/web3.js': 1.95.5(bufferutil@4.0.8)(utf-8-validate@5.0.10) bn.js: 5.2.1 buffer-layout: 1.2.2 - '@coral-xyz/borsh@0.30.1(@solana/web3.js@1.95.5(bufferutil@4.0.8)(utf-8-validate@5.0.10))': + '@coral-xyz/borsh@0.29.0(@solana/web3.js@1.95.5)': dependencies: '@solana/web3.js': 1.95.5(bufferutil@4.0.8)(utf-8-validate@5.0.10) bn.js: 5.2.1 buffer-layout: 1.2.2 - '@coral-xyz/borsh@0.30.1(@solana/web3.js@1.98.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))': + '@coral-xyz/borsh@0.29.0(@solana/web3.js@1.98.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))': dependencies: '@solana/web3.js': 1.98.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) bn.js: 5.2.1 buffer-layout: 1.2.2 + '@coral-xyz/borsh@0.30.1(@solana/web3.js@1.95.5(bufferutil@4.0.8)(utf-8-validate@5.0.10))': + dependencies: + '@solana/web3.js': 1.95.5(bufferutil@4.0.8)(utf-8-validate@5.0.10) + bn.js: 5.2.1 + buffer-layout: 1.2.2 + '@cspotcode/source-map-support@0.8.1': dependencies: '@jridgewell/trace-mapping': 0.3.9 @@ -10927,11 +10954,11 @@ snapshots: transitivePeerDependencies: - fastestsmallesttextencoderdecoder - '@solana/spl-token-group@0.0.5(@solana/web3.js@1.95.5(bufferutil@4.0.8)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.2)': + '@solana/spl-token-group@0.0.5(@solana/web3.js@1.98.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.2)': dependencies: '@solana/codecs': 2.0.0-preview.4(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.2) '@solana/spl-type-length-value': 0.1.0 - '@solana/web3.js': 1.95.5(bufferutil@4.0.8)(utf-8-validate@5.0.10) + '@solana/web3.js': 1.98.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) transitivePeerDependencies: - fastestsmallesttextencoderdecoder - typescript @@ -10948,11 +10975,11 @@ snapshots: transitivePeerDependencies: - fastestsmallesttextencoderdecoder - '@solana/spl-token-metadata@0.1.5(@solana/web3.js@1.95.5(bufferutil@4.0.8)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.2)': + '@solana/spl-token-metadata@0.1.5(@solana/web3.js@1.98.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.2)': dependencies: '@solana/codecs': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.2) '@solana/spl-type-length-value': 0.1.0 - '@solana/web3.js': 1.95.5(bufferutil@4.0.8)(utf-8-validate@5.0.10) + '@solana/web3.js': 1.98.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) transitivePeerDependencies: - fastestsmallesttextencoderdecoder - typescript @@ -10970,13 +10997,13 @@ snapshots: - fastestsmallesttextencoderdecoder - utf-8-validate - '@solana/spl-token@0.4.8(@solana/web3.js@1.95.5(bufferutil@4.0.8)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.2)(utf-8-validate@5.0.10)': + '@solana/spl-token@0.4.8(@solana/web3.js@1.98.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(bufferutil@4.0.8)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.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)(utf-8-validate@5.0.10) - '@solana/spl-token-group': 0.0.5(@solana/web3.js@1.95.5(bufferutil@4.0.8)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.2) - '@solana/spl-token-metadata': 0.1.5(@solana/web3.js@1.95.5(bufferutil@4.0.8)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.2) - '@solana/web3.js': 1.95.5(bufferutil@4.0.8)(utf-8-validate@5.0.10) + '@solana/spl-token-group': 0.0.5(@solana/web3.js@1.98.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.2) + '@solana/spl-token-metadata': 0.1.5(@solana/web3.js@1.98.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.2) + '@solana/web3.js': 1.98.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) buffer: 6.0.3 transitivePeerDependencies: - bufferutil