@mysten/sui 2.22.0 → 2.23.1

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 (147) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist/bcs/bcs.d.mts +6 -6
  3. package/dist/bcs/bcs.d.mts.map +1 -1
  4. package/dist/bcs/bcs.mjs +1 -19
  5. package/dist/bcs/bcs.mjs.map +1 -1
  6. package/dist/bcs/index.d.mts +4225 -1319
  7. package/dist/bcs/index.d.mts.map +1 -1
  8. package/dist/bcs/index.mjs +2 -1
  9. package/dist/bcs/index.mjs.map +1 -1
  10. package/dist/bcs/transactions.mjs +147 -0
  11. package/dist/bcs/transactions.mjs.map +1 -0
  12. package/dist/client/address-balance-transaction-expiration.mjs +22 -0
  13. package/dist/client/address-balance-transaction-expiration.mjs.map +1 -0
  14. package/dist/client/core-resolver.mjs +2 -1
  15. package/dist/client/core-resolver.mjs.map +1 -1
  16. package/dist/client/core.d.mts +2 -0
  17. package/dist/client/core.d.mts.map +1 -1
  18. package/dist/client/core.mjs.map +1 -1
  19. package/dist/client/query-filters.mjs +119 -0
  20. package/dist/client/query-filters.mjs.map +1 -0
  21. package/dist/client/types.d.mts +166 -1
  22. package/dist/client/types.d.mts.map +1 -1
  23. package/dist/client/utils.d.mts.map +1 -1
  24. package/dist/client/utils.mjs +13 -1
  25. package/dist/client/utils.mjs.map +1 -1
  26. package/dist/cryptography/signature.d.mts +6 -6
  27. package/dist/graphql/client.d.mts +15 -2
  28. package/dist/graphql/client.d.mts.map +1 -1
  29. package/dist/graphql/client.mjs +6 -0
  30. package/dist/graphql/client.mjs.map +1 -1
  31. package/dist/graphql/core.d.mts +5 -1
  32. package/dist/graphql/core.d.mts.map +1 -1
  33. package/dist/graphql/core.mjs +96 -4
  34. package/dist/graphql/core.mjs.map +1 -1
  35. package/dist/graphql/generated/queries.d.mts.map +1 -1
  36. package/dist/graphql/generated/queries.mjs +140 -1
  37. package/dist/graphql/generated/queries.mjs.map +1 -1
  38. package/dist/graphql/generated/tada-env.d.mts +108 -0
  39. package/dist/graphql/index.d.mts +2 -2
  40. package/dist/grpc/client.d.mts +11 -0
  41. package/dist/grpc/client.d.mts.map +1 -1
  42. package/dist/grpc/client.mjs +6 -0
  43. package/dist/grpc/client.mjs.map +1 -1
  44. package/dist/grpc/core.d.mts +5 -1
  45. package/dist/grpc/core.d.mts.map +1 -1
  46. package/dist/grpc/core.mjs +113 -4
  47. package/dist/grpc/core.mjs.map +1 -1
  48. package/dist/grpc/filters.mjs +45 -0
  49. package/dist/grpc/filters.mjs.map +1 -0
  50. package/dist/grpc/proto/sui/forking/v1alpha/forking_service.client.d.mts +4 -4
  51. package/dist/grpc/proto/sui/rpc/v2/event.d.mts +31 -0
  52. package/dist/grpc/proto/sui/rpc/v2/event.d.mts.map +1 -1
  53. package/dist/grpc/proto/sui/rpc/v2/event.mjs +30 -0
  54. package/dist/grpc/proto/sui/rpc/v2/event.mjs.map +1 -1
  55. package/dist/grpc/proto/sui/rpc/v2/executed_transaction.d.mts +7 -0
  56. package/dist/grpc/proto/sui/rpc/v2/executed_transaction.d.mts.map +1 -1
  57. package/dist/grpc/proto/sui/rpc/v2/executed_transaction.mjs +8 -0
  58. package/dist/grpc/proto/sui/rpc/v2/executed_transaction.mjs.map +1 -1
  59. package/dist/grpc/proto/sui/rpc/v2/filter.d.mts +423 -0
  60. package/dist/grpc/proto/sui/rpc/v2/filter.d.mts.map +1 -0
  61. package/dist/grpc/proto/sui/rpc/v2/filter.mjs +297 -0
  62. package/dist/grpc/proto/sui/rpc/v2/filter.mjs.map +1 -0
  63. package/dist/grpc/proto/sui/rpc/v2/ledger_service.client.d.mts +62 -6
  64. package/dist/grpc/proto/sui/rpc/v2/ledger_service.client.d.mts.map +1 -1
  65. package/dist/grpc/proto/sui/rpc/v2/ledger_service.client.mjs +37 -0
  66. package/dist/grpc/proto/sui/rpc/v2/ledger_service.client.mjs.map +1 -1
  67. package/dist/grpc/proto/sui/rpc/v2/ledger_service.d.mts +293 -1
  68. package/dist/grpc/proto/sui/rpc/v2/ledger_service.d.mts.map +1 -1
  69. package/dist/grpc/proto/sui/rpc/v2/ledger_service.mjs +241 -1
  70. package/dist/grpc/proto/sui/rpc/v2/ledger_service.mjs.map +1 -1
  71. package/dist/grpc/proto/sui/rpc/v2/move_package_service.client.d.mts +4 -4
  72. package/dist/grpc/proto/sui/rpc/v2/name_service.client.d.mts +4 -4
  73. package/dist/grpc/proto/sui/rpc/v2/protocol_config.d.mts +15 -2
  74. package/dist/grpc/proto/sui/rpc/v2/protocol_config.d.mts.map +1 -1
  75. package/dist/grpc/proto/sui/rpc/v2/protocol_config.mjs +11 -0
  76. package/dist/grpc/proto/sui/rpc/v2/protocol_config.mjs.map +1 -1
  77. package/dist/grpc/proto/sui/rpc/v2/query_options.d.mts +211 -0
  78. package/dist/grpc/proto/sui/rpc/v2/query_options.d.mts.map +1 -0
  79. package/dist/grpc/proto/sui/rpc/v2/query_options.mjs +163 -0
  80. package/dist/grpc/proto/sui/rpc/v2/query_options.mjs.map +1 -0
  81. package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.mts +4 -4
  82. package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.d.mts +105 -23
  83. package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.d.mts.map +1 -1
  84. package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.mjs +56 -9
  85. package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.mjs.map +1 -1
  86. package/dist/grpc/proto/sui/rpc/v2/subscription_service.d.mts +148 -8
  87. package/dist/grpc/proto/sui/rpc/v2/subscription_service.d.mts.map +1 -1
  88. package/dist/grpc/proto/sui/rpc/v2/subscription_service.mjs +109 -8
  89. package/dist/grpc/proto/sui/rpc/v2/subscription_service.mjs.map +1 -1
  90. package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.mts +4 -4
  91. package/dist/grpc/proto/types.d.mts +5 -3
  92. package/dist/grpc/proto/types.mjs +33 -2
  93. package/dist/grpc/proto/types.mjs.map +1 -1
  94. package/dist/jsonRpc/core.d.mts +10 -0
  95. package/dist/jsonRpc/core.d.mts.map +1 -1
  96. package/dist/jsonRpc/core.mjs +85 -2
  97. package/dist/jsonRpc/core.mjs.map +1 -1
  98. package/dist/transactions/Transaction.d.mts +6 -6
  99. package/dist/transactions/Transaction.d.mts.map +1 -1
  100. package/dist/transactions/intents/CoinWithBalance.mjs +14 -18
  101. package/dist/transactions/intents/CoinWithBalance.mjs.map +1 -1
  102. package/dist/version.mjs +1 -1
  103. package/dist/version.mjs.map +1 -1
  104. package/dist/zklogin/address.mjs +2 -2
  105. package/dist/zklogin/address.mjs.map +1 -1
  106. package/dist/zklogin/bcs.d.mts +14 -14
  107. package/dist/zklogin/poseidon.mjs +5 -2
  108. package/dist/zklogin/poseidon.mjs.map +1 -1
  109. package/docs/clients/core.md +115 -1
  110. package/docs/clients/grpc.md +68 -0
  111. package/docs/migrations/sui-2.0/json-rpc-migration.md +104 -101
  112. package/package.json +2 -2
  113. package/src/bcs/bcs.ts +0 -27
  114. package/src/bcs/index.ts +7 -5
  115. package/src/bcs/transactions.ts +226 -0
  116. package/src/client/address-balance-transaction-expiration.ts +53 -0
  117. package/src/client/core-resolver.ts +5 -1
  118. package/src/client/core.ts +8 -0
  119. package/src/client/query-filters.ts +195 -0
  120. package/src/client/types.ts +186 -1
  121. package/src/client/utils.ts +13 -0
  122. package/src/graphql/client.ts +25 -1
  123. package/src/graphql/core.ts +156 -6
  124. package/src/graphql/generated/queries.ts +230 -1
  125. package/src/graphql/generated/schema.graphql +75 -0
  126. package/src/graphql/generated/tada-env.ts +133 -0
  127. package/src/graphql/index.ts +1 -0
  128. package/src/graphql/queries/listEvents.graphql +40 -0
  129. package/src/graphql/queries/transactions.graphql +29 -0
  130. package/src/grpc/client.ts +19 -0
  131. package/src/grpc/core.ts +201 -6
  132. package/src/grpc/filters.ts +68 -0
  133. package/src/grpc/proto/sui/rpc/v2/event.ts +49 -0
  134. package/src/grpc/proto/sui/rpc/v2/executed_transaction.ts +15 -0
  135. package/src/grpc/proto/sui/rpc/v2/filter.ts +589 -0
  136. package/src/grpc/proto/sui/rpc/v2/ledger_service.client.ts +111 -0
  137. package/src/grpc/proto/sui/rpc/v2/ledger_service.ts +406 -0
  138. package/src/grpc/proto/sui/rpc/v2/protocol_config.ts +22 -2
  139. package/src/grpc/proto/sui/rpc/v2/query_options.ts +255 -0
  140. package/src/grpc/proto/sui/rpc/v2/subscription_service.client.ts +136 -18
  141. package/src/grpc/proto/sui/rpc/v2/subscription_service.ts +187 -7
  142. package/src/grpc/proto/types.ts +2 -0
  143. package/src/jsonRpc/core.ts +136 -2
  144. package/src/transactions/intents/CoinWithBalance.ts +41 -41
  145. package/src/version.ts +1 -1
  146. package/src/zklogin/address.ts +2 -2
  147. package/src/zklogin/poseidon.ts +6 -4
