@triton-one/yellowstone-grpc 5.0.2 → 5.0.4

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.
@@ -14,15 +14,18 @@ export declare class DuplexStream {
14
14
  /**
15
15
  * Read JS Accesspoint.
16
16
  *
17
- * Retrieve one SubscribeUpdate from the worker.
17
+ * Retrieve one `SubscribeUpdate` from the worker and convert it to
18
+ * the generated N-API JS representation (`JsSubscribeUpdate`).
18
19
  */
19
- read(): Promise<object>
20
+ read(): Promise<JsSubscribeUpdate | undefined | null>
20
21
  /**
21
22
  * Write JS Accesspoint.
22
23
  *
23
- * Take in SubscribeRequest and send to the worker.
24
+ * Accept a JS request object, convert to protobuf, then enqueue for the
25
+ * worker to forward to the gRPC request sink.
24
26
  */
25
- write(chunk: object): void
27
+ close(): void
28
+ write(request: JsSubscribeRequest): void
26
29
  }
27
30
 
28
31
  /**
@@ -49,8 +52,14 @@ export declare class GrpcClient {
49
52
  getBlockHeight(request: JsGetBlockHeightRequest): Promise<JsGetBlockHeightResponse>
50
53
  getSlot(request: JsGetSlotRequest): Promise<JsGetSlotResponse>
51
54
  isBlockhashValid(request: JsIsBlockhashValidRequest): Promise<JsIsBlockhashValidResponse>
52
- getVersion(request: JsGetVersionRequest): Promise<JsGetVersionResponse>
53
- subscribeReplayInfo(request: JsSubscribeReplayInfoRequest): Promise<JsSubscribeReplayInfoResponse>
55
+ getVersion(getVersionRequest: JsGetVersionRequest): Promise<JsGetVersionResponse>
56
+ subscribeReplayInfo(subscribeReplayInfoRequest: JsSubscribeReplayInfoRequest): Promise<JsSubscribeReplayInfoResponse>
57
+ /**
58
+ * Creates a subscription stream bound to this client connection.
59
+ *
60
+ * The returned value is consumed by the JS SDK `ClientDuplexStream` wrapper,
61
+ * which handles Node stream lifecycle and protobuf-shape normalization.
62
+ */
54
63
  subscribe(): DuplexStream
55
64
  }
56
65
 
@@ -58,6 +67,10 @@ export declare function decodeTxError(err: Array<number>): string
58
67
 
59
68
  export declare function encodeTx(data: Uint8Array, encoding: WasmUiTransactionEncoding, maxSupportedTransactionVersion: number | undefined | null, showRewards: boolean): string
60
69
 
