@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.
@@ -1,5 +1,21 @@
1
1
  /* auto-generated by NAPI-RS */
2
2
  /* eslint-disable */
3
+ export declare class CompressedAccountFilterSet {
4
+ constructor(maxCapacity: number)
5
+ insert(pubkey: string): boolean
6
+ insertBytes(pubkey: Buffer): boolean
7
+ remove(pubkey: string): boolean
8
+ removeBytes(pubkey: Buffer): boolean
9
+ contains(pubkey: string): boolean
10
+ containsBytes(pubkey: Buffer): boolean
11
+ len(): number
12
+ capacity(): number
13
+ isEmpty(): boolean
14
+ toProto(): Buffer
15
+ toAccountFilter(): Buffer
16
+ toBlockFilter(): Buffer
17
+ }
18
+
3
19
  /**
4
20
  * DuplexStream Engine
5
21
  *
@@ -14,18 +30,11 @@ export declare class DuplexStream {
14
30
  /**
15
31
  * Read JS Accesspoint.
16
32
  *
17
- * Retrieve one `SubscribeUpdate` from the worker and convert it to
18
- * the generated N-API JS representation (`JsSubscribeUpdate`).
19
- */
20
- read(): Promise<JsSubscribeUpdate | undefined | null>
21
- /**
22
- * Write JS Accesspoint.
23
- *
24
- * Accept a JS request object, convert to protobuf, then enqueue for the
25
- * worker to forward to the gRPC request sink.
33
+ * Retrieve one encoded `SubscribeUpdate` payload from the worker.
26
34
  */
35
+ read(): Promise<Buffer | undefined | null>
36
+ /** Close the stream and reject future writes. */
27
37
  close(): void
28
- write(request: JsSubscribeRequest): void
29
38
  writeRaw(requestBytes: Buffer): void
30
39
  }
31
40
 
