wowok 1.1.0 → 1.1.1
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.
- package/README.md +1 -1
- package/dist/demand.d.ts +2 -3
- package/dist/demand.d.ts.map +1 -1
- package/dist/demand.js +19 -11
- package/dist/guard.js +32 -32
- package/dist/machine.js +7 -7
- package/dist/passport.d.ts +3 -3
- package/dist/passport.d.ts.map +1 -1
- package/dist/passport.js +32 -22
- package/dist/permission.js +2 -2
- package/dist/progress.js +3 -3
- package/dist/protocol.d.ts +5 -3
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +18 -4
- package/dist/repository.js +5 -5
- package/dist/service.d.ts +3 -3
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +115 -116
- package/dist/utils.d.ts +3 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +8 -1
- package/dist/vote.js +8 -8
- package/package.json +1 -1
- package/src/guard.ts +32 -32
- package/src/machine.ts +7 -7
- package/src/passport.ts +5 -5
- package/src/permission.ts +2 -2
- package/src/progress.ts +3 -3
- package/src/protocol.ts +10 -0
- package/src/repository.ts +5 -5
- package/src/service.ts +25 -25
- package/src/utils.ts +8 -4
- package/src/vote.ts +8 -8
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
AI-oriented web3 collaboration protocol, driving innovaion and making it more likely to happen.
|
|
5
5
|
|
|
6
|
-
Github: [https://github.com/wowok-ai/sdk](https://github.com/wowok-ai/sdk)
|
|
6
|
+
Github: [https://github.com/wowok-ai/sdk](https://github.com/wowok-ai/sdk)
|
|
7
7
|
Examples: [https://github.com/wowok-ai/sdk-examples](https://github.com/wowok-ai/sdk-examples)
|
|
8
8
|
|
|
9
9
|
### Installation
|
package/dist/demand.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type TransactionResult } from '@mysten/sui.js/transactions';
|
|
2
2
|
import { Protocol, PassportObject, PermissionObject, GuardObject, DemandAddress, TxbObject } from './protocol';
|
|
3
|
-
import { Service } from './service';
|
|
4
3
|
export declare class Demand {
|
|
5
4
|
protected earnest_type: string;
|
|
6
5
|
protected permission: PermissionObject;
|
|
@@ -17,9 +16,9 @@ export declare class Demand {
|
|
|
17
16
|
expand_time(minutes_duration: number, passport?: PassportObject): void;
|
|
18
17
|
set_guard(guard?: GuardObject, passport?: PassportObject): void;
|
|
19
18
|
set_description(description: string, passport?: PassportObject): void;
|
|
20
|
-
yes(
|
|
19
|
+
yes(service_address: string, passport?: PassportObject): void;
|
|
21
20
|
deposit(earnest: TxbObject): void;
|
|
22
|
-
present(
|
|
21
|
+
present(service_address: string, service_pay_type: string, tips: string, passport?: PassportObject): void;
|
|
23
22
|
change_permission(new_permission: PermissionObject): void;
|
|
24
23
|
static MAX_EARNEST_COUNT: number;
|
|
25
24
|
static MAX_PRESENTERS_COUNT: number;
|
package/dist/demand.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"demand.d.ts","sourceRoot":"","sources":["../src/demand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EAAc,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAC,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"demand.d.ts","sourceRoot":"","sources":["../src/demand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EAAc,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAC,MAAM,YAAY,CAAC;AAM1H,qBAAa,MAAM;IACf,SAAS,CAAC,YAAY,SAAC;IACvB,SAAS,CAAC,UAAU,mBAAE;IACtB,SAAS,CAAC,MAAM,EAAG,SAAS,CAAE;I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!IsValidAddress(service_address)) {
|
|
169
169
|
ERROR(Errors.IsValidAddress);
|
|
170
170
|
}
|
|
171
171
|
let txb = this.protocol.CurrentSession();
|
|
172
172
|
if (passport) {
|
|
173
173
|
txb.moveCall({
|
|
174
174
|
target: this.protocol.DemandFn('yes_with_passport'),
|
|
175
|
-
arguments: [passport, Protocol.TXB_OBJECT(txb, this.object),
|
|
175
|
+
arguments: [passport, Protocol.TXB_OBJECT(txb, this.object),
|
|
176
|
+
txb.pure(service_address, BCS.ADDRESS),
|
|
176
177
|
Protocol.TXB_OBJECT(txb, this.permission)],
|
|
177
178
|
typeArguments: [this.earnest_type],
|
|
178
179
|
});
|
|
@@ -180,7 +181,8 @@ export class Demand {
|
|
|
180
181
|
else {
|
|
181
182
|
txb.moveCall({
|
|
182
183
|
target: this.protocol.DemandFn('yes'),
|
|
183
|
-
arguments: [Protocol.TXB_OBJECT(txb, this.object),
|
|
184
|
+
arguments: [Protocol.TXB_OBJECT(txb, this.object),
|
|
185
|
+
txb.pure(service_address, BCS.ADDRESS),
|
|
184
186
|
Protocol.TXB_OBJECT(txb, this.permission)],
|
|
185
187
|
typeArguments: [this.earnest_type],
|
|
186
188
|
});
|
|
@@ -197,25 +199,31 @@ export class Demand {
|
|
|
197
199
|
typeArguments: [this.earnest_type],
|
|
198
200
|
});
|
|
199
201
|
}
|
|
200
|
-
present(
|
|
202
|
+
present(service_address, service_pay_type, tips, passport) {
|
|
201
203
|
if (!IsValidDesription(tips)) {
|
|
202
204
|
ERROR(Errors.IsValidDesription, 'tips');
|
|
203
205
|
}
|
|
206
|
+
if (!IsValidAddress(service_address)) {
|
|
207
|
+
ERROR(Errors.IsValidAddress, 'service_address');
|
|
208
|
+
}
|
|
209
|
+
if (!IsValidArgType(service_pay_type)) {
|
|
210
|
+
ERROR(Errors.IsValidArgType, 'service_pay_type');
|
|
211
|
+
}
|
|
204
212
|
let txb = this.protocol.CurrentSession();
|
|
205
213
|
if (passport) {
|
|
206
214
|
txb.moveCall({
|
|
207
215
|
target: this.protocol.DemandFn('present_with_passport'),
|
|
208
|
-
arguments: [passport, Protocol.TXB_OBJECT(txb, this.object), Protocol.TXB_OBJECT(txb,
|
|
209
|
-
txb.pure(tips, BCS.STRING)
|
|
210
|
-
typeArguments: [this.earnest_type,
|
|
216
|
+
arguments: [passport, Protocol.TXB_OBJECT(txb, this.object), Protocol.TXB_OBJECT(txb, service_address),
|
|
217
|
+
txb.pure(tips, BCS.STRING)],
|
|
218
|
+
typeArguments: [this.earnest_type, service_pay_type],
|
|
211
219
|
});
|
|
212
220
|
}
|
|
213
221
|
else {
|
|
214
222
|
txb.moveCall({
|
|
215
223
|
target: this.protocol.DemandFn('present'),
|
|
216
|
-
arguments: [Protocol.TXB_OBJECT(txb, this.object), Protocol.TXB_OBJECT(txb,
|
|
217
|
-
txb.pure(tips, BCS.STRING)
|
|
218
|
-
typeArguments: [this.earnest_type,
|
|
224
|
+
arguments: [Protocol.TXB_OBJECT(txb, this.object), Protocol.TXB_OBJECT(txb, service_address),
|
|
225
|
+
txb.pure(tips, BCS.STRING)],
|
|
226
|
+
typeArguments: [this.earnest_type, service_pay_type],
|
|
219
227
|
});
|
|
220
228
|
}
|
|
221
229
|
}
|
package/dist/guard.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BCS } from '@mysten/bcs';
|
|
2
2
|
import { MODULES, ContextType, ValueType, OperatorType } from './protocol';
|
|
3
3
|
import { concatenate, array_equal } from './utils';
|
|
4
|
-
import { IsValidDesription,
|
|
4
|
+
import { IsValidDesription, Bcs, IsValidInt, IsValidAddress } from './utils';
|
|
5
5
|
import { ERROR, Errors } from './exception';
|
|
6
6
|
export var Guard_Sense_Binder;
|
|
7
7
|
(function (Guard_Sense_Binder) {
|
|
@@ -55,8 +55,8 @@ export class Guard {
|
|
|
55
55
|
if (variables.has(identifier)) {
|
|
56
56
|
let v = variables.get(identifier);
|
|
57
57
|
if (bNeedSerialize) {
|
|
58
|
-
v.value = value ?
|
|
59
|
-
v.witness = witness ?
|
|
58
|
+
v.value = value ? Bcs.getInstance().ser_address(value) : undefined;
|
|
59
|
+
v.witness = witness ? Bcs.getInstance().ser_address(witness) : undefined;
|
|
60
60
|
}
|
|
61
61
|
else {
|
|
62
62
|
v.value = value ? value : undefined;
|
|
@@ -65,7 +65,7 @@ export class Guard {
|
|
|
65
65
|
}
|
|
66
66
|
else {
|
|
67
67
|
if (bNeedSerialize) {
|
|
68
|
-
variables.set(identifier, { type: type, value: value ?
|
|
68
|
+
variables.set(identifier, { type: type, value: value ? Bcs.getInstance().ser_address(value) : undefined, witness: witness ? Bcs.getInstance().ser_address(witness) : undefined });
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
71
71
|
variables.set(identifier, { type: type, value: value ? value : undefined, witness: witness ? witness : undefined });
|
|
@@ -84,24 +84,24 @@ export class Guard {
|
|
|
84
84
|
return false;
|
|
85
85
|
switch (type) {
|
|
86
86
|
case ContextType.TYPE_CONTEXT_bool:
|
|
87
|
-
bNeedSerialize ? variables.set(identifier, { type: type, value:
|
|
87
|
+
bNeedSerialize ? variables.set(identifier, { type: type, value: Bcs.getInstance().ser_bool(value) }) :
|
|
88
88
|
variables.set(identifier, { type: type, value: value });
|
|
89
89
|
return true;
|
|
90
90
|
case ContextType.TYPE_CONTEXT_address:
|
|
91
91
|
case OperatorType.TYPE_QUERY_FROM_CONTEXT:
|
|
92
|
-
bNeedSerialize ? variables.set(identifier, { type: type, value:
|
|
92
|
+
bNeedSerialize ? variables.set(identifier, { type: type, value: Bcs.getInstance().ser_address(value) }) :
|
|
93
93
|
variables.set(identifier, { type: type, value: value });
|
|
94
94
|
return true;
|
|
95
95
|
case ContextType.TYPE_CONTEXT_u64:
|
|
96
|
-
bNeedSerialize ? variables.set(identifier, { type: type, value:
|
|
96
|
+
bNeedSerialize ? variables.set(identifier, { type: type, value: Bcs.getInstance().ser_u64(value) }) :
|
|
97
97
|
variables.set(identifier, { type: type, value: value });
|
|
98
98
|
return true;
|
|
99
99
|
case ContextType.TYPE_CONTEXT_u8:
|
|
100
|
-
bNeedSerialize ? variables.set(identifier, { type: type, value:
|
|
100
|
+
bNeedSerialize ? variables.set(identifier, { type: type, value: Bcs.getInstance().ser_u8(value) }) :
|
|
101
101
|
variables.set(identifier, { type: type, value: value });
|
|
102
102
|
return true;
|
|
103
103
|
case ContextType.TYPE_CONTEXT_vec_u8:
|
|
104
|
-
bNeedSerialize ? variables.set(identifier, { type: type, value:
|
|
104
|
+
bNeedSerialize ? variables.set(identifier, { type: type, value: Bcs.getInstance().ser_string(value) }) :
|
|
105
105
|
variables.set(identifier, { type: type, value: value });
|
|
106
106
|
return true;
|
|
107
107
|
}
|
|
@@ -334,45 +334,45 @@ export class SenseMaker {
|
|
|
334
334
|
case ValueType.TYPE_STATIC_address:
|
|
335
335
|
if (!param)
|
|
336
336
|
return false;
|
|
337
|
-
this.data.push(
|
|
338
|
-
this.data.push(
|
|
337
|
+
this.data.push(Bcs.getInstance().ser_u8(type));
|
|
338
|
+
this.data.push(Bcs.getInstance().ser_address(param));
|
|
339
339
|
this.type_validator.push(type);
|
|
340
340
|
break;
|
|
341
341
|
case ValueType.TYPE_STATIC_bool:
|
|
342
342
|
if (!param)
|
|
343
343
|
return false;
|
|
344
|
-
this.data.push(
|
|
345
|
-
this.data.push(
|
|
344
|
+
this.data.push(Bcs.getInstance().ser_u8(type));
|
|
345
|
+
this.data.push(Bcs.getInstance().ser_bool(param));
|
|
346
346
|
this.type_validator.push(type);
|
|
347
347
|
break;
|
|
348
348
|
case ValueType.TYPE_STATIC_u8:
|
|
349
349
|
if (!param)
|
|
350
350
|
return false;
|
|
351
|
-
this.data.push(
|
|
352
|
-
this.data.push(
|
|
351
|
+
this.data.push(Bcs.getInstance().ser_u8(type));
|
|
352
|
+
this.data.push(Bcs.getInstance().ser_u8(param));
|
|
353
353
|
this.type_validator.push(type);
|
|
354
354
|
break;
|
|
355
355
|
case ValueType.TYPE_STATIC_u64:
|
|
356
356
|
if (!param)
|
|
357
357
|
return false;
|
|
358
|
-
this.data.push(
|
|
359
|
-
this.data.push(
|
|
358
|
+
this.data.push(Bcs.getInstance().ser_u8(type));
|
|
359
|
+
this.data.push(Bcs.getInstance().ser_u64(param));
|
|
360
360
|
this.type_validator.push(type);
|
|
361
361
|
break;
|
|
362
362
|
case ValueType.TYPE_STATIC_vec_u8:
|
|
363
363
|
if (!param)
|
|
364
364
|
return false;
|
|
365
|
-
this.data.push(
|
|
366
|
-
this.data.push(
|
|
365
|
+
this.data.push(Bcs.getInstance().ser_u8(type));
|
|
366
|
+
this.data.push(Bcs.getInstance().ser_string(param));
|
|
367
367
|
this.type_validator.push(type);
|
|
368
368
|
// this.data[this.data.length-1].forEach((item : number) => console.log(item))
|
|
369
369
|
break;
|
|
370
370
|
case ContextType.TYPE_CONTEXT_SIGNER:
|
|
371
|
-
this.data.push(
|
|
371
|
+
this.data.push(Bcs.getInstance().ser_u8(type));
|
|
372
372
|
this.type_validator.push(ValueType.TYPE_STATIC_address);
|
|
373
373
|
break;
|
|
374
374
|
case ContextType.TYPE_CONTEXT_CLOCK:
|
|
375
|
-
this.data.push(
|
|
375
|
+
this.data.push(Bcs.getInstance().ser_u8(type));
|
|
376
376
|
this.type_validator.push(ValueType.TYPE_STATIC_u64);
|
|
377
377
|
break;
|
|
378
378
|
case ContextType.TYPE_CONTEXT_bool:
|
|
@@ -389,8 +389,8 @@ export class SenseMaker {
|
|
|
389
389
|
return false;
|
|
390
390
|
var v = variable.get(param);
|
|
391
391
|
if (v?.type == type) {
|
|
392
|
-
this.data.push(
|
|
393
|
-
this.data.push(
|
|
392
|
+
this.data.push(Bcs.getInstance().ser_u8(type));
|
|
393
|
+
this.data.push(Bcs.getInstance().ser_u8(param));
|
|
394
394
|
if (type == ContextType.TYPE_CONTEXT_bool) {
|
|
395
395
|
this.type_validator.push(ValueType.TYPE_STATIC_bool);
|
|
396
396
|
}
|
|
@@ -443,9 +443,9 @@ export class SenseMaker {
|
|
|
443
443
|
if (!array_equal(types, Guard.QUERIES[query_index][3])) { // type validate
|
|
444
444
|
return false;
|
|
445
445
|
}
|
|
446
|
-
this.data.push(
|
|
447
|
-
this.data.push(
|
|
448
|
-
this.data.push(
|
|
446
|
+
this.data.push(Bcs.getInstance().ser_u8(OperatorType.TYPE_FUTURE_QUERY)); // TYPE
|
|
447
|
+
this.data.push(Bcs.getInstance().ser_u8(identifier)); // variable identifier
|
|
448
|
+
this.data.push(Bcs.getInstance().ser_u8(Guard.QUERIES[query_index][2])); // cmd
|
|
449
449
|
this.type_validator.splice(offset, Guard.QUERIES[query_index][3].length); // delete type stack
|
|
450
450
|
this.type_validator.push(Guard.QUERIES[query_index][4]); // add the return value type to type stack
|
|
451
451
|
// console.log(this.type_validator)
|
|
@@ -473,14 +473,14 @@ export class SenseMaker {
|
|
|
473
473
|
return false;
|
|
474
474
|
}
|
|
475
475
|
if (typeof (object_address_from) == 'string') {
|
|
476
|
-
this.data.push(
|
|
477
|
-
this.data.push(
|
|
476
|
+
this.data.push(Bcs.getInstance().ser_u8(OperatorType.TYPE_QUERY)); // TYPE
|
|
477
|
+
this.data.push(Bcs.getInstance().ser_address(object_address_from)); // object address
|
|
478
478
|
}
|
|
479
479
|
else {
|
|
480
|
-
this.data.push(
|
|
481
|
-
this.data.push(
|
|
480
|
+
this.data.push(Bcs.getInstance().ser_u8(OperatorType.TYPE_QUERY_FROM_CONTEXT)); // TYPE
|
|
481
|
+
this.data.push(Bcs.getInstance().ser_u8(object_address_from)); // object identifer in variables
|
|
482
482
|
}
|
|
483
|
-
this.data.push(
|
|
483
|
+
this.data.push(Bcs.getInstance().ser_u8(Guard.QUERIES[query_index][2])); // cmd
|
|
484
484
|
this.type_validator.splice(offset, Guard.QUERIES[query_index][3].length); // delete type stack
|
|
485
485
|
this.type_validator.push(Guard.QUERIES[query_index][4]); // add the return value type to type stack
|
|
486
486
|
// console.log(this.type_validator)
|
|
@@ -512,7 +512,7 @@ export class SenseMaker {
|
|
|
512
512
|
default:
|
|
513
513
|
return false;
|
|
514
514
|
}
|
|
515
|
-
this.data.push(
|
|
515
|
+
this.data.push(Bcs.getInstance().ser_u8(type)); // TYPE
|
|
516
516
|
this.type_validator.splice(this.type_validator.length - 2); // delete type stack
|
|
517
517
|
this.type_validator.push(ValueType.TYPE_STATIC_bool); // add bool to type stack
|
|
518
518
|
return true;
|
package/dist/machine.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BCS } from '@mysten/bcs';
|
|
2
2
|
import { Protocol } from './protocol';
|
|
3
|
-
import { IsValidInt, IsValidUint,
|
|
3
|
+
import { IsValidInt, IsValidUint, Bcs, array_unique, IsValidArray, IsValidAddress, IsValidName, IsValidName_AllowEmpty, IsValidEndpoint, OptionNone, IsValidDesription } from './utils';
|
|
4
4
|
import { Permission } from './permission';
|
|
5
5
|
import { Errors, ERROR } from './exception';
|
|
6
6
|
export class Machine {
|
|
@@ -30,7 +30,7 @@ export class Machine {
|
|
|
30
30
|
ERROR(Errors.IsValidEndpoint);
|
|
31
31
|
}
|
|
32
32
|
let txb = protocol.CurrentSession();
|
|
33
|
-
let ep = endpoint ? txb.pure(
|
|
33
|
+
let ep = endpoint ? txb.pure(Bcs.getInstance().ser_option_string(endpoint)) : OptionNone(txb);
|
|
34
34
|
if (passport) {
|
|
35
35
|
m.object = txb.moveCall({
|
|
36
36
|
target: protocol.MachineFn('new_with_passport'),
|
|
@@ -89,10 +89,10 @@ export class Machine {
|
|
|
89
89
|
arguments: [txb.pure(node.name), txb.pure(node.description)]
|
|
90
90
|
});
|
|
91
91
|
node.pairs.forEach((pair) => {
|
|
92
|
-
let threshold = pair?.threshold ? txb.pure(
|
|
92
|
+
let threshold = pair?.threshold ? txb.pure(Bcs.getInstance().ser_option_u64(pair.threshold)) : OptionNone(txb);
|
|
93
93
|
pair.forwards.forEach((forward) => {
|
|
94
94
|
let weight = forward?.weight ? forward.weight : 1;
|
|
95
|
-
let perm = forward?.permission ? txb.pure(
|
|
95
|
+
let perm = forward?.permission ? txb.pure(Bcs.getInstance().ser_option_u64(forward.permission)) : OptionNone(txb);
|
|
96
96
|
let namedOperator = forward?.namedOperator ? txb.pure(forward.namedOperator) : txb.pure('');
|
|
97
97
|
let f;
|
|
98
98
|
if (forward?.guard) {
|
|
@@ -149,14 +149,14 @@ export class Machine {
|
|
|
149
149
|
if (passport) {
|
|
150
150
|
txb.moveCall({
|
|
151
151
|
target: this.protocol.MachineFn('node_remove_with_passport'),
|
|
152
|
-
arguments: [passport, Protocol.TXB_OBJECT(txb, this.object), txb.pure(
|
|
152
|
+
arguments: [passport, Protocol.TXB_OBJECT(txb, this.object), txb.pure(Bcs.getInstance().ser_vector_string(nodes_name)),
|
|
153
153
|
txb.pure(bTransferMyself, BCS.BOOL), Protocol.TXB_OBJECT(txb, this.permission)],
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
156
|
else {
|
|
157
157
|
txb.moveCall({
|
|
158
158
|
target: this.protocol.MachineFn('node_remove'),
|
|
159
|
-
arguments: [Protocol.TXB_OBJECT(txb, this.object), txb.pure(
|
|
159
|
+
arguments: [Protocol.TXB_OBJECT(txb, this.object), txb.pure(Bcs.getInstance().ser_vector_string(nodes_name)), txb.pure(bTransferMyself, BCS.BOOL), Protocol.TXB_OBJECT(txb, this.permission)],
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
}
|
|
@@ -266,7 +266,7 @@ export class Machine {
|
|
|
266
266
|
ERROR(Errors.IsValidEndpoint);
|
|
267
267
|
}
|
|
268
268
|
let txb = this.protocol.CurrentSession();
|
|
269
|
-
let ep = endpoint ? txb.pure(
|
|
269
|
+
let ep = endpoint ? txb.pure(Bcs.getInstance().ser_option_string(endpoint)) : OptionNone(txb);
|
|
270
270
|
if (passport) {
|
|
271
271
|
txb.moveCall({
|
|
272
272
|
target: this.protocol.MachineFn('endpoint_set_with_passport'),
|
package/dist/passport.d.ts
CHANGED
|
@@ -20,15 +20,15 @@ export type FutureValueRequest = {
|
|
|
20
20
|
identifier: number;
|
|
21
21
|
type: ContextType | OperatorType;
|
|
22
22
|
witness: string;
|
|
23
|
-
value
|
|
23
|
+
value: string;
|
|
24
24
|
};
|
|
25
25
|
export declare class GuardParser {
|
|
26
26
|
static guard_futures: (protocol: Protocol, guards: string[]) => Promise<FutureValueRequest[]>;
|
|
27
27
|
static parse_futures(result: FutureValueRequest[], guardid: string, chain_sense_bsc: Uint8Array, variable?: VariableType): boolean;
|
|
28
28
|
static guard_queries: (protocol: Protocol, guards: string[], futures?: FutureValueRequest[]) => Promise<Guard_Query_Object[]>;
|
|
29
29
|
static parse_sense_bsc(result: string[], guardid: string, chain_sense_bsc: Uint8Array, variable?: VariableType): boolean;
|
|
30
|
-
static rpc_sense_objects_fn: (response: SuiObjectResponse, param: Query_Param, option: SuiObjectDataOptions) => void;
|
|
31
|
-
static rpc_query_cmd_fn: (response: SuiObjectResponse, param: Query_Param, option: SuiObjectDataOptions) => void;
|
|
30
|
+
static rpc_sense_objects_fn: (protocol: Protocol, response: SuiObjectResponse, param: Query_Param, option: SuiObjectDataOptions) => void;
|
|
31
|
+
static rpc_query_cmd_fn: (protocol: Protocol, response: SuiObjectResponse, param: Query_Param, option: SuiObjectDataOptions) => void;
|
|
32
32
|
}
|
|
33
33
|
export declare class Passport {
|
|
34
34
|
static MAX_GUARD_COUNT: number;
|
package/dist/passport.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passport.d.ts","sourceRoot":"","sources":["../src/passport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAoB,KAAK,sBAAsB,EAAU,MAAM,6BAA6B,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,WAAW,EAAkB,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAC9F,OAAO,EACrB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,YAAY,EAAu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AC,kBAAkB,EAAE,EAAE,aAAa,CAAC,EAAC,kBAAkB,EAAE;IAgE7H,OAAO;IAQP,MAAM;CAOT"}
|
package/dist/passport.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Inputs } from '@mysten/sui.js/transactions';
|
|
2
2
|
import { Protocol, ContextType, OperatorType, ValueType, } from './protocol';
|
|
3
|
-
import { parse_object_type, array_unique,
|
|
3
|
+
import { parse_object_type, array_unique, Bcs, ulebDecode } from './utils';
|
|
4
4
|
import { Guard } from './guard';
|
|
5
5
|
import { BCS } from '@mysten/bcs';
|
|
6
6
|
import { ERROR, Errors } from './exception';
|
|
@@ -50,8 +50,8 @@ export class GuardParser {
|
|
|
50
50
|
let witness = Guard.get_variable_witness(variable, identifer[0], type);
|
|
51
51
|
if (!witness)
|
|
52
52
|
return false;
|
|
53
|
-
result.push({ guardid: guardid, identifier: identifer[0], type: type,
|
|
54
|
-
witness: '0x' +
|
|
53
|
+
result.push({ guardid: guardid, identifier: identifer[0], type: type, value: '',
|
|
54
|
+
witness: '0x' + Bcs.getInstance().de(BCS.ADDRESS, Uint8Array.from(witness)) });
|
|
55
55
|
break;
|
|
56
56
|
case ContextType.TYPE_CONTEXT_address:
|
|
57
57
|
case ContextType.TYPE_CONTEXT_bool:
|
|
@@ -185,7 +185,7 @@ export class GuardParser {
|
|
|
185
185
|
arr.splice(0, value + length);
|
|
186
186
|
break;
|
|
187
187
|
case OperatorType.TYPE_QUERY:
|
|
188
|
-
result.push('0x' +
|
|
188
|
+
result.push('0x' + Bcs.getInstance().de(BCS.ADDRESS, Uint8Array.from(arr)).toString());
|
|
189
189
|
arr.splice(0, 33); // address + cmd
|
|
190
190
|
break;
|
|
191
191
|
case OperatorType.TYPE_QUERY_FROM_CONTEXT:
|
|
@@ -194,7 +194,7 @@ export class GuardParser {
|
|
|
194
194
|
if (variable) {
|
|
195
195
|
let v = Guard.get_variable_value(variable, identifer[0], type);
|
|
196
196
|
if (v) {
|
|
197
|
-
result.push('0x' +
|
|
197
|
+
result.push('0x' + Bcs.getInstance().de(BCS.ADDRESS, Uint8Array.from(v)).toString());
|
|
198
198
|
arr.splice(0, 1); // splice cmd
|
|
199
199
|
break;
|
|
200
200
|
}
|
|
@@ -211,17 +211,17 @@ export class GuardParser {
|
|
|
211
211
|
return true;
|
|
212
212
|
}
|
|
213
213
|
// callback to parse guard's object-queries into Guard_Query_Object[]
|
|
214
|
-
static rpc_sense_objects_fn = (response, param, option) => {
|
|
214
|
+
static rpc_sense_objects_fn = (protocol, response, param, option) => {
|
|
215
215
|
if (!response.error) {
|
|
216
216
|
let c = response?.data?.content;
|
|
217
|
-
let index =
|
|
217
|
+
let index = protocol.WOWOK_OBJECTS_TYPE().findIndex(v => v.includes('guard::Guard') && v == c.type);
|
|
218
218
|
if (index >= 0 && c.fields.id.id == param.objectid) { // GUARD OBJECT
|
|
219
219
|
if (!param?.variables) {
|
|
220
220
|
let v = new Map();
|
|
221
221
|
for (let i = 0; i < c.fields.variables.length; i++) {
|
|
222
222
|
let variable = c.fields.variables[i];
|
|
223
223
|
let bret;
|
|
224
|
-
if (variable.type == (
|
|
224
|
+
if (variable.type == (protocol.WOWOK_OBJECTS_PREFIX_TYPE()[index] + 'Variable')) { // ...::guard::Variable
|
|
225
225
|
if (variable.fields.type == OperatorType.TYPE_FUTURE_QUERY || variable.fields.type == ContextType.TYPE_CONTEXT_FUTURE_ID) {
|
|
226
226
|
bret = Guard.add_future_variable(v, variable.fields.identifier, variable.fields.type, variable.fields?.value ? Uint8Array.from(variable.fields.value) : undefined, undefined, false);
|
|
227
227
|
}
|
|
@@ -239,7 +239,7 @@ export class GuardParser {
|
|
|
239
239
|
}
|
|
240
240
|
for (let i = 0; i < c.fields.senses.length; i++) {
|
|
241
241
|
let sense = c.fields.senses[i];
|
|
242
|
-
if (sense.type == (
|
|
242
|
+
if (sense.type == (protocol.WOWOK_OBJECTS_PREFIX_TYPE()[index] + 'Sense')) { // ...::guard::Sense
|
|
243
243
|
let result = [];
|
|
244
244
|
if (param?.parser && param.parser(result, param.objectid, Uint8Array.from(sense.fields.input.fields.bytes), param.variables)) {
|
|
245
245
|
param.data = param.data.concat(result); // DONT array_unique senses
|
|
@@ -250,11 +250,11 @@ export class GuardParser {
|
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
252
|
// construct Guard_Query_Object of wowok objects for passport verify
|
|
253
|
-
static rpc_query_cmd_fn = (response, param, option) => {
|
|
253
|
+
static rpc_query_cmd_fn = (protocol, response, param, option) => {
|
|
254
254
|
if (!response.error && response.data?.objectId == param.objectid && response.data?.type) {
|
|
255
|
-
for (let k = 0; k <
|
|
256
|
-
if (response?.data?.type.includes(
|
|
257
|
-
param.data = { target:
|
|
255
|
+
for (let k = 0; k < protocol.WOWOK_OBJECTS_TYPE().length; k++) {
|
|
256
|
+
if (response?.data?.type.includes(protocol.WOWOK_OBJECTS_TYPE()[k])) { // type: pack::m::Object<...>
|
|
257
|
+
param.data = { target: protocol.WOWOK_OBJECTS_PREFIX_TYPE()[k] + 'guard_query',
|
|
258
258
|
object: Inputs.SharedObjectRef({
|
|
259
259
|
objectId: response.data.objectId,
|
|
260
260
|
mutable: false,
|
|
@@ -282,7 +282,7 @@ export class Passport {
|
|
|
282
282
|
}
|
|
283
283
|
this.protocol = protocol;
|
|
284
284
|
let txb = protocol.CurrentSession();
|
|
285
|
-
|
|
285
|
+
this.passport = txb.moveCall({
|
|
286
286
|
target: protocol.PassportFn('new'),
|
|
287
287
|
arguments: []
|
|
288
288
|
});
|
|
@@ -290,31 +290,41 @@ export class Passport {
|
|
|
290
290
|
guards.forEach((guard) => {
|
|
291
291
|
txb.moveCall({
|
|
292
292
|
target: protocol.PassportFn('guard_add'),
|
|
293
|
-
arguments: [passport, Protocol.TXB_OBJECT(txb, guard)]
|
|
293
|
+
arguments: [this.passport, Protocol.TXB_OBJECT(txb, guard)]
|
|
294
294
|
});
|
|
295
295
|
});
|
|
296
|
+
let result = new Map();
|
|
296
297
|
future_values?.forEach((v) => {
|
|
298
|
+
if (result.has(v.guardid)) {
|
|
299
|
+
result.get(v.guardid)?.identifier.push(v.identifier);
|
|
300
|
+
result.get(v.guardid)?.real_address.push(v.value);
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
result.set(v.guardid, { identifier: [v.identifier], real_address: [v.value] });
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
result.forEach((v, k) => {
|
|
297
307
|
txb.moveCall({
|
|
298
|
-
target: protocol.PassportFn('
|
|
299
|
-
arguments: [passport, txb.pure(
|
|
300
|
-
txb.pure(
|
|
308
|
+
target: protocol.PassportFn('futures_set'),
|
|
309
|
+
arguments: [this.passport, txb.pure(Bcs.getInstance().ser_address(k)), txb.pure(Bcs.getInstance().ser_vector_u8(v.identifier)),
|
|
310
|
+
txb.pure(v.real_address, 'vector<address>')]
|
|
301
311
|
});
|
|
302
312
|
});
|
|
303
313
|
// rules: 'verify' & 'query' in turns;'verify' at final end.
|
|
304
314
|
for (let i = 0; i < guard_queries.length; i++) {
|
|
305
315
|
let res = txb.moveCall({
|
|
306
316
|
target: protocol.PassportFn('passport_verify'),
|
|
307
|
-
arguments: [passport, txb.object(Protocol.CLOCK_OBJECT),]
|
|
317
|
+
arguments: [this.passport, txb.object(Protocol.CLOCK_OBJECT),]
|
|
308
318
|
});
|
|
309
319
|
txb.moveCall({
|
|
310
320
|
target: guard_queries[i].target,
|
|
311
|
-
arguments: [txb.object(guard_queries[i].object), passport, res],
|
|
321
|
+
arguments: [txb.object(guard_queries[i].object), this.passport, res],
|
|
312
322
|
typeArguments: guard_queries[i].types,
|
|
313
323
|
});
|
|
314
324
|
}
|
|
315
|
-
|
|
325
|
+
txb.moveCall({
|
|
316
326
|
target: protocol.PassportFn('passport_verify'),
|
|
317
|
-
arguments: [passport, txb.object(Protocol.CLOCK_OBJECT)]
|
|
327
|
+
arguments: [this.passport, txb.object(Protocol.CLOCK_OBJECT)]
|
|
318
328
|
});
|
|
319
329
|
}
|
|
320
330
|
destroy() {
|
package/dist/permission.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BCS } from '@mysten/bcs';
|
|
2
2
|
import { Protocol } from './protocol';
|
|
3
|
-
import { array_unique, IsValidAddress, IsValidArray, IsValidDesription, IsValidUint,
|
|
3
|
+
import { array_unique, IsValidAddress, IsValidArray, IsValidDesription, IsValidUint, Bcs } from './utils';
|
|
4
4
|
import { ERROR, Errors } from './exception';
|
|
5
5
|
export var PermissionIndex;
|
|
6
6
|
(function (PermissionIndex) {
|
|
@@ -208,7 +208,7 @@ export class Permission {
|
|
|
208
208
|
txb.moveCall({
|
|
209
209
|
target: this.protocol.PermissionFn('remove_index'),
|
|
210
210
|
arguments: [Protocol.TXB_OBJECT(txb, this.object), txb.pure(entity_address, BCS.ADDRESS),
|
|
211
|
-
txb.pure(
|
|
211
|
+
txb.pure(Bcs.getInstance().ser_vector_u64(array_unique(index)))]
|
|
212
212
|
});
|
|
213
213
|
}
|
|
214
214
|
remove_entity(entity_address) {
|
package/dist/progress.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BCS } from '@mysten/bcs';
|
|
2
2
|
import { Protocol } from './protocol';
|
|
3
|
-
import {
|
|
3
|
+
import { Bcs, array_unique, IsValidName, IsValidAddress, IsValidArray, OptionNone, IsValidInt } from './utils';
|
|
4
4
|
import { ERROR, Errors } from './exception';
|
|
5
5
|
export class Progress {
|
|
6
6
|
permission;
|
|
@@ -224,8 +224,8 @@ export class Progress {
|
|
|
224
224
|
ERROR(Errors.IsValidAddress, 'sub_id');
|
|
225
225
|
}
|
|
226
226
|
let txb = this.protocol.CurrentSession();
|
|
227
|
-
let diliverable = deliverables_address ? txb.pure(
|
|
228
|
-
let sub = sub_id ? txb.pure(
|
|
227
|
+
let diliverable = deliverables_address ? txb.pure(Bcs.getInstance().ser_option_address(deliverables_address)) : OptionNone(txb);
|
|
228
|
+
let sub = sub_id ? txb.pure(Bcs.getInstance().ser_option_address(sub_id)) : OptionNone(txb);
|
|
229
229
|
if (passport) {
|
|
230
230
|
txb.moveCall({
|
|
231
231
|
target: this.protocol.ProgressFn('next_with_passport'),
|
package/dist/protocol.d.ts
CHANGED
|
@@ -122,7 +122,10 @@ export declare class Protocol {
|
|
|
122
122
|
NewSession: () => TransactionBlock;
|
|
123
123
|
CurrentSession: () => TransactionBlock;
|
|
124
124
|
SignExcute: (exes: ((protocol: Protocol, param: any) => void)[], priv_key: string, param?: any, options?: SuiTransactionBlockResponseOptions) => Promise<SuiTransactionBlockResponse>;
|
|
125
|
+
static SUI_TOKEN_TYPE: string;
|
|
125
126
|
static SUI_COIN_TYPE: string;
|
|
127
|
+
WOWOK_TOKEN_TYPE: () => string;
|
|
128
|
+
WOWOK_COIN_TYPE: () => string;
|
|
126
129
|
static CLOCK_OBJECT: {
|
|
127
130
|
Object: {
|
|
128
131
|
ImmOrOwned: {
|
|
@@ -146,18 +149,17 @@ export declare class Protocol {
|
|
|
146
149
|
};
|
|
147
150
|
static TXB_OBJECT(txb: TransactionBlock, arg: TxbObject): TransactionResult;
|
|
148
151
|
static IsValidObjects: (arr: TxbObject[]) => boolean;
|
|
149
|
-
WOWOK_COIN_TYPE: () => string;
|
|
150
152
|
WOWOK_OBJECTS_TYPE: () => string[];
|
|
151
153
|
WOWOK_OBJECTS_PREFIX_TYPE: () => string[];
|
|
154
|
+
object_name_from_type_repr: (type_repr: string) => string;
|
|
152
155
|
}
|
|
153
156
|
export declare class RpcResultParser {
|
|
154
157
|
static Object_Type_Extra: () => string[];
|
|
155
158
|
static objectids_from_response: (protocol: Protocol, response: SuiTransactionBlockResponse, concat_result?: Map<string, TxbObject[]>) => Map<string, TxbObject[]>;
|
|
156
159
|
}
|
|
157
160
|
export type Query_Param = {
|
|
158
|
-
protocol: Protocol;
|
|
159
161
|
objectid: string;
|
|
160
|
-
callback: (response: SuiObjectResponse, param: Query_Param, option: SuiObjectDataOptions) => void;
|
|
162
|
+
callback: (protocol: Protocol, response: SuiObjectResponse, param: Query_Param, option: SuiObjectDataOptions) => void;
|
|
161
163
|
parser?: (result: any[], guardid: string, chain_sense_bsc: Uint8Array, variable?: VariableType) => boolean;
|
|
162
164
|
data?: any;
|
|
163
165
|
variables?: VariableType;
|
package/dist/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,iBAAiB,EAAE,oBAAoB,EAAE,kCAAkC,EAC3F,2BAA2B,EAAmB,MAAM,uBAAuB,CAAC;AAGhF,OAAO,EAAE,gBAAgB,EAAU,iBAAiB,EAAuB,MAAM,6BAA6B,CAAC;AAE/G,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,oBAAY,OAAO;IACf,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,KAAK,UAAU;CAClB;AAED,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAClD,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,GAAG,MAAM,CAAC;AAC1D,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAClD,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,GAAG,MAAM,CAAC;AAC1D,MAAM,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAC7C,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG,MAAM,CAAE;AACtD,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAC/C,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,MAAM,CAAC;AACvD,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAC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