@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.
Files changed (54) hide show
  1. package/package.json +14 -13
  2. package/src/getAccountInfo.ts +145 -0
  3. package/src/getBalance.ts +31 -0
  4. package/src/getBlock.ts +552 -0
  5. package/src/getBlockCommitment.ts +20 -0
  6. package/src/getBlockHeight.ts +29 -0
  7. package/src/getBlockProduction.ts +83 -0
  8. package/src/getBlockTime.ts +21 -0
  9. package/src/getBlocks.ts +34 -0
  10. package/src/getBlocksWithLimit.ts +33 -0
  11. package/src/getClusterNodes.ts +49 -0
  12. package/src/getEpochInfo.ts +43 -0
  13. package/src/getEpochSchedule.ts +29 -0
  14. package/src/getFeeForMessage.ts +35 -0
  15. package/src/getFirstAvailableBlock.ts +17 -0
  16. package/src/getGenesisHash.ts +13 -0
  17. package/src/getHealth.ts +17 -0
  18. package/src/getHighestSnapshotSlot.ts +23 -0
  19. package/src/getIdentity.ts +14 -0
  20. package/src/getInflationGovernor.ts +39 -0
  21. package/src/getInflationRate.ts +21 -0
  22. package/src/getInflationReward.ts +53 -0
  23. package/src/getLargestAccounts.ts +42 -0
  24. package/src/getLatestBlockhash.ts +40 -0
  25. package/src/getLeaderSchedule.ts +103 -0
  26. package/src/getMaxRetransmitSlot.ts +12 -0
  27. package/src/getMaxShredInsertSlot.ts +12 -0
  28. package/src/getMinimumBalanceForRentExemption.ts +32 -0
  29. package/src/getMultipleAccounts.ts +156 -0
  30. package/src/getProgramAccounts.ts +264 -0
  31. package/src/getRecentPerformanceSamples.ts +29 -0
  32. package/src/getRecentPrioritizationFees.ts +28 -0
  33. package/src/getSignatureStatuses.ts +62 -0
  34. package/src/getSignaturesForAddress.ts +88 -0
  35. package/src/getSlot.ts +29 -0
  36. package/src/getSlotLeader.ts +32 -0
  37. package/src/getSlotLeaders.ts +21 -0
  38. package/src/getStakeMinimumDelegation.ts +26 -0
  39. package/src/getSupply.ts +66 -0
  40. package/src/getTokenAccountBalance.ts +26 -0
  41. package/src/getTokenAccountsByDelegate.ts +196 -0
  42. package/src/getTokenAccountsByOwner.ts +190 -0
  43. package/src/getTokenLargestAccounts.ts +29 -0
  44. package/src/getTokenSupply.ts +26 -0
  45. package/src/getTransaction.ts +437 -0
  46. package/src/getTransactionCount.ts +30 -0
  47. package/src/getVersion.ts +21 -0
  48. package/src/getVoteAccounts.ts +80 -0
  49. package/src/index.ts +353 -0
  50. package/src/isBlockhashValid.ts +35 -0
  51. package/src/minimumLedgerSlot.ts +16 -0
  52. package/src/requestAirdrop.ts +34 -0
  53. package/src/sendTransaction.ts +80 -0
  54. package/src/simulateTransaction.ts +727 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/rpc-api",
3
- "version": "6.3.1",
3
+ "version": "6.3.2-canary-20260313112147",
4
4
  "description": "Defines all default Solana RPC methods as types",
5
5
  "homepage": "https://www.solanakit.com/api#solanarpc-api",
