@clonegod/ttd-sui-common 1.0.93 → 1.0.94

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 (44) 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/test/test.js +2 -2
  42. package/dist/test/test_grpc.js +9 -9
  43. package/dist/trade/abstract_sui_dex_trade_plus.js +1 -1
  44. package/package.json +2 -2
@@ -0,0 +1,340 @@
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
+ message SystemState {
9
+ // The version of the system state data structure type.
10
+ optional uint64 version = 1;
11
+
12
+ // The epoch id
13
+ optional uint64 epoch = 2;
14
+
15
+ // The protocol version
16
+ optional uint64 protocol_version = 3;
17
+
18
+ // Information about the validators
19
+ optional ValidatorSet validators = 4;
20
+
21
+ // Storage Fund info
22
+ optional StorageFund storage_fund = 5;
23
+
24
+ // Set of system config parameters
25
+ optional SystemParameters parameters = 6;
26
+
27
+ // The reference gas price for this epoch
28
+ optional uint64 reference_gas_price = 7;
29
+
30
+ // A list of the records of validator reporting each other.
31
+ //
32
+ // There is an entry in this list for each validator that has been reported
33
+ // at least once. Each record contains all the validators that reported
34
+ // them. If a validator has never been reported they don't have a record in this list.
35
+ // This lists persists across epoch: a peer continues being in a reported state until the
36
+ // reporter doesn't explicitly remove their report.
37
+ repeated ValidatorReportRecord validator_report_records = 8;
38
+
39
+ // Schedule of stake subsidies given out each epoch.
40
+ optional StakeSubsidy stake_subsidy = 9;
41
+
42
+ // Whether the system is running in a downgraded safe mode due to a non-recoverable bug.
43
+ // This is set whenever we failed to execute advance_epoch, and ended up executing advance_epoch_safe_mode.
44
+ // It can be reset once we are able to successfully execute advance_epoch.
45
+ // The rest of the fields starting with `safe_mode_` are accumulated during safe mode
46
+ // when advance_epoch_safe_mode is executed. They will eventually be processed once we
47
+ // are out of safe mode.
48
+ optional bool safe_mode = 10;
49
+
50
+ // Storage rewards accumulated during safe_mode
51
+ optional uint64 safe_mode_storage_rewards = 11;
52
+
53
+ // Computation rewards accumulated during safe_mode
54
+ optional uint64 safe_mode_computation_rewards = 12;
55
+
56
+ // Storage rebates paid out during safe_mode
57
+ optional uint64 safe_mode_storage_rebates = 13;
58
+
59
+ // Nonrefundable storage fees accumulated during safe_mode
60
+ optional uint64 safe_mode_non_refundable_storage_fee = 14;
61
+
62
+ // Unix timestamp of when this this epoch started
63
+ optional uint64 epoch_start_timestamp_ms = 15;
64
+
65
+ // Any extra fields that's not defined statically.
66
+ optional MoveTable extra_fields = 16;
67
+ }
68
+
69
+ message ValidatorReportRecord {
70
+ // The address of the validator being reported
71
+ optional string reported = 1;
72
+
73
+ // The list of validator (addresses) that are reporting on the validator specified by `reported`
74
+ repeated string reporters = 2;
75
+ }
76
+
77
+ message SystemParameters {
78
+ // The duration of an epoch, in milliseconds.
79
+ optional uint64 epoch_duration_ms = 1;
80
+
81
+ // The starting epoch in which stake subsidies start being paid out
82
+ optional uint64 stake_subsidy_start_epoch = 2;
83
+
84
+ // Minimum number of active validators at any moment.
85
+ optional uint64 min_validator_count = 3;
86
+
87
+ // Maximum number of active validators at any moment.
88
+ // We do not allow the number of validators in any epoch to go above this.
89
+ optional uint64 max_validator_count = 4;
90
+
91
+ // Deprecated.
92
+ // Lower-bound on the amount of stake required to become a validator.
93
+ optional uint64 min_validator_joining_stake = 5;
94
+
95
+ // Deprecated.
96
+ // Validators with stake amount below `validator_low_stake_threshold` are considered to
97
+ // have low stake and will be escorted out of the validator set after being below this
98
+ // threshold for more than `validator_low_stake_grace_period` number of epochs.
99
+ optional uint64 validator_low_stake_threshold = 6;
100
+
101
+ // Deprecated.
102
+ // Validators with stake below `validator_very_low_stake_threshold` will be removed
103
+ // immediately at epoch change, no grace period.
104
+ optional uint64 validator_very_low_stake_threshold = 7;
105
+
106
+ // A validator can have stake below `validator_low_stake_threshold`
107
+ // for this many epochs before being kicked out.
108
+ optional uint64 validator_low_stake_grace_period = 8;
109
+
110
+ // Any extra fields that are not defined statically.
111
+ optional MoveTable extra_fields = 9;
112
+ }
113
+
114
+ // A message that represents a Move `0x2::table::Table` or `0x2::bag::Bag`
115
+ message MoveTable {
116
+ // The UID of the table or bag
117
+ optional string id = 1;
118
+
119
+ // The size or number of key-value pairs in the table or bag
120
+ optional uint64 size = 2;
121
+ }
122
+
123
+ message StakeSubsidy {
124
+ // Balance of SUI set aside for stake subsidies that will be drawn down over time.
125
+ optional uint64 balance = 1;
126
+
127
+ // Count of the number of times stake subsidies have been distributed.
128
+ optional uint64 distribution_counter = 2;
129
+
130
+ // The amount of stake subsidy to be drawn down per distribution.
131
+ // This amount decays and decreases over time.
132
+ optional uint64 current_distribution_amount = 3;
133
+
134
+ // Number of distributions to occur before the distribution amount decays.
135
+ optional uint64 stake_subsidy_period_length = 4;
136
+
137
+ // The rate at which the distribution amount decays at the end of each
138
+ // period. Expressed in basis points.
139
+ optional uint32 stake_subsidy_decrease_rate = 5;
140
+
141
+ // Any extra fields that's not defined statically.
142
+ optional MoveTable extra_fields = 6;
143
+ }
144
+
145
+ // Struct representing the onchain storage fund.
146
+ message StorageFund {
147
+ // This is the sum of `storage_rebate` of
148
+ // all objects currently stored on-chain. To maintain this invariant, the only inflow of this
149
+ // balance is storage charges collected from transactions, and the only outflow is storage rebates
150
+ // of transactions, including both the portion refunded to the transaction senders as well as
151
+ // the non-refundable portion taken out and put into `non_refundable_balance`.
152
+ optional uint64 total_object_storage_rebates = 1;
153
+
154
+ // Represents any remaining inflow of the storage fund that should not
155
+ // be taken out of the fund.
156
+ optional uint64 non_refundable_balance = 2;
157
+ }
158
+
159
+ message ValidatorSet {
160
+ // Total amount of stake from all active validators at the beginning of the epoch.
161
+ // Written only once per epoch, in `advance_epoch` function.
162
+ optional uint64 total_stake = 1;
163
+
164
+ // The current list of active validators.
165
+ repeated Validator active_validators = 2;
166
+
167
+ // List of new validator candidates added during the current epoch.
168
+ // They will be processed at the end of the epoch.
169
+ //
170
+ // key: u64 (index), value: 0x3::validator::Validator
171
+ optional MoveTable pending_active_validators = 3;
172
+
173
+ // Removal requests from the validators. Each element is an index
174
+ // pointing to `active_validators`.
175
+ repeated uint64 pending_removals = 4;
176
+
177
+ // Mappings from staking pool's ID to the sui address of a validator.
178
+ //
179
+ // key: address (staking pool Id), value: address (sui address of the validator)
180
+ optional MoveTable staking_pool_mappings = 5;
181
+
182
+ // Mapping from a staking pool ID to the inactive validator that has that pool as its staking pool.
183
+ // When a validator is deactivated the validator is removed from `active_validators` it
184
+ // is added to this table so that stakers can continue to withdraw their stake from it.
185
+ //
186
+ // key: address (staking pool Id), value: 0x3::validator_wrapper::ValidatorWrapper
187
+ optional MoveTable inactive_validators = 6;
188
+ // Table storing preactive/candidate validators, mapping their addresses to their `Validator ` structs.
189
+ // When an address calls `request_add_validator_candidate`, they get added to this table and become a preactive
190
+ // validator.
191
+ // When the candidate has met the min stake requirement, they can call `request_add_validator` to
192
+ // officially add them to the active validator set `active_validators` next epoch.
193
+ //
194
+ // key: address (sui address of the validator), value: 0x3::validator_wrapper::ValidatorWrapper
195
+ optional MoveTable validator_candidates = 7;
196
+
197
+ // Table storing the number of epochs during which a validator's stake has been below the low stake threshold.
198
+ map<string, uint64> at_risk_validators = 8;
199
+
200
+ // Any extra fields that's not defined statically.
201
+ optional MoveTable extra_fields = 9;
202
+ }
203
+
204
+ // Definition of a Validator in the system contracts
205
+ //
206
+ // Note: fields of ValidatorMetadata are flattened into this type
207
+ message Validator {
208
+ // A unique human-readable name of this validator.
209
+ optional string name = 1;
210
+
211
+ // The Sui Address of the validator. This is the sender that created the Validator object,
212
+ // and also the address to send validator/coins to during withdraws.
213
+ optional string address = 2;
214
+
215
+ optional string description = 3;
216
+
217
+ optional string image_url = 4;
218
+
219
+ optional string project_url = 5;
220
+
221
+ // Reserve field for protocol key scheme
222
+ reserved 6;
223
+ // The public key bytes corresponding to the private key that the validator
224
+ // holds to sign transactions. For now, this is the same as AuthorityName.
225
+ optional bytes protocol_public_key = 7;
226
+
227
+ // This is a proof that the validator has ownership of the protocol private key
228
+ optional bytes proof_of_possession = 8;
229
+
230
+ // Reserve field for network key scheme
231
+ reserved 9;
232
+ // The public key bytes corresponding to the private key that the validator
233
+ // uses to establish TLS connections
234
+ optional bytes network_public_key = 10;
235
+ // Reserve field for worker key scheme
236
+ reserved 11;
237
+ // The public key bytes corresponding to the Narwhal Worker
238
+ optional bytes worker_public_key = 12;
239
+ // The network address of the validator (could also contain extra info such as port, DNS and etc.).
240
+ optional string network_address = 13;
241
+ // The address of the validator used for p2p activities such as state sync (could also contain extra info such as port, DNS and etc.).
242
+ optional string p2p_address = 14;
243
+ // The address of the narwhal primary
244
+ optional string primary_address = 15;
245
+ // The address of the narwhal worker
246
+ optional string worker_address = 16;
247
+
248
+ // "next_epoch" metadata only takes effects in the next epoch.
249
+ // If none, current value will stay unchanged.
250
+ // Reserve field for protocol key scheme
251
+ reserved 17;
252
+ optional bytes next_epoch_protocol_public_key = 18;
253
+ optional bytes next_epoch_proof_of_possession = 19;
254
+ // Reserve field for network key scheme
255
+ reserved 20;
256
+ optional bytes next_epoch_network_public_key = 21;
257
+ // Reserve field for worker key scheme
258
+ reserved 22;
259
+ optional bytes next_epoch_worker_public_key = 23;
260
+ optional string next_epoch_network_address = 24;
261
+ optional string next_epoch_p2p_address = 25;
262
+ optional string next_epoch_primary_address = 26;
263
+ optional string next_epoch_worker_address = 27;
264
+
265
+ // Any extra fields that's not defined statically in the `ValidatorMetadata` struct
266
+ optional MoveTable metadata_extra_fields = 28;
267
+
268
+ // The voting power of this validator, which might be different from its
269
+ // stake amount.
270
+ optional uint64 voting_power = 29;
271
+
272
+ // The ID of this validator's current valid `UnverifiedValidatorOperationCap`
273
+ optional string operation_cap_id = 30;
274
+
275
+ // Gas price quote, updated only at end of epoch.
276
+ optional uint64 gas_price = 31;
277
+
278
+ // Staking pool for this validator.
279
+ optional StakingPool staking_pool = 32;
280
+
281
+ // Commission rate of the validator, in basis point.
282
+ optional uint64 commission_rate = 33;
283
+
284
+ // Total amount of stake that would be active in the next epoch.
285
+ optional uint64 next_epoch_stake = 34;
286
+
287
+ // This validator's gas price quote for the next epoch.
288
+ optional uint64 next_epoch_gas_price = 35;
289
+
290
+ // The commission rate of the validator starting the next epoch, in basis point.
291
+ optional uint64 next_epoch_commission_rate = 36;
292
+
293
+ // Any extra fields that's not defined statically.
294
+ optional MoveTable extra_fields = 37;
295
+ }
296
+
297
+ // A staking pool embedded in each validator struct in the system state object.
298
+ message StakingPool {
299
+ // UID of the StakingPool object
300
+ optional string id = 1;
301
+
302
+ // The epoch at which this pool became active.
303
+ // The value is `None` if the pool is pre-active and `Some(<epoch_number>)` if active or inactive.
304
+ optional uint64 activation_epoch = 2;
305
+
306
+ // The epoch at which this staking pool ceased to be active. `None` = {pre-active, active},
307
+ // `Some(<epoch_number>)` if in-active, and it was de-activated at epoch `<epoch_number>`.
308
+ optional uint64 deactivation_epoch = 3;
309
+
310
+ // The total number of SUI tokens in this pool, including the SUI in the rewards_pool, as well as in all the principal
311
+ // in the `StakedSui` object, updated at epoch boundaries.
312
+ optional uint64 sui_balance = 4;
313
+
314
+ // The epoch stake rewards will be added here at the end of each epoch.
315
+ optional uint64 rewards_pool = 5;
316
+
317
+ // Total number of pool tokens issued by the pool.
318
+ optional uint64 pool_token_balance = 6;
319
+
320
+ // Exchange rate history of previous epochs.
321
+ //
322
+ // The entries start from the `activation_epoch` of this pool and contains exchange rates at the beginning of each epoch,
323
+ // i.e., right after the rewards for the previous epoch have been deposited into the pool.
324
+ //
325
+ // key: u64 (epoch number), value: PoolTokenExchangeRate
326
+ optional MoveTable exchange_rates = 7;
327
+
328
+ // Pending stake amount for this epoch, emptied at epoch boundaries.
329
+ optional uint64 pending_stake = 8;
330
+
331
+ // Pending stake withdrawn during the current epoch, emptied at epoch boundaries.
332
+ // This includes both the principal and rewards SUI withdrawn.
333
+ optional uint64 pending_total_sui_withdraw = 9;
334
+
335
+ // Pending pool token withdrawn during the current epoch, emptied at epoch boundaries.
336
+ optional uint64 pending_pool_token_withdraw = 10;
337
+
338
+ // Any extra fields that's not defined statically.
339
+ optional MoveTable extra_fields = 11;
340
+ }