@thru/thru-sdk 0.1.19 → 0.1.21

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 (88) hide show
  1. package/README.md +19 -0
  2. package/dist/{chunk-PH7P5EEU.js → chunk-SHMREHP5.js} +13 -9
  3. package/dist/chunk-SHMREHP5.js.map +1 -0
  4. package/dist/client.d.ts +2 -1
  5. package/dist/client.js +3 -2
  6. package/dist/client.js.map +1 -1
  7. package/dist/metafile-esm.json +1 -1
  8. package/dist/sdk.d.ts +3 -3
  9. package/dist/sdk.js +1 -1
  10. package/dist/{transactions-BzD9hYlc.d.ts → transactions-CLezIeXO.d.ts} +20 -18
  11. package/package.json +7 -3
  12. package/buf.gen.yaml +0 -12
  13. package/buf.lock +0 -9
  14. package/buf.yaml +0 -15
  15. package/dist/chunk-PH7P5EEU.js.map +0 -1
  16. package/proto/thru/common/v1/consensus.proto +0 -73
  17. package/proto/thru/common/v1/errors.proto +0 -65
  18. package/proto/thru/common/v1/filters.proto +0 -60
  19. package/proto/thru/common/v1/pagination.proto +0 -45
  20. package/proto/thru/core/v1/account.proto +0 -137
  21. package/proto/thru/core/v1/block.proto +0 -80
  22. package/proto/thru/core/v1/state.proto +0 -35
  23. package/proto/thru/core/v1/transaction.proto +0 -136
  24. package/proto/thru/core/v1/types.proto +0 -50
  25. package/proto/thru/services/v1/command_service.proto +0 -70
  26. package/proto/thru/services/v1/query_service.proto +0 -344
  27. package/proto/thru/services/v1/streaming_service.proto +0 -126
  28. package/thru-ts-client-sdk/__tests__/helpers/test-utils.ts +0 -228
  29. package/thru-ts-client-sdk/client.ts +0 -10
  30. package/thru-ts-client-sdk/core/__tests__/bound-client.test.ts +0 -354
  31. package/thru-ts-client-sdk/core/__tests__/client.test.ts +0 -53
  32. package/thru-ts-client-sdk/core/bound-client.ts +0 -156
  33. package/thru-ts-client-sdk/core/client.ts +0 -38
  34. package/thru-ts-client-sdk/defaults.ts +0 -26
  35. package/thru-ts-client-sdk/modules/__tests__/accounts.test.ts +0 -406
  36. package/thru-ts-client-sdk/modules/__tests__/blocks.test.ts +0 -199
  37. package/thru-ts-client-sdk/modules/__tests__/events.test.ts +0 -74
  38. package/thru-ts-client-sdk/modules/__tests__/height.test.ts +0 -39
  39. package/thru-ts-client-sdk/modules/__tests__/helpers.test.ts +0 -288
  40. package/thru-ts-client-sdk/modules/__tests__/keys.test.ts +0 -55
  41. package/thru-ts-client-sdk/modules/__tests__/proofs.test.ts +0 -119
  42. package/thru-ts-client-sdk/modules/__tests__/streaming.test.ts +0 -152
  43. package/thru-ts-client-sdk/modules/__tests__/transactions.test.ts +0 -730
  44. package/thru-ts-client-sdk/modules/__tests__/version.test.ts +0 -40
  45. package/thru-ts-client-sdk/modules/accounts.ts +0 -141
  46. package/thru-ts-client-sdk/modules/blocks.ts +0 -75
  47. package/thru-ts-client-sdk/modules/events.ts +0 -20
  48. package/thru-ts-client-sdk/modules/height.ts +0 -9
  49. package/thru-ts-client-sdk/modules/helpers.ts +0 -131
  50. package/thru-ts-client-sdk/modules/keys.ts +0 -29
  51. package/thru-ts-client-sdk/modules/proofs.ts +0 -20
  52. package/thru-ts-client-sdk/modules/streaming.ts +0 -133
  53. package/thru-ts-client-sdk/modules/transactions.ts +0 -374
  54. package/thru-ts-client-sdk/modules/version.ts +0 -10
  55. package/thru-ts-client-sdk/proto/buf/validate/validate_pb.ts +0 -4761
  56. package/thru-ts-client-sdk/proto/google/api/annotations_pb.ts +0 -39
  57. package/thru-ts-client-sdk/proto/google/api/client_pb.ts +0 -953
  58. package/thru-ts-client-sdk/proto/google/api/field_behavior_pb.ts +0 -157
  59. package/thru-ts-client-sdk/proto/google/api/http_pb.ts +0 -474
  60. package/thru-ts-client-sdk/proto/google/api/launch_stage_pb.ts +0 -118
  61. package/thru-ts-client-sdk/proto/thru/common/v1/consensus_pb.ts +0 -162
  62. package/thru-ts-client-sdk/proto/thru/common/v1/errors_pb.ts +0 -129
  63. package/thru-ts-client-sdk/proto/thru/common/v1/filters_pb.ts +0 -129
  64. package/thru-ts-client-sdk/proto/thru/common/v1/pagination_pb.ts +0 -79
  65. package/thru-ts-client-sdk/proto/thru/core/v1/account_pb.ts +0 -359
  66. package/thru-ts-client-sdk/proto/thru/core/v1/block_pb.ts +0 -259
  67. package/thru-ts-client-sdk/proto/thru/core/v1/state_pb.ts +0 -103
  68. package/thru-ts-client-sdk/proto/thru/core/v1/transaction_pb.ts +0 -528
  69. package/thru-ts-client-sdk/proto/thru/core/v1/types_pb.ts +0 -100
  70. package/thru-ts-client-sdk/proto/thru/services/v1/command_service_pb.ts +0 -146
  71. package/thru-ts-client-sdk/proto/thru/services/v1/query_service_pb.ts +0 -819
  72. package/thru-ts-client-sdk/proto/thru/services/v1/streaming_service_pb.ts +0 -390
  73. package/thru-ts-client-sdk/sdk.ts +0 -42
  74. package/thru-ts-client-sdk/test-scripts/counter.ts +0 -469
  75. package/thru-ts-client-sdk/test-scripts/create-account.ts +0 -74
  76. package/thru-ts-client-sdk/test-scripts/get-height.ts +0 -52
  77. package/thru-ts-client-sdk/transactions/Transaction.ts +0 -240
  78. package/thru-ts-client-sdk/transactions/TransactionBuilder.ts +0 -53
  79. package/thru-ts-client-sdk/transactions/__tests__/TransactionBuilder.test.ts +0 -411
  80. package/thru-ts-client-sdk/transactions/__tests__/utils.test.ts +0 -214
  81. package/thru-ts-client-sdk/transactions/index.ts +0 -3
  82. package/thru-ts-client-sdk/transactions/types.ts +0 -74
  83. package/thru-ts-client-sdk/transactions/utils.ts +0 -132
  84. package/thru-ts-client-sdk/types/types.ts +0 -8
  85. package/thru-ts-client-sdk/utils/utils.ts +0 -27
  86. package/tsconfig.json +0 -9
  87. package/tsup.config.ts +0 -14
  88. package/vitest.config.ts +0 -31