@@ -0,0 +1,255 @@
1
+ // Copyright (c) Mysten Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ // @generated by protobuf-ts 2.9.6 with parameter force_server_none,optimize_code_size,ts_nocheck
5
+ // @generated from protobuf file "sui/rpc/v2/query_options.proto" (package "sui.rpc.v2", syntax proto3)
6
+ // tslint:disable
7
+ // @ts-nocheck
8
+ //
9
+ // Copyright (c) Mysten Labs, Inc.
10
+ // SPDX-License-Identifier: Apache-2.0
11
+ //
12
+ import { MessageType } from '@protobuf-ts/runtime';
13
+ /**
14
+ * Cursor-bounded query options.
15
+ *
16
+ * `after` and `before` are canonical ledger-position bounds, not
17
+ * ordering-relative cursors. `after` always excludes items at or below that
18
+ * cursor, and `before` always excludes items at or above that cursor. Ordering
19
+ * only controls the order of returned items within the resulting open interval.
20
+ *
21
+ * When a request also specifies a checkpoint range, cursor bounds and
22
+ * checkpoint bounds compose by intersection: results come only from ledger
23
+ * positions inside both. Checkpoint bounds are likewise canonical and
24
+ * ordering-independent.
25
+ *
26
+ * For example, with `after = A`, `before = B`, `ordering = DESCENDING`, and
27
+ * `limit = N`, the response contains up to N matching items in descending
28
+ * order from the interval `(A, B)`. If the response ends with
29
+ * `QUERY_END_REASON_ITEM_LIMIT`, resume by keeping `after = A` and setting
30
+ * `before` to the last `Watermark.cursor` received. That cursor is the
31
+ * lowest position reached in ledger order, so it becomes the next exclusive
32
+ * upper bound.
33
+ *
34
+ * @generated from protobuf message sui.rpc.v2.QueryOptions
35
+ */
36
+ export interface QueryOptions {
37
+ /**
38
+ * The maximum number of items to return. Each method applies its own default
39
+ * and maximum. QueryEnd does not count against this limit.
40
+ *
41
+ * @generated from protobuf field: optional uint32 limit = 1;
42
+ */
43
+ limit?: number;
44
+ /**
45
+ * Opaque exclusive lower bound. Results must be strictly after this cursor in
46
+ * canonical ledger order.
47
+ *
48
+ * @generated from protobuf field: optional bytes after = 2;
49
+ */
50
+ after?: Uint8Array;
51
+ /**
52
+ * Opaque exclusive upper bound. Results must be strictly before this cursor
53
+ * in canonical ledger order.
54
+ *
55
+ * @generated from protobuf field: optional bytes before = 3;
56
+ */
57
+ before?: Uint8Array;
58
+ /**
59
+ * Ordering for returned results. Defaults to ASCENDING.
60
+ *
61
+ * Ordering only controls the order of results within the bounded interval;
62
+ * cursor bounds keep the same meaning for ascending and descending reads.
63
+ *
64
+ * @generated from protobuf field: optional sui.rpc.v2.Ordering ordering = 4;
65
+ */
66
+ ordering?: Ordering;
67
+ }
68
+ /**
69
+ * Progress marker for a query scan. Carried on every response frame, whether or
70
+ * not the frame delivers a matching item. Watermarks never regress in the
71
+ * requested ordering, but consecutive frames may carry the same watermark when
72
+ * additional work does not advance the safe resume frontier.
73
+ *
74
+ * @generated from protobuf message sui.rpc.v2.Watermark
75
+ */
76
+ export interface Watermark {
77
+ /**
78
+ * Opaque cursor at this scan position. Set on every watermark. Use as
79
+ * `options.after` (ascending) or `options.before` (descending) on the next
80
+ * request to resume from here. The most recently received cursor is always
81
+ * the safe resume point.
82
+ *
83
+ * @generated from protobuf field: optional bytes cursor = 1;
84
+ */
85
+ cursor?: Uint8Array;
86
+ /**
87
+ * The inclusive boundary checkpoint that the scan has fully covered within
88
+ * the request's effective interval, in the request's ordering direction: an
89
+ * ascending scan has emitted every matching item in the interval at
90
+ * checkpoints `<= checkpoint` (strictly greater ones may still hold
91
+ * matches); a descending scan has emitted every matching item in the
92
+ * interval at checkpoints `>= checkpoint`. This boundary never regresses in
93
+ * the scan direction, but it may repeat while the cursor advances.
94
+ *
95
+ * Unset until the scan's first checkpoint is fully covered. For example, a
96
+ * scan resumed from a cursor that lands mid-checkpoint leaves this unset
97
+ * until the next checkpoint boundary in the scan direction is fully covered.
98
+ * A watermark still has a valid resume cursor while this field is unset.
99
+ *
100
+ * @generated from protobuf field: optional uint64 checkpoint = 2;
101
+ */
102
+ checkpoint?: bigint;
103
+ }
104
+ /**
105
+ * Marker for the final frame of a successful query stream. Every successful
106
+ * stream sets `QueryEnd` on exactly one frame, after which no further frames
107
+ * are sent. That frame always carries the final watermark. For `ItemLimit`, it
108
+ * also carries the final matching item; for every other reason it carries no
109
+ * item. A ScanLimit terminal watermark may repeat the previous frame's cursor
110
+ * when its authoritative scan frontier was already emitted; this does not
111
+ * repeat an item.
112
+ *
113
+ * A stream that fails or is cancelled terminates with a gRPC status and does
114
+ * not send `QueryEnd`.
115
+ *
116
+ * @generated from protobuf message sui.rpc.v2.QueryEnd
117
+ */
118
+ export interface QueryEnd {
119
+ /**
120
+ * Reason this response stopped.
121
+ *
122
+ * @generated from protobuf field: optional sui.rpc.v2.QueryEndReason reason = 1;
123
+ */
124
+ reason?: QueryEndReason;
125
+ }
126
+ /**
127
+ * Ordering for the returned result set.
128
+ *
129
+ * @generated from protobuf enum sui.rpc.v2.Ordering
130
+ */
131
+ export enum Ordering {
132
+ /**
133
+ * Return results in increasing cursor order.
134
+ *
135
+ * @generated from protobuf enum value: ORDERING_ASCENDING = 0;
136
+ */
137
+ ASCENDING = 0,
138
+ /**
139
+ * Return results in decreasing cursor order.
140
+ *
141
+ * @generated from protobuf enum value: ORDERING_DESCENDING = 1;
142
+ */
143
+ DESCENDING = 1,
144
+ }
145
+ /**
146
+ * Reason the server stopped this query response.
147
+ *
148
+ * @generated from protobuf enum sui.rpc.v2.QueryEndReason
149
+ */
150
+ export enum QueryEndReason {
151
+ /**
152
+ * The stop reason was not specified.
153
+ *
154
+ * @generated from protobuf enum value: QUERY_END_REASON_UNKNOWN = 0;
155
+ */
156
+ UNKNOWN = 0,
157
+ /**
158
+ * The response reached the requested item limit. The final matching item's
159
+ * frame carries `QueryEnd` and the final watermark. Resume from that frame's
160
+ * `Watermark.cursor` to continue reading the same effective interval.
161
+ *
162
+ * @generated from protobuf enum value: QUERY_END_REASON_ITEM_LIMIT = 1;
163
+ */
164
+ ITEM_LIMIT = 1,
165
+ /**
166
+ * The response reached the server's per-request bucket-fetch budget for
167
+ * filtered scans before reaching the effective interval bound. The terminal
168
+ * frame carries no item. Its watermark cursor is the authoritative scan
169
+ * frontier from which to resume.
170
+ *
171
+ * @generated from protobuf enum value: QUERY_END_REASON_SCAN_LIMIT = 2;
172
+ */
173
+ SCAN_LIMIT = 2,
174
+ /**
175
+ * The scan reached a requested checkpoint range bound. The terminal frame
176
+ * carries no item.
177
+ *
178
+ * @generated from protobuf enum value: QUERY_END_REASON_CHECKPOINT_BOUND = 3;
179
+ */
180
+ CHECKPOINT_BOUND = 3,
181
+ /**
182
+ * The scan reached an exclusive cursor bound. The terminal frame carries no
183
+ * item. Its watermark cursor represents that resolved bound without claiming
184
+ * that its containing checkpoint was fully covered.
185
+ *
186
+ * @generated from protobuf enum value: QUERY_END_REASON_CURSOR_BOUND = 4;
187
+ */
188
+ CURSOR_BOUND = 4,
189
+ /**
190
+ * The scan reached the currently indexed ledger tip. The terminal frame
191
+ * carries no item.
192
+ *
193
+ * @generated from protobuf enum value: QUERY_END_REASON_LEDGER_TIP = 5;
194
+ */
195
+ LEDGER_TIP = 5,
196
+ }
197
+ // @generated message type with reflection information, may provide speed optimized methods
198
+ class QueryOptions$Type extends MessageType<QueryOptions> {
199
+ constructor() {
200
+ super('sui.rpc.v2.QueryOptions', [
201
+ { no: 1, name: 'limit', kind: 'scalar', opt: true, T: 13 /*ScalarType.UINT32*/ },
202
+ { no: 2, name: 'after', kind: 'scalar', opt: true, T: 12 /*ScalarType.BYTES*/ },
203
+ { no: 3, name: 'before', kind: 'scalar', opt: true, T: 12 /*ScalarType.BYTES*/ },
204
+ {
205
+ no: 4,
206
+ name: 'ordering',
207
+ kind: 'enum',
208
+ opt: true,
209
+ T: () => ['sui.rpc.v2.Ordering', Ordering, 'ORDERING_'],
210
+ },
211
+ ]);
212
+ }
213
+ }
214
+ /**
215
+ * @generated MessageType for protobuf message sui.rpc.v2.QueryOptions
216
+ */
217
+ export const QueryOptions = new QueryOptions$Type();
218
+ // @generated message type with reflection information, may provide speed optimized methods
219
+ class Watermark$Type extends MessageType<Watermark> {
220
+ constructor() {
221
+ super('sui.rpc.v2.Watermark', [
222
+ { no: 1, name: 'cursor', kind: 'scalar', opt: true, T: 12 /*ScalarType.BYTES*/ },
223
+ {
224
+ no: 2,
225
+ name: 'checkpoint',
226
+ kind: 'scalar',
227
+ opt: true,
228
+ T: 4 /*ScalarType.UINT64*/,
229
+ L: 0 /*LongType.BIGINT*/,
230
+ },
231
+ ]);
232
+ }
233
+ }
234
+ /**
235
+ * @generated MessageType for protobuf message sui.rpc.v2.Watermark
236
+ */
237
+ export const Watermark = new Watermark$Type();
238
+ // @generated message type with reflection information, may provide speed optimized methods
239
+ class QueryEnd$Type extends MessageType<QueryEnd> {
240
+ constructor() {
241
+ super('sui.rpc.v2.QueryEnd', [
242
+ {
243
+ no: 1,
244
+ name: 'reason',
245
+ kind: 'enum',
246
+ opt: true,
247
+ T: () => ['sui.rpc.v2.QueryEndReason', QueryEndReason, 'QUERY_END_REASON_'],
248
+ },
249
+ ]);
250
+ }
251
+ }
252
+ /**
253
+ * @generated MessageType for protobuf message sui.rpc.v2.QueryEnd
254
+ */
255
+ export const QueryEnd = new QueryEnd$Type();
@@ -12,27 +12,54 @@
12
12
  import type { RpcTransport } from '@protobuf-ts/runtime-rpc';
