@lightprotocol/compressed-token 0.22.1-alpha.0 → 0.22.1-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { Signer, PublicKey, ConfirmOptions, TransactionSignature, Commitment, Keypair, AccountMeta, TransactionInstruction, Connection } from '@solana/web3.js';
2
2
  import { Rpc, TreeInfo, ParsedTokenAccount, PackedMerkleContextLegacy, CompressedCpiContext, ValidityProof, InputTokenDataWithContext as InputTokenDataWithContext$1, CompressedProof } from '@lightprotocol/stateless.js';
3
3
  import BN from 'bn.js';
4
- import { Buffer as Buffer$1 } from 'buffer';
4
+ import { Buffer } from 'buffer';
5
5
  import * as buffer_layout from 'buffer-layout';
6
6
 
7
7
  /**
@@ -504,7 +504,7 @@ type TokenTransferOutputData = {
504
504
  /**
505
505
  * TokenExtension tlv
506
506
  */
507
- tlv: Buffer$1 | null;
507
+ tlv: Buffer | null;
508
508
  };
509
509
  type PackedTokenTransferOutputData = {
510
510
  /**
@@ -526,7 +526,7 @@ type PackedTokenTransferOutputData = {
526
526
  /**
527
527
  * TokenExtension tlv
528
528
  */
529
- tlv: Buffer$1 | null;
529
+ tlv: Buffer | null;
530
530
  };
