@clonegod/ttd-sui-common 1.0.5 → 1.0.7

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 (73) hide show
  1. package/dist/grpc/protos/google/protobuf/any.proto +162 -0
  2. package/dist/grpc/protos/google/protobuf/duration.proto +115 -0
  3. package/dist/grpc/protos/google/protobuf/empty.proto +51 -0
  4. package/dist/grpc/protos/google/protobuf/field_mask.proto +245 -0
  5. package/dist/grpc/protos/google/protobuf/struct.proto +95 -0
  6. package/dist/grpc/protos/google/protobuf/timestamp.proto +144 -0
  7. package/dist/grpc/protos/google/rpc/error_details.proto +363 -0
  8. package/dist/grpc/protos/google/rpc/status.proto +49 -0
  9. package/dist/grpc/protos/sui/rpc/v2beta2/README.md +123 -0
  10. package/dist/grpc/protos/sui/rpc/v2beta2/argument.proto +34 -0
  11. package/dist/grpc/protos/sui/rpc/v2beta2/balance_change.proto +18 -0
  12. package/dist/grpc/protos/sui/rpc/v2beta2/bcs.proto +17 -0
  13. package/dist/grpc/protos/sui/rpc/v2beta2/checkpoint.proto +32 -0
  14. package/dist/grpc/protos/sui/rpc/v2beta2/checkpoint_contents.proto +34 -0
  15. package/dist/grpc/protos/sui/rpc/v2beta2/checkpoint_summary.proto +102 -0
  16. package/dist/grpc/protos/sui/rpc/v2beta2/effects.proto +154 -0
  17. package/dist/grpc/protos/sui/rpc/v2beta2/epoch.proto +34 -0
  18. package/dist/grpc/protos/sui/rpc/v2beta2/error_reason.proto +12 -0
  19. package/dist/grpc/protos/sui/rpc/v2beta2/event.proto +44 -0
  20. package/dist/grpc/protos/sui/rpc/v2beta2/executed_transaction.proto +51 -0
  21. package/dist/grpc/protos/sui/rpc/v2beta2/execution_status.proto +374 -0
  22. package/dist/grpc/protos/sui/rpc/v2beta2/gas_cost_summary.proto +19 -0
  23. package/dist/grpc/protos/sui/rpc/v2beta2/input.proto +55 -0
  24. package/dist/grpc/protos/sui/rpc/v2beta2/ledger_service.proto +165 -0
  25. package/dist/grpc/protos/sui/rpc/v2beta2/live_data_service.proto +298 -0
  26. package/dist/grpc/protos/sui/rpc/v2beta2/move_package.proto +238 -0
  27. package/dist/grpc/protos/sui/rpc/v2beta2/move_package_service.proto +91 -0
  28. package/dist/grpc/protos/sui/rpc/v2beta2/object.proto +62 -0
  29. package/dist/grpc/protos/sui/rpc/v2beta2/object_reference.proto +16 -0
  30. package/dist/grpc/protos/sui/rpc/v2beta2/owner.proto +25 -0
  31. package/dist/grpc/protos/sui/rpc/v2beta2/protocol_config.proto +12 -0
  32. package/dist/grpc/protos/sui/rpc/v2beta2/signature.proto +232 -0
  33. package/dist/grpc/protos/sui/rpc/v2beta2/signature_scheme.proto +22 -0
  34. package/dist/grpc/protos/sui/rpc/v2beta2/signature_verification_service.proto +49 -0
  35. package/dist/grpc/protos/sui/rpc/v2beta2/subscription_service.proto +41 -0
  36. package/dist/grpc/protos/sui/rpc/v2beta2/system_state.proto +340 -0
  37. package/dist/grpc/protos/sui/rpc/v2beta2/transaction.proto +494 -0
  38. package/dist/grpc/protos/sui/rpc/v2beta2/transaction_execution_service.proto +53 -0
  39. package/dist/index.d.ts +2 -0
  40. package/dist/index.js +2 -0
  41. package/dist/parsed_swap_transactions_2025-08-30T12-11-48-744Z.json +19215 -0
  42. package/dist/parsed_swap_transactions_2025-08-30T12-51-39-586Z.json +19309 -0
  43. package/dist/parsed_swap_transactions_2025-08-30T13-58-34-579Z.json +19005 -0
  44. package/dist/swap_transactions_2025-08-30T12-05-49-140Z.json +1384 -0
  45. package/dist/swap_transactions_2025-08-30T12-05-51-529Z.json +2907 -0
  46. package/dist/swap_transactions_2025-08-30T12-05-54-042Z.json +13392 -0
  47. package/dist/swap_transactions_2025-08-30T12-05-56-880Z.json +16210 -0
  48. package/dist/swap_transactions_2025-08-30T12-05-59-588Z.json +17993 -0
  49. package/dist/swap_transactions_2025-08-30T12-05-59-597Z.json +17993 -0
  50. package/dist/test/test_checkpoint_processor.d.ts +1 -0
  51. package/dist/test/test_checkpoint_processor.js +112 -0
  52. package/dist/test/test_checkpoint_subscription.d.ts +1 -0
  53. package/dist/test/test_checkpoint_subscription.js +132 -0
  54. package/dist/test/test_grpc.js +1 -1
  55. package/dist/test/test_momentum_events.d.ts +1 -0
  56. package/dist/test/test_momentum_events.js +113 -0
  57. package/dist/test/test_single_momentum_event.d.ts +1 -0
  58. package/dist/test/test_single_momentum_event.js +44 -0
  59. package/dist/type/index.d.ts +45 -0
  60. package/dist/type/index.js +2 -0
  61. package/dist/utils/bcs-parser.d.ts +8 -0
  62. package/dist/utils/bcs-parser.js +121 -0
  63. package/dist/utils/checkpoint-processor.d.ts +7 -0
  64. package/dist/utils/checkpoint-processor.js +123 -0
  65. package/dist/utils/checkpoint_parse.d.ts +26 -0
  66. package/dist/utils/checkpoint_parse.js +277 -0
  67. package/dist/utils/decode.d.ts +2 -0
  68. package/dist/utils/decode.js +43 -0
  69. package/dist/utils/dex-parser-manager.d.ts +7 -0
  70. package/dist/utils/dex-parser-manager.js +138 -0
  71. package/dist/utils/index.d.ts +2 -2
  72. package/dist/utils/index.js +16 -41
  73. package/package.json +4 -2