13
13
  import type { ServiceInfo } from '@protobuf-ts/runtime-rpc';
14
14
  import { SubscriptionService } from './subscription_service.js';
15
+ import type { SubscribeEventsResponse } from './subscription_service.js';
16
+ import type { SubscribeEventsRequest } from './subscription_service.js';
17
+ import type { SubscribeTransactionsResponse } from './subscription_service.js';
18
+ import type { SubscribeTransactionsRequest } from './subscription_service.js';
15
19
  import { stackIntercept } from '@protobuf-ts/runtime-rpc';
16
20
  import type { SubscribeCheckpointsResponse } from './subscription_service.js';
17
21
  import type { SubscribeCheckpointsRequest } from './subscription_service.js';
18
22
  import type { ServerStreamingCall } from '@protobuf-ts/runtime-rpc';
19
23
  import type { RpcOptions } from '@protobuf-ts/runtime-rpc';
20
24
  /**
25
+ * SubscriptionService provides filtered, real-time streams of checkpoints,
26
+ * transactions, and events.
27
+ *
28
+ * Each Subscribe API pairs with the LedgerService List API of the same name:
29
+ * requests take the same filter message, and responses carry the same item
30
+ * and watermark shapes with identical cursor semantics.
31
+ *
32
+ * Subscriptions do not support resumption. A new subscription always begins
33
+ * at the current tip of the chain as seen by the server (the latest executed
34
+ * checkpoint). To recover data missed between subscriptions, replay the gap
35
+ * with the paired List API: pass the last received `Watermark.cursor` as
36
+ * `options.after` on the List request (for checkpoints, pass the last
37
+ * received `cursor + 1` as `start_checkpoint`). The List scan reads from the
38
+ * indexed tip, which may trail the subscription's start position; repeat the
39
+ * List call as the index advances until the replay reaches the position
40
+ * established by the subscription's first frame.
41
+ *
42
+ * A subscription behaves like an unbounded ascending scan: every frame
43
+ * carries the subscriber's resume point, and progress advances as
44
+ * checkpoints are fully covered. Two delivery guarantees keep sparse
45
+ * filters live: the first frame on a filtered subscription is a
46
+ * progress-only frame establishing the stream's start position, and
47
+ * progress continues to advance with bounded staleness even when no item
48
+ * matches.
49
+ *
50
+ * Subscription streams have no successful end: they run until cancelled by
51
+ * the client or terminated by the server with a gRPC status.
52
+ *
21
53
  * @generated from protobuf service sui.rpc.v2.SubscriptionService
22
54
  */