531
531
  type InputTokenDataWithContext = {
532
532
  amount: BN;
@@ -534,7 +534,7 @@ type InputTokenDataWithContext = {
534
534
  merkleContext: PackedMerkleContextLegacy;
535
535
  rootIndex: number;
536
536
  lamports: BN | null;
537
- tlv: Buffer$1 | null;
537
+ tlv: Buffer | null;
538
538
  };
539
539
  type DelegatedTransfer = {
540
540
  owner: PublicKey;
@@ -623,7 +623,7 @@ type TokenData = {
623
623
  /**
624
624
  * TokenExtension tlv
625
625
  */
626
- tlv: Buffer$1 | null;
626
+ tlv: Buffer | null;
627
627
  };
628
628
  type CompressedTokenInstructionDataApprove = {
629
629
  proof: ValidityProof | null;
@@ -680,17 +680,17 @@ declare function packCompressedTokenAccounts(params: PackCompressedTokenAccounts
680
680
  */
681
681
  declare function checkMint(compressedTokenAccounts: ParsedTokenAccount[], mint: PublicKey): boolean;
682
682
 
683
- declare const POOL_SEED: Buffer$1<ArrayBuffer>;
684
- declare const CPI_AUTHORITY_SEED: Buffer$1<ArrayBuffer>;
683
+ declare const POOL_SEED: Buffer<ArrayBuffer>;
684
+ declare const CPI_AUTHORITY_SEED: Buffer<ArrayBuffer>;
685
685
  declare const SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE = 1461600;
686
- declare const CREATE_TOKEN_POOL_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
687
- declare const MINT_TO_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
688
- declare const BATCH_COMPRESS_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
689
- declare const TRANSFER_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
690
- declare const COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
691
- declare const APPROVE_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
692
- declare const REVOKE_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
693
- declare const ADD_TOKEN_POOL_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
686
+ declare const CREATE_TOKEN_POOL_DISCRIMINATOR: Buffer<ArrayBuffer>;
687
+ declare const MINT_TO_DISCRIMINATOR: Buffer<ArrayBuffer>;
688
+ declare const BATCH_COMPRESS_DISCRIMINATOR: Buffer<ArrayBuffer>;
689
+ declare const TRANSFER_DISCRIMINATOR: Buffer<ArrayBuffer>;
690
+ declare const COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR: Buffer<ArrayBuffer>;
691
+ declare const APPROVE_DISCRIMINATOR: Buffer<ArrayBuffer>;
692
+ declare const REVOKE_DISCRIMINATOR: Buffer<ArrayBuffer>;
693
+ declare const ADD_TOKEN_POOL_DISCRIMINATOR: Buffer<ArrayBuffer>;
694
694
 
695
695
  type LightCompressedToken = {
696
696
  version: '1.2.0';
@@ -2532,14 +2532,14 @@ declare const CompressedTokenInstructionDataTransferLayout: buffer_layout.Layout
2532
2532
  declare const mintToLayout: buffer_layout.Layout<unknown>;
2533
2533
  declare const batchCompressLayout: buffer_layout.Layout<unknown>;
2534
2534
  declare const compressSplTokenAccountInstructionDataLayout: buffer_layout.Layout<unknown>;
2535
- declare function encodeMintToInstructionData(data: MintToInstructionData): Buffer$1;
2536
- declare function decodeMintToInstructionData(buffer: Buffer$1): MintToInstructionData;
2537
- declare function encodeBatchCompressInstructionData(data: BatchCompressInstructionData): Buffer$1;
2538
- declare function decodeBatchCompressInstructionData(buffer: Buffer$1): BatchCompressInstructionData;
2539
- declare function encodeCompressSplTokenAccountInstructionData(data: CompressSplTokenAccountInstructionData): Buffer$1;
2540
- declare function decodeCompressSplTokenAccountInstructionData(buffer: Buffer$1): CompressSplTokenAccountInstructionData;
2541
- declare function encodeTransferInstructionData(data: CompressedTokenInstructionDataTransfer): Buffer$1;
2542
- declare function decodeTransferInstructionData(buffer: Buffer$1): CompressedTokenInstructionDataTransfer;
2535
+ declare function encodeMintToInstructionData(data: MintToInstructionData): Buffer;
2536
+ declare function decodeMintToInstructionData(buffer: Buffer): MintToInstructionData;
2537
+ declare function encodeBatchCompressInstructionData(data: BatchCompressInstructionData): Buffer;
2538
+ declare function decodeBatchCompressInstructionData(buffer: Buffer): BatchCompressInstructionData;
2539
+ declare function encodeCompressSplTokenAccountInstructionData(data: CompressSplTokenAccountInstructionData): Buffer;
2540
+ declare function decodeCompressSplTokenAccountInstructionData(buffer: Buffer): CompressSplTokenAccountInstructionData;
2541
+ declare function encodeTransferInstructionData(data: CompressedTokenInstructionDataTransfer): Buffer;
2542
+ declare function decodeTransferInstructionData(buffer: Buffer): CompressedTokenInstructionDataTransfer;
2543
2543
  interface BaseAccountsLayoutParams {
2544
2544
  feePayer: PublicKey;
2545
2545
  authority: PublicKey;
@@ -2591,10 +2591,10 @@ declare const freezeAccountsLayout: (accounts: freezeAccountsLayoutParams) => Ac
2591
2591
  declare const thawAccountsLayout: (accounts: freezeAccountsLayoutParams) => AccountMeta[];
2592
2592
  declare const CompressedTokenInstructionDataApproveLayout: buffer_layout.Layout<unknown>;
2593
2593
  declare const CompressedTokenInstructionDataRevokeLayout: buffer_layout.Layout<unknown>;
2594
- declare function encodeApproveInstructionData(data: CompressedTokenInstructionDataApprove): Buffer$1;
2595
- declare function decodeApproveInstructionData(buffer: Buffer$1): CompressedTokenInstructionDataApprove;
2596
- declare function encodeRevokeInstructionData(data: CompressedTokenInstructionDataRevoke): Buffer$1;
2597
- declare function decodeRevokeInstructionData(buffer: Buffer$1): CompressedTokenInstructionDataRevoke;
2594
+ declare function encodeApproveInstructionData(data: CompressedTokenInstructionDataApprove): Buffer;
2595
+ declare function decodeApproveInstructionData(buffer: Buffer): CompressedTokenInstructionDataApprove;
2596
+ declare function encodeRevokeInstructionData(data: CompressedTokenInstructionDataRevoke): Buffer;
2597
+ declare function decodeRevokeInstructionData(buffer: Buffer): CompressedTokenInstructionDataRevoke;
2598
2598
 
2599
2599
  type CompressParams = {
2600
2600
  /**
@@ -3233,18 +3233,4 @@ declare class CompressedTokenProgram {
3233
3233
  static revoke({ payer, inputCompressedTokenAccounts, recentValidityProof, recentInputStateRootIndices, }: RevokeParams): Promise<TransactionInstruction>;
3234
3234
  }
3235
3235
 
3236
- /**
3237
- * Returns the compressed mint address as a Array (32 bytes).
3238
- */
3239
- declare function deriveCompressedMintAddress(mintSeed: PublicKey, addressTreeInfo: TreeInfo): number[];
3240
- declare const COMPRESSED_MINT_SEED: Buffer<ArrayBuffer>;
3241
- /**
3242
- * Finds the SPL mint PDA for a compressed mint.
3243
- * @param mintSeed The mint seed public key.
3244
- * @returns [PDA, bump]
3245
- */
3246
- declare function findMintAddress(mintSigner: PublicKey): [PublicKey, number];
3247
- declare function getAssociatedCTokenAddressAndBump(owner: PublicKey, mint: PublicKey): [PublicKey, number];
3248
- declare function getAssociatedCTokenAddress(owner: PublicKey, mint: PublicKey): PublicKey;
3249
-
3250
- export { ADD_TOKEN_POOL_DISCRIMINATOR, APPROVE_DISCRIMINATOR, Action, type AddTokenPoolParams, type ApproveAndMintToParams, type ApproveParams, BATCH_COMPRESS_DISCRIMINATOR, type BatchCompressInstructionData, COMPRESSED_MINT_SEED, COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR, CPI_AUTHORITY_SEED, CREATE_TOKEN_POOL_DISCRIMINATOR, type CompressParams, type CompressSplTokenAccountInstructionData, type CompressSplTokenAccountParams, type CompressedTokenInstructionDataApprove, CompressedTokenInstructionDataApproveLayout, type CompressedTokenInstructionDataRevoke, CompressedTokenInstructionDataRevokeLayout, type CompressedTokenInstructionDataTransfer, CompressedTokenInstructionDataTransferLayout, CompressedTokenProgram, CpiContextLayout, type CreateMintParams, type CreateTokenPoolParams, type CreateTokenProgramLookupTableParams, type DecompressParams, type DelegatedTransfer, DelegatedTransferLayout, ERROR_NO_ACCOUNTS_FOUND, IDL, type InputTokenDataWithContext, type LightCompressedToken, MINT_TO_DISCRIMINATOR, type MergeTokenAccountsParams, type MintToInstructionData, type MintToParams, POOL_SEED, type PackCompressedTokenAccountsParams, type PackedTokenTransferOutputData, REVOKE_DISCRIMINATOR, type RevokeParams, SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE, TRANSFER_DISCRIMINATOR, type TokenData, type TokenPoolActivity, type TokenPoolInfo, type TokenTransferOutputData, type TransferParams, addTokenPoolAccountsLayout, type addTokenPoolAccountsLayoutParams, addTokenPools, approve, approveAccountsLayout, type approveAccountsLayoutParams, approveAndMintTo, batchCompressLayout, checkMint, checkTokenPoolInfo, compress, compressSplTokenAccount, compressSplTokenAccountInstructionDataLayout, createDecompressOutputState, createMint, createTokenPool, createTokenPoolAccountsLayout, type createTokenPoolAccountsLayoutParams, createTokenProgramLookupTable, createTransferOutputState, decodeApproveInstructionData, decodeBatchCompressInstructionData, decodeCompressSplTokenAccountInstructionData, decodeMintToInstructionData, decodeRevokeInstructionData, decodeTransferInstructionData, decompress, decompressDelegated, deriveCompressedMintAddress, encodeApproveInstructionData, encodeBatchCompressInstructionData, encodeCompressSplTokenAccountInstructionData, encodeMintToInstructionData, encodeRevokeInstructionData, encodeTransferInstructionData, findMintAddress, freezeAccountsLayout, type freezeAccountsLayoutParams, getAssociatedCTokenAddress, getAssociatedCTokenAddressAndBump, getTokenPoolInfos, isSingleTokenPoolInfo, mergeTokenAccounts, mintTo, mintToAccountsLayout, type mintToAccountsLayoutParams, mintToLayout, packCompressedTokenAccounts, parseMaybeDelegatedTransfer, parseTokenData, revoke, revokeAccountsLayout, type revokeAccountsLayoutParams, selectMinCompressedTokenAccountsForDecompression, selectMinCompressedTokenAccountsForTransfer, selectMinCompressedTokenAccountsForTransferOrPartial, selectSmartCompressedTokenAccountsForTransfer, selectSmartCompressedTokenAccountsForTransferOrPartial, selectTokenAccountsForApprove, selectTokenPoolInfo, selectTokenPoolInfosForDecompression, sumUpTokenAmount, thawAccountsLayout, type thawAccountsLayoutParams, transfer, transferAccountsLayout, type transferAccountsLayoutParams, transferDelegated, validateSameTokenOwner };
3236
+ export { ADD_TOKEN_POOL_DISCRIMINATOR, APPROVE_DISCRIMINATOR, Action, type AddTokenPoolParams, type ApproveAndMintToParams, type ApproveParams, BATCH_COMPRESS_DISCRIMINATOR, type BatchCompressInstructionData, COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR, CPI_AUTHORITY_SEED, CREATE_TOKEN_POOL_DISCRIMINATOR, type CompressParams, type CompressSplTokenAccountInstructionData, type CompressSplTokenAccountParams, type CompressedTokenInstructionDataApprove, CompressedTokenInstructionDataApproveLayout, type CompressedTokenInstructionDataRevoke, CompressedTokenInstructionDataRevokeLayout, type CompressedTokenInstructionDataTransfer, CompressedTokenInstructionDataTransferLayout, CompressedTokenProgram, CpiContextLayout, type CreateMintParams, type CreateTokenPoolParams, type CreateTokenProgramLookupTableParams, type DecompressParams, type DelegatedTransfer, DelegatedTransferLayout, ERROR_NO_ACCOUNTS_FOUND, IDL, type InputTokenDataWithContext, type LightCompressedToken, MINT_TO_DISCRIMINATOR, type MergeTokenAccountsParams, type MintToInstructionData, type MintToParams, POOL_SEED, type PackCompressedTokenAccountsParams, type PackedTokenTransferOutputData, REVOKE_DISCRIMINATOR, type RevokeParams, SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE, TRANSFER_DISCRIMINATOR, type TokenData, type TokenPoolActivity, type TokenPoolInfo, type TokenTransferOutputData, type TransferParams, addTokenPoolAccountsLayout, type addTokenPoolAccountsLayoutParams, addTokenPools, approve, approveAccountsLayout, type approveAccountsLayoutParams, approveAndMintTo, batchCompressLayout, checkMint, checkTokenPoolInfo, compress, compressSplTokenAccount, compressSplTokenAccountInstructionDataLayout, createDecompressOutputState, createMint, createTokenPool, createTokenPoolAccountsLayout, type createTokenPoolAccountsLayoutParams, createTokenProgramLookupTable, createTransferOutputState, decodeApproveInstructionData, decodeBatchCompressInstructionData, decodeCompressSplTokenAccountInstructionData, decodeMintToInstructionData, decodeRevokeInstructionData, decodeTransferInstructionData, decompress, decompressDelegated, encodeApproveInstructionData, encodeBatchCompressInstructionData, encodeCompressSplTokenAccountInstructionData, encodeMintToInstructionData, encodeRevokeInstructionData, encodeTransferInstructionData, freezeAccountsLayout, type freezeAccountsLayoutParams, getTokenPoolInfos, isSingleTokenPoolInfo, mergeTokenAccounts, mintTo, mintToAccountsLayout, type mintToAccountsLayoutParams, mintToLayout, packCompressedTokenAccounts, parseMaybeDelegatedTransfer, parseTokenData, revoke, revokeAccountsLayout, type revokeAccountsLayoutParams, selectMinCompressedTokenAccountsForDecompression, selectMinCompressedTokenAccountsForTransfer, selectMinCompressedTokenAccountsForTransferOrPartial, selectSmartCompressedTokenAccountsForTransfer, selectSmartCompressedTokenAccountsForTransferOrPartial, selectTokenAccountsForApprove, selectTokenPoolInfo, selectTokenPoolInfosForDecompression, sumUpTokenAmount, thawAccountsLayout, type thawAccountsLayoutParams, transfer, transferAccountsLayout, type transferAccountsLayoutParams, transferDelegated, validateSameTokenOwner };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightprotocol/compressed-token",
3
- "version": "0.22.1-alpha.0",
3
+ "version": "0.22.1-alpha.2",
4
4
  "description": "JS client to interact with the compressed-token program",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/node/index.cjs",
@@ -31,7 +31,7 @@
31
31
  "peerDependencies": {
32
32
  "@solana/spl-token": ">=0.3.9",
33
33
  "@solana/web3.js": ">=1.73.5",
34
- "@lightprotocol/stateless.js": "0.22.1-alpha.0"
34
+ "@lightprotocol/stateless.js": "0.22.1-alpha.1"
35
35
  },
36
36
  "dependencies": {
37
37
  "@coral-xyz/borsh": "^0.29.0",
@@ -41,6 +41,7 @@
41
41
  "devDependencies": {
42
42
  "@coral-xyz/anchor": "^0.29.0",
43
43
  "@esbuild-plugins/node-globals-polyfill": "^0.2.3",
44
+ "@eslint/js": "9.36.0",
44
45
  "@lightprotocol/hasher.rs": "0.2.1",
45
46
  "@rollup/plugin-alias": "^5.1.0",
46
47
  "@rollup/plugin-babel": "^6.0.4",
@@ -51,14 +52,14 @@
51
52
  "@rollup/plugin-terser": "^0.4.4",
52
53
  "@rollup/plugin-typescript": "^11.1.6",
53
54
  "@solana/spl-token": "0.4.8",
54
- "@solana/web3.js": "1.98.0",
55
+ "@solana/web3.js": "1.98.4",
55
56
  "@types/bn.js": "^5.1.5",
56
57
  "@types/node": "^22.5.5",
57
- "@typescript-eslint/eslint-plugin": "^7.13.1",
58
- "@typescript-eslint/parser": "^7.13.1",
58
+ "@typescript-eslint/eslint-plugin": "^8.44.0",
59
+ "@typescript-eslint/parser": "^8.44.0",
59
60
  "add": "^2.0.6",
60
61
  "crypto-browserify": "^3.12.0",
61
- "eslint": "^8.56.0",
62
+ "eslint": "^9.36.0",
62
63
  "eslint-plugin-import": "^2.30.0",
63
64
  "eslint-plugin-n": "^17.10.2",
64
65
  "eslint-plugin-promise": "^7.1.0",
@@ -73,8 +74,7 @@
73
74
  "ts-node": "^10.9.2",
74
75
  "tslib": "^2.7.0",
75
76
  "typescript": "^5.6.2",
76
- "vitest": "^2.1.1",
77
- "@lightprotocol/programs": "0.3.0"
77
+ "vitest": "^2.1.1"
78
78
  },
79
79
  "keywords": [
80
80
  "zk",
@@ -91,6 +91,16 @@
91
91
  "{workspaceRoot}/target/idl",
92
92
  "{workspaceRoot}/target/types"
93
93
  ]
94
+ },
95
+ "build-ci": {
96
+ "dependsOn": [
97
+ "@lightprotocol/stateless.js:build-ci"
98
+ ]
99
+ },
100
+ "test-ci": {
101
+ "dependsOn": [
102
+ "@lightprotocol/stateless.js:test-ci"
103
+ ]
94
104
  }
95
105
  }
96
106
  },
@@ -130,6 +140,8 @@
130
140
  "build:v2": "LIGHT_PROTOCOL_VERSION=V2 pnpm build:stateless:v2 && LIGHT_PROTOCOL_VERSION=V2 pnpm build:bundle",
131
141
  "build:stateless:v1": "cd ../stateless.js && pnpm build:v1",
132
142
  "build:stateless:v2": "cd ../stateless.js && pnpm build:v2",
143
+ "build-ci": "if [ \"$LIGHT_PROTOCOL_VERSION\" = \"V2\" ]; then LIGHT_PROTOCOL_VERSION=V2 pnpm build:bundle; else LIGHT_PROTOCOL_VERSION=V1 pnpm build:bundle; fi",
144
+ "test-ci": "pnpm test",
133
145
  "format": "prettier --write .",
134
146
  "lint": "eslint ."
135
147
  }