wowok 1.6.84 → 1.6.85

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 (63) hide show
  1. package/dist/permission.d.ts +1 -1
  2. package/dist/permission.d.ts.map +1 -1
  3. package/dist/permission.js +0 -45
  4. package/package.json +1 -1
  5. package/src/permission.ts +18 -60
  6. package/tsconfig.json +112 -112
  7. package/dist/empty.d.ts +0 -1
  8. package/dist/empty.d.ts.map +0 -1
  9. package/dist/empty.js +0 -1
  10. package/dist/src/arbitration.d.ts +0 -61
  11. package/dist/src/arbitration.d.ts.map +0 -1
  12. package/dist/src/arbitration.js +0 -473
  13. package/dist/src/demand.d.ts +0 -26
  14. package/dist/src/demand.d.ts.map +0 -1
  15. package/dist/src/demand.js +0 -256
  16. package/dist/src/entity.d.ts +0 -27
  17. package/dist/src/entity.d.ts.map +0 -1
  18. package/dist/src/entity.js +0 -95
  19. package/dist/src/exception.d.ts +0 -31
  20. package/dist/src/exception.d.ts.map +0 -1
  21. package/dist/src/exception.js +0 -34
  22. package/dist/src/guard.d.ts +0 -79
  23. package/dist/src/guard.d.ts.map +0 -1
  24. package/dist/src/guard.js +0 -749
  25. package/dist/src/index.d.ts +0 -25
  26. package/dist/src/index.d.ts.map +0 -1
  27. package/dist/src/index.js +0 -24
  28. package/dist/src/machine.d.ts +0 -67
  29. package/dist/src/machine.d.ts.map +0 -1
  30. package/dist/src/machine.js +0 -518
  31. package/dist/src/passport.d.ts +0 -86
  32. package/dist/src/passport.d.ts.map +0 -1
  33. package/dist/src/passport.js +0 -645
  34. package/dist/src/payment.d.ts +0 -16
  35. package/dist/src/payment.d.ts.map +0 -1
  36. package/dist/src/payment.js +0 -41
  37. package/dist/src/permission.d.ts +0 -150
  38. package/dist/src/permission.d.ts.map +0 -1
  39. package/dist/src/permission.js +0 -502
  40. package/dist/src/progress.d.ts +0 -72
  41. package/dist/src/progress.d.ts.map +0 -1
  42. package/dist/src/progress.js +0 -301
  43. package/dist/src/protocol.d.ts +0 -226
  44. package/dist/src/protocol.d.ts.map +0 -1
  45. package/dist/src/protocol.js +0 -482
  46. package/dist/src/repository.d.ts +0 -83
  47. package/dist/src/repository.d.ts.map +0 -1
  48. package/dist/src/repository.js +0 -528
  49. package/dist/src/resource.d.ts +0 -35
  50. package/dist/src/resource.d.ts.map +0 -1
  51. package/dist/src/resource.js +0 -130
  52. package/dist/src/service.d.ts +0 -128
  53. package/dist/src/service.d.ts.map +0 -1
  54. package/dist/src/service.js +0 -1234
  55. package/dist/src/treasury.d.ts +0 -55
  56. package/dist/src/treasury.d.ts.map +0 -1
  57. package/dist/src/treasury.js +0 -396
  58. package/dist/src/utils.d.ts +0 -93
  59. package/dist/src/utils.d.ts.map +0 -1
  60. package/dist/src/utils.js +0 -616
  61. package/dist/src/wowok.d.ts +0 -15
  62. package/dist/src/wowok.d.ts.map +0 -1
  63. package/dist/src/wowok.js +0 -67