6
6
  "exports": {
@@ -33,7 +33,8 @@
33
33
  "types": "./dist/types/index.d.ts",
34
34
  "type": "commonjs",
35
35
  "files": [
36
- "./dist/"
36
+ "./dist/",
37
+ "./src/"
37
38
  ],
38
39
  "sideEffects": false,
39
40
  "keywords": [
@@ -55,17 +56,17 @@
55
56
  "maintained node versions"
56
57
  ],
57
58
  "dependencies": {
58
- "@solana/addresses": "6.3.1",
59
- "@solana/codecs-strings": "6.3.1",
60
- "@solana/errors": "6.3.1",
61
- "@solana/keys": "6.3.1",
62
- "@solana/codecs-core": "6.3.1",
63
- "@solana/rpc-parsed-types": "6.3.1",
64
- "@solana/rpc-spec": "6.3.1",
65
- "@solana/rpc-transformers": "6.3.1",
66
- "@solana/transaction-messages": "6.3.1",
67
- "@solana/rpc-types": "6.3.1",
68
- "@solana/transactions": "6.3.1"
59
+ "@solana/addresses": "6.3.2-canary-20260313112147",
60
+ "@solana/codecs-core": "6.3.2-canary-20260313112147",
61
+ "@solana/codecs-strings": "6.3.2-canary-20260313112147",
62
+ "@solana/errors": "6.3.2-canary-20260313112147",
63
+ "@solana/keys": "6.3.2-canary-20260313112147",
64
+ "@solana/rpc-parsed-types": "6.3.2-canary-20260313112147",
65
+ "@solana/rpc-transformers": "6.3.2-canary-20260313112147",
66
+ "@solana/rpc-spec": "6.3.2-canary-20260313112147",
67
+ "@solana/rpc-types": "6.3.2-canary-20260313112147",
68
+ "@solana/transactions": "6.3.2-canary-20260313112147",
69
+ "@solana/transaction-messages": "6.3.2-canary-20260313112147"
69
70
  },
70
71
  "peerDependencies": {
71
72
  "typescript": "^5.0.0"
@@ -0,0 +1,145 @@
1
+ import type { Address } from '@solana/addresses';
2
+ import type {
3
+ AccountInfoBase,
4
+ AccountInfoWithBase58Bytes,
5
+ AccountInfoWithBase58EncodedData,
6
+ AccountInfoWithBase64EncodedData,
7
+ AccountInfoWithBase64EncodedZStdCompressedData,
8
+ AccountInfoWithJsonData,
9
+ Commitment,
10
+ DataSlice,
11
+ Slot,
12
+ SolanaRpcResponse,
13
+ } from '@solana/rpc-types';
14
+
15
+ type GetAccountInfoApiResponse<T> = (AccountInfoBase & T) | null;
16
+
17
+ type GetAccountInfoApiCommonConfig = Readonly<{
18
+ /**
19
+ * Fetch the details of the account as of the highest slot that has reached this level of
20
+ * commitment.
21
+ *
22
+ * @defaultValue Whichever default is applied by the underlying {@link RpcApi} in use. For
23
+ * example, when using an API created by a `createSolanaRpc*()` helper, the default commitment
24
+ * is `"confirmed"` unless configured otherwise. Unmitigated by an API layer on the client, the
25
+ * default commitment applied by the server is `"finalized"`.
26
+ */
27
+ commitment?: Commitment;
28
+ /**
29
+ * Determines how the account data should be encoded in the response.
30
+ *
31
+ * - `'base58'` returns a tuple whose first element is the data as a base58-encoded string. If
32
+ * the account contains more than 129 bytes of data, an error will be raised.
33
+ * - `'base64'` returns a tuple whose first element is the data as a base64-encoded string.
34
+ * - `'base64+zstd'` returns a tuple whose first element is the
35
+ * [ZStandard](https://facebook.github.io/zstd/)-compressed data as a base64-encoded string.
36
+ * - `'jsonParsed'` will cause the server to attempt to process the data using a parser specific
37
+ * to the account's owning program. If successful, the parsed data will be returned in the
38
+ * response as JSON. Otherwise, the raw account data will be returned in the response as a
39
+ * tuple whose first element is a base64-encoded string.
40
+ */
41
+ encoding: 'base58' | 'base64' | 'base64+zstd' | 'jsonParsed';
42
+ /**
43
+ * Prevents accessing stale data by enforcing that the RPC node has processed transactions up to
44
+ * this slot
45
+ */
46
+ minContextSlot?: Slot;
47
+ }>;
48
+
49
+ type GetAccountInfoApiSliceableCommonConfig = Readonly<{
50
+ /**
51
+ * Define which slice of the account's data you want the RPC to return.
52
+ *
53
+ * Use this to save network bandwidth and encoding time when you do not need the entire buffer.
54
+ *
55
+ * Data slicing is only available for `"base58"`, `"base64"`, and `"base64+zstd"` encodings.
56
+ */
57
+ dataSlice?: DataSlice;
58
+ }>;
59
+
60
+ export type GetAccountInfoApi = {
61
+ /**
62
+ * Fetches information associated with the account at the given address.
63
+ *
64
+ * If the account has data, it will be returned in the response as a tuple whose first element
65
+ * is a base64-encoded string.
66
+ *
67
+ * {@label base64}
68
+ * @see https://solana.com/docs/rpc/http/getaccountinfo
69
+ */
70
+ getAccountInfo(
71
+ address: Address,
72
+ config: GetAccountInfoApiCommonConfig &
73
+ GetAccountInfoApiSliceableCommonConfig &
74
+ Readonly<{
75
+ encoding: 'base64';
76
+ }>,
77
+ ): SolanaRpcResponse<GetAccountInfoApiResponse<AccountInfoWithBase64EncodedData>>;
78
+ /**
79
+ * Fetches information associated with the account at the given address.
80
+ *
81
+ * If the account has data, it will first be compressed using
82
+ * [ZStandard](https://facebook.github.io/zstd/) and the result will be returned in the response
83
+ * as a tuple whose first element is a base64-encoded string.
84
+ *
85
+ * {@label base64-zstd-compressed}
86
+ * @see https://solana.com/docs/rpc/http/getaccountinfo
87
+ */
88
+ getAccountInfo(
89
+ address: Address,
90
+ config: GetAccountInfoApiCommonConfig &
91
+ GetAccountInfoApiSliceableCommonConfig &
92
+ Readonly<{
93
+ encoding: 'base64+zstd';
94
+ }>,
95
+ ): SolanaRpcResponse<GetAccountInfoApiResponse<AccountInfoWithBase64EncodedZStdCompressedData>>;
96
+ /**
97
+ * Fetches information associated with the account at the given address.
98
+ *
99
+ * If the account has data, the server will attempt to process it using a parser specific to the
100
+ * account's owning program. If successful, the parsed data will be returned in the response as
101
+ * JSON. Otherwise, the raw account data will be returned in the response as a tuple whose first
102
+ * element is a base64-encoded string.
103
+ *
104
+ * {@label parsed}
105
+ * @see https://solana.com/docs/rpc/http/getaccountinfo
106
+ */
107
+ getAccountInfo(
108
+ address: Address,
109
+ config: GetAccountInfoApiCommonConfig &
110
+ Readonly<{
111
+ encoding: 'jsonParsed';
112
+ }>,
113
+ ): SolanaRpcResponse<GetAccountInfoApiResponse<AccountInfoWithJsonData>>;
114
+ /**
115
+ * Fetches information associated with the account at the given address.
116
+ *
117
+ * If the account has data, it will be returned in the response as a tuple whose first element
118
+ * is a base58-encoded string. If the account contains more than 129 bytes of data, this method
119
+ * will raise an error.
120
+ *
121
+ * {@label base58}
122
+ * @see https://solana.com/docs/rpc/http/getaccountinfo
123
+ */
124
+ getAccountInfo(
125
+ address: Address,
126
+ config: GetAccountInfoApiCommonConfig &
127
+ GetAccountInfoApiSliceableCommonConfig &
128
+ Readonly<{
129
+ encoding: 'base58';
130
+ }>,
131
+ ): SolanaRpcResponse<GetAccountInfoApiResponse<AccountInfoWithBase58EncodedData>>;
132
+ /**
133
+ * Fetches information associated with the account at the given address.
134
+ *
135
+ * If the account has data, it will be returned in the response as a base58-encoded string. If
136
+ * the account contains more than 129 bytes of data, this method will raise an error.
137
+ *
138
+ * {@label base58-legacy}
139
+ * @see https://solana.com/docs/rpc/http/getaccountinfo
140
+ */
141
+ getAccountInfo(
142
+ address: Address,
143
+ config?: Omit<GetAccountInfoApiCommonConfig, 'encoding'>,
144
+ ): SolanaRpcResponse<GetAccountInfoApiResponse<AccountInfoWithBase58Bytes>>;
145
+ };
@@ -0,0 +1,31 @@
1
+ import type { Address } from '@solana/addresses';
2
+ import type { Commitment, Lamports, Slot, SolanaRpcResponse } from '@solana/rpc-types';
3
+
4
+ type GetBalanceApiResponse = SolanaRpcResponse<Lamports>;
5
+
6
+ export type GetBalanceApi = {
7
+ /**
8
+ * Fetches the Lamport balance of the account at the given address.
9
+ * @see https://solana.com/docs/rpc/http/getbalance
10
+ */
11
+ getBalance(
12
+ address: Address,
13
+ config?: Readonly<{
14
+ /**
15
+ * Fetch the balance of the account as of the highest slot that has reached this level
16
+ * of commitment.
17
+ *
18
+ * @defaultValue Whichever default is applied by the underlying {@link RpcApi} in use.
19
+ * For example, when using an API created by a `createSolanaRpc*()` helper, the default
20
+ * commitment is `"confirmed"` unless configured otherwise. Unmitigated by an API layer
21
+ * on the client, the default commitment applied by the server is `"finalized"`.
22
+ */
23
+ commitment?: Commitment;
24
+ /**
25
+ * Prevents accessing stale data by enforcing that the RPC node has processed
26
+ * transactions up to this slot
27
+ */
28
+ minContextSlot?: Slot;
29
+ }>,
30
+ ): GetBalanceApiResponse;
31
+ };