@triton-one/yellowstone-grpc 5.0.8 → 5.0.9
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/README.md +70 -0
- package/dist/cjs/grpc/geyser.js +414 -8
- package/dist/cjs/grpc/geyser.js.map +1 -1
- package/dist/cjs/grpc/solana-storage.js +21 -2
- package/dist/cjs/grpc/solana-storage.js.map +1 -1
- package/dist/cjs/index.js +128 -103
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/napi/index.js +54 -52
- package/dist/cjs/napi/index.js.map +1 -1
- package/dist/esm/grpc/geyser.js +406 -4
- package/dist/esm/grpc/solana-storage.js +20 -1
- package/dist/esm/index.js +118 -106
- package/dist/esm/napi/index.js +54 -52
- package/dist/types/grpc/geyser.d.ts +40 -0
- package/dist/types/grpc/solana-storage.d.ts +1 -0
- package/dist/types/index.d.ts +31 -4
- package/dist/types/napi/index.d.ts +45 -445
- package/package.json +7 -7
|
@@ -21,6 +21,18 @@ export declare enum SlotStatus {
|
|
|
21
21
|
}
|
|
22
22
|
export declare function slotStatusFromJSON(object: any): SlotStatus;
|
|
23
23
|
export declare function slotStatusToJSON(object: SlotStatus): string;
|
|
24
|
+
/**
|
|
25
|
+
* Hash algorithm used to build the filter. Carried on the wire so future
|
|
26
|
+
* releases can add alternative algorithms (e.g., xxh3) without breaking
|
|
27
|
+
* existing clients. Readers should verify this matches a supported algorithm
|
|
28
|
+
* before deserializing.
|
|
29
|
+
*/
|
|
30
|
+
export declare enum CuckooHashAlgorithm {
|
|
31
|
+
SIP_HASH = 0,
|
|
32
|
+
UNRECOGNIZED = -1
|
|
33
|
+
}
|
|
34
|
+
export declare function cuckooHashAlgorithmFromJSON(object: any): CuckooHashAlgorithm;
|
|
35
|
+
export declare function cuckooHashAlgorithmToJSON(object: CuckooHashAlgorithm): string;
|
|
24
36
|
export interface SubscribeRequest {
|
|
25
37
|
accounts: {
|
|
26
38
|
[key: string]: SubscribeRequestFilterAccounts;
|
|
@@ -76,11 +88,25 @@ export interface SubscribeRequest_EntryEntry {
|
|
|
76
88
|
key: string;
|
|
77
89
|
value: SubscribeRequestFilterEntry | undefined;
|
|
78
90
|
}
|
|
91
|
+
export interface CuckooFilter {
|
|
92
|
+
/** bucket data */
|
|
93
|
+
data: Uint8Array;
|
|
94
|
+
/** number of buckets */
|
|
95
|
+
bucketCount: number;
|
|
96
|
+
/** slots per bucket (typically 4) */
|
|
97
|
+
entriesPerBucket: number;
|
|
98
|
+
/** fingerprint size (8, 12, or 16) */
|
|
99
|
+
fingerprintBits: number;
|
|
100
|
+
/** seed for deterministic hashing */
|
|
101
|
+
hashSeed: string;
|
|
102
|
+
hashAlgorithm: CuckooHashAlgorithm;
|
|
103
|
+
}
|
|
79
104
|
export interface SubscribeRequestFilterAccounts {
|
|
80
105
|
account: string[];
|
|
81
106
|
owner: string[];
|
|
82
107
|
filters: SubscribeRequestFilterAccountsFilter[];
|
|
83
108
|
nonemptyTxnSignature?: boolean | undefined;
|
|
109
|
+
cuckooAccountsFilter?: CuckooFilter | undefined;
|
|
84
110
|
}
|
|
85
111
|
export interface SubscribeRequestFilterAccountsFilter {
|
|
86
112
|
memcmp?: SubscribeRequestFilterAccountsFilterMemcmp | undefined;
|
|
@@ -117,6 +143,7 @@ export interface SubscribeRequestFilterBlocks {
|
|
|
117
143
|
includeTransactions?: boolean | undefined;
|
|
118
144
|
includeAccounts?: boolean | undefined;
|
|
119
145
|
includeEntries?: boolean | undefined;
|
|
146
|
+
cuckooAccountInclude?: CuckooFilter | undefined;
|
|
120
147
|
}
|
|
121
148
|
export interface SubscribeRequestFilterBlocksMeta {
|
|
122
149
|
}
|
|
@@ -155,11 +182,18 @@ export interface SubscribeDeshredRequest {
|
|
|
155
182
|
[key: string]: SubscribeRequestFilterDeshredTransactions;
|
|
156
183
|
};
|
|
157
184
|
ping?: SubscribeRequestPing | undefined;
|
|
185
|
+
slots: {
|
|
186
|
+
[key: string]: SubscribeRequestFilterSlots;
|
|
187
|
+
};
|
|
158
188
|
}
|
|
159
189
|
export interface SubscribeDeshredRequest_DeshredTransactionsEntry {
|
|
160
190
|
key: string;
|
|
161
191
|
value: SubscribeRequestFilterDeshredTransactions | undefined;
|
|
162
192
|
}
|
|
193
|
+
export interface SubscribeDeshredRequest_SlotsEntry {
|
|
194
|
+
key: string;
|
|
195
|
+
value: SubscribeRequestFilterSlots | undefined;
|
|
196
|
+
}
|
|
163
197
|
export interface SubscribeUpdate {
|
|
164
198
|
filters: string[];
|
|
165
199
|
account?: SubscribeUpdateAccount | undefined;
|
|
@@ -257,6 +291,8 @@ export interface SubscribeUpdateDeshredTransactionInfo {
|
|
|
257
291
|
transaction: Transaction | undefined;
|
|
258
292
|
loadedWritableAddresses: Uint8Array[];
|
|
259
293
|
loadedReadonlyAddresses: Uint8Array[];
|
|
294
|
+
completedDataSetStartingShredIndex: number;
|
|
295
|
+
completedDataSetEndingShredIndexExclusive: number;
|
|
260
296
|
}
|
|
261
297
|
export interface SubscribeUpdatePing {
|
|
262
298
|
}
|
|
@@ -268,6 +304,8 @@ export interface SubscribeUpdateDeshred {
|
|
|
268
304
|
deshredTransaction?: SubscribeUpdateDeshredTransaction | undefined;
|
|
269
305
|
ping?: SubscribeUpdatePing | undefined;
|
|
270
306
|
pong?: SubscribeUpdatePong | undefined;
|
|
307
|
+
/** field 5 is reserved for created_at (below the oneof) */
|
|
308
|
+
slot?: SubscribeUpdateSlot | undefined;
|
|
271
309
|
createdAt: Date | undefined;
|
|
272
310
|
}
|
|
273
311
|
export interface SubscribeReplayInfoRequest {
|
|
@@ -322,6 +360,7 @@ export declare const SubscribeRequest_TransactionsStatusEntry: MessageFns<Subscr
|
|
|
322
360
|
export declare const SubscribeRequest_BlocksEntry: MessageFns<SubscribeRequest_BlocksEntry>;
|
|
323
361
|
export declare const SubscribeRequest_BlocksMetaEntry: MessageFns<SubscribeRequest_BlocksMetaEntry>;
|
|
324
362
|
export declare const SubscribeRequest_EntryEntry: MessageFns<SubscribeRequest_EntryEntry>;
|
|
363
|
+
export declare const CuckooFilter: MessageFns<CuckooFilter>;
|
|
325
364
|
export declare const SubscribeRequestFilterAccounts: MessageFns<SubscribeRequestFilterAccounts>;
|
|
326
365
|
export declare const SubscribeRequestFilterAccountsFilter: MessageFns<SubscribeRequestFilterAccountsFilter>;
|
|
327
366
|
export declare const SubscribeRequestFilterAccountsFilterMemcmp: MessageFns<SubscribeRequestFilterAccountsFilterMemcmp>;
|
|
@@ -336,6 +375,7 @@ export declare const SubscribeRequestAccountsDataSlice: MessageFns<SubscribeRequ
|
|
|
336
375
|
export declare const SubscribeRequestPing: MessageFns<SubscribeRequestPing>;
|
|
337
376
|
export declare const SubscribeDeshredRequest: MessageFns<SubscribeDeshredRequest>;
|
|
338
377
|
export declare const SubscribeDeshredRequest_DeshredTransactionsEntry: MessageFns<SubscribeDeshredRequest_DeshredTransactionsEntry>;
|
|
378
|
+
export declare const SubscribeDeshredRequest_SlotsEntry: MessageFns<SubscribeDeshredRequest_SlotsEntry>;
|
|
339
379
|
export declare const SubscribeUpdate: MessageFns<SubscribeUpdate>;
|
|
340
380
|
export declare const SubscribeUpdateAccount: MessageFns<SubscribeUpdateAccount>;
|
|
341
381
|
export declare const SubscribeUpdateAccountInfo: MessageFns<SubscribeUpdateAccountInfo>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,22 +1,49 @@
|
|
|
1
1
|
/** TypeScript/JavaScript client for gRPC Geyser. */
|
|
2
2
|
import { SubscribeUpdateDeshredTransactionInfo, SubscribeUpdateTransactionInfo } from "./grpc/geyser";
|
|
3
|
-
import type { CommitmentLevel, GetBlockHeightResponse, GetLatestBlockhashResponse, GetSlotResponse, GetVersionResponse, IsBlockhashValidResponse, PongResponse, SubscribeDeshredRequest, SubscribeReplayInfoResponse, SubscribeRequest } from "./grpc/geyser";
|
|
4
|
-
export { CommitmentLevel, SubscribeDeshredRequest, SubscribeDeshredRequest_DeshredTransactionsEntry, SubscribeRequest, SubscribeRequest_AccountsEntry, SubscribeRequest_BlocksEntry, SubscribeRequest_BlocksMetaEntry, SubscribeRequestFilterDeshredTransactions, SubscribeRequest_SlotsEntry, SubscribeRequest_TransactionsEntry, SubscribeRequestAccountsDataSlice, SubscribeRequestFilterAccounts, SubscribeRequestFilterAccountsFilter, SubscribeRequestFilterAccountsFilterLamports, SubscribeRequestFilterAccountsFilterMemcmp, SubscribeRequestFilterBlocks, SubscribeRequestFilterBlocksMeta, SubscribeRequestFilterEntry, SubscribeRequestFilterSlots, SubscribeRequestFilterTransactions, SubscribeUpdate, SubscribeUpdateAccount, SubscribeUpdateAccountInfo, SubscribeUpdateBlock, SubscribeUpdateBlockMeta, SubscribeUpdateDeshred, SubscribeUpdateDeshredTransaction, SubscribeUpdateDeshredTransactionInfo, SubscribeUpdatePing, SubscribeUpdateSlot, SubscribeUpdateTransaction, SubscribeUpdateTransactionInfo, } from "./grpc/geyser";
|
|
3
|
+
import type { CommitmentLevel, CuckooFilter, GetBlockHeightResponse, GetLatestBlockhashResponse, GetSlotResponse, GetVersionResponse, IsBlockhashValidResponse, PongResponse, SubscribeDeshredRequest, SubscribeReplayInfoResponse, SubscribeRequest, SubscribeRequestFilterAccounts, SubscribeRequestFilterBlocks } from "./grpc/geyser";
|
|
4
|
+
export { CommitmentLevel, CuckooFilter, CuckooHashAlgorithm, SubscribeDeshredRequest, SubscribeDeshredRequest_DeshredTransactionsEntry, SubscribeRequest, SubscribeRequest_AccountsEntry, SubscribeRequest_BlocksEntry, SubscribeRequest_BlocksMetaEntry, SubscribeRequestFilterDeshredTransactions, SubscribeRequest_SlotsEntry, SubscribeRequest_TransactionsEntry, SubscribeRequestAccountsDataSlice, SubscribeRequestFilterAccounts, SubscribeRequestFilterAccountsFilter, SubscribeRequestFilterAccountsFilterLamports, SubscribeRequestFilterAccountsFilterMemcmp, SubscribeRequestFilterBlocks, SubscribeRequestFilterBlocksMeta, SubscribeRequestFilterEntry, SubscribeRequestFilterSlots, SubscribeRequestFilterTransactions, SubscribeUpdate, SubscribeUpdateAccount, SubscribeUpdateAccountInfo, SubscribeUpdateBlock, SubscribeUpdateBlockMeta, SubscribeUpdateDeshred, SubscribeUpdateDeshredTransaction, SubscribeUpdateDeshredTransactionInfo, SubscribeUpdatePing, SubscribeUpdateSlot, SubscribeUpdateTransaction, SubscribeUpdateTransactionInfo, } from "./grpc/geyser";
|
|
5
5
|
import type { TransactionErrorSolana, DeshredTransactionEncodingToReturnType, MapTransactionEncodingToReturnType } from "./types";
|
|
6
6
|
import { Duplex } from "stream";
|
|
7
7
|
import * as napi from "./napi/index";
|
|
8
|
+
export declare const AUTORECONNECT_FILTER_KEY: string;
|
|
8
9
|
/**
|
|
9
10
|
* Public channel options accepted by the SDK constructor.
|
|
10
11
|
* This is sourced from the native N-API constructor signature to avoid
|
|
11
12
|
* duplicating option fields in this file.
|
|
12
13
|
*/
|
|
13
14
|
export type ChannelOptions = NonNullable<Parameters<typeof napi.GrpcClient.new>[2]>;
|
|
15
|
+
export interface ReconnectOptions {
|
|
16
|
+
enabled?: boolean;
|
|
17
|
+
backoff?: {
|
|
18
|
+
initialIntervalMs?: number;
|
|
19
|
+
multiplier?: number;
|
|
20
|
+
maxRetries?: number;
|
|
21
|
+
};
|
|
22
|
+
slotRetention?: number;
|
|
23
|
+
}
|
|
24
|
+
export type PubkeyInput = string | Uint8Array;
|
|
25
|
+
export declare class CompressedAccountFilterSet {
|
|
26
|
+
private _native;
|
|
27
|
+
constructor(maxCapacity: number);
|
|
28
|
+
insert(pubkey: PubkeyInput): boolean;
|
|
29
|
+
remove(pubkey: PubkeyInput): boolean;
|
|
30
|
+
contains(pubkey: PubkeyInput): boolean;
|
|
31
|
+
len(): number;
|
|
32
|
+
capacity(): number;
|
|
33
|
+
isEmpty(): boolean;
|
|
34
|
+
toProto(): CuckooFilter;
|
|
35
|
+
toAccountFilter(): SubscribeRequestFilterAccounts;
|
|
36
|
+
toBlockFilter(): SubscribeRequestFilterBlocks;
|
|
37
|
+
insertIntoSubscribeRequest(request: SubscribeRequest, name: string): void;
|
|
38
|
+
insertIntoBlockSubscribeRequest(request: SubscribeRequest, name: string): void;
|
|
39
|
+
}
|
|
14
40
|
export default class Client {
|
|
15
41
|
private _insecureEndpoint;
|
|
16
42
|
private _insecureXToken;
|
|
17
43
|
private _channelOptions;
|
|
44
|
+
private _reconnectOptions;
|
|
18
45
|
private _grpcClient;
|
|
19
|
-
constructor(endpoint: string, xToken: string | undefined, channel_options: ChannelOptions | undefined);
|
|
46
|
+
constructor(endpoint: string, xToken: string | undefined, channel_options: ChannelOptions | undefined, reconnect_options?: ReconnectOptions);
|
|
20
47
|
private _connectedGrpcClient;
|
|
21
48
|
connect(): Promise<void>;
|
|
22
49
|
getLatestBlockhash(commitment?: CommitmentLevel): Promise<GetLatestBlockhashResponse>;
|
|
@@ -26,7 +53,7 @@ export default class Client {
|
|
|
26
53
|
isBlockhashValid(blockhash: string, commitment?: CommitmentLevel): Promise<IsBlockhashValidResponse>;
|
|
27
54
|
getVersion(): Promise<GetVersionResponse>;
|
|
28
55
|
subscribeReplayInfo(): Promise<SubscribeReplayInfoResponse>;
|
|
29
|
-
subscribe(): Promise<ClientDuplexStream>;
|
|
56
|
+
subscribe(request?: SubscribeRequest): Promise<ClientDuplexStream>;
|
|
30
57
|
subscribeDeshred(): Promise<ClientDeshredDuplexStream>;
|
|
31
58
|
}
|
|
32
59
|
export declare class ClientDuplexStream extends Duplex {
|