@lightprotocol/compressed-token 0.15.2 → 0.15.3

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.
@@ -1872,6 +1872,32 @@ type CompressParams = {
1872
1872
  */
1873
1873
  outputStateTree?: PublicKey;
1874
1874
  };
1875
+ type CompressSplTokenAccountParams = {
1876
+ /**
1877
+ * Tx feepayer
1878
+ */
1879
+ feePayer: PublicKey;
1880
+ /**
1881
+ * Authority that owns the token account
1882
+ */
1883
+ authority: PublicKey;
1884
+ /**
1885
+ * Token account to compress
1886
+ */
1887
+ tokenAccount: PublicKey;
1888
+ /**
1889
+ * Mint public key
1890
+ */
1891
+ mint: PublicKey;
1892
+ /**
1893
+ * Optional: remaining amount to leave in token account. Default: 0
1894
+ */
1895
+ remainingAmount?: BN;
1896
+ /**
1897
+ * The state tree that the compressed token account should be inserted into.
1898
+ */
1899
+ outputStateTree: PublicKey;
1900
+ };
1875
1901
  type DecompressParams = {
1876
1902
  /**
1877
1903
  * The payer of the transaction.
@@ -2131,32 +2157,6 @@ declare function createTransferOutputState(inputCompressedTokenAccounts: ParsedT
2131
2157
  * instruction
2132
2158
  */
2133
2159
  declare function createDecompressOutputState(inputCompressedTokenAccounts: ParsedTokenAccount[], amount: number | BN): TokenTransferOutputData$1[];
2134
- type CompressSplTokenAccountParams = {
2135
- /**
2136
- * Tx feepayer
2137
- */
2138
- feePayer: PublicKey;
2139
- /**
2140
- * Authority that owns the token account
2141
- */
2142
- authority: PublicKey;
2143
- /**
2144
- * Token account to compress
2145
- */
2146
- tokenAccount: PublicKey;
2147
- /**
2148
- * Mint public key
2149
- */
2150
- mint: PublicKey;
2151
- /**
2152
- * Optional: remaining amount to leave in token account. Default: 0
2153
- */
2154
- remainingAmount?: BN;
2155
- /**
2156
- * The state tree that the compressed token account should be inserted into.
2157
- */
2158
- outputStateTree: PublicKey;
2159
- };
2160
2160
  declare class CompressedTokenProgram {
2161
2161
  /**
2162
2162
  * @internal
@@ -2166,6 +2166,13 @@ declare class CompressedTokenProgram {
2166
2166
  * Public key that identifies the CompressedPda program
2167
2167
  */
2168
2168
  static programId: PublicKey;
2169
+ /**
2170
+ * Set a custom programId via PublicKey or base58 encoded string.
2171
+ * This method is not required for regular usage.
2172
+ *
2173
+ * Use this only if you know what you are doing.
2174
+ */
2175
+ static setProgramId(programId: PublicKey | string): void;
2169
2176
  private static _program;
2170
2177
  /** @internal */
2171
2178
  static get program(): Program<LightCompressedToken>;
@@ -2405,4 +2412,4 @@ declare function createTokenProgramLookupTable(rpc: Rpc, payer: Signer, authorit
2405
2412
  */
2406
2413
  declare function compressSplTokenAccount(rpc: Rpc, payer: Signer, mint: PublicKey, owner: Signer, tokenAccount: PublicKey, outputStateTree: PublicKey, remainingAmount?: BN, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
2407
2414
 
2408
- export { type ApproveAndMintToParams, CPI_AUTHORITY_SEED, type CompressSplTokenAccountParams, type CompressedTokenInstructionDataInvoke, CompressedTokenProgram, type CreateMintParams, type CreateTokenProgramLookupTableParams, IDL, type InputTokenDataWithContext, type LightCompressedToken, type MergeTokenAccountsParams, type MintToParams, POOL_SEED, type PackCompressedTokenAccountsParams, type PackedTokenTransferOutputData, type RegisterMintParams, SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE, type TokenData, type TokenTransferOutputData, type TransferParams, approveAndMintTo, compress, compressSplTokenAccount, createDecompressOutputState, createMint, createTokenPool, createTokenProgramLookupTable, createTransferOutputState, decompress, mergeTokenAccounts, mintTo, packCompressedTokenAccounts, parseTokenData, selectMinCompressedTokenAccountsForTransfer, sumUpTokenAmount, transfer, validateSameTokenOwner };
2415
+ export { type ApproveAndMintToParams, CPI_AUTHORITY_SEED, type CompressParams, type CompressSplTokenAccountParams, type CompressedTokenInstructionDataInvoke, CompressedTokenProgram, type CreateMintParams, type CreateTokenProgramLookupTableParams, type DecompressParams, IDL, type InputTokenDataWithContext, type LightCompressedToken, type MergeTokenAccountsParams, type MintToParams, POOL_SEED, type PackCompressedTokenAccountsParams, type PackedTokenTransferOutputData, type RegisterMintParams, SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE, type TokenData, type TokenTransferOutputData, type TransferParams, approveAndMintTo, compress, compressSplTokenAccount, createDecompressOutputState, createMint, createTokenPool, createTokenProgramLookupTable, createTransferOutputState, decompress, mergeTokenAccounts, mintTo, packCompressedTokenAccounts, parseTokenData, selectMinCompressedTokenAccountsForTransfer, sumUpTokenAmount, transfer, validateSameTokenOwner };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightprotocol/compressed-token",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "description": "JS client to interact with the compressed-token program",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/node/index.cjs",
@@ -36,7 +36,7 @@
36
36
  ],
37
37
  "license": "Apache-2.0",
38
38
  "peerDependencies": {
39
- "@lightprotocol/stateless.js": "0.15.1"
39
+ "@lightprotocol/stateless.js": "0.15.2"
40
40
  },
41
41
  "dependencies": {
42
42
  "@coral-xyz/anchor": "0.29.0",
@@ -76,8 +76,8 @@
76
76
  "tslib": "^2.7.0",
77
77
  "typescript": "^5.6.2",
78
78
  "vitest": "^2.1.1",
79
- "@lightprotocol/hasher.rs": "0.2.0",
80
- "@lightprotocol/programs": "0.3.0"
79
+ "@lightprotocol/programs": "0.3.0",
80
+ "@lightprotocol/hasher.rs": "0.2.0"
81
81
  },
82
82
  "nx": {
83
83
  "targets": {
@@ -106,7 +106,8 @@
106
106
  "test:e2e:compress-spl-token-account": "pnpm test-validator && vitest run tests/e2e/compress-spl-token-account.test.ts --reporter=verbose",
107
107
  "test:e2e:decompress": "pnpm test-validator && vitest run tests/e2e/decompress.test.ts --reporter=verbose",
108
108
  "test:e2e:rpc-token-interop": "pnpm test-validator && vitest run tests/e2e/rpc-token-interop.test.ts --reporter=verbose",
109
- "test:e2e:all": "pnpm test-validator && vitest run tests/e2e/create-mint.test.ts && vitest run tests/e2e/mint-to.test.ts && vitest run tests/e2e/transfer.test.ts && vitest run tests/e2e/compress.test.ts && vitest run tests/e2e/compress-spl-token-account.test.ts && vitest run tests/e2e/decompress.test.ts && vitest run tests/e2e/create-token-pool.test.ts && vitest run tests/e2e/approve-and-mint-to.test.ts && vitest run tests/e2e/rpc-token-interop.test.ts",
109
+ "test:e2e:custom-program-id": "vitest run tests/e2e/custom-program-id.test.ts --reporter=verbose",
110
+ "test:e2e:all": "pnpm test-validator && vitest run tests/e2e/create-mint.test.ts && vitest run tests/e2e/mint-to.test.ts && vitest run tests/e2e/transfer.test.ts && vitest run tests/e2e/compress.test.ts && vitest run tests/e2e/compress-spl-token-account.test.ts && vitest run tests/e2e/decompress.test.ts && vitest run tests/e2e/create-token-pool.test.ts && vitest run tests/e2e/approve-and-mint-to.test.ts && vitest run tests/e2e/rpc-token-interop.test.ts && vitest run tests/e2e/custom-program-id.test.ts",
110
111
  "pull-idl": "../../scripts/push-compressed-token-idl.sh",
111
112
  "build": "rimraf dist && pnpm pull-idl && pnpm build:bundle",
112
113
  "build:bundle": "rollup -c",