@@ -1,70 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package thru.services.v1;
4
-
5
- import "google/api/annotations.proto";
6
- import "google/api/client.proto";
7
- import "google/api/field_behavior.proto";
8
- import "thru/core/v1/transaction.proto";
9
- import "thru/core/v1/types.proto";
10
-
11
- option go_package = "github.com/Unto-Labs/thru-net/grpc/pkg/proto/thru/services/v1;servicesv1";
12
- option java_multiple_files = true;
13
- option java_package = "network.thru.services.v1";
14
- option csharp_namespace = "Thru.Services.V1";
15
- option ruby_package = "Thru::Services::V1";
16
- option objc_class_prefix = "THUS";
17
- option swift_prefix = "THUS";
18
-
19
- // SendTransactionRequest submits a transaction to the cluster.
20
- message SendTransactionRequest {
21
- // Raw transaction bytes encoded according to chain specification.
22
- bytes raw_transaction = 1 [(google.api.field_behavior) = REQUIRED];
23
- }
24
-
25
- // SendTransactionResponse echoes submission metadata.
26
- message SendTransactionResponse {
27
- thru.core.v1.Signature signature = 1 [(google.api.field_behavior) = REQUIRED];
28
- }
29
-
30
- // BatchSendTransactionsRequest submits multiple transactions to the cluster.
31
- message BatchSendTransactionsRequest {
32
- // List of raw transaction bytes encoded according to chain specification.
33
- repeated bytes raw_transactions = 1 [(google.api.field_behavior) = REQUIRED];
34
-
35
- // Number of retries for each transaction if not accepted by UDS (defaults to 0).
36
- int32 num_retries = 2;
37
- }
38
-
39
- // BatchSendTransactionsResponse returns submission results for each transaction.
40
- message BatchSendTransactionsResponse {
41
- // Signatures for each transaction (in same order as request).
42
- repeated thru.core.v1.Signature signatures = 1 [(google.api.field_behavior) = REQUIRED];
43
-
44
- // Acceptance status for each transaction (true if accepted, false if not).
45
- repeated bool accepted = 2 [(google.api.field_behavior) = REQUIRED];
46
- }
47
-
48
- // CommandService defines transactional RPCs that mutate state or perform
49
- // expensive computations.
50
- service CommandService {
51
- option (google.api.default_host) = "api.thru.network";
52
-
53
- // Submit a new transaction to the cluster.
54
- rpc SendTransaction(SendTransactionRequest)
55
- returns (SendTransactionResponse) {
56
- option (google.api.http) = {
57
- post: "/v1/transactions"
58
- body: "*"
59
- };
60
- }
61
-
62
- // Submit multiple transactions to the cluster in batch.
63
- rpc BatchSendTransactions(BatchSendTransactionsRequest)
64
- returns (BatchSendTransactionsResponse) {
65
- option (google.api.http) = {
66
- post: "/v1/transactions/batch"
67
- body: "*"
68
- };
69
- }
70
- }
@@ -1,344 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package thru.services.v1;
4
-
5
- import "buf/validate/validate.proto";
6
- import "google/api/annotations.proto";
7
- import "google/api/client.proto";
8
- import "google/api/field_behavior.proto";
9
- import "thru/common/v1/consensus.proto";
10
- import "thru/common/v1/filters.proto";
11
- import "thru/common/v1/pagination.proto";
12
- import "thru/core/v1/account.proto";
13
- import "thru/core/v1/block.proto";
14
- import "thru/core/v1/state.proto";
15
- import "thru/core/v1/transaction.proto";
16
- import "thru/core/v1/types.proto";
17
-
18
- option go_package = "github.com/Unto-Labs/thru-net/grpc/pkg/proto/thru/services/v1;servicesv1";
19
- option java_multiple_files = true;
20
- option java_package = "network.thru.services.v1";
21
- option csharp_namespace = "Thru.Services.V1";
22
- option ruby_package = "Thru::Services::V1";
23
- option objc_class_prefix = "THUS";
24
- option swift_prefix = "THUS";
25
-
26
- // GetAccountRequest retrieves a decoded account by public key.
27
- message GetAccountRequest {
28
- thru.core.v1.Pubkey address = 1 [(google.api.field_behavior) = REQUIRED];
29
- optional thru.core.v1.AccountView view = 2 [(google.api.field_behavior) = OPTIONAL];
30
- thru.common.v1.VersionContext version_context = 3
31
- [(google.api.field_behavior) = REQUIRED];
32
- optional thru.common.v1.ConsensusStatus min_consensus = 4
33
- [(google.api.field_behavior) = OPTIONAL];
34
- optional thru.core.v1.DataSlice data_slice = 5
35
- [(google.api.field_behavior) = OPTIONAL];
36
- }
37
-
38
- // GetRawAccountRequest retrieves raw account bytes by public key.
39
- message GetRawAccountRequest {
40
- thru.core.v1.Pubkey address = 1 [(google.api.field_behavior) = REQUIRED];
41
- optional thru.core.v1.AccountView view = 2 [(google.api.field_behavior) = OPTIONAL];
42
- thru.common.v1.VersionContext version_context = 3
43
- [(google.api.field_behavior) = REQUIRED];
44
- optional thru.common.v1.ConsensusStatus min_consensus = 4
45
- [(google.api.field_behavior) = OPTIONAL];
46
- }
47
-
48
- // GetTransactionRequest retrieves a decoded transaction by signature.
49
- message GetTransactionRequest {
50
- thru.core.v1.Signature signature = 1 [(google.api.field_behavior) = REQUIRED];
51
- optional thru.core.v1.TransactionView view = 2 [(google.api.field_behavior) = OPTIONAL];
52
- thru.common.v1.VersionContext version_context = 3
53
- [(google.api.field_behavior) = REQUIRED];
54
- optional thru.common.v1.ConsensusStatus min_consensus = 4
55
- [(google.api.field_behavior) = OPTIONAL];
56
- }
57
-
58
- // GetRawTransactionRequest retrieves raw transaction bytes by signature.
59
- message GetRawTransactionRequest {
60
- thru.core.v1.Signature signature = 1 [(google.api.field_behavior) = REQUIRED];
61
- thru.common.v1.VersionContext version_context = 2
62
- [(google.api.field_behavior) = REQUIRED];
63
- optional thru.common.v1.ConsensusStatus min_consensus = 3
64
- [(google.api.field_behavior) = OPTIONAL];
65
- }
66
-
67
- // GenerateStateProofRequest requests an account state proof.
68
- message GenerateStateProofRequest {
69
- thru.core.v1.StateProofRequest request = 1
70
- [(google.api.field_behavior) = REQUIRED];
71
- }
72
-
73
- // GenerateStateProofResponse contains the generated proof.
74
- message GenerateStateProofResponse {
75
- thru.core.v1.StateProof proof = 1 [(google.api.field_behavior) = REQUIRED];
76
- }
77
-
78
- // GetBlockRequest retrieves decoded block information by slot or hash.
79
- message GetBlockRequest {
80
- option (buf.validate.message).cel = {
81
- id: "block_selector_set"
82
- message: "either slot or block_hash must be set"
83
- expression: "has(this.slot) || has(this.block_hash)"
84
- };
85
-
86
- oneof selector {
87
- uint64 slot = 1 [(google.api.field_behavior) = OPTIONAL];
88
- thru.core.v1.BlockHash block_hash = 2 [(google.api.field_behavior) = OPTIONAL];
89
- }
90
- optional thru.core.v1.BlockView view = 3 [(google.api.field_behavior) = OPTIONAL];
91
- optional thru.common.v1.ConsensusStatus min_consensus = 4
92
- [(google.api.field_behavior) = OPTIONAL];
93
- }
94
-
95
- // GetRawBlockRequest retrieves raw block bytes by slot or hash.
96
- message GetRawBlockRequest {
97
- option (buf.validate.message).cel = {
98
- id: "raw_block_selector_set"
99
- message: "either slot or block_hash must be set"
100
- expression: "has(this.slot) || has(this.block_hash)"
101
- };
102
-
103
- oneof selector {
104
- uint64 slot = 1 [(google.api.field_behavior) = OPTIONAL];
105
- thru.core.v1.BlockHash block_hash = 2 [(google.api.field_behavior) = OPTIONAL];
106
- }
107
- optional thru.common.v1.ConsensusStatus min_consensus = 3
108
- [(google.api.field_behavior) = OPTIONAL];
109
- }
110
-
111
- // ListAccountsRequest lists accounts using CEL filters.
112
- message ListAccountsRequest {
113
- optional thru.core.v1.AccountView view = 1 [(google.api.field_behavior) = OPTIONAL];
114
- optional thru.common.v1.VersionContext version_context = 2
115
- [(google.api.field_behavior) = OPTIONAL];
116
-
117
- // Optional CEL filter applied server-side. To emulate the legacy
118
- // ListOwnedAccounts RPC, set:
119
- // filter.expression = "meta.owner.value == params.owner_bytes"
120
- // filter.params["owner_bytes"].bytes_value = <32-byte owner pubkey>
121
- optional thru.common.v1.Filter filter = 3 [(google.api.field_behavior) = OPTIONAL];
122
- optional thru.common.v1.PageRequest page = 4 [(google.api.field_behavior) = OPTIONAL];
123
- optional thru.common.v1.ConsensusStatus min_consensus = 5
124
- [(google.api.field_behavior) = OPTIONAL];
125
- }
126
-
127
- // ListAccountsResponse contains paginated accounts.
128
- message ListAccountsResponse {
129
- repeated thru.core.v1.Account accounts = 1
130
- [(google.api.field_behavior) = OPTIONAL];
131
- optional thru.common.v1.PageResponse page = 2
132
- [(google.api.field_behavior) = OPTIONAL];
133
- }
134
-
135
- // ListBlocksRequest lists blocks with pagination and filtering.
136
- message ListBlocksRequest {
137
- optional thru.common.v1.Filter filter = 1 [(google.api.field_behavior) = OPTIONAL];
138
- optional thru.common.v1.PageRequest page = 2 [(google.api.field_behavior) = OPTIONAL];
139
- optional thru.core.v1.BlockView view = 3 [(google.api.field_behavior) = OPTIONAL];
140
- optional thru.common.v1.ConsensusStatus min_consensus = 4
141
- [(google.api.field_behavior) = OPTIONAL];
142
- }
143
-
144
- // ListBlocksResponse returns a page of blocks.
145
- message ListBlocksResponse {
146
- repeated thru.core.v1.Block blocks = 1
147
- [(google.api.field_behavior) = OPTIONAL];
148
- optional thru.common.v1.PageResponse page = 2
149
- [(google.api.field_behavior) = OPTIONAL];
150
- }
151
-
152
- // ListTransactionsForAccountRequest lists transaction signatures involving an account.
153
- message ListTransactionsForAccountRequest {
154
- thru.core.v1.Pubkey account = 1 [(google.api.field_behavior) = REQUIRED];
155
- optional thru.common.v1.PageRequest page = 2 [(google.api.field_behavior) = OPTIONAL];
156
- // Optional CEL filter applied after the account constraint.
157
- optional thru.common.v1.Filter filter = 3 [(google.api.field_behavior) = OPTIONAL];
158
- }
159
-
160
- // ListTransactionsForAccountResponse contains transaction signatures.
161
- message ListTransactionsForAccountResponse {
162
- repeated thru.core.v1.Signature signatures = 1
163
- [(google.api.field_behavior) = OPTIONAL];
164
- optional thru.common.v1.PageResponse page = 2
165
- [(google.api.field_behavior) = OPTIONAL];
166
- }
167
-
168
- // GetVersionRequest fetches component version strings.
169
- message GetVersionRequest {}
170
-
171
- // GetVersionResponse returns version information per component.
172
- message GetVersionResponse {
173
- map<string, string> versions = 1
174
- [(google.api.field_behavior) = REQUIRED];
175
- }
176
-
177
- // GetEventRequest fetches an event by identifier.
178
- message GetEventRequest {
179
- string event_id = 1 [
180
- (google.api.field_behavior) = REQUIRED,
181
- (buf.validate.field).string.max_len = 128
182
- ];
183
- optional thru.common.v1.VersionContext version_context = 2
184
- [(google.api.field_behavior) = OPTIONAL];
185
- }
186
-
187
- // Event represents a transaction event emitted by the chain.
188
- message Event {
189
- string event_id = 1 [(google.api.field_behavior) = REQUIRED];
190
- thru.core.v1.Signature transaction_signature = 2
191
- [(google.api.field_behavior) = REQUIRED];
192
- optional thru.core.v1.Pubkey program = 3 [(google.api.field_behavior) = OPTIONAL];
193
- optional bytes payload = 4 [(google.api.field_behavior) = OPTIONAL];
194
- optional uint64 slot = 5 [(google.api.field_behavior) = OPTIONAL];
195
- optional uint32 call_idx = 6 [(google.api.field_behavior) = OPTIONAL];
196
- optional uint32 program_idx = 7 [(google.api.field_behavior) = OPTIONAL];
197
- optional uint32 payload_size = 8 [(google.api.field_behavior) = OPTIONAL];
198
- }
199
-
200
- // GetTransactionStatusRequest fetches execution status for a transaction.
201
- message GetTransactionStatusRequest {
202
- thru.core.v1.Signature signature = 1 [(google.api.field_behavior) = REQUIRED];
203
- }
204
-
205
- // TransactionStatus captures status metadata for a transaction.
206
- message TransactionStatus {
207
- thru.core.v1.Signature signature = 1 [(google.api.field_behavior) = REQUIRED];
208
- optional thru.common.v1.ConsensusStatus consensus_status = 2
209
- [(google.api.field_behavior) = OPTIONAL];
210
- optional thru.core.v1.TransactionExecutionResult execution_result = 3
211
- [(google.api.field_behavior) = OPTIONAL];
212
- }
213
-
214
- //
215
- message GetHeightRequest {}
216
-
217
- // GetHeightResponse
218
- message GetHeightResponse {
219
- uint64 finalized = 1 [(google.api.field_behavior) = REQUIRED];
220
- uint64 locally_executed = 2 [(google.api.field_behavior) = REQUIRED];
221
- uint64 cluster_executed = 3 [(google.api.field_behavior) = REQUIRED];
222
- }
223
-
224
-
225
- // QueryService defines unary RPCs for accessing blockchain data.
226
- service QueryService {
227
- option (google.api.default_host) = "api.thru.network";
228
-
229
- // Get block heights
230
- rpc GetHeight(GetHeightRequest) returns (GetHeightResponse) {
231
- option (google.api.http) = {
232
- get: "/v1/height"
233
- };
234
- }
235
-
236
- // Get account information.
237
- rpc GetAccount(GetAccountRequest) returns (thru.core.v1.Account) {
238
- option (google.api.http) = {
239
- get: "/v1/accounts/{address.value}"
240
- };
241
- option (google.api.method_signature) = "address";
242
- }
243
-
244
- // Get account raw bytes.
245
- rpc GetRawAccount(GetRawAccountRequest) returns (thru.core.v1.RawAccount) {
246
- option (google.api.http) = {
247
- get: "/v1/accounts/{address.value}:raw"
248
- };
249
- option (google.api.method_signature) = "address";
250
- }
251
-
252
- // Get transaction by signature.
253
- rpc GetTransaction(GetTransactionRequest) returns (thru.core.v1.Transaction) {
254
- option (google.api.http) = {
255
- get: "/v1/transactions/{signature.value}"
256
- };
257
- option (google.api.method_signature) = "signature";
258
- }
259
-
260
- // Get raw transaction by signature.
261
- rpc GetRawTransaction(GetRawTransactionRequest)
262
- returns (thru.core.v1.RawTransaction) {
263
- option (google.api.http) = {
264
- get: "/v1/transactions/{signature.value}:raw"
265
- };
266
- option (google.api.method_signature) = "signature";
267
- }
268
-
269
- // Get block by slot or hash.
270
- rpc GetBlock(GetBlockRequest) returns (thru.core.v1.Block) {
271
- option (google.api.http) = {
272
- get: "/v1/blocks/{slot}"
273
- additional_bindings {
274
- get: "/v1/blocks/by-hash/{block_hash.value}"
275
- }
276
- };
277
- }
278
-
279
- // Get raw block bytes.
280
- rpc GetRawBlock(GetRawBlockRequest) returns (thru.core.v1.RawBlock) {
281
- option (google.api.http) = {
282
- get: "/v1/blocks/{slot}:raw"
283
- additional_bindings {
284
- get: "/v1/blocks/by-hash/{block_hash.value}:raw"
285
- }
286
- };
287
- }
288
-
289
- // List accounts using CEL-based filtering.
290
- rpc ListAccounts(ListAccountsRequest) returns (ListAccountsResponse) {
291
- option (google.api.http) = {
292
- get: "/v1/accounts"
293
- };
294
- }
295
-
296
- // List blocks using pagination and filtering. By default returns blocks ordered from latest slot to the first one.
297
- rpc ListBlocks(ListBlocksRequest) returns (ListBlocksResponse) {
298
- option (google.api.http) = {
299
- get: "/v1/blocks"
300
- };
301
- }
302
-
303
- // List executed transaction signatures involving an account.
304
- rpc ListTransactionsForAccount(ListTransactionsForAccountRequest)
305
- returns (ListTransactionsForAccountResponse) {
306
- option (google.api.http) = {
307
- get: "/v1/accounts/{account.value}/transactions"
308
- };
309
- option (google.api.method_signature) = "account";
310
- }
311
-
312
- // Get a specific event by ID.
313
- rpc GetEvent(GetEventRequest) returns (Event) {
314
- option (google.api.http) = {
315
- get: "/v1/events/{event_id}"
316
- };
317
- option (google.api.method_signature) = "event_id";
318
- }
319
-
320
- // Get derived transaction status metadata.
321
- rpc GetTransactionStatus(GetTransactionStatusRequest)
322
- returns (TransactionStatus) {
323
- option (google.api.http) = {
324
- get: "/v1/transactions/{signature.value}:status"
325
- };
326
- option (google.api.method_signature) = "signature";
327
- }
328
-
329
- // Generate an account state proof snapshot.
330
- rpc GenerateStateProof(GenerateStateProofRequest)
331
- returns (GenerateStateProofResponse) {
332
- option (google.api.http) = {
333
- post: "/v1/stateproofs:generate"
334
- body: "*"
335
- };
336
- }
337
-
338
- // Get component version strings.
339
- rpc GetVersion(GetVersionRequest) returns (GetVersionResponse) {
340
- option (google.api.http) = {
341
- get: "/v1/version"
342
- };
343
- }
344
- }
@@ -1,126 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package thru.services.v1;
4
-
5
- import "buf/validate/validate.proto";
6
- import "google/api/field_behavior.proto";
7
- import "google/protobuf/duration.proto";
8
- import "google/protobuf/timestamp.proto";
9
- import "thru/common/v1/consensus.proto";
10
- import "thru/common/v1/filters.proto";
11
- import "thru/core/v1/account.proto";
12
- import "thru/core/v1/block.proto";
13
- import "thru/core/v1/transaction.proto";
14
- import "thru/core/v1/types.proto";
15
-
16
- option go_package = "github.com/Unto-Labs/thru-net/grpc/pkg/proto/thru/services/v1;servicesv1";
17
- option java_multiple_files = true;
18
- option java_package = "network.thru.services.v1";
19
- option csharp_namespace = "Thru.Services.V1";
20
- option ruby_package = "Thru::Services::V1";
21
- option objc_class_prefix = "THUS";
22
- option swift_prefix = "THUS";
23
-
24
- // StreamBlocksRequest subscribes to real-time block updates.
25
- message StreamBlocksRequest {
26
- optional uint64 start_slot = 1 [(google.api.field_behavior) = OPTIONAL];
27
- optional thru.common.v1.Filter filter = 2 [(google.api.field_behavior) = OPTIONAL];
28
- optional thru.core.v1.BlockView view = 3 [(google.api.field_behavior) = OPTIONAL];
29
- optional thru.common.v1.ConsensusStatus min_consensus = 4
30
- [(google.api.field_behavior) = OPTIONAL];
31
- }
32
-
33
- // StreamBlocksResponse delivers block updates.
34
- message StreamBlocksResponse {
35
- thru.core.v1.Block block = 1 [(google.api.field_behavior) = REQUIRED];
36
- }
37
-
38
- // StreamAccountUpdatesRequest subscribes to account delta events.
39
- message StreamAccountUpdatesRequest {
40
- thru.core.v1.Pubkey address = 1 [(google.api.field_behavior) = REQUIRED];
41
- optional thru.core.v1.AccountView view = 2 [(google.api.field_behavior) = OPTIONAL];
42
- optional thru.common.v1.Filter filter = 4 [(google.api.field_behavior) = OPTIONAL];
43
- }
44
-
45
- // AccountUpdate describes a delta for an account.
46
- message AccountUpdate {
47
- uint64 slot = 1 [(google.api.field_behavior) = REQUIRED];
48
- optional thru.core.v1.AccountPage page = 2
49
- [(google.api.field_behavior) = OPTIONAL];
50
- optional thru.core.v1.AccountMeta meta = 3
51
- [(google.api.field_behavior) = OPTIONAL];
52
- optional bool delete = 4 [(google.api.field_behavior) = OPTIONAL];
53
- }
54
-
55
- // StreamAccountUpdatesResponse contains either an initial snapshot or a delta.
56
- message StreamAccountUpdatesResponse {
57
- oneof message {
58
- thru.core.v1.Account snapshot = 1;
59
- AccountUpdate update = 2;
60
- }
61
- }
62
-
63
- // StreamTransactionsRequest subscribes to transaction confirmations.
64
- message StreamTransactionsRequest {
65
- optional thru.common.v1.Filter filter = 1 [(google.api.field_behavior) = OPTIONAL];
66
- optional thru.common.v1.ConsensusStatus min_consensus = 2
67
- [(google.api.field_behavior) = OPTIONAL];
68
- }
69
-
70
- // StreamTransactionsResponse delivers transaction events.
71
- message StreamTransactionsResponse {
72
- thru.core.v1.Transaction transaction = 1
73
- [(google.api.field_behavior) = REQUIRED];
74
- }
75
-
76
- // StreamEventsRequest subscribes to chain events.
77
- message StreamEventsRequest {
78
- optional thru.common.v1.Filter filter = 1 [(google.api.field_behavior) = OPTIONAL];
79
- }
80
-
81
- // StreamEventsResponse delivers event payloads.
82
- message StreamEventsResponse {
83
- string event_id = 1 [(google.api.field_behavior) = REQUIRED];
84
- optional bytes payload = 2 [(google.api.field_behavior) = OPTIONAL];
85
- optional google.protobuf.Timestamp timestamp = 3
86
- [(google.api.field_behavior) = OPTIONAL];
87
- thru.core.v1.Pubkey program = 4 [(google.api.field_behavior) = REQUIRED];
88
- uint32 call_idx = 5 [(google.api.field_behavior) = REQUIRED];
89
- thru.core.v1.Signature signature = 6
90
- [(google.api.field_behavior) = REQUIRED];
91
- uint64 slot = 7 [(google.api.field_behavior) = REQUIRED];
92
- }
93
-
94
- // TrackTransactionRequest subscribes to status updates for a transaction.
95
- message TrackTransactionRequest {
96
- thru.core.v1.Signature signature = 1 [(google.api.field_behavior) = REQUIRED];
97
- optional google.protobuf.Duration timeout = 2
98
- [(google.api.field_behavior) = OPTIONAL];
99
- }
100
-
101
- // TrackTransactionResponse reports status transitions for a transaction.
102
- message TrackTransactionResponse {
103
- thru.core.v1.Signature signature = 1 [(google.api.field_behavior) = REQUIRED];
104
- thru.common.v1.ConsensusStatus consensus_status = 2
105
- [(google.api.field_behavior) = OPTIONAL];
106
- thru.core.v1.TransactionExecutionResult execution_result = 3
107
- [(google.api.field_behavior) = OPTIONAL];
108
- }
109
-
110
- // StreamingService serves server-streaming gRPC APIs for real-time data.
111
- service StreamingService {
112
- rpc StreamBlocks(StreamBlocksRequest)
113
- returns (stream StreamBlocksResponse);
114
-
115
- rpc StreamAccountUpdates(StreamAccountUpdatesRequest)
116
- returns (stream StreamAccountUpdatesResponse);
117
-
118
- rpc StreamTransactions(StreamTransactionsRequest)
119
- returns (stream StreamTransactionsResponse);
120
-
121
- rpc StreamEvents(StreamEventsRequest)
122
- returns (stream StreamEventsResponse);
123
-
124
- rpc TrackTransaction(TrackTransactionRequest)
125
- returns (stream TrackTransactionResponse);
126
- }