@clonegod/ttd-sui-common 1.0.95 → 1.0.96

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.
@@ -91,6 +91,7 @@ message ChangedObject {
91
91
  OUTPUT_OBJECT_STATE_DOES_NOT_EXIST = 1;
92
92
  OUTPUT_OBJECT_STATE_OBJECT_WRITE = 2;
93
93
  OUTPUT_OBJECT_STATE_PACKAGE_WRITE = 3;
94
+ OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE = 4;
94
95
  }
95
96
 
96
97
  optional OutputObjectState output_state = 6;
@@ -100,6 +101,8 @@ message ChangedObject {
100
101
  optional string output_digest = 8;
101
102
  // Owner of the object after this transaction executed.
102
103
  optional Owner output_owner = 9;
104
+ // The contents of the accumulator write when `output_state` is `OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE`
105
+ optional AccumulatorWrite accumulator_write = 12;
103
106
 
104
107
  enum IdOperation {
105
108
  ID_OPERATION_UNKNOWN = 0;
@@ -116,6 +119,28 @@ message ChangedObject {
116
119
  optional string object_type = 11;
117
120
  }
118
121
 
122
+ message AccumulatorWrite {
123
+ optional string address = 1;
124
+ optional string accumulator_type = 2;
125
+
126
+ enum AccumulatorOperation {
127
+ ACCUMULATOR_OPERATION_UNKNOWN = 0;
128
+ MERGE = 1;
129
+ SPLIT = 2;
130
+ }
131
+
132
+ optional AccumulatorOperation operation = 3;
133
+
134
+ // enum AccumulatorValue {
135
+ // ACCUMULATOR_VALUE_UNKNOWN = 0;
136
+ // INTEGER = 1;
137
+ // }
138
+ // optional AccumulatorValue value_kind = 4;
139
+ reserved 4; // AccumulatorValueKind
140
+
141
+ optional uint64 value = 5;
142
+ }
143
+
119
144
  // A consensus object that wasn't changed during execution.
120
145
  message UnchangedConsensusObject {
121
146
  enum UnchangedConsensusObjectKind {
@@ -166,11 +166,24 @@ message ExecutionError {
166
166
  // Certificate is canceled because randomness could not be generated this epoch.
167
167
  EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE = 37;
168
168
 
169
+ // Move vector element (passed to MakeMoveVec) with size {value_size} is larger \
170
+ // than the maximum size {max_scaled_size}. Note that this maximum is scaled based on the \
171
+ // type of the vector element.
169
172
  MOVE_VECTOR_ELEM_TOO_BIG = 38;
170
173
 
174
+ // Move value (possibly an upgrade ticket or a dev-inspect value) with size {value_size} \
175
+ // is larger than the maximum size {max_scaled_size}. Note that this maximum is scaled based \
176
+ // on the type of the value.
171
177
  MOVE_RAW_VALUE_TOO_BIG = 39;
172
178
 
179
+ // A valid linkage was unable to be determined for the transaction or one of its commands.
173
180
  INVALID_LINKAGE = 40;
181
+
182
+ // Insufficient balance for transaction withdrawal
183
+ INSUFFICIENT_BALANCE_FOR_WITHDRAW = 41;
184
+
185
+ // An input object with non-exclusive write mutability was modified
186
+ NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED = 42;
174
187
  }
175
188
 
176
189
  optional ExecutionErrorKind kind = 3;
@@ -309,6 +322,32 @@ message CommandArgumentError {
309
322
  // Invalid argument arity. Expected a single argument but found a result that expanded to
310
323
  // multiple arguments.
311
324
  INVALID_ARGUMENT_ARITY = 13;
325
+
326
+ // Object passed to TransferObject does not have public transfer, i.e. the `store` ability
327
+ INVALID_TRANSFER_OBJECT = 14;
328
+
329
+ // First argument to MakeMoveVec is not an object. If no type is specified for MakeMoveVec,
330
+ // all arguments must be the same object type.
331
+ INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT = 15;
332
+
333
+ // Specified argument location does not have a value and cannot be used
334
+ ARGUMENT_WITHOUT_VALUE = 16;
335
+
336
+ // Cannot move a borrowed value. The value's type does resulted in this argument usage being
337
+ // inferred as a move. This is likely due to the type not having the `copy` ability; although
338
+ // in rare cases, it could also be this is the last usage of a value without the `drop`
339
+ // ability.
340
+ CANNOT_MOVE_BORROWED_VALUE = 17;
341
+
342
+ // Cannot write to an argument location that is still borrowed, and where that borrow is an
343
+ // extension of that reference. This is likely due to this argument being used in a Move call
344
+ // that returns a reference, and that reference is used in a later command.
345
+ CANNOT_WRITE_TO_EXTENDED_REFERENCE = 18;
346
+
347
+ // The argument specified cannot be used as a reference argument in the Move call. Either the
348
+ // argument is a mutable reference and it conflicts with another argument to the call, or the
349
+ // argument is mutable and another reference extends it and will be used in a later command.
350
+ INVALID_REFERENCE_ARGUMENT = 19;
312
351
  }
313
352
 
314
353
  optional CommandArgumentErrorKind kind = 2;
@@ -23,6 +23,9 @@ message Input {
23
23
 
24
24
  // A Move object that is attempted to be received in this transaction.
25
25
  RECEIVING = 4;
26
+
27
+ // Reservation to withdraw balance from a funds accumulator
28
+ FUNDS_WITHDRAWAL = 5;
26
29
  }
27
30
 
28
31
  optional InputKind kind = 1;
@@ -48,8 +51,41 @@ message Input {
48
51
  // object.
49
52
  optional bool mutable = 6;
50
53
 
54
+ enum Mutability {
55
+ MUTABILITY_UNKNOWN = 0;
56
+ IMMUTABLE = 1;
57
+ MUTABLE = 2;
58
+
59
+ // Non-exclusive write is used to allow multiple transactions to
60
+ // simultaneously add disjoint dynamic fields to an object.
61
+ // (Currently only used by settlement transactions).
62
+ NON_EXCLUSIVE_WRITE = 3;
63
+ }
64
+
65
+ // NOTE: For backwards compatibility purposes the addition of the new
66
+ // `NON_EXCLUSIVE_WRITE` mutability variant requires providing a new field.
67
+ // The old `mutable` field will continue to be populated and respected as an
68
+ // input for the time being.
69
+ optional Mutability mutability = 7;
70
+
71
+ // Fund Reservation information if `kind` is `FUNDS_WITHDRAWAL`.
72
+ optional FundsWithdrawal funds_withdrawal = 8;
73
+
51
74
  // A literal value
52
75
  //
53
76
  // INPUT ONLY
54
77
  optional google.protobuf.Value literal = 1000;
55
78
  }
79
+
80
+ message FundsWithdrawal {
81
+ optional uint64 amount = 1;
82
+ optional string coin_type = 2;
83
+
84
+ enum Source {
85
+ SOURCE_UNKNOWN = 0;
86
+ SENDER = 1;
87
+ SPONSOR = 2;
88
+ }
89
+
90
+ optional Source source = 3;
91
+ }
@@ -59,11 +59,44 @@ message TransactionExpiration {
59
59
  // Validators won't sign and execute transaction unless the expiration epoch
60
60
  // is greater than or equal to the current epoch.
61
61
  EPOCH = 2;
62
+
63
+ // This variant enables gas payments from address balances.
64
+ //
65
+ // When transactions use address balances for gas payment instead of explicit gas coins,
66
+ // we lose the natural transaction uniqueness and replay prevention that comes from
67
+ // mutation of gas coin objects.
68
+ //
69
+ // By bounding expiration and providing a nonce, validators must only retain
70
+ // executed digests for the maximum possible expiry range to differentiate
71
+ // retries from unique transactions with otherwise identical inputs.
72
+ VALID_DURING = 3;
62
73
  }
63
74
 
64
75
  optional TransactionExpirationKind kind = 1;
65
76
 
77
+ // Maximum epoch in which a transaction can be executed. The provided maximal epoch
78
+ // must be greater than or equal to the current epoch for a transaction to execute.
66
79
  optional uint64 epoch = 2;
80
+
81
+ // Minimal epoch in which a transaction can be executed. The provided minimal epoch
82
+ // must be less than or equal to the current epoch for a transaction to execute.
83
+ optional uint64 min_epoch = 3;
84
+
85
+ // Minimal UNIX timestamp in which a transaction can be executed. The
86
+ // provided minimal timestamp must be less than or equal to the current
87
+ // clock.
88
+ optional google.protobuf.Timestamp min_timestamp = 4;
89
+
90
+ // Maximum UNIX timestamp in which a transaction can be executed. The
91
+ // provided maximal timestamp must be greater than or equal to the current
92
+ // clock.
93
+ optional google.protobuf.Timestamp max_timestamp = 5;
94
+
95
+ // ChainId of the network this transaction is intended for in order to prevent cross-chain replay
96
+ optional string chain = 6;
97
+
98
+ // User-provided uniqueness identifier to differentiate otherwise identical transactions
99
+ optional uint32 nonce = 7;
67
100
  }
68
101
 
69
102
  // Transaction type.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-sui-common",
3
- "version": "1.0.95",
3
+ "version": "1.0.96",
4
4
  "description": "Sui common library",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",
@@ -15,7 +15,7 @@
15
15
  "push": "npm run build && npm publish"
16
16
  },
17
17
  "dependencies": {
18
- "@clonegod/ttd-core": "2.0.85",
18
+ "@clonegod/ttd-core": "2.1.17",
19
19
  "@grpc/grpc-js": "^1.13.4",
20
20
  "@grpc/proto-loader": "^0.8.0",
21
21
  "@mysten/sui": "^1.37.5",