@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,238 @@
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
+ // A Move Package
9
+ message Package {
10
+ // The PackageId of this package
11
+ //
12
+ // A package's `storage_id` is the Sui ObjectId of the package on-chain.
13
+ // Outside of system packages the `storage_id` for every package version is
14
+ // different.
15
+ optional string storage_id = 1;
16
+
17
+ // The PackageId of the first published version of this package.
18
+ //
19
+ // A package's `original_id` (sometimes also called its `runtime_id`) is the
20
+ // `storage_id` of the first version of this package that has been published.
21
+ // The `original_id`/`runtime_id` is stable across all versions of the
22
+ // package and does not ever change.
23
+ optional string original_id = 2;
24
+
25
+ // The version of this package
26
+ optional uint64 version = 3;
27
+
28
+ // The modules defined by this package
29
+ repeated Module modules = 4;
30
+
31
+ // List of datatype origins for mapping datatypes to a package version where
32
+ // it was first defined
33
+ repeated TypeOrigin type_origins = 5;
34
+
35
+ // The package's transitive dependencies as a mapping from the package's
36
+ // runtime Id (the Id it is referred to by in other packages) to its
37
+ // storage Id (the Id it is loaded from on chain).
38
+ repeated Linkage linkage = 6;
39
+ }
40
+
41
+ // A Move Module.
42
+ message Module {
43
+ // Name of this module.
44
+ optional string name = 1;
45
+
46
+ // Serialized bytecode of the module.
47
+ optional bytes contents = 2;
48
+
49
+ // List of DataTypes defined by this module.
50
+ repeated DatatypeDescriptor datatypes = 3;
51
+
52
+ // List of Functions defined by this module.
53
+ repeated FunctionDescriptor functions = 4;
54
+
55
+ // List of Constants defined by this module.
56
+ // repeated Constant constants = 5;
57
+ }
58
+
59
+ // Describes a Move Datatype.
60
+ message DatatypeDescriptor {
61
+ // Fully qualified name of this Datatype.
62
+ //
63
+ // This is `<defining_id>::<module>::<name>`
64
+ optional string type_name = 1;
65
+
66
+ // PackageId of the package where this Datatype is defined.
67
+ //
68
+ // A type's `defining_id` is the `storage_id` of the package version that first introduced or added that type.
69
+ optional string defining_id = 2;
70
+
71
+ // Name of the module where this Datatype is defined
72
+ optional string module = 3;
73
+
74
+ // Name of this Datatype
75
+ optional string name = 4;
76
+
77
+ // This type's abilities
78
+ repeated Ability abilities = 5;
79
+
80
+ // Ability constraints and phantom status for this type's generic type parameters
81
+ repeated TypeParameter type_parameters = 6;
82
+
83
+ enum DatatypeKind {
84
+ DATATYPE_KIND_UNKNOWN = 0;
85
+ STRUCT = 1;
86
+ ENUM = 2;
87
+ }
88
+
89
+ // Indicates whether this datatype is a 'STRUCT' or an 'ENUM'
90
+ optional DatatypeKind kind = 7;
91
+
92
+ // Set of fields if this Datatype is a struct.
93
+ //
94
+ // The order of the entries is the order of how the fields are defined.
95
+ repeated FieldDescriptor fields = 8;
96
+
97
+ // Set of variants if this Datatype is an enum.
98
+ //
99
+ // The order of the entries is the order of how the variants are defined.
100
+ repeated VariantDescriptor variants = 9;
101
+ }
102
+
103
+ // An `Ability` classifies what operations are permitted for a given type
104
+ enum Ability {
105
+ ABILITY_UNKNOWN = 0;
106
+
107
+ // Allows values of types with this ability to be copied
108
+ COPY = 1;
109
+
110
+ // Allows values of types with this ability to be dropped.
111
+ DROP = 2;
112
+
113
+ // Allows values of types with this ability to exist inside a struct in global storage
114
+ STORE = 3;
115
+
116
+ // Allows the type to serve as a key for global storage operations
117
+ KEY = 4;
118
+ }
119
+
120
+ // A generic type parameter used in the declaration of a struct or enum.
121
+ message TypeParameter {
122
+ // The type parameter constraints
123
+ repeated Ability constraints = 1;
124
+
125
+ // Whether the parameter is declared as phantom
126
+ optional bool is_phantom = 2;
127
+ }
128
+
129
+ // Descriptor of a field that belongs to a struct or enum variant
130
+ message FieldDescriptor {
131
+ // Name of the field
132
+ optional string name = 1;
133
+
134
+ // Order or position of the field in the struct or enum variant definition.
135
+ optional uint32 position = 2;
136
+
137
+ // The type of the field
138
+ optional OpenSignatureBody type = 3;
139
+ }
140
+
141
+ // Descriptor of an enum variant
142
+ message VariantDescriptor {
143
+ // Name of the variant
144
+ optional string name = 1;
145
+
146
+ // Order or position of the variant in the enum definition.
147
+ optional uint32 position = 2;
148
+
149
+ // Set of fields defined by this variant.
150
+ repeated FieldDescriptor fields = 3;
151
+ }
152
+
153
+ // Representation of a type signature that could appear as a field type for a struct or enum
154
+ message OpenSignatureBody {
155
+ enum Type {
156
+ TYPE_UNKNOWN = 0;
157
+ ADDRESS = 1;
158
+ BOOL = 2;
159
+ U8 = 3;
160
+ U16 = 4;
161
+ U32 = 5;
162
+ U64 = 6;
163
+ U128 = 7;
164
+ U256 = 8;
165
+ VECTOR = 9;
166
+ DATATYPE = 10;
167
+ TYPE_PARAMETER = 11;
168
+ }
169
+
170
+ // Type of this signature
171
+ optional Type type = 1;
172
+
173
+ // Fully qualified name of the datatype when `type` is `DATATYPE`
174
+ optional string type_name = 2;
175
+
176
+ // Set when `type` is `VECTOR` or `DATATYPE`
177
+ repeated OpenSignatureBody type_parameter_instantiation = 3;
178
+
179
+ // Position of the type parameter as defined in the containing data type descriptor when `type` is `TYPE_PARAMETER`
180
+ optional uint32 type_parameter = 4;
181
+ }
182
+
183
+ // Descriptor of a Move function
184
+ message FunctionDescriptor {
185
+ // Name of the function
186
+ optional string name = 1;
187
+
188
+ enum Visibility {
189
+ VISIBILITY_UNKNOWN = 0;
190
+ PRIVATE = 1;
191
+ PUBLIC = 2;
192
+ FRIEND = 3;
193
+ }
194
+
195
+ // Whether the function is `public`, `private` or `public(friend)`
196
+ optional Visibility visibility = 5;
197
+
198
+ // Whether the function is marked `entry` or not.
199
+ optional bool is_entry = 6;
200
+
201
+ // Ability constraints for type parameters
202
+ repeated TypeParameter type_parameters = 7;
203
+
204
+ // Formal parameter types.
205
+ repeated OpenSignature parameters = 8;
206
+
207
+ // Return types.
208
+ repeated OpenSignature returns = 9;
209
+ }
210
+
211
+ // Representation of a type signature that could appear as a function parameter or return value.
212
+ message OpenSignature {
213
+ enum Reference {
214
+ REFERENCE_UNKNOWN = 0;
215
+ IMMUTABLE = 1;
216
+ MUTABLE = 2;
217
+ }
218
+
219
+ optional Reference reference = 1;
220
+ optional OpenSignatureBody body = 2;
221
+ }
222
+
223
+ // Identifies a struct and the module it was defined in.
224
+ message TypeOrigin {
225
+ optional string module_name = 1;
226
+ optional string datatype_name = 2;
227
+ optional string package_id = 3;
228
+ }
229
+
230
+ // Upgraded package info for the linkage table.
231
+ message Linkage {
232
+ // Id of the original package.
233
+ optional string original_id = 1;
234
+ // Id of the upgraded package.
235
+ optional string upgraded_id = 2;
236
+ // Version of the upgraded package.
237
+ optional uint64 upgraded_version = 3;
238
+ }
@@ -0,0 +1,91 @@
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/move_package.proto";
9
+
10
+ service MovePackageService {
11
+ rpc GetPackage(GetPackageRequest) returns (GetPackageResponse);
12
+ rpc GetDatatype(GetDatatypeRequest) returns (GetDatatypeResponse);
13
+ rpc GetFunction(GetFunctionRequest) returns (GetFunctionResponse);
14
+ rpc ListPackageVersions(ListPackageVersionsRequest) returns (ListPackageVersionsResponse);
15
+ }
16
+
17
+ message GetPackageRequest {
18
+ // Required. The `storage_id` of the requested package.
19
+ optional string package_id = 1;
20
+ }
21
+
22
+ message GetPackageResponse {
23
+ // The package.
24
+ optional Package package = 1;
25
+ }
26
+
27
+ message GetDatatypeRequest {
28
+ // Required. The `storage_id` of the requested package.
29
+ optional string package_id = 1;
30
+
31
+ // Required. The name of the requested module.
32
+ optional string module_name = 2;
33
+
34
+ // Required. The name of the requested datatype.
35
+ optional string name = 3;
36
+ }
37
+
38
+ message GetDatatypeResponse {
39
+ // The datatype.
40
+ optional DatatypeDescriptor datatype = 1;
41
+ }
42
+
43
+ message GetFunctionRequest {
44
+ // Required. The `storage_id` of the requested package.
45
+ optional string package_id = 1;
46
+
47
+ // Required. The name of the requested module.
48
+ optional string module_name = 2;
49
+
50
+ // Required. The name of the requested function.
51
+ optional string name = 3;
52
+ }
53
+
54
+ message GetFunctionResponse {
55
+ // The function.
56
+ optional FunctionDescriptor function = 1;
57
+ }
58
+
59
+ message ListPackageVersionsRequest {
60
+ // Required. The `storage_id` of any version of the package.
61
+ optional string package_id = 1;
62
+
63
+ // The maximum number of versions to return. The service may return fewer than this value.
64
+ // If unspecified, at most `1000` entries will be returned.
65
+ // The maximum value is `10000`; values above `10000` will be coerced to `10000`.
66
+ optional uint32 page_size = 2;
67
+
68
+ // A page token, received from a previous `ListPackageVersions` call.
69
+ // Provide this to retrieve the subsequent page.
70
+ //
71
+ // When paginating, all other parameters provided to `ListPackageVersions` must
72
+ // match the call that provided the page token.
73
+ optional bytes page_token = 3;
74
+ }
75
+
76
+ message ListPackageVersionsResponse {
77
+ // List of all package versions, ordered by version.
78
+ repeated PackageVersion versions = 1;
79
+
80
+ // A token, which can be sent as `page_token` to retrieve the next page.
81
+ // If this field is omitted, there are no subsequent pages.
82
+ optional bytes next_page_token = 2;
83
+ }
84
+
85
+ // A simplified representation of a package version
86
+ message PackageVersion {
87
+ // The storage ID of this package version
88
+ optional string package_id = 1;
89
+ // The version number
90
+ optional uint64 version = 2;
91
+ }
@@ -0,0 +1,67 @@
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
+
10
+ service NameService {
11
+ rpc LookupName(LookupNameRequest) returns (LookupNameResponse);
12
+ rpc ReverseLookupName(ReverseLookupNameRequest) returns (ReverseLookupNameResponse);
13
+ }
14
+
15
+ message LookupNameRequest {
16
+ // Required. The SuiNS name to lookup.
17
+ //
18
+ // Supports both `@name` as well as `name.sui` formats.
19
+ optional string name = 1;
20
+ }
21
+
22
+ message LookupNameResponse {
23
+ // The record for the requested name
24
+ optional NameRecord record = 1;
25
+ }
26
+
27
+ message ReverseLookupNameRequest {
28
+ // Required. The address to perform a reverse lookup for.
29
+ optional string address = 1;
30
+ }
31
+
32
+ message ReverseLookupNameResponse {
33
+ // The record for the SuiNS name linked to the requested address
34
+ optional NameRecord record = 1;
35
+ }
36
+
37
+ message NameRecord {
38
+ // Id of this record.
39
+ //
40
+ // Note that records are stored on chain as dynamic fields of the type
41
+ // `Field<Domain,NameRecord>`.
42
+ optional string id = 1;
43
+
44
+ // The SuiNS name of this record
45
+ optional string name = 2;
46
+
47
+ // The ID of the `RegistrationNFT` assigned to this record.
48
+ //
49
+ // The owner of the corresponding `RegistrationNFT` has the rights to
50
+ // be able to change and adjust the `target_address` of this domain.
51
+ //
52
+ // It is possible that the ID changes if the record expires and is
53
+ // purchased by someone else.
54
+ optional string registration_nft_id = 3;
55
+
56
+ // Timestamp when the record expires.
57
+ //
58
+ // This is either the expiration of the record itself or the expiration of
59
+ // this record's parent if this is a leaf record.
60
+ optional google.protobuf.Timestamp expiration_timestamp = 4;
61
+
62
+ // The target address that this name points to
63
+ optional string target_address = 5;
64
+
65
+ // Additional data which may be stored in a record
66
+ map<string, string> data = 6;
67
+ }
@@ -0,0 +1,68 @@
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
+ import "sui/rpc/v2/move_package.proto";
11
+ import "sui/rpc/v2/owner.proto";
12
+
13
+ // An object on the Sui blockchain.
14
+ message Object {
15
+ // This Object serialized as BCS.
16
+ optional Bcs bcs = 1;
17
+
18
+ // `ObjectId` for this object.
19
+ optional string object_id = 2;
20
+
21
+ // Version of the object.
22
+ optional uint64 version = 3;
23
+
24
+ // The digest of this Object.
25
+ optional string digest = 4;
26
+
27
+ // Owner of the object.
28
+ optional Owner owner = 5;
29
+
30
+ // The type of this object.
31
+ //
32
+ // This will be 'package' for packages and a StructTag for move structs.
33
+ optional string object_type = 6;
34
+
35
+ // DEPRECATED this field is no longer used to determine whether a tx can transfer this
36
+ // object. Instead, it is always calculated from the objects type when loaded in execution.
37
+ //
38
+ // Only set for Move structs
39
+ optional bool has_public_transfer = 7;
40
+
41
+ // BCS bytes of a Move struct value.
42
+ //
43
+ // Only set for Move structs
44
+ optional Bcs contents = 8;
45
+
46
+ // Package information for Move Packages
47
+ optional Package package = 9;
48
+
49
+ // The digest of the transaction that created or last mutated this object
50
+ optional string previous_transaction = 10;
51
+
52
+ // The amount of SUI to rebate if this object gets deleted.
53
+ // This number is re-calculated each time the object is mutated based on
54
+ // the present storage gas price.
55
+ optional uint64 storage_rebate = 11;
56
+
57
+ // JSON rendering of the object.
58
+ optional google.protobuf.Value json = 100;
59
+
60
+ // Current balance if this object is a `0x2::coin::Coin<T>`
61
+ optional uint64 balance = 101;
62
+ }
63
+
64
+ // Set of Objects
65
+ message ObjectSet {
66
+ // Objects are sorted by the key `(object_id, version)`.
67
+ repeated Object objects = 1;
68
+ }
@@ -0,0 +1,16 @@
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
+ // Reference to an object.
9
+ message ObjectReference {
10
+ // The object id of this object.
11
+ optional string object_id = 1;
12
+ // The version of this object.
13
+ optional uint64 version = 2;
14
+ // The digest of this object.
15
+ optional string digest = 3;
16
+ }
@@ -0,0 +1,25 @@
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 of different types of ownership for an object.
9
+ message Owner {
10
+ enum OwnerKind {
11
+ OWNER_KIND_UNKNOWN = 0;
12
+ ADDRESS = 1;
13
+ OBJECT = 2;
14
+ SHARED = 3;
15
+ IMMUTABLE = 4;
16
+ CONSENSUS_ADDRESS = 5;
17
+ }
18
+ optional OwnerKind kind = 1;
19
+
20
+ // Address or ObjectId of the owner
21
+ optional string address = 2;
22
+
23
+ // The `initial_shared_version` if kind is `SHARED` or `start_version` if kind `CONSENSUS_ADDRESS`.
24
+ optional uint64 version = 3;
25
+ }
@@ -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
+ message ProtocolConfig {
9
+ optional uint64 protocol_version = 1;
10
+ map<string, bool> feature_flags = 2;
11
+ map<string, string> attributes = 3;
12
+ }