23
55
  export interface ISubscriptionServiceClient {
24
56
  /**
25
57
  * Subscribe to the stream of checkpoints.
26
58
  *
27
- * This API provides a subscription to the checkpoint stream for the Sui
28
- * blockchain. When a subscription is initialized the stream will begin with
29
- * the latest executed checkpoint as seen by the server. Responses are
30
- * guaranteed to return checkpoints in-order and without gaps. This enables
31
- * clients to know exactly the last checkpoint they have processed and in the
32
- * event the subscription terminates (either by the client/server or by the
33
- * connection breaking), clients will be able to reinitialize a subscription
34
- * and then leverage other APIs in order to request data for the checkpoints
35
- * they missed.
59
+ * The stream begins at the latest executed checkpoint as seen by the
60
+ * server and yields checkpoints matching the filter as they are executed.
61
+ * A checkpoint matches if any transaction it contains satisfies the
62
+ * filter.
36
63
  *
37
64
  * @generated from protobuf rpc: SubscribeCheckpoints(sui.rpc.v2.SubscribeCheckpointsRequest) returns (stream sui.rpc.v2.SubscribeCheckpointsResponse);
38
65
  */
@@ -40,8 +67,60 @@ export interface ISubscriptionServiceClient {
40
67
  input: SubscribeCheckpointsRequest,
41
68
  options?: RpcOptions,
42
69
  ): ServerStreamingCall<SubscribeCheckpointsRequest, SubscribeCheckpointsResponse>;
70
+ /**
71
+ * Subscribe to the stream of transactions.
72
+ *
73
+ * The stream begins at the latest executed checkpoint as seen by the
74
+ * server and yields transactions matching the filter as they are executed.
75
+ *
76
+ * @generated from protobuf rpc: SubscribeTransactions(sui.rpc.v2.SubscribeTransactionsRequest) returns (stream sui.rpc.v2.SubscribeTransactionsResponse);
77
+ */
78
+ subscribeTransactions(
79
+ input: SubscribeTransactionsRequest,
80
+ options?: RpcOptions,
81
+ ): ServerStreamingCall<SubscribeTransactionsRequest, SubscribeTransactionsResponse>;
82
+ /**
83
+ * Subscribe to the stream of events.
84
+ *
85
+ * The stream begins at the latest executed checkpoint as seen by the
86
+ * server and yields events matching the filter as they are emitted.
87
+ *
88
+ * @generated from protobuf rpc: SubscribeEvents(sui.rpc.v2.SubscribeEventsRequest) returns (stream sui.rpc.v2.SubscribeEventsResponse);
89
+ */
90
+ subscribeEvents(
91
+ input: SubscribeEventsRequest,
92
+ options?: RpcOptions,
93
+ ): ServerStreamingCall<SubscribeEventsRequest, SubscribeEventsResponse>;
43
94
  }