@@ -35,10 +44,9 @@ export declare class DuplexStream {
35
44
  * Similar to `DuplexStream`, but targets the deshred pre-execution stream.
36
45
  */
37
46
  export declare class DuplexStreamDeshred {
38
- /** Retrieve one `SubscribeUpdateDeshred` and convert it to generated N-API JS shape. */
39
- read(): Promise<JsSubscribeUpdateDeshred | undefined | null>
47
+ /** Retrieve one encoded `SubscribeUpdateDeshred` payload. */
48
+ read(): Promise<Buffer | undefined | null>
40
49
  close(): void
41
- write(request: JsSubscribeDeshredRequest): void
42
50
  writeRaw(requestBytes: Buffer): void
43
51
  }
44
52
 
@@ -60,21 +68,21 @@ export declare class GrpcClient {
60
68
  *
61
69
  * The connection is persistent and will be reused for all subsequent operations.
62
70
  */
63
- static new(endpoint: string, xToken?: string | undefined | null, channelOptions?: JsChannelOptions | undefined | null): Promise<GrpcClient>
64
- getLatestBlockhash(request: JsGetLatestBlockhashRequest): Promise<JsGetLatestBlockhashResponse>
65
- ping(request: JsPingRequest): Promise<JsPongResponse>
66
- getBlockHeight(request: JsGetBlockHeightRequest): Promise<JsGetBlockHeightResponse>
67
- getSlot(request: JsGetSlotRequest): Promise<JsGetSlotResponse>
68
- isBlockhashValid(request: JsIsBlockhashValidRequest): Promise<JsIsBlockhashValidResponse>
69
- getVersion(getVersionRequest: JsGetVersionRequest): Promise<JsGetVersionResponse>
70
- subscribeReplayInfo(subscribeReplayInfoRequest: JsSubscribeReplayInfoRequest): Promise<JsSubscribeReplayInfoResponse>
71
+ static new(endpoint: string, xToken?: string | undefined | null, channelOptions?: JsChannelOptions | undefined | null, reconnectConfig?: JsReconnectConfig | undefined | null): Promise<GrpcClient>
72
+ getLatestBlockhash(requestBytes: Buffer): Promise<Buffer>
73
+ ping(requestBytes: Buffer): Promise<Buffer>
74
+ getBlockHeight(requestBytes: Buffer): Promise<Buffer>
75
+ getSlot(requestBytes: Buffer): Promise<Buffer>
76
+ isBlockhashValid(requestBytes: Buffer): Promise<Buffer>
77
+ getVersion(requestBytes: Buffer): Promise<Buffer>
78
+ subscribeReplayInfo(requestBytes: Buffer): Promise<Buffer>
71
79
  /**
72
80
  * Creates a subscription stream bound to this client connection.
73
81
  *
74
82
  * The returned value is consumed by the JS SDK `ClientDuplexStream` wrapper,
75
- * which handles Node stream lifecycle and protobuf-shape normalization.
83
+ * which handles Node stream lifecycle and protobuf payload decoding.
76
84
  */
77
- subscribe(): Promise<DuplexStream>
85
+ subscribe(initialRequestBytes?: Buffer | undefined | null): Promise<DuplexStream>
78
86
  /**
79
87
  * Creates a deshred subscription stream bound to this client connection.
80
88
  *
@@ -85,16 +93,14 @@ export declare class GrpcClient {
85
93
  subscribeDeshred(): Promise<DuplexStreamDeshred>
86
94
  }
87
95
 
96
+ export const AUTORECONNECT_FILTER_KEY: string
97
+
88
98
  export declare function decodeTxError(err: Array<number>): string
89
99
 
90
100
  export declare function encodeDeshredTx(data: Uint8Array, encoding: WasmUiTransactionEncoding): string
91
101
 
92
102
  export declare function encodeTx(data: Uint8Array, encoding: WasmUiTransactionEncoding, maxSupportedTransactionVersion: number | undefined | null, showRewards: boolean): string
93
103
 
94
- export interface JsBlockHeight {
95
- blockHeight: string
96
- }
97
-
98
104
  /**
99
105
  * ChannelOptions from JS.
100
106
  *
@@ -123,431 +129,25 @@ export interface JsChannelOptions {
123
129
  grpcTcpNodelay?: boolean
124
130
  }
125
131
 
126
- export interface JsCompiledInstruction {
127
- programIdIndex: number
128
- accounts: Buffer
129
- data: Buffer
130
- }
131
-
132
132
  export declare const enum JsCompressionAlgorithm {
133
133
  Gzip = 0,
134
134
  Zstd = 1
135
135
  }
136
136
 
137
- export interface JsConfirmedBlock {
138
- previousBlockhash: string
139
- blockhash: string
140
- parentSlot: string
141
- transactions: Array<JsConfirmedTransaction>
142
- rewards: Array<JsReward>
143
- blockTime?: JsUnixTimestamp
144
- blockHeight?: JsBlockHeight
145
- numPartitions?: JsNumPartitions
146
- }
147
-
148
- export interface JsConfirmedTransaction {
149
- transaction?: JsTransaction
150
- meta?: JsTransactionStatusMeta
151
- }
152
-
153
- export interface JsGetBlockHeightRequest {
154
- commitment?: number
155
- }
156
-
157
- export interface JsGetBlockHeightResponse {
158
- blockHeight: string
159
- }
160
-
161
- export interface JsGetLatestBlockhashRequest {
162
- commitment?: number
163
- }
164
-
165
- export interface JsGetLatestBlockhashResponse {
166
- slot: string
167
- blockhash: string
168
- lastValidBlockHeight: string
169
- }
170
-
171
- export interface JsGetSlotRequest {
172
- commitment?: number
173
- }
174
-
175
- export interface JsGetSlotResponse {
176
- slot: string
177
- }
178
-
179
- export interface JsGetVersionRequest {
180
-
181
- }
182
-
183
- export interface JsGetVersionResponse {
184
- version: string
185
- }
186
-
187
- export interface JsInnerInstruction {
188
- programIdIndex: number
189
- accounts: Buffer
190
- data: Buffer
191
- stackHeight?: number
192
- }
193
-
194
- export interface JsInnerInstructions {
195
- index: number
196
- instructions: Array<JsInnerInstruction>
197
- }
198
-
199
- export interface JsIsBlockhashValidRequest {
200
- blockhash: string
201
- commitment?: number
202
- }
203
-
204
- export interface JsIsBlockhashValidResponse {
205
- slot: string
206
- valid: boolean
207
- }
208
-
209
- export interface JsMessage {
210
- header?: JsMessageHeader
211
- accountKeys: Array<Buffer>
212
- recentBlockhash: Buffer
213
- instructions: Array<JsCompiledInstruction>
214
- versioned: boolean
215
- addressTableLookups: Array<JsMessageAddressTableLookup>
216
- }
217
-
218
- export interface JsMessageAddressTableLookup {
219
- accountKey: Buffer
220
- writableIndexes: Buffer
221
- readonlyIndexes: Buffer
222
- }
223
-
224
- export interface JsMessageHeader {
225
- numRequiredSignatures: number
226
- numReadonlySignedAccounts: number
227
- numReadonlyUnsignedAccounts: number
228
- }
229
-
230
- export interface JsNumPartitions {
231
- numPartitions: string
232
- }
233
-
234
- export interface JsPingRequest {
235
- count: number
236
- }
237
-
238
- export interface JsPongResponse {
239
- count: number
240
- }
241
-
242
- export interface JsReturnData {
243
- programId: Buffer
244
- data: Buffer
245
- }
246
-
247
- export interface JsReward {
248
- pubkey: string
249
- lamports: string
250
- postBalance: string
251
- rewardType: number
252
- commission: string
253
- }
254
-
255
- export interface JsRewards {
256
- rewards: Array<JsReward>
257
- numPartitions?: JsNumPartitions
258
- }
259
-
260
- export interface JsSubscribeDeshredRequest {
261
- deshredTransactions: Record<string, JsSubscribeRequestFilterDeshredTransactions>
262
- ping?: JsSubscribeRequestPing
263
- }
264
-
265
- export interface JsSubscribeReplayInfoRequest {
266
-
267
- }
268
-
269
- export interface JsSubscribeReplayInfoResponse {
270
- firstAvailable?: string
271
- }
272
-
273
- export interface JsSubscribeRequest {
274
- accounts: Record<string, JsSubscribeRequestFilterAccounts>
275
- slots: Record<string, JsSubscribeRequestFilterSlots>
276
- transactions: Record<string, JsSubscribeRequestFilterTransactions>
277
- transactionsStatus: Record<string, JsSubscribeRequestFilterTransactions>
278
- blocks: Record<string, JsSubscribeRequestFilterBlocks>
279
- blocksMeta: Record<string, JsSubscribeRequestFilterBlocksMeta>
280
- entry: Record<string, JsSubscribeRequestFilterEntry>
281
- commitment?: number
282
- accountsDataSlice: Array<JsSubscribeRequestAccountsDataSlice>
283
- ping?: JsSubscribeRequestPing
284
- fromSlot?: string
285
- }
286
-
287
- export interface JsSubscribeRequestAccountsDataSlice {
288
- offset: string
289
- length: string
290
- }
291
-
292
- export interface JsSubscribeRequestFilterAccounts {
293
- account: Array<string>
294
- owner: Array<string>
295
- filters: Array<JsSubscribeRequestFilterAccountsFilter>
296
- nonemptyTxnSignature?: boolean
297
- }
298
-
299
- export interface JsSubscribeRequestFilterAccountsFilter {
300
- filter?: JsSubscribeRequestFilterAccountsFilterFilter
301
- }
302
-
303
- export interface JsSubscribeRequestFilterAccountsFilterFilter {
304
- memcmp?: JsSubscribeRequestFilterAccountsFilterMemcmp
305
- datasize?: string
306
- tokenAccountState?: boolean
307
- lamports?: JsSubscribeRequestFilterAccountsFilterLamports
137
+ export interface JsReconnectBackoff {
138
+ initialIntervalMs?: number
139
+ multiplier?: number
140
+ maxRetries?: number
308
141
  }
309
142
 
310
- export interface JsSubscribeRequestFilterAccountsFilterLamports {
311
- cmp?: JsSubscribeRequestFilterAccountsFilterLamportsCmp
312
- }
313
-
314
- export interface JsSubscribeRequestFilterAccountsFilterLamportsCmp {
315
- eq?: string
316
- ne?: string
317
- lt?: string
318
- gt?: string
319
- }
320
-
321
- export interface JsSubscribeRequestFilterAccountsFilterMemcmp {
322
- offset: string
323
- data?: JsSubscribeRequestFilterAccountsFilterMemcmpData
324
- }
325
-
326
- export interface JsSubscribeRequestFilterAccountsFilterMemcmpData {
327
- bytes?: Buffer
328
- base58?: string
329
- base64?: string
330
- }
331
-
332
- export interface JsSubscribeRequestFilterBlocks {
333
- accountInclude: Array<string>
334
- includeTransactions?: boolean
335
- includeAccounts?: boolean
336
- includeEntries?: boolean
337
- }
338
-
339
- export interface JsSubscribeRequestFilterBlocksMeta {
340
-
341
- }
342
-
343
- export interface JsSubscribeRequestFilterDeshredTransactions {
344
- vote?: boolean
345
- accountInclude: Array<string>
346
- accountExclude: Array<string>
347
- accountRequired: Array<string>
348
- }
349
-
350
- export interface JsSubscribeRequestFilterEntry {
351
-
352
- }
353
-
354
- export interface JsSubscribeRequestFilterSlots {
355
- filterByCommitment?: boolean
356
- interslotUpdates?: boolean
357
- }
358
-
359
- export interface JsSubscribeRequestFilterTransactions {
360
- vote?: boolean
361
- failed?: boolean
362
- signature?: string
363
- accountInclude: Array<string>
364
- accountExclude: Array<string>
365
- accountRequired: Array<string>
366
- }
367
-
368
- export interface JsSubscribeRequestPing {
369
- id: number
370
- }
371
-
372
- export interface JsSubscribeUpdate {
373
- filters: Array<string>
374
- createdAt?: Date
375
- updateOneof?: JsSubscribeUpdateUpdateOneof
376
- }
377
-
378
- export interface JsSubscribeUpdateAccount {
379
- account?: JsSubscribeUpdateAccountInfo
380
- slot: string
381
- isStartup: boolean
382
- }
383
-
384
- export interface JsSubscribeUpdateAccountInfo {
385
- pubkey: Buffer
386
- lamports: string
387
- owner: Buffer
388
- executable: boolean
389
- rentEpoch: string
390
- data: Buffer
391
- writeVersion: string
392
- txnSignature?: Buffer
393
- }
394
-
395
- export interface JsSubscribeUpdateBlock {
396
- slot: string
397
- blockhash: string
398
- rewards?: JsRewards
399
- blockTime?: JsUnixTimestamp
400
- blockHeight?: JsBlockHeight
401
- parentSlot: string
402
- parentBlockhash: string
403
- executedTransactionCount: string
404
- transactions: Array<JsSubscribeUpdateTransactionInfo>
405
- updatedAccountCount: string
406
- accounts: Array<JsSubscribeUpdateAccountInfo>
407
- entriesCount: string
408
- entries: Array<JsSubscribeUpdateEntry>
409
- }
410
-
411
- export interface JsSubscribeUpdateBlockMeta {
412
- slot: string
413
- blockhash: string
414
- rewards?: JsRewards
415
- blockTime?: JsUnixTimestamp
416
- blockHeight?: JsBlockHeight
417
- parentSlot: string
418
- parentBlockhash: string
419
- executedTransactionCount: string
420
- entriesCount: string
421
- }
422
-
423
- export interface JsSubscribeUpdateDeshred {
424
- filters: Array<string>
425
- createdAt?: Date
426
- updateOneof?: JsSubscribeUpdateDeshredUpdateOneof
427
- }
428
-
429
- export interface JsSubscribeUpdateDeshredTransaction {
430
- transaction?: JsSubscribeUpdateDeshredTransactionInfo
431
- slot: string
432
- }
433
-
434
- export interface JsSubscribeUpdateDeshredTransactionInfo {
435
- signature: Buffer
436
- isVote: boolean
437
- transaction?: JsTransaction
438
- loadedWritableAddresses: Array<Buffer>
439
- loadedReadonlyAddresses: Array<Buffer>
440
- }
441
-
442
- export interface JsSubscribeUpdateDeshredUpdateOneof {
443
- deshredTransaction?: JsSubscribeUpdateDeshredTransaction
444
- ping?: JsSubscribeUpdatePing
445
- pong?: JsSubscribeUpdatePong
446
- }
447
-
448
- export interface JsSubscribeUpdateEntry {
449
- slot: string
450
- index: string
451
- numHashes: string
452
- hash: Buffer
453
- executedTransactionCount: string
454
- startingTransactionIndex: string
455
- }
456
-
457
- export interface JsSubscribeUpdatePing {
458
-
459
- }
460
-
461
- export interface JsSubscribeUpdatePong {
462
- id: number
463
- }
464
-
465
- export interface JsSubscribeUpdateSlot {
466
- slot: string
467
- parent?: string
468
- status: number
469
- deadError?: string
470
- }
471
-
472
- export interface JsSubscribeUpdateTransaction {
473
- transaction?: JsSubscribeUpdateTransactionInfo
474
- slot: string
475
- }
476
-
477
- export interface JsSubscribeUpdateTransactionInfo {
478
- signature: Buffer
479
- isVote: boolean
480
- transaction?: JsTransaction
481
- meta?: JsTransactionStatusMeta
482
- index: string
483
- }
484
-
485
- export interface JsSubscribeUpdateTransactionStatus {
486
- slot: string
487
- signature: Buffer
488
- isVote: boolean
489
- index: string
490
- err?: JsTransactionError
491
- }
492
-
493
- export interface JsSubscribeUpdateUpdateOneof {
494
- account?: JsSubscribeUpdateAccount
495
- slot?: JsSubscribeUpdateSlot
496
- transaction?: JsSubscribeUpdateTransaction
497
- transactionStatus?: JsSubscribeUpdateTransactionStatus
498
- block?: JsSubscribeUpdateBlock
499
- ping?: JsSubscribeUpdatePing
500
- pong?: JsSubscribeUpdatePong
501
- blockMeta?: JsSubscribeUpdateBlockMeta
502
- entry?: JsSubscribeUpdateEntry
503
- }
504
-
505
- export interface JsTokenBalance {
506
- accountIndex: number
507
- mint: string
508
- uiTokenAmount?: JsUiTokenAmount
509
- owner: string
510
- programId: string
511
- }
512
-
513
- export interface JsTransaction {
514
- signatures: Array<Buffer>
515
- message?: JsMessage
516
- }
517
-
518
- export interface JsTransactionError {
519
- err: Buffer
520
- }
521
-
522
- export interface JsTransactionStatusMeta {
523
- err?: JsTransactionError
524
- fee: string
525
- preBalances: Array<string>
526
- postBalances: Array<string>
527
- innerInstructions: Array<JsInnerInstructions>
528
- innerInstructionsNone: boolean
529
- logMessages: Array<string>
530
- logMessagesNone: boolean
531
- preTokenBalances: Array<JsTokenBalance>
532
- postTokenBalances: Array<JsTokenBalance>
533
- rewards: Array<JsReward>
534
- loadedWritableAddresses: Array<Buffer>
535
- loadedReadonlyAddresses: Array<Buffer>
536
- returnData?: JsReturnData
537
- returnDataNone: boolean
538
- computeUnitsConsumed?: string
539
- costUnits?: string
540
- }
541
-
542
- export interface JsUiTokenAmount {
543
- uiAmount: number
544
- decimals: number
545
- amount: string
546
- uiAmountString: string
547
- }
548
-
549
- export interface JsUnixTimestamp {
550
- timestamp: string
143
+ export interface JsReconnectConfig {
144
+ /**
145
+ * Omitted or true enables reconnect when this object is provided.
146
+ * False keeps legacy no-reconnect behavior.
147
+ */
148
+ enabled?: boolean
149
+ backoff?: JsReconnectBackoff
150
+ slotRetention?: number
551
151
  }
552
152
 
553
153
  export declare const enum WasmUiTransactionEncoding {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triton-one/yellowstone-grpc",
3
- "version": "5.0.8",
3
+ "version": "5.0.9",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Triton One",
6
6
  "description": "Yellowstone gRPC Geyser Node.js Client",
@@ -16,7 +16,7 @@
16
16
  "grpc-generate": "mkdir -p src/grpc && protoc -I../yellowstone-grpc-proto/proto --plugin=node_modules/.bin/protoc-gen-ts_proto --ts_proto_opt=forceLong=string --ts_proto_opt=outputServices=none --experimental_allow_proto3_optional --ts_proto_out=src/grpc geyser.proto --ts_proto_opt=esModuleInterop=true",
17
17
  "patch-napi-loader": "node napi/patch-napi-loader.js",
18
18
  "fmt": "prettier -w .",
19
- "test": "jest --forceExit"
19
+ "test": "jest --forceExit --runInBand"
20
20
  },
21
21
  "repository": {
22
22
  "type": "git",
@@ -39,10 +39,10 @@
39
39
  "@solana/rpc-types": "=5.1.0"
40
40
  },
41
41
  "optionalDependencies": {
42
- "@triton-one/yellowstone-grpc-napi-linux-x64-gnu": "0.0.13",
43
- "@triton-one/yellowstone-grpc-napi-linux-x64-musl": "0.0.13",
44
- "@triton-one/yellowstone-grpc-napi-darwin-arm64": "0.0.13",
45
- "@triton-one/yellowstone-grpc-napi-darwin-x64": "0.0.13"
42
+ "@triton-one/yellowstone-grpc-napi-linux-x64-gnu": "0.0.14",
43
+ "@triton-one/yellowstone-grpc-napi-linux-x64-musl": "0.0.14",
44
+ "@triton-one/yellowstone-grpc-napi-darwin-arm64": "0.0.14",
45
+ "@triton-one/yellowstone-grpc-napi-darwin-x64": "0.0.14"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@babel/core": "^7.28.5",
@@ -92,4 +92,4 @@
92
92
  "types": "./dist/types/napi/index.d.ts"
93
93
  }
94
94
  }
95
- }
95
+ }