wowok 1.5.43 → 1.5.44

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wowok",
3
- "version": "1.5.43",
3
+ "version": "1.5.44",
4
4
  "description": "Create, collaborate, and transact on your own terms with the AI-driven web3 collaboration protocol.",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
package/src/guard.ts CHANGED
@@ -727,10 +727,12 @@ export class GuardMaker {
727
727
  type === OperatorType.TYPE_LOGIC_EQUAL ||
728
728
  type === OperatorType.TYPE_LOGIC_HAS_SUBSTRING ||
729
729
  type === OperatorType.TYPE_LOGIC_AND ||
730
- type === OperatorType.TYPE_LOGIC_OR)
730
+ type === OperatorType.TYPE_LOGIC_OR ||
731
+ type === OperatorType.TYPE_NUMBER_ADD ||
732
+ type === OperatorType.TYPE_NUMBER_DEVIDE ||
733
+ type === OperatorType.TYPE_NUMBER_MULTIPLY ||
734
+ type === OperatorType.TYPE_NUMBER_SUBTRACT ||
735
+ type === OperatorType.TYPE_NUMBER_MOD)
731
736
  }
732
737
  }
733
738
 
734
-
735
-
736
-
package/src/passport.ts CHANGED
@@ -67,7 +67,6 @@ export class GuardParser {
67
67
  // console.log(constants)
68
68
 
69
69
  let inputs : DeGuardInput[] = GuardParser.parse_bcs(constants, guard_input_bytes);
70
-
71
70
  // console.log(data);
72
71
  if (!inputs || inputs.length == 0) ERROR(Errors.Fail, 'GuardObject: data parsed error');
73
72
  let stack: DeGuardData[] = [];
@@ -149,6 +148,7 @@ export class GuardParser {
149
148
  current.ret_type = ValueType.TYPE_BOOL;
150
149
  if (stack.length < current.value || current.value < 2) ERROR(Errors.Fail, 'ResolveData: ' + current.type);
151
150
  var p0 = stack.pop() as DeGuardData;
151
+ current.child.push(p0);
152
152
  for (let i = 1; i < current.value; ++i) {
153
153
  var p = stack.pop() as DeGuardData;
154
154
  if (!p.ret_type || (p.ret_type != p0.ret_type)) ERROR(Errors.Fail, 'ResolveData: ' + current.type + ' INVALID param type');
@@ -184,7 +184,7 @@ export class GuardParser {
184
184
  current.ret_type = r[4];
185
185
 
186
186
  if (stack.length < r[3].length) ERROR(Errors.Fail, 'OperateParamCount: cmd param lost ' + current.type);
187
- r[3].forEach((e:number) => {
187
+ r[3].forEach((e:number) => {
188
188
  let d = stack.pop() as DeGuardData;
189
189
  if (!d?.ret_type || d.ret_type != e) {
190
190
  ERROR(Errors.Fail, 'OperateParamCount: cmd param not match ' + current.type);
package/src/service.ts CHANGED
@@ -360,22 +360,24 @@ export class Service {
360
360
  }
361
361
  }
362
362
  }
363
- add_arbitration(arbitraion:ArbitrationObject, passport?:PassportObject) {
363
+ add_arbitration(arbitraion:ArbitrationObject, arbitraion_token_type:string, passport?:PassportObject) {
364
364
  if (!Protocol.IsValidObjects([arbitraion])) {
365
- ERROR(Errors.IsValidObjects, 'arbitration_add');
365
+ ERROR(Errors.IsValidObjects, 'add_arbitration.arbitraion');
366
+ }
367
+ if (!IsValidTokenType(arbitraion_token_type)) {
368
+ ERROR(Errors.IsValidTokenType, 'add_arbitration.arbitraion_token_type')
366
369
  }
367
-
368
370
  if (passport) {
369
371
  this.txb.moveCall({
370
372
  target:Protocol.Instance().ServiceFn('arbitration_add_with_passport') as FnCallType,
371
- arguments:[Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, arbitraion), Protocol.TXB_OBJECT(this.txb, this.permission)],
372
- typeArguments:[this.pay_token_type]
373
+ arguments:[passport, Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, arbitraion), Protocol.TXB_OBJECT(this.txb, this.permission)],
374
+ typeArguments:[this.pay_token_type, arbitraion_token_type]
373
375
  })
374
376
  } else {
375
377
  this.txb.moveCall({
376
- target:Protocol.Instance().ServiceFn('repository_add') as FnCallType,
378
+ target:Protocol.Instance().ServiceFn('arbitration_add') as FnCallType,
377
379
  arguments:[Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, arbitraion), Protocol.TXB_OBJECT(this.txb, this.permission)],
378
- typeArguments:[this.pay_token_type]
380
+ typeArguments:[this.pay_token_type, arbitraion_token_type]
379
381
  })
380
382
  }
381
383
  }
@@ -383,7 +385,7 @@ export class Service {
383
385
  if (!removeall && address.length===0) return;
384
386
 
385
387
  if (!IsValidArray(address, IsValidAddress)) {
386
- ERROR(Errors.IsValidArray, 'arbitration_remove.address');
388
+ ERROR(Errors.IsValidArray, 'remove_arbitration.address');
387
389
  }
388
390
 
389
391
  if (passport) {