44
95
  /**
96
+ * SubscriptionService provides filtered, real-time streams of checkpoints,
97
+ * transactions, and events.
98
+ *
99
+ * Each Subscribe API pairs with the LedgerService List API of the same name:
100
+ * requests take the same filter message, and responses carry the same item
101
+ * and watermark shapes with identical cursor semantics.
102
+ *
103
+ * Subscriptions do not support resumption. A new subscription always begins
104
+ * at the current tip of the chain as seen by the server (the latest executed
105
+ * checkpoint). To recover data missed between subscriptions, replay the gap
106
+ * with the paired List API: pass the last received `Watermark.cursor` as
107
+ * `options.after` on the List request (for checkpoints, pass the last
108
+ * received `cursor + 1` as `start_checkpoint`). The List scan reads from the
109
+ * indexed tip, which may trail the subscription's start position; repeat the
110
+ * List call as the index advances until the replay reaches the position
111
+ * established by the subscription's first frame.
112
+ *
113
+ * A subscription behaves like an unbounded ascending scan: every frame
114
+ * carries the subscriber's resume point, and progress advances as
115
+ * checkpoints are fully covered. Two delivery guarantees keep sparse
116
+ * filters live: the first frame on a filtered subscription is a
117
+ * progress-only frame establishing the stream's start position, and
118
+ * progress continues to advance with bounded staleness even when no item
119
+ * matches.
120
+ *
121
+ * Subscription streams have no successful end: they run until cancelled by
122
+ * the client or terminated by the server with a gRPC status.
123
+ *
45
124
  * @generated from protobuf service sui.rpc.v2.SubscriptionService
46
125
  */