70
+ export interface JsBlockHeight {
71
+ blockHeight: string
72
+ }
73
+
61
74
  /**
62
75
  * ChannelOptions from JS.
63
76
  *
@@ -86,11 +99,33 @@ export interface JsChannelOptions {
86
99
  grpcTcpNodelay?: boolean
87
100
  }
88
101
 
102
+ export interface JsCompiledInstruction {
103
+ programIdIndex: number
104
+ accounts: Buffer
105
+ data: Buffer
106
+ }
107
+
89
108
  export declare const enum JsCompressionAlgorithm {
90
109
  Gzip = 0,
91
110
  Zstd = 1
92
111
  }
93
112
 
113
+ export interface JsConfirmedBlock {
114
+ previousBlockhash: string
115
+ blockhash: string
116
+ parentSlot: string
117
+ transactions: Array<JsConfirmedTransaction>
118
+ rewards: Array<JsReward>
119
+ blockTime?: JsUnixTimestamp
120
+ blockHeight?: JsBlockHeight
121
+ numPartitions?: JsNumPartitions
122
+ }
123
+
124
+ export interface JsConfirmedTransaction {
125
+ transaction?: JsTransaction
126
+ meta?: JsTransactionStatusMeta
127
+ }
128
+
94
129
  export interface JsGetBlockHeightRequest {
95
130
  commitment?: number
96
131
  }
@@ -125,6 +160,18 @@ export interface JsGetVersionResponse {
125
160
  version: string
126
161
  }
127
162
 
163
+ export interface JsInnerInstruction {
164
+ programIdIndex: number
165
+ accounts: Buffer
166
+ data: Buffer
167
+ stackHeight?: number
168
+ }
169
+
170
+ export interface JsInnerInstructions {
171
+ index: number
172
+ instructions: Array<JsInnerInstruction>
173
+ }
174
+
128
175
  export interface JsIsBlockhashValidRequest {
129
176
  blockhash: string
130
177
  commitment?: number
@@ -135,6 +182,31 @@ export interface JsIsBlockhashValidResponse {
135
182
  valid: boolean
136
183
  }
137
184
 
185
+ export interface JsMessage {
186
+ header?: JsMessageHeader
187
+ accountKeys: Array<Buffer>
188
+ recentBlockhash: Buffer
189
+ instructions: Array<JsCompiledInstruction>
190
+ versioned: boolean
191
+ addressTableLookups: Array<JsMessageAddressTableLookup>
192
+ }
193
+
194
+ export interface JsMessageAddressTableLookup {
195
+ accountKey: Buffer
196
+ writableIndexes: Buffer
197
+ readonlyIndexes: Buffer
198
+ }
199
+
200
+ export interface JsMessageHeader {
201
+ numRequiredSignatures: number
202
+ numReadonlySignedAccounts: number
203
+ numReadonlyUnsignedAccounts: number
204
+ }
205
+
206
+ export interface JsNumPartitions {
207
+ numPartitions: string
208
+ }
209
+
138
210
  export interface JsPingRequest {
139
211
  count: number
140
212
  }
@@ -143,6 +215,24 @@ export interface JsPongResponse {
143
215
  count: number
144
216
  }
145
217
 
218
+ export interface JsReturnData {
219
+ programId: Buffer
220
+ data: Buffer
221
+ }
222
+
223
+ export interface JsReward {
224
+ pubkey: string
225
+ lamports: string
226
+ postBalance: string
227
+ rewardType: number
228
+ commission: string
229
+ }
230
+
231
+ export interface JsRewards {
232
+ rewards: Array<JsReward>
233
+ numPartitions?: JsNumPartitions
234
+ }
235
+
146
236
  export interface JsSubscribeReplayInfoRequest {
147
237
 
148
238
  }
@@ -151,6 +241,254 @@ export interface JsSubscribeReplayInfoResponse {
151
241
  firstAvailable?: string
152
242
  }
153
243
 
244
+ export interface JsSubscribeRequest {
245
+ accounts: Record<string, JsSubscribeRequestFilterAccounts>
246
+ slots: Record<string, JsSubscribeRequestFilterSlots>
247
+ transactions: Record<string, JsSubscribeRequestFilterTransactions>
248
+ transactionsStatus: Record<string, JsSubscribeRequestFilterTransactions>
249
+ blocks: Record<string, JsSubscribeRequestFilterBlocks>
250
+ blocksMeta: Record<string, JsSubscribeRequestFilterBlocksMeta>
251
+ entry: Record<string, JsSubscribeRequestFilterEntry>
252
+ commitment?: number
253
+ accountsDataSlice: Array<JsSubscribeRequestAccountsDataSlice>
254
+ ping?: JsSubscribeRequestPing
255
+ fromSlot?: string
256
+ }
257
+
258
+ export interface JsSubscribeRequestAccountsDataSlice {
259
+ offset: string
260
+ length: string
261
+ }
262
+
263
+ export interface JsSubscribeRequestFilterAccounts {
264
+ account: Array<string>
265
+ owner: Array<string>
266
+ filters: Array<JsSubscribeRequestFilterAccountsFilter>
267
+ nonemptyTxnSignature?: boolean
268
+ }
269
+
270
+ export interface JsSubscribeRequestFilterAccountsFilter {
271
+ filter?: JsSubscribeRequestFilterAccountsFilterFilter
272
+ }
273
+
274
+ export interface JsSubscribeRequestFilterAccountsFilterFilter {
275
+ memcmp?: JsSubscribeRequestFilterAccountsFilterMemcmp
276
+ datasize?: string
277
+ tokenAccountState?: boolean
278
+ lamports?: JsSubscribeRequestFilterAccountsFilterLamports
279
+ }
280
+
281
+ export interface JsSubscribeRequestFilterAccountsFilterLamports {
282
+ cmp?: JsSubscribeRequestFilterAccountsFilterLamportsCmp
283
+ }
284
+
285
+ export interface JsSubscribeRequestFilterAccountsFilterLamportsCmp {
286
+ eq?: string
287
+ ne?: string
288
+ lt?: string
289
+ gt?: string
290
+ }
291
+
292
+ export interface JsSubscribeRequestFilterAccountsFilterMemcmp {
293
+ offset: string
294
+ data?: JsSubscribeRequestFilterAccountsFilterMemcmpData
295
+ }
296
+
297
+ export interface JsSubscribeRequestFilterAccountsFilterMemcmpData {
298
+ bytes?: Buffer
299
+ base58?: string
300
+ base64?: string
301
+ }
302
+
303
+ export interface JsSubscribeRequestFilterBlocks {
304
+ accountInclude: Array<string>
305
+ includeTransactions?: boolean
306
+ includeAccounts?: boolean
307
+ includeEntries?: boolean
308
+ }
309
+
310
+ export interface JsSubscribeRequestFilterBlocksMeta {
311
+
312
+ }
313
+
314
+ export interface JsSubscribeRequestFilterEntry {
315
+
316
+ }
317
+
318
+ export interface JsSubscribeRequestFilterSlots {
319
+ filterByCommitment?: boolean
320
+ interslotUpdates?: boolean
321
+ }
322
+
323
+ export interface JsSubscribeRequestFilterTransactions {
324
+ vote?: boolean
325
+ failed?: boolean
326
+ signature?: string
327
+ accountInclude: Array<string>
328
+ accountExclude: Array<string>
329
+ accountRequired: Array<string>
330
+ }
331
+
332
+ export interface JsSubscribeRequestPing {
333
+ id: number
334
+ }
335
+
336
+ export interface JsSubscribeUpdate {
337
+ filters: Array<string>
338
+ createdAt?: Date
339
+ updateOneof?: JsSubscribeUpdateUpdateOneof
340
+ }
341
+
342
+ export interface JsSubscribeUpdateAccount {
343
+ account?: JsSubscribeUpdateAccountInfo
344
+ slot: string
345
+ isStartup: boolean
346
+ }
347
+
348
+ export interface JsSubscribeUpdateAccountInfo {
349
+ pubkey: Buffer
350
+ lamports: string
351
+ owner: Buffer
352
+ executable: boolean
353
+ rentEpoch: string
354
+ data: Buffer
355
+ writeVersion: string
356
+ txnSignature?: Buffer
357
+ }
358
+
359
+ export interface JsSubscribeUpdateBlock {
360
+ slot: string
361
+ blockhash: string
362
+ rewards?: JsRewards
363
+ blockTime?: JsUnixTimestamp
364
+ blockHeight?: JsBlockHeight
365
+ parentSlot: string
366
+ parentBlockhash: string
367
+ executedTransactionCount: string
368
+ transactions: Array<JsSubscribeUpdateTransactionInfo>
369
+ updatedAccountCount: string
370
+ accounts: Array<JsSubscribeUpdateAccountInfo>
371
+ entriesCount: string
372
+ entries: Array<JsSubscribeUpdateEntry>
373
+ }
374
+
375
+ export interface JsSubscribeUpdateBlockMeta {
376
+ slot: string
377
+ blockhash: string
378
+ rewards?: JsRewards
379
+ blockTime?: JsUnixTimestamp
380
+ blockHeight?: JsBlockHeight
381
+ parentSlot: string
382
+ parentBlockhash: string
383
+ executedTransactionCount: string
384
+ entriesCount: string
385
+ }
386
+
387
+ export interface JsSubscribeUpdateEntry {
388
+ slot: string
389
+ index: string
390
+ numHashes: string
391
+ hash: Buffer
392
+ executedTransactionCount: string
393
+ startingTransactionIndex: string
394
+ }
395
+
396
+ export interface JsSubscribeUpdatePing {
397
+
398
+ }
399
+
400
+ export interface JsSubscribeUpdatePong {
401
+ id: number
402
+ }
403
+
404
+ export interface JsSubscribeUpdateSlot {
405
+ slot: string
406
+ parent?: string
407
+ status: number
408
+ deadError?: string
409
+ }
410
+
411
+ export interface JsSubscribeUpdateTransaction {
412
+ transaction?: JsSubscribeUpdateTransactionInfo
413
+ slot: string
414
+ }
415
+
416
+ export interface JsSubscribeUpdateTransactionInfo {
417
+ signature: Buffer
418
+ isVote: boolean
419
+ transaction?: JsTransaction
420
+ meta?: JsTransactionStatusMeta
421
+ index: string
422
+ }
423
+
424
+ export interface JsSubscribeUpdateTransactionStatus {
425
+ slot: string
426
+ signature: Buffer
427
+ isVote: boolean
428
+ index: string
429
+ err?: JsTransactionError
430
+ }
431
+
432
+ export interface JsSubscribeUpdateUpdateOneof {
433
+ account?: JsSubscribeUpdateAccount
434
+ slot?: JsSubscribeUpdateSlot
435
+ transaction?: JsSubscribeUpdateTransaction
436
+ transactionStatus?: JsSubscribeUpdateTransactionStatus
437
+ block?: JsSubscribeUpdateBlock
438
+ ping?: JsSubscribeUpdatePing
439
+ pong?: JsSubscribeUpdatePong
440
+ blockMeta?: JsSubscribeUpdateBlockMeta
441
+ entry?: JsSubscribeUpdateEntry
442
+ }
443
+
444
+ export interface JsTokenBalance {
445
+ accountIndex: number
446
+ mint: string
447
+ uiTokenAmount?: JsUiTokenAmount
448
+ owner: string
449
+ programId: string
450
+ }
451
+
452
+ export interface JsTransaction {
453
+ signatures: Array<Buffer>
454
+ message?: JsMessage
455
+ }
456
+
457
+ export interface JsTransactionError {
458
+ err: Buffer
459
+ }
460
+
461
+ export interface JsTransactionStatusMeta {
462
+ err?: JsTransactionError
463
+ fee: string
464
+ preBalances: Array<string>
465
+ postBalances: Array<string>
466
+ innerInstructions: Array<JsInnerInstructions>
467
+ innerInstructionsNone: boolean
468
+ logMessages: Array<string>
469
+ logMessagesNone: boolean
470
+ preTokenBalances: Array<JsTokenBalance>
471
+ postTokenBalances: Array<JsTokenBalance>
472
+ rewards: Array<JsReward>
473
+ loadedWritableAddresses: Array<Buffer>
474
+ loadedReadonlyAddresses: Array<Buffer>
475
+ returnData?: JsReturnData
476
+ returnDataNone: boolean
477
+ computeUnitsConsumed?: string
478
+ costUnits?: string
479
+ }
480
+
481
+ export interface JsUiTokenAmount {
482
+ uiAmount: number
483
+ decimals: number
484
+ amount: string
485
+ uiAmountString: string
486
+ }
487
+
488
+ export interface JsUnixTimestamp {
489
+ timestamp: string
490
+ }
491
+
154
492
  export declare const enum WasmUiTransactionEncoding {
155
493
  Binary = 0,
156
494
  Base64 = 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triton-one/yellowstone-grpc",
3
- "version": "5.0.2",
3
+ "version": "5.0.4",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Triton One",
6
6
  "description": "Yellowstone gRPC Geyser Node.js Client",
@@ -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.6",
43
- "@triton-one/yellowstone-grpc-napi-linux-x64-musl": "0.0.6",
44
- "@triton-one/yellowstone-grpc-napi-darwin-arm64": "0.0.6",
45
- "@triton-one/yellowstone-grpc-napi-darwin-x64": "0.0.6"
42
+ "@triton-one/yellowstone-grpc-napi-linux-x64-gnu": "0.0.8",
43
+ "@triton-one/yellowstone-grpc-napi-linux-x64-musl": "0.0.8",
44
+ "@triton-one/yellowstone-grpc-napi-darwin-arm64": "0.0.8",
45
+ "@triton-one/yellowstone-grpc-napi-darwin-x64": "0.0.8"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@babel/core": "^7.28.5",