@lightprotocol/compressed-token 0.22.0 → 0.22.1-alpha.0
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.
package/dist/types/index.d.ts
CHANGED
|
@@ -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 } from 'buffer';
|
|
4
|
+
import { Buffer as Buffer$1 } 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 | null;
|
|
507
|
+
tlv: Buffer$1 | 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 | null;
|
|
529
|
+
tlv: Buffer$1 | 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 | null;
|
|
537
|
+
tlv: Buffer$1 | 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 | null;
|
|
626
|
+
tlv: Buffer$1 | 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
|
|
684
|
-
declare const CPI_AUTHORITY_SEED: Buffer
|
|
683
|
+
declare const POOL_SEED: Buffer$1<ArrayBuffer>;
|
|
684
|
+
declare const CPI_AUTHORITY_SEED: Buffer$1<ArrayBuffer>;
|
|
685
685
|
declare const SPL_TOKEN_MINT_RENT_EXEMPT_BALANCE = 1461600;
|
|
686
|
-
declare const CREATE_TOKEN_POOL_DISCRIMINATOR: Buffer
|
|
687
|
-
declare const MINT_TO_DISCRIMINATOR: Buffer
|
|
688
|
-
declare const BATCH_COMPRESS_DISCRIMINATOR: Buffer
|
|
689
|
-
declare const TRANSFER_DISCRIMINATOR: Buffer
|
|
690
|
-
declare const COMPRESS_SPL_TOKEN_ACCOUNT_DISCRIMINATOR: Buffer
|
|
691
|
-
declare const APPROVE_DISCRIMINATOR: Buffer
|
|
692
|
-
declare const REVOKE_DISCRIMINATOR: Buffer
|
|
693
|
-
declare const ADD_TOKEN_POOL_DISCRIMINATOR: Buffer
|
|
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>;
|
|
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;
|
|
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;
|
|
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;
|
|
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;
|
|
2595
|
-
declare function decodeApproveInstructionData(buffer: Buffer): CompressedTokenInstructionDataApprove;
|
|
2596
|
-
declare function encodeRevokeInstructionData(data: CompressedTokenInstructionDataRevoke): Buffer;
|
|
2597
|
-
declare function decodeRevokeInstructionData(buffer: Buffer): CompressedTokenInstructionDataRevoke;
|
|
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;
|
|
2598
2598
|
|
|
2599
2599
|
type CompressParams = {
|
|
2600
2600
|
/**
|
|
@@ -3233,4 +3233,18 @@ declare class CompressedTokenProgram {
|
|
|
3233
3233
|
static revoke({ payer, inputCompressedTokenAccounts, recentValidityProof, recentInputStateRootIndices, }: RevokeParams): Promise<TransactionInstruction>;
|
|
3234
3234
|
}
|
|
3235
3235
|
|
|
3236
|
-
|
|
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightprotocol/compressed-token",
|
|
3
|
-
"version": "0.22.0",
|
|
3
|
+
"version": "0.22.1-alpha.0",
|
|
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.0"
|
|
34
|
+
"@lightprotocol/stateless.js": "0.22.1-alpha.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@coral-xyz/borsh": "^0.29.0",
|