@solana/rpc-subscriptions-api 2.0.0-experimental.12ae1c6

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 (37) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +17 -0
  3. package/dist/index.browser.cjs +201 -0
  4. package/dist/index.browser.cjs.map +1 -0
  5. package/dist/index.browser.js +198 -0
  6. package/dist/index.browser.js.map +1 -0
  7. package/dist/index.native.js +198 -0
  8. package/dist/index.native.js.map +1 -0
  9. package/dist/index.node.cjs +201 -0
  10. package/dist/index.node.cjs.map +1 -0
  11. package/dist/index.node.js +198 -0
  12. package/dist/index.node.js.map +1 -0
  13. package/dist/types/account-notifications.d.ts +30 -0
  14. package/dist/types/account-notifications.d.ts.map +1 -0
  15. package/dist/types/block-notifications.d.ts +237 -0
  16. package/dist/types/block-notifications.d.ts.map +1 -0
  17. package/dist/types/common-transactions.d.ts +247 -0
  18. package/dist/types/common-transactions.d.ts.map +1 -0
  19. package/dist/types/common.d.ts +53 -0
  20. package/dist/types/common.d.ts.map +1 -0
  21. package/dist/types/index.d.ts +18 -0
  22. package/dist/types/index.d.ts.map +1 -0
  23. package/dist/types/logs-notifications.d.ts +25 -0
  24. package/dist/types/logs-notifications.d.ts.map +1 -0
  25. package/dist/types/program-notifications.d.ts +45 -0
  26. package/dist/types/program-notifications.d.ts.map +1 -0
  27. package/dist/types/root-notifications.d.ts +11 -0
  28. package/dist/types/root-notifications.d.ts.map +1 -0
  29. package/dist/types/signature-notifications.d.ts +25 -0
  30. package/dist/types/signature-notifications.d.ts.map +1 -0
  31. package/dist/types/slot-notifications.d.ts +15 -0
  32. package/dist/types/slot-notifications.d.ts.map +1 -0
  33. package/dist/types/slots-updates-notifications.d.ts +33 -0
  34. package/dist/types/slots-updates-notifications.d.ts.map +1 -0
  35. package/dist/types/vote-notifications.d.ts +19 -0
  36. package/dist/types/vote-notifications.d.ts.map +1 -0
  37. package/package.json +80 -0
