@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.
- 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 +3 -3
- package/dist/cjs/browser/rpc.d.ts +2 -57
- package/dist/cjs/browser/test-helpers/test-rpc/test-rpc.d.ts +2 -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 +3 -3
- package/dist/cjs/node/rpc.d.ts +2 -57
- package/dist/cjs/node/test-helpers/test-rpc/test-rpc.d.ts +2 -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 +3 -3
- package/dist/es/browser/rpc.d.ts +2 -57
- package/dist/es/browser/test-helpers/test-rpc/test-rpc.d.ts +2 -3
- package/dist/types/index.d.ts +5 -185
- package/package.json +4 -4
- package/dist/cjs/browser/connection-interface.d.ts +0 -125
- package/dist/cjs/node/connection-interface.d.ts +0 -125
- package/dist/es/browser/connection-interface.d.ts +0 -125
|
@@ -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>;
|
package/dist/es/browser/rpc.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Connection, ConnectionConfig,
|
|
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
|
|
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
|
|
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<
|
|
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;
|
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, TransactionInstruction, AddressLookupTableAccount, VersionedTransaction, ConfirmOptions, TransactionSignature, RpcResponseAndContext, SignatureResult, Signer, DataSlice, MemcmpFilter, ConnectionConfig, ParsedTransactionWithMeta,
|
|
2
|
+
import { PublicKey, Connection, Commitment, Keypair, TransactionInstruction, AddressLookupTableAccount, VersionedTransaction, ConfirmOptions, TransactionSignature, RpcResponseAndContext, SignatureResult, Signer, DataSlice, MemcmpFilter, ConnectionConfig, ParsedTransactionWithMeta, AccountMeta } 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';
|
|
@@ -1546,7 +1546,7 @@ interface TestRpcConfig {
|
|
|
1546
1546
|
*/
|
|
1547
1547
|
addressQueueAddress?: PublicKey;
|
|
1548
1548
|
}
|
|
1549
|
-
type ClientSubscriptionId
|
|
1549
|
+
type ClientSubscriptionId = number;
|
|
1550
1550
|
interface LightWasm {
|
|
1551
1551
|
blakeHash(input: string | Uint8Array, hashLength: number): Uint8Array;
|
|
1552
1552
|
poseidonHash(input: string[] | BN[]): Uint8Array;
|
|
@@ -1568,7 +1568,7 @@ interface LightWasm {
|
|
|
1568
1568
|
* @param depth Depth of the merkle tree.
|
|
1569
1569
|
* @param log Log proof generation time.
|
|
1570
1570
|
*/
|
|
1571
|
-
declare function getTestRpc(lightWasm: LightWasm, endpoint?: string, compressionApiEndpoint?: string, proverEndpoint?: string, merkleTreeAddress?: PublicKey, nullifierQueueAddress?: PublicKey, depth?: number, log?: boolean): Promise<
|
|
1571
|
+
declare function getTestRpc(lightWasm: LightWasm, endpoint?: string, compressionApiEndpoint?: string, proverEndpoint?: string, merkleTreeAddress?: PublicKey, nullifierQueueAddress?: PublicKey, depth?: number, log?: boolean): Promise<TestRpc>;
|
|
1572
1572
|
/**
|
|
1573
1573
|
* Simple mock rpc for unit tests that simulates the compression rpc interface.
|
|
1574
1574
|
* Fetches, parses events and builds merkletree on-demand, i.e. it does not persist state.
|
|
@@ -1579,7 +1579,6 @@ declare function getTestRpc(lightWasm: LightWasm, endpoint?: string, compression
|
|
|
1579
1579
|
* For advanced testing use photon: https://github.com/helius-labs/photon
|
|
1580
1580
|
*/
|
|
1581
1581
|
declare class TestRpc extends Connection implements CompressionApiInterface {
|
|
1582
|
-
connection: Connection;
|
|
1583
1582
|
compressionApiEndpoint: string;
|
|
1584
1583
|
proverEndpoint: string;
|
|
1585
1584
|
merkleTreeAddress: PublicKey;
|
|
@@ -1983,131 +1982,6 @@ declare function getCompressedTokenAccountsByOwnerTest(rpc: Rpc, owner: PublicKe
|
|
|
1983
1982
|
declare function getCompressedTokenAccountsByDelegateTest(rpc: Rpc, delegate: PublicKey, mint: PublicKey): Promise<WithCursor<ParsedTokenAccount[]>>;
|
|
1984
1983
|
declare function getCompressedTokenAccountByHashTest(rpc: Rpc, hash: BN): Promise<ParsedTokenAccount>;
|
|
1985
1984
|
|
|
1986
|
-
type ClientSubscriptionId = number;
|
|
1987
|
-
interface ConnectionInterface {
|
|
1988
|
-
readonly commitment?: Commitment;
|
|
1989
|
-
readonly rpcEndpoint: string;
|
|
1990
|
-
getBalanceAndContext(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetBalanceConfig): Promise<RpcResponseAndContext<number>>;
|
|
1991
|
-
getBalance(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetBalanceConfig): Promise<number>;
|
|
1992
|
-
getBlockTime(slot: number): Promise<number | null>;
|
|
1993
|
-
getMinimumLedgerSlot(): Promise<number>;
|
|
1994
|
-
getFirstAvailableBlock(): Promise<number>;
|
|
1995
|
-
getSupply(config?: GetSupplyConfig | Commitment): Promise<RpcResponseAndContext<Supply>>;
|
|
1996
|
-
getTokenSupply(tokenMintAddress: PublicKey, commitment?: Commitment): Promise<RpcResponseAndContext<TokenAmount>>;
|
|
1997
|
-
getTokenAccountBalance(tokenAddress: PublicKey, commitment?: Commitment): Promise<RpcResponseAndContext<TokenAmount>>;
|
|
1998
|
-
getTokenAccountsByOwner(ownerAddress: PublicKey, filter: TokenAccountsFilter, commitmentOrConfig?: Commitment | GetTokenAccountsByOwnerConfig): Promise<RpcResponseAndContext<GetProgramAccountsResponse>>;
|
|
1999
|
-
getParsedTokenAccountsByOwner(ownerAddress: PublicKey, filter: TokenAccountsFilter, commitment?: Commitment): Promise<RpcResponseAndContext<Array<{
|
|
2000
|
-
pubkey: PublicKey;
|
|
2001
|
-
account: AccountInfo<ParsedAccountData>;
|
|
2002
|
-
}>>>;
|
|
2003
|
-
getLargestAccounts(config?: GetLargestAccountsConfig): Promise<RpcResponseAndContext<Array<AccountBalancePair>>>;
|
|
2004
|
-
getTokenLargestAccounts(mintAddress: PublicKey, commitment?: Commitment): Promise<RpcResponseAndContext<Array<TokenAccountBalancePair>>>;
|
|
2005
|
-
getAccountInfoAndContext(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<RpcResponseAndContext<AccountInfo<Buffer> | null>>;
|
|
2006
|
-
getParsedAccountInfo(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<RpcResponseAndContext<AccountInfo<Buffer | ParsedAccountData> | null>>;
|
|
2007
|
-
getAccountInfo(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<AccountInfo<Buffer> | null>;
|
|
2008
|
-
getMultipleParsedAccounts(publicKeys: PublicKey[], rawConfig?: GetMultipleAccountsConfig): Promise<RpcResponseAndContext<(AccountInfo<Buffer | ParsedAccountData> | null)[]>>;
|
|
2009
|
-
getMultipleAccountsInfoAndContext(publicKeys: PublicKey[], commitmentOrConfig?: Commitment | GetMultipleAccountsConfig): Promise<RpcResponseAndContext<(AccountInfo<Buffer> | null)[]>>;
|
|
2010
|
-
getMultipleAccountsInfo(publicKeys: PublicKey[], commitmentOrConfig?: Commitment | GetMultipleAccountsConfig): Promise<(AccountInfo<Buffer> | null)[]>;
|
|
2011
|
-
getStakeActivation(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetStakeActivationConfig, epoch?: number): Promise<StakeActivationData>;
|
|
2012
|
-
getProgramAccounts(programId: PublicKey, configOrCommitment?: GetProgramAccountsConfig | Commitment): Promise<GetProgramAccountsResponse>;
|
|
2013
|
-
getProgramAccounts(programId: PublicKey, configOrCommitment: GetProgramAccountsConfig & {
|
|
2014
|
-
withContext: true;
|
|
2015
|
-
}): Promise<RpcResponseAndContext<GetProgramAccountsResponse>>;
|
|
2016
|
-
getParsedProgramAccounts(programId: PublicKey, configOrCommitment?: GetParsedProgramAccountsConfig | Commitment): Promise<Array<{
|
|
2017
|
-
pubkey: PublicKey;
|
|
2018
|
-
account: AccountInfo<Buffer | ParsedAccountData>;
|
|
2019
|
-
}>>;
|
|
2020
|
-
confirmTransaction(strategy: TransactionConfirmationStrategy, commitment?: Commitment): Promise<RpcResponseAndContext<SignatureResult>>;
|
|
2021
|
-
confirmTransaction(strategy: TransactionSignature, commitment?: Commitment): Promise<RpcResponseAndContext<SignatureResult>>;
|
|
2022
|
-
getClusterNodes(): Promise<Array<ContactInfo>>;
|
|
2023
|
-
getVoteAccounts(commitment?: Commitment): Promise<VoteAccountStatus>;
|
|
2024
|
-
getSlot(commitmentOrConfig?: Commitment | GetSlotConfig): Promise<number>;
|
|
2025
|
-
getSlotLeader(commitmentOrConfig?: Commitment | GetSlotLeaderConfig): Promise<string>;
|
|
2026
|
-
getSlotLeaders(startSlot: number, limit: number): Promise<Array<PublicKey>>;
|
|
2027
|
-
getSignatureStatus(signature: TransactionSignature, config?: SignatureStatusConfig): Promise<RpcResponseAndContext<SignatureStatus | null>>;
|
|
2028
|
-
getSignatureStatuses(signatures: Array<TransactionSignature>, config?: SignatureStatusConfig): Promise<RpcResponseAndContext<Array<SignatureStatus | null>>>;
|
|
2029
|
-
getTransactionCount(commitmentOrConfig?: Commitment | GetTransactionCountConfig): Promise<number>;
|
|
2030
|
-
getTotalSupply(commitment?: Commitment): Promise<number>;
|
|
2031
|
-
getInflationGovernor(commitment?: Commitment): Promise<InflationGovernor>;
|
|
2032
|
-
getInflationReward(addresses: PublicKey[], epoch?: number, commitmentOrConfig?: Commitment | GetInflationRewardConfig): Promise<(InflationReward | null)[]>;
|
|
2033
|
-
getInflationRate(): Promise<InflationRate>;
|
|
2034
|
-
getEpochInfo(commitmentOrConfig?: Commitment | GetEpochInfoConfig): Promise<EpochInfo>;
|
|
2035
|
-
getEpochSchedule(): Promise<EpochSchedule>;
|
|
2036
|
-
getLeaderSchedule(): Promise<LeaderSchedule>;
|
|
2037
|
-
getMinimumBalanceForRentExemption(dataLength: number, commitment?: Commitment): Promise<number>;
|
|
2038
|
-
getRecentBlockhashAndContext(commitment?: Commitment): Promise<RpcResponseAndContext<{
|
|
2039
|
-
blockhash: Blockhash;
|
|
2040
|
-
feeCalculator: FeeCalculator;
|
|
2041
|
-
}>>;
|
|
2042
|
-
getRecentPerformanceSamples(limit?: number): Promise<Array<PerfSample>>;
|
|
2043
|
-
getFeeCalculatorForBlockhash(blockhash: Blockhash, commitment?: Commitment): Promise<RpcResponseAndContext<FeeCalculator | null>>;
|
|
2044
|
-
getFeeForMessage(message: VersionedMessage, commitment?: Commitment): Promise<RpcResponseAndContext<number | null>>;
|
|
2045
|
-
getRecentPrioritizationFees(config?: GetRecentPrioritizationFeesConfig): Promise<RecentPrioritizationFees[]>;
|
|
2046
|
-
getRecentBlockhash(commitment?: Commitment): Promise<{
|
|
2047
|
-
blockhash: Blockhash;
|
|
2048
|
-
feeCalculator: FeeCalculator;
|
|
2049
|
-
}>;
|
|
2050
|
-
getLatestBlockhash(commitmentOrConfig?: Commitment | GetLatestBlockhashConfig): Promise<BlockhashWithExpiryBlockHeight>;
|
|
2051
|
-
getLatestBlockhashAndContext(commitmentOrConfig?: Commitment | GetLatestBlockhashConfig): Promise<RpcResponseAndContext<BlockhashWithExpiryBlockHeight>>;
|
|
2052
|
-
isBlockhashValid(blockhash: Blockhash, rawConfig?: IsBlockhashValidConfig): Promise<RpcResponseAndContext<boolean>>;
|
|
2053
|
-
getVersion(): Promise<Version>;
|
|
2054
|
-
getGenesisHash(): Promise<string>;
|
|
2055
|
-
getBlock(slot: number, rawConfig?: GetVersionedBlockConfig): Promise<VersionedBlockResponse | null>;
|
|
2056
|
-
getBlock(slot: number, rawConfig: GetVersionedBlockConfig & {
|
|
2057
|
-
transactionDetails: 'accounts';
|
|
2058
|
-
}): Promise<VersionedAccountsModeBlockResponse | null>;
|
|
2059
|
-
getBlock(slot: number, rawConfig: GetVersionedBlockConfig & {
|
|
2060
|
-
transactionDetails: 'none';
|
|
2061
|
-
}): Promise<VersionedNoneModeBlockResponse | null>;
|
|
2062
|
-
getParsedBlock(slot: number, rawConfig?: GetVersionedBlockConfig): Promise<ParsedAccountsModeBlockResponse>;
|
|
2063
|
-
getParsedBlock(slot: number, rawConfig: GetVersionedBlockConfig & {
|
|
2064
|
-
transactionDetails: 'accounts';
|
|
2065
|
-
}): Promise<ParsedAccountsModeBlockResponse>;
|
|
2066
|
-
getParsedBlock(slot: number, rawConfig: GetVersionedBlockConfig & {
|
|
2067
|
-
transactionDetails: 'none';
|
|
2068
|
-
}): Promise<ParsedNoneModeBlockResponse>;
|
|
2069
|
-
getBlockHeight(commitmentOrConfig?: Commitment | GetBlockHeightConfig): Promise<number>;
|
|
2070
|
-
getBlockProduction(configOrCommitment?: GetBlockProductionConfig | Commitment): Promise<RpcResponseAndContext<BlockProduction>>;
|
|
2071
|
-
getTransaction(signature: string, rawConfig?: GetVersionedTransactionConfig): Promise<VersionedTransactionResponse | null>;
|
|
2072
|
-
getParsedTransaction(signature: TransactionSignature, commitmentOrConfig?: GetVersionedTransactionConfig | Finality): Promise<ParsedTransactionWithMeta | null>;
|
|
2073
|
-
getParsedTransactions(signatures: TransactionSignature[], commitmentOrConfig?: GetVersionedTransactionConfig | Finality): Promise<(ParsedTransactionWithMeta | null)[]>;
|
|
2074
|
-
getTransactions(signatures: TransactionSignature[], commitmentOrConfig: GetVersionedTransactionConfig | Finality): Promise<(VersionedTransactionResponse | null)[]>;
|
|
2075
|
-
getConfirmedBlock(slot: number, commitment?: Finality): Promise<ConfirmedBlock>;
|
|
2076
|
-
getBlocks(startSlot: number, endSlot?: number, commitment?: Finality): Promise<Array<number>>;
|
|
2077
|
-
getBlockSignatures(slot: number, commitment?: Finality): Promise<BlockSignatures>;
|
|
2078
|
-
getConfirmedBlockSignatures(slot: number, commitment?: Finality): Promise<BlockSignatures>;
|
|
2079
|
-
getConfirmedTransaction(signature: TransactionSignature, commitment?: Finality): Promise<ConfirmedTransaction | null>;
|
|
2080
|
-
getParsedConfirmedTransaction(signature: TransactionSignature, commitment?: Finality): Promise<ParsedConfirmedTransaction | null>;
|
|
2081
|
-
getParsedConfirmedTransactions(signatures: TransactionSignature[], commitment?: Finality): Promise<(ParsedConfirmedTransaction | null)[]>;
|
|
2082
|
-
getConfirmedSignaturesForAddress(address: PublicKey, startSlot: number, endSlot: number): Promise<Array<TransactionSignature>>;
|
|
2083
|
-
getConfirmedSignaturesForAddress2(address: PublicKey, options?: ConfirmedSignaturesForAddress2Options, commitment?: Finality): Promise<Array<ConfirmedSignatureInfo>>;
|
|
2084
|
-
getSignaturesForAddress(address: PublicKey, options?: SignaturesForAddressOptions, commitment?: Finality): Promise<Array<ConfirmedSignatureInfo>>;
|
|
2085
|
-
getAddressLookupTable(accountKey: PublicKey, config?: GetAccountInfoConfig): Promise<RpcResponseAndContext<AddressLookupTableAccount | null>>;
|
|
2086
|
-
getNonceAndContext(nonceAccount: PublicKey, commitmentOrConfig?: Commitment | GetNonceAndContextConfig): Promise<RpcResponseAndContext<NonceAccount | null>>;
|
|
2087
|
-
getNonce(nonceAccount: PublicKey, commitmentOrConfig?: Commitment | GetNonceConfig): Promise<NonceAccount | null>;
|
|
2088
|
-
requestAirdrop(to: PublicKey, lamports: number): Promise<TransactionSignature>;
|
|
2089
|
-
getStakeMinimumDelegation(config?: GetStakeMinimumDelegationConfig): Promise<RpcResponseAndContext<number>>;
|
|
2090
|
-
simulateTransaction(transaction: VersionedTransaction, config?: SimulateTransactionConfig): Promise<RpcResponseAndContext<SimulatedTransactionResponse>>;
|
|
2091
|
-
sendTransaction(transaction: VersionedTransaction, options?: SendOptions): Promise<TransactionSignature>;
|
|
2092
|
-
sendRawTransaction(rawTransaction: Buffer | Uint8Array | Array<number>, options?: SendOptions): Promise<TransactionSignature>;
|
|
2093
|
-
sendEncodedTransaction(encodedTransaction: string, options?: SendOptions): Promise<TransactionSignature>;
|
|
2094
|
-
onAccountChange(publicKey: PublicKey, callback: AccountChangeCallback, config?: AccountSubscriptionConfig): ClientSubscriptionId;
|
|
2095
|
-
onProgramAccountChange(programId: PublicKey, callback: ProgramAccountChangeCallback, config?: ProgramAccountSubscriptionConfig): ClientSubscriptionId;
|
|
2096
|
-
onLogs(filter: LogsFilter, callback: LogsCallback, commitment?: Commitment): ClientSubscriptionId;
|
|
2097
|
-
onSlotChange(callback: SlotChangeCallback): ClientSubscriptionId;
|
|
2098
|
-
onSlotUpdate(callback: SlotUpdateCallback): ClientSubscriptionId;
|
|
2099
|
-
onSignature(signature: TransactionSignature, callback: SignatureResultCallback, commitment?: Commitment): ClientSubscriptionId;
|
|
2100
|
-
onSignatureWithOptions(signature: TransactionSignature, callback: SignatureSubscriptionCallback, options?: SignatureSubscriptionOptions): ClientSubscriptionId;
|
|
2101
|
-
onRootChange(callback: RootChangeCallback): ClientSubscriptionId;
|
|
2102
|
-
removeAccountChangeListener(clientSubscriptionId: ClientSubscriptionId): Promise<void>;
|
|
2103
|
-
removeProgramAccountChangeListener(clientSubscriptionId: ClientSubscriptionId): Promise<void>;
|
|
2104
|
-
removeOnLogsListener(clientSubscriptionId: ClientSubscriptionId): Promise<void>;
|
|
2105
|
-
removeSlotChangeListener(clientSubscriptionId: ClientSubscriptionId): Promise<void>;
|
|
2106
|
-
removeSlotUpdateListener(clientSubscriptionId: ClientSubscriptionId): Promise<void>;
|
|
2107
|
-
removeSignatureListener(clientSubscriptionId: ClientSubscriptionId): Promise<void>;
|
|
2108
|
-
removeRootChangeListener(clientSubscriptionId: ClientSubscriptionId): Promise<void>;
|
|
2109
|
-
}
|
|
2110
|
-
|
|
2111
1985
|
/** @internal */
|
|
2112
1986
|
declare function parseAccountData({ discriminator, data, dataHash, }: {
|
|
2113
1987
|
discriminator: BN;
|
|
@@ -2170,8 +2044,7 @@ declare function getPublicInputHash(accountProofs: MerkleContextWithMerkleProof[
|
|
|
2170
2044
|
/**
|
|
2171
2045
|
*
|
|
2172
2046
|
*/
|
|
2173
|
-
declare class Rpc extends Connection implements
|
|
2174
|
-
connection: Connection;
|
|
2047
|
+
declare class Rpc extends Connection implements CompressionApiInterface {
|
|
2175
2048
|
compressionApiEndpoint: string;
|
|
2176
2049
|
proverEndpoint: string;
|
|
2177
2050
|
/**
|
|
@@ -2183,59 +2056,6 @@ declare class Rpc extends Connection implements ConnectionInterface, Compression
|
|
|
2183
2056
|
* @param connectionConfig Optional connection config
|
|
2184
2057
|
*/
|
|
2185
2058
|
constructor(endpoint: string, compressionApiEndpoint: string, proverEndpoint: string, config?: ConnectionConfig);
|
|
2186
|
-
get commitment(): Commitment | undefined;
|
|
2187
|
-
get rpcEndpoint(): string;
|
|
2188
|
-
getBalanceAndContext(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetBalanceConfig): Promise<RpcResponseAndContext<number>>;
|
|
2189
|
-
getBalance(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetBalanceConfig): Promise<number>;
|
|
2190
|
-
getBlockTime(slot: number): Promise<number | null>;
|
|
2191
|
-
getMinimumLedgerSlot(): Promise<number>;
|
|
2192
|
-
getFirstAvailableBlock(): Promise<number>;
|
|
2193
|
-
getSupply(config?: GetSupplyConfig | Commitment): Promise<RpcResponseAndContext<Supply>>;
|
|
2194
|
-
getTokenSupply(tokenMintAddress: PublicKey, commitment?: Commitment): Promise<RpcResponseAndContext<TokenAmount>>;
|
|
2195
|
-
getTokenAccountBalance(tokenAddress: PublicKey, commitment?: Commitment): Promise<RpcResponseAndContext<TokenAmount>>;
|
|
2196
|
-
getTokenAccountsByOwner(ownerAddress: PublicKey, filter: TokenAccountsFilter, commitmentOrConfig?: Commitment | GetTokenAccountsByOwnerConfig): Promise<RpcResponseAndContext<GetProgramAccountsResponse>>;
|
|
2197
|
-
getParsedTokenAccountsByOwner(ownerAddress: PublicKey, filter: TokenAccountsFilter, commitment?: Commitment): Promise<RpcResponseAndContext<Array<{
|
|
2198
|
-
pubkey: PublicKey;
|
|
2199
|
-
account: AccountInfo<ParsedAccountData>;
|
|
2200
|
-
}>>>;
|
|
2201
|
-
getLargestAccounts(config?: GetLargestAccountsConfig): Promise<RpcResponseAndContext<Array<AccountBalancePair>>>;
|
|
2202
|
-
getTokenLargestAccounts(mintAddress: PublicKey, commitment?: Commitment): Promise<RpcResponseAndContext<Array<TokenAccountBalancePair>>>;
|
|
2203
|
-
getAccountInfoAndContext(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<RpcResponseAndContext<AccountInfo<Buffer$1> | null>>;
|
|
2204
|
-
getParsedAccountInfo(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<RpcResponseAndContext<AccountInfo<Buffer$1 | ParsedAccountData> | null>>;
|
|
2205
|
-
getAccountInfo(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<AccountInfo<Buffer$1> | null>;
|
|
2206
|
-
getMultipleParsedAccounts(publicKeys: PublicKey[], rawConfig?: GetMultipleAccountsConfig): Promise<RpcResponseAndContext<(AccountInfo<Buffer$1 | ParsedAccountData> | null)[]>>;
|
|
2207
|
-
getMultipleAccountsInfoAndContext(publicKeys: PublicKey[], commitmentOrConfig?: Commitment | GetMultipleAccountsConfig): Promise<RpcResponseAndContext<(AccountInfo<Buffer$1> | null)[]>>;
|
|
2208
|
-
getMultipleAccountsInfo(publicKeys: PublicKey[], commitmentOrConfig?: Commitment | GetMultipleAccountsConfig): Promise<(AccountInfo<Buffer$1> | null)[]>;
|
|
2209
|
-
getStakeActivation(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetStakeActivationConfig, epoch?: number): Promise<StakeActivationData>;
|
|
2210
|
-
getProgramAccounts(programId: PublicKey, configOrCommitment?: GetProgramAccountsConfig | Commitment): Promise<GetProgramAccountsResponse>;
|
|
2211
|
-
getProgramAccounts(programId: PublicKey, configOrCommitment: GetProgramAccountsConfig & {
|
|
2212
|
-
withContext: true;
|
|
2213
|
-
}): Promise<RpcResponseAndContext<GetProgramAccountsResponse>>;
|
|
2214
|
-
getParsedProgramAccounts(programId: PublicKey, configOrCommitment?: GetParsedProgramAccountsConfig | Commitment): Promise<Array<{
|
|
2215
|
-
pubkey: PublicKey;
|
|
2216
|
-
account: AccountInfo<Buffer$1 | ParsedAccountData>;
|
|
2217
|
-
}>>;
|
|
2218
|
-
getParsedBlock(slot: number, rawConfig?: GetVersionedBlockConfig): Promise<ParsedAccountsModeBlockResponse>;
|
|
2219
|
-
getParsedBlock(slot: number, rawConfig: GetVersionedBlockConfig & {
|
|
2220
|
-
transactionDetails: 'accounts';
|
|
2221
|
-
}): Promise<ParsedAccountsModeBlockResponse>;
|
|
2222
|
-
getParsedBlock(slot: number, rawConfig: GetVersionedBlockConfig & {
|
|
2223
|
-
transactionDetails: 'none';
|
|
2224
|
-
}): Promise<ParsedNoneModeBlockResponse>;
|
|
2225
|
-
getConfirmedTransaction(signature: TransactionSignature, commitment?: Finality): Promise<ConfirmedTransaction | null>;
|
|
2226
|
-
getParsedConfirmedTransaction(signature: TransactionSignature, commitment?: Finality): Promise<ParsedConfirmedTransaction | null>;
|
|
2227
|
-
getParsedConfirmedTransactions(signatures: TransactionSignature[], commitment?: Finality): Promise<(ParsedConfirmedTransaction | null)[]>;
|
|
2228
|
-
getConfirmedSignaturesForAddress(address: PublicKey, startSlot: number, endSlot: number): Promise<Array<TransactionSignature>>;
|
|
2229
|
-
getConfirmedSignaturesForAddress2(address: PublicKey, options?: ConfirmedSignaturesForAddress2Options, commitment?: Finality): Promise<Array<ConfirmedSignatureInfo>>;
|
|
2230
|
-
getSignaturesForAddress(address: PublicKey, options?: SignaturesForAddressOptions, commitment?: Finality): Promise<Array<ConfirmedSignatureInfo>>;
|
|
2231
|
-
getRecentPrioritizationFees(config?: GetRecentPrioritizationFeesConfig): Promise<RecentPrioritizationFees[]>;
|
|
2232
|
-
getLatestBlockhash(config?: GetLatestBlockhashConfig): Promise<BlockhashWithExpiryBlockHeight>;
|
|
2233
|
-
getLatestBlockhashAndContext(commitmentOrConfig?: Commitment | GetLatestBlockhashConfig): Promise<RpcResponseAndContext<BlockhashWithExpiryBlockHeight>>;
|
|
2234
|
-
isBlockhashValid(blockhash: Blockhash, config?: IsBlockhashValidConfig): Promise<RpcResponseAndContext<boolean>>;
|
|
2235
|
-
getVersion(): Promise<Version>;
|
|
2236
|
-
getAddressLookupTable(accountKey: PublicKey, config?: GetAccountInfoConfig): Promise<RpcResponseAndContext<AddressLookupTableAccount | null>>;
|
|
2237
|
-
getNonceAndContext(nonceAccount: PublicKey, commitmentOrConfig?: Commitment | GetNonceAndContextConfig): Promise<RpcResponseAndContext<NonceAccount | null>>;
|
|
2238
|
-
getNonce(nonceAccount: PublicKey, commitmentOrConfig?: Commitment | GetNonceConfig): Promise<NonceAccount | null>;
|
|
2239
2059
|
/**
|
|
2240
2060
|
* Fetch the compressed account for the specified account address or hash
|
|
2241
2061
|
*/
|
|
@@ -2907,4 +2727,4 @@ declare class MerkleTreeError extends MetaError {
|
|
|
2907
2727
|
declare class UtilsError extends MetaError {
|
|
2908
2728
|
}
|
|
2909
2729
|
|
|
2910
|
-
export { ADDRESS_QUEUE_ROLLOVER_FEE, ADDRESS_TREE_NETWORK_FEE, ALICE, AccountProofResult, type AddressWithTree, type BN254, BOB, BalanceResult, BaseRpc, CHARLIE, type ClientSubscriptionId
|
|
2730
|
+
export { ADDRESS_QUEUE_ROLLOVER_FEE, ADDRESS_TREE_NETWORK_FEE, ALICE, AccountProofResult, type AddressWithTree, type BN254, BOB, BalanceResult, BaseRpc, CHARLIE, type ClientSubscriptionId, type CompressedAccount, type CompressedAccountData, CompressedAccountLayout, CompressedAccountResult, type CompressedAccountWithMerkleContext, CompressedAccountsByOwnerResult, type CompressedMintTokenHolders, CompressedMintTokenHoldersResult, type CompressedProof, type CompressedProofWithContext, CompressedTokenAccountResult, CompressedTokenAccountsByOwnerOrDelegateResult, type CompressedTransaction, CompressedTransactionResult, type CompressionApiInterface, CreateUtxoError, CreateUtxoErrorCode, DAVE, DEFAULT_MERKLE_TREE_HEIGHT, DEFAULT_MERKLE_TREE_ROOTS, DEFAULT_ZERO, type EventWithParsedTokenTlvData, FIELD_SIZE, type GetCompressedAccountConfig, type GetCompressedAccountsByOwnerConfig, type GetCompressedAccountsConfig, type GetCompressedAccountsFilter, type GetCompressedTokenAccountsByOwnerOrDelegateOptions, HIGHEST_ADDRESS_PLUS_ONE, HashError, HashErrorCode, type HashWithTree, HealthResult, type HexBatchInputsForProver, type HexInputsForProver, IndexedArray, IndexedElement, IndexedElementBundle, type InputTokenDataWithContext, type InstructionDataInvoke, InstructionDataInvokeLayout, type LatestNonVotingSignatures, type LatestNonVotingSignaturesPaginated, LatestNonVotingSignaturesResult, LatestNonVotingSignaturesResultPaginated, LightSystemProgram, type LightWasm, LookupTableError, LookupTableErrorCode, MerkeProofResult, type MerkleContext, MerkleContextLayout, type MerkleContextWithMerkleProof, type MerkleContextWithNewAddressProof, MerkleTree, MerkleTreeError, MerkleTreeErrorCode, MultipleCompressedAccountsResult, MultipleMerkleProofsResult, NativeBalanceResult, type NewAddressParams, NewAddressParamsLayout, type NewAddressParamsPacked, NewAddressProofResult, type NonInclusionJsonStruct, type NonInclusionMerkleProofInputs, type OutputCompressedAccountWithPackedContext, type PackedCompressedAccountWithMerkleContext, type PackedMerkleContext, type PaginatedOptions, type ParsedTokenAccount, ProofError, ProofErrorCode, type PublicTransactionEvent, PublicTransactionEventLayout, type QueueIndex, Rpc, RpcError, RpcErrorCode, type RpcResult, type RpcResultError, type RpcResultSuccess, STATE_MERKLE_TREE_NETWORK_FEE, STATE_MERKLE_TREE_ROLLOVER_FEE, SelectInUtxosError, SelectInUtxosErrorCode, SignatureListResult, SignatureListWithCursorResult, type SignatureWithMetadata, SlotResult, TRANSACTION_MERKLE_TREE_ROLLOVER_THRESHOLD, TestRpc, type TestRpcConfig, type TokenBalance, TokenBalanceListResult, TokenBalanceListResultV2, TokenBalanceResult, type TokenData$1 as TokenData, TokenDataLayout, TokenDataResult, UTXO_MERGE_MAXIMUM, UTXO_MERGE_THRESHOLD, UtilsError, UtilsErrorCode, UtxoError, UtxoErrorCode, ValidityProofResult, type WithContext, type WithCursor, type WithRpcContext, accountCompressionProgram, addressQueue, addressTree, airdropSol, bn, bufToDecStr, buildAndSignTx, buildTx, byteArrayToKeypair, calculateComputeUnitPrice, checkValidityProofShape, compress, confirmConfig, confirmTransaction, confirmTx, convertMerkleProofsWithContextToHex, convertNonInclusionMerkleProofInputsToHex, createAccount, createAccountWithLamports, createBN254, createCompressedAccount, createCompressedAccountWithMerkleContext, createMerkleContext, createRpc, createRpcResult, decodeInstructionDataInvoke, decodePublicTransactionEvent, decompress, dedupeSigner, defaultStaticAccounts, defaultStaticAccountsStruct, defaultTestStateTreeAccounts, deriveAddress, deriveAddressSeed, encodeBN254toBase58, encodeInstructionDataInvoke, encodePublicTransactionEvent, getAccountCompressionAuthority, getCompressedTokenAccountByHashTest, getCompressedTokenAccounts, getCompressedTokenAccountsByDelegateTest, getCompressedTokenAccountsByOwnerTest, getConnection, getIndexOrAdd, getParsedEvents, getPublicInputHash, getRegisteredProgramPda, getTestKeypair, getTestRpc, hashToBn254FieldSizeBe, hashvToBn254FieldSizeBe, invokeAccountsLayout, type invokeAccountsLayoutParams, jsonRpcResult, jsonRpcResultAndContext, lightProgram, merkletreePubkey, negateAndCompressProof, newAccountWithLamports, noopProgram, nullifierQueuePubkey, packCompressedAccounts, packNewAddressParams, padOutputStateMerkleTrees, parseAccountData, parseEvents, parsePublicTransactionEventWithIdl, parseTokenLayoutWithIdl, pipe, placeholderValidityProof, proofFromJsonStruct, proverRequest, pushUniqueItems, rpcRequest, selectMinCompressedSolAccountsForTransfer, sendAndConfirmTx, sleep, sumUpLamports, toAccountMetas, toArray, toCamelCase, toHex, toUnixTimestamp, transfer, validateSameOwner, validateSufficientBalance };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightprotocol/stateless.js",
|
|
3
|
-
"version": "0.17.2-alpha.
|
|
3
|
+
"version": "0.17.2-alpha.1",
|
|
4
4
|
"description": "JavaScript API for Light and ZK Compression",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/node/index.cjs",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
],
|
|
36
36
|
"license": "Apache-2.0",
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@solana/web3.js": ">=1.
|
|
38
|
+
"@solana/web3.js": ">=1.73.5"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@coral-xyz/borsh": "^0.30.1",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@rollup/plugin-replace": "^5.0.7",
|
|
59
59
|
"@rollup/plugin-terser": "^0.4.4",
|
|
60
60
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
61
|
-
"@solana/web3.js": "1.
|
|
61
|
+
"@solana/web3.js": "1.98.0",
|
|
62
62
|
"@types/bn.js": "^5.1.5",
|
|
63
63
|
"@types/node": "^22.5.5",
|
|
64
64
|
"@typescript-eslint/eslint-plugin": "^7.13.1",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"scripts": {
|
|
96
96
|
"test": "pnpm test:unit:all && pnpm test:e2e:all",
|
|
97
97
|
"test-all": "vitest run",
|
|
98
|
-
"test:unit:all": "vitest run tests/unit",
|
|
98
|
+
"test:unit:all": "vitest run tests/unit --reporter=verbose",
|
|
99
99
|
"test-validator": "./../../cli/test_bin/run test-validator --prover-run-mode rpc",
|
|
100
100
|
"test:e2e:transfer": "pnpm test-validator && vitest run tests/e2e/transfer.test.ts --reporter=verbose",
|
|
101
101
|
"test:e2e:compress": "pnpm test-validator && vitest run tests/e2e/compress.test.ts --reporter=verbose",
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { PublicKey, Commitment, GetBalanceConfig, RpcResponseAndContext, Supply, TokenAmount, GetSupplyConfig, TokenAccountsFilter, GetProgramAccountsResponse, GetTokenAccountsByOwnerConfig, AccountInfo, ParsedAccountData, GetLargestAccountsConfig, AccountBalancePair, TokenAccountBalancePair, GetAccountInfoConfig, GetMultipleAccountsConfig, StakeActivationData, GetBlockHeightConfig, GetBlockProductionConfig, BlockProduction, GetLatestBlockhashConfig, BlockhashWithExpiryBlockHeight, SimulatedTransactionResponse, SimulateTransactionConfig, SendOptions, TransactionSignature, AddressLookupTableAccount, GetParsedProgramAccountsConfig, Finality, GetVersionedBlockConfig, VersionedBlockResponse, VersionedAccountsModeBlockResponse, VersionedNoneModeBlockResponse, ParsedAccountsModeBlockResponse, ParsedNoneModeBlockResponse, ParsedTransactionWithMeta, VersionedTransaction, VersionedTransactionResponse, ConfirmedBlock, ConfirmedSignatureInfo, ConfirmedSignaturesForAddress2Options, SignatureStatusConfig, SignatureStatus, Version, VoteAccountStatus, GetSlotConfig, GetSlotLeaderConfig, GetProgramAccountsConfig, SignatureResult, TransactionConfirmationStrategy, AccountChangeCallback, ProgramAccountChangeCallback, LogsCallback, SlotChangeCallback, SlotUpdateCallback, SignatureResultCallback, SignatureSubscriptionCallback, SignatureSubscriptionOptions, RootChangeCallback, GetStakeActivationConfig, InflationGovernor, GetTransactionCountConfig, GetInflationRewardConfig, InflationReward, InflationRate, GetEpochInfoConfig, EpochInfo, EpochSchedule, LeaderSchedule, Blockhash, FeeCalculator, PerfSample, VersionedMessage, GetRecentPrioritizationFeesConfig, RecentPrioritizationFees, IsBlockhashValidConfig, GetVersionedTransactionConfig, ParsedConfirmedTransaction, ConfirmedTransaction, BlockSignatures, SignaturesForAddressOptions, GetNonceAndContextConfig, NonceAccount, GetNonceConfig, GetStakeMinimumDelegationConfig, AccountSubscriptionConfig, ProgramAccountSubscriptionConfig, LogsFilter, ContactInfo } from '@solana/web3.js';
|
|
2
|
-
export type ClientSubscriptionId = number;
|
|
3
|
-
export interface ConnectionInterface {
|
|
4
|
-
readonly commitment?: Commitment;
|
|
5
|
-
readonly rpcEndpoint: string;
|
|
6
|
-
getBalanceAndContext(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetBalanceConfig): Promise<RpcResponseAndContext<number>>;
|
|
7
|
-
getBalance(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetBalanceConfig): Promise<number>;
|
|
8
|
-
getBlockTime(slot: number): Promise<number | null>;
|
|
9
|
-
getMinimumLedgerSlot(): Promise<number>;
|
|
10
|
-
getFirstAvailableBlock(): Promise<number>;
|
|
11
|
-
getSupply(config?: GetSupplyConfig | Commitment): Promise<RpcResponseAndContext<Supply>>;
|
|
12
|
-
getTokenSupply(tokenMintAddress: PublicKey, commitment?: Commitment): Promise<RpcResponseAndContext<TokenAmount>>;
|
|
13
|
-
getTokenAccountBalance(tokenAddress: PublicKey, commitment?: Commitment): Promise<RpcResponseAndContext<TokenAmount>>;
|
|
14
|
-
getTokenAccountsByOwner(ownerAddress: PublicKey, filter: TokenAccountsFilter, commitmentOrConfig?: Commitment | GetTokenAccountsByOwnerConfig): Promise<RpcResponseAndContext<GetProgramAccountsResponse>>;
|
|
15
|
-
getParsedTokenAccountsByOwner(ownerAddress: PublicKey, filter: TokenAccountsFilter, commitment?: Commitment): Promise<RpcResponseAndContext<Array<{
|
|
16
|
-
pubkey: PublicKey;
|
|
17
|
-
account: AccountInfo<ParsedAccountData>;
|
|
18
|
-
}>>>;
|
|
19
|
-
getLargestAccounts(config?: GetLargestAccountsConfig): Promise<RpcResponseAndContext<Array<AccountBalancePair>>>;
|
|
20
|
-
getTokenLargestAccounts(mintAddress: PublicKey, commitment?: Commitment): Promise<RpcResponseAndContext<Array<TokenAccountBalancePair>>>;
|
|
21
|
-
getAccountInfoAndContext(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<RpcResponseAndContext<AccountInfo<Buffer> | null>>;
|
|
22
|
-
getParsedAccountInfo(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<RpcResponseAndContext<AccountInfo<Buffer | ParsedAccountData> | null>>;
|
|
23
|
-
getAccountInfo(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<AccountInfo<Buffer> | null>;
|
|
24
|
-
getMultipleParsedAccounts(publicKeys: PublicKey[], rawConfig?: GetMultipleAccountsConfig): Promise<RpcResponseAndContext<(AccountInfo<Buffer | ParsedAccountData> | null)[]>>;
|
|
25
|
-
getMultipleAccountsInfoAndContext(publicKeys: PublicKey[], commitmentOrConfig?: Commitment | GetMultipleAccountsConfig): Promise<RpcResponseAndContext<(AccountInfo<Buffer> | null)[]>>;
|
|
26
|
-
getMultipleAccountsInfo(publicKeys: PublicKey[], commitmentOrConfig?: Commitment | GetMultipleAccountsConfig): Promise<(AccountInfo<Buffer> | null)[]>;
|
|
27
|
-
getStakeActivation(publicKey: PublicKey, commitmentOrConfig?: Commitment | GetStakeActivationConfig, epoch?: number): Promise<StakeActivationData>;
|
|
28
|
-
getProgramAccounts(programId: PublicKey, configOrCommitment?: GetProgramAccountsConfig | Commitment): Promise<GetProgramAccountsResponse>;
|
|
29
|
-
getProgramAccounts(programId: PublicKey, configOrCommitment: GetProgramAccountsConfig & {
|
|
30
|
-
withContext: true;
|
|
31
|
-
}): Promise<RpcResponseAndContext<GetProgramAccountsResponse>>;
|
|
32
|
-
getParsedProgramAccounts(programId: PublicKey, configOrCommitment?: GetParsedProgramAccountsConfig | Commitment): Promise<Array<{
|
|
33
|
-
pubkey: PublicKey;
|
|
34
|
-
account: AccountInfo<Buffer | ParsedAccountData>;
|
|
35
|
-
}>>;
|
|
36
|
-
confirmTransaction(strategy: TransactionConfirmationStrategy, commitment?: Commitment): Promise<RpcResponseAndContext<SignatureResult>>;
|
|
37
|
-
confirmTransaction(strategy: TransactionSignature, commitment?: Commitment): Promise<RpcResponseAndContext<SignatureResult>>;
|
|
38
|
-
getClusterNodes(): Promise<Array<ContactInfo>>;
|
|
39
|
-
getVoteAccounts(commitment?: Commitment): Promise<VoteAccountStatus>;
|
|
40
|
-
getSlot(commitmentOrConfig?: Commitment | GetSlotConfig): Promise<number>;
|
|
41
|
-
getSlotLeader(commitmentOrConfig?: Commitment | GetSlotLeaderConfig): Promise<string>;
|
|
42
|
-
getSlotLeaders(startSlot: number, limit: number): Promise<Array<PublicKey>>;
|
|
43
|
-
getSignatureStatus(signature: TransactionSignature, config?: SignatureStatusConfig): Promise<RpcResponseAndContext<SignatureStatus | null>>;
|
|
44
|
-
getSignatureStatuses(signatures: Array<TransactionSignature>, config?: SignatureStatusConfig): Promise<RpcResponseAndContext<Array<SignatureStatus | null>>>;
|
|
45
|
-
getTransactionCount(commitmentOrConfig?: Commitment | GetTransactionCountConfig): Promise<number>;
|
|
46
|
-
getTotalSupply(commitment?: Commitment): Promise<number>;
|
|
47
|
-
getInflationGovernor(commitment?: Commitment): Promise<InflationGovernor>;
|
|
48
|
-
getInflationReward(addresses: PublicKey[], epoch?: number, commitmentOrConfig?: Commitment | GetInflationRewardConfig): Promise<(InflationReward | null)[]>;
|
|
49
|
-
getInflationRate(): Promise<InflationRate>;
|
|
50
|
-
getEpochInfo(commitmentOrConfig?: Commitment | GetEpochInfoConfig): Promise<EpochInfo>;
|
|
51
|
-
getEpochSchedule(): Promise<EpochSchedule>;
|
|
52
|
-
getLeaderSchedule(): Promise<LeaderSchedule>;
|
|
53
|
-
getMinimumBalanceForRentExemption(dataLength: number, commitment?: Commitment): Promise<number>;
|
|
54
|
-
getRecentBlockhashAndContext(commitment?: Commitment): Promise<RpcResponseAndContext<{
|
|
55
|
-
blockhash: Blockhash;
|
|
56
|
-
feeCalculator: FeeCalculator;
|
|
57
|
-
}>>;
|
|
58
|
-
getRecentPerformanceSamples(limit?: number): Promise<Array<PerfSample>>;
|
|
59
|
-
getFeeCalculatorForBlockhash(blockhash: Blockhash, commitment?: Commitment): Promise<RpcResponseAndContext<FeeCalculator | null>>;
|
|
60
|
-
getFeeForMessage(message: VersionedMessage, commitment?: Commitment): Promise<RpcResponseAndContext<number | null>>;
|
|
61
|
-
getRecentPrioritizationFees(config?: GetRecentPrioritizationFeesConfig): Promise<RecentPrioritizationFees[]>;
|
|
62
|
-
getRecentBlockhash(commitment?: Commitment): Promise<{
|
|
63
|
-
blockhash: Blockhash;
|
|
64
|
-
feeCalculator: FeeCalculator;
|
|
65
|
-
}>;
|
|
66
|
-
getLatestBlockhash(commitmentOrConfig?: Commitment | GetLatestBlockhashConfig): Promise<BlockhashWithExpiryBlockHeight>;
|
|
67
|
-
getLatestBlockhashAndContext(commitmentOrConfig?: Commitment | GetLatestBlockhashConfig): Promise<RpcResponseAndContext<BlockhashWithExpiryBlockHeight>>;
|
|
68
|
-
isBlockhashValid(blockhash: Blockhash, rawConfig?: IsBlockhashValidConfig): Promise<RpcResponseAndContext<boolean>>;
|
|
69
|
-
getVersion(): Promise<Version>;
|
|
70
|
-
getGenesisHash(): Promise<string>;
|
|
71
|
-
getBlock(slot: number, rawConfig?: GetVersionedBlockConfig): Promise<VersionedBlockResponse | null>;
|
|
72
|
-
getBlock(slot: number, rawConfig: GetVersionedBlockConfig & {
|
|
73
|
-
transactionDetails: 'accounts';
|
|
74
|
-
}): Promise<VersionedAccountsModeBlockResponse | null>;
|
|
75
|
-
getBlock(slot: number, rawConfig: GetVersionedBlockConfig & {
|
|
76
|
-
transactionDetails: 'none';
|
|
77
|
-
}): Promise<VersionedNoneModeBlockResponse | null>;
|
|
78
|
-
getParsedBlock(slot: number, rawConfig?: GetVersionedBlockConfig): Promise<ParsedAccountsModeBlockResponse>;
|
|
79
|
-
getParsedBlock(slot: number, rawConfig: GetVersionedBlockConfig & {
|
|
80
|
-
transactionDetails: 'accounts';
|
|
81
|
-
}): Promise<ParsedAccountsModeBlockResponse>;
|
|
82
|
-
getParsedBlock(slot: number, rawConfig: GetVersionedBlockConfig & {
|
|
83
|
-
transactionDetails: 'none';
|
|
84
|
-
}): Promise<ParsedNoneModeBlockResponse>;
|
|
85
|
-
getBlockHeight(commitmentOrConfig?: Commitment | GetBlockHeightConfig): Promise<number>;
|
|
86
|
-
getBlockProduction(configOrCommitment?: GetBlockProductionConfig | Commitment): Promise<RpcResponseAndContext<BlockProduction>>;
|
|
87
|
-
getTransaction(signature: string, rawConfig?: GetVersionedTransactionConfig): Promise<VersionedTransactionResponse | null>;
|
|
88
|
-
getParsedTransaction(signature: TransactionSignature, commitmentOrConfig?: GetVersionedTransactionConfig | Finality): Promise<ParsedTransactionWithMeta | null>;
|
|
89
|
-
getParsedTransactions(signatures: TransactionSignature[], commitmentOrConfig?: GetVersionedTransactionConfig | Finality): Promise<(ParsedTransactionWithMeta | null)[]>;
|
|
90
|
-
getTransactions(signatures: TransactionSignature[], commitmentOrConfig: GetVersionedTransactionConfig | Finality): Promise<(VersionedTransactionResponse | null)[]>;
|
|
91
|
-
getConfirmedBlock(slot: number, commitment?: Finality): Promise<ConfirmedBlock>;
|
|
92
|
-
getBlocks(startSlot: number, endSlot?: number, commitment?: Finality): Promise<Array<number>>;
|
|
93
|
-
getBlockSignatures(slot: number, commitment?: Finality): Promise<BlockSignatures>;
|
|
94
|
-
getConfirmedBlockSignatures(slot: number, commitment?: Finality): Promise<BlockSignatures>;
|
|
95
|
-
getConfirmedTransaction(signature: TransactionSignature, commitment?: Finality): Promise<ConfirmedTransaction | null>;
|
|
96
|
-
getParsedConfirmedTransaction(signature: TransactionSignature, commitment?: Finality): Promise<ParsedConfirmedTransaction | null>;
|
|
97
|
-
getParsedConfirmedTransactions(signatures: TransactionSignature[], commitment?: Finality): Promise<(ParsedConfirmedTransaction | null)[]>;
|
|
98
|
-
getConfirmedSignaturesForAddress(address: PublicKey, startSlot: number, endSlot: number): Promise<Array<TransactionSignature>>;
|
|
99
|
-
getConfirmedSignaturesForAddress2(address: PublicKey, options?: ConfirmedSignaturesForAddress2Options, commitment?: Finality): Promise<Array<ConfirmedSignatureInfo>>;
|
|
100
|
-
getSignaturesForAddress(address: PublicKey, options?: SignaturesForAddressOptions, commitment?: Finality): Promise<Array<ConfirmedSignatureInfo>>;
|
|
101
|
-
getAddressLookupTable(accountKey: PublicKey, config?: GetAccountInfoConfig): Promise<RpcResponseAndContext<AddressLookupTableAccount | null>>;
|
|
102
|
-
getNonceAndContext(nonceAccount: PublicKey, commitmentOrConfig?: Commitment | GetNonceAndContextConfig): Promise<RpcResponseAndContext<NonceAccount | null>>;
|
|
103
|
-
getNonce(nonceAccount: PublicKey, commitmentOrConfig?: Commitment | GetNonceConfig): Promise<NonceAccount | null>;
|
|
104
|
-
requestAirdrop(to: PublicKey, lamports: number): Promise<TransactionSignature>;
|
|
105
|
-
getStakeMinimumDelegation(config?: GetStakeMinimumDelegationConfig): Promise<RpcResponseAndContext<number>>;
|
|
106
|
-
simulateTransaction(transaction: VersionedTransaction, config?: SimulateTransactionConfig): Promise<RpcResponseAndContext<SimulatedTransactionResponse>>;
|
|
107
|
-
sendTransaction(transaction: VersionedTransaction, options?: SendOptions): Promise<TransactionSignature>;
|
|
108
|
-
sendRawTransaction(rawTransaction: Buffer | Uint8Array | Array<number>, options?: SendOptions): Promise<TransactionSignature>;
|
|
109
|
-
sendEncodedTransaction(encodedTransaction: string, options?: SendOptions): Promise<TransactionSignature>;
|
|
110
|
-
onAccountChange(publicKey: PublicKey, callback: AccountChangeCallback, config?: AccountSubscriptionConfig): ClientSubscriptionId;
|
|
111
|
-
onProgramAccountChange(programId: PublicKey, callback: ProgramAccountChangeCallback, config?: ProgramAccountSubscriptionConfig): ClientSubscriptionId;
|
|
112
|
-
onLogs(filter: LogsFilter, callback: LogsCallback, commitment?: Commitment): ClientSubscriptionId;
|
|
113
|
-
onSlotChange(callback: SlotChangeCallback): ClientSubscriptionId;
|
|
114
|
-
onSlotUpdate(callback: SlotUpdateCallback): ClientSubscriptionId;
|
|
115
|
-
onSignature(signature: TransactionSignature, callback: SignatureResultCallback, commitment?: Commitment): ClientSubscriptionId;
|
|
116
|
-
onSignatureWithOptions(signature: TransactionSignature, callback: SignatureSubscriptionCallback, options?: SignatureSubscriptionOptions): ClientSubscriptionId;
|
|
117
|
-
onRootChange(callback: RootChangeCallback): ClientSubscriptionId;
|
|
118
|
-
removeAccountChangeListener(clientSubscriptionId: ClientSubscriptionId): Promise<void>;
|
|
119
|
-
removeProgramAccountChangeListener(clientSubscriptionId: ClientSubscriptionId): Promise<void>;
|
|
120
|
-
removeOnLogsListener(clientSubscriptionId: ClientSubscriptionId): Promise<void>;
|
|
121
|
-
removeSlotChangeListener(clientSubscriptionId: ClientSubscriptionId): Promise<void>;
|
|
122
|
-
removeSlotUpdateListener(clientSubscriptionId: ClientSubscriptionId): Promise<void>;
|
|
123
|
-
removeSignatureListener(clientSubscriptionId: ClientSubscriptionId): Promise<void>;
|
|
124
|
-
removeRootChangeListener(clientSubscriptionId: ClientSubscriptionId): Promise<void>;
|
|
125
|
-
}
|