47
126
  export class SubscriptionServiceClient implements ISubscriptionServiceClient, ServiceInfo {
@@ -52,15 +131,10 @@ export class SubscriptionServiceClient implements ISubscriptionServiceClient, Se
52
131
  /**
53
132
  * Subscribe to the stream of checkpoints.
54
133
  *
55
- * This API provides a subscription to the checkpoint stream for the Sui
56
- * blockchain. When a subscription is initialized the stream will begin with
57
- * the latest executed checkpoint as seen by the server. Responses are
58
- * guaranteed to return checkpoints in-order and without gaps. This enables
59
- * clients to know exactly the last checkpoint they have processed and in the
60
- * event the subscription terminates (either by the client/server or by the
61
- * connection breaking), clients will be able to reinitialize a subscription
62
- * and then leverage other APIs in order to request data for the checkpoints
63
- * they missed.
134
+ * The stream begins at the latest executed checkpoint as seen by the
135
+ * server and yields checkpoints matching the filter as they are executed.
136
+ * A checkpoint matches if any transaction it contains satisfies the
137
+ * filter.
64
138
  *
65
139
  * @generated from protobuf rpc: SubscribeCheckpoints(sui.rpc.v2.SubscribeCheckpointsRequest) returns (stream sui.rpc.v2.SubscribeCheckpointsResponse);
66
140
  */
@@ -78,4 +152,48 @@ export class SubscriptionServiceClient implements ISubscriptionServiceClient, Se
78
152
  input,
79
153
  );
80
154
  }
155
+ /**
156
+ * Subscribe to the stream of transactions.
157
+ *
158
+ * The stream begins at the latest executed checkpoint as seen by the
159
+ * server and yields transactions matching the filter as they are executed.
160
+ *
161
+ * @generated from protobuf rpc: SubscribeTransactions(sui.rpc.v2.SubscribeTransactionsRequest) returns (stream sui.rpc.v2.SubscribeTransactionsResponse);
162
+ */
163
+ subscribeTransactions(
164
+ input: SubscribeTransactionsRequest,
165
+ options?: RpcOptions,
166
+ ): ServerStreamingCall<SubscribeTransactionsRequest, SubscribeTransactionsResponse> {
167
+ const method = this.methods[1],
168
+ opt = this._transport.mergeOptions(options);
169
+ return stackIntercept<SubscribeTransactionsRequest, SubscribeTransactionsResponse>(
170
+ 'serverStreaming',
171
+ this._transport,
172
+ method,
173
+ opt,
174
+ input,
175
+ );
176
+ }
177
+ /**
178
+ * Subscribe to the stream of events.
179
+ *
180
+ * The stream begins at the latest executed checkpoint as seen by the
181
+ * server and yields events matching the filter as they are emitted.
182
+ *
183
+ * @generated from protobuf rpc: SubscribeEvents(sui.rpc.v2.SubscribeEventsRequest) returns (stream sui.rpc.v2.SubscribeEventsResponse);
184
+ */
185
+ subscribeEvents(
186
+ input: SubscribeEventsRequest,
187
+ options?: RpcOptions,
188
+ ): ServerStreamingCall<SubscribeEventsRequest, SubscribeEventsResponse> {
189
+ const method = this.methods[2],
190
+ opt = this._transport.mergeOptions(options);
191
+ return stackIntercept<SubscribeEventsRequest, SubscribeEventsResponse>(
192
+ 'serverStreaming',
193
+ this._transport,
194
+ method,
195
+ opt,
196
+ input,
197
+ );
198
+ }
81
199
  }
@@ -11,47 +11,161 @@
11
11
  //
12
12
  import { ServiceType } from '@protobuf-ts/runtime-rpc';
13
13
  import { MessageType } from '@protobuf-ts/runtime';
14
+ import { Event } from './event.js';
15
+ import { EventFilter } from './filter.js';
16
+ import { Watermark } from './query_options.js';
17
+ import { ExecutedTransaction } from './executed_transaction.js';
14
18
  import { Checkpoint } from './checkpoint.js';
19
+ import { TransactionFilter } from './filter.js';
15
20
  import { FieldMask } from '../../../google/protobuf/field_mask.js';
