@lightprotocol/stateless.js 0.17.2-alpha.0 → 0.17.2-alpha.1

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.
@@ -566,21 +566,21 @@ export declare const HealthResult: Struct<string, null>;
566
566
  */
567
567
  export declare const LatestNonVotingSignaturesResult: Struct<{
568
568
  items: {
569
+ error: string | null;
569
570
  blockTime: number;
570
571
  signature: string;
571
- error: string | null;
572
572
  slot: number;
573
573
  }[];
574
574
  }, {
575
575
  items: Struct<{
576
+ error: string | null;
576
577
  blockTime: number;
577
578
  signature: string;
578
- error: string | null;
579
579
  slot: number;
580
580
  }[], Struct<{
581
+ error: string | null;
581
582
  blockTime: number;
582
583
  signature: string;
583
- error: string | null;
584
584
  slot: number;
585
585
  }, {
586
586
  signature: Struct<string, null>;
@@ -1,4 +1,4 @@
1
- import { Connection, ConnectionConfig, Commitment, PublicKey, BlockhashWithExpiryBlockHeight, RpcResponseAndContext, GetBalanceConfig, GetSupplyConfig, Supply, GetTokenAccountsByOwnerConfig, GetProgramAccountsResponse, TokenAccountsFilter, AccountInfo, GetMultipleAccountsConfig, StakeActivationData, GetStakeActivationConfig, GetRecentPrioritizationFeesConfig, RecentPrioritizationFees, GetLatestBlockhashConfig, Version, ParsedConfirmedTransaction, GetAccountInfoConfig, GetLargestAccountsConfig, TokenAccountBalancePair, AccountBalancePair, ParsedAccountData, Finality, TransactionSignature, ConfirmedSignatureInfo, AddressLookupTableAccount, ParsedNoneModeBlockResponse, TokenAmount, GetNonceAndContextConfig, NonceAccount, GetNonceConfig, GetProgramAccountsConfig, GetParsedProgramAccountsConfig, Blockhash, IsBlockhashValidConfig, GetVersionedBlockConfig, ParsedAccountsModeBlockResponse, ConfirmedTransaction, ConfirmedSignaturesForAddress2Options, SignaturesForAddressOptions } from '@solana/web3.js';
1
+ import { Connection, ConnectionConfig, PublicKey } from '@solana/web3.js';
2
2
  import { Buffer } from 'buffer';
3
3
  import { CompressedProofWithContext, CompressedTransaction, CompressionApiInterface, GetCompressedTokenAccountsByOwnerOrDelegateOptions, HexInputsForProver, ParsedTokenAccount, SignatureWithMetadata, LatestNonVotingSignatures, LatestNonVotingSignaturesPaginated, WithContext, GetCompressedAccountsByOwnerConfig, WithCursor, AddressWithTree, HashWithTree, CompressedMintTokenHolders, TokenBalance, PaginatedOptions } from './rpc-interface';
4
4
  import { MerkleContextWithMerkleProof, BN254, CompressedAccountWithMerkleContext, CompressedProof } from './state';
@@ -61,13 +61,11 @@ export type NonInclusionJsonStruct = {
61
61
  export declare function convertMerkleProofsWithContextToHex(merkleProofsWithContext: MerkleContextWithMerkleProof[]): HexInputsForProver[];
62
62
  export declare function convertNonInclusionMerkleProofInputsToHex(nonInclusionMerkleProofInputs: MerkleContextWithNewAddressProof[]): NonInclusionJsonStruct[];
63
63
  import { LightWasm } from './test-helpers';
64
- import { ConnectionInterface } from './connection-interface';
65
64
  export declare function getPublicInputHash(accountProofs: MerkleContextWithMerkleProof[], accountHashes: BN254[], newAddressProofs: MerkleContextWithNewAddressProof[], lightWasm: LightWasm): BN;
66
65
  /**
67
66
  *
68
67
  */
69
- export declare class Rpc extends Connection implements ConnectionInterface, CompressionApiInterface {
70
- connection: Connection;
68
+ export declare class Rpc extends Connection implements CompressionApiInterface {
71
69
  compressionApiEndpoint: string;
72
70
  proverEndpoint: string;
73
71
  /**
@@ -79,59 +77,6 @@ export declare class Rpc extends Connection implements ConnectionInterface, Comp
79
77
  * @param connectionConfig Optional connection config
80
78
  */
81
79
  constructor(endpoint: string, compressionApiEndpoint: string, proverEndpoint: string, config?: ConnectionConfig);
82
- get commitment(): Commitment | undefined;
83
- get rpcEndpoint(): string;
84
- getBalanceAndContext(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetBalanceConfig): Promise<RpcResponseAndContext<number>>;
85
- getBalance(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetBalanceConfig): Promise<number>;
86
- getBlockTime(slot: number): Promise<number | null>;
87
- getMinimumLedgerSlot(): Promise<number>;
88
- getFirstAvailableBlock(): Promise<number>;
89
- getSupply(config?: GetSupplyConfig | Commitment): Promise<RpcResponseAndContext<Supply>>;
90
- getTokenSupply(tokenMintAddress: PublicKey, commitment?: Commitment): Promise<RpcResponseAndContext<TokenAmount>>;
91
- getTokenAccountBalance(tokenAddress: PublicKey, commitment?: Commitment): Promise<RpcResponseAndContext<TokenAmount>>;
92
- getTokenAccountsByOwner(ownerAddress: PublicKey, filter: TokenAccountsFilter, commitmentOrConfig?: Commitment | GetTokenAccountsByOwnerConfig): Promise<RpcResponseAndContext<GetProgramAccountsResponse>>;
93
- getParsedTokenAccountsByOwner(ownerAddress: PublicKey, filter: TokenAccountsFilter, commitment?: Commitment): Promise<RpcResponseAndContext<Array<{
94
- pubkey: PublicKey;
95
- account: AccountInfo<ParsedAccountData>;
96
- }>>>;
97
- getLargestAccounts(config?: GetLargestAccountsConfig): Promise<RpcResponseAndContext<Array<AccountBalancePair>>>;
98
- getTokenLargestAccounts(mintAddress: PublicKey, commitment?: Commitment): Promise<RpcResponseAndContext<Array<TokenAccountBalancePair>>>;
99
- getAccountInfoAndContext(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<RpcResponseAndContext<AccountInfo<Buffer> | null>>;
100
- getParsedAccountInfo(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<RpcResponseAndContext<AccountInfo<Buffer | ParsedAccountData> | null>>;
101
- getAccountInfo(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<AccountInfo<Buffer> | null>;
102
- getMultipleParsedAccounts(publicKeys: PublicKey[], rawConfig?: GetMultipleAccountsConfig): Promise<RpcResponseAndContext<(AccountInfo<Buffer | ParsedAccountData> | null)[]>>;
103
- getMultipleAccountsInfoAndContext(publicKeys: PublicKey[], commitmentOrConfig?: Commitment | GetMultipleAccountsConfig): Promise<RpcResponseAndContext<(AccountInfo<Buffer> | null)[]>>;
104
- getMultipleAccountsInfo(publicKeys: PublicKey[], commitmentOrConfig?: Commitment | GetMultipleAccountsConfig): Promise<(AccountInfo<Buffer> | null)[]>;
105
- getStakeActivation(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetStakeActivationConfig, epoch?: number): Promise<StakeActivationData>;
106
- getProgramAccounts(programId: PublicKey, configOrCommitment?: GetProgramAccountsConfig | Commitment): Promise<GetProgramAccountsResponse>;
107
- getProgramAccounts(programId: PublicKey, configOrCommitment: GetProgramAccountsConfig & {
108
- withContext: true;
109
- }): Promise<RpcResponseAndContext<GetProgramAccountsResponse>>;
110
- getParsedProgramAccounts(programId: PublicKey, configOrCommitment?: GetParsedProgramAccountsConfig | Commitment): Promise<Array<{
111
- pubkey: PublicKey;
112
- account: AccountInfo<Buffer | ParsedAccountData>;
113
- }>>;
114
- getParsedBlock(slot: number, rawConfig?: GetVersionedBlockConfig): Promise<ParsedAccountsModeBlockResponse>;
115
- getParsedBlock(slot: number, rawConfig: GetVersionedBlockConfig & {
116
- transactionDetails: 'accounts';
117
- }): Promise<ParsedAccountsModeBlockResponse>;
118
- getParsedBlock(slot: number, rawConfig: GetVersionedBlockConfig & {
119
- transactionDetails: 'none';
120
- }): Promise<ParsedNoneModeBlockResponse>;
121
- getConfirmedTransaction(signature: TransactionSignature, commitment?: Finality): Promise<ConfirmedTransaction | null>;
122
- getParsedConfirmedTransaction(signature: TransactionSignature, commitment?: Finality): Promise<ParsedConfirmedTransaction | null>;
123
- getParsedConfirmedTransactions(signatures: TransactionSignature[], commitment?: Finality): Promise<(ParsedConfirmedTransaction | null)[]>;
124
- getConfirmedSignaturesForAddress(address: PublicKey, startSlot: number, endSlot: number): Promise<Array<TransactionSignature>>;
125
- getConfirmedSignaturesForAddress2(address: PublicKey, options?: ConfirmedSignaturesForAddress2Options, commitment?: Finality): Promise<Array<ConfirmedSignatureInfo>>;
126
- getSignaturesForAddress(address: PublicKey, options?: SignaturesForAddressOptions, commitment?: Finality): Promise<Array<ConfirmedSignatureInfo>>;
127
- getRecentPrioritizationFees(config?: GetRecentPrioritizationFeesConfig): Promise<RecentPrioritizationFees[]>;
128
- getLatestBlockhash(config?: GetLatestBlockhashConfig): Promise<BlockhashWithExpiryBlockHeight>;
129
- getLatestBlockhashAndContext(commitmentOrConfig?: Commitment | GetLatestBlockhashConfig): Promise<RpcResponseAndContext<BlockhashWithExpiryBlockHeight>>;
130
- isBlockhashValid(blockhash: Blockhash, config?: IsBlockhashValidConfig): Promise<RpcResponseAndContext<boolean>>;
131
- getVersion(): Promise<Version>;
132
- getAddressLookupTable(accountKey: PublicKey, config?: GetAccountInfoConfig): Promise<RpcResponseAndContext<AddressLookupTableAccount | null>>;
133
- getNonceAndContext(nonceAccount: PublicKey, commitmentOrConfig?: Commitment | GetNonceAndContextConfig): Promise<RpcResponseAndContext<NonceAccount | null>>;
134
- getNonce(nonceAccount: PublicKey, commitmentOrConfig?: Commitment | GetNonceConfig): Promise<NonceAccount | null>;
135
80
  /**
136
81
  * Fetch the compressed account for the specified account address or hash
137
82
  */
@@ -3,7 +3,7 @@ import BN from 'bn.js';
3
3
  import { AddressWithTree, CompressedMintTokenHolders, CompressedTransaction, GetCompressedAccountsByOwnerConfig, PaginatedOptions, HashWithTree, LatestNonVotingSignatures, LatestNonVotingSignaturesPaginated, SignatureWithMetadata, WithContext, WithCursor } from '../../rpc-interface';
4
4
  import { CompressedProofWithContext, CompressionApiInterface, GetCompressedTokenAccountsByOwnerOrDelegateOptions, ParsedTokenAccount, TokenBalance } from '../../rpc-interface';
5
5
  import { BN254, CompressedAccountWithMerkleContext, MerkleContextWithMerkleProof } from '../../state';
6
- import { MerkleContextWithNewAddressProof, Rpc } from '../../rpc';
6
+ import { MerkleContextWithNewAddressProof } from '../../rpc';
7
7
  export interface TestRpcConfig {
8
8
  /**
9
9
  * Address of the state tree to index. Default: public default test state
@@ -54,7 +54,7 @@ export interface LightWasm {
54
54
  * @param depth Depth of the merkle tree.
55
55
  * @param log Log proof generation time.
56
56
  */
57
- export declare function getTestRpc(lightWasm: LightWasm, endpoint?: string, compressionApiEndpoint?: string, proverEndpoint?: string, merkleTreeAddress?: PublicKey, nullifierQueueAddress?: PublicKey, depth?: number, log?: boolean): Promise<Rpc>;
57
+ export declare function getTestRpc(lightWasm: LightWasm, endpoint?: string, compressionApiEndpoint?: string, proverEndpoint?: string, merkleTreeAddress?: PublicKey, nullifierQueueAddress?: PublicKey, depth?: number, log?: boolean): Promise<TestRpc>;
58
58
  /**
59
59
  * Simple mock rpc for unit tests that simulates the compression rpc interface.
60
60
  * Fetches, parses events and builds merkletree on-demand, i.e. it does not persist state.
@@ -65,7 +65,6 @@ export declare function getTestRpc(lightWasm: LightWasm, endpoint?: string, comp
65
65
  * For advanced testing use photon: https://github.com/helius-labs/photon
66
66
  */
67
67
  export declare class TestRpc extends Connection implements CompressionApiInterface {
68
- connection: Connection;
69
68
  compressionApiEndpoint: string;
70
69
  proverEndpoint: string;
71
70
  merkleTreeAddress: PublicKey;