@lightprotocol/stateless.js 0.22.1-alpha.1 → 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.
- package/README.md +4 -1
- package/dist/cjs/browser/constants.d.ts +22 -3
- package/dist/cjs/browser/index.cjs +1 -1
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/browser/rpc-interface.d.ts +96 -2
- package/dist/cjs/browser/rpc.d.ts +80 -3
- package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +0 -2
- package/dist/cjs/browser/test-helpers/test-rpc/test-rpc.d.ts +6 -0
- package/dist/cjs/browser/utils/get-state-tree-infos.d.ts +15 -0
- package/dist/cjs/browser/utils/index.d.ts +1 -0
- package/dist/cjs/browser/utils/pack-decompress.d.ts +31 -0
- package/dist/cjs/node/constants.d.ts +22 -3
- package/dist/cjs/node/index.cjs +1 -1
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/cjs/node/rpc-interface.d.ts +96 -2
- package/dist/cjs/node/rpc.d.ts +80 -3
- package/dist/cjs/node/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +0 -2
- package/dist/cjs/node/test-helpers/test-rpc/test-rpc.d.ts +6 -0
- package/dist/cjs/node/utils/get-state-tree-infos.d.ts +15 -0
- package/dist/cjs/node/utils/index.d.ts +1 -0
- package/dist/cjs/node/utils/pack-decompress.d.ts +31 -0
- package/dist/es/browser/constants.d.ts +22 -3
- package/dist/es/browser/index.js +1 -1
- package/dist/es/browser/index.js.map +1 -1
- package/dist/es/browser/rpc-interface.d.ts +96 -2
- package/dist/es/browser/rpc.d.ts +80 -3
- package/dist/es/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +0 -2
- package/dist/es/browser/test-helpers/test-rpc/test-rpc.d.ts +6 -0
- package/dist/es/browser/utils/get-state-tree-infos.d.ts +15 -0
- package/dist/es/browser/utils/index.d.ts +1 -0
- package/dist/es/browser/utils/pack-decompress.d.ts +31 -0
- package/dist/types/index.d.ts +243 -6
- package/package.json +4 -4
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
|
-
import { PublicKey, Connection, Commitment, Keypair, Signer, AccountMeta, TransactionInstruction, AddressLookupTableAccount, VersionedTransaction, ConfirmOptions, TransactionSignature, RpcResponseAndContext, SignatureResult, DataSlice, MemcmpFilter, ConnectionConfig, ParsedTransactionWithMeta } from '@solana/web3.js';
|
|
2
|
+
import { PublicKey, Connection, Commitment, Keypair, Signer, AccountMeta, TransactionInstruction, AddressLookupTableAccount, VersionedTransaction, ConfirmOptions, TransactionSignature, RpcResponseAndContext, SignatureResult, DataSlice, MemcmpFilter, GetAccountInfoConfig, AccountInfo, SignaturesForAddressOptions, ConfirmedSignatureInfo, TokenAmount, ConnectionConfig, ParsedTransactionWithMeta } from '@solana/web3.js';
|
|
3
3
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
4
4
|
import { Struct } from 'superstruct';
|
|
5
5
|
import BN from 'bn.js';
|
|
@@ -379,10 +379,24 @@ declare const isLocalTest: (url: string) => boolean;
|
|
|
379
379
|
* @internal
|
|
380
380
|
*/
|
|
381
381
|
declare const localTestActiveStateTreeInfos: () => TreeInfo[];
|
|
382
|
+
declare const getDefaultAddressSpace: () => {
|
|
383
|
+
tree: PublicKey;
|
|
384
|
+
queue: PublicKey;
|
|
385
|
+
cpiContext: undefined;
|
|
386
|
+
treeType: TreeType;
|
|
387
|
+
nextTreeInfo: null;
|
|
388
|
+
};
|
|
382
389
|
declare const getDefaultAddressTreeInfo: () => {
|
|
383
390
|
tree: PublicKey;
|
|
384
391
|
queue: PublicKey;
|
|
385
|
-
cpiContext:
|
|
392
|
+
cpiContext: undefined;
|
|
393
|
+
treeType: TreeType;
|
|
394
|
+
nextTreeInfo: null;
|
|
395
|
+
};
|
|
396
|
+
declare const getBatchAddressTreeInfo: () => {
|
|
397
|
+
tree: PublicKey;
|
|
398
|
+
queue: PublicKey;
|
|
399
|
+
cpiContext: undefined;
|
|
386
400
|
treeType: TreeType;
|
|
387
401
|
nextTreeInfo: null;
|
|
388
402
|
};
|
|
@@ -407,6 +421,7 @@ declare const defaultTestStateTreeAccounts2: () => {
|
|
|
407
421
|
merkleTree2: PublicKey;
|
|
408
422
|
};
|
|
409
423
|
declare const COMPRESSED_TOKEN_PROGRAM_ID: PublicKey;
|
|
424
|
+
declare const CTOKEN_PROGRAM_ID: PublicKey;
|
|
410
425
|
declare const stateTreeLookupTableMainnet = "7i86eQs3GSqHjN47WdWLTCGMW6gde1q96G2EVnUyK2st";
|
|
411
426
|
declare const nullifiedStateTreeLookupTableMainnet = "H9QD4u1fG7KmkAzn2tDXhheushxFe1EcrjGGyEFXeMqT";
|
|
412
427
|
declare const stateTreeLookupTableDevnet = "Dk9mNkbiZXJZ4By8DfSP6HEE4ojZzRvucwpawLeuwq8q";
|
|
@@ -470,10 +485,28 @@ declare const ADDRESS_QUEUE_ROLLOVER_FEE: BN;
|
|
|
470
485
|
*/
|
|
471
486
|
declare const STATE_MERKLE_TREE_NETWORK_FEE: BN;
|
|
472
487
|
/**
|
|
473
|
-
* Is charged
|
|
488
|
+
* Is charged per address the transaction creates.
|
|
474
489
|
*/
|
|
475
|
-
declare const
|
|
490
|
+
declare const ADDRESS_TREE_NETWORK_FEE_V1: BN;
|
|
491
|
+
/**
|
|
492
|
+
* Is charged per address the transaction creates.
|
|
493
|
+
*/
|
|
494
|
+
declare const ADDRESS_TREE_NETWORK_FEE_V2: BN;
|
|
476
495
|
|
|
496
|
+
/**
|
|
497
|
+
* Get the currently active output queue from a merkle context.
|
|
498
|
+
*
|
|
499
|
+
* @param merkleContext The merkle context to get the output queue from
|
|
500
|
+
* @returns The output queue public key
|
|
501
|
+
*/
|
|
502
|
+
declare function getOutputQueue(merkleContext: MerkleContext): PublicKey;
|
|
503
|
+
/**
|
|
504
|
+
* Get the currently active output tree info from a merkle context.
|
|
505
|
+
*
|
|
506
|
+
* @param merkleContext The merkle context to get the output tree info from
|
|
507
|
+
* @returns The output tree info
|
|
508
|
+
*/
|
|
509
|
+
declare function getOutputTreeInfo(merkleContext: MerkleContext): TreeInfo;
|
|
477
510
|
/**
|
|
478
511
|
* @deprecated use {@link getTreeInfoByPubkey} instead
|
|
479
512
|
*/
|
|
@@ -520,6 +553,35 @@ declare function getAllStateTreeInfos({ connection, stateTreeLUTPairs, }: {
|
|
|
520
553
|
stateTreeLUTPairs: StateTreeLUTPair[];
|
|
521
554
|
}): Promise<TreeInfo[]>;
|
|
522
555
|
|
|
556
|
+
interface AccountDataWithTreeInfo {
|
|
557
|
+
key: string;
|
|
558
|
+
data: any;
|
|
559
|
+
treeInfo: TreeInfo;
|
|
560
|
+
}
|
|
561
|
+
interface PackedDecompressResult {
|
|
562
|
+
proofOption: {
|
|
563
|
+
0: ValidityProof | null;
|
|
564
|
+
};
|
|
565
|
+
compressedAccounts: any[];
|
|
566
|
+
systemAccountsOffset: number;
|
|
567
|
+
remainingAccounts: AccountMeta[];
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* Pack accounts and proof for decompressAccountsIdempotent instruction.
|
|
571
|
+
* This function prepares compressed account data, validity proof, and remaining accounts
|
|
572
|
+
* for idempotent decompression operations.
|
|
573
|
+
*
|
|
574
|
+
* @param programId - The program ID
|
|
575
|
+
* @param proof - The validity proof with context
|
|
576
|
+
* @param accountsData - Array of account data with tree info
|
|
577
|
+
* @param addresses - Array of account addresses
|
|
578
|
+
* @returns Packed instruction parameters
|
|
579
|
+
*/
|
|
580
|
+
declare function packDecompressAccountsIdempotent(programId: PublicKey, proof: {
|
|
581
|
+
compressedProof: ValidityProof | null;
|
|
582
|
+
treeInfos: TreeInfo[];
|
|
583
|
+
}, accountsData: AccountDataWithTreeInfo[], addresses: PublicKey[]): Promise<PackedDecompressResult>;
|
|
584
|
+
|
|
523
585
|
declare enum TreeType {
|
|
524
586
|
/**
|
|
525
587
|
* v1 state merkle tree
|
|
@@ -1248,6 +1310,14 @@ interface AddressWithTreeInfo {
|
|
|
1248
1310
|
address: BN254;
|
|
1249
1311
|
treeInfo: AddressTreeInfo;
|
|
1250
1312
|
}
|
|
1313
|
+
interface AddressWithTreeInfoV2 {
|
|
1314
|
+
address: Uint8Array;
|
|
1315
|
+
treeInfo: TreeInfo;
|
|
1316
|
+
}
|
|
1317
|
+
declare enum DerivationMode {
|
|
1318
|
+
compressible = "compressible",
|
|
1319
|
+
standard = "standard"
|
|
1320
|
+
}
|
|
1251
1321
|
interface CompressedTransaction {
|
|
1252
1322
|
compressionInfo: {
|
|
1253
1323
|
closedAccounts: {
|
|
@@ -3926,6 +3996,15 @@ interface CompressionApiInterface {
|
|
|
3926
3996
|
getLatestCompressionSignatures(cursor?: string, limit?: number): Promise<LatestNonVotingSignaturesPaginated>;
|
|
3927
3997
|
getIndexerHealth(): Promise<string>;
|
|
3928
3998
|
getIndexerSlot(): Promise<number>;
|
|
3999
|
+
getAccountInfoInterface(address: PublicKey, programId: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig, addressSpace?: TreeInfo): Promise<{
|
|
4000
|
+
accountInfo: AccountInfo<Buffer>;
|
|
4001
|
+
isCold: boolean;
|
|
4002
|
+
loadContext?: MerkleContext;
|
|
4003
|
+
} | null>;
|
|
4004
|
+
getSignaturesForAddressInterface(address: PublicKey, options?: SignaturesForAddressOptions, compressedOptions?: PaginatedOptions): Promise<SignaturesForAddressInterfaceResult>;
|
|
4005
|
+
getSignaturesForOwnerInterface(owner: PublicKey, options?: SignaturesForAddressOptions, compressedOptions?: PaginatedOptions): Promise<SignaturesForAddressInterfaceResult>;
|
|
4006
|
+
getTokenAccountBalanceInterface(address: PublicKey, owner: PublicKey, mint: PublicKey, commitment?: Commitment): Promise<UnifiedTokenBalance>;
|
|
4007
|
+
getBalanceInterface(address: PublicKey, commitment?: Commitment): Promise<UnifiedBalance>;
|
|
3929
4008
|
}
|
|
3930
4009
|
type RpcResultSuccess<T> = {
|
|
3931
4010
|
jsonrpc: '2.0';
|
|
@@ -3942,6 +4021,83 @@ type RpcResultError = {
|
|
|
3942
4021
|
};
|
|
3943
4022
|
};
|
|
3944
4023
|
type RpcResult<T> = RpcResultSuccess<T> | RpcResultError;
|
|
4024
|
+
/**
|
|
4025
|
+
* Source type for signature data.
|
|
4026
|
+
*/
|
|
4027
|
+
declare const SignatureSource: {
|
|
4028
|
+
/** From standard Solana RPC (getSignaturesForAddress) */
|
|
4029
|
+
readonly Solana: "solana";
|
|
4030
|
+
/** From compression indexer (getCompressionSignaturesFor*) */
|
|
4031
|
+
readonly Compressed: "compressed";
|
|
4032
|
+
};
|
|
4033
|
+
type SignatureSourceType = (typeof SignatureSource)[keyof typeof SignatureSource];
|
|
4034
|
+
/**
|
|
4035
|
+
* Unified signature info combining data from both Solana RPC and compression indexer.
|
|
4036
|
+
*
|
|
4037
|
+
* Design rationale:
|
|
4038
|
+
* - `sources` array indicates where this signature was found (can be both!)
|
|
4039
|
+
* - Primary data comes from Solana RPC when available (richer: err, memo, confirmationStatus)
|
|
4040
|
+
* - Compression-only signatures still included for complete transaction history
|
|
4041
|
+
*/
|
|
4042
|
+
interface UnifiedSignatureInfo {
|
|
4043
|
+
/** Transaction signature (base58) */
|
|
4044
|
+
signature: string;
|
|
4045
|
+
/** Slot when the transaction was processed */
|
|
4046
|
+
slot: number;
|
|
4047
|
+
/** Block time (unix timestamp), null if not available */
|
|
4048
|
+
blockTime: number | null;
|
|
4049
|
+
/** Transaction error, null if successful. Only from Solana RPC. */
|
|
4050
|
+
err: any | null;
|
|
4051
|
+
/** Memo data. Only from Solana RPC. */
|
|
4052
|
+
memo: string | null;
|
|
4053
|
+
/** Confirmation status. Only from Solana RPC. */
|
|
4054
|
+
confirmationStatus?: string;
|
|
4055
|
+
/**
|
|
4056
|
+
* Sources where this signature was found.
|
|
4057
|
+
* - ['solana'] = only in Solana RPC
|
|
4058
|
+
* - ['compressed'] = only in compression indexer
|
|
4059
|
+
* - ['solana', 'compressed'] = found in both (compression tx indexed by both)
|
|
4060
|
+
*/
|
|
4061
|
+
sources: SignatureSourceType[];
|
|
4062
|
+
}
|
|
4063
|
+
/**
|
|
4064
|
+
* Result of getSignaturesForAddressInterface / getSignaturesForOwnerInterface.
|
|
4065
|
+
*
|
|
4066
|
+
* Design rationale:
|
|
4067
|
+
* - `signatures`: Unified view, merged and deduplicated, sorted by slot desc
|
|
4068
|
+
* - `solana` / `compressed`: Raw responses preserved for clients that need source-specific data
|
|
4069
|
+
* - Allows callers to use the unified view OR drill into specific sources
|
|
4070
|
+
*/
|
|
4071
|
+
interface SignaturesForAddressInterfaceResult {
|
|
4072
|
+
/** Merged signatures from all sources, sorted by slot (descending) */
|
|
4073
|
+
signatures: UnifiedSignatureInfo[];
|
|
4074
|
+
/** Raw signatures from Solana RPC */
|
|
4075
|
+
solana: ConfirmedSignatureInfo[];
|
|
4076
|
+
/** Raw signatures from compression indexer */
|
|
4077
|
+
compressed: SignatureWithMetadata[];
|
|
4078
|
+
}
|
|
4079
|
+
/**
|
|
4080
|
+
* Unified token balance combining hot and cold token balances.
|
|
4081
|
+
*/
|
|
4082
|
+
interface UnifiedTokenBalance {
|
|
4083
|
+
/** Total balance (hot + cold) */
|
|
4084
|
+
amount: BN;
|
|
4085
|
+
/** True if any cold balance exists - call load() before usage */
|
|
4086
|
+
hasColdBalance: boolean;
|
|
4087
|
+
/** Token decimals (from on-chain mint or 0 if unknown) */
|
|
4088
|
+
decimals: number;
|
|
4089
|
+
/** Raw Solana RPC TokenAmount response, null if no on-chain account */
|
|
4090
|
+
solana: TokenAmount | null;
|
|
4091
|
+
}
|
|
4092
|
+
/**
|
|
4093
|
+
* Unified SOL balance combining hot and cold SOL balances.
|
|
4094
|
+
*/
|
|
4095
|
+
interface UnifiedBalance {
|
|
4096
|
+
/** Total balance (hot + cold) in lamports */
|
|
4097
|
+
total: BN;
|
|
4098
|
+
/** True if any cold balance exists - call load() before usage */
|
|
4099
|
+
hasColdBalance: boolean;
|
|
4100
|
+
}
|
|
3945
4101
|
|
|
3946
4102
|
interface TestRpcConfig {
|
|
3947
4103
|
/**
|
|
@@ -4174,6 +4330,12 @@ declare class TestRpc extends Connection implements CompressionApiInterface {
|
|
|
4174
4330
|
*/
|
|
4175
4331
|
getValidityProof(hashes?: BN254[], newAddresses?: BN254[]): Promise<ValidityProofWithContext>;
|
|
4176
4332
|
getValidityProofV0(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<ValidityProofWithContext>;
|
|
4333
|
+
getValidityProofV2(accountMerkleContexts?: any[], newAddresses?: any[], derivationMode?: any): Promise<ValidityProofWithContext>;
|
|
4334
|
+
getAccountInfoInterface(_address: PublicKey, _programId: PublicKey, _addressSpaceInfo: any): Promise<any>;
|
|
4335
|
+
getSignaturesForAddressInterface(_address: PublicKey, _options?: any, _compressedOptions?: PaginatedOptions): Promise<any>;
|
|
4336
|
+
getSignaturesForOwnerInterface(_owner: PublicKey, _options?: any, _compressedOptions?: PaginatedOptions): Promise<any>;
|
|
4337
|
+
getTokenAccountBalanceInterface(_address: PublicKey, _owner: PublicKey, _mint: PublicKey, _commitment?: any): Promise<any>;
|
|
4338
|
+
getBalanceInterface(_address: PublicKey, _commitment?: any): Promise<any>;
|
|
4177
4339
|
}
|
|
4178
4340
|
|
|
4179
4341
|
declare class IndexedElement {
|
|
@@ -4371,7 +4533,6 @@ type TokenData = {
|
|
|
4371
4533
|
state: number;
|
|
4372
4534
|
tlv: Buffer | null;
|
|
4373
4535
|
};
|
|
4374
|
-
declare const TokenDataLayout: Layout<TokenData>;
|
|
4375
4536
|
type EventWithParsedTokenTlvData = {
|
|
4376
4537
|
inputCompressedAccountHashes: number[][];
|
|
4377
4538
|
outputCompressedAccounts: ParsedTokenAccount[];
|
|
@@ -4494,6 +4655,12 @@ interface NullifierMetadata {
|
|
|
4494
4655
|
nullifier: BN254;
|
|
4495
4656
|
txHash: BN254;
|
|
4496
4657
|
}
|
|
4658
|
+
/**
|
|
4659
|
+
* Merge signatures from Solana RPC and compression indexer.
|
|
4660
|
+
* Deduplicates by signature, tracking sources in the `sources` array.
|
|
4661
|
+
* When a signature exists in both, uses Solana data (richer) but marks both sources.
|
|
4662
|
+
*/
|
|
4663
|
+
declare function mergeSignatures(solanaSignatures: ConfirmedSignatureInfo[], compressedSignatures: SignatureWithMetadata[]): UnifiedSignatureInfo[];
|
|
4497
4664
|
/**
|
|
4498
4665
|
*
|
|
4499
4666
|
*/
|
|
@@ -4686,6 +4853,17 @@ declare class Rpc extends Connection implements CompressionApiInterface {
|
|
|
4686
4853
|
* @returns validity proof with context
|
|
4687
4854
|
*/
|
|
4688
4855
|
getValidityProofV0(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<ValidityProofWithContext>;
|
|
4856
|
+
/**
|
|
4857
|
+
* Fetch the latest validity proof for (1) compressed accounts specified by
|
|
4858
|
+
* an array of account Merkle contexts, and (2) new unique addresses specified by
|
|
4859
|
+
* an array of address objects with tree info.
|
|
4860
|
+
*
|
|
4861
|
+
* Validity proofs prove the presence of compressed accounts in state trees
|
|
4862
|
+
* and the non-existence of addresses in address trees, respectively. They
|
|
4863
|
+
* enable verification without recomputing the merkle proof path, thus
|
|
4864
|
+
* lowering verification and data costs.
|
|
4865
|
+
*/
|
|
4866
|
+
getValidityProofV2(accountMerkleContexts?: (MerkleContext | undefined)[], newAddresses?: AddressWithTreeInfoV2[], derivationMode?: DerivationMode): Promise<ValidityProofWithContext>;
|
|
4689
4867
|
/**
|
|
4690
4868
|
* Fetch the latest validity proof for (1) compressed accounts specified by
|
|
4691
4869
|
* an array of account hashes. (2) new unique addresses specified by an
|
|
@@ -4703,6 +4881,65 @@ declare class Rpc extends Connection implements CompressionApiInterface {
|
|
|
4703
4881
|
* @returns validity proof with context
|
|
4704
4882
|
*/
|
|
4705
4883
|
getValidityProofAndRpcContext(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<WithContext<ValidityProofWithContext>>;
|
|
4884
|
+
/**
|
|
4885
|
+
* Fetch the account info for the specified public key. Returns metadata
|
|
4886
|
+
* to load in case the account is cold.
|
|
4887
|
+
* @param address The account address to fetch.
|
|
4888
|
+
* @param programId The owner program ID.
|
|
4889
|
+
* @param commitmentOrConfig Optional. The commitment or config to use
|
|
4890
|
+
* for the onchain account fetch.
|
|
4891
|
+
* @param addressSpace Optional. The address space info that was
|
|
4892
|
+
* used at init.
|
|
4893
|
+
*
|
|
4894
|
+
* @returns Account info with load info, or null if
|
|
4895
|
+
* account doesn't exist. LoadContext is always
|
|
4896
|
+
* some if the account is compressible. isCold
|
|
4897
|
+
* indicates the current state of the account,
|
|
4898
|
+
* if true the account must referenced in a
|
|
4899
|
+
* load instruction before use.
|
|
4900
|
+
*/
|
|
4901
|
+
getAccountInfoInterface(address: PublicKey, programId: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig, addressSpace?: TreeInfo): Promise<{
|
|
4902
|
+
accountInfo: AccountInfo<Buffer$1>;
|
|
4903
|
+
isCold: boolean;
|
|
4904
|
+
loadContext?: MerkleContext;
|
|
4905
|
+
} | null>;
|
|
4906
|
+
/**
|
|
4907
|
+
* Get signatures for an address from both Solana and compression indexer.
|
|
4908
|
+
*
|
|
4909
|
+
* @param address Address to fetch signatures for.
|
|
4910
|
+
* @param options Options for the Solana getSignaturesForAddress call.
|
|
4911
|
+
* @param compressedOptions Options for the compression getCompressionSignaturesForAddress call.
|
|
4912
|
+
* @returns Unified signatures from both sources.
|
|
4913
|
+
*/
|
|
4914
|
+
getSignaturesForAddressInterface(address: PublicKey, options?: SignaturesForAddressOptions, compressedOptions?: PaginatedOptions): Promise<SignaturesForAddressInterfaceResult>;
|
|
4915
|
+
/**
|
|
4916
|
+
* Get signatures for an owner from both Solana and compression indexer.
|
|
4917
|
+
*
|
|
4918
|
+
* @param owner Owner address to fetch signatures for.
|
|
4919
|
+
* @param options Options for the Solana getSignaturesForAddress call.
|
|
4920
|
+
* @param compressedOptions Options for the compression getCompressionSignaturesForOwner call.
|
|
4921
|
+
* @returns Unified signatures from both sources.
|
|
4922
|
+
*/
|
|
4923
|
+
getSignaturesForOwnerInterface(owner: PublicKey, options?: SignaturesForAddressOptions, compressedOptions?: PaginatedOptions): Promise<SignaturesForAddressInterfaceResult>;
|
|
4924
|
+
/**
|
|
4925
|
+
* Get token account balance for an address, regardless of whether the token
|
|
4926
|
+
* account is hot or cold.
|
|
4927
|
+
*
|
|
4928
|
+
* @param address Token account address.
|
|
4929
|
+
* @param owner Owner public key.
|
|
4930
|
+
* @param mint Mint public key.
|
|
4931
|
+
* @param commitment Commitment level for on-chain query.
|
|
4932
|
+
* @returns Unified token balance from both sources.
|
|
4933
|
+
*/
|
|
4934
|
+
getTokenAccountBalanceInterface(address: PublicKey, owner: PublicKey, mint: PublicKey, commitment?: Commitment): Promise<UnifiedTokenBalance>;
|
|
4935
|
+
/**
|
|
4936
|
+
* Get SOL balance for an address, regardless of whether the account is hot or cold.
|
|
4937
|
+
*
|
|
4938
|
+
* @param address Address to fetch balance for.
|
|
4939
|
+
* @param commitment Commitment level for on-chain query.
|
|
4940
|
+
* @returns Unified SOL balance.
|
|
4941
|
+
*/
|
|
4942
|
+
getBalanceInterface(address: PublicKey, commitment?: Commitment): Promise<UnifiedBalance>;
|
|
4706
4943
|
}
|
|
4707
4944
|
|
|
4708
4945
|
/**
|
|
@@ -6180,4 +6417,4 @@ declare class MerkleTreeError extends MetaError {
|
|
|
6180
6417
|
declare class UtilsError extends MetaError {
|
|
6181
6418
|
}
|
|
6182
6419
|
|
|
6183
|
-
export { ADDRESS_QUEUE_ROLLOVER_FEE,
|
|
6420
|
+
export { ADDRESS_QUEUE_ROLLOVER_FEE, ADDRESS_TREE_NETWORK_FEE_V1, ADDRESS_TREE_NETWORK_FEE_V2, ALICE, type AccountDataWithTreeInfo, type AccountProofInput, AccountProofResult, type ActiveTreeBundle, type AddressTreeInfo, type AddressWithTree, type AddressWithTreeInfo, type AddressWithTreeInfoV2, AppendLeavesInputLayout, AppendNullifyCreateAddressInputsMetaLayout, type BN254, BOB, BalanceResult, CHARLIE, COMPRESSED_TOKEN_PROGRAM_ID, COMPUTE_BUDGET_PATTERN, CTOKEN_PROGRAM_ID, type ClientSubscriptionId, type CompressedAccount, type CompressedAccountData, CompressedAccountLayout, type CompressedAccountLegacy, type CompressedAccountMeta, CompressedAccountResult, CompressedAccountResultV2, type CompressedAccountWithMerkleContext, type CompressedAccountWithMerkleContextLegacy, CompressedAccountsByOwnerResult, CompressedAccountsByOwnerResultV2, type CompressedCpiContext, CompressedCpiContextLayout, type CompressedMintTokenHolders, CompressedMintTokenHoldersResult, type CompressedProof, CompressedProofLayout, type CompressedProofWithContext, CompressedTokenAccountResult, CompressedTokenAccountResultV2, CompressedTokenAccountsByOwnerOrDelegateResult, CompressedTokenAccountsByOwnerOrDelegateResultV2, type CompressedTransaction, CompressedTransactionResult, CompressedTransactionResultV2, type CompressionApiInterface, CreateUtxoError, CreateUtxoErrorCode, DAVE, DEFAULT_MERKLE_TREE_HEIGHT, DEFAULT_MERKLE_TREE_ROOTS, DEFAULT_ZERO, DerivationMode, type EventWithParsedTokenTlvData, FIELD_SIZE, type GetCompressedAccountConfig, type GetCompressedAccountsByOwnerConfig, type GetCompressedAccountsConfig, type GetCompressedAccountsFilter, type GetCompressedTokenAccountsByOwnerOrDelegateOptions, HIGHEST_ADDRESS_PLUS_ONE, HashError, HashErrorCode, type HashWithTree, type HashWithTreeInfo, HealthResult, type HexBatchInputsForProver, type HexInputsForProver, IDL, INSERT_INTO_QUEUES_DISCRIMINATOR, INVOKE_CPI_DISCRIMINATOR, INVOKE_CPI_WITH_ACCOUNT_INFO_DISCRIMINATOR, INVOKE_CPI_WITH_READ_ONLY_DISCRIMINATOR, INVOKE_DISCRIMINATOR, InAccountLayout, IndexedArray, IndexedElement, IndexedElementBundle, type InputTokenDataWithContext, InsertAddressInputLayout, InsertNullifierInputLayout, type InstructionDataInvoke, type InstructionDataInvokeCpi, InstructionDataInvokeCpiLayout, InstructionDataInvokeCpiWithReadOnlyLayout, InstructionDataInvokeLayout, type LatestNonVotingSignatures, type LatestNonVotingSignaturesPaginated, LatestNonVotingSignaturesResult, LatestNonVotingSignaturesResultPaginated, LightSystemProgram, type LightSystemProgram$1 as LightSystemProgramIDL, type LightWasm, LookupTableError, LookupTableErrorCode, type MerkleContext, MerkleContextLayout, type MerkleContextLegacy, type MerkleContextWithMerkleProof, type MerkleContextWithNewAddressProof, MerkleProofResult, MerkleProofResultV2, MerkleTree, MerkleTreeError, MerkleTreeErrorCode, type MerkleTreeSequenceNumber, MerkleTreeSequenceNumberLayout, MultipleCompressedAccountsResult, MultipleCompressedAccountsResultV2, MultipleMerkleProofsResult, MultipleMerkleProofsResultV2, NativeBalanceResult, type NewAddressParams, NewAddressParamsAssignedPackedLayout, NewAddressParamsLayout, type NewAddressParamsPacked, type NewAddressProofInput, NewAddressProofResult, type NonInclusionJsonStruct, type NonInclusionMerkleProofInputs, type NullifierMetadata, type OutputCompressedAccountWithPackedContext, PackedAccounts, type PackedAddressTreeInfo, type PackedCompressedAccountWithMerkleContext, type PackedDecompressResult, PackedMerkleContextLayout, type PackedMerkleContextLegacy, PackedReadOnlyAddressLayout, PackedReadOnlyCompressedAccountLayout, type PackedStateTreeInfo, type PackedStateTreeInfos, type PackedTreeInfos, type PaginatedOptions, type ParsedTokenAccount, ProofError, ProofErrorCode, type PublicTransactionEvent, PublicTransactionEventLayout, RootIndexResultV2, Rpc, RpcError, RpcErrorCode, type RpcResult, type RpcResultError, type RpcResultSuccess, STATE_MERKLE_TREE_NETWORK_FEE, STATE_MERKLE_TREE_ROLLOVER_FEE, SelectInUtxosError, SelectInUtxosErrorCode, SignatureListResult, SignatureListWithCursorResult, SignatureSource, type SignatureSourceType, type SignatureWithMetadata, type SignaturesForAddressInterfaceResult, SlotResult, type StateTreeInfo, type StateTreeLUTPair, SystemAccountMetaConfig, TRANSACTION_MERKLE_TREE_ROLLOVER_THRESHOLD, TestRpc, type TestRpcConfig, type TokenBalance, TokenBalanceListResult, TokenBalanceListResultV2, TokenBalanceResult, type TokenData$1 as TokenData, TokenDataResult, type TreeInfo, TreeType, UTXO_MERGE_MAXIMUM, UTXO_MERGE_THRESHOLD, type UnifiedBalance, type UnifiedSignatureInfo, type UnifiedTokenBalance, UtilsError, UtilsErrorCode, UtxoError, UtxoErrorCode, VERSION, type ValidityProof, ValidityProofResult, ValidityProofResultV2, type ValidityProofWithContext, type WithContext, type WithCursor, type WithRpcContext, accountCompressionProgram, addressQueue, addressTree, airdropSol, batchAddressTree, batchCpiContext1, batchCpiContext2, batchCpiContext3, batchCpiContext4, batchCpiContext5, batchMerkleTree, batchMerkleTree1, batchMerkleTree2, batchMerkleTree3, batchMerkleTree4, batchMerkleTree5, batchQueue, batchQueue1, batchQueue2, batchQueue3, batchQueue4, batchQueue5, bn, bufToDecStr, buildAndSignTx, buildTx, byteArrayToKeypair, calculateComputeUnitPrice, checkValidityProofShape, compress, confirmConfig, confirmTransaction, confirmTx, convertInvokeCpiWithReadOnlyToInvoke, convertMerkleProofsWithContextToHex, convertNonInclusionMerkleProofInputsToHex, convertToPublicTransactionEvent, cpiContext2Pubkey, cpiContextPubkey, createAccount, createAccountWithLamports, createBN254, createCompressedAccountLegacy, createCompressedAccountMeta, createCompressedAccountWithMerkleContextLegacy, createMerkleContextLegacy, createRpc, createRpcResult, createStateTreeLookupTable, decodeInstructionDataInvoke, decodeInstructionDataInvokeCpi, decodeInstructionDataInvokeCpiWithReadOnly, decodePublicTransactionEvent, decompress, dedupeSigner, deepEqual, defaultStateTreeLookupTables, defaultStaticAccounts, defaultStaticAccountsStruct, defaultTestStateTreeAccounts, defaultTestStateTreeAccounts2, deriveAddress, deriveAddressSeed, deriveAddressSeedV2, deriveAddressV2, deserializeAppendNullifyCreateAddressInputsIndexer, encodeBN254toBase58, encodeInstructionDataInvoke, encodePublicTransactionEvent, extendStateTreeLookupTable, featureFlags, getAccountCompressionAuthority, getAllStateTreeInfos, getBatchAddressTreeInfo, getCompressedTokenAccountByHashTest, getCompressedTokenAccounts, getCompressedTokenAccountsByDelegateTest, getCompressedTokenAccountsByOwnerTest, getConnection, getDefaultAddressSpace, getDefaultAddressTreeInfo, getIndexOrAdd, getLightSystemAccountMetas, getLightSystemAccountMetasV2, getOutputQueue, getOutputTreeInfo, getParsedEvents, getPublicInputHash, getRegisteredProgramPda, getStateTreeInfoByPubkey, getTestKeypair, getTestRpc, getTreeInfoByPubkey, hashToBn254FieldSizeBe, hashvToBn254FieldSizeBe, hashvToBn254FieldSizeBeU8Array, invokeAccountsLayout, type invokeAccountsLayoutParams, isLocalTest, isSmallerThanBn254FieldSizeBe, jsonRpcResult, jsonRpcResultAndContext, lightSystemProgram, localTestActiveStateTreeInfos, mergeSignatures, merkleTree2Pubkey, merkletreePubkey, negateAndCompressProof, newAccountWithLamports, noopProgram, nullifiedStateTreeLookupTableDevnet, nullifiedStateTreeLookupTableMainnet, nullifierQueue2Pubkey, nullifierQueuePubkey, nullifyLookupTable, packCompressedAccounts, packDecompressAccountsIdempotent, packNewAddressParams, packTreeInfos, padOutputStateMerkleTrees, parseAccountData, parseEvents, parseLightTransaction, parsePublicTransactionEventWithIdl, parseTokenLayoutWithIdl, pickRandomTreeAndQueue, pipe, placeholderValidityProof, proofFromJsonStruct, proverRequest, pushUniqueItems, rpcRequest, selectMinCompressedSolAccountsForTransfer, selectStateTreeInfo, sendAndConfirmTx, sleep, stateTreeLookupTableDevnet, stateTreeLookupTableMainnet, sumUpLamports, testBatchAddressTree, toAccountMetas, toArray, toCamelCase, toHex, toUnixTimestamp, transfer, validateNumbers, validateNumbersForInclusionProof, validateNumbersForNonInclusionProof, validateNumbersForProof, validateSameOwner, validateSufficientBalance, versionedEndpoint, wrapBigNumbersAsStrings };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightprotocol/stateless.js",
|
|
3
|
-
"version": "0.22.1-alpha.
|
|
3
|
+
"version": "0.22.1-alpha.2",
|
|
4
4
|
"description": "JavaScript API for Light & ZK Compression",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/node/index.cjs",
|
|
@@ -103,9 +103,10 @@
|
|
|
103
103
|
},
|
|
104
104
|
"scripts": {
|
|
105
105
|
"test": "pnpm test:unit:all && pnpm test:e2e:all",
|
|
106
|
+
"test-ci": "vitest run tests/unit && pnpm test:e2e:all",
|
|
107
|
+
"test:v1": "pnpm build:v1 && LIGHT_PROTOCOL_VERSION=V1 vitest run tests/unit && LIGHT_PROTOCOL_VERSION=V1 pnpm test:e2e:all",
|
|
108
|
+
"test:v2": "pnpm build:v2 && LIGHT_PROTOCOL_VERSION=V2 vitest run tests/unit && LIGHT_PROTOCOL_VERSION=V2 pnpm test:e2e:all",
|
|
106
109
|
"test-all": "vitest run",
|
|
107
|
-
"test:v1": "LIGHT_PROTOCOL_VERSION=V1 pnpm test",
|
|
108
|
-
"test:v2": "LIGHT_PROTOCOL_VERSION=V2 pnpm test",
|
|
109
110
|
"test:unit:all": "vitest run tests/unit --reporter=verbose",
|
|
110
111
|
"test:unit:all:v1": "LIGHT_PROTOCOL_VERSION=V1 vitest run tests/unit --reporter=verbose",
|
|
111
112
|
"test:unit:all:v2": "LIGHT_PROTOCOL_VERSION=V2 vitest run tests/unit --reporter=verbose",
|
|
@@ -131,7 +132,6 @@
|
|
|
131
132
|
"build:v1": "LIGHT_PROTOCOL_VERSION=V1 pnpm build:bundle",
|
|
132
133
|
"build:v2": "LIGHT_PROTOCOL_VERSION=V2 pnpm build:bundle",
|
|
133
134
|
"build-ci": "if [ \"$LIGHT_PROTOCOL_VERSION\" = \"V2\" ]; then LIGHT_PROTOCOL_VERSION=V2 pnpm build:bundle; else LIGHT_PROTOCOL_VERSION=V1 pnpm build:bundle; fi",
|
|
134
|
-
"test-ci": "pnpm test",
|
|
135
135
|
"format": "prettier --write .",
|
|
136
136
|
"lint": "eslint ."
|
|
137
137
|
}
|