16
21
  /**
17
- * Request message for SubscriptionService.SubscribeCheckpoints
22
+ * Request message for SubscriptionService.SubscribeCheckpoints.
18
23
  *
19
24
  * @generated from protobuf message sui.rpc.v2.SubscribeCheckpointsRequest
20
25
  */
21
26
  export interface SubscribeCheckpointsRequest {
22
27
  /**
23
- * Optional. Mask for specifying which parts of the
24
- * SubscribeCheckpointsResponse should be returned.
28
+ * Optional. Mask for specifying which parts of the Checkpoint should be
29
+ * returned (e.g. summary, contents, signatures). `cursor` is always
30
+ * populated and is not subject to the mask.
25
31
  *
26
32
  * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 1;
27
33
  */
28
34
  readMask?: FieldMask;
35
+ /**
36
+ * Optional. DNF filter over indexed transaction dimensions. A checkpoint
37
+ * matches if any transaction it contains satisfies the filter. If absent,
38
+ * every checkpoint is streamed.
39
+ *
40
+ * @generated from protobuf field: optional sui.rpc.v2.TransactionFilter filter = 2;
41
+ */
42
+ filter?: TransactionFilter;
29
43
  }
30
44
  /**
31
- * Response message for SubscriptionService.SubscribeCheckpoints
45
+ * Response message for SubscriptionService.SubscribeCheckpoints.
46
+ *
47
+ * A checkpoint stream's position is checkpoint-granular, so the `cursor`
48
+ * sequence number stands in for the `Watermark` message the other
49
+ * subscription responses carry. Progress-only frames (with `checkpoint`
50
+ * unset) occur only on filtered streams: on an unfiltered stream every frame
51
+ * carries both fields, in order and without gaps.
32
52
  *
33
53
  * @generated from protobuf message sui.rpc.v2.SubscribeCheckpointsResponse
34
54
  */
35
55
  export interface SubscribeCheckpointsResponse {
36
56
  /**
37
- * Required. The checkpoint sequence number and value of the current cursor
38
- * into the checkpoint stream
57
+ * Required. The checkpoint sequence number the stream has fully covered,
58
+ * inclusive: every matching checkpoint from the stream's start position
59
+ * through `cursor` has been delivered. Present on every frame and
60
+ * advances monotonically.
39
61
  *
40
62
  * @generated from protobuf field: optional uint64 cursor = 1;
41
63
  */
42
64
  cursor?: bigint;
43
65
  /**
44
- * The requested data for this checkpoint
66
+ * The matching checkpoint. Unset when this frame only advances the
67
+ * cursor past non-matching checkpoints.
45
68
  *
46
69
  * @generated from protobuf field: optional sui.rpc.v2.Checkpoint checkpoint = 2;
47
70
  */
48
71
  checkpoint?: Checkpoint;
49
72
  }
73
+ /**
74
+ * Request message for SubscriptionService.SubscribeTransactions.
75
+ *
76
+ * @generated from protobuf message sui.rpc.v2.SubscribeTransactionsRequest
77
+ */
78
+ export interface SubscribeTransactionsRequest {
79
+ /**
80
+ * Optional. Mask for specifying which parts of the ExecutedTransaction
81
+ * should be returned.
82
+ *
83
+ * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 1;
84
+ */
85
+ readMask?: FieldMask;
86
+ /**
87
+ * Optional. DNF filter over indexed dimensions. If absent, every
88
+ * transaction is streamed.
89
+ *
90
+ * @generated from protobuf field: optional sui.rpc.v2.TransactionFilter filter = 2;
91
+ */
92
+ filter?: TransactionFilter;
93
+ }
94
+ /**
95
+ * Response message for SubscriptionService.SubscribeTransactions.
96
+ *
97
+ * Mirrors ListTransactionsResponse, except there is no `end` field: a
98
+ * subscription stream has no successful end.
99
+ *
100
+ * @generated from protobuf message sui.rpc.v2.SubscribeTransactionsResponse
101
+ */
102
+ export interface SubscribeTransactionsResponse {
103
+ /**
104
+ * One matching transaction. Its position within the containing checkpoint
105
+ * is reported by `ExecutedTransaction.transaction_index`.
106
+ *
107
+ * @generated from protobuf field: optional sui.rpc.v2.ExecutedTransaction transaction = 1;
108
+ */
109
+ transaction?: ExecutedTransaction;
110
+ /**
111
+ * Progress watermark as of this frame. Present on every frame.
112
+ *
113
+ * @generated from protobuf field: optional sui.rpc.v2.Watermark watermark = 2;
114
+ */
115
+ watermark?: Watermark;
116
+ }
117
+ /**
118
+ * Request message for SubscriptionService.SubscribeEvents.
119
+ *
120
+ * @generated from protobuf message sui.rpc.v2.SubscribeEventsRequest
121
+ */
122
+ export interface SubscribeEventsRequest {
123
+ /**
124
+ * Optional. Mask for specifying which parts of the Event should be
125
+ * returned.
126
+ *
127
+ * @generated from protobuf field: optional google.protobuf.FieldMask read_mask = 1;
128
+ */
129
+ readMask?: FieldMask;
130
+ /**
131
+ * Optional. DNF filter over indexed dimensions. If absent, every event is
132
+ * streamed.
133
+ *
134
+ * @generated from protobuf field: optional sui.rpc.v2.EventFilter filter = 2;
135
+ */
136
+ filter?: EventFilter;
137
+ }
138
+ /**
139
+ * Response message for SubscriptionService.SubscribeEvents.
140
+ *
141
+ * Mirrors ListEventsResponse, except there is no `end` field: a subscription
142
+ * stream has no successful end.
143
+ *
144
+ * @generated from protobuf message sui.rpc.v2.SubscribeEventsResponse
145
+ */
146
+ export interface SubscribeEventsResponse {
147
+ /**
148
+ * One matching event. Its ledger position -- containing checkpoint,
149
+ * emitting transaction digest and offset, and index within that
150
+ * transaction's event list -- is reported by the corresponding fields on
151
+ * `Event`.
152
+ *
153
+ * @generated from protobuf field: optional sui.rpc.v2.Event event = 1;
154
+ */
155
+ event?: Event;
156
+ /**
157
+ * Progress watermark as of this frame. Present on every frame.
158
+ *
159
+ * @generated from protobuf field: optional sui.rpc.v2.Watermark watermark = 2;
160
+ */
161
+ watermark?: Watermark;
162
+ }
50
163
  // @generated message type with reflection information, may provide speed optimized methods
