@clonegod/ttd-sui-common 1.0.92 → 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 (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.d.ts +1 -1
  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 +105 -96
  45. package/package.json +2 -2
package/README.md CHANGED
@@ -4,7 +4,7 @@ https://github.com/MystenLabs/sui/blob/main/docs/content/concepts/grpc-overview.
4
4
 
5
5
  ### grpc proto
6
6
 
7
- https://github.com/MystenLabs/sui-rust-sdk/tree/master/crates/sui-rpc/vendored/proto/sui/rpc/v2beta2
7
+ https://github.com/MystenLabs/sui-rust-sdk/tree/master/crates/sui-rpc/vendored/proto/sui/rpc/v2
8
8
 
9
9
  https://github.com/MystenLabs/sui-apis/tree/main/proto
10
10
 
@@ -76,7 +76,7 @@ class GrpcConnection {
76
76
  }
77
77
  createServiceClient(protoFileName, serviceName) {
78
78
  var _a, _b, _c;
79
- const protoPath = path.join(__dirname, 'protos/sui/rpc/v2beta2', protoFileName);
79
+ const protoPath = path.join(__dirname, 'protos/sui/rpc/v2', protoFileName);
80
80
  const packageDefinition = protoLoader.loadSync(protoPath, {
81
81
  keepCase: true,
82
82
  longs: String,
@@ -86,7 +86,7 @@ class GrpcConnection {
86
86
  includeDirs: [path.join(__dirname, 'protos')]
87
87
  });
88
88
  const protoDescriptor = grpc.loadPackageDefinition(packageDefinition);
89
- const service = (_c = (_b = (_a = protoDescriptor.sui) === null || _a === void 0 ? void 0 : _a.rpc) === null || _b === void 0 ? void 0 : _b.v2beta2) === null || _c === void 0 ? void 0 : _c[serviceName];
89
+ const service = (_c = (_b = (_a = protoDescriptor.sui) === null || _a === void 0 ? void 0 : _a.rpc) === null || _b === void 0 ? void 0 : _b.v2) === null || _c === void 0 ? void 0 : _c[serviceName];
90
90
  if (!service) {
91
91
  throw new Error(`Service ${serviceName} not found in proto file`);
92
92
  }
@@ -1,6 +1,6 @@
1
1
  export { GrpcConnection } from './grpc-connection';
2
2
  export { LedgerService } from './ledger-service';
3
- export { LiveDataService } from './live-data-service';
3
+ export { StateService } from './state-service';
4
4
  export { TransactionService } from './transaction-service';
5
5
  export { SubscriptionService } from './subscription-service';
6
6
  export { SuiGrpcClient } from './sui-grpc-client';
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GasPriceCache = exports.SuiGrpcClient = exports.SubscriptionService = exports.TransactionService = exports.LiveDataService = exports.LedgerService = exports.GrpcConnection = void 0;
3
+ exports.GasPriceCache = exports.SuiGrpcClient = exports.SubscriptionService = exports.TransactionService = exports.StateService = exports.LedgerService = exports.GrpcConnection = void 0;
4
4
  var grpc_connection_1 = require("./grpc-connection");
5
5
  Object.defineProperty(exports, "GrpcConnection", { enumerable: true, get: function () { return grpc_connection_1.GrpcConnection; } });
6
6
  var ledger_service_1 = require("./ledger-service");
7
7
  Object.defineProperty(exports, "LedgerService", { enumerable: true, get: function () { return ledger_service_1.LedgerService; } });
8
- var live_data_service_1 = require("./live-data-service");
9
- Object.defineProperty(exports, "LiveDataService", { enumerable: true, get: function () { return live_data_service_1.LiveDataService; } });
8
+ var state_service_1 = require("./state-service");
9
+ Object.defineProperty(exports, "StateService", { enumerable: true, get: function () { return state_service_1.StateService; } });
10
10
  var transaction_service_1 = require("./transaction-service");
11
11
  Object.defineProperty(exports, "TransactionService", { enumerable: true, get: function () { return transaction_service_1.TransactionService; } });
12
12
  var subscription_service_1 = require("./subscription-service");
@@ -112,8 +112,8 @@ option csharp_namespace = "Google.Protobuf.WellKnownTypes";
112
112
  // {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
113
113
  // seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
114
114
  // are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
115
- // is required. A proto3 JSON serializer should always use UTC (as indicated by
116
- // "Z") when printing the Timestamp type and a proto3 JSON parser should be
115
+ // is required. A ProtoJSON serializer should always use UTC (as indicated by
116
+ // "Z") when printing the Timestamp type and a ProtoJSON parser should be
117
117
  // able to accept both UTC and other timezones (as indicated by an offset).
118
118
  //
119
119
  // For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
@@ -131,14 +131,15 @@ option csharp_namespace = "Google.Protobuf.WellKnownTypes";
131
131
  // ) to obtain a formatter capable of generating timestamps in this format.
132
132
  //
133
133
  message Timestamp {
134
- // Represents seconds of UTC time since Unix epoch
135
- // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
136
- // 9999-12-31T23:59:59Z inclusive.
134
+ // Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
135
+ // be between -62135596800 and 253402300799 inclusive (which corresponds to
136
+ // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
137
137
  int64 seconds = 1;
138
138
 
139
- // Non-negative fractions of a second at nanosecond resolution. Negative
140
- // second values with fractions must still have non-negative nanos values
141
- // that count forward in time. Must be from 0 to 999,999,999
139
+ // Non-negative fractions of a second at nanosecond resolution. This field is
140
+ // the nanosecond portion of the duration, not an alternative to seconds.
141
+ // Negative second values with fractions must still have non-negative nanos
142
+ // values that count forward in time. Must be between 0 and 999,999,999
142
143
  // inclusive.
143
144
  int32 nanos = 2;
144
145
  }
@@ -0,0 +1,34 @@
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
+ // An argument to a programmable transaction command.
9
+ message Argument {
10
+ enum ArgumentKind {
11
+ ARGUMENT_KIND_UNKNOWN = 0;
12
+
13
+ // The gas coin.
14
+ GAS = 1;
15
+
16
+ // One of the input objects or primitive values (from
17
+ // `ProgrammableTransaction` inputs).
18
+ INPUT = 2;
19
+
20
+ // The result of another command (from `ProgrammableTransaction` commands).
21
+ RESULT = 3;
22
+ }
23
+
24
+ optional ArgumentKind kind = 1;
25
+
26
+ // Index of an input when `kind` is `INPUT`.
27
+ optional uint32 input = 2;
28
+
29
+ // Index of a result when `kind` is `RESULT`.
30
+ optional uint32 result = 3;
31
+
32
+ // Used to access a nested result when `kind` is `RESULT`.
33
+ optional uint32 subresult = 4;
34
+ }
@@ -0,0 +1,18 @@
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 delta, or change, in balance for an address for a particular `Coin` type.
9
+ message BalanceChange {
10
+ // The account address that is affected by this balance change event.
11
+ optional string address = 1;
12
+
13
+ // The `Coin` type of this balance change event.
14
+ optional string coin_type = 2;
15
+
16
+ // The amount or change in balance.
17
+ optional string amount = 3;
18
+ }
@@ -0,0 +1,17 @@
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
+ // `Bcs` contains an arbitrary type that is serialized using the
9
+ // [BCS](https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/index.html#bcs)
10
+ // format as well as a name that identifies the type of the serialized value.
11
+ message Bcs {
12
+ // Name that identifies the type of the serialized value.
13
+ optional string name = 1;
14
+
15
+ // Bytes of a BCS serialized value.
16
+ optional bytes value = 2;
17
+ }
@@ -0,0 +1,42 @@
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 "sui/rpc/v2/checkpoint_contents.proto";
9
+ import "sui/rpc/v2/checkpoint_summary.proto";
10
+ import "sui/rpc/v2/executed_transaction.proto";
11
+ import "sui/rpc/v2/object.proto";
12
+ import "sui/rpc/v2/signature.proto";
13
+
14
+ message Checkpoint {
15
+ // The height of this checkpoint.
16
+ optional uint64 sequence_number = 1;
17
+
18
+ // The digest of this Checkpoint's CheckpointSummary.
19
+ optional string digest = 2;
20
+
21
+ // The `CheckpointSummary` for this checkpoint.
22
+ optional CheckpointSummary summary = 3;
23
+
24
+ // An aggregated quorum signature from the validator committee that
25
+ // certified this checkpoint.
26
+ optional ValidatorAggregatedSignature signature = 4;
27
+
28
+ // The `CheckpointContents` for this checkpoint.
29
+ optional CheckpointContents contents = 5;
30
+
31
+ // List of transactions included in this checkpoint.
32
+ repeated ExecutedTransaction transactions = 6;
33
+
34
+ // Set of objects either referenced as inputs or produced as
35
+ // outputs by transactions included in this checkpoint.
36
+ //
37
+ // In order to benefit from deduplication of objects that
38
+ // appear in multiple transactions in this checkpoint, objects
39
+ // will only be present here and the `transactions.objects`
40
+ // field will not be populated.
41
+ optional ObjectSet objects = 7;
42
+ }
@@ -0,0 +1,34 @@
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 "sui/rpc/v2/bcs.proto";
9
+ import "sui/rpc/v2/signature.proto";
10
+
11
+ // The committed to contents of a checkpoint.
12
+ message CheckpointContents {
13
+ // This CheckpointContents serialized as BCS.
14
+ optional Bcs bcs = 1;
15
+
16
+ // The digest of this CheckpointContents.
17
+ optional string digest = 2;
18
+
19
+ // Version of this CheckpointContents
20
+ optional int32 version = 3;
21
+
22
+ // Set of transactions committed to in this checkpoint.
23
+ repeated CheckpointedTransactionInfo transactions = 4;
24
+ }
25
+
26
+ // Transaction information committed to in a checkpoint.
27
+ message CheckpointedTransactionInfo {
28
+ // Digest of the transaction.
29
+ optional string transaction = 1;
30
+ // Digest of the effects.
31
+ optional string effects = 2;
32
+ // Set of user signatures that authorized the transaction.
33
+ repeated UserSignature signatures = 3;
34
+ }
@@ -0,0 +1,105 @@
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/timestamp.proto";
9
+ import "sui/rpc/v2/bcs.proto";
10
+ import "sui/rpc/v2/gas_cost_summary.proto";
11
+ import "sui/rpc/v2/signature.proto";
12
+
13
+ // A header for a checkpoint on the Sui blockchain.
14
+ //
15
+ // On the Sui network, checkpoints define the history of the blockchain. They are quite similar to
16
+ // the concept of blocks used by other blockchains like Bitcoin or Ethereum. The Sui blockchain,
17
+ // however, forms checkpoints after transaction execution has already happened to provide a
18
+ // certified history of the chain, instead of being formed before execution.
19
+ //
20
+ // Checkpoints commit to a variety of state, including but not limited to:
21
+ // - The hash of the previous checkpoint.
22
+ // - The set of transaction digests, their corresponding effects digests, as well as the set of
23
+ // user signatures that authorized its execution.
24
+ // - The objects produced by a transaction.
25
+ // - The set of live objects that make up the current state of the chain.
26
+ // - On epoch transitions, the next validator committee.
27
+ //
28
+ // `CheckpointSummary`s themselves don't directly include all of the previous information but they
29
+ // are the top-level type by which all the information is committed to transitively via cryptographic
30
+ // hashes included in the summary. `CheckpointSummary`s are signed and certified by a quorum of
31
+ // the validator committee in a given epoch to allow verification of the chain's state.
32
+ message CheckpointSummary {
33
+ // This CheckpointSummary serialized as BCS.
34
+ optional Bcs bcs = 1;
35
+
36
+ // The digest of this CheckpointSummary.
37
+ optional string digest = 2;
38
+
39
+ // Epoch that this checkpoint belongs to.
40
+ optional uint64 epoch = 3;
41
+
42
+ // The height of this checkpoint.
43
+ optional uint64 sequence_number = 4;
44
+
45
+ // Total number of transactions committed since genesis, including those in this
46
+ // checkpoint.
47
+ optional uint64 total_network_transactions = 5;
48
+
49
+ // The hash of the `CheckpointContents` for this checkpoint.
50
+ optional string content_digest = 6;
51
+
52
+ // The hash of the previous `CheckpointSummary`.
53
+ //
54
+ // This will be `None` only for the first, or genesis, checkpoint.
55
+ optional string previous_digest = 7;
56
+
57
+ // The running total gas costs of all transactions included in the current epoch so far
58
+ // until this checkpoint.
59
+ optional GasCostSummary epoch_rolling_gas_cost_summary = 8;
60
+
61
+ // Timestamp of the checkpoint - number of milliseconds from the Unix epoch
62
+ // Checkpoint timestamps are monotonic, but not strongly monotonic - subsequent
63
+ // checkpoints can have the same timestamp if they originate from the same underlining consensus commit.
64
+ optional google.protobuf.Timestamp timestamp = 9;
65
+
66
+ // Commitments to checkpoint-specific state.
67
+ repeated CheckpointCommitment commitments = 10;
68
+
69
+ // Extra data only present in the final checkpoint of an epoch.
70
+ optional EndOfEpochData end_of_epoch_data = 11;
71
+
72
+ // `CheckpointSummary` is not an evolvable structure - it must be readable by any version of
73
+ // the code. Therefore, to allow extensions to be added to `CheckpointSummary`,
74
+ // opaque data can be added to checkpoints, which can be deserialized based on the current
75
+ // protocol version.
76
+ optional bytes version_specific_data = 12;
77
+ }
78
+
79
+ // Data, which when included in a `CheckpointSummary`, signals the end of an `Epoch`.
80
+ message EndOfEpochData {
81
+ // The set of validators that will be in the `ValidatorCommittee` for the next epoch.
82
+ repeated ValidatorCommitteeMember next_epoch_committee = 1;
83
+ // The protocol version that is in effect during the next epoch.
84
+ optional uint64 next_epoch_protocol_version = 2;
85
+ // Commitments to epoch specific state (live object set)
86
+ repeated CheckpointCommitment epoch_commitments = 3;
87
+ }
88
+
89
+ // A commitment made by a checkpoint.
90
+ message CheckpointCommitment {
91
+ enum CheckpointCommitmentKind {
92
+ CHECKPOINT_COMMITMENT_KIND_UNKNOWN = 0;
93
+
94
+ // An elliptic curve multiset hash attesting to the set of objects that
95
+ // comprise the live state of the Sui blockchain.
96
+ ECMH_LIVE_OBJECT_SET = 1;
97
+
98
+ // Digest of the checkpoint artifacts.
99
+ CHECKPOINT_ARTIFACTS = 2;
100
+ }
101
+
102
+ optional CheckpointCommitmentKind kind = 1;
103
+
104
+ optional string digest = 2;
105
+ }
@@ -0,0 +1,157 @@
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 "sui/rpc/v2/bcs.proto";
9
+ import "sui/rpc/v2/execution_status.proto";
10
+ import "sui/rpc/v2/gas_cost_summary.proto";
11
+ import "sui/rpc/v2/object_reference.proto";
12
+ import "sui/rpc/v2/owner.proto";
13
+
14
+ // The effects of executing a transaction.
15
+ message TransactionEffects {
16
+ // This TransactionEffects serialized as BCS.
17
+ optional Bcs bcs = 1;
18
+
19
+ // The digest of this TransactionEffects.
20
+ optional string digest = 2;
21
+
22
+ // Version of this TransactionEffects.
23
+ optional int32 version = 3;
24
+
25
+ // The status of the execution.
26
+ optional ExecutionStatus status = 4;
27
+
28
+ // The epoch when this transaction was executed.
29
+ optional uint64 epoch = 5;
30
+
31
+ // The gas used by this transaction.
32
+ optional GasCostSummary gas_used = 6;
33
+
34
+ // The transaction digest.
35
+ optional string transaction_digest = 7;
36
+
37
+ // Information about the gas object. Also present in the `changed_objects` vector.
38
+ //
39
+ // System transactions that don't require gas will leave this as `None`.
40
+ optional ChangedObject gas_object = 8;
41
+
42
+ // The digest of the events emitted during execution,
43
+ // can be `None` if the transaction does not emit any event.
44
+ optional string events_digest = 9;
45
+
46
+ // The set of transaction digests this transaction depends on.
47
+ repeated string dependencies = 10;
48
+
49
+ // The version number of all the written objects (excluding packages) by this transaction.
50
+ optional uint64 lamport_version = 11;
51
+
52
+ // Objects whose state are changed by this transaction.
53
+ repeated ChangedObject changed_objects = 12;
54
+
55
+ // Consensus objects that are not mutated in this transaction. Unlike owned objects,
56
+ // read-only consensus objects' version are not committed in the transaction,
57
+ // and in order for a node to catch up and execute it without consensus sequencing,
58
+ // the version needs to be committed in the effects.
59
+ repeated UnchangedConsensusObject unchanged_consensus_objects = 13;
60
+
61
+ // Auxiliary data that are not protocol-critical, generated as part of the effects but are stored separately.
62
+ // Storing it separately allows us to avoid bloating the effects with data that are not critical.
63
+ // It also provides more flexibility on the format and type of the data.
64
+ optional string auxiliary_data_digest = 14;
65
+
66
+ repeated ObjectReference unchanged_loaded_runtime_objects = 15;
67
+ }
68
+
69
+ // Input/output state of an object that was changed during execution.
70
+ message ChangedObject {
71
+ // ID of the object.
72
+ optional string object_id = 1;
73
+
74
+ enum InputObjectState {
75
+ INPUT_OBJECT_STATE_UNKNOWN = 0;
76
+ INPUT_OBJECT_STATE_DOES_NOT_EXIST = 1;
77
+ INPUT_OBJECT_STATE_EXISTS = 2;
78
+ }
79
+
80
+ optional InputObjectState input_state = 2;
81
+
82
+ // Version of the object before this transaction executed.
83
+ optional uint64 input_version = 3;
84
+ // Digest of the object before this transaction executed.
85
+ optional string input_digest = 4;
86
+ // Owner of the object before this transaction executed.
87
+ optional Owner input_owner = 5;
88
+
89
+ enum OutputObjectState {
90
+ OUTPUT_OBJECT_STATE_UNKNOWN = 0;
91
+ OUTPUT_OBJECT_STATE_DOES_NOT_EXIST = 1;
92
+ OUTPUT_OBJECT_STATE_OBJECT_WRITE = 2;
93
+ OUTPUT_OBJECT_STATE_PACKAGE_WRITE = 3;
94
+ }
95
+
96
+ optional OutputObjectState output_state = 6;
97
+ // Version of the object after this transaction executed.
98
+ optional uint64 output_version = 7;
99
+ // Digest of the object after this transaction executed.
100
+ optional string output_digest = 8;
101
+ // Owner of the object after this transaction executed.
102
+ optional Owner output_owner = 9;
103
+
104
+ enum IdOperation {
105
+ ID_OPERATION_UNKNOWN = 0;
106
+ NONE = 1;
107
+ CREATED = 2;
108
+ DELETED = 3;
109
+ }
110
+
111
+ // What happened to an `ObjectId` during execution.
112
+ optional IdOperation id_operation = 10;
113
+
114
+ // Type information is not provided by the effects structure but is instead
115
+ // provided by an indexing layer
116
+ optional string object_type = 11;
117
+ }
118
+
119
+ // A consensus object that wasn't changed during execution.
120
+ message UnchangedConsensusObject {
121
+ enum UnchangedConsensusObjectKind {
122
+ UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN = 0;
123
+
124
+ // Read-only consensus object from the input.
125
+ READ_ONLY_ROOT = 1;
126
+
127
+ // Objects with ended consensus streams that appear mutably/owned in the input.
128
+ MUTATE_CONSENSUS_STREAM_ENDED = 2;
129
+
130
+ // Objects with ended consensus streams objects that appear as read-only in the input.
131
+ READ_CONSENSUS_STREAM_ENDED = 3;
132
+
133
+ // Consensus objects that were congested and resulted in this transaction being
134
+ // canceled.
135
+ CANCELED = 4;
136
+
137
+ // Read of a per-epoch config object that should remain the same during an
138
+ // epoch. This optionally will indicate the sequence number of the config
139
+ // object at the start of the epoch.
140
+ PER_EPOCH_CONFIG = 5;
141
+ }
142
+
143
+ optional UnchangedConsensusObjectKind kind = 1;
144
+
145
+ // ObjectId of the consensus object.
146
+ optional string object_id = 2;
147
+
148
+ // Version of the consensus object.
149
+ optional uint64 version = 3;
150
+
151
+ // Digest of the consensus object.
152
+ optional string digest = 4;
153
+
154
+ // Type information is not provided by the effects structure but is instead
155
+ // provided by an indexing layer
156
+ optional string object_type = 5;
157
+ }
@@ -0,0 +1,34 @@
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/timestamp.proto";
9
+ import "sui/rpc/v2/protocol_config.proto";
10
+ import "sui/rpc/v2/signature.proto";
11
+ import "sui/rpc/v2/system_state.proto";
12
+
13
+ message Epoch {
14
+ optional uint64 epoch = 1;
15
+
16
+ // The committee governing this epoch.
17
+ optional ValidatorCommittee committee = 2;
18
+
19
+ // Snapshot of Sui's SystemState (`0x3::sui_system::SystemState`) at the
20
+ // beginning of the epoch, for past epochs, or the current state for the
21
+ // current epoch.
22
+ optional SystemState system_state = 3;
23
+
24
+ optional uint64 first_checkpoint = 4;
25
+ optional uint64 last_checkpoint = 5;
26
+
27
+ optional google.protobuf.Timestamp start = 6;
28
+ optional google.protobuf.Timestamp end = 7;
29
+
30
+ // Reference gas price denominated in MIST
31
+ optional uint64 reference_gas_price = 8;
32
+
33
+ optional ProtocolConfig protocol_config = 9;
34
+ }
@@ -0,0 +1,12 @@
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
+ enum ErrorReason {
9
+ ERROR_REASON_UNKNOWN = 0;
10
+ FIELD_INVALID = 1;
11
+ FIELD_MISSING = 2;
12
+ }
@@ -0,0 +1,44 @@
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
+ import "sui/rpc/v2/bcs.proto";
10
+
11
+ // Events emitted during the successful execution of a transaction.
12
+ message TransactionEvents {
13
+ // This TransactionEvents serialized as BCS.
14
+ optional Bcs bcs = 1;
15
+
16
+ // The digest of this TransactionEvents.
17
+ optional string digest = 2;
18
+
19
+ // Set of events emitted by a transaction.
20
+ repeated Event events = 3;
21
+ }
22
+
23
+ // An event.
24
+ message Event {
25
+ // Package ID of the top-level function invoked by a `MoveCall` command that triggered this
26
+ // event to be emitted.
27
+ optional string package_id = 1;
28
+
29
+ // Module name of the top-level function invoked by a `MoveCall` command that triggered this
30
+ // event to be emitted.
31
+ optional string module = 2;
32
+
33
+ // Address of the account that sent the transaction where this event was emitted.
34
+ optional string sender = 3;
35
+
36
+ // The type of the event emitted.
37
+ optional string event_type = 4;
38
+
39
+ // BCS serialized bytes of the event.
40
+ optional Bcs contents = 5;
41
+
42
+ // JSON rendering of the event.
43
+ optional google.protobuf.Value json = 6;
44
+ }
@@ -0,0 +1,49 @@
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/timestamp.proto";
9
+ import "sui/rpc/v2/balance_change.proto";
10
+ import "sui/rpc/v2/effects.proto";
11
+ import "sui/rpc/v2/event.proto";
12
+ import "sui/rpc/v2/object.proto";
13
+ import "sui/rpc/v2/signature.proto";
14
+ import "sui/rpc/v2/transaction.proto";
15
+
16
+ message ExecutedTransaction {
17
+ // The digest of this Transaction.
18
+ optional string digest = 1;
19
+
20
+ // The transaction itself.
21
+ optional Transaction transaction = 2;
22
+
23
+ // List of user signatures that are used to authorize the
24
+ // execution of this transaction.
25
+ repeated UserSignature signatures = 3;
26
+
27
+ // The `TransactionEffects` for this transaction.
28
+ optional TransactionEffects effects = 4;
29
+
30
+ // The `TransactionEvents` for this transaction.
31
+ //
32
+ // This field might be empty, even if it was explicitly requested, if the
33
+ // transaction didn't produce any events.
34
+ // `sui.types.TransactionEffects.events_digest` is populated if the
35
+ // transaction produced any events.
36
+ optional TransactionEvents events = 5;
37
+
38
+ // The sequence number for the checkpoint that includes this transaction.
39
+ optional uint64 checkpoint = 6;
40
+
41
+ // The Unix timestamp of the checkpoint that includes this transaction.
42
+ optional google.protobuf.Timestamp timestamp = 7;
43
+
44
+ repeated BalanceChange balance_changes = 8;
45
+
46
+ // Set of objects either referenced as inputs or produced as
47
+ // outputs from this Transaction.
48
+ optional ObjectSet objects = 9;
49
+ }