@apibara/protocol 0.1.2 → 0.2.0

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/dist/buffer.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * Converts the hex-encoded bytes to a `Buffer`.
4
4
  * @param hex The hex string
5
- * @param size The buffer size, in bits
5
+ * @param size The buffer size, in bytes
6
6
  */
7
7
  export declare function hexToBuffer(hex: string, size: number): Buffer;
8
8
  /**
package/dist/buffer.js CHANGED
@@ -4,7 +4,7 @@ exports.bufferToHex = exports.hexToBuffer = void 0;
4
4
  /**
5
5
  * Converts the hex-encoded bytes to a `Buffer`.
6
6
  * @param hex The hex string
7
- * @param size The buffer size, in bits
7
+ * @param size The buffer size, in bytes
8
8
  */
9
9
  function hexToBuffer(hex, size) {
10
10
  const padSize = size * 2;
@@ -1,7 +1,9 @@
1
1
  import type { Long } from '@grpc/proto-loader';
2
2
  export interface StreamMessagesRequest {
3
3
  'startingSequence'?: (number | string | Long);
4
+ 'pendingBlockIntervalSeconds'?: (number);
4
5
  }
5
6
  export interface StreamMessagesRequest__Output {
6
7
  'startingSequence': (string);
8
+ 'pendingBlockIntervalSeconds': (number);
7
9
  }
@@ -5,11 +5,13 @@ export interface StreamMessagesResponse {
5
5
  'invalidate'?: (_apibara_node_v1alpha1_Invalidate | null);
6
6
  'data'?: (_apibara_node_v1alpha1_Data | null);
7
7
  'heartbeat'?: (_apibara_node_v1alpha1_Heartbeat | null);
8
- 'message'?: "invalidate" | "data" | "heartbeat";
8
+ 'pending'?: (_apibara_node_v1alpha1_Data | null);
9
+ 'message'?: "invalidate" | "data" | "heartbeat" | "pending";
9
10
  }
10
11
  export interface StreamMessagesResponse__Output {
11
12
  'invalidate'?: (_apibara_node_v1alpha1_Invalidate__Output | null);
12
13
  'data'?: (_apibara_node_v1alpha1_Data__Output | null);
13
14
  'heartbeat'?: (_apibara_node_v1alpha1_Heartbeat__Output | null);
14
- 'message': "invalidate" | "data" | "heartbeat";
15
+ 'pending'?: (_apibara_node_v1alpha1_Data__Output | null);
16
+ 'message': "invalidate" | "data" | "heartbeat" | "pending";
15
17
  }
@@ -70,6 +70,8 @@ message ConnectResponse {
70
70
  message StreamMessagesRequest {
71
71
  // Start streaming from the provided sequence number.
72
72
  uint64 starting_sequence = 1;
73
+ // If greater than 0, send pending blocks at the specified interval.
74
+ uint32 pending_block_interval_seconds = 2;
73
75
  }
74
76
 
75
77
  // Message sent from the node to the client.
@@ -78,6 +80,7 @@ message StreamMessagesResponse {
78
80
  Invalidate invalidate = 1;
79
81
  Data data = 2;
80
82
  Heartbeat heartbeat = 3;
83
+ Data pending = 4;
81
84
  }
82
85
  }
83
86
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apibara/protocol",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "source": "src/index.ts",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/buffer.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Converts the hex-encoded bytes to a `Buffer`.
3
3
  * @param hex The hex string
4
- * @param size The buffer size, in bits
4
+ * @param size The buffer size, in bytes
5
5
  */
6
6
  export function hexToBuffer(hex: string, size: number): Buffer {
7
7
  const padSize = size * 2
@@ -4,8 +4,10 @@ import type { Long } from '@grpc/proto-loader';
4
4
 
5
5
  export interface StreamMessagesRequest {
6
6
  'startingSequence'?: (number | string | Long);
7
+ 'pendingBlockIntervalSeconds'?: (number);
7
8
  }
8
9
 
9
10
  export interface StreamMessagesRequest__Output {
10
11
  'startingSequence': (string);
12
+ 'pendingBlockIntervalSeconds': (number);
11
13
  }
@@ -8,12 +8,14 @@ export interface StreamMessagesResponse {
8
8
  'invalidate'?: (_apibara_node_v1alpha1_Invalidate | null);
9
9
  'data'?: (_apibara_node_v1alpha1_Data | null);
10
10
  'heartbeat'?: (_apibara_node_v1alpha1_Heartbeat | null);
11
- 'message'?: "invalidate"|"data"|"heartbeat";
11
+ 'pending'?: (_apibara_node_v1alpha1_Data | null);
12
+ 'message'?: "invalidate"|"data"|"heartbeat"|"pending";
12
13
  }
13
14
 
14
15
  export interface StreamMessagesResponse__Output {
15
16
  'invalidate'?: (_apibara_node_v1alpha1_Invalidate__Output | null);
16
17
  'data'?: (_apibara_node_v1alpha1_Data__Output | null);
17
18
  'heartbeat'?: (_apibara_node_v1alpha1_Heartbeat__Output | null);
18
- 'message': "invalidate"|"data"|"heartbeat";
19
+ 'pending'?: (_apibara_node_v1alpha1_Data__Output | null);
20
+ 'message': "invalidate"|"data"|"heartbeat"|"pending";
19
21
  }
@@ -70,6 +70,8 @@ message ConnectResponse {
70
70
  message StreamMessagesRequest {
71
71
  // Start streaming from the provided sequence number.
72
72
  uint64 starting_sequence = 1;
73
+ // If greater than 0, send pending blocks at the specified interval.
74
+ uint32 pending_block_interval_seconds = 2;
73
75
  }
74
76
 
75
77
  // Message sent from the node to the client.
@@ -78,6 +80,7 @@ message StreamMessagesResponse {
78
80
  Invalidate invalidate = 1;
79
81
  Data data = 2;
80
82
  Heartbeat heartbeat = 3;
83
+ Data pending = 4;
81
84
  }
82
85
  }
83
86