@clonegod/ttd-sui-common 1.0.93 → 1.0.95
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/README.md +1 -1
- package/dist/grpc/grpc-connection.js +2 -2
- package/dist/grpc/index.d.ts +1 -1
- package/dist/grpc/index.js +3 -3
- package/dist/grpc/protos/google/protobuf/timestamp.proto +9 -8
- package/dist/grpc/protos/sui/rpc/v2/argument.proto +34 -0
- package/dist/grpc/protos/sui/rpc/v2/balance_change.proto +18 -0
- package/dist/grpc/protos/sui/rpc/v2/bcs.proto +17 -0
- package/dist/grpc/protos/sui/rpc/v2/checkpoint.proto +42 -0
- package/dist/grpc/protos/sui/rpc/v2/checkpoint_contents.proto +34 -0
- package/dist/grpc/protos/sui/rpc/v2/checkpoint_summary.proto +105 -0
- package/dist/grpc/protos/sui/rpc/v2/effects.proto +157 -0
- package/dist/grpc/protos/sui/rpc/v2/epoch.proto +34 -0
- package/dist/grpc/protos/sui/rpc/v2/error_reason.proto +12 -0
- package/dist/grpc/protos/sui/rpc/v2/event.proto +44 -0
- package/dist/grpc/protos/sui/rpc/v2/executed_transaction.proto +49 -0
- package/dist/grpc/protos/sui/rpc/v2/execution_status.proto +374 -0
- package/dist/grpc/protos/sui/rpc/v2/gas_cost_summary.proto +19 -0
- package/dist/grpc/protos/sui/rpc/v2/input.proto +55 -0
- package/dist/grpc/protos/sui/rpc/v2/jwk.proto +38 -0
- package/dist/grpc/protos/sui/rpc/v2/ledger_service.proto +165 -0
- package/dist/grpc/protos/sui/rpc/v2/move_package.proto +238 -0
- package/dist/grpc/protos/sui/rpc/v2/move_package_service.proto +91 -0
- package/dist/grpc/protos/sui/rpc/v2/name_service.proto +67 -0
- package/dist/grpc/protos/sui/rpc/v2/object.proto +68 -0
- package/dist/grpc/protos/sui/rpc/v2/object_reference.proto +16 -0
- package/dist/grpc/protos/sui/rpc/v2/owner.proto +25 -0
- package/dist/grpc/protos/sui/rpc/v2/protocol_config.proto +12 -0
- package/dist/grpc/protos/sui/rpc/v2/signature.proto +238 -0
- package/dist/grpc/protos/sui/rpc/v2/signature_scheme.proto +22 -0
- package/dist/grpc/protos/sui/rpc/v2/signature_verification_service.proto +49 -0
- package/dist/grpc/protos/sui/rpc/v2/state_service.proto +300 -0
- package/dist/grpc/protos/sui/rpc/v2/subscription_service.proto +41 -0
- package/dist/grpc/protos/sui/rpc/v2/system_state.proto +340 -0
- package/dist/grpc/protos/sui/rpc/v2/transaction.proto +531 -0
- package/dist/grpc/protos/sui/rpc/v2/transaction_execution_service.proto +78 -0
- package/dist/grpc/state-service.d.ts +11 -0
- package/dist/grpc/state-service.js +107 -0
- package/dist/grpc/sui-grpc-client.d.ts +2 -2
- package/dist/grpc/sui-grpc-client.js +2 -2
- package/dist/redis/redis_client.js +1 -2
- package/dist/test/test.js +2 -2
- package/dist/test/test_grpc.js +9 -9
- package/dist/trade/abstract_sui_dex_trade_plus.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
// Copyright (c) Mysten Labs, Inc.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
syntax = "proto3";
|
|
5
|
+
|
|
6
|
+
package sui.rpc.v2;
|
|
7
|
+
|
|
8
|
+
// The status of an executed transaction.
|
|
9
|
+
message ExecutionStatus {
|
|
10
|
+
// Indicates if the transaction was successful or not.
|
|
11
|
+
optional bool success = 1;
|
|
12
|
+
|
|
13
|
+
// The error if `success` is false.
|
|
14
|
+
optional ExecutionError error = 2;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// An error that can occur during the execution of a transaction.
|
|
18
|
+
message ExecutionError {
|
|
19
|
+
// A human readable description of the error
|
|
20
|
+
optional string description = 1;
|
|
21
|
+
|
|
22
|
+
// The command, if any, during which the error occurred.
|
|
23
|
+
optional uint64 command = 2;
|
|
24
|
+
|
|
25
|
+
enum ExecutionErrorKind {
|
|
26
|
+
EXECUTION_ERROR_KIND_UNKNOWN = 0;
|
|
27
|
+
|
|
28
|
+
// Insufficient gas.
|
|
29
|
+
INSUFFICIENT_GAS = 1;
|
|
30
|
+
|
|
31
|
+
// Invalid `Gas` object.
|
|
32
|
+
INVALID_GAS_OBJECT = 2;
|
|
33
|
+
|
|
34
|
+
// Invariant violation.
|
|
35
|
+
INVARIANT_VIOLATION = 3;
|
|
36
|
+
|
|
37
|
+
// Attempted to use feature that is not supported yet.
|
|
38
|
+
FEATURE_NOT_YET_SUPPORTED = 4;
|
|
39
|
+
|
|
40
|
+
// Move object is larger than the maximum allowed size.
|
|
41
|
+
OBJECT_TOO_BIG = 5;
|
|
42
|
+
|
|
43
|
+
// Package is larger than the maximum allowed size.
|
|
44
|
+
PACKAGE_TOO_BIG = 6;
|
|
45
|
+
|
|
46
|
+
// Circular object ownership.
|
|
47
|
+
CIRCULAR_OBJECT_OWNERSHIP = 7;
|
|
48
|
+
|
|
49
|
+
//
|
|
50
|
+
// Coin errors.
|
|
51
|
+
//
|
|
52
|
+
|
|
53
|
+
// Insufficient coin balance for requested operation.
|
|
54
|
+
INSUFFICIENT_COIN_BALANCE = 8;
|
|
55
|
+
|
|
56
|
+
// Coin balance overflowed an u64.
|
|
57
|
+
COIN_BALANCE_OVERFLOW = 9;
|
|
58
|
+
|
|
59
|
+
//
|
|
60
|
+
// Publish/Upgrade errors.
|
|
61
|
+
//
|
|
62
|
+
|
|
63
|
+
// Publish error, non-zero address.
|
|
64
|
+
// The modules in the package must have their self-addresses set to zero.
|
|
65
|
+
PUBLISH_ERROR_NON_ZERO_ADDRESS = 10;
|
|
66
|
+
|
|
67
|
+
// Sui Move bytecode verification error.
|
|
68
|
+
SUI_MOVE_VERIFICATION_ERROR = 11;
|
|
69
|
+
|
|
70
|
+
//
|
|
71
|
+
// MoveVm errors.
|
|
72
|
+
//
|
|
73
|
+
|
|
74
|
+
// Error from a non-abort instruction.
|
|
75
|
+
// Possible causes:
|
|
76
|
+
// Arithmetic error, stack overflow, max value depth, or similar.
|
|
77
|
+
MOVE_PRIMITIVE_RUNTIME_ERROR = 12;
|
|
78
|
+
|
|
79
|
+
// Move runtime abort.
|
|
80
|
+
MOVE_ABORT = 13;
|
|
81
|
+
|
|
82
|
+
// Bytecode verification error.
|
|
83
|
+
VM_VERIFICATION_OR_DESERIALIZATION_ERROR = 14;
|
|
84
|
+
|
|
85
|
+
// MoveVm invariant violation.
|
|
86
|
+
VM_INVARIANT_VIOLATION = 15;
|
|
87
|
+
|
|
88
|
+
//
|
|
89
|
+
// Programmable transaction errors.
|
|
90
|
+
//
|
|
91
|
+
|
|
92
|
+
// Function not found.
|
|
93
|
+
FUNCTION_NOT_FOUND = 16;
|
|
94
|
+
|
|
95
|
+
// Parity mismatch for Move function.
|
|
96
|
+
// The number of arguments does not match the number of parameters.
|
|
97
|
+
ARITY_MISMATCH = 17;
|
|
98
|
+
|
|
99
|
+
// Type parity mismatch for Move function.
|
|
100
|
+
// Mismatch between the number of actual versus expected type arguments.
|
|
101
|
+
TYPE_ARITY_MISMATCH = 18;
|
|
102
|
+
|
|
103
|
+
// Non-entry function invoked. Move Call must start with an entry function.
|
|
104
|
+
NON_ENTRY_FUNCTION_INVOKED = 19;
|
|
105
|
+
|
|
106
|
+
// Invalid command argument.
|
|
107
|
+
COMMAND_ARGUMENT_ERROR = 20;
|
|
108
|
+
|
|
109
|
+
// Type argument error.
|
|
110
|
+
TYPE_ARGUMENT_ERROR = 21;
|
|
111
|
+
|
|
112
|
+
// Unused result without the drop ability.
|
|
113
|
+
UNUSED_VALUE_WITHOUT_DROP = 22;
|
|
114
|
+
|
|
115
|
+
// Invalid public Move function signature.
|
|
116
|
+
// Unsupported return type for return value.
|
|
117
|
+
INVALID_PUBLIC_FUNCTION_RETURN_TYPE = 23;
|
|
118
|
+
|
|
119
|
+
// Invalid transfer object, object does not have public transfer.
|
|
120
|
+
INVALID_TRANSFER_OBJECT = 24;
|
|
121
|
+
|
|
122
|
+
//
|
|
123
|
+
// Post-execution errors.
|
|
124
|
+
//
|
|
125
|
+
|
|
126
|
+
// Effects from the transaction are too large.
|
|
127
|
+
EFFECTS_TOO_LARGE = 25;
|
|
128
|
+
|
|
129
|
+
// Publish or Upgrade is missing dependency.
|
|
130
|
+
PUBLISH_UPGRADE_MISSING_DEPENDENCY = 26;
|
|
131
|
+
|
|
132
|
+
// Publish or upgrade dependency downgrade.
|
|
133
|
+
//
|
|
134
|
+
// Indirect (transitive) dependency of published or upgraded package has been assigned an
|
|
135
|
+
// on-chain version that is less than the version required by one of the package's
|
|
136
|
+
// transitive dependencies.
|
|
137
|
+
PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE = 27;
|
|
138
|
+
|
|
139
|
+
// Invalid package upgrade.
|
|
140
|
+
PACKAGE_UPGRADE_ERROR = 28;
|
|
141
|
+
|
|
142
|
+
// Indicates the transaction tried to write objects too large to storage.
|
|
143
|
+
WRITTEN_OBJECTS_TOO_LARGE = 29;
|
|
144
|
+
|
|
145
|
+
// Certificate is on the deny list.
|
|
146
|
+
CERTIFICATE_DENIED = 30;
|
|
147
|
+
|
|
148
|
+
// Sui Move bytecode verification timed out.
|
|
149
|
+
SUI_MOVE_VERIFICATION_TIMEDOUT = 31;
|
|
150
|
+
|
|
151
|
+
// The requested consensus object operation is not allowed.
|
|
152
|
+
CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED = 32;
|
|
153
|
+
|
|
154
|
+
// Requested consensus object has been deleted.
|
|
155
|
+
INPUT_OBJECT_DELETED = 33;
|
|
156
|
+
|
|
157
|
+
// Certificate is canceled due to congestion on consensus objects.
|
|
158
|
+
EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION = 34;
|
|
159
|
+
|
|
160
|
+
// Address is denied for this coin type.
|
|
161
|
+
ADDRESS_DENIED_FOR_COIN = 35;
|
|
162
|
+
|
|
163
|
+
// Coin type is globally paused for use.
|
|
164
|
+
COIN_TYPE_GLOBAL_PAUSE = 36;
|
|
165
|
+
|
|
166
|
+
// Certificate is canceled because randomness could not be generated this epoch.
|
|
167
|
+
EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE = 37;
|
|
168
|
+
|
|
169
|
+
MOVE_VECTOR_ELEM_TOO_BIG = 38;
|
|
170
|
+
|
|
171
|
+
MOVE_RAW_VALUE_TOO_BIG = 39;
|
|
172
|
+
|
|
173
|
+
INVALID_LINKAGE = 40;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
optional ExecutionErrorKind kind = 3;
|
|
177
|
+
|
|
178
|
+
oneof error_details {
|
|
179
|
+
MoveAbort abort = 4;
|
|
180
|
+
SizeError size_error = 5;
|
|
181
|
+
CommandArgumentError command_argument_error = 6;
|
|
182
|
+
TypeArgumentError type_argument_error = 7;
|
|
183
|
+
PackageUpgradeError package_upgrade_error = 8;
|
|
184
|
+
IndexError index_error = 9;
|
|
185
|
+
string object_id = 10;
|
|
186
|
+
CoinDenyListError coin_deny_list_error = 11;
|
|
187
|
+
// Set of objects that were congested, leading to the transaction's cancellation.
|
|
188
|
+
CongestedObjects congested_objects = 12;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
message MoveAbort {
|
|
193
|
+
optional uint64 abort_code = 1;
|
|
194
|
+
// Location in Move where the error occurred.
|
|
195
|
+
optional MoveLocation location = 2;
|
|
196
|
+
// Extra error information if abort code is a "Clever Error"
|
|
197
|
+
optional CleverError clever_error = 3;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Location in Move bytecode where an error occurred.
|
|
201
|
+
message MoveLocation {
|
|
202
|
+
// The package ID.
|
|
203
|
+
optional string package = 1;
|
|
204
|
+
// The module name.
|
|
205
|
+
optional string module = 2;
|
|
206
|
+
// The function index.
|
|
207
|
+
optional uint32 function = 3;
|
|
208
|
+
// Offset of the instruction where the error occurred.
|
|
209
|
+
optional uint32 instruction = 4;
|
|
210
|
+
// The name of the function, if available.
|
|
211
|
+
optional string function_name = 5;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
message CleverError {
|
|
215
|
+
optional uint64 error_code = 1;
|
|
216
|
+
optional uint64 line_number = 2;
|
|
217
|
+
optional string constant_name = 3;
|
|
218
|
+
optional string constant_type = 4;
|
|
219
|
+
oneof value {
|
|
220
|
+
string rendered = 5;
|
|
221
|
+
bytes raw = 6;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// A size error.
|
|
226
|
+
message SizeError {
|
|
227
|
+
// The offending size.
|
|
228
|
+
optional uint64 size = 1;
|
|
229
|
+
// The maximum allowable size.
|
|
230
|
+
optional uint64 max_size = 2;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
message IndexError {
|
|
234
|
+
// Index of an input or result.
|
|
235
|
+
optional uint32 index = 1;
|
|
236
|
+
|
|
237
|
+
// Index of a subresult.
|
|
238
|
+
optional uint32 subresult = 2;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
message CoinDenyListError {
|
|
242
|
+
// Denied address.
|
|
243
|
+
optional string address = 1;
|
|
244
|
+
// Coin type.
|
|
245
|
+
optional string coin_type = 2;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Set of objects that were congested, leading to the transaction's cancellation.
|
|
249
|
+
message CongestedObjects {
|
|
250
|
+
repeated string objects = 1;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// An error with an argument to a command.
|
|
254
|
+
message CommandArgumentError {
|
|
255
|
+
// Position of the problematic argument.
|
|
256
|
+
optional uint32 argument = 1;
|
|
257
|
+
|
|
258
|
+
enum CommandArgumentErrorKind {
|
|
259
|
+
COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN = 0;
|
|
260
|
+
|
|
261
|
+
// The type of the value does not match the expected type.
|
|
262
|
+
TYPE_MISMATCH = 1;
|
|
263
|
+
|
|
264
|
+
// The argument cannot be deserialized into a value of the specified type.
|
|
265
|
+
INVALID_BCS_BYTES = 2;
|
|
266
|
+
|
|
267
|
+
// The argument cannot be instantiated from raw bytes.
|
|
268
|
+
INVALID_USAGE_OF_PURE_ARGUMENT = 3;
|
|
269
|
+
|
|
270
|
+
// Invalid argument to private entry function.
|
|
271
|
+
// Private entry functions cannot take arguments from other Move functions.
|
|
272
|
+
INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION = 4;
|
|
273
|
+
|
|
274
|
+
// Out of bounds access to input or results.
|
|
275
|
+
//
|
|
276
|
+
// `index` field will be set indicating the invalid index value.
|
|
277
|
+
INDEX_OUT_OF_BOUNDS = 5;
|
|
278
|
+
|
|
279
|
+
// Out of bounds access to subresult.
|
|
280
|
+
//
|
|
281
|
+
// `index` and `subresult` fields will be set indicating the invalid index value.
|
|
282
|
+
SECONDARY_INDEX_OUT_OF_BOUNDS = 6;
|
|
283
|
+
|
|
284
|
+
// Invalid usage of result.
|
|
285
|
+
// Expected a single result but found either no return value or multiple.
|
|
286
|
+
// `index` field will be set indicating the invalid index value.
|
|
287
|
+
INVALID_RESULT_ARITY = 7;
|
|
288
|
+
|
|
289
|
+
// Invalid usage of gas coin.
|
|
290
|
+
// The gas coin can only be used by-value with a `TransferObject` command.
|
|
291
|
+
INVALID_GAS_COIN_USAGE = 8;
|
|
292
|
+
|
|
293
|
+
// Invalid usage of Move value.
|
|
294
|
+
// - Mutably borrowed values require unique usage.
|
|
295
|
+
// - Immutably borrowed values cannot be taken or borrowed mutably.
|
|
296
|
+
// - Taken values cannot be used again.
|
|
297
|
+
INVALID_VALUE_USAGE = 9;
|
|
298
|
+
|
|
299
|
+
// Immutable objects cannot be passed by-value.
|
|
300
|
+
INVALID_OBJECT_BY_VALUE = 10;
|
|
301
|
+
|
|
302
|
+
// Immutable objects cannot be passed by mutable reference, `&mut`.
|
|
303
|
+
INVALID_OBJECT_BY_MUT_REF = 11;
|
|
304
|
+
|
|
305
|
+
// Consensus object operations such as wrapping, freezing, or converting to owned are not
|
|
306
|
+
// allowed.
|
|
307
|
+
CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED = 12;
|
|
308
|
+
|
|
309
|
+
// Invalid argument arity. Expected a single argument but found a result that expanded to
|
|
310
|
+
// multiple arguments.
|
|
311
|
+
INVALID_ARGUMENT_ARITY = 13;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
optional CommandArgumentErrorKind kind = 2;
|
|
315
|
+
|
|
316
|
+
optional IndexError index_error = 3;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
// An error with upgrading a package.
|
|
320
|
+
message PackageUpgradeError {
|
|
321
|
+
enum PackageUpgradeErrorKind {
|
|
322
|
+
PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN = 0;
|
|
323
|
+
|
|
324
|
+
// Unable to fetch package.
|
|
325
|
+
UNABLE_TO_FETCH_PACKAGE = 1;
|
|
326
|
+
|
|
327
|
+
// Object is not a package.
|
|
328
|
+
NOT_A_PACKAGE = 2;
|
|
329
|
+
|
|
330
|
+
// Package upgrade is incompatible with previous version.
|
|
331
|
+
INCOMPATIBLE_UPGRADE = 3;
|
|
332
|
+
|
|
333
|
+
// Digest in upgrade ticket and computed digest differ.
|
|
334
|
+
DIGEST_DOES_NOT_MATCH = 4;
|
|
335
|
+
|
|
336
|
+
// Upgrade policy is not valid.
|
|
337
|
+
UNKNOWN_UPGRADE_POLICY = 5;
|
|
338
|
+
|
|
339
|
+
// Package ID does not match `PackageId` in upgrade ticket.
|
|
340
|
+
PACKAGE_ID_DOES_NOT_MATCH = 6;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
optional PackageUpgradeErrorKind kind = 1;
|
|
344
|
+
|
|
345
|
+
// The Package Id.
|
|
346
|
+
optional string package_id = 2;
|
|
347
|
+
|
|
348
|
+
// A digest.
|
|
349
|
+
optional string digest = 3;
|
|
350
|
+
|
|
351
|
+
// The policy.
|
|
352
|
+
optional uint32 policy = 4;
|
|
353
|
+
|
|
354
|
+
// The ticket Id.
|
|
355
|
+
optional string ticket_id = 5;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// Type argument error.
|
|
359
|
+
message TypeArgumentError {
|
|
360
|
+
// Index of the problematic type argument.
|
|
361
|
+
optional uint32 type_argument = 1;
|
|
362
|
+
|
|
363
|
+
enum TypeArgumentErrorKind {
|
|
364
|
+
TYPE_ARGUMENT_ERROR_KIND_UNKNOWN = 0;
|
|
365
|
+
|
|
366
|
+
// A type was not found in the module specified.
|
|
367
|
+
TYPE_NOT_FOUND = 1;
|
|
368
|
+
|
|
369
|
+
// A type provided did not match the specified constraint.
|
|
370
|
+
CONSTRAINT_NOT_SATISFIED = 2;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
optional TypeArgumentErrorKind kind = 2;
|
|
374
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright (c) Mysten Labs, Inc.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
syntax = "proto3";
|
|
5
|
+
|
|
6
|
+
package sui.rpc.v2;
|
|
7
|
+
|
|
8
|
+
// Summary of gas charges.
|
|
9
|
+
message GasCostSummary {
|
|
10
|
+
// Cost of computation/execution.
|
|
11
|
+
optional uint64 computation_cost = 1;
|
|
12
|
+
// Storage cost, it's the sum of all storage cost for all objects created or mutated.
|
|
13
|
+
optional uint64 storage_cost = 2;
|
|
14
|
+
// The amount of storage cost refunded to the user for all objects deleted or mutated in the
|
|
15
|
+
// transaction.
|
|
16
|
+
optional uint64 storage_rebate = 3;
|
|
17
|
+
// The fee for the rebate. The portion of the storage rebate kept by the system.
|
|
18
|
+
optional uint64 non_refundable_storage_fee = 4;
|
|
19
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Copyright (c) Mysten Labs, Inc.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
syntax = "proto3";
|
|
5
|
+
|
|
6
|
+
package sui.rpc.v2;
|
|
7
|
+
|
|
8
|
+
import "google/protobuf/struct.proto";
|
|
9
|
+
|
|
10
|
+
// An input to a user transaction.
|
|
11
|
+
message Input {
|
|
12
|
+
enum InputKind {
|
|
13
|
+
INPUT_KIND_UNKNOWN = 0;
|
|
14
|
+
|
|
15
|
+
// A move value serialized as BCS.
|
|
16
|
+
PURE = 1;
|
|
17
|
+
|
|
18
|
+
// A Move object that is either immutable or address owned.
|
|
19
|
+
IMMUTABLE_OR_OWNED = 2;
|
|
20
|
+
|
|
21
|
+
// A Move object whose owner is "Shared".
|
|
22
|
+
SHARED = 3;
|
|
23
|
+
|
|
24
|
+
// A Move object that is attempted to be received in this transaction.
|
|
25
|
+
RECEIVING = 4;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
optional InputKind kind = 1;
|
|
29
|
+
|
|
30
|
+
// A move value serialized as BCS.
|
|
31
|
+
//
|
|
32
|
+
// For normal operations this is required to be a move primitive type and not contain structs
|
|
33
|
+
// or objects.
|
|
34
|
+
optional bytes pure = 2;
|
|
35
|
+
|
|
36
|
+
// `ObjectId` of the object input.
|
|
37
|
+
optional string object_id = 3;
|
|
38
|
+
|
|
39
|
+
// Requested version of the input object when `kind` is `IMMUTABLE_OR_OWNED`
|
|
40
|
+
// or `RECEIVING` or if `kind` is `SHARED` this is the initial version of the
|
|
41
|
+
// object when it was shared
|
|
42
|
+
optional uint64 version = 4;
|
|
43
|
+
|
|
44
|
+
// The digest of this object.
|
|
45
|
+
optional string digest = 5;
|
|
46
|
+
|
|
47
|
+
// Controls whether the caller asks for a mutable reference to the shared
|
|
48
|
+
// object.
|
|
49
|
+
optional bool mutable = 6;
|
|
50
|
+
|
|
51
|
+
// A literal value
|
|
52
|
+
//
|
|
53
|
+
// INPUT ONLY
|
|
54
|
+
optional google.protobuf.Value literal = 1000;
|
|
55
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright (c) Mysten Labs, Inc.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
syntax = "proto3";
|
|
5
|
+
|
|
6
|
+
package sui.rpc.v2;
|
|
7
|
+
|
|
8
|
+
// Key to uniquely identify a JWK.
|
|
9
|
+
message JwkId {
|
|
10
|
+
// The issuer or identity of the OIDC provider.
|
|
11
|
+
optional string iss = 1;
|
|
12
|
+
// A key ID used to uniquely identify a key from an OIDC provider.
|
|
13
|
+
optional string kid = 2;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// A JSON web key.
|
|
17
|
+
//
|
|
18
|
+
// Struct that contains info for a JWK. A list of them for different kinds can
|
|
19
|
+
// be retrieved from the JWK endpoint (for example, <https://www.googleapis.com/oauth2/v3/certs>).
|
|
20
|
+
// The JWK is used to verify the JWT token.
|
|
21
|
+
message Jwk {
|
|
22
|
+
// Key type parameter, https://datatracker.ietf.org/doc/html/rfc7517#section-4.1.
|
|
23
|
+
optional string kty = 1;
|
|
24
|
+
// RSA public exponent, https://datatracker.ietf.org/doc/html/rfc7517#section-9.3.
|
|
25
|
+
optional string e = 2;
|
|
26
|
+
// RSA modulus, https://datatracker.ietf.org/doc/html/rfc7517#section-9.3.
|
|
27
|
+
optional string n = 3;
|
|
28
|
+
// Algorithm parameter, https://datatracker.ietf.org/doc/html/rfc7517#section-4.4.
|
|
29
|
+
optional string alg = 4;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Represents a standard JWT header according to
|
|
33
|
+
// https://openid.net/specs/openid-connect-core-1_0.html
|
|
34
|
+
// message JwtHeader {
|
|
35
|
+
// optional string alg = 1;
|
|
36
|
+
// optional string kid = 2;
|
|
37
|
+
// optional string typ = 3;
|
|
38
|
+
// }
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// Copyright (c) Mysten Labs, Inc.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
syntax = "proto3";
|
|
5
|
+
|
|
6
|
+
package sui.rpc.v2;
|
|
7
|
+
|
|
8
|
+
import "google/protobuf/field_mask.proto";
|
|
9
|
+
import "google/protobuf/timestamp.proto";
|
|
10
|
+
import "google/rpc/status.proto";
|
|
11
|
+
import "sui/rpc/v2/checkpoint.proto";
|
|
12
|
+
import "sui/rpc/v2/epoch.proto";
|
|
13
|
+
import "sui/rpc/v2/executed_transaction.proto";
|
|
14
|
+
import "sui/rpc/v2/object.proto";
|
|
15
|
+
|
|
16
|
+
service LedgerService {
|
|
17
|
+
// Query the service for general information about its current state.
|
|
18
|
+
rpc GetServiceInfo(GetServiceInfoRequest) returns (GetServiceInfoResponse);
|
|
19
|
+
|
|
20
|
+
rpc GetObject(GetObjectRequest) returns (GetObjectResponse);
|
|
21
|
+
rpc BatchGetObjects(BatchGetObjectsRequest) returns (BatchGetObjectsResponse);
|
|
22
|
+
|
|
23
|
+
rpc GetTransaction(GetTransactionRequest) returns (GetTransactionResponse);
|
|
24
|
+
rpc BatchGetTransactions(BatchGetTransactionsRequest) returns (BatchGetTransactionsResponse);
|
|
25
|
+
|
|
26
|
+
rpc GetCheckpoint(GetCheckpointRequest) returns (GetCheckpointResponse);
|
|
27
|
+
|
|
28
|
+
rpc GetEpoch(GetEpochRequest) returns (GetEpochResponse);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
message GetServiceInfoRequest {}
|
|
32
|
+
|
|
33
|
+
message GetServiceInfoResponse {
|
|
34
|
+
// The chain identifier of the chain that this node is on.
|
|
35
|
+
//
|
|
36
|
+
// The chain identifier is the digest of the genesis checkpoint, the
|
|
37
|
+
// checkpoint with sequence number 0.
|
|
38
|
+
optional string chain_id = 1;
|
|
39
|
+
|
|
40
|
+
// Human-readable name of the chain that this node is on.
|
|
41
|
+
//
|
|
42
|
+
// This is intended to be a human-readable name like `mainnet`, `testnet`, and so on.
|
|
43
|
+
optional string chain = 2;
|
|
44
|
+
|
|
45
|
+
// Current epoch of the node based on its highest executed checkpoint.
|
|
46
|
+
optional uint64 epoch = 3;
|
|
47
|
+
|
|
48
|
+
// Checkpoint height of the most recently executed checkpoint.
|
|
49
|
+
optional uint64 checkpoint_height = 4;
|
|
50
|
+
|
|
51
|
+
// Unix timestamp of the most recently executed checkpoint.
|
|
52
|
+
optional google.protobuf.Timestamp timestamp = 5;
|
|
53
|
+
|
|
54
|
+
// The lowest checkpoint for which checkpoints and transaction data are available.
|
|
55
|
+
optional uint64 lowest_available_checkpoint = 6;
|
|
56
|
+
|
|
57
|
+
// The lowest checkpoint for which object data is available.
|
|
58
|
+
optional uint64 lowest_available_checkpoint_objects = 7;
|
|
59
|
+
|
|
60
|
+
// Software version of the service. Similar to the `server` http header.
|
|
61
|
+
optional string server = 8;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
message GetObjectRequest {
|
|
65
|
+
// Required. The `ObjectId` of the requested object.
|
|
66
|
+
optional string object_id = 1;
|
|
67
|
+
|
|
68
|
+
// Request a specific version of the object.
|
|
69
|
+
// If no version is specified, and the object is live, then the latest
|
|
70
|
+
// version of the object is returned.
|
|
71
|
+
optional uint64 version = 2;
|
|
72
|
+
|
|
73
|
+
// Mask specifying which fields to read.
|
|
74
|
+
// If no mask is specified, defaults to `object_id,version,digest`.
|
|
75
|
+
optional google.protobuf.FieldMask read_mask = 3;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
message GetObjectResponse {
|
|
79
|
+
optional Object object = 1;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
message BatchGetObjectsRequest {
|
|
83
|
+
repeated GetObjectRequest requests = 1;
|
|
84
|
+
|
|
85
|
+
// Mask specifying which fields to read.
|
|
86
|
+
// If no mask is specified, defaults to `object_id,version,digest`.
|
|
87
|
+
optional google.protobuf.FieldMask read_mask = 2;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
message BatchGetObjectsResponse {
|
|
91
|
+
repeated GetObjectResult objects = 1;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
message GetObjectResult {
|
|
95
|
+
oneof result {
|
|
96
|
+
Object object = 1;
|
|
97
|
+
google.rpc.Status error = 2;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
message GetTransactionRequest {
|
|
102
|
+
// Required. The digest of the requested transaction.
|
|
103
|
+
optional string digest = 1;
|
|
104
|
+
|
|
105
|
+
// Mask specifying which fields to read.
|
|
106
|
+
// If no mask is specified, defaults to `digest`.
|
|
107
|
+
optional google.protobuf.FieldMask read_mask = 2;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
message GetTransactionResponse {
|
|
111
|
+
optional ExecutedTransaction transaction = 1;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
message BatchGetTransactionsRequest {
|
|
115
|
+
// Required. The digests of the requested transactions.
|
|
116
|
+
repeated string digests = 1;
|
|
117
|
+
|
|
118
|
+
// Mask specifying which fields to read.
|
|
119
|
+
// If no mask is specified, defaults to `digest`.
|
|
120
|
+
optional google.protobuf.FieldMask read_mask = 2;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
message BatchGetTransactionsResponse {
|
|
124
|
+
repeated GetTransactionResult transactions = 1;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
message GetTransactionResult {
|
|
128
|
+
oneof result {
|
|
129
|
+
ExecutedTransaction transaction = 1;
|
|
130
|
+
google.rpc.Status error = 2;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
message GetCheckpointRequest {
|
|
135
|
+
// If neither is provided, return the latest
|
|
136
|
+
oneof checkpoint_id {
|
|
137
|
+
// The sequence number of the requested checkpoint.
|
|
138
|
+
uint64 sequence_number = 1;
|
|
139
|
+
|
|
140
|
+
// The digest of the requested checkpoint.
|
|
141
|
+
string digest = 2;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Mask specifying which fields to read.
|
|
145
|
+
// If no mask is specified, defaults to `sequence_number,digest`.
|
|
146
|
+
optional google.protobuf.FieldMask read_mask = 3;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
message GetCheckpointResponse {
|
|
150
|
+
optional Checkpoint checkpoint = 1;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
message GetEpochRequest {
|
|
154
|
+
// The requested epoch.
|
|
155
|
+
// If no epoch is provided the current epoch will be returned.
|
|
156
|
+
optional uint64 epoch = 1;
|
|
157
|
+
|
|
158
|
+
// Mask specifying which fields to read.
|
|
159
|
+
// If no mask is specified, defaults to `epoch`.
|
|
160
|
+
optional google.protobuf.FieldMask read_mask = 2;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
message GetEpochResponse {
|
|
164
|
+
optional Epoch epoch = 1;
|
|
165
|
+
}
|