@lightprotocol/stateless.js 0.17.2-alpha.0 → 0.17.2-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/dist/cjs/browser/constants.d.ts +2 -0
- package/dist/cjs/browser/idl.d.ts +1015 -0
- package/dist/cjs/browser/index.cjs +1 -1
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/browser/index.d.ts +1 -0
- package/dist/cjs/browser/rpc-interface.d.ts +110 -117
- package/dist/cjs/browser/rpc.d.ts +2 -57
- package/dist/cjs/browser/state/types.d.ts +5 -0
- package/dist/cjs/browser/test-helpers/test-rpc/test-rpc.d.ts +2 -3
- package/dist/cjs/browser/utils/test-utils.d.ts +8 -0
- package/dist/cjs/node/constants.d.ts +2 -0
- package/dist/cjs/node/idl.d.ts +1015 -0
- package/dist/cjs/node/index.cjs +1 -1
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/cjs/node/index.d.ts +1 -0
- package/dist/cjs/node/rpc-interface.d.ts +110 -117
- package/dist/cjs/node/rpc.d.ts +2 -57
- package/dist/cjs/node/state/types.d.ts +5 -0
- package/dist/cjs/node/test-helpers/test-rpc/test-rpc.d.ts +2 -3
- package/dist/cjs/node/utils/test-utils.d.ts +8 -0
- package/dist/types/index.d.ts +1036 -193
- package/package.json +9 -8
- package/dist/cjs/browser/connection-interface.d.ts +0 -125
- package/dist/cjs/node/connection-interface.d.ts +0 -125
- package/dist/es/browser/actions/common.d.ts +0 -3
- package/dist/es/browser/actions/compress.d.ts +0 -16
- package/dist/es/browser/actions/create-account.d.ts +0 -41
- package/dist/es/browser/actions/decompress.d.ts +0 -16
- package/dist/es/browser/actions/index.d.ts +0 -5
- package/dist/es/browser/actions/transfer.d.ts +0 -20
- package/dist/es/browser/connection-interface.d.ts +0 -125
- package/dist/es/browser/constants.d.ts +0 -63
- package/dist/es/browser/errors.d.ts +0 -74
- package/dist/es/browser/index.d.ts +0 -10
- package/dist/es/browser/index.js +0 -2
- package/dist/es/browser/index.js.map +0 -1
- package/dist/es/browser/instruction/index.d.ts +0 -1
- package/dist/es/browser/instruction/pack-compressed-accounts.d.ts +0 -35
- package/dist/es/browser/programs/index.d.ts +0 -2
- package/dist/es/browser/programs/layout.d.ts +0 -25
- package/dist/es/browser/programs/system.d.ts +0 -199
- package/dist/es/browser/rpc-interface.d.ts +0 -1179
- package/dist/es/browser/rpc.d.ts +0 -330
- package/dist/es/browser/state/BN254.d.ts +0 -14
- package/dist/es/browser/state/compressed-account.d.ts +0 -31
- package/dist/es/browser/state/index.d.ts +0 -3
- package/dist/es/browser/state/types.d.ts +0 -91
- package/dist/es/browser/test-helpers/index.d.ts +0 -2
- package/dist/es/browser/test-helpers/merkle-tree/index.d.ts +0 -2
- package/dist/es/browser/test-helpers/merkle-tree/indexed-array.d.ts +0 -85
- package/dist/es/browser/test-helpers/merkle-tree/merkle-tree.d.ts +0 -92
- package/dist/es/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +0 -7
- package/dist/es/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +0 -40
- package/dist/es/browser/test-helpers/test-rpc/get-parsed-events.d.ts +0 -13
- package/dist/es/browser/test-helpers/test-rpc/index.d.ts +0 -3
- package/dist/es/browser/test-helpers/test-rpc/test-rpc.d.ts +0 -250
- package/dist/es/browser/utils/address.d.ts +0 -63
- package/dist/es/browser/utils/airdrop.d.ts +0 -7
- package/dist/es/browser/utils/calculate-compute-unit-price.d.ts +0 -7
- package/dist/es/browser/utils/conversion.d.ts +0 -31
- package/dist/es/browser/utils/index.d.ts +0 -10
- package/dist/es/browser/utils/parse-validity-proof.d.ts +0 -20
- package/dist/es/browser/utils/pipe.d.ts +0 -2
- package/dist/es/browser/utils/send-and-confirm.d.ts +0 -52
- package/dist/es/browser/utils/sleep.d.ts +0 -1
- package/dist/es/browser/utils/test-utils.d.ts +0 -23
- package/dist/es/browser/utils/validation.d.ts +0 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightprotocol/stateless.js",
|
|
3
|
-
"version": "0.17.2-alpha.
|
|
4
|
-
"description": "JavaScript API for Light
|
|
3
|
+
"version": "0.17.2-alpha.2",
|
|
4
|
+
"description": "JavaScript API for Light & ZK Compression",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/node/index.cjs",
|
|
7
7
|
"type": "module",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"require": "./dist/cjs/node/index.cjs",
|
|
11
11
|
"types": "./dist/types/index.d.ts",
|
|
12
|
-
"
|
|
12
|
+
"default": "./dist/cjs/node/index.cjs"
|
|
13
13
|
},
|
|
14
14
|
"./browser": {
|
|
15
15
|
"import": "./dist/es/browser/index.js",
|
|
@@ -35,10 +35,10 @@
|
|
|
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
|
-
"@coral-xyz/borsh": "^0.
|
|
41
|
+
"@coral-xyz/borsh": "^0.29.0",
|
|
42
42
|
"@noble/hashes": "1.5.0",
|
|
43
43
|
"bn.js": "^5.2.1",
|
|
44
44
|
"bs58": "^6.0.0",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"superstruct": "2.0.2"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
+
"@coral-xyz/anchor": "0.29.0",
|
|
51
52
|
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
|
|
52
53
|
"@lightprotocol/hasher.rs": "0.2.1",
|
|
53
54
|
"@playwright/test": "^1.47.1",
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
"@rollup/plugin-replace": "^5.0.7",
|
|
59
60
|
"@rollup/plugin-terser": "^0.4.4",
|
|
60
61
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
61
|
-
"@solana/web3.js": "1.
|
|
62
|
+
"@solana/web3.js": "1.98.0",
|
|
62
63
|
"@types/bn.js": "^5.1.5",
|
|
63
64
|
"@types/node": "^22.5.5",
|
|
64
65
|
"@typescript-eslint/eslint-plugin": "^7.13.1",
|
|
@@ -95,7 +96,7 @@
|
|
|
95
96
|
"scripts": {
|
|
96
97
|
"test": "pnpm test:unit:all && pnpm test:e2e:all",
|
|
97
98
|
"test-all": "vitest run",
|
|
98
|
-
"test:unit:all": "vitest run tests/unit",
|
|
99
|
+
"test:unit:all": "vitest run tests/unit --reporter=verbose",
|
|
99
100
|
"test-validator": "./../../cli/test_bin/run test-validator --prover-run-mode rpc",
|
|
100
101
|
"test:e2e:transfer": "pnpm test-validator && vitest run tests/e2e/transfer.test.ts --reporter=verbose",
|
|
101
102
|
"test:e2e:compress": "pnpm test-validator && vitest run tests/e2e/compress.test.ts --reporter=verbose",
|
|
@@ -104,7 +105,7 @@
|
|
|
104
105
|
"test:e2e:browser": "pnpm playwright test",
|
|
105
106
|
"test:e2e:all": "pnpm test-validator && vitest run tests/e2e/test-rpc.test.ts && vitest run tests/e2e/compress.test.ts && vitest run tests/e2e/transfer.test.ts && vitest run tests/e2e/rpc-interop.test.ts",
|
|
106
107
|
"test:index": "vitest run tests/e2e/program.test.ts",
|
|
107
|
-
"test:e2e:
|
|
108
|
+
"test:e2e:layout": "vitest run tests/e2e/layout.test.ts --reporter=verbose",
|
|
108
109
|
"test:verbose": "vitest run --reporter=verbose",
|
|
109
110
|
"test:testnet": "vitest run tests/e2e/testnet.test.ts --reporter=verbose",
|
|
110
111
|
"pull-idls": "../../scripts/push-stateless-js-idls.sh && ../../scripts/push-compressed-token-idl.sh",
|
|
@@ -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
|
-
}
|
|
@@ -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
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ConfirmOptions, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
|
|
2
|
-
import { Rpc } from '../rpc';
|
|
3
|
-
import BN from 'bn.js';
|
|
4
|
-
/**
|
|
5
|
-
* Compress lamports to a solana address
|
|
6
|
-
*
|
|
7
|
-
* @param rpc RPC to use
|
|
8
|
-
* @param payer Payer of the transaction and initialization fees
|
|
9
|
-
* @param lamports Amount of lamports to compress
|
|
10
|
-
* @param toAddress Address of the recipient compressed account
|
|
11
|
-
* @param outputStateTree Optional output state tree. Defaults to a current shared state tree.
|
|
12
|
-
* @param confirmOptions Options for confirming the transaction
|
|
13
|
-
*
|
|
14
|
-
* @return Transaction signature
|
|
15
|
-
*/
|
|
16
|
-
export declare function compress(rpc: Rpc, payer: Signer, lamports: number | BN, toAddress: PublicKey, outputStateTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { ConfirmOptions, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
|
|
2
|
-
import { Rpc } from '../rpc';
|
|
3
|
-
import BN from 'bn.js';
|
|
4
|
-
/**
|
|
5
|
-
* Create compressed account with address
|
|
6
|
-
*
|
|
7
|
-
* @param rpc RPC to use
|
|
8
|
-
* @param payer Payer of the transaction and initialization fees
|
|
9
|
-
* @param seeds Seeds to derive the new account address
|
|
10
|
-
* @param programId Owner of the new account
|
|
11
|
-
* @param addressTree Optional address tree. Defaults to a current shared
|
|
12
|
-
* address tree.
|
|
13
|
-
* @param addressQueue Optional address queue. Defaults to a current shared
|
|
14
|
-
* address queue.
|
|
15
|
-
* @param outputStateTree Optional output state tree. Defaults to a current
|
|
16
|
-
* shared state tree.
|
|
17
|
-
* @param confirmOptions Options for confirming the transaction
|
|
18
|
-
*
|
|
19
|
-
* @return Transaction signature
|
|
20
|
-
*/
|
|
21
|
-
export declare function createAccount(rpc: Rpc, payer: Signer, seeds: Uint8Array[], programId: PublicKey, addressTree?: PublicKey, addressQueue?: PublicKey, outputStateTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
22
|
-
/**
|
|
23
|
-
* Create compressed account with address and lamports
|
|
24
|
-
*
|
|
25
|
-
* @param rpc RPC to use
|
|
26
|
-
* @param payer Payer of the transaction and initialization fees
|
|
27
|
-
* @param seeds Seeds to derive the new account address
|
|
28
|
-
* @param lamports Number of compressed lamports to initialize the
|
|
29
|
-
* account with
|
|
30
|
-
* @param programId Owner of the new account
|
|
31
|
-
* @param addressTree Optional address tree. Defaults to a current shared
|
|
32
|
-
* address tree.
|
|
33
|
-
* @param addressQueue Optional address queue. Defaults to a current shared
|
|
34
|
-
* address queue.
|
|
35
|
-
* @param outputStateTree Optional output state tree. Defaults to a current
|
|
36
|
-
* shared state tree.
|
|
37
|
-
* @param confirmOptions Options for confirming the transaction
|
|
38
|
-
*
|
|
39
|
-
* @return Transaction signature
|
|
40
|
-
*/
|
|
41
|
-
export declare function createAccountWithLamports(rpc: Rpc, payer: Signer, seeds: Uint8Array[], lamports: number | BN, programId: PublicKey, addressTree?: PublicKey, addressQueue?: PublicKey, outputStateTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ConfirmOptions, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
|
|
2
|
-
import { Rpc } from '../rpc';
|
|
3
|
-
import BN from 'bn.js';
|
|
4
|
-
/**
|
|
5
|
-
* Decompress lamports into a solana account
|
|
6
|
-
*
|
|
7
|
-
* @param rpc RPC to use
|
|
8
|
-
* @param payer Payer of the transaction and initialization fees
|
|
9
|
-
* @param lamports Amount of lamports to compress
|
|
10
|
-
* @param toAddress Address of the recipient compressed account
|
|
11
|
-
* @param outputStateTree Optional output state tree. Defaults to a current shared state tree.
|
|
12
|
-
* @param confirmOptions Options for confirming the transaction
|
|
13
|
-
*
|
|
14
|
-
* @return Transaction signature
|
|
15
|
-
*/
|
|
16
|
-
export declare function decompress(rpc: Rpc, payer: Signer, lamports: number | BN, recipient: PublicKey, outputStateTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ConfirmOptions, PublicKey, Signer, TransactionSignature } from '@solana/web3.js';
|
|
2
|
-
import BN from 'bn.js';
|
|
3
|
-
import { Rpc } from '../rpc';
|
|
4
|
-
/**
|
|
5
|
-
* Transfer compressed lamports from one owner to another
|
|
6
|
-
*
|
|
7
|
-
* @param rpc Rpc to use
|
|
8
|
-
* @param payer Payer of transaction fees
|
|
9
|
-
* @param lamports Number of lamports to transfer
|
|
10
|
-
* @param owner Owner of the compressed lamports
|
|
11
|
-
* @param toAddress Destination address of the recipient
|
|
12
|
-
* @param merkleTree State tree account that the compressed lamports should be
|
|
13
|
-
* inserted into. Defaults to the default state tree account.
|
|
14
|
-
* @param confirmOptions Options for confirming the transaction
|
|
15
|
-
* @param config Configuration for fetching compressed accounts
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* @return Signature of the confirmed transaction
|
|
19
|
-
*/
|
|
20
|
-
export declare function transfer(rpc: Rpc, payer: Signer, lamports: number | BN, owner: Signer, toAddress: PublicKey, merkleTree?: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
@@ -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
|
-
}
|