@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.
Files changed (45) hide show
  1. package/README.md +1 -1
  2. package/dist/grpc/grpc-connection.js +2 -2
  3. package/dist/grpc/index.d.ts +1 -1
  4. package/dist/grpc/index.js +3 -3
  5. package/dist/grpc/protos/google/protobuf/timestamp.proto +9 -8
  6. package/dist/grpc/protos/sui/rpc/v2/argument.proto +34 -0
  7. package/dist/grpc/protos/sui/rpc/v2/balance_change.proto +18 -0
  8. package/dist/grpc/protos/sui/rpc/v2/bcs.proto +17 -0
  9. package/dist/grpc/protos/sui/rpc/v2/checkpoint.proto +42 -0
  10. package/dist/grpc/protos/sui/rpc/v2/checkpoint_contents.proto +34 -0
  11. package/dist/grpc/protos/sui/rpc/v2/checkpoint_summary.proto +105 -0
  12. package/dist/grpc/protos/sui/rpc/v2/effects.proto +157 -0
  13. package/dist/grpc/protos/sui/rpc/v2/epoch.proto +34 -0
  14. package/dist/grpc/protos/sui/rpc/v2/error_reason.proto +12 -0
  15. package/dist/grpc/protos/sui/rpc/v2/event.proto +44 -0
  16. package/dist/grpc/protos/sui/rpc/v2/executed_transaction.proto +49 -0
  17. package/dist/grpc/protos/sui/rpc/v2/execution_status.proto +374 -0
  18. package/dist/grpc/protos/sui/rpc/v2/gas_cost_summary.proto +19 -0
  19. package/dist/grpc/protos/sui/rpc/v2/input.proto +55 -0
  20. package/dist/grpc/protos/sui/rpc/v2/jwk.proto +38 -0
  21. package/dist/grpc/protos/sui/rpc/v2/ledger_service.proto +165 -0
  22. package/dist/grpc/protos/sui/rpc/v2/move_package.proto +238 -0
  23. package/dist/grpc/protos/sui/rpc/v2/move_package_service.proto +91 -0
  24. package/dist/grpc/protos/sui/rpc/v2/name_service.proto +67 -0
  25. package/dist/grpc/protos/sui/rpc/v2/object.proto +68 -0
  26. package/dist/grpc/protos/sui/rpc/v2/object_reference.proto +16 -0
  27. package/dist/grpc/protos/sui/rpc/v2/owner.proto +25 -0
  28. package/dist/grpc/protos/sui/rpc/v2/protocol_config.proto +12 -0
  29. package/dist/grpc/protos/sui/rpc/v2/signature.proto +238 -0
  30. package/dist/grpc/protos/sui/rpc/v2/signature_scheme.proto +22 -0
  31. package/dist/grpc/protos/sui/rpc/v2/signature_verification_service.proto +49 -0
  32. package/dist/grpc/protos/sui/rpc/v2/state_service.proto +300 -0
  33. package/dist/grpc/protos/sui/rpc/v2/subscription_service.proto +41 -0
  34. package/dist/grpc/protos/sui/rpc/v2/system_state.proto +340 -0
  35. package/dist/grpc/protos/sui/rpc/v2/transaction.proto +531 -0
  36. package/dist/grpc/protos/sui/rpc/v2/transaction_execution_service.proto +78 -0
  37. package/dist/grpc/state-service.d.ts +11 -0
  38. package/dist/grpc/state-service.js +107 -0
  39. package/dist/grpc/sui-grpc-client.d.ts +2 -2
  40. package/dist/grpc/sui-grpc-client.js +2 -2
  41. package/dist/redis/redis_client.js +1 -2
  42. package/dist/test/test.js +2 -2
  43. package/dist/test/test_grpc.js +9 -9
  44. package/dist/trade/abstract_sui_dex_trade_plus.js +1 -1
  45. package/package.json +2 -2