51
164
  class SubscribeCheckpointsRequest$Type extends MessageType<SubscribeCheckpointsRequest> {
52
165
  constructor() {
53
166
  super('sui.rpc.v2.SubscribeCheckpointsRequest', [
54
167
  { no: 1, name: 'read_mask', kind: 'message', T: () => FieldMask },
168
+ { no: 2, name: 'filter', kind: 'message', T: () => TransactionFilter },
55
169
  ]);
56
170
  }
57
171
  }
@@ -79,6 +193,58 @@ class SubscribeCheckpointsResponse$Type extends MessageType<SubscribeCheckpoints
79
193
  * @generated MessageType for protobuf message sui.rpc.v2.SubscribeCheckpointsResponse
80
194
  */
81
195
  export const SubscribeCheckpointsResponse = new SubscribeCheckpointsResponse$Type();
196
+ // @generated message type with reflection information, may provide speed optimized methods
197
+ class SubscribeTransactionsRequest$Type extends MessageType<SubscribeTransactionsRequest> {
198
+ constructor() {
199
+ super('sui.rpc.v2.SubscribeTransactionsRequest', [
200
+ { no: 1, name: 'read_mask', kind: 'message', T: () => FieldMask },
201
+ { no: 2, name: 'filter', kind: 'message', T: () => TransactionFilter },
202
+ ]);
203
+ }
204
+ }
205
+ /**
206
+ * @generated MessageType for protobuf message sui.rpc.v2.SubscribeTransactionsRequest
207
+ */
208
+ export const SubscribeTransactionsRequest = new SubscribeTransactionsRequest$Type();
209
+ // @generated message type with reflection information, may provide speed optimized methods
210
+ class SubscribeTransactionsResponse$Type extends MessageType<SubscribeTransactionsResponse> {
211
+ constructor() {
212
+ super('sui.rpc.v2.SubscribeTransactionsResponse', [
213
+ { no: 1, name: 'transaction', kind: 'message', T: () => ExecutedTransaction },
214
+ { no: 2, name: 'watermark', kind: 'message', T: () => Watermark },
215
+ ]);
216
+ }
217
+ }
218
+ /**
219
+ * @generated MessageType for protobuf message sui.rpc.v2.SubscribeTransactionsResponse
220
+ */
221
+ export const SubscribeTransactionsResponse = new SubscribeTransactionsResponse$Type();
222
+ // @generated message type with reflection information, may provide speed optimized methods
223
+ class SubscribeEventsRequest$Type extends MessageType<SubscribeEventsRequest> {
224
+ constructor() {
225
+ super('sui.rpc.v2.SubscribeEventsRequest', [
226
+ { no: 1, name: 'read_mask', kind: 'message', T: () => FieldMask },
227
+ { no: 2, name: 'filter', kind: 'message', T: () => EventFilter },
228
+ ]);
229
+ }
230
+ }
231
+ /**
232
+ * @generated MessageType for protobuf message sui.rpc.v2.SubscribeEventsRequest
233
+ */
234
+ export const SubscribeEventsRequest = new SubscribeEventsRequest$Type();
235
+ // @generated message type with reflection information, may provide speed optimized methods
236
+ class SubscribeEventsResponse$Type extends MessageType<SubscribeEventsResponse> {
237
+ constructor() {
238
+ super('sui.rpc.v2.SubscribeEventsResponse', [
239
+ { no: 1, name: 'event', kind: 'message', T: () => Event },
240
+ { no: 2, name: 'watermark', kind: 'message', T: () => Watermark },
241
+ ]);
242
+ }
243
+ }
244
+ /**
245
+ * @generated MessageType for protobuf message sui.rpc.v2.SubscribeEventsResponse
246
+ */
247
+ export const SubscribeEventsResponse = new SubscribeEventsResponse$Type();
82
248
  /**
83
249
  * @generated ServiceType for protobuf service sui.rpc.v2.SubscriptionService
84
250
  */
@@ -90,4 +256,18 @@ export const SubscriptionService = new ServiceType('sui.rpc.v2.SubscriptionServi
90
256
  I: SubscribeCheckpointsRequest,
91
257
  O: SubscribeCheckpointsResponse,
92
258
  },
259
+ {
260
+ name: 'SubscribeTransactions',
261
+ serverStreaming: true,
262
+ options: {},
263
+ I: SubscribeTransactionsRequest,
264
+ O: SubscribeTransactionsResponse,
265
+ },
266
+ {
267
+ name: 'SubscribeEvents',
268
+ serverStreaming: true,
269
+ options: {},
270
+ I: SubscribeEventsRequest,
271
+ O: SubscribeEventsResponse,
272
+ },
93
273
  ]);