@@ -1,473 +0,0 @@
1
- import { IsValidArray, array_unique, IsValidTokenType, IsValidDesription, parseObjectType, IsValidAddress, IsValidEndpoint, IsValidU64, IsValidName, } from './utils';
2
- import { Protocol } from './protocol';
3
- import { ERROR, Errors } from './exception';
4
- export class Arbitration {
5
- pay_token_type;
6
- permission;
7
- object;
8
- txb;
9
- //static token2coin = (token:string) => { return '0x2::coin::Coin<' + token + '>'};
10
- get_pay_type() { return this.pay_token_type; }
11
- get_object() { return this.object; }
12
- constructor(txb, pay_token_type, permission) {
13
- this.pay_token_type = pay_token_type;
14
- this.txb = txb;
15
- this.permission = permission;
16
- this.object = '';
17
- }
18
- static From(txb, token_type, permission, object) {
19
- let s = new Arbitration(txb, token_type, permission);
20
- s.object = Protocol.TXB_OBJECT(txb, object);
21
- return s;
22
- }
23
- static New(txb, token_type, permission, description, fee, withdrawTreasury, passport) {
24
- if (!Protocol.IsValidObjects([permission, withdrawTreasury])) {
25
- ERROR(Errors.IsValidObjects);
26
- }
27
- if (!IsValidTokenType(token_type)) {
28
- ERROR(Errors.IsValidTokenType, 'New.token_type');
29
- }
30
- if (!IsValidDesription(description)) {
31
- ERROR(Errors.IsValidDesription);
32
- }
33
- if (!IsValidU64(fee)) {
34
- ERROR(Errors.IsValidU64, 'New.fee');
35
- }
36
- let pay_token_type = token_type;
37
- let obj = new Arbitration(txb, pay_token_type, permission);
38
- if (passport) {
39
- obj.object = txb.moveCall({
40
- target: Protocol.Instance().arbitrationFn('new_with_passport'),
41
- arguments: [passport, txb.pure.string(description), txb.pure.u64(fee), txb.object(withdrawTreasury), Protocol.TXB_OBJECT(txb, permission)],
42
- typeArguments: [pay_token_type],
43
- });
44
- }
45
- else {
46
- obj.object = txb.moveCall({
47
- target: Protocol.Instance().arbitrationFn('new'),
48
- arguments: [txb.pure.string(description), txb.pure.u64(fee), txb.object(withdrawTreasury), Protocol.TXB_OBJECT(txb, permission)],
49
- typeArguments: [pay_token_type],
50
- });
51
- }
52
- return obj;
53
- }
54
- launch() {
55
- return this.txb.moveCall({
56
- target: Protocol.Instance().arbitrationFn('create'),
57
- arguments: [Protocol.TXB_OBJECT(this.txb, this.object)],
58
- typeArguments: [this.pay_token_type]
59
- });
60
- }
61
- set_description(description, passport) {
62
- if (!IsValidDesription(description)) {
63
- ERROR(Errors.IsValidDesription, 'set_description.description');
64
- }
65
- if (passport) {
66
- this.txb.moveCall({
67
- target: Protocol.Instance().arbitrationFn('description_set_with_passport'),
68
- arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.string(description), Protocol.TXB_OBJECT(this.txb, this.permission)],
69
- typeArguments: [this.pay_token_type]
70
- });
71
- }
72
- else {
73
- this.txb.moveCall({
74
- target: Protocol.Instance().arbitrationFn('description_set'),
75
- arguments: [Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.string(description), Protocol.TXB_OBJECT(this.txb, this.permission)],
76
- typeArguments: [this.pay_token_type]
77
- });
78
- }
79
- }
80
- set_fee(fee, passport) {
81
- if (!IsValidU64(fee)) {
82
- ERROR(Errors.IsValidU64, 'set_fee.fee');
83
- }
84
- if (passport) {
85
- this.txb.moveCall({
86
- target: Protocol.Instance().arbitrationFn('fee_set_with_passport'),
87
- arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.u64(fee), Protocol.TXB_OBJECT(this.txb, this.permission)],
88
- typeArguments: [this.pay_token_type]
89
- });
90
- }
91
- else {
92
- this.txb.moveCall({
93
- target: Protocol.Instance().arbitrationFn('fee_set'),
94
- arguments: [Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.u64(fee), Protocol.TXB_OBJECT(this.txb, this.permission)],
95
- typeArguments: [this.pay_token_type]
96
- });
97
- }
98
- }
99
- set_endpoint(endpoint, passport) {
100
- if (endpoint && !IsValidEndpoint(endpoint)) {
101
- ERROR(Errors.IsValidEndpoint, 'set_endpoint.endpoint');
102
- }
103
- if (passport) {
104
- if (endpoint) {
105
- this.txb.moveCall({
106
- target: Protocol.Instance().arbitrationFn('endpoint_set_with_passport'),
107
- arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.string(endpoint), Protocol.TXB_OBJECT(this.txb, this.permission)],
108
- typeArguments: [this.pay_token_type]
109
- });
110
- }
111
- else {
112
- this.txb.moveCall({
113
- target: Protocol.Instance().arbitrationFn('endpoint_none_with_passport'),
114
- arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, this.permission)],
115
- typeArguments: [this.pay_token_type]
116
- });
117
- }
118
- }
119
- else {
120
- if (endpoint) {
121
- this.txb.moveCall({
122
- target: Protocol.Instance().arbitrationFn('endpoint_set'),
123
- arguments: [Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.string(endpoint), Protocol.TXB_OBJECT(this.txb, this.permission)],
124
- typeArguments: [this.pay_token_type]
125
- });
126
- }
127
- else {
128
- this.txb.moveCall({
129
- target: Protocol.Instance().arbitrationFn('endpoint_none'),
130
- arguments: [Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, this.permission)],
131
- typeArguments: [this.pay_token_type]
132
- });
133
- }
134
- }
135
- }
136
- add_voting_guard(guard, passport) {
137
- if (guard.length === 0)
138
- return;
139
- if (!IsValidArray(guard, (g) => Protocol.IsValidObjects([g.guard]) && IsValidU64(g.voting_weight))) {
140
- ERROR(Errors.IsValidArray, 'add_voting_guard.guard');
141
- }
142
- if (passport) {
143
- guard.forEach(v => {
144
- this.txb.moveCall({
145
- target: Protocol.Instance().arbitrationFn('voting_guard_add_with_passport'),
146
- arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), this.txb.object(v.guard),
147
- this.txb.pure.u64(v.voting_weight), Protocol.TXB_OBJECT(this.txb, this.permission)],
148
- typeArguments: [this.pay_token_type]
149
- });
150
- });
151
- }
152
- else {
153
- guard.forEach(v => {
154
- this.txb.moveCall({
155
- target: Protocol.Instance().arbitrationFn('voting_guard_add'),
156
- arguments: [Protocol.TXB_OBJECT(this.txb, this.object), this.txb.object(v.guard),
157
- this.txb.pure.u64(v.voting_weight), Protocol.TXB_OBJECT(this.txb, this.permission)],
158
- typeArguments: [this.pay_token_type]
159
- });
160
- });
161
- }
162
- }
163
- remove_voting_guard(guard, removeall, passport) {
164
- if (!removeall && guard.length === 0)
165
- return;
166
- if (!IsValidArray(guard, IsValidAddress)) {
167
- ERROR(Errors.IsValidArray, 'remove_voting_guard.guard');
168
- }
169
- if (passport) {
170
- if (removeall) {
171
- this.txb.moveCall({
172
- target: Protocol.Instance().arbitrationFn('voting_guard_removeall_with_passport'),
173
- arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, this.permission)],
174
- typeArguments: [this.pay_token_type]
175
- });
176
- }
177
- else {
178
- this.txb.moveCall({
179
- target: Protocol.Instance().arbitrationFn('voting_guard_remove_with_passport'),
180
- arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.vector('address', guard),
181
- Protocol.TXB_OBJECT(this.txb, this.permission)],
182
- typeArguments: [this.pay_token_type]
183
- });
184
- }
185
- }
186
- else {
187
- if (removeall) {
188
- this.txb.moveCall({
189
- target: Protocol.Instance().arbitrationFn('voting_guard_removeall'),
190
- arguments: [Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, this.permission)],
191
- typeArguments: [this.pay_token_type]
192
- });
193
- }
194
- else {
195
- this.txb.moveCall({
196
- target: Protocol.Instance().arbitrationFn('voting_guard_remove'),
197
- arguments: [Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.vector('address', guard),
198
- Protocol.TXB_OBJECT(this.txb, this.permission)],
199
- typeArguments: [this.pay_token_type]
200
- });
201
- }
202
- }
203
- }
204
- set_guard(apply_guard, passport) {
205
- if (apply_guard && !IsValidAddress(apply_guard)) {
206
- ERROR(Errors.IsValidAddress, 'set_guard.apply_guard');
207
- }
208
- if (passport) {
209
- if (apply_guard) {
210
- this.txb.moveCall({
211
- target: Protocol.Instance().arbitrationFn('usage_guard_set_with_passport'),
212
- arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), this.txb.object(apply_guard), Protocol.TXB_OBJECT(this.txb, this.permission)],
213
- typeArguments: [this.pay_token_type]
214
- });
215
- }
216
- else {
217
- this.txb.moveCall({
218
- target: Protocol.Instance().arbitrationFn('usage_guard_none_with_passport'),
219
- arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, this.permission)],
220
- typeArguments: [this.pay_token_type]
221
- });
222
- }
223
- }
224
- else {
225
- if (apply_guard) {
226
- this.txb.moveCall({
227
- target: Protocol.Instance().arbitrationFn('usage_guard_set'),
228
- arguments: [Protocol.TXB_OBJECT(this.txb, this.object), this.txb.object(apply_guard), Protocol.TXB_OBJECT(this.txb, this.permission)],
229
- typeArguments: [this.pay_token_type]
230
- });
231
- }
232
- else {
233
- this.txb.moveCall({
234
- target: Protocol.Instance().arbitrationFn('usage_guard_none'),
235
- arguments: [Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, this.permission)],
236
- typeArguments: [this.pay_token_type]
237
- });
238
- }
239
- }
240
- }
241
- pause(pause, passport) {
242
- if (passport) {
243
- this.txb.moveCall({
244
- target: Protocol.Instance().arbitrationFn('pause_with_passport'),
245
- arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.bool(pause), Protocol.TXB_OBJECT(this.txb, this.permission)],
246
- typeArguments: [this.pay_token_type]
247
- });
248
- }
249
- else {
250
- this.txb.moveCall({
251
- target: Protocol.Instance().arbitrationFn('pause'),
252
- arguments: [Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.bool(pause), Protocol.TXB_OBJECT(this.txb, this.permission)],
253
- typeArguments: [this.pay_token_type]
254
- });
255
- }
256
- }
257
- vote(param, passport) {
258
- if (param.voting_guard && !Protocol.IsValidObjects([param.voting_guard])) {
259
- ERROR(Errors.IsValidObjects, 'vote.param.voting_guard');
260
- }
261
- if (!IsValidArray(param.agrees, (v) => IsValidU64(v) && v < Arbitration.MAX_PROPOSITION_COUNT)) {
262
- ERROR(Errors.IsValidArray, 'vote.param.agrees');
263
- }
264
- if (!Protocol.IsValidObjects([param.arb])) {
265
- ERROR(Errors.IsValidObjects, 'vote.param.arb');
266
- }
267
- const clock = this.txb.sharedObjectRef(Protocol.CLOCK_OBJECT);
268
- if (passport) {
269
- if (param.voting_guard) {
270
- this.txb.moveCall({
271
- target: Protocol.Instance().arbitrationFn('vote_with_passport'),
272
- arguments: [passport, this.txb.object(param.voting_guard), Protocol.TXB_OBJECT(this.txb, this.object),
273
- this.txb.object(param.arb), this.txb.pure.vector('u8', param.agrees),
274
- this.txb.object(clock), Protocol.TXB_OBJECT(this.txb, this.permission)],
275
- typeArguments: [this.pay_token_type]
276
- });
277
- }
278
- else {
279
- this.txb.moveCall({
280
- target: Protocol.Instance().arbitrationFn('vote2_with_passport'),
281
- arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), this.txb.object(param.arb), this.txb.pure.vector('u8', param.agrees),
282
- this.txb.object(clock), Protocol.TXB_OBJECT(this.txb, this.permission)],
283
- typeArguments: [this.pay_token_type]
284
- });
285
- }
286
- }
287
- else {
288
- this.txb.moveCall({
289
- target: Protocol.Instance().arbitrationFn('vote'),
290
- arguments: [Protocol.TXB_OBJECT(this.txb, this.object), this.txb.object(param.arb), this.txb.pure.vector('u8', param.agrees),
291
- this.txb.object(clock), Protocol.TXB_OBJECT(this.txb, this.permission)],
292
- typeArguments: [this.pay_token_type]
293
- });
294
- }
295
- }
296
- arbitration(param, passport) {
297
- if (!IsValidDesription(param.feedback)) {
298
- ERROR(Errors.IsValidDesription, 'arbitration.param.feedback');
299
- }
300
- if (!Protocol.IsValidObjects([param.arb])) {
301
- ERROR(Errors.IsValidObjects, 'arbitration.param.arb');
302
- }
303
- if (param.indemnity && !IsValidU64(param.indemnity)) {
304
- ERROR(Errors.IsValidU64, 'arbitration.param.indemnity');
305
- }
306
- let ind = this.txb.pure.option('u64', param.indemnity ? param.indemnity : undefined);
307
- if (passport) {
308
- this.txb.moveCall({
309
- target: Protocol.Instance().arbitrationFn('arbitration_with_passport'),
310
- arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object),
311
- this.txb.object(param.arb), this.txb.pure.string(param.feedback), ind, Protocol.TXB_OBJECT(this.txb, this.permission)],
312
- typeArguments: [this.pay_token_type]
313
- });
314
- }
315
- else {
316
- this.txb.moveCall({
317
- target: Protocol.Instance().arbitrationFn('arbitration'),
318
- arguments: [Protocol.TXB_OBJECT(this.txb, this.object),
319
- this.txb.object(param.arb), this.txb.pure.string(param.feedback), ind, Protocol.TXB_OBJECT(this.txb, this.permission)],
320
- typeArguments: [this.pay_token_type]
321
- });
322
- }
323
- }
324
- withdraw_fee(arb, param, passport) {
325
- if (!Protocol.IsValidObjects([arb, param.treasury])) {
326
- ERROR(Errors.IsValidObjects, 'withdraw_fee.arb or treasury');
327
- }
328
- if (param?.for_guard && !Protocol.IsValidObjects([param.for_guard])) {
329
- ERROR(Errors.IsValidObjects, 'withdraw_fee.param.for_guard');
330
- }
331
- if (param?.for_object && !IsValidAddress(param.for_object)) {
332
- ERROR(Errors.IsValidAddress, 'withdraw_fee.param.for_object');
333
- }
334
- if (!IsValidDesription(param.remark)) {
335
- ERROR(Errors.IsValidDesription, 'withdraw_fee.param.remark');
336
- }
337
- if (!IsValidU64(param.index)) {
338
- ERROR(Errors.IsValidU64, 'withdraw_fee.param.index');
339
- }
340
- const for_obj = this.txb.pure.option('address', param.for_object ? param.for_object : undefined);
341
- const clock = this.txb.sharedObjectRef(Protocol.CLOCK_OBJECT);
342
- if (passport) {
343
- if (param.for_guard) {
344
- return this.txb.moveCall({
345
- target: Protocol.Instance().arbitrationFn('withdraw_forGuard_with_passport'),
346
- arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), this.txb.object(arb), this.txb.object(param.treasury),
347
- for_obj, this.txb.object(param.for_guard), this.txb.pure.u64(param.index), this.txb.pure.string(param.remark), this.txb.object(clock),
348
- Protocol.TXB_OBJECT(this.txb, this.permission)],
349
- typeArguments: [this.pay_token_type]
350
- });
351
- }
352
- else {
353
- return this.txb.moveCall({
354
- target: Protocol.Instance().arbitrationFn('withdraw_with_passport'),
355
- arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), this.txb.object(arb), this.txb.object(param.treasury),
356
- for_obj, this.txb.pure.u64(param.index), this.txb.pure.string(param.remark), this.txb.object(clock), Protocol.TXB_OBJECT(this.txb, this.permission)],
357
- typeArguments: [this.pay_token_type]
358
- });
359
- }
360
- }
361
- else {
362
- if (param.for_guard) {
363
- return this.txb.moveCall({
364
- target: Protocol.Instance().arbitrationFn('withdraw_forGuard'),
365
- arguments: [Protocol.TXB_OBJECT(this.txb, this.object), this.txb.object(arb), this.txb.object(param.treasury),
366
- for_obj, this.txb.object(param.for_guard), this.txb.pure.u64(param.index), this.txb.pure.string(param.remark), this.txb.object(clock),
367
- Protocol.TXB_OBJECT(this.txb, this.permission)],
368
- typeArguments: [this.pay_token_type]
369
- });
370
- }
371
- else {
372
- return this.txb.moveCall({
373
- target: Protocol.Instance().arbitrationFn('withdraw'),
374
- arguments: [Protocol.TXB_OBJECT(this.txb, this.object), this.txb.object(arb), this.txb.object(param.treasury),
375
- for_obj, this.txb.pure.u64(param.index), this.txb.pure.string(param.remark), this.txb.object(clock), Protocol.TXB_OBJECT(this.txb, this.permission)],
376
- typeArguments: [this.pay_token_type]
377
- });
378
- }
379
- }
380
- }
381
- set_withdrawTreasury(treasury, passport) {
382
- if (!Protocol.IsValidObjects([treasury])) {
383
- ERROR(Errors.IsValidObjects, 'set_withdrawTreasury.treasury');
384
- }
385
- if (passport) {
386
- this.txb.moveCall({
387
- target: Protocol.Instance().arbitrationFn('withdraw_treasury_set_with_passport'),
388
- arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object),
389
- this.txb.object(treasury), Protocol.TXB_OBJECT(this.txb, this.permission)],
390
- typeArguments: [this.pay_token_type]
391
- });
392
- }
393
- else {
394
- this.txb.moveCall({
395
- target: Protocol.Instance().arbitrationFn('withdraw_treasury_set'),
396
- arguments: [Protocol.TXB_OBJECT(this.txb, this.object),
397
- this.txb.object(treasury), Protocol.TXB_OBJECT(this.txb, this.permission)],
398
- typeArguments: [this.pay_token_type]
399
- });
400
- }
401
- }
402
- dispute(param, passport) {
403
- if (!Protocol.IsValidObjects([param.order])) {
404
- ERROR(Errors.IsValidObjects, 'dispute.param.order');
405
- }
406
- if (!IsValidTokenType(param.order_token_type)) {
407
- ERROR(Errors.IsValidTokenType, 'dispute.param.order_token_type');
408
- }
409
- if (!IsValidDesription(param.description)) {
410
- ERROR(Errors.IsValidDesription, 'dispute.param.description');
411
- }
412
- if (!IsValidArray(param.votable_proposition, IsValidName)) {
413
- ERROR(Errors.IsValidArray, 'dispute.param.votable_proposition');
414
- }
415
- if (passport) {
416
- if (param.fee) {
417
- return this.txb.moveCall({
418
- target: Protocol.Instance().arbitrationFn('dispute_with_passport'),
419
- arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), this.txb.object(param.order), this.txb.pure.string(param.description),
420
- this.txb.pure.vector('string', array_unique(param.votable_proposition)), this.txb.object(param.fee)],
421
- typeArguments: [this.pay_token_type, param.order_token_type]
422
- });
423
- }
424
- else {
425
- return this.txb.moveCall({
426
- target: Protocol.Instance().arbitrationFn('free_dispute_with_passport'),
427
- arguments: [passport, Protocol.TXB_OBJECT(this.txb, this.object), this.txb.object(param.order), this.txb.pure.string(param.description),
428
- this.txb.pure.vector('string', array_unique(param.votable_proposition))],
429
- typeArguments: [this.pay_token_type, param.order_token_type]
430
- });
431
- }
432
- }
433
- else {
434
- if (param.fee) {
435
- return this.txb.moveCall({
436
- target: Protocol.Instance().arbitrationFn('dispute'),
437
- arguments: [Protocol.TXB_OBJECT(this.txb, this.object), this.txb.object(param.order), this.txb.pure.string(param.description),
438
- this.txb.pure.vector('string', array_unique(param.votable_proposition)), this.txb.object(param.fee)],
439
- typeArguments: [this.pay_token_type, param.order_token_type]
440
- });
441
- }
442
- else {
443
- return this.txb.moveCall({
444
- target: Protocol.Instance().arbitrationFn('free_dispute'),
445
- arguments: [Protocol.TXB_OBJECT(this.txb, this.object), this.txb.object(param.order), this.txb.pure.string(param.description),
446
- this.txb.pure.vector('string', array_unique(param.votable_proposition))],
447
- typeArguments: [this.pay_token_type, param.order_token_type]
448
- });
449
- }
450
- }
451
- }
452
- change_permission(new_permission) {
453
- if (!Protocol.IsValidObjects([new_permission])) {
454
- ERROR(Errors.IsValidObjects);
455
- }
456
- this.txb.moveCall({
457
- target: Protocol.Instance().arbitrationFn('permission_set'),
458
- arguments: [Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, this.permission), Protocol.TXB_OBJECT(this.txb, new_permission)],
459
- typeArguments: [this.pay_token_type]
460
- });
461
- this.permission = new_permission;
462
- }
463
- static parseObjectType = (chain_type) => {
464
- return parseObjectType(chain_type, 'arbitration::Arbitration<');
465
- };
466
- static parseArbObjectType = (chain_type) => {
467
- return parseObjectType(chain_type, 'arb::Arb<');
468
- };
469
- static queryArbVoted = () => {
470
- };
471
- static MAX_PROPOSITION_COUNT = 16;
472
- static MAX_VOTING_GUARD_COUNT = 16;
473
- }
@@ -1,26 +0,0 @@
1
- import { Transaction as TransactionBlock } from '@mysten/sui/transactions';
2
- import { PassportObject, PermissionObject, GuardObject, DemandAddress, TxbObject, ServiceObject } from './protocol';
3
- export declare class Demand {
4
- protected bounty_type: string;
5
- protected permission: PermissionObject;
6
- protected object: TxbObject;
7
- protected txb: TransactionBlock;
8
- get_bounty_type(): string;
9
- get_object(): TxbObject;
10
- static From(txb: TransactionBlock, bounty_type: string, permission: PermissionObject, object: TxbObject): Demand;
11
- private constructor();
12
- static New(txb: TransactionBlock, bounty_type: string, ms_expand: boolean, time: number, permission: PermissionObject, description: string, passport?: PassportObject): Demand;
13
- launch(): DemandAddress;
14
- refund(passport?: PassportObject): void;
15
- expand_time(minutes_duration: boolean, time: number, passport?: PassportObject): void;
16
- set_guard(guard?: GuardObject, service_identifier?: number, passport?: PassportObject): void;
17
- set_description(description: string, passport?: PassportObject): void;
18
- yes(service_address: string, passport?: PassportObject): void;
19
- deposit(bounty: TxbObject): void;
20
- present(service: ServiceObject | number, service_pay_type: string, tips: string, passport?: PassportObject): void;
21
- change_permission(new_permission: PermissionObject): void;
22
- static parseObjectType: (chain_type?: string | null) => string;
23
- static MAX_BOUNTY_COUNT: number;
24
- static MAX_PRESENTERS_COUNT: number;
25
- }
26
- //# sourceMappingURL=demand.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"demand.d.ts","sourceRoot":"","sources":["../../src/demand.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,WAAW,IAAI,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACnG,OAAO,EAAwB,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAI1I,qBAAa,MAAM;IACf,SAAS,CAAC,WAAW,SAAC;IACtB,SAAS,CAAC,UAAU,mBAAE;IACtB,SAAS,CAAC,MAAM,EAAG,SAAS,CAAC;IAC7B,SAAS,CAAC,GAAG,mBAAC;IAEd,eAAe;IACf,UAAU;IAEV,MAAM,CAAC,IAAI,CAAC,GAAG,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,EAAE,UAAU,EAAC,gBAAgB,EAAE,MAAM,EAAC,SAAS,GAAI,MAAM;IAM7G,OAAO;IAMP,MAAM,CAAC,GAAG,CAAC,GAAG,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,EAAE,SAAS,EAAC,OAAO,EAAE,IAAI,EAAC,MAAM,EAAE,UAAU,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,EAChI,QAAQ,CAAC,EAAC,cAAc,GAAI,MAAM;IA+BtC,MAAM,IAAK,aAAa;IAQxB,MAAM,CAAC,QAAQ,CAAC,EAAC,cAAc;IAmB/B,WAAW,CAAC,gBAAgB,EAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAC,cAAc;IAqB7E,SAAS,CAAC,KAAK,CAAC,EAAC,WAAW,EAAE,kBAAkB,CAAC,EAAC,MAAM,EAAE,QAAQ,CAAC,EAAC,cAAc;IA0CjF,eAAe,CAAC,WAAW,EAAC,MAAM,EAAE,QAAQ,CAAC,EAAC,cAAc;IAqB5D,GAAG,CAAC,eAAe,EAAC,MAAM,EAAE,QAAQ,CAAC,EAAC,cAAc;IAwBpD,OAAO,CAAC,MAAM,EAAC,SAAS;IAYxB,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,EAAE,gBAAgB,EAAC,MAAM,EAAE,IAAI,EAAC,MAAM,EAAE,QAAQ,CAAC,EAAC,cAAc;IA4CvG,iBAAiB,CAAC,cAAc,EAAC,gBAAgB;IAYjD,MAAM,CAAC,eAAe,GAAI,aAAY,MAAM,GAAG,IAAI,KAAI,MAAM,CAE5D;IAED,MAAM,CAAC,gBAAgB,SAAO;IAC9B,MAAM,CAAC,oBAAoB,SAAO;CACrC"}