@@ -0,0 +1,531 @@
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/duration.proto";
9
+ import "google/protobuf/timestamp.proto";
10
+ import "sui/rpc/v2/argument.proto";
11
+ import "sui/rpc/v2/bcs.proto";
12
+ import "sui/rpc/v2/input.proto";
13
+ import "sui/rpc/v2/jwk.proto";
14
+ import "sui/rpc/v2/object.proto";
15
+ import "sui/rpc/v2/object_reference.proto";
16
+
17
+ // A transaction.
18
+ message Transaction {
19
+ // This Transaction serialized as BCS.
20
+ optional Bcs bcs = 1;
21
+
22
+ // The digest of this Transaction.
23
+ optional string digest = 2;
24
+
25
+ // Version of this Transaction.
26
+ optional int32 version = 3;
27
+
28
+ optional TransactionKind kind = 4;
29
+ optional string sender = 5;
30
+ optional GasPayment gas_payment = 6;
31
+ optional TransactionExpiration expiration = 7;
32
+ }
33
+
34
+ // Payment information for executing a transaction.
35
+ message GasPayment {
36
+ // Set of gas objects to use for payment.
37
+ repeated ObjectReference objects = 1;
38
+
39
+ // Owner of the gas objects, either the transaction sender or a sponsor.
40
+ optional string owner = 2;
41
+
42
+ // Gas unit price to use when charging for computation.
43
+ //
44
+ // Must be greater than or equal to the network's current RGP (reference gas price).
45
+ optional uint64 price = 3;
46
+
47
+ // Total budget willing to spend for the execution of a transaction.
48
+ optional uint64 budget = 4;
49
+ }
50
+
51
+ // A TTL for a transaction.
52
+ message TransactionExpiration {
53
+ enum TransactionExpirationKind {
54
+ TRANSACTION_EXPIRATION_KIND_UNKNOWN = 0;
55
+
56
+ // The transaction has no expiration.
57
+ NONE = 1;
58
+
59
+ // Validators won't sign and execute transaction unless the expiration epoch
60
+ // is greater than or equal to the current epoch.
61
+ EPOCH = 2;
62
+ }
63
+
64
+ optional TransactionExpirationKind kind = 1;
65
+
66
+ optional uint64 epoch = 2;
67
+ }
68
+
69
+ // Transaction type.
70
+ message TransactionKind {
71
+ enum Kind {
72
+ KIND_UNKNOWN = 0;
73
+
74
+ // A user transaction comprised of a list of native commands and Move calls.
75
+ PROGRAMMABLE_TRANSACTION = 1;
76
+
77
+ // System Transactions
78
+
79
+ // System transaction used to end an epoch.
80
+ //
81
+ // The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
82
+ // `EndOfEpochTransaction`).
83
+ CHANGE_EPOCH = 2;
84
+
85
+ // Transaction used to initialize the chain state.
86
+ //
87
+ // Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
88
+ // executed on the chain.
89
+ GENESIS = 3;
90
+
91
+ // V1 consensus commit update.
92
+ CONSENSUS_COMMIT_PROLOGUE_V1 = 4;
93
+
94
+ // Update set of valid JWKs used for zklogin.
95
+ AUTHENTICATOR_STATE_UPDATE = 5;
96
+
97
+ // Set of operations to run at the end of the epoch to close out the current epoch and start
98
+ // the next one.
99
+ END_OF_EPOCH = 6;
100
+
101
+ // Randomness update.
102
+ RANDOMNESS_STATE_UPDATE = 7;
103
+
104
+ // V2 consensus commit update.
105
+ CONSENSUS_COMMIT_PROLOGUE_V2 = 8;
106
+
107
+ // V3 consensus commit update.
108
+ CONSENSUS_COMMIT_PROLOGUE_V3 = 9;
109
+
110
+ // V4 consensus commit update.
111
+ CONSENSUS_COMMIT_PROLOGUE_V4 = 10;
112
+
113
+ // A system transaction comprised of a list of native commands and Move calls.
114
+ // PROGRAMMABLE_SYSTEM_TRANSACTION = 11;
115
+ }
116
+
117
+ optional Kind kind = 1;
118
+
119
+ oneof data {
120
+ // A transaction comprised of a list of native commands and Move calls.
121
+ ProgrammableTransaction programmable_transaction = 2;
122
+
123
+ // System transaction used to end an epoch.
124
+ //
125
+ // The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
126
+ // `EndOfEpochTransaction`).
127
+ ChangeEpoch change_epoch = 3;
128
+
129
+ // Transaction used to initialize the chain state.
130
+ //
131
+ // Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
132
+ // executed on the chain.
133
+ GenesisTransaction genesis = 4;
134
+
135
+ // consensus commit update info
136
+ ConsensusCommitPrologue consensus_commit_prologue = 5;
137
+
138
+ // Update set of valid JWKs used for zklogin.
139
+ AuthenticatorStateUpdate authenticator_state_update = 6;
140
+
141
+ // Set of operations to run at the end of the epoch to close out the current epoch and start
142
+ // the next one.
143
+ EndOfEpochTransaction end_of_epoch = 7;
144
+
145
+ // Randomness update.
146
+ RandomnessStateUpdate randomness_state_update = 8;
147
+ }
148
+ }
149
+
150
+ // A user transaction.
151
+ //
152
+ // Contains a series of native commands and Move calls where the results of one command can be
153
+ // used in future commands.
154
+ message ProgrammableTransaction {
155
+ // Input objects or primitive values.
156
+ repeated Input inputs = 1;
157
+
158
+ // The commands to be executed sequentially. A failure in any command
159
+ // results in the failure of the entire transaction.
160
+ repeated Command commands = 2;
161
+ }
162
+
163
+ // A single command in a programmable transaction.
164
+ message Command {
165
+ oneof command {
166
+ // A call to either an entry or a public Move function.
167
+ MoveCall move_call = 1;
168
+
169
+ // `(Vec<forall T:key+store. T>, address)`
170
+ // It sends n-objects to the specified address. These objects must have store
171
+ // (public transfer) and either the previous owner must be an address or the object must
172
+ // be newly created.
173
+ TransferObjects transfer_objects = 2;
174
+
175
+ // `(&mut Coin<T>, Vec<u64>)` -> `Vec<Coin<T>>`
176
+ // It splits off some amounts into new coins with those amounts.
177
+ SplitCoins split_coins = 3;
178
+
179
+ // `(&mut Coin<T>, Vec<Coin<T>>)`
180
+ // It merges n-coins into the first coin.
181
+ MergeCoins merge_coins = 4;
182
+
183
+ // Publishes a Move package. It takes the package bytes and a list of the package's transitive
184
+ // dependencies to link against on chain.
185
+ Publish publish = 5;
186
+
187
+ // `forall T: Vec<T> -> vector<T>`
188
+ // Given n-values of the same type, it constructs a vector. For non-objects or an empty vector,
189
+ // the type tag must be specified.
190
+ MakeMoveVector make_move_vector = 6;
191
+
192
+ // Upgrades a Move package.
193
+ // Takes (in order):
194
+ // 1. A vector of serialized modules for the package.
195
+ // 2. A vector of object ids for the transitive dependencies of the new package.
196
+ // 3. The object ID of the package being upgraded.
197
+ // 4. An argument holding the `UpgradeTicket` that must have been produced from an earlier command in the same
198
+ // programmable transaction.
199
+ Upgrade upgrade = 7;
200
+ }
201
+ }
202
+
203
+ // Command to call a Move function.
204
+ //
205
+ // Functions that can be called by a `MoveCall` command are those that have a function signature
206
+ // that is either `entry` or `public` (which don't have a reference return type).
207
+ message MoveCall {
208
+ // The package containing the module and function.
209
+ optional string package = 1;
210
+ // The specific module in the package containing the function.
211
+ optional string module = 2;
212
+ // The function to be called.
213
+ optional string function = 3;
214
+ // The type arguments to the function.
215
+ repeated string type_arguments = 4;
216
+ // The arguments to the function.
217
+ repeated Argument arguments = 5;
218
+ }
219
+
220
+ // Command to transfer ownership of a set of objects to an address.
221
+ message TransferObjects {
222
+ // Set of objects to transfer.
223
+ repeated Argument objects = 1;
224
+ // The address to transfer ownership to.
225
+ optional Argument address = 2;
226
+ }
227
+
228
+ // Command to split a single coin object into multiple coins.
229
+ message SplitCoins {
230
+ // The coin to split.
231
+ optional Argument coin = 1;
232
+ // The amounts to split off.
233
+ repeated Argument amounts = 2;
234
+ }
235
+
236
+ // Command to merge multiple coins of the same type into a single coin.
237
+ message MergeCoins {
238
+ // Coin to merge coins into.
239
+ optional Argument coin = 1;
240
+
241
+ // Set of coins to merge into `coin`.
242
+ //
243
+ // All listed coins must be of the same type and be the same type as `coin`
244
+ repeated Argument coins_to_merge = 2;
245
+ }
246
+
247
+ // Command to publish a new Move package.
248
+ message Publish {
249
+ // The serialized Move modules.
250
+ repeated bytes modules = 1;
251
+
252
+ // Set of packages that the to-be published package depends on.
253
+ repeated string dependencies = 2;
254
+ }
255
+
256
+ // Command to build a Move vector out of a set of individual elements.
257
+ message MakeMoveVector {
258
+ // Type of the individual elements.
259
+ //
260
+ // This is required to be set when the type can't be inferred, for example when the set of
261
+ // provided arguments are all pure input values.
262
+ optional string element_type = 1;
263
+
264
+ // The set individual elements to build the vector with.
265
+ repeated Argument elements = 2;
266
+ }
267
+
268
+ // Command to upgrade an already published package.
269
+ message Upgrade {
270
+ // The serialized Move modules.
271
+ repeated bytes modules = 1;
272
+ // Set of packages that the to-be published package depends on.
273
+ repeated string dependencies = 2;
274
+ // Package ID of the package to upgrade.
275
+ optional string package = 3;
276
+ // Ticket authorizing the upgrade.
277
+ optional Argument ticket = 4;
278
+ }
279
+
280
+ // Randomness update.
281
+ message RandomnessStateUpdate {
282
+ // Epoch of the randomness state update transaction.
283
+ optional uint64 epoch = 1;
284
+
285
+ // Randomness round of the update.
286
+ optional uint64 randomness_round = 2;
287
+
288
+ // Updated random bytes.
289
+ optional bytes random_bytes = 3;
290
+
291
+ // The initial version of the randomness object that it was shared at.
292
+ optional uint64 randomness_object_initial_shared_version = 4;
293
+ }
294
+
295
+ // System transaction used to change the epoch.
296
+ message ChangeEpoch {
297
+ // The next (to become) epoch ID.
298
+ optional uint64 epoch = 1;
299
+ // The protocol version in effect in the new epoch.
300
+ optional uint64 protocol_version = 2;
301
+ // The total amount of gas charged for storage during the epoch.
302
+ optional uint64 storage_charge = 3;
303
+ // The total amount of gas charged for computation during the epoch.
304
+ optional uint64 computation_charge = 4;
305
+ // The amount of storage rebate refunded to the txn senders.
306
+ optional uint64 storage_rebate = 5;
307
+ // The non-refundable storage fee.
308
+ optional uint64 non_refundable_storage_fee = 6;
309
+ // Unix timestamp when epoch started.
310
+ optional google.protobuf.Timestamp epoch_start_timestamp = 7;
311
+ // System packages (specifically framework and Move stdlib) that are written before the new
312
+ // epoch starts. This tracks framework upgrades on chain. When executing the `ChangeEpoch` txn,
313
+ // the validator must write out the following modules. Modules are provided with the version they
314
+ // will be upgraded to, their modules in serialized form (which include their package ID), and
315
+ // a list of their transitive dependencies.
316
+ repeated SystemPackage system_packages = 8;
317
+ }
318
+
319
+ // System package.
320
+ message SystemPackage {
321
+ // Version of the package.
322
+ optional uint64 version = 1;
323
+ // Move modules.
324
+ repeated bytes modules = 2;
325
+ // Package dependencies.
326
+ repeated string dependencies = 3;
327
+ }
328
+
329
+ // The genesis transaction.
330
+ message GenesisTransaction {
331
+ // Set of genesis objects.
332
+ repeated Object objects = 1;
333
+ }
334
+
335
+ // Consensus commit prologue system transaction.
336
+ //
337
+ // This message can represent V1, V2, and V3 prologue types.
338
+ message ConsensusCommitPrologue {
339
+ // Epoch of the commit prologue transaction.
340
+ //
341
+ // Present in V1, V2, V3, V4.
342
+ optional uint64 epoch = 1;
343
+
344
+ // Consensus round of the commit.
345
+ //
346
+ // Present in V1, V2, V3, V4.
347
+ optional uint64 round = 2;
348
+
349
+ // Unix timestamp from consensus.
350
+ //
351
+ // Present in V1, V2, V3, V4.
352
+ optional google.protobuf.Timestamp commit_timestamp = 3;
353
+
354
+ // Digest of consensus output.
355
+ //
356
+ // Present in V2, V3, V4.
357
+ optional string consensus_commit_digest = 4;
358
+
359
+ // The sub DAG index of the consensus commit. This field is populated if there
360
+ // are multiple consensus commits per round.
361
+ //
362
+ // Present in V3, V4.
363
+ optional uint64 sub_dag_index = 5;
364
+
365
+ // Stores consensus handler determined consensus object version assignments.
366
+ //
367
+ // Present in V3, V4.
368
+ optional ConsensusDeterminedVersionAssignments consensus_determined_version_assignments = 6;
369
+
370
+ // Digest of any additional state computed by the consensus handler.
371
+ // Used to detect forking bugs as early as possible.
372
+ //
373
+ // Present in V4.
374
+ optional string additional_state_digest = 7;
375
+ }
376
+
377
+ // Object version assignment from consensus.
378
+ message VersionAssignment {
379
+ // `ObjectId` of the object.
380
+ optional string object_id = 1;
381
+ // start version of the consensus stream for this object
382
+ optional uint64 start_version = 2;
383
+ // Assigned version.
384
+ optional uint64 version = 3;
385
+ }
386
+
387
+ // A transaction that was canceled.
388
+ message CanceledTransaction {
389
+ // Digest of the canceled transaction.
390
+ optional string digest = 1;
391
+ // List of object version assignments.
392
+ repeated VersionAssignment version_assignments = 2;
393
+ }
394
+
395
+ // Version assignments performed by consensus.
396
+ message ConsensusDeterminedVersionAssignments {
397
+ // Version of this message
398
+ optional int32 version = 1;
399
+
400
+ // Canceled transaction version assignment.
401
+ repeated CanceledTransaction canceled_transactions = 3;
402
+ }
403
+
404
+ // Update the set of valid JWKs.
405
+ message AuthenticatorStateUpdate {
406
+ // Epoch of the authenticator state update transaction.
407
+ optional uint64 epoch = 1;
408
+ // Consensus round of the authenticator state update.
409
+ optional uint64 round = 2;
410
+ // Newly active JWKs.
411
+ repeated ActiveJwk new_active_jwks = 3;
412
+ // The initial version of the authenticator object that it was shared at.
413
+ optional uint64 authenticator_object_initial_shared_version = 4;
414
+ }
415
+
416
+ // A new JWK.
417
+ message ActiveJwk {
418
+ // Identifier used to uniquely identify a JWK.
419
+ optional JwkId id = 1;
420
+ // The JWK.
421
+ optional Jwk jwk = 2;
422
+ // Most recent epoch in which the JWK was validated.
423
+ optional uint64 epoch = 3;
424
+ }
425
+
426
+ // Set of operations run at the end of the epoch to close out the current epoch
427
+ // and start the next one.
428
+ message EndOfEpochTransaction {
429
+ repeated EndOfEpochTransactionKind transactions = 1;
430
+ }
431
+
432
+ // Operation run at the end of an epoch.
433
+ message EndOfEpochTransactionKind {
434
+ enum Kind {
435
+ KIND_UNKNOWN = 0;
436
+
437
+ // End the epoch and start the next one.
438
+ CHANGE_EPOCH = 1;
439
+
440
+ // Create and initialize the authenticator object used for zklogin.
441
+ AUTHENTICATOR_STATE_CREATE = 2;
442
+ // Expire JWKs used for zklogin.
443
+ AUTHENTICATOR_STATE_EXPIRE = 3;
444
+
445
+ // Create and initialize the randomness object.
446
+ RANDOMNESS_STATE_CREATE = 4;
447
+
448
+ // Create and initialize the deny list object.
449
+ DENY_LIST_STATE_CREATE = 5;
450
+
451
+ // Create and initialize the bridge object.
452
+ BRIDGE_STATE_CREATE = 6;
453
+
454
+ // Initialize the bridge committee.
455
+ BRIDGE_COMMITTEE_INIT = 7;
456
+
457
+ // Execution time observations from the committee to preserve cross epoch
458
+ STORE_EXECUTION_TIME_OBSERVATIONS = 8;
459
+
460
+ // Create the accumulator root object.
461
+ ACCUMULATOR_ROOT_CREATE = 9;
462
+
463
+ // Create and initialize the Coin Registry object.
464
+ COIN_REGISTRY_CREATE = 10;
465
+
466
+ // Create and initialize the Display Registry object.
467
+ DISPLAY_REGISTRY_CREATE = 11;
468
+ }
469
+
470
+ optional Kind kind = 1;
471
+
472
+ oneof data {
473
+ // End the epoch and start the next one.
474
+ ChangeEpoch change_epoch = 2;
475
+
476
+ // Expire JWKs used for zklogin.
477
+ AuthenticatorStateExpire authenticator_state_expire = 3;
478
+
479
+ // Execution time observations from the committee to preserve cross epoch
480
+ ExecutionTimeObservations execution_time_observations = 4;
481
+
482
+ // ChainId used when initializing the bridge
483
+ string bridge_chain_id = 5;
484
+
485
+ // Start version of the Bridge object
486
+ uint64 bridge_object_version = 6;
487
+ }
488
+ }
489
+
490
+ // Expire old JWKs.
491
+ message AuthenticatorStateExpire {
492
+ // Expire JWKs that have a lower epoch than this.
493
+ optional uint64 min_epoch = 1;
494
+ // The initial version of the authenticator object that it was shared at.
495
+ optional uint64 authenticator_object_initial_shared_version = 2;
496
+ }
497
+
498
+ message ExecutionTimeObservations {
499
+ // Version of this ExecutionTimeObservations
500
+ optional int32 version = 1;
501
+
502
+ repeated ExecutionTimeObservation observations = 2;
503
+ }
504
+
505
+ message ExecutionTimeObservation {
506
+ enum ExecutionTimeObservationKind {
507
+ EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN = 0;
508
+
509
+ MOVE_ENTRY_POINT = 1;
510
+ TRANSFER_OBJECTS = 2;
511
+ SPLIT_COINS = 3;
512
+ MERGE_COINS = 4;
513
+ PUBLISH = 5;
514
+ MAKE_MOVE_VECTOR = 6;
515
+ UPGRADE = 7;
516
+ }
517
+
518
+ optional ExecutionTimeObservationKind kind = 1;
519
+
520
+ optional MoveCall move_entry_point = 2;
521
+
522
+ repeated ValidatorExecutionTimeObservation validator_observations = 3;
523
+ }
524
+
525
+ message ValidatorExecutionTimeObservation {
526
+ // Bls12381 public key of the validator
527
+ optional bytes validator = 1;
528
+
529
+ // Duration of an execution observation
530
+ optional google.protobuf.Duration duration = 2;
531
+ }
@@ -0,0 +1,78 @@
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/struct.proto";
10
+ import "sui/rpc/v2/argument.proto";
11
+ import "sui/rpc/v2/bcs.proto";
12
+ import "sui/rpc/v2/executed_transaction.proto";
13
+ import "sui/rpc/v2/signature.proto";
14
+ import "sui/rpc/v2/transaction.proto";
15
+
16
+ service TransactionExecutionService {
17
+ rpc ExecuteTransaction(ExecuteTransactionRequest) returns (ExecuteTransactionResponse);
18
+ rpc SimulateTransaction(SimulateTransactionRequest) returns (SimulateTransactionResponse);
19
+ }
20
+
21
+ message ExecuteTransactionRequest {
22
+ // The transaction to execute.
23
+ optional Transaction transaction = 1;
24
+
25
+ // Set of `UserSignature`s authorizing the execution of the provided
26
+ // transaction.
27
+ repeated UserSignature signatures = 2;
28
+
29
+ // Mask specifying which fields to read.
30
+ // If no mask is specified, defaults to `effects.status,checkpoint`.
31
+ optional google.protobuf.FieldMask read_mask = 3;
32
+ }
33
+
34
+ // Response message for `NodeService.ExecuteTransaction`.
35
+ message ExecuteTransactionResponse {
36
+ optional ExecutedTransaction transaction = 1;
37
+ }
38
+
39
+ message SimulateTransactionRequest {
40
+ optional Transaction transaction = 1;
41
+
42
+ // Mask specifying which fields to read.
43
+ optional google.protobuf.FieldMask read_mask = 2;
44
+
45
+ // buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX
46
+ enum TransactionChecks {
47
+ ENABLED = 0;
48
+ DISABLED = 1;
49
+ }
50
+
51
+ // Specify whether checks should be ENABLED (default) or DISABLED while executing the transaction
52
+ optional TransactionChecks checks = 3;
53
+
54
+ // Perform gas selection based on a budget estimation and include the
55
+ // selected gas payment and budget in the response.
56
+ //
57
+ // This option will be ignored if `checks` is `DISABLED`.
58
+ optional bool do_gas_selection = 4;
59
+ }
60
+
61
+ message SimulateTransactionResponse {
62
+ optional ExecutedTransaction transaction = 1;
63
+ repeated CommandResult command_outputs = 2;
64
+ }
65
+
66
+ // An intermediate result/output from the execution of a single command
67
+ message CommandResult {
68
+ repeated CommandOutput return_values = 1;
69
+ repeated CommandOutput mutated_by_ref = 2;
70
+ }
71
+
72
+ message CommandOutput {
73
+ optional Argument argument = 1;
74
+ optional Bcs value = 2;
75
+
76
+ // JSON rendering of the output.
77
+ optional google.protobuf.Value json = 3;
78
+ }
@@ -0,0 +1,11 @@
1
+ import { GrpcConnection } from './grpc-connection';
2
+ import { ListOwnedObjectsResponse } from '../type/sui_object_types';
3
+ export declare class StateService {
4
+ private stateClient;
5
+ private connection;
6
+ constructor(connection: GrpcConnection);
7
+ getBalance(owner: string, coinType: string): Promise<any>;
8
+ listBalances(owner: string): Promise<unknown>;
9
+ getCoinInfo(coinType: string): Promise<unknown>;
10
+ listOwnedObjects(owner: string, coinType?: string, limit?: number, readMask?: string[]): Promise<ListOwnedObjectsResponse>;
11
+ }