@solana/rpc-api 6.3.1 → 6.3.2-canary-20260313112147
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/package.json +14 -13
- package/src/getAccountInfo.ts +145 -0
- package/src/getBalance.ts +31 -0
- package/src/getBlock.ts +552 -0
- package/src/getBlockCommitment.ts +20 -0
- package/src/getBlockHeight.ts +29 -0
- package/src/getBlockProduction.ts +83 -0
- package/src/getBlockTime.ts +21 -0
- package/src/getBlocks.ts +34 -0
- package/src/getBlocksWithLimit.ts +33 -0
- package/src/getClusterNodes.ts +49 -0
- package/src/getEpochInfo.ts +43 -0
- package/src/getEpochSchedule.ts +29 -0
- package/src/getFeeForMessage.ts +35 -0
- package/src/getFirstAvailableBlock.ts +17 -0
- package/src/getGenesisHash.ts +13 -0
- package/src/getHealth.ts +17 -0
- package/src/getHighestSnapshotSlot.ts +23 -0
- package/src/getIdentity.ts +14 -0
- package/src/getInflationGovernor.ts +39 -0
- package/src/getInflationRate.ts +21 -0
- package/src/getInflationReward.ts +53 -0
- package/src/getLargestAccounts.ts +42 -0
- package/src/getLatestBlockhash.ts +40 -0
- package/src/getLeaderSchedule.ts +103 -0
- package/src/getMaxRetransmitSlot.ts +12 -0
- package/src/getMaxShredInsertSlot.ts +12 -0
- package/src/getMinimumBalanceForRentExemption.ts +32 -0
- package/src/getMultipleAccounts.ts +156 -0
- package/src/getProgramAccounts.ts +264 -0
- package/src/getRecentPerformanceSamples.ts +29 -0
- package/src/getRecentPrioritizationFees.ts +28 -0
- package/src/getSignatureStatuses.ts +62 -0
- package/src/getSignaturesForAddress.ts +88 -0
- package/src/getSlot.ts +29 -0
- package/src/getSlotLeader.ts +32 -0
- package/src/getSlotLeaders.ts +21 -0
- package/src/getStakeMinimumDelegation.ts +26 -0
- package/src/getSupply.ts +66 -0
- package/src/getTokenAccountBalance.ts +26 -0
- package/src/getTokenAccountsByDelegate.ts +196 -0
- package/src/getTokenAccountsByOwner.ts +190 -0
- package/src/getTokenLargestAccounts.ts +29 -0
- package/src/getTokenSupply.ts +26 -0
- package/src/getTransaction.ts +437 -0
- package/src/getTransactionCount.ts +30 -0
- package/src/getVersion.ts +21 -0
- package/src/getVoteAccounts.ts +80 -0
- package/src/index.ts +353 -0
- package/src/isBlockhashValid.ts +35 -0
- package/src/minimumLedgerSlot.ts +16 -0
- package/src/requestAirdrop.ts +34 -0
- package/src/sendTransaction.ts +80 -0
- package/src/simulateTransaction.ts +727 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Slot } from '@solana/rpc-types';
|
|
2
|
+
|
|
3
|
+
type GetMaxShredInsertSlotApiResponse = Slot;
|
|
4
|
+
|
|
5
|
+
export type GetMaxShredInsertSlotApi = {
|
|
6
|
+
/**
|
|
7
|
+
* Get the max slot seen from after shred insert.
|
|
8
|
+
*
|
|
9
|
+
* @see https://solana.com/docs/rpc/http/getmaxshredinsertslot
|
|
10
|
+
*/
|
|
11
|
+
getMaxShredInsertSlot(): GetMaxShredInsertSlotApiResponse;
|
|
12
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Commitment, Lamports } from '@solana/rpc-types';
|
|
2
|
+
|
|
3
|
+
type GetMinimumBalanceForRentExemptionApiResponse = Lamports;
|
|
4
|
+
|
|
5
|
+
export type GetMinimumBalanceForRentExemptionApi = {
|
|
6
|
+
/**
|
|
7
|
+
* Returns the minimum balance required to exempt an account from rent collection.
|
|
8
|
+
*
|
|
9
|
+
* @returns The minimum {@link Lamports | Lamport} balance required to grant an account of the
|
|
10
|
+
* specified size an exemption from rent collection.
|
|
11
|
+
* @see https://solana.com/docs/rpc/http/getminimumbalanceforrentexemption
|
|
12
|
+
*/
|
|
13
|
+
getMinimumBalanceForRentExemption(
|
|
14
|
+
/**
|
|
15
|
+
* The number of bytes of account data for which an exemption from rent collection is being
|
|
16
|
+
* sought.
|
|
17
|
+
*/
|
|
18
|
+
size: bigint,
|
|
19
|
+
config?: Readonly<{
|
|
20
|
+
/**
|
|
21
|
+
* Return the minimum balance as of the highest slot that has reached this level of
|
|
22
|
+
* commitment.
|
|
23
|
+
*
|
|
24
|
+
* @defaultValue Whichever default is applied by the underlying {@link RpcApi} in use.
|
|
25
|
+
* For example, when using an API created by a `createSolanaRpc*()` helper, the default
|
|
26
|
+
* commitment is `"confirmed"` unless configured otherwise. Unmitigated by an API layer
|
|
27
|
+
* on the client, the default commitment applied by the server is `"finalized"`.
|
|
28
|
+
*/
|
|
29
|
+
commitment?: Commitment;
|
|
30
|
+
}>,
|
|
31
|
+
): GetMinimumBalanceForRentExemptionApiResponse;
|
|
32
|
+
};
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import type { Address } from '@solana/addresses';
|
|
2
|
+
import type {
|
|
3
|
+
AccountInfoBase,
|
|
4
|
+
AccountInfoWithBase58EncodedData,
|
|
5
|
+
AccountInfoWithBase64EncodedData,
|
|
6
|
+
AccountInfoWithBase64EncodedZStdCompressedData,
|
|
7
|
+
AccountInfoWithJsonData,
|
|
8
|
+
Commitment,
|
|
9
|
+
DataSlice,
|
|
10
|
+
Slot,
|
|
11
|
+
SolanaRpcResponse,
|
|
12
|
+
} from '@solana/rpc-types';
|
|
13
|
+
|
|
14
|
+
type GetMultipleAccountsApiResponseBase = AccountInfoBase | null;
|
|
15
|
+
|
|
16
|
+
type GetMultipleAccountsApiCommonConfig = Readonly<{
|
|
17
|
+
/**
|
|
18
|
+
* Fetch the details of the accounts as of the highest slot that has reached this level of
|
|
19
|
+
* commitment.
|
|
20
|
+
*
|
|
21
|
+
* @defaultValue Whichever default is applied by the underlying {@link RpcApi} in use. For
|
|
22
|
+
* example, when using an API created by a `createSolanaRpc*()` helper, the default commitment
|
|
23
|
+
* is `"confirmed"` unless configured otherwise. Unmitigated by an API layer on the client, the
|
|
24
|
+
* default commitment applied by the server is `"finalized"`.
|
|
25
|
+
*/
|
|
26
|
+
commitment?: Commitment;
|
|
27
|
+
/**
|
|
28
|
+
* Determines how the accounts' data should be encoded in the response.
|
|
29
|
+
*
|
|
30
|
+
* - `'base58'` returns a tuple whose first element is the data as a base58-encoded string. If
|
|
31
|
+
* the account contains more than 129 bytes of data, an error will be raised.
|
|
32
|
+
* - `'base64'` returns a tuple whose first element is the data as a base64-encoded string.
|
|
33
|
+
* - `'base64+zstd'` returns a tuple whose first element is the
|
|
34
|
+
* [ZStandard](https://facebook.github.io/zstd/)-compressed data as a base64-encoded string.
|
|
35
|
+
* - `'jsonParsed'` will cause the server to attempt to process the data using a parser specific
|
|
36
|
+
* to each account's owning program. If successful, the parsed data will be returned in the
|
|
37
|
+
* response as JSON. Otherwise, the raw account data will be returned in the response as a
|
|
38
|
+
* tuple whose first element is a base64-encoded string.
|
|
39
|
+
*/
|
|
40
|
+
encoding?: 'base58' | 'base64' | 'base64+zstd' | 'jsonParsed';
|
|
41
|
+
/**
|
|
42
|
+
* Prevents accessing stale data by enforcing that the RPC node has processed transactions up to
|
|
43
|
+
* this slot
|
|
44
|
+
*/
|
|
45
|
+
minContextSlot?: Slot;
|
|
46
|
+
}>;
|
|
47
|
+
|
|
48
|
+
type GetMultipleAccountsApiSliceableCommonConfig = Readonly<{
|
|
49
|
+
/**
|
|
50
|
+
* Define which slice of the accounts' data you want the RPC to return.
|
|
51
|
+
*
|
|
52
|
+
* Use this to save network bandwidth and encoding time when you do not need the entire buffer.
|
|
53
|
+
*
|
|
54
|
+
* Data slicing is only available for `"base58"`, `"base64"`, and `"base64+zstd"` encodings.
|
|
55
|
+
*/
|
|
56
|
+
dataSlice?: DataSlice;
|
|
57
|
+
}>;
|
|
58
|
+
|
|
59
|
+
export type GetMultipleAccountsApi = {
|
|
60
|
+
/**
|
|
61
|
+
* Fetches information associated with the accounts at the given addresses.
|
|
62
|
+
*
|
|
63
|
+
* If the accounts have data, it will be returned in the response as a tuple whose first element
|
|
64
|
+
* is a base64-encoded string.
|
|
65
|
+
*
|
|
66
|
+
* @param addresses A maximum of 100 addresses for which to fetch account data
|
|
67
|
+
*
|
|
68
|
+
* {@label base64}
|
|
69
|
+
* @see https://solana.com/docs/rpc/http/getmultipleaccounts
|
|
70
|
+
*/
|
|
71
|
+
getMultipleAccounts(
|
|
72
|
+
addresses: readonly Address[],
|
|
73
|
+
config: GetMultipleAccountsApiCommonConfig &
|
|
74
|
+
GetMultipleAccountsApiSliceableCommonConfig &
|
|
75
|
+
Readonly<{
|
|
76
|
+
encoding: 'base64';
|
|
77
|
+
}>,
|
|
78
|
+
): SolanaRpcResponse<(GetMultipleAccountsApiResponseBase & (AccountInfoWithBase64EncodedData | null))[]>;
|
|
79
|
+
/**
|
|
80
|
+
* Fetches information associated with the accounts at the given addresses.
|
|
81
|
+
*
|
|
82
|
+
* If the accounts have data, it will first be compressed using
|
|
83
|
+
* [ZStandard](https://facebook.github.io/zstd/) and the result will be returned in the response
|
|
84
|
+
* as a tuple whose first element is a base64-encoded string.
|
|
85
|
+
*
|
|
86
|
+
* @param addresses A maximum of 100 addresses for which to fetch account data
|
|
87
|
+
*
|
|
88
|
+
* {@label base64-zstd-compressed}
|
|
89
|
+
* @see https://solana.com/docs/rpc/http/getmultipleaccounts
|
|
90
|
+
*/
|
|
91
|
+
getMultipleAccounts(
|
|
92
|
+
addresses: readonly Address[],
|
|
93
|
+
config: GetMultipleAccountsApiCommonConfig &
|
|
94
|
+
GetMultipleAccountsApiSliceableCommonConfig &
|
|
95
|
+
Readonly<{
|
|
96
|
+
encoding: 'base64+zstd';
|
|
97
|
+
}>,
|
|
98
|
+
): SolanaRpcResponse<
|
|
99
|
+
(GetMultipleAccountsApiResponseBase & (AccountInfoWithBase64EncodedZStdCompressedData | null))[]
|
|
100
|
+
>;
|
|
101
|
+
/**
|
|
102
|
+
* Fetches information associated with the accounts at the given addresses.
|
|
103
|
+
*
|
|
104
|
+
* If the accounts have data, the server will attempt to process it using a parser specific to
|
|
105
|
+
* each account's owning program. If successful, the parsed data will be returned in the
|
|
106
|
+
* response as JSON. Otherwise, the raw account data will be returned in the response as a tuple
|
|
107
|
+
* whose first element is a base64-encoded string.
|
|
108
|
+
*
|
|
109
|
+
* @param addresses A maximum of 100 addresses for which to fetch account data
|
|
110
|
+
*
|
|
111
|
+
* {@label parsed}
|
|
112
|
+
* @see https://solana.com/docs/rpc/http/getmultipleaccounts
|
|
113
|
+
*/
|
|
114
|
+
getMultipleAccounts(
|
|
115
|
+
addresses: readonly Address[],
|
|
116
|
+
config: GetMultipleAccountsApiCommonConfig &
|
|
117
|
+
Readonly<{
|
|
118
|
+
encoding: 'jsonParsed';
|
|
119
|
+
}>,
|
|
120
|
+
): SolanaRpcResponse<(GetMultipleAccountsApiResponseBase & (AccountInfoWithJsonData | null))[]>;
|
|
121
|
+
/**
|
|
122
|
+
* Fetches information associated with the accounts at the given addresses.
|
|
123
|
+
*
|
|
124
|
+
* If the accounts have data, it will be returned in the response as a tuple whose first element
|
|
125
|
+
* is a base58-encoded string. If any account contains more than 129 bytes of data, this method
|
|
126
|
+
* will raise an error.
|
|
127
|
+
*
|
|
128
|
+
* @param addresses A maximum of 100 addresses for which to fetch account data
|
|
129
|
+
*
|
|
130
|
+
* {@label base58}
|
|
131
|
+
* @see https://solana.com/docs/rpc/http/getmultipleaccounts
|
|
132
|
+
*/
|
|
133
|
+
getMultipleAccounts(
|
|
134
|
+
addresses: readonly Address[],
|
|
135
|
+
config: GetMultipleAccountsApiCommonConfig &
|
|
136
|
+
GetMultipleAccountsApiSliceableCommonConfig &
|
|
137
|
+
Readonly<{
|
|
138
|
+
encoding: 'base58';
|
|
139
|
+
}>,
|
|
140
|
+
): SolanaRpcResponse<(GetMultipleAccountsApiResponseBase & (AccountInfoWithBase58EncodedData | null))[]>;
|
|
141
|
+
/**
|
|
142
|
+
* Fetches information associated with the accounts at the given addresses.
|
|
143
|
+
*
|
|
144
|
+
* If the accounts have data, it will be returned in the response as a base58-encoded string. If
|
|
145
|
+
* any account contains more than 129 bytes of data, this method will raise an error.
|
|
146
|
+
*
|
|
147
|
+
* @param addresses A maximum of 100 addresses for which to fetch account data
|
|
148
|
+
*
|
|
149
|
+
* {@label base58-legacy}
|
|
150
|
+
* @see https://solana.com/docs/rpc/http/getmultipleaccounts
|
|
151
|
+
*/
|
|
152
|
+
getMultipleAccounts(
|
|
153
|
+
addresses: readonly Address[],
|
|
154
|
+
config?: GetMultipleAccountsApiCommonConfig,
|
|
155
|
+
): SolanaRpcResponse<(GetMultipleAccountsApiResponseBase & (AccountInfoWithBase64EncodedData | null))[]>;
|
|
156
|
+
};
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import type { Address } from '@solana/addresses';
|
|
2
|
+
import type {
|
|
3
|
+
AccountInfoBase,
|
|
4
|
+
AccountInfoWithBase58Bytes,
|
|
5
|
+
AccountInfoWithBase58EncodedData,
|
|
6
|
+
AccountInfoWithBase64EncodedData,
|
|
7
|
+
AccountInfoWithBase64EncodedZStdCompressedData,
|
|
8
|
+
AccountInfoWithJsonData,
|
|
9
|
+
AccountInfoWithPubkey,
|
|
10
|
+
Commitment,
|
|
11
|
+
DataSlice,
|
|
12
|
+
GetProgramAccountsDatasizeFilter,
|
|
13
|
+
GetProgramAccountsMemcmpFilter,
|
|
14
|
+
Slot,
|
|
15
|
+
SolanaRpcResponse,
|
|
16
|
+
} from '@solana/rpc-types';
|
|
17
|
+
|
|
18
|
+
type GetProgramAccountsApiCommonConfig = Readonly<{
|
|
19
|
+
/**
|
|
20
|
+
* Fetch the details of the accounts as of the highest slot that has reached this level of
|
|
21
|
+
* commitment.
|
|
22
|
+
*
|
|
23
|
+
* @defaultValue Whichever default is applied by the underlying {@link RpcApi} in use. For
|
|
24
|
+
* example, when using an API created by a `createSolanaRpc*()` helper, the default commitment
|
|
25
|
+
* is `"confirmed"` unless configured otherwise. Unmitigated by an API layer on the client, the
|
|
26
|
+
* default commitment applied by the server is `"finalized"`.
|
|
27
|
+
*/
|
|
28
|
+
commitment?: Commitment;
|
|
29
|
+
/**
|
|
30
|
+
* Determines how the accounts' data should be encoded in the response.
|
|
31
|
+
*
|
|
32
|
+
* - `'base58'` returns a tuple whose first element is the data as a base58-encoded string. If
|
|
33
|
+
* the account contains more than 129 bytes of data, an error will be raised.
|
|
34
|
+
* - `'base64'` returns a tuple whose first element is the data as a base64-encoded string.
|
|
35
|
+
* - `'base64+zstd'` returns a tuple whose first element is the
|
|
36
|
+
* [ZStandard](https://facebook.github.io/zstd/)-compressed data as a base64-encoded string.
|
|
37
|
+
* - `'jsonParsed'` will cause the server to attempt to process the data using a parser specific
|
|
38
|
+
* to the owning program. If successful, the parsed data will be returned in the response as
|
|
39
|
+
* JSON. Otherwise, the raw account data will be returned in the response as a tuple whose
|
|
40
|
+
* first element is a base64-encoded string.
|
|
41
|
+
*/
|
|
42
|
+
encoding?: 'base58' | 'base64' | 'base64+zstd' | 'jsonParsed';
|
|
43
|
+
/**
|
|
44
|
+
* Limits results to those that match all of these filters.
|
|
45
|
+
*
|
|
46
|
+
* This is useful when your aim is to find program accounts whose purpose is uniquely determined
|
|
47
|
+
* by having a data buffer of a known size, or whose data contains a known series of bytes (eg.
|
|
48
|
+
* a discriminator).
|
|
49
|
+
*
|
|
50
|
+
* You can specify up to 4 filters.
|
|
51
|
+
*
|
|
52
|
+
* @defaultValue When omitted, no filters are applied.
|
|
53
|
+
*/
|
|
54
|
+
filters?: readonly (GetProgramAccountsDatasizeFilter | GetProgramAccountsMemcmpFilter)[];
|
|
55
|
+
/**
|
|
56
|
+
* Prevents accessing stale data by enforcing that the RPC node has processed transactions up to
|
|
57
|
+
* this slot
|
|
58
|
+
*/
|
|
59
|
+
minContextSlot?: Slot;
|
|
60
|
+
/**
|
|
61
|
+
* Wraps the result in an {@link RpcResponse} when `true`
|
|
62
|
+
*
|
|
63
|
+
* @defaultValue false
|
|
64
|
+
*/
|
|
65
|
+
withContext?: boolean;
|
|
66
|
+
}>;
|
|
67
|
+
|
|
68
|
+
type GetProgramAccountsApiSliceableCommonConfig = Readonly<{
|
|
69
|
+
/**
|
|
70
|
+
* Define which slice of the accounts' data you want the RPC to return.
|
|
71
|
+
*
|
|
72
|
+
* Use this to save network bandwidth and encoding time when you do not need the entire buffer.
|
|
73
|
+
*
|
|
74
|
+
* Data slicing is only available for `"base58"`, `"base64"`, and `"base64+zstd"` encodings.
|
|
75
|
+
*/
|
|
76
|
+
dataSlice?: DataSlice;
|
|
77
|
+
}>;
|
|
78
|
+
|
|
79
|
+
export type GetProgramAccountsApi = {
|
|
80
|
+
/**
|
|
81
|
+
* Fetches information associated with all accounts owned by the program at the given address.
|
|
82
|
+
*
|
|
83
|
+
* If the accounts have data, it will be returned in the response as a tuple whose first element
|
|
84
|
+
* is a base64-encoded string.
|
|
85
|
+
*
|
|
86
|
+
* {@label base64-withcontext}
|
|
87
|
+
* @see https://solana.com/docs/rpc/http/getprogramaccounts
|
|
88
|
+
*/
|
|
89
|
+
getProgramAccounts(
|
|
90
|
+
program: Address,
|
|
91
|
+
config: GetProgramAccountsApiCommonConfig &
|
|
92
|
+
GetProgramAccountsApiSliceableCommonConfig &
|
|
93
|
+
Readonly<{
|
|
94
|
+
encoding: 'base64';
|
|
95
|
+
withContext: true;
|
|
96
|
+
}>,
|
|
97
|
+
): SolanaRpcResponse<AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase64EncodedData>[]>;
|
|
98
|
+
/**
|
|
99
|
+
* Fetches information associated with all accounts owned by the program at the given address.
|
|
100
|
+
*
|
|
101
|
+
* If the accounts have data, it will be returned in the response as a tuple whose first element
|
|
102
|
+
* is a base64-encoded string.
|
|
103
|
+
*
|
|
104
|
+
* {@label base64}
|
|
105
|
+
* @see https://solana.com/docs/rpc/http/getprogramaccounts
|
|
106
|
+
*/
|
|
107
|
+
getProgramAccounts(
|
|
108
|
+
program: Address,
|
|
109
|
+
config: GetProgramAccountsApiCommonConfig &
|
|
110
|
+
GetProgramAccountsApiSliceableCommonConfig &
|
|
111
|
+
Readonly<{
|
|
112
|
+
encoding: 'base64';
|
|
113
|
+
withContext?: boolean;
|
|
114
|
+
}>,
|
|
115
|
+
): AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase64EncodedData>[];
|
|
116
|
+
/**
|
|
117
|
+
* Fetches information associated with all accounts owned by the program at the given address.
|
|
118
|
+
*
|
|
119
|
+
* If the accounts have data, it will first be compressed using
|
|
120
|
+
* [ZStandard](https://facebook.github.io/zstd/) and the result will be returned in the response
|
|
121
|
+
* as a tuple whose first element is a base64-encoded string.
|
|
122
|
+
*
|
|
123
|
+
* {@label base64-zstd-compressed-withcontext}
|
|
124
|
+
* @see https://solana.com/docs/rpc/http/getprogramaccounts
|
|
125
|
+
*/
|
|
126
|
+
getProgramAccounts(
|
|
127
|
+
program: Address,
|
|
128
|
+
config: GetProgramAccountsApiCommonConfig &
|
|
129
|
+
GetProgramAccountsApiSliceableCommonConfig &
|
|
130
|
+
Readonly<{
|
|
131
|
+
encoding: 'base64+zstd';
|
|
132
|
+
withContext: true;
|
|
133
|
+
}>,
|
|
134
|
+
): SolanaRpcResponse<AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase64EncodedZStdCompressedData>[]>;
|
|
135
|
+
/**
|
|
136
|
+
* Fetches information associated with all accounts owned by the program at the given address.
|
|
137
|
+
*
|
|
138
|
+
* If the accounts have data, it will first be compressed using
|
|
139
|
+
* [ZStandard](https://facebook.github.io/zstd/) and the result will be returned in the response
|
|
140
|
+
* as a tuple whose first element is a base64-encoded string.
|
|
141
|
+
*
|
|
142
|
+
* {@label base64-zstd-compressed}
|
|
143
|
+
* @see https://solana.com/docs/rpc/http/getprogramaccounts
|
|
144
|
+
*/
|
|
145
|
+
getProgramAccounts(
|
|
146
|
+
program: Address,
|
|
147
|
+
config: GetProgramAccountsApiCommonConfig &
|
|
148
|
+
GetProgramAccountsApiSliceableCommonConfig &
|
|
149
|
+
Readonly<{
|
|
150
|
+
encoding: 'base64+zstd';
|
|
151
|
+
withContext?: boolean;
|
|
152
|
+
}>,
|
|
153
|
+
): AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase64EncodedZStdCompressedData>[];
|
|
154
|
+
/**
|
|
155
|
+
* Fetches information associated with all accounts owned by the program at the given address.
|
|
156
|
+
*
|
|
157
|
+
* If the accounts have data, the server will attempt to process it using a parser specific to
|
|
158
|
+
* the owning program. If successful, the parsed data will be returned in the response as JSON.
|
|
159
|
+
* Otherwise, the raw account data will be returned in the response as a tuple whose first
|
|
160
|
+
* element is a base64-encoded string.
|
|
161
|
+
*
|
|
162
|
+
* {@label parsed-withcontext}
|
|
163
|
+
* @see https://solana.com/docs/rpc/http/getprogramaccounts
|
|
164
|
+
*/
|
|
165
|
+
getProgramAccounts(
|
|
166
|
+
program: Address,
|
|
167
|
+
config: GetProgramAccountsApiCommonConfig &
|
|
168
|
+
Readonly<{
|
|
169
|
+
encoding: 'jsonParsed';
|
|
170
|
+
withContext: true;
|
|
171
|
+
}>,
|
|
172
|
+
): SolanaRpcResponse<AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithJsonData>[]>;
|
|
173
|
+
/**
|
|
174
|
+
* Fetches information associated with all accounts owned by the program at the given address.
|
|
175
|
+
*
|
|
176
|
+
* If the accounts have data, the server will attempt to process it using a parser specific to
|
|
177
|
+
* the owning program. If successful, the parsed data will be returned in the response as JSON.
|
|
178
|
+
* Otherwise, the raw account data will be returned in the response as a tuple whose first
|
|
179
|
+
* element is a base64-encoded string.
|
|
180
|
+
*
|
|
181
|
+
* {@label parsed}
|
|
182
|
+
* @see https://solana.com/docs/rpc/http/getprogramaccounts
|
|
183
|
+
*/
|
|
184
|
+
getProgramAccounts(
|
|
185
|
+
program: Address,
|
|
186
|
+
config: GetProgramAccountsApiCommonConfig &
|
|
187
|
+
Readonly<{
|
|
188
|
+
encoding: 'jsonParsed';
|
|
189
|
+
withContext?: boolean;
|
|
190
|
+
}>,
|
|
191
|
+
): AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithJsonData>[];
|
|
192
|
+
/**
|
|
193
|
+
* Fetches information associated with all accounts owned by the program at the given address.
|
|
194
|
+
*
|
|
195
|
+
* If the accounts have data, it will be returned in the response as a tuple whose first element
|
|
196
|
+
* is a base58-encoded string. If any account contains more than 129 bytes of data, this method
|
|
197
|
+
* will raise an error.
|
|
198
|
+
*
|
|
199
|
+
* {@label base58-withcontext}
|
|
200
|
+
* @see https://solana.com/docs/rpc/http/getprogramaccounts
|
|
201
|
+
*/
|
|
202
|
+
getProgramAccounts(
|
|
203
|
+
program: Address,
|
|
204
|
+
config: GetProgramAccountsApiCommonConfig &
|
|
205
|
+
GetProgramAccountsApiSliceableCommonConfig &
|
|
206
|
+
Readonly<{
|
|
207
|
+
encoding: 'base58';
|
|
208
|
+
withContext: true;
|
|
209
|
+
}>,
|
|
210
|
+
): SolanaRpcResponse<AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase58EncodedData>[]>;
|
|
211
|
+
/**
|
|
212
|
+
* Fetches information associated with all accounts owned by the program at the given address.
|
|
213
|
+
*
|
|
214
|
+
* If the accounts have data, it will be returned in the response as a tuple whose first element
|
|
215
|
+
* is a base58-encoded string. If any account contains more than 129 bytes of data, this method
|
|
216
|
+
* will raise an error.
|
|
217
|
+
*
|
|
218
|
+
* {@label base58}
|
|
219
|
+
* @see https://solana.com/docs/rpc/http/getprogramaccounts
|
|
220
|
+
*/
|
|
221
|
+
getProgramAccounts(
|
|
222
|
+
program: Address,
|
|
223
|
+
config: GetProgramAccountsApiCommonConfig &
|
|
224
|
+
GetProgramAccountsApiSliceableCommonConfig &
|
|
225
|
+
Readonly<{
|
|
226
|
+
encoding: 'base58';
|
|
227
|
+
withContext?: boolean;
|
|
228
|
+
}>,
|
|
229
|
+
): AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase58EncodedData>[];
|
|
230
|
+
/**
|
|
231
|
+
* Fetches information associated with all accounts owned by the program at the given address.
|
|
232
|
+
*
|
|
233
|
+
* If the accounts have data, it will be returned in the response as a base58-encoded string. If
|
|
234
|
+
* any account contains more than 129 bytes of data, this method will raise an error.
|
|
235
|
+
*
|
|
236
|
+
* {@label base58-legacy-withcontext}
|
|
237
|
+
* @see https://solana.com/docs/rpc/http/getprogramaccounts
|
|
238
|
+
*/
|
|
239
|
+
getProgramAccounts(
|
|
240
|
+
program: Address,
|
|
241
|
+
config: GetProgramAccountsApiCommonConfig &
|
|
242
|
+
GetProgramAccountsApiSliceableCommonConfig &
|
|
243
|
+
Readonly<{
|
|
244
|
+
withContext: true;
|
|
245
|
+
}>,
|
|
246
|
+
): SolanaRpcResponse<AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase58Bytes>[]>;
|
|
247
|
+
/**
|
|
248
|
+
* Fetches information associated with all accounts owned by the program at the given address.
|
|
249
|
+
*
|
|
250
|
+
* If the accounts have data, it will be returned in the response as a base58-encoded string. If
|
|
251
|
+
* any account contains more than 129 bytes of data, this method will raise an error.
|
|
252
|
+
*
|
|
253
|
+
* {@label base58-legacy-withcontext}
|
|
254
|
+
* @see https://solana.com/docs/rpc/http/getprogramaccounts
|
|
255
|
+
*/
|
|
256
|
+
getProgramAccounts(
|
|
257
|
+
program: Address,
|
|
258
|
+
config?: GetProgramAccountsApiCommonConfig &
|
|
259
|
+
GetProgramAccountsApiSliceableCommonConfig &
|
|
260
|
+
Readonly<{
|
|
261
|
+
withContext?: boolean;
|
|
262
|
+
}>,
|
|
263
|
+
): AccountInfoWithPubkey<AccountInfoBase & AccountInfoWithBase58Bytes>[];
|
|
264
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Slot } from '@solana/rpc-types';
|
|
2
|
+
|
|
3
|
+
type PerformanceSample = Readonly<{
|
|
4
|
+
/** Number of non-vote transactions in sample */
|
|
5
|
+
numNonVoteTransactions: bigint;
|
|
6
|
+
/** Number of slots in sample */
|
|
7
|
+
numSlots: bigint;
|
|
8
|
+
/** Number of transactions in sample */
|
|
9
|
+
numTransactions: bigint;
|
|
10
|
+
/** Number of seconds in a sample window */
|
|
11
|
+
samplePeriodSecs: number;
|
|
12
|
+
/** Slot in which sample was taken at */
|
|
13
|
+
slot: Slot;
|
|
14
|
+
}>;
|
|
15
|
+
|
|
16
|
+
type GetRecentPerformanceSamplesApiResponse = readonly PerformanceSample[];
|
|
17
|
+
|
|
18
|
+
export type GetRecentPerformanceSamplesApi = {
|
|
19
|
+
/**
|
|
20
|
+
* Returns a list of recent performance samples, in reverse slot order.
|
|
21
|
+
*
|
|
22
|
+
* Performance samples are taken every 60 seconds and include the number of transactions and
|
|
23
|
+
* slots that occur in a given time window.
|
|
24
|
+
*
|
|
25
|
+
* @param limit Number of samples to return. Maximum of 720.
|
|
26
|
+
* @see https://solana.com/docs/rpc/http/getrecentperformancesamples
|
|
27
|
+
*/
|
|
28
|
+
getRecentPerformanceSamples(limit?: number): GetRecentPerformanceSamplesApiResponse;
|
|
29
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Address } from '@solana/addresses';
|
|
2
|
+
import type { MicroLamports, Slot } from '@solana/rpc-types';
|
|
3
|
+
|
|
4
|
+
type RecentPrioritizationFee = Readonly<{
|
|
5
|
+
/**
|
|
6
|
+
* The smallest per-compute-unit fee paid by at least one successfully landed transaction,
|
|
7
|
+
* specified in increments of {@link MicroLamports} (0.000001 {@link Lamports}).
|
|
8
|
+
*/
|
|
9
|
+
prioritizationFee: MicroLamports;
|
|
10
|
+
/** Slot in which the fee was observed */
|
|
11
|
+
slot: Slot;
|
|
12
|
+
}>;
|
|
13
|
+
|
|
14
|
+
type GetRecentPrioritizationFeesApiResponse = readonly RecentPrioritizationFee[];
|
|
15
|
+
|
|
16
|
+
export type GetRecentPrioritizationFeesApi = {
|
|
17
|
+
/**
|
|
18
|
+
* Returns a list of the smallest prioritization fees paid in recent blocks.
|
|
19
|
+
*
|
|
20
|
+
* Currently, a node's prioritization-fee cache stores data from up to 150 blocks.
|
|
21
|
+
*
|
|
22
|
+
* @param addresses A maximum of 128 addresses. When supplied, the response will reflect the
|
|
23
|
+
* prioritization fee paid for transactions which take a write-lock on all of them.
|
|
24
|
+
*
|
|
25
|
+
* @see https://solana.com/docs/rpc/http/getrecentprioritizationfees
|
|
26
|
+
*/
|
|
27
|
+
getRecentPrioritizationFees(addresses?: readonly Address[]): GetRecentPrioritizationFeesApiResponse;
|
|
28
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Signature } from '@solana/keys';
|
|
2
|
+
import type { Commitment, Slot, SolanaRpcResponse, TransactionError } from '@solana/rpc-types';
|
|
3
|
+
|
|
4
|
+
/** @deprecated */
|
|
5
|
+
type TransactionStatusOk = Readonly<{
|
|
6
|
+
Ok: null;
|
|
7
|
+
}>;
|
|
8
|
+
|
|
9
|
+
/** @deprecated */
|
|
10
|
+
type TransactionStatusErr = Readonly<{
|
|
11
|
+
Err: TransactionError;
|
|
12
|
+
}>;
|
|
13
|
+
|
|
14
|
+
type SignatureStatusResult = Readonly<{
|
|
15
|
+
/**
|
|
16
|
+
* The transaction's cluster confirmation status; either `processed`, `confirmed`, or
|
|
17
|
+
* `finalized`.
|
|
18
|
+
*/
|
|
19
|
+
confirmationStatus: Commitment | null;
|
|
20
|
+
/**
|
|
21
|
+
* Number of blocks since signature confirmation or `null` if rooted as well as finalized by a
|
|
22
|
+
* supermajority of the cluster.
|
|
23
|
+
*/
|
|
24
|
+
confirmations: bigint | null;
|
|
25
|
+
/** If the transaction failed, this property will contain the error */
|
|
26
|
+
err: TransactionError | null;
|
|
27
|
+
/** The slot the transaction was processed */
|
|
28
|
+
slot: Slot;
|
|
29
|
+
/** @deprecated */
|
|
30
|
+
status: TransactionStatusErr | TransactionStatusOk;
|
|
31
|
+
}>;
|
|
32
|
+
|
|
33
|
+
type GetSignatureStatusesApiResponse = readonly (SignatureStatusResult | null)[];
|
|
34
|
+
|
|
35
|
+
export type GetSignatureStatusesApi = {
|
|
36
|
+
/**
|
|
37
|
+
* Returns the statuses of a list of signatures.
|
|
38
|
+
*
|
|
39
|
+
* Each signature uniquely identifies a transaction by virtue of being the first or only
|
|
40
|
+
* signature in its list of signatures.
|
|
41
|
+
*
|
|
42
|
+
* @see https://solana.com/docs/rpc/http/getsignaturestatuses
|
|
43
|
+
*/
|
|
44
|
+
getSignatureStatuses(
|
|
45
|
+
/**
|
|
46
|
+
* An array of transaction signatures to confirm, as base-58 encoded strings (up to a
|
|
47
|
+
* maximum of 256)
|
|
48
|
+
*/
|
|
49
|
+
signatures: readonly Signature[],
|
|
50
|
+
config?: Readonly<{
|
|
51
|
+
/**
|
|
52
|
+
* Determines whether the search for a transaction with a given signature will consider
|
|
53
|
+
* any more than what is available in the recent status cache that retains statuses for
|
|
54
|
+
* the active slots plus `MAX_RECENT_BLOCKHASHES` rooted slots. When `true` the search
|
|
55
|
+
* will proceed into local block storage then, if available, archival storage.
|
|
56
|
+
*
|
|
57
|
+
* @defaultValue `false`
|
|
58
|
+
*/
|
|
59
|
+
searchTransactionHistory?: boolean;
|
|
60
|
+
}>,
|
|
61
|
+
): SolanaRpcResponse<GetSignatureStatusesApiResponse>;
|
|
62
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { Address } from '@solana/addresses';
|
|
2
|
+
import type { Signature } from '@solana/keys';
|
|
3
|
+
import type { Commitment, Slot, TransactionError, UnixTimestamp } from '@solana/rpc-types';
|
|
4
|
+
|
|
5
|
+
type GetSignaturesForAddressTransaction = Readonly<{
|
|
6
|
+
/** estimated production time of when transaction was processed. null if not available. */
|
|
7
|
+
blockTime: UnixTimestamp | null;
|
|
8
|
+
/** The transaction's cluster confirmation status */
|
|
9
|
+
confirmationStatus: Commitment | null;
|
|
10
|
+
/** Error if transaction failed, null if transaction succeeded. */
|
|
11
|
+
err: TransactionError | null;
|
|
12
|
+
/** Memo associated with the transaction, null if no memo is present */
|
|
13
|
+
memo: string | null;
|
|
14
|
+
/** transaction signature as base-58 encoded string */
|
|
15
|
+
signature: Signature;
|
|
16
|
+
/** The slot that contains the block with the transaction */
|
|
17
|
+
slot: Slot;
|
|
18
|
+
}>;
|
|
19
|
+
|
|
20
|
+
type GetSignaturesForAddressApiResponse = readonly GetSignaturesForAddressTransaction[];
|
|
21
|
+
|
|
22
|
+
type AllowedCommitmentForGetSignaturesForAddress = Exclude<Commitment, 'processed'>;
|
|
23
|
+
|
|
24
|
+
type GetSignaturesForAddressConfig = Readonly<{
|
|
25
|
+
/**
|
|
26
|
+
* Start the search from before, but excluding, this signature.
|
|
27
|
+
*
|
|
28
|
+
* @defaultValue When omitted, the search starts from the top of the latest confirmed block.
|
|
29
|
+
*/
|
|
30
|
+
before?: Signature;
|
|
31
|
+
/**
|
|
32
|
+
* Fetch the signatures as of the highest slot that has reached this level of commitment.
|
|
33
|
+
*
|
|
34
|
+
* @defaultValue Whichever default is applied by the underlying {@link RpcApi} in use. For
|
|
35
|
+
* example, when using an API created by a `createSolanaRpc*()` helper, the default commitment
|
|
36
|
+
* is `"confirmed"` unless configured otherwise. Unmitigated by an API layer on the client, the
|
|
37
|
+
* default commitment applied by the server is `"finalized"`.
|
|
38
|
+
*/
|
|
39
|
+
commitment?: AllowedCommitmentForGetSignaturesForAddress;
|
|
40
|
+
/**
|
|
41
|
+
* Maximum transaction signatures to return (between 1 and 1,000).
|
|
42
|
+
*
|
|
43
|
+
* @defaultValue 1000
|
|
44
|
+
*/
|
|
45
|
+
limit?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Prevents accessing stale data by enforcing that the RPC node has processed transactions up to
|
|
48
|
+
* this slot
|
|
49
|
+
*/
|
|
50
|
+
minContextSlot?: Slot;
|
|
51
|
+
/**
|
|
52
|
+
* Search, back in time, until this transaction signature.
|
|
53
|
+
*
|
|
54
|
+
* @defaultValue When omitted, search will proceed until the limit (if supplied) or until 1,000
|
|
55
|
+
* signatures have been found.
|
|
56
|
+
*/
|
|
57
|
+
until?: Signature;
|
|
58
|
+
}>;
|
|
59
|
+
|
|
60
|
+
export type GetSignaturesForAddressApi = {
|
|
61
|
+
/**
|
|
62
|
+
* Returns signatures for confirmed transactions that load the given address.
|
|
63
|
+
*
|
|
64
|
+
* {@label before-signature}
|
|
65
|
+
* @returns Signatures in reverse chronological order starting from before, but excluding, the
|
|
66
|
+
* signature supplied.
|
|
67
|
+
* @see https://solana.com/docs/rpc/http/getsignaturesforaddress
|
|
68
|
+
*/
|
|
69
|
+
getSignaturesForAddress(
|
|
70
|
+
address: Address,
|
|
71
|
+
config?: GetSignaturesForAddressConfig &
|
|
72
|
+
Readonly<{
|
|
73
|
+
before: Signature;
|
|
74
|
+
}>,
|
|
75
|
+
): GetSignaturesForAddressApiResponse;
|
|
76
|
+
/**
|
|
77
|
+
* Returns signatures for confirmed transactions that load the given address.
|
|
78
|
+
*
|
|
79
|
+
* {@label all}
|
|
80
|
+
* @returns Signatures in reverse chronological order starting from the most recent confirmed
|
|
81
|
+
* block.
|
|
82
|
+
* @see https://solana.com/docs/rpc/http/getsignaturesforaddress
|
|
83
|
+
*/
|
|
84
|
+
getSignaturesForAddress(
|
|
85
|
+
address: Address,
|
|
86
|
+
config?: GetSignaturesForAddressConfig,
|
|
87
|
+
): GetSignaturesForAddressApiResponse;
|
|
88
|
+
};
|