forked from Jaammerr/python_sui_sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
/
models.py
327 lines (264 loc) · 7 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
from typing import Optional, Union, Any, List, NamedTuple
class SignatureScheme:
ED25519 = 'ED25519'
Secp256k1 = 'Secp256k1'
class ExecuteType:
ImmediateReturn = "ImmediateReturn"
WaitForTxCert = "WaitForTxCert"
WaitForEffectsCert = "WaitForEffectsCert"
WaitForLocalExecution = "WaitForLocalExecution"
class WalletInfo(NamedTuple):
mnemonic: str
private_key: bytes
public_key: bytes
address: str
class WalletInfoParams:
def __init__(
self,
mnemonic: str
):
self.mnemonic = mnemonic
class GetPublicKeyAsb64StringParams:
def __init__(
self,
public_key: bytes
):
self.public_key = public_key
class DryRunTransactionParams:
def __init__(
self,
tx_bytes: str
):
self.tx_bytes = tx_bytes
class GetTransactionsIDParams:
def __init__(
self,
response: dict
):
self.response = response
class GetObjectsOwnedByAddressParams:
def __init__(
self,
address: str
):
self.address = address
class GetObjectsOwnedByObjectParams:
def __init__(
self,
object_id: str
):
self.object_id = object_id
class GetNormalizedMoveFunctionParams:
def __init__(
self,
package: str,
module_name: str,
function_name: str
):
self.package = package
self.module_name = module_name
self.function_name = function_name
class GetNormalizedMoveModuleParams:
def __init__(
self,
package: str,
module_name: str
):
self.package = package
self.module_name = module_name
class GetNormalizedMoveModulesByPackageParams:
def __init__(
self,
package: str
):
self.package = package
class GetNormalizedMoveStructParams:
def __init__(
self,
package: str,
module_name: str,
struct_name: str
):
self.package = package
self.module_name = module_name
self.struct_name = struct_name
class GetObjectParams:
def __init__(
self,
object_id: str
):
self.object_id = object_id
class MergeCoinsParams:
def __init__(
self,
primary_coin: str,
coin_to_merge: str,
gas: str,
gas_budget: int
):
self.primary_coin = primary_coin
self.coin_to_merge = coin_to_merge
self.gas = gas
self.gas_budget = gas_budget
class PayParams:
def __init__(
self,
input_coins: List[str] or str,
recipients: List[str] or str,
amounts: List[int] or int,
gas: str,
gas_budget: int
):
self.input_coins = input_coins
self.recipients = recipients
self.amounts = amounts
self.gas = gas
self.gas_budget = gas_budget
class PayAllParams:
def __init__(
self,
input_coins: List[str] or str,
recipient: str,
gas_budget: int
):
self.input_coins = input_coins
self.recipient = recipient
self.gas_budget = gas_budget
class PublishParams:
def __init__(
self,
compiled_modules: str,
gas: str,
gas_budget: int
):
self.compiled_modules = compiled_modules
self.gas = gas,
self.gas_budget = gas_budget
class SplitCoinParams:
def __init__(
self,
coin_object_id: str,
split_amounts: int,
gas: str,
gas_budget: int
):
self.coin_object_id = coin_object_id
self.split_amounts = split_amounts
self.gas = gas,
self.gas_budget = gas_budget
class SplitCoinEqualParams:
def __init__(
self,
coin_object_id: str,
split_count: int,
gas: str,
gas_budget: int
):
self.coin_object_id = coin_object_id
self.split_count = split_count
self.gas = gas,
self.gas_budget = gas_budget
class MoveCallParams:
def __init__(
self,
package_object_id: str,
module: str,
function: str,
type_arguments: Union[List[str], List[Any]],
arguments: List[Union[bool, int, str, List[Any]]],
gas_budget: int,
gas_payment: Optional[str] = None
):
self.package_object_id = package_object_id
self.module = module
self.function = function
self.type_arguments = type_arguments
self.arguments = arguments
self.gas_budget = gas_budget
self.gas_payment = gas_payment
class TransferObjectParams:
def __init__(
self,
object_id: str,
recipient: str,
gas_budget: int,
gas_payment: Optional[str] = None
):
self.object_id = object_id
self.gas_payment = gas_payment
self.gas_budget = gas_budget
self.recipient = recipient
class TransferSuiParams:
def __init__(
self,
sui_object_id: str,
recipient: str,
gas_budget: int,
amount: Optional[int] = None
):
self.sui_object_id = sui_object_id
self.recipient = recipient
self.gas_budget = gas_budget
self.amount = amount
class BatchTransactionParams:
def __init__(
self,
single_transaction_params: list,
gas: str,
gas_budget: int
):
self.single_transaction_params = single_transaction_params
self.gas = gas
self.gas_budget = gas_budget
class MoveFunctionArgTypesParams:
def __init__(
self,
package: str,
module: str,
function: str
):
self.package = package
self.module = module
self.function = function
class GetRawObjectParams:
def __init__(
self,
object_id: str
):
self.object_id = object_id
class GetTransactionsParams:
def __init__(
self,
query: str,
cursor: str,
limit: int,
descending_order: bool = False
):
self.query = query
self.cursor = cursor
self.limit = limit
self.descending_order = descending_order
class GetTransactionParams:
def __init__(
self,
digest: str
):
self.digest = digest
class GetEventsByTransactionParams:
def __init__(
self,
query: str,
cursor: str,
limit: int
):
self.query = query
self.cursor = cursor
self.limit = limit
class GetTotalTransactionsNumberInRangeParams:
def __init__(
self,
start_of_range: int,
end_of_range: int
):
self.start_of_range = start_of_range
self.end_of_range = end_of_range