@solana/rpc-subscriptions-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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/rpc-subscriptions-api",
3
- "version": "6.3.1",
3
+ "version": "6.3.2-canary-20260313112147",
4
4
  "description": "Defines all default Solana RPC subscriptions as types",
5
5
  "homepage": "https://www.solanakit.com/api#solanarpc-subscriptions-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,13 +56,13 @@
55
56
  "maintained node versions"
56
57
  ],
57
58
  "dependencies": {
58
- "@solana/addresses": "6.3.1",
59
- "@solana/keys": "6.3.1",
60
- "@solana/rpc-subscriptions-spec": "6.3.1",
61
- "@solana/rpc-transformers": "6.3.1",
62
- "@solana/rpc-types": "6.3.1",
63
- "@solana/transaction-messages": "6.3.1",
64
- "@solana/transactions": "6.3.1"
59
+ "@solana/addresses": "6.3.2-canary-20260313112147",
60
+ "@solana/keys": "6.3.2-canary-20260313112147",
61
+ "@solana/rpc-subscriptions-spec": "6.3.2-canary-20260313112147",
62
+ "@solana/rpc-transformers": "6.3.2-canary-20260313112147",
63
+ "@solana/rpc-types": "6.3.2-canary-20260313112147",
64
+ "@solana/transaction-messages": "6.3.2-canary-20260313112147",
65
+ "@solana/transactions": "6.3.2-canary-20260313112147"
65
66
  },
66
67
  "peerDependencies": {
67
68
  "typescript": "^5.0.0"
@@ -0,0 +1,128 @@
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
+ SolanaRpcResponse,
11
+ } from '@solana/rpc-types';
12
+
13
+ type AccountNotificationsApiCommonConfig = Readonly<{
14
+ /**
15
+ * Get notified when a modification to an account has reached this level of commitment.
16
+ *
17
+ * @defaultValue Whichever default is applied by the underlying {@link RpcSubscriptionsApi} in
18
+ * use. For example, when using an API created by a `createSolanaRpcSubscriptions*()` helper,
19
+ * the default commitment is `"confirmed"` unless configured otherwise. Unmitigated by an API
20
+ * layer on the client, the default commitment applied by the server is `"finalized"`.
21
+ */
22
+ commitment?: Commitment;
23
+ }>;
24
+
25
+ export type AccountNotificationsApi = {
26
+ /**
27
+ * Subscribe for notifications when there is a change in the {@link Lamports} or data of the
28
+ * account at the specified address.
29
+ *
30
+ * The notification format is the same as seen in the {@link GetAccountInfoApi.getAccountInfo}
31
+ * RPC HTTP method.
32
+ *
33
+ * If the account has data, it will be returned in the response as a tuple whose first element
34
+ * is a base64-encoded string.
35
+ *
36
+ * {@label base64}
37
+ * @see https://solana.com/docs/rpc/websocket/accountsubscribe
38
+ */
39
+ accountNotifications(
40
+ address: Address,
41
+ config: AccountNotificationsApiCommonConfig &
42
+ Readonly<{
43
+ encoding: 'base64';
44
+ }>,
45
+ ): SolanaRpcResponse<AccountInfoBase & AccountInfoWithBase64EncodedData>;
46
+ /**
47
+ * Subscribe for notifications when there is a change in the {@link Lamports} or data of the
48
+ * account at the specified address.
49
+ *
50
+ * The notification format is the same as seen in the {@link GetAccountInfoApi.getAccountInfo}
51
+ * RPC HTTP method.
52
+ *
53
+ * If the account has data, it will first be compressed using
54
+ * [ZStandard](https://facebook.github.io/zstd/) and the result will be returned in the response
55
+ * as a tuple whose first element is a base64-encoded string.
56
+ *
57
+ * {@label base64-zstd-compressed}
58
+ * @see https://solana.com/docs/rpc/websocket/accountsubscribe
59
+ */
60
+ accountNotifications(
61
+ address: Address,
62
+ config: AccountNotificationsApiCommonConfig &
63
+ Readonly<{
64
+ encoding: 'base64+zstd';
65
+ }>,
66
+ ): SolanaRpcResponse<AccountInfoBase & AccountInfoWithBase64EncodedZStdCompressedData>;
67
+ /**
68
+ * Subscribe for notifications when there is a change in the {@link Lamports} or data of the
69
+ * account at the specified address.
70
+ *
71
+ * The notification format is the same as seen in the {@link GetAccountInfoApi.getAccountInfo}
72
+ * RPC HTTP method.
73
+ *
74
+ * If the account has data, the server will attempt to process it using a parser specific to the
75
+ * account's owning program. If successful, the parsed data will be returned in the response as
76
+ * JSON. Otherwise, the raw account data will be returned in the response as a tuple whose first
77
+ * element is a base64-encoded string.
78
+ *
79
+ * {@label parsed}
80
+ * @see https://solana.com/docs/rpc/websocket/accountsubscribe
81
+ */
82
+ accountNotifications(
83
+ address: Address,
84
+ config: AccountNotificationsApiCommonConfig &
85
+ Readonly<{
86
+ encoding: 'jsonParsed';
87
+ }>,
88
+ ): SolanaRpcResponse<AccountInfoBase & AccountInfoWithJsonData>;
89
+ /**
90
+ * Subscribe for notifications when there is a change in the {@link Lamports} or data of the
91
+ * account at the specified address.
92
+ *
93
+ * The notification format is the same as seen in the {@link GetAccountInfoApi.getAccountInfo}
94
+ * RPC HTTP method.
95
+ *
96
+ * If the account has data, it will be returned in the response as a tuple whose first element
97
+ * is a base58-encoded string. If the account contains more than 129 bytes of data, the `data`
98
+ * field will materialize as the string `"error: data too large for bs58 encoding"`.
99
+ *
100
+ * {@label base58}
101
+ * @see https://solana.com/docs/rpc/websocket/accountsubscribe
102
+ */
103
+ accountNotifications(
104
+ address: Address,
105
+ config: AccountNotificationsApiCommonConfig &
106
+ Readonly<{
107
+ encoding: 'base58';
108
+ }>,
109
+ ): SolanaRpcResponse<AccountInfoBase & AccountInfoWithBase58EncodedData>;
110
+ /**
111
+ * Subscribe for notifications when there is a change in the {@link Lamports} or data of the
112
+ * account at the specified address.
113
+ *
114
+ * The notification format is the same as seen in the {@link GetAccountInfoApi.getAccountInfo}
115
+ * RPC HTTP method.
116
+ *
117
+ * If the account has data, it will be returned in the response as a base58-encoded string. If
118
+ * the account contains more than 129 bytes of data, the `data` field will materialize as the
119
+ * string `"error: data too large for bs58 encoding"`.
120
+ *
121
+ * {@label base58-legacy}
122
+ * @see https://solana.com/docs/rpc/websocket/accountsubscribe
123
+ */
124
+ accountNotifications(
125
+ address: Address,
126
+ config?: AccountNotificationsApiCommonConfig,
127
+ ): SolanaRpcResponse<AccountInfoBase & AccountInfoWithBase58Bytes>;
128
+ };