@@ -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.v2beta2;
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.v2beta2;
7
+
8
+ message ProtocolConfig {
9
+ optional uint64 protocol_version = 1;
10
+ map<string, bool> feature_flags = 2;
11
+ map<string, string> attributes = 3;
12
+ }
@@ -0,0 +1,232 @@
1
+ // Copyright (c) Mysten Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ syntax = "proto3";
5
+
6
+ package sui.rpc.v2beta2;
7
+
8
+ import "sui/rpc/v2beta2/bcs.proto";
9
+ import "sui/rpc/v2beta2/signature_scheme.proto";
10
+
11
+ // A signature from a user.
12
+ message UserSignature {
13
+ // This signature serialized as as BCS.
14
+ //
15
+ // When provided as input this will support both the form that is length
16
+ // prefixed as well as not length prefixed.
17
+ optional Bcs bcs = 1;
18
+
19
+ // The signature scheme of this signature.
20
+ optional SignatureScheme scheme = 2;
21
+
22
+ oneof signature {
23
+ // Simple signature if scheme is ed25519 | secp256k1 | secp256r1.
24
+ SimpleSignature simple = 3;
25
+
26
+ // The multisig aggregated signature if scheme is `MULTISIG`.
27
+ MultisigAggregatedSignature multisig = 4;
28
+
29
+ // The zklogin authenticator if scheme is `ZKLOGIN`.
30
+ ZkLoginAuthenticator zklogin = 5;
31
+
32
+ // The passkey authenticator if scheme is `PASSKEY`.
33
+ PasskeyAuthenticator passkey = 6;
34
+ }
35
+ }
36
+
37
+ // Either an ed25519, secp256k1 or secp256r1 signature
38
+ message SimpleSignature {
39
+ // The signature scheme of this signature.
40
+ optional SignatureScheme scheme = 1;
41
+
42
+ // Signature bytes
43
+ optional bytes signature = 2;
44
+
45
+ // Public key bytes
46
+ optional bytes public_key = 3;
47
+ }
48
+
49
+ // Public key equivalent for zklogin authenticators.
50
+ message ZkLoginPublicIdentifier {
51
+ optional string iss = 1;
52
+ // base10 encoded Bn254FieldElement
53
+ optional string address_seed = 2;
54
+ }
55
+
56
+ // Set of valid public keys for multisig committee members.
57
+ message MultisigMemberPublicKey {
58
+ // The signature scheme of this public key.
59
+ optional SignatureScheme scheme = 1;
60
+
61
+ // Public key bytes if scheme is ed25519 | secp256k1 | secp256r1 | passkey.
62
+ optional bytes public_key = 2;
63
+
64
+ // A zklogin public identifier if scheme is zklogin.
65
+ optional ZkLoginPublicIdentifier zklogin = 3;
66
+ }
67
+
68
+ // A member in a multisig committee.
69
+ message MultisigMember {
70
+ // The public key of the committee member.
71
+ optional MultisigMemberPublicKey public_key = 1;
72
+ // The weight of this member's signature.
73
+ optional uint32 weight = 2;
74
+ }
75
+
76
+ // A multisig committee.
77
+ message MultisigCommittee {
78
+ // A list of committee members and their corresponding weight.
79
+ repeated MultisigMember members = 1;
80
+ // The threshold of signatures needed to validate a signature from
81
+ // this committee.
82
+ optional uint32 threshold = 2;
83
+ }
84
+
85
+ // Aggregated signature from members of a multisig committee.
86
+ message MultisigAggregatedSignature {
87
+ // The plain signatures encoded with signature scheme.
88
+ //
89
+ // The signatures must be in the same order as they are listed in the committee.
90
+ repeated MultisigMemberSignature signatures = 1;
91
+
92
+ // Bitmap indicating which committee members contributed to the
93
+ // signature.
94
+ optional uint32 bitmap = 2;
95
+ // If present, means this signature's on-chain format uses the old
96
+ // legacy multisig format.
97
+ repeated uint32 legacy_bitmap = 3;
98
+ // The committee to use to validate this signature.
99
+ optional MultisigCommittee committee = 4;
100
+ }
101
+
102
+ // A signature from a member of a multisig committee.
103
+ message MultisigMemberSignature {
104
+ // The signature scheme of this signature.
105
+ optional SignatureScheme scheme = 1;
106
+
107
+ // Signature bytes if scheme is ed25519 | secp256k1 | secp256r1.
108
+ optional bytes signature = 2;
109
+
110
+ // The zklogin authenticator if scheme is `ZKLOGIN`.
111
+ optional ZkLoginAuthenticator zklogin = 3;
112
+
113
+ // The passkey authenticator if scheme is `PASSKEY`.
114
+ optional PasskeyAuthenticator passkey = 4;
115
+ }
116
+
117
+ // A zklogin authenticator.
118
+ message ZkLoginAuthenticator {
119
+ // Zklogin proof and inputs required to perform proof verification.
120
+ optional ZkLoginInputs inputs = 1;
121
+ // Maximum epoch for which the proof is valid.
122
+ optional uint64 max_epoch = 2;
123
+ // User signature with the public key attested to by the provided proof.
124
+ optional SimpleSignature signature = 3;
125
+ }
126
+
127
+ // A zklogin groth16 proof and the required inputs to perform proof verification.
128
+ message ZkLoginInputs {
129
+ optional ZkLoginProof proof_points = 1;
130
+ optional ZkLoginClaim iss_base64_details = 2;
131
+ optional string header_base64 = 3;
132
+ // base10 encoded Bn254FieldElement
133
+ optional string address_seed = 4;
134
+ }
135
+
136
+ // A zklogin groth16 proof.
137
+ message ZkLoginProof {
138
+ optional CircomG1 a = 1;
139
+ optional CircomG2 b = 2;
140
+ optional CircomG1 c = 3;
141
+ }
142
+
143
+ // A claim of the iss in a zklogin proof.
144
+ message ZkLoginClaim {
145
+ optional string value = 1;
146
+ optional uint32 index_mod_4 = 2;
147
+ }
148
+
149
+ // A G1 point.
150
+ message CircomG1 {
151
+ // base10 encoded Bn254FieldElement
152
+ optional string e0 = 1;
153
+ // base10 encoded Bn254FieldElement
154
+ optional string e1 = 2;
155
+ // base10 encoded Bn254FieldElement
156
+ optional string e2 = 3;
157
+ }
158
+
159
+ // A G2 point.
160
+ message CircomG2 {
161
+ // base10 encoded Bn254FieldElement
162
+ optional string e00 = 1;
163
+ // base10 encoded Bn254FieldElement
164
+ optional string e01 = 2;
165
+
166
+ // base10 encoded Bn254FieldElement
167
+ optional string e10 = 3;
168
+ // base10 encoded Bn254FieldElement
169
+ optional string e11 = 4;
170
+
171
+ // base10 encoded Bn254FieldElement
172
+ optional string e20 = 5;
173
+ // base10 encoded Bn254FieldElement
174
+ optional string e21 = 6;
175
+ }
176
+
177
+ // A passkey authenticator.
178
+ //
179
+ // See
180
+ // [struct.PasskeyAuthenticator](https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/struct.PasskeyAuthenticator.html#bcs)
181
+ // for more information on the requirements on the shape of the
182
+ // `client_data_json` field.
183
+ message PasskeyAuthenticator {
184
+ // Opaque authenticator data for this passkey signature.
185
+ //
186
+ // See [Authenticator Data](https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data) for
187
+ // more information on this field.
188
+ optional bytes authenticator_data = 1;
189
+
190
+ // Structured, unparsed, JSON for this passkey signature.
191
+ //
192
+ // See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata)
193
+ // for more information on this field.
194
+ optional string client_data_json = 2;
195
+
196
+ // A secp256r1 signature.
197
+ optional SimpleSignature signature = 3;
198
+ }
199
+
200
+ // The validator set for a particular epoch.
201
+ message ValidatorCommittee {
202
+ // The epoch where this committee governs.
203
+ optional uint64 epoch = 1;
204
+
205
+ // The committee members.
206
+ repeated ValidatorCommitteeMember members = 2;
207
+ }
208
+
209
+ // A member of a validator committee.
210
+ message ValidatorCommitteeMember {
211
+ // The 96-byte Bls12381 public key for this validator.
212
+ optional bytes public_key = 1;
213
+
214
+ // voting weight this validator possesses.
215
+ optional uint64 weight = 2;
216
+ }
217
+
218
+ /// An aggregated signature from multiple validators.
219
+ message ValidatorAggregatedSignature {
220
+ // The epoch when this signature was produced.
221
+ //
222
+ // This can be used to lookup the `ValidatorCommittee` from this epoch
223
+ // to verify this signature.
224
+ optional uint64 epoch = 1;
225
+
226
+ // The 48-byte Bls12381 aggregated signature.
227
+ optional bytes signature = 2;
228
+
229
+ // Bitmap indicating which members of the committee contributed to
230
+ // this signature.
231
+ repeated uint32 bitmap = 3;
232
+ }
@@ -0,0 +1,22 @@
1
+ // Copyright (c) Mysten Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ syntax = "proto3";
5
+
6
+ package sui.rpc.v2beta2;
7
+
8
+ // Flag use to disambiguate the signature schemes supported by Sui.
9
+ //
10
+ // Note: the enum values defined by this proto message exactly match their
11
+ // expected BCS serialized values when serialized as a u8. See
12
+ // [enum.SignatureScheme](https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/enum.SignatureScheme.html)
13
+ // for more information about signature schemes.
14
+ enum SignatureScheme {
15
+ ED25519 = 0;
16
+ SECP256K1 = 1;
17
+ SECP256R1 = 2;
18
+ MULTISIG = 3;
19
+ BLS12381 = 4;
20
+ ZKLOGIN = 5;
21
+ PASSKEY = 6;
22
+ }
@@ -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.v2beta2;
7
+
8
+ import "sui/rpc/v2beta2/bcs.proto";
9
+ import "sui/rpc/v2beta2/signature.proto";
10
+ import "sui/rpc/v2beta2/transaction.proto";
11
+
12
+ service SignatureVerificationService {
13
+ // Perform signature verification of a UserSignature against the provided message.
14
+ rpc VerifySignature(VerifySignatureRequest) returns (VerifySignatureResponse);
15
+ }
16
+
17
+ message VerifySignatureRequest {
18
+ // The message to verify against.
19
+ //
20
+ // Today the only supported message types are `PersonalMessage` and
21
+ // `TransactionData` and the `Bcs.name` must be set to indicate which type of
22
+ // message is being verified.
23
+ optional Bcs message = 1;
24
+
25
+ // The siganture to verify.
26
+ optional UserSignature signature = 2;
27
+
28
+ // Optional. Address to validate against the provided signature.
29
+ //
30
+ // If provided, this address will be compared against the the address derived
31
+ // from the provide signature and a successful response will only be returned
32
+ // if they match.
33
+ optional string address = 3;
34
+
35
+ // The set of JWKs to use when verifying Zklogin signatures.
36
+ // If this is empty the current set of valid JWKs stored onchain will be used
37
+ repeated ActiveJwk jwks = 4;
38
+
39
+ // The epoch to use
40
+ // optional uint64 epoch = 5;
41
+ }
42
+
43
+ message VerifySignatureResponse {
44
+ // Indicates if the provided signature was valid given the requested parameters.
45
+ optional bool is_valid = 1;
46
+
47
+ // If `is_valid` is `false`, this is the reason for why the signature verification failed.
48
+ optional string reason = 2;
49
+ }
@@ -0,0 +1,41 @@
1
+ // Copyright (c) Mysten Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ syntax = "proto3";
5
+
6
+ package sui.rpc.v2beta2;
7
+
8
+ import "google/protobuf/field_mask.proto";
9
+ import "sui/rpc/v2beta2/checkpoint.proto";
10
+
11
+ service SubscriptionService {
12
+ // Subscribe to the stream of checkpoints.
13
+ //
14
+ // This API provides a subscription to the checkpoint stream for the Sui
15
+ // blockchain. When a subscription is initialized the stream will begin with
16
+ // the latest executed checkpoint as seen by the server. Responses are
17
+ // guaranteed to return checkpoints in-order and without gaps. This enables
18
+ // clients to know exactly the last checkpoint they have processed and in the
19
+ // event the subscription terminates (either by the client/server or by the
20
+ // connection breaking), clients will be able to reinitailize a subscription
21
+ // and then leverage other APIs in order to request data for the checkpoints
22
+ // they missed.
23
+ rpc SubscribeCheckpoints(SubscribeCheckpointsRequest) returns (stream SubscribeCheckpointsResponse);
24
+ }
25
+
26
+ // Request message for SubscriptionService.SubscribeCheckpoints
27
+ message SubscribeCheckpointsRequest {
28
+ // Optional. Mask for specifiying which parts of the
29
+ // SubscribeCheckpointsResponse should be returned.
30
+ optional google.protobuf.FieldMask read_mask = 1;
31
+ }
32
+
33
+ // Response message for SubscriptionService.SubscribeCheckpoints
34
+ message SubscribeCheckpointsResponse {
35
+ // Required. The checkpoint sequence number and value of the current cursor
36
+ // into the checkpoint stream
37
+ optional uint64 cursor = 1;
38
+
39
+ // The requested data for this checkpoint
40
+ optional Checkpoint checkpoint = 2;
41
+ }