@@ -0,0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AGF,yBAAyB,CAAC;CACnC,CAAC,CAAC;AAEH,MAAM,MAAM,qBAAqB,CAAC,QAAQ,SAAS,eAAe,IAAI,QAAQ,CAAC;IAC3E,OAAO,EAAE,QAAQ,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;CACnB,CAAC,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAChC,uEAAuE;IACvE,YAAY,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,uCAAuC;IACvC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,WAAW,CAAC;CAC9B,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { RpcSubscriptionsApi, RpcSubscriptionsApiMethods } from '@solana/rpc-subscriptions-spec';
2
+ import { ParamsTransformerConfig } from '@solana/rpc-transformers';
3
+ import { AccountNotificationsApi } from './account-notifications';
4
+ import { BlockNotificationsApi } from './block-notifications';
5
+ import { LogsNotificationsApi } from './logs-notifications';
6
+ import { ProgramNotificationsApi } from './program-notifications';
7
+ import { RootNotificationsApi } from './root-notifications';
8
+ import { SignatureNotificationsApi } from './signature-notifications';
9
+ import { SlotNotificationsApi } from './slot-notifications';
10
+ import { SlotsUpdatesNotificationsApi } from './slots-updates-notifications';
11
+ import { VoteNotificationsApi } from './vote-notifications';
12
+ export type SolanaRpcSubscriptionsApi = AccountNotificationsApi & BlockNotificationsApi & LogsNotificationsApi & ProgramNotificationsApi & RootNotificationsApi & SignatureNotificationsApi & SlotNotificationsApi;
13
+ export type SolanaRpcSubscriptionsApiUnstable = SlotsUpdatesNotificationsApi & VoteNotificationsApi;
14
+ export type { AccountNotificationsApi, BlockNotificationsApi, LogsNotificationsApi, ProgramNotificationsApi, RootNotificationsApi, SignatureNotificationsApi, SlotNotificationsApi, SlotsUpdatesNotificationsApi, VoteNotificationsApi, };
15
+ type Config = ParamsTransformerConfig;
16
+ export declare function createSolanaRpcSubscriptionsApi<TApi extends RpcSubscriptionsApiMethods = SolanaRpcSubscriptionsApi>(config?: Config): RpcSubscriptionsApi<TApi>;
17
+ export declare function createSolanaRpcSubscriptionsApi_UNSTABLE(config?: Config): RpcSubscriptionsApi<AccountNotificationsApi & BlockNotificationsApi & LogsNotificationsApi & ProgramNotificationsApi & RootNotificationsApi & SignatureNotificationsApi & SlotNotificationsApi & SlotsUpdatesNotificationsApi & VoteNotificationsApi>;
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,mBAAmB,EACnB,0BAA0B,EAC7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAMH,uBAAuB,EAC1B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,MAAM,yBAAyB,GAAG,uBAAuB,GAC3D,qBAAqB,GACrB,oBAAoB,GACpB,uBAAuB,GACvB,oBAAoB,GACpB,yBAAyB,GACzB,oBAAoB,CAAC;AACzB,MAAM,MAAM,iCAAiC,GAAG,4BAA4B,GAAG,oBAAoB,CAAC;AAEpG,YAAY,EACR,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACpB,4BAA4B,EAC5B,oBAAoB,GACvB,CAAC;AAEF,KAAK,MAAM,GAAG,uBAAuB,CAAC;AAiBtC,wBAAgB,+BAA+B,CAAC,IAAI,SAAS,0BAA0B,GAAG,yBAAyB,EAC/G,MAAM,CAAC,EAAE,MAAM,GAChB,mBAAmB,CAAC,IAAI,CAAC,CAE3B;AAED,wBAAgB,wCAAwC,CAAC,MAAM,CAAC,EAAE,MAAM,yPAIvE"}
@@ -0,0 +1,25 @@
1
+ import type { Address } from '@solana/addresses';
2
+ import type { Signature } from '@solana/keys';
3
+ import type { RpcSubscriptionsApiMethods } from '@solana/rpc-subscriptions-spec';
4
+ import type { Commitment, SolanaRpcResponse, TransactionError } from '@solana/rpc-types';
5
+ type LogsNotificationsApiNotification = SolanaRpcResponse<Readonly<{
6
+ err: TransactionError | null;
7
+ logs: readonly string[] | null;
8
+ signature: Signature;
9
+ }>>;
10
+ type LogsNotificationsApiFilter = 'all' | 'allWithVotes' | {
11
+ mentions: [Address];
12
+ };
13
+ type LogsNotificationsApiConfig = Readonly<{
14
+ commitment?: Commitment;
15
+ }>;
16
+ export interface LogsNotificationsApi extends RpcSubscriptionsApiMethods {
17
+ /**
18
+ * Subscribe to a transaction logs to receive notification when a given transaction is committed.
19
+ * On `logsNotification` - the subscription is automatically cancelled.
20
+ * The logs must be a txid, the first logs of a transaction.
21
+ */
22
+ logsNotifications(filter: LogsNotificationsApiFilter, config?: LogsNotificationsApiConfig): LogsNotificationsApiNotification;
23
+ }
24
+ export {};
25
+ //# sourceMappingURL=logs-notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs-notifications.d.ts","sourceRoot":"","sources":["../../src/logs-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEzF,KAAK,gCAAgC,GAAG,iBAAiB,CACrD,QAAQ,CAAC;IAEL,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAI7B,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IAE/B,SAAS,EAAE,SAAS,CAAC;CACxB,CAAC,CACL,CAAC;AAIF,KAAK,0BAA0B,GAAG,KAAK,GAAG,cAAc,GAAG;IAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAA;CAAE,CAAC;AAEnF,KAAK,0BAA0B,GAAG,QAAQ,CAAC;IACvC,UAAU,CAAC,EAAE,UAAU,CAAC;CAC3B,CAAC,CAAC;AAEH,MAAM,WAAW,oBAAqB,SAAQ,0BAA0B;IACpE;;;;OAIG;IACH,iBAAiB,CACb,MAAM,EAAE,0BAA0B,EAClC,MAAM,CAAC,EAAE,0BAA0B,GACpC,gCAAgC,CAAC;CACvC"}
@@ -0,0 +1,45 @@
1
+ import type { Address } from '@solana/addresses';
2
+ import type { RpcSubscriptionsApiMethods } from '@solana/rpc-subscriptions-spec';
3
+ import type { AccountInfoBase, AccountInfoWithBase58Bytes, AccountInfoWithBase58EncodedData, AccountInfoWithBase64EncodedData, AccountInfoWithBase64EncodedZStdCompressedData, AccountInfoWithJsonData, Base58EncodedBytes, Base64EncodedBytes, Commitment, SolanaRpcResponse, U64UnsafeBeyond2Pow53Minus1 } from '@solana/rpc-types';
4
+ type ProgramNotificationsMemcmpFilterBase58 = Readonly<{
5
+ offset: U64UnsafeBeyond2Pow53Minus1;
6
+ bytes: Base58EncodedBytes;
7
+ encoding: 'base58';
8
+ }>;
9
+ type ProgramNotificationsMemcmpFilterBase64 = Readonly<{
10
+ offset: U64UnsafeBeyond2Pow53Minus1;
11
+ bytes: Base64EncodedBytes;
12
+ encoding: 'base64';
13
+ }>;
14
+ type ProgramNotificationsDatasizeFilter = Readonly<{
15
+ dataSize: U64UnsafeBeyond2Pow53Minus1;
16
+ }>;
17
+ type ProgramNotificationsApiNotificationBase<TData> = SolanaRpcResponse<Readonly<{
18
+ pubkey: Address;
19
+ account: AccountInfoBase & TData;
20
+ }>>;
21
+ type ProgramNotificationsApiCommonConfig = Readonly<{
22
+ commitment?: Commitment;
23
+ filters?: readonly (ProgramNotificationsMemcmpFilterBase58 | ProgramNotificationsMemcmpFilterBase64 | ProgramNotificationsDatasizeFilter)[];
24
+ }>;
25
+ export interface ProgramNotificationsApi extends RpcSubscriptionsApiMethods {
26
+ /**
27
+ * Subscribe to a program to receive notifications when the lamports or data for an account
28
+ * owned by the given program changes
29
+ */
30
+ programNotifications(programId: Address, config: ProgramNotificationsApiCommonConfig & Readonly<{
31
+ encoding: 'base64';
32
+ }>): ProgramNotificationsApiNotificationBase<AccountInfoWithBase64EncodedData>;
33
+ programNotifications(programId: Address, config: ProgramNotificationsApiCommonConfig & Readonly<{
34
+ encoding: 'base64+zstd';
35
+ }>): ProgramNotificationsApiNotificationBase<AccountInfoWithBase64EncodedZStdCompressedData>;
36
+ programNotifications(programId: Address, config: ProgramNotificationsApiCommonConfig & Readonly<{
37
+ encoding: 'jsonParsed';
38
+ }>): ProgramNotificationsApiNotificationBase<AccountInfoWithJsonData>;
39
+ programNotifications(programId: Address, config: ProgramNotificationsApiCommonConfig & Readonly<{
40
+ encoding: 'base58';
41
+ }>): ProgramNotificationsApiNotificationBase<AccountInfoWithBase58EncodedData>;
42
+ programNotifications(programId: Address, config?: ProgramNotificationsApiCommonConfig): ProgramNotificationsApiNotificationBase<AccountInfoWithBase58Bytes>;
43
+ }
44
+ export {};
45
+ //# sourceMappingURL=program-notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":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AE,mCAAmC,GACvC,QAAQ,CAAC;QACL,QAAQ,EAAE,QAAQ,CAAC;KACtB,CAAC,GACP,uCAAuC,CAAC,gCAAgC,CAAC,CAAC;IAC7E,oBAAoB,CAChB,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,mCAAmC,GACvC,QAAQ,CAAC;QACL,QAAQ,EAAE,aAAa,CAAC;KAC3B,CAAC,GACP,uCAAuC,CAAC,8CAA8C,CAAC,CAAC;IAC3F,oBAAoB,CAChB,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,mCAAmC,GACvC,QAAQ,CAAC;QACL,QAAQ,EAAE,YAAY,CAAC;KAC1B,CAAC,GACP,uCAAuC,CAAC,uBAAuB,CAAC,CAAC;IACpE,oBAAoB,CAChB,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,mCAAmC,GACvC,QAAQ,CAAC;QACL,QAAQ,EAAE,QAAQ,CAAC;KACtB,CAAC,GACP,uCAAuC,CAAC,gCAAgC,CAAC,CAAC;IAC7E,oBAAoB,CAChB,SAAS,EAAE,OAAO,EAClB,MAAM,CAAC,EAAE,mCAAmC,GAC7C,uCAAuC,CAAC,0BAA0B,CAAC,CAAC;CAC1E"}
@@ -0,0 +1,11 @@
1
+ import type { RpcSubscriptionsApiMethods } from '@solana/rpc-subscriptions-spec';
2
+ import type { Slot } from '@solana/rpc-types';
3
+ type RootNotificationsApiNotification = Slot;
4
+ export interface RootNotificationsApi extends RpcSubscriptionsApiMethods {
5
+ /**
6
+ * Subscribe to receive notification anytime a new root is set by the validator
7
+ */
8
+ rootNotifications(NO_CONFIG?: Record<string, never>): RootNotificationsApiNotification;
9
+ }
10
+ export {};
11
+ //# sourceMappingURL=root-notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-notifications.d.ts","sourceRoot":"","sources":["../../src/root-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE9C,KAAK,gCAAgC,GAAG,IAAI,CAAC;AAE7C,MAAM,WAAW,oBAAqB,SAAQ,0BAA0B;IACpE;;OAEG;IACH,iBAAiB,CAEb,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAClC,gCAAgC,CAAC;CACvC"}
@@ -0,0 +1,25 @@
1
+ import type { Signature } from '@solana/keys';
2
+ import type { RpcSubscriptionsApiMethods } from '@solana/rpc-subscriptions-spec';
3
+ import type { Commitment, SolanaRpcResponse, TransactionError } from '@solana/rpc-types';
4
+ type SignatureNotificationsApiNotificationReceived = SolanaRpcResponse<Readonly<string>>;
5
+ type SignatureNotificationsApiNotificationProcessed = SolanaRpcResponse<Readonly<{
6
+ err: TransactionError | null;
7
+ }>>;
8
+ type SignatureNotificationsApiConfigBase = Readonly<{
9
+ commitment?: Commitment;
10
+ }>;
11
+ export interface SignatureNotificationsApi extends RpcSubscriptionsApiMethods {
12
+ /**
13
+ * Subscribe to a transaction signature to receive notification when a given transaction is committed.
14
+ * On `signatureNotification` - the subscription is automatically cancelled.
15
+ * The signature must be a txid, the first signature of a transaction.
16
+ */
17
+ signatureNotifications(signature: Signature, config: SignatureNotificationsApiConfigBase & Readonly<{
18
+ enableReceivedNotification: true;
19
+ }>): SignatureNotificationsApiNotificationReceived | SignatureNotificationsApiNotificationProcessed;
20
+ signatureNotifications(signature: Signature, config?: SignatureNotificationsApiConfigBase & Readonly<{
21
+ enableReceivedNotification?: false;
22
+ }>): SignatureNotificationsApiNotificationProcessed;
23
+ }
24
+ export {};
25
+ //# sourceMappingURL=signature-notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signature-notifications.d.ts","sourceRoot":"","sources":["../../src/signature-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEzF,KAAK,6CAA6C,GAAG,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AAEzF,KAAK,8CAA8C,GAAG,iBAAiB,CACnE,QAAQ,CAAC;IAEL,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAChC,CAAC,CACL,CAAC;AAEF,KAAK,mCAAmC,GAAG,QAAQ,CAAC;IAChD,UAAU,CAAC,EAAE,UAAU,CAAC;CAC3B,CAAC,CAAC;AAEH,MAAM,WAAW,yBAA0B,SAAQ,0BAA0B;IACzE;;;;OAIG;IACH,sBAAsB,CAElB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,mCAAmC,GACvC,QAAQ,CAAC;QAGL,0BAA0B,EAAE,IAAI,CAAC;KACpC,CAAC,GACP,6CAA6C,GAAG,8CAA8C,CAAC;IAClG,sBAAsB,CAClB,SAAS,EAAE,SAAS,EACpB,MAAM,CAAC,EAAE,mCAAmC,GACxC,QAAQ,CAAC;QACL,0BAA0B,CAAC,EAAE,KAAK,CAAC;KACtC,CAAC,GACP,8CAA8C,CAAC;CACrD"}
@@ -0,0 +1,15 @@
1
+ import type { RpcSubscriptionsApiMethods } from '@solana/rpc-subscriptions-spec';
2
+ import type { Slot } from '@solana/rpc-types';
3
+ type SlotNotificationsApiNotification = Readonly<{
4
+ parent: Slot;
5
+ root: Slot;
6
+ slot: Slot;
7
+ }>;
8
+ export interface SlotNotificationsApi extends RpcSubscriptionsApiMethods {
9
+ /**
10
+ * Subscribe to receive notification anytime a slot is processed by the validator
11
+ */
12
+ slotNotifications(NO_CONFIG?: Record<string, never>): SlotNotificationsApiNotification;
13
+ }
14
+ export {};
15
+ //# sourceMappingURL=slot-notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slot-notifications.d.ts","sourceRoot":"","sources":["../../src/slot-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE9C,KAAK,gCAAgC,GAAG,QAAQ,CAAC;IAC7C,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,IAAI,CAAC;CACd,CAAC,CAAC;AAEH,MAAM,WAAW,oBAAqB,SAAQ,0BAA0B;IACpE;;OAEG;IACH,iBAAiB,CAEb,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAClC,gCAAgC,CAAC;CACvC"}
@@ -0,0 +1,33 @@
1
+ import type { RpcSubscriptionsApiMethods } from '@solana/rpc-subscriptions-spec';
2
+ import type { Slot, U64UnsafeBeyond2Pow53Minus1 } from '@solana/rpc-types';
3
+ type SlotsUpdatesNotificationsApiNotificationBase = Readonly<{
4
+ slot: Slot;
5
+ timestamp: U64UnsafeBeyond2Pow53Minus1;
6
+ type: 'completed' | 'firstShredReceived' | 'optimisticConfirmation' | 'root';
7
+ }>;
8
+ type SlotsUpdatesNotificationsApiNotificationCreatedBank = SlotsUpdatesNotificationsApiNotificationBase & Readonly<{
9
+ parent: Slot;
10
+ type: 'createdBank';
11
+ }>;
12
+ type SlotsUpdatesNotificationsApiNotificationDead = SlotsUpdatesNotificationsApiNotificationBase & Readonly<{
13
+ err: string;
14
+ type: 'dead';
15
+ }>;
16
+ type SlotsUpdatesNotificationsApiNotificationFrozen = SlotsUpdatesNotificationsApiNotificationBase & Readonly<{
17
+ stats: Readonly<{
18
+ maxTransactionsPerEntry: U64UnsafeBeyond2Pow53Minus1;
19
+ numFailedTransactions: U64UnsafeBeyond2Pow53Minus1;
20
+ numSuccessfulTransactions: U64UnsafeBeyond2Pow53Minus1;
21
+ numTransactionEntries: U64UnsafeBeyond2Pow53Minus1;
22
+ }>;
23
+ type: 'frozen';
24
+ }>;
25
+ type SlotsUpdatesNotificationsApiNotification = SlotsUpdatesNotificationsApiNotificationBase | SlotsUpdatesNotificationsApiNotificationCreatedBank | SlotsUpdatesNotificationsApiNotificationDead | SlotsUpdatesNotificationsApiNotificationFrozen;
26
+ export interface SlotsUpdatesNotificationsApi extends RpcSubscriptionsApiMethods {
27
+ /**
28
+ * Subscribe to receive a notification from the validator on a variety of updates on every slot
29
+ */
30
+ slotsUpdatesNotifications(NO_CONFIG?: Record<string, never>): SlotsUpdatesNotificationsApiNotification;
31
+ }
32
+ export {};
33
+ //# sourceMappingURL=slots-updates-notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slots-updates-notifications.d.ts","sourceRoot":"","sources":["../../src/slots-updates-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,KAAK,EAAE,IAAI,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAE3E,KAAK,4CAA4C,GAAG,QAAQ,CAAC;IACzD,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,EAAE,2BAA2B,CAAC;IACvC,IAAI,EAAE,WAAW,GAAG,oBAAoB,GAAG,wBAAwB,GAAG,MAAM,CAAC;CAChF,CAAC,CAAC;AAEH,KAAK,mDAAmD,GAAG,4CAA4C,GACnG,QAAQ,CAAC;IACL,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;CACvB,CAAC,CAAC;AAEP,KAAK,4CAA4C,GAAG,4CAA4C,GAC5F,QAAQ,CAAC;IACL,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEP,KAAK,8CAA8C,GAAG,4CAA4C,GAC9F,QAAQ,CAAC;IACL,KAAK,EAAE,QAAQ,CAAC;QACZ,uBAAuB,EAAE,2BAA2B,CAAC;QACrD,qBAAqB,EAAE,2BAA2B,CAAC;QACnD,yBAAyB,EAAE,2BAA2B,CAAC;QACvD,qBAAqB,EAAE,2BAA2B,CAAC;KACtD,CAAC,CAAC;IACH,IAAI,EAAE,QAAQ,CAAC;CAClB,CAAC,CAAC;AAEP,KAAK,wCAAwC,GACvC,4CAA4C,GAC5C,mDAAmD,GACnD,4CAA4C,GAC5C,8CAA8C,CAAC;AAErD,MAAM,WAAW,4BAA6B,SAAQ,0BAA0B;IAC5E;;OAEG;IACH,yBAAyB,CAErB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAClC,wCAAwC,CAAC;CAC/C"}
@@ -0,0 +1,19 @@
1
+ import type { Address } from '@solana/addresses';
2
+ import type { Signature } from '@solana/keys';
3
+ import type { RpcSubscriptionsApiMethods } from '@solana/rpc-subscriptions-spec';
4
+ import type { Blockhash, Slot, UnixTimestamp } from '@solana/rpc-types';
5
+ type VoteNotificationsApiNotification = Readonly<{
6
+ hash: Blockhash;
7
+ signature: Signature;
8
+ slots: readonly Slot[];
9
+ timestamp: UnixTimestamp | null;
10
+ votePubkey: Address;
11
+ }>;
12
+ export interface VoteNotificationsApi extends RpcSubscriptionsApiMethods {
13
+ /**
14
+ * Subscribe to receive a notification from the validator on a variety of updates on every slot
15
+ */
16
+ voteNotifications(NO_CONFIG?: Record<string, never>): VoteNotificationsApiNotification;
17
+ }
18
+ export {};
19
+ //# sourceMappingURL=vote-notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vote-notifications.d.ts","sourceRoot":"","sources":["../../src/vote-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAExE,KAAK,gCAAgC,GAAG,QAAQ,CAAC;IAC7C,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IACvB,SAAS,EAAE,aAAa,GAAG,IAAI,CAAC;IAChC,UAAU,EAAE,OAAO,CAAC;CACvB,CAAC,CAAC;AAEH,MAAM,WAAW,oBAAqB,SAAQ,0BAA0B;IACpE;;OAEG;IACH,iBAAiB,CAEb,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAClC,gCAAgC,CAAC;CACvC"}
package/package.json ADDED
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "@solana/rpc-subscriptions-api",
3
+ "version": "2.0.0-experimental.12ae1c6",
4
+ "description": "Defines all default Solana RPC subscriptions as types",
5
+ "exports": {
6
+ "browser": {
7
+ "import": "./dist/index.browser.js",
8
+ "require": "./dist/index.browser.cjs"
9
+ },
10
+ "node": {
11
+ "import": "./dist/index.node.js",
12
+ "require": "./dist/index.node.cjs"
13
+ },
14
+ "react-native": "./dist/index.native.js",
15
+ "types": "./dist/types/index.d.ts"
16
+ },
17
+ "browser": {
18
+ "./dist/index.node.cjs": "./dist/index.browser.cjs",
19
+ "./dist/index.node.js": "./dist/index.browser.js"
20
+ },
21
+ "main": "./dist/index.node.cjs",
22
+ "module": "./dist/index.node.js",
23
+ "react-native": "./dist/index.native.js",
24
+ "types": "./dist/types/index.d.ts",
25
+ "type": "module",
26
+ "files": [
27
+ "./dist/"
28
+ ],
29
+ "sideEffects": false,
30
+ "keywords": [
31
+ "blockchain",
32
+ "solana",
33
+ "web3"
34
+ ],
35
+ "author": "Solana Labs Maintainers <maintainers@solanalabs.com>",
36
+ "license": "MIT",
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "https://github.com/solana-labs/solana-web3.js"
40
+ },
41
+ "bugs": {
42
+ "url": "http://github.com/solana-labs/solana-web3.js/issues"
43
+ },
44
+ "browserslist": [
45
+ "supports bigint and not dead",
46
+ "maintained node versions"
47
+ ],
48
+ "dependencies": {
49
+ "@solana/addresses": "2.0.0-development",
50
+ "@solana/keys": "2.0.0-development",
51
+ "@solana/rpc-subscriptions-spec": "2.0.0-development",
52
+ "@solana/rpc-transformers": "2.0.0-development",
53
+ "@solana/rpc-types": "2.0.0-development",
54
+ "@solana/transactions": "2.0.0-development"
55
+ },
56
+ "bundlewatch": {
57
+ "defaultCompression": "gzip",
58
+ "files": [
59
+ {
60
+ "path": "./dist/index*.js"
61
+ }
62
+ ]
63
+ },
64
+ "scripts": {
65
+ "compile:js": "tsup --config build-scripts/tsup.config.package.ts",
66
+ "compile:typedefs": "tsc -p ./tsconfig.declarations.json && node node_modules/@solana/build-scripts/add-js-extension-to-types.mjs",
67
+ "dev": "jest -c node_modules/@solana/test-config/jest-dev.config.ts --globalSetup @solana/test-config/test-validator-setup.js --globalTeardown @solana/test-config/test-validator-teardown.js --rootDir . --watch",
68
+ "publish-impl": "npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || pnpm publish --tag experimental --access public --no-git-checks",
69
+ "publish-packages": "pnpm prepublishOnly && pnpm publish-impl",
70
+ "style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/* package.json",
71
+ "test:lint": "jest -c node_modules/@solana/test-config/jest-lint.config.ts --rootDir . --silent",
72
+ "test:prettier": "jest -c node_modules/@solana/test-config/jest-prettier.config.ts --rootDir . --silent",
73
+ "test:treeshakability:browser": "agadoo dist/index.browser.js",
74
+ "test:treeshakability:native": "agadoo dist/index.native.js",
75
+ "test:treeshakability:node": "agadoo dist/index.node.js",
76
+ "test:typecheck": "tsc --noEmit",
77
+ "test:unit:browser": "jest -c node_modules/@solana/test-config/jest-unit.config.browser.ts --globalSetup @solana/test-config/test-validator-setup.js --globalTeardown @solana/test-config/test-validator-teardown.js --rootDir . --silent",
78
+ "test:unit:node": "jest -c node_modules/@solana/test-config/jest-unit.config.node.ts --globalSetup @solana/test-config/test-validator-setup.js --globalTeardown @solana/test-config/test-validator-teardown.js --rootDir . --silent"
79
+ }
80
+ }