wowok_agent 1.3.49 → 1.3.51

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.
@@ -45,21 +45,22 @@ export class CallArbitration extends CallBase {
45
45
 
46
46
  protected async prepare() {
47
47
  if (!this.object_address) {
48
- this.object_address = (await LocalMark.Instance().get_address(GetObjectExisted(this.data.object)));
49
- if (this.object_address) {
50
- await this.update_content('Arbitration', this.object_address);
51
- if (!this.content) ERROR(Errors.InvalidParam, 'CallArbitration_Data.data.object:' + this.data.object);
52
- this.permission_address = (this.content as ObjectArbitration).permission;
53
- this.type_parameter = Arbitration.parseObjectType(this.content.type_raw);
54
- } else {
55
- const n = GetObjectMain(this.data.object) as TypeNamedObjectWithPermission;
56
- if (!IsValidArgType(n?.type_parameter)) {
57
- ERROR(Errors.IsValidArgType, 'CallArbitration_Data.data.object.type_parameter');
58
- }
59
- this.permission_address = await LocalMark.Instance().get_address(GetObjectExisted(n?.permission));
60
- this.type_parameter = n.type_parameter;
61
- }
48
+ this.object_address = (await LocalMark.Instance().get_address(GetObjectExisted(this.data.object)));
62
49
  }
50
+
51
+ if (this.object_address) {
52
+ await this.update_content('Arbitration', this.object_address);
53
+ if (!this.content) ERROR(Errors.InvalidParam, 'CallArbitration_Data.data.object:' + this.data.object);
54
+ this.permission_address = (this.content as ObjectArbitration).permission;
55
+ this.type_parameter = Arbitration.parseObjectType((this.content as ObjectArbitration).type_raw);
56
+ } else {
57
+ const n = GetObjectMain(this.data.object) as TypeNamedObjectWithPermission;
58
+ if (!IsValidArgType(n?.type_parameter)) {
59
+ ERROR(Errors.IsValidArgType, 'CallArbitration_Data.data.object.type_parameter');
60
+ }
61
+ this.permission_address = await LocalMark.Instance().get_address(GetObjectExisted(n?.permission));
62
+ this.type_parameter = Arbitration.parseObjectType(n.type_parameter);
63
+ }
63
64
  }
64
65
 
65
66
  async call(account?:string) : Promise<CallResult> {
@@ -71,32 +72,32 @@ export class CallArbitration extends CallBase {
71
72
  if (!this.data?.object) {
72
73
  perms.push(PermissionIndex.arbitration)
73
74
  }
74
- if (this.data?.description !== undefined && this.object_address) {
75
+ if (this.data?.description != null && this.object_address) {
75
76
  perms.push(PermissionIndex.arbitration_description)
76
77
  }
77
- if (this.data?.bPaused !== undefined) {
78
+ if (this.data?.bPaused != null) {
78
79
  perms.push(PermissionIndex.arbitration_pause)
79
80
  }
80
- if (this.data?.endpoint == undefined) { // publish is an irreversible one-time operation
81
+ if (this.data?.endpoint != null) { // publish is an irreversible one-time operation
81
82
  perms.push(PermissionIndex.arbitration_endpoint)
82
83
  }
83
- if (this.data?.fee !== undefined && this.object_address) {
84
+ if (this.data?.fee != null && this.object_address) {
84
85
  perms.push(PermissionIndex.arbitration_fee)
85
86
  }
86
- if (this.data.fee_treasury !== undefined && this.object_address) {
87
+ if (this.data.fee_treasury != null && this.object_address) {
87
88
  perms.push(PermissionIndex.arbitration_treasury)
88
89
  }
89
- if (this.data?.guard !== undefined) {
90
+ if (this.data?.guard != null) {
90
91
  perms.push(PermissionIndex.arbitration_guard)
91
92
  }
92
- if (this.data?.voting_guard !== undefined) {
93
+ if (this.data?.voting_guard != null) {
93
94
  perms.push(PermissionIndex.arbitration_voting_guard)
94
95
  }
95
- if (this.data?.arb_arbitration !== undefined) {
96
+ if (this.data?.arb_arbitration != null) {
96
97
  perms.push(PermissionIndex.arbitration_arbitration)
97
98
  }
98
99
 
99
- if (this.data?.arb_new !== undefined) { // new arb with guard and permission
100
+ if (this.data?.arb_new != null) { // new arb with guard and permission
100
101
  if (this.object_address) {
101
102
  if ((this.content as ObjectArbitration)?.usage_guard) {
102
103
  guards.push((this.content as ObjectArbitration).usage_guard!)
@@ -104,7 +105,7 @@ export class CallArbitration extends CallBase {
104
105
  }
105
106
  }
106
107
 
107
- if (this.data?.arb_vote !== undefined) {
108
+ if (this.data?.arb_vote != null) {
108
109
  perms.push(PermissionIndex.arbitration_vote);
109
110
 
110
111
  const voting_guard = await LocalMark.Instance().get_address(this.data?.arb_vote?.voting_guard);
@@ -150,7 +151,7 @@ export class CallArbitration extends CallBase {
150
151
 
151
152
  const pst = perm?undefined:passport;
152
153
  var arb_new : ArbObject | undefined;
153
- if (this.data?.arb_new !== undefined) {
154
+ if (this.data?.arb_new != null) {
154
155
  const d = this.data?.arb_new.data;
155
156
  const fee = BigInt((this.object_address ? (this.content as ObjectArbitration)?.fee : this.data?.fee) ?? 0);
156
157
  const max_fee = BigInt(d.max_fee ?? fee);
@@ -171,21 +172,21 @@ export class CallArbitration extends CallBase {
171
172
 
172
173
  }
173
174
 
174
- if (this.data?.arb_arbitration !== undefined) {
175
+ if (this.data?.arb_arbitration != null) {
175
176
  const a = await LocalMark.Instance().get_address(this.data.arb_arbitration.arb) ?? arb_new;
176
177
  if (!a) ERROR(Errors.InvalidParam, 'CallArbitration_Data.data.arb_arbitration.arb');
177
178
 
178
179
  obj?.arbitration({arb:a!, feedback:this.data.arb_arbitration.feedback, indemnity:this.data.arb_arbitration.indemnity}, pst)
179
180
  }
180
181
 
181
- if (this.data?.arb_vote !== undefined) {
182
+ if (this.data?.arb_vote != null) {
182
183
  const a = await LocalMark.Instance().get_address(this.data.arb_vote.arb) ?? arb_new;
183
184
  if (!a) ERROR(Errors.InvalidParam, 'CallArbitration_Data.data.arb_vote.arb');
184
185
 
185
186
  obj?.vote({arb:a!, voting_guard:this.data.arb_vote.voting_guard, agrees:this.data.arb_vote.agrees}, pst)
186
187
  }
187
188
 
188
- if (this.data?.arb_withdraw_fee !== undefined) {
189
+ if (this.data?.arb_withdraw_fee != null) {
189
190
  const a = await LocalMark.Instance().get_address(this.data.arb_withdraw_fee.arb);
190
191
  if (!a) ERROR(Errors.InvalidParam, 'CallArbitration_Data.data.arb_withdraw_fee.arb');
191
192
 
@@ -196,16 +197,16 @@ export class CallArbitration extends CallBase {
196
197
  await this.new_with_mark('Arb', txb, obj?.arb_launch(arb_new), (this.data?.arb_new as any)?.namedNew, account);
197
198
  }
198
199
 
199
- if (this.data?.description !== undefined && this.object_address) {
200
+ if (this.data?.description != null && this.object_address) {
200
201
  obj?.set_description(this.data.description, pst);
201
202
  }
202
- if (this.data?.endpoint !== undefined) {
203
+ if (this.data?.endpoint != null) {
203
204
  obj?.set_endpoint(this.data.endpoint, pst)
204
205
  }
205
- if (this.data?.fee !== undefined && this.object_address) {
206
+ if (this.data?.fee != null && this.object_address) {
206
207
  obj?.set_fee(BigInt(this.data.fee), pst)
207
208
  }
208
- if (this.data?.fee_treasury !== undefined && this.object_address) {
209
+ if (this.data?.fee_treasury != null && this.object_address) {
209
210
  const treasury_address = await LocalMark.Instance().get_address(GetObjectExisted(this.data.fee_treasury));
210
211
  if (!treasury_address) {
211
212
  withdraw_treasury = Treasury.New(txb, this.type_parameter!, permission,
@@ -223,7 +224,7 @@ export class CallArbitration extends CallBase {
223
224
  obj?.set_guard(guard, pst)
224
225
  }
225
226
 
226
- if (this.data?.voting_guard !== undefined) {
227
+ if (this.data?.voting_guard != null) {
227
228
  switch (this.data.voting_guard.op) {
228
229
  case 'add':
229
230
  case 'set':
@@ -251,7 +252,7 @@ export class CallArbitration extends CallBase {
251
252
  }
252
253
  }
253
254
 
254
- if (this.data?.bPaused !== undefined) {
255
+ if (this.data?.bPaused != null) {
255
256
  obj?.pause(this.data.bPaused, pst);
256
257
  }
257
258
  if (withdraw_treasury) {
package/src/call/base.ts CHANGED
@@ -58,13 +58,13 @@ export const GetObjectParam = (object: ObjectParam | undefined) : NamedObjectWit
58
58
  export type ObjectsOp = {op:'set' | 'add' | 'remove' ; objects:string[]} | {op:'removeall'};
59
59
 
60
60
  // address from local Account or local Mark.
61
- export type AccountOrMark_Address = {account_name?: string} | {mark_name: string};
61
+ export type AccountOrMark_Address = {account_or_address?: string} | {mark_or_address: string};
62
62
 
63
63
  export const GetAccountOrMark_Address = async (entity?: AccountOrMark_Address) : Promise<string | undefined> => {
64
- if (typeof((entity as any)?.mark_name) === 'string') {
65
- return await LocalMark.Instance().get_address((entity as any).mark_name);
64
+ if (typeof((entity as any)?.mark_or_address) === 'string') {
65
+ return await LocalMark.Instance().get_address((entity as any).mark_or_address);
66
66
  } else {
67
- return (await Account.Instance().get((entity as any)?.account_name))?.address;
67
+ return (await Account.Instance().get((entity as any)?.account_or_address))?.address;
68
68
  }
69
69
  }
70
70
 
@@ -160,7 +160,7 @@ export class CallBase {
160
160
  var guards : string[] = [];
161
161
 
162
162
  if (permIndex.length > 0 || checkOwner) {
163
- const p = await query_permission({permission_object:permission, address:{account_name:account}});
163
+ const p = await query_permission({permission_object:permission, address:{account_or_address:account}});
164
164
  if (checkOwner && !p.owner) ERROR(Errors.noPermission, 'owner');
165
165
  if (checkAdmin && !p.admin) ERROR(Errors.noPermission, 'admin');
166
166
 
@@ -211,7 +211,7 @@ export class CallBase {
211
211
 
212
212
  // onchain mark
213
213
  if (!this.resouceObject) {
214
- const r = await query_personal({address:{account_name:account}});
214
+ const r = await query_personal({address:{account_or_address:account}});
215
215
  if (!r?.mark_object) {
216
216
  this.resouceObject = Entity.From(txb).create_resource2(); // new
217
217
  Resource.From(txb, this.resouceObject).add(object, tags, named_new?.name);
@@ -35,21 +35,21 @@ export class CallDemand extends CallBase {
35
35
 
36
36
  protected async prepare(): Promise<void> {
37
37
  if (!this.object_address) {
38
- this.object_address = (await LocalMark.Instance().get_address(GetObjectExisted(this.data.object)));
39
- if (this.object_address) {
40
- await this.update_content('Demand', this.object_address);
41
- if (!this.content) ERROR(Errors.InvalidParam, 'CallDemand_Data.data.object:' + this.object_address);
42
- this.permission_address = (this.content as ObjectDemand).permission;
43
- this.type_parameter = Demand.parseObjectType(this.content.type_raw);
44
- } else {
45
- const n = GetObjectMain(this.data.object) as TypeNamedObjectWithPermission;
46
- if (!IsValidArgType(n?.type_parameter)) {
47
- ERROR(Errors.IsValidArgType, 'CallDemand_Data.data.object.type_parameter');
48
- }
49
- this.permission_address = (await LocalMark.Instance().get_address(GetObjectExisted(n?.permission)));
50
- this.type_parameter = n.type_parameter;
51
- }
38
+ this.object_address = (await LocalMark.Instance().get_address(GetObjectExisted(this.data.object)));
52
39
  }
40
+ if (this.object_address) {
41
+ await this.update_content('Demand', this.object_address);
42
+ if (!this.content) ERROR(Errors.InvalidParam, 'CallDemand_Data.data.object:' + this.object_address);
43
+ this.permission_address = (this.content as ObjectDemand).permission;
44
+ this.type_parameter = Demand.parseObjectType((this.content as ObjectDemand).type_raw);
45
+ } else {
46
+ const n = GetObjectMain(this.data.object) as TypeNamedObjectWithPermission;
47
+ if (!IsValidArgType(n?.type_parameter)) {
48
+ ERROR(Errors.IsValidArgType, 'CallDemand_Data.data.object.type_parameter');
49
+ }
50
+ this.permission_address = (await LocalMark.Instance().get_address(GetObjectExisted(n?.permission)));
51
+ this.type_parameter = Demand.parseObjectType(n.type_parameter);
52
+ }
53
53
  }
54
54
  async call(account?:string) : Promise<CallResult> {
55
55
  var checkOwner = false; const guards : string[] = [];
@@ -60,10 +60,10 @@ export class CallDemand extends CallBase {
60
60
  if (!this.data?.object) {
61
61
  perms.push(PermissionIndex.demand)
62
62
  }
63
- if (this.data?.description !== undefined && this.object_address) {
63
+ if (this.data?.description != null && this.object_address) {
64
64
  perms.push(PermissionIndex.demand_description)
65
65
  }
66
- if (this.data?.time_expire !== undefined && this.object_address) {
66
+ if (this.data?.time_expire != null && this.object_address) {
67
67
  perms.push(PermissionIndex.demand_expand_time)
68
68
  }
69
69
  if (this.data?.bounty?.op === 'reward') {
@@ -72,10 +72,10 @@ export class CallDemand extends CallBase {
72
72
  if (this.data?.bounty?.op === 'refund') {
73
73
  perms.push(PermissionIndex.demand_refund)
74
74
  }
75
- if (this.data?.guard !== undefined) {
75
+ if (this.data?.guard != null) {
76
76
  perms.push(PermissionIndex.demand_guard)
77
77
  }
78
- if (this.data?.present !== undefined) {
78
+ if (this.data?.present != null) {
79
79
  if (this.object_address) {
80
80
  if ((this.content as ObjectDemand)?.guard?.object) {
81
81
  guards.push((this.content as ObjectDemand).guard?.object!);
@@ -101,7 +101,7 @@ export class CallDemand extends CallBase {
101
101
  permission = perm.get_object();
102
102
  }
103
103
 
104
- if (this.data.time_expire !== undefined) {
104
+ if (this.data.time_expire != null) {
105
105
  obj = Demand.New(txb, this.type_parameter!, this.data.time_expire?.op === 'duration' ? true : false,
106
106
  this.data.time_expire?.op === 'duration' ? this.data.time_expire.minutes : this.data.time_expire?.time,
107
107
  permission, this.data?.description??'', perm?undefined:passport)
@@ -115,8 +115,8 @@ export class CallDemand extends CallBase {
115
115
  if (!permission) ERROR(Errors.InvalidParam, 'CallDemand_Data.data.object.permission');
116
116
 
117
117
  const pst = perm?undefined:passport;
118
- if (this.data?.present !== undefined) {
119
- if ((this.content as ObjectDemand)?.guard?.service_id_in_guard !== undefined && (this.content as ObjectDemand)?.guard?.service_id_in_guard !== null) {
118
+ if (this.data?.present != null) {
119
+ if ((this.content as ObjectDemand)?.guard?.service_id_in_guard != null && (this.content as ObjectDemand)?.guard?.service_id_in_guard !== null) {
120
120
  obj?.present((this.content as ObjectDemand)!.guard!.service_id_in_guard!, undefined, this.data.present.recommend_words, pst);
121
121
  } else {
122
122
  const service_address = await LocalMark.Instance().get_address(this.data.present.service);
@@ -134,19 +134,19 @@ export class CallDemand extends CallBase {
134
134
  }
135
135
  }
136
136
 
137
- if (this.data?.description !== undefined && this.object_address) {
137
+ if (this.data?.description != null && this.object_address) {
138
138
  obj?.set_description(this.data.description, pst);
139
139
  }
140
- if (this.data?.time_expire !== undefined && this.object_address) {
140
+ if (this.data?.time_expire != null && this.object_address) {
141
141
  obj?.expand_time(this.data.time_expire.op === 'duration' ? true : false,
142
142
  this.data.time_expire.op === 'duration' ? this.data.time_expire.minutes : this.data.time_expire.time, pst)
143
143
  }
144
- if (this.data?.bounty !== undefined) {
144
+ if (this.data?.bounty != null) {
145
145
  if (this.data.bounty.op === 'add') {
146
146
  const bounty = await LocalMark.Instance().get_address((this.data.bounty.object as any)?.address)
147
147
  if (bounty) {
148
148
  obj.deposit(bounty)
149
- } else if ((this.data.bounty.object as any)?.balance !== undefined){
149
+ } else if ((this.data.bounty.object as any)?.balance != null){
150
150
  const r = await Account.Instance().get_coin_object(txb, (this.data.bounty.object as any)?.balance, account, this.type_parameter);
151
151
  if (r) obj.deposit(r)
152
152
  }
@@ -159,7 +159,7 @@ export class CallDemand extends CallBase {
159
159
  }
160
160
  }
161
161
 
162
- if (this.data?.guard !== undefined) {
162
+ if (this.data?.guard != null) {
163
163
  const guard = await LocalMark.Instance().get_address(this.data?.guard.address);
164
164
  if (!guard) {
165
165
  ERROR(Errors.InvalidParam, 'CallDemand_Data.data.guard.address')
@@ -50,16 +50,16 @@ export class CallMachine extends CallBase { //@ todo self-owned node operate
50
50
  protected async prepare() {
51
51
  if (!this.object_address) {
52
52
  this.object_address = (await LocalMark.Instance().get_address(GetObjectExisted(this.data?.object)));
53
-
54
- if (this.object_address) {
55
- await this.update_content('Machine', this.object_address);
56
- if (!this.content) ERROR(Errors.InvalidParam, 'CallMachine_Data.data.object:' + this.object_address);
57
- this.permission_address = (this.content as ObjectMachine).permission;
58
- } else {
59
- const n = GetObjectMain(this.data?.object) as TypeNamedObjectWithPermission;
60
- this.permission_address = (await LocalMark.Instance().get_address(GetObjectExisted(n?.permission)));
61
- }
62
53
  }
54
+
55
+ if (this.object_address) {
56
+ await this.update_content('Machine', this.object_address);
57
+ if (!this.content) ERROR(Errors.InvalidParam, 'CallMachine_Data.data.object:' + this.object_address);
58
+ this.permission_address = (this.content as ObjectMachine).permission;
59
+ } else {
60
+ const n = GetObjectMain(this.data?.object) as TypeNamedObjectWithPermission;
61
+ this.permission_address = (await LocalMark.Instance().get_address(GetObjectExisted(n?.permission)));
62
+ }
63
63
  }
64
64
 
65
65
  async call(account?:string) : Promise<CallResult> {
@@ -71,49 +71,49 @@ export class CallMachine extends CallBase { //@ todo self-owned node operate
71
71
  if (!this.data?.object) {
72
72
  perms.push(PermissionIndex.machine)
73
73
  }
74
- if (this.data?.description !== undefined && this.object_address) {
74
+ if (this.data?.description != null && this.object_address) {
75
75
  perms.push(PermissionIndex.machine_description)
76
76
  }
77
- if (this.data?.endpoint !== undefined && this.object_address) {
77
+ if (this.data?.endpoint != null && this.object_address) {
78
78
  perms.push(PermissionIndex.machine_endpoint)
79
79
  }
80
- if (this.data?.consensus_repository !== undefined) {
80
+ if (this.data?.consensus_repository != null) {
81
81
  perms.push(PermissionIndex.machine_repository)
82
82
  }
83
- if (this.data?.nodes !== undefined) {
83
+ if (this.data?.nodes != null) {
84
84
  perms.push(PermissionIndex.machine_node)
85
85
  }
86
86
  if (this.data?.bPublished) { // publish is an irreversible one-time operation
87
87
  perms.push(PermissionIndex.machine_publish)
88
88
  }
89
- if (this.data?.progress_new !== undefined) {
89
+ if (this.data?.progress_new != null) {
90
90
  perms.push(PermissionIndex.progress)
91
91
  }
92
- if (this.data?.progress_context_repository !== undefined) {
92
+ if (this.data?.progress_context_repository != null) {
93
93
  perms.push(PermissionIndex.progress_context_repository)
94
94
  }
95
- if (this.data?.progress_namedOperator !== undefined) {
95
+ if (this.data?.progress_namedOperator != null) {
96
96
  perms.push(PermissionIndex.progress_namedOperator)
97
97
  }
98
- if (this.data?.progress_parent !== undefined) {
98
+ if (this.data?.progress_parent != null) {
99
99
  perms.push(PermissionIndex.progress_parent)
100
100
  }
101
- if (this.data?.progress_task !== undefined) {
101
+ if (this.data?.progress_task != null) {
102
102
  perms.push(PermissionIndex.progress_bind_task)
103
103
  }
104
- if (this.data?.progress_hold !== undefined) {
104
+ if (this.data?.progress_hold != null) {
105
105
  if (this.data.progress_hold.adminUnhold) {
106
106
  perms.push(PermissionIndex.progress_unhold)
107
107
  }
108
108
  }
109
- if (this.data?.bPaused !== undefined) {
109
+ if (this.data?.bPaused != null) {
110
110
  perms.push(PermissionIndex.machine_pause)
111
111
  }
112
- if (this.data?.clone_new!== undefined) {
112
+ if (this.data?.clone_new!= null) {
113
113
  perms.push(PermissionIndex.machine_clone)
114
114
  }
115
115
 
116
- if (this.data?.progress_next !== undefined) {
116
+ if (this.data?.progress_next != null) {
117
117
  if (this.object_address) { // fetch guard
118
118
  const [p, acc] = await Promise.all([
119
119
  LocalMark.Instance().get_address(this.data?.progress_next.progress),
@@ -159,11 +159,11 @@ export class CallMachine extends CallBase { //@ todo self-owned node operate
159
159
 
160
160
  const pst = perm?undefined:passport;
161
161
  var new_progress : Progress | undefined;
162
- if (this.data?.progress_new !== undefined) {
162
+ if (this.data?.progress_new != null) {
163
163
  const task = await LocalMark.Instance().get_address(this.data?.progress_new?.task_address);
164
164
  new_progress = Progress?.New(txb, obj?.get_object(), permission, task, pst);
165
165
  }
166
- if (this.data?.progress_context_repository !== undefined) {
166
+ if (this.data?.progress_context_repository != null) {
167
167
  const p = this.data?.progress_context_repository.progress
168
168
  ? await LocalMark.Instance().get_address(this.data?.progress_context_repository.progress)
169
169
  : new_progress?.get_object();
@@ -171,7 +171,7 @@ export class CallMachine extends CallBase { //@ todo self-owned node operate
171
171
  const rep = await LocalMark.Instance().get_address(this.data?.progress_context_repository.repository);
172
172
  Progress.From(txb, obj?.get_object(), permission, p!).set_context_repository(rep, pst)
173
173
  }
174
- if (this.data?.progress_namedOperator !== undefined) {
174
+ if (this.data?.progress_namedOperator != null) {
175
175
  const p = this.data?.progress_namedOperator.progress
176
176
  ? await LocalMark.Instance().get_address(this.data?.progress_namedOperator.progress)
177
177
  : new_progress?.get_object();
@@ -184,7 +184,7 @@ export class CallMachine extends CallBase { //@ todo self-owned node operate
184
184
  pp.set_namedOperator(v.name, addrs, pst);
185
185
  }
186
186
  }
187
- if (this.data?.progress_parent !== undefined) {
187
+ if (this.data?.progress_parent != null) {
188
188
  const p = this.data?.progress_parent.progress
189
189
  ? await LocalMark.Instance().get_address(this.data?.progress_parent.progress)
190
190
  : new_progress?.get_object();
@@ -200,7 +200,7 @@ export class CallMachine extends CallBase { //@ todo self-owned node operate
200
200
  Progress.From(txb, obj?.get_object(), permission, p!).parent_none();
201
201
  }
202
202
  }
203
- if (this.data?.progress_hold !== undefined) {
203
+ if (this.data?.progress_hold != null) {
204
204
  const p = this.data?.progress_hold.progress
205
205
  ? await LocalMark.Instance().get_address(this.data?.progress_hold.progress)
206
206
  : new_progress?.get_object();
@@ -212,11 +212,11 @@ export class CallMachine extends CallBase { //@ todo self-owned node operate
212
212
  Progress.From(txb, obj?.get_object(), permission, p!).hold(this.data.progress_hold.operation, this.data.progress_hold.bHold)
213
213
  }
214
214
  }
215
- if (this.data?.progress_task !== undefined) {
215
+ if (this.data?.progress_task != null) {
216
216
  const [p, task] = await LocalMark.Instance().get_many_address([this.data?.progress_task.progress, this.data?.progress_task.task_address]);
217
217
  if (p && task) Progress.From(txb, obj?.get_object(), permission, p).bind_task(task, pst);
218
218
  }
219
- if (this.data?.progress_next !== undefined) {
219
+ if (this.data?.progress_next != null) {
220
220
  const p = await LocalMark.Instance().get_address(this.data?.progress_next.progress);
221
221
  if (!p) ERROR(Errors.InvalidParam, 'CallMachine_Data.data.progress_next.progress');
222
222
  var t: OrderWrap[] = [];
@@ -242,14 +242,14 @@ export class CallMachine extends CallBase { //@ todo self-owned node operate
242
242
  await this.new_with_mark('Progress', txb, addr, this.data?.progress_new?.namedNew, account);
243
243
  }
244
244
 
245
- if (this.data?.description !== undefined && this.object_address) {
245
+ if (this.data?.description != null && this.object_address) {
246
246
  obj?.set_description(this.data.description, pst);
247
247
  }
248
- if (this.data?.endpoint !== undefined && this.object_address) {
248
+ if (this.data?.endpoint != null && this.object_address) {
249
249
  obj?.set_endpoint(this.data.endpoint, pst)
250
250
  }
251
251
 
252
- if (this.data?.consensus_repository !== undefined) {
252
+ if (this.data?.consensus_repository != null) {
253
253
  switch (this.data.consensus_repository.op) {
254
254
  case 'add':
255
255
  case 'set':
@@ -270,7 +270,7 @@ export class CallMachine extends CallBase { //@ todo self-owned node operate
270
270
  break;
271
271
  }
272
272
  }
273
- if (this.data?.nodes !== undefined) {
273
+ if (this.data?.nodes != null) {
274
274
  switch (this.data?.nodes?.op) {
275
275
  case 'add':
276
276
  obj?.add_node(this.data.nodes.data, pst)
@@ -299,10 +299,10 @@ export class CallMachine extends CallBase { //@ todo self-owned node operate
299
299
  obj?.publish(passport)
300
300
  }
301
301
 
302
- if (this.data?.bPaused !== undefined) {
302
+ if (this.data?.bPaused != null) {
303
303
  obj?.pause(this.data.bPaused, pst)
304
304
  }
305
- if (this.data?.clone_new !== undefined && this.object_address) {
305
+ if (this.data?.clone_new != null && this.object_address) {
306
306
  await this.new_with_mark('Machine', txb, obj?.clone(true, pst) as TxbAddress, (this.data?.clone_new as any)?.namedNew, account);
307
307
  }
308
308
  if (perm) {
@@ -59,13 +59,13 @@ export class CallPermission extends CallBase {
59
59
 
60
60
  await this.prepare();
61
61
  if (this.object_address) {
62
- if (this.data?.builder !== undefined || this.data?.admin !== undefined) {
62
+ if (this.data?.builder != null || this.data?.admin != null) {
63
63
  checkOwner = true;
64
64
  }
65
- if (this.data?.permission !== undefined || this.data?.biz_permission !== undefined) {
65
+ if (this.data?.permission != null || this.data?.biz_permission != null) {
66
66
  checkAdmin = true;
67
67
  }
68
- if (this.data?.description !== undefined) {
68
+ if (this.data?.description != null) {
69
69
  checkAdmin = true;
70
70
  }
71
71
  return await this.check_permission_and_call(this.object_address, [], [], checkOwner, checkAdmin, account)
@@ -83,10 +83,10 @@ export class CallPermission extends CallBase {
83
83
 
84
84
  if (!obj) ERROR(Errors.InvalidParam, 'CallPermission_Data.data.object');
85
85
 
86
- if (this.data?.description !== undefined && this.data?.object) {
86
+ if (this.data?.description != null && this.data?.object) {
87
87
  obj?.set_description(this.data.description)
88
88
  }
89
- if (this.data?.biz_permission !== undefined) { // High priority operate
89
+ if (this.data?.biz_permission != null) { // High priority operate
90
90
  switch(this.data.biz_permission.op) {
91
91
  case 'add':
92
92
  this.data.biz_permission.data.forEach(v => {
@@ -100,7 +100,7 @@ export class CallPermission extends CallBase {
100
100
  break;
101
101
  }
102
102
  }
103
- if (this.data?.permission !== undefined) {
103
+ if (this.data?.permission != null) {
104
104
  switch (this.data.permission.op) {
105
105
  case 'add entity':
106
106
  var add_entity:Wowok_Permission_Entity[] = [];
@@ -144,7 +144,7 @@ export class CallPermission extends CallBase {
144
144
  break;
145
145
  }
146
146
  }
147
- if (this.data?.admin !== undefined) {
147
+ if (this.data?.admin != null) {
148
148
  switch(this.data.admin?.op) {
149
149
  case 'add':
150
150
  case 'set':
@@ -161,7 +161,7 @@ export class CallPermission extends CallBase {
161
161
  break;
162
162
  }
163
163
  }
164
- if (this.data?.builder !== undefined ) {
164
+ if (this.data?.builder != null ) {
165
165
  const b = await GetAccountOrMark_Address(this.data.builder);
166
166
  if (b) obj?.change_owner(b);
167
167
  }
@@ -26,14 +26,14 @@ export class CallPersonal extends CallBase {
26
26
  }
27
27
  protected async operate (txb:TransactionBlock, passport?:PassportObject, account?: string) {
28
28
  let obj : Resource | undefined ; let entity: Entity = Entity.From(txb);
29
- const entity_data = await query_personal({address:{account_name:account}});
29
+ const entity_data = await query_personal({address:{account_or_address:account}});
30
30
  if (entity_data?.mark_object) {
31
31
  obj = Resource.From(txb, entity_data.mark_object);
32
32
  } else {
33
33
  obj = Resource.From(txb, entity.create_resource2());
34
34
  }
35
35
 
36
- if (this.data?.information !== undefined ) {
36
+ if (this.data?.information != null ) {
37
37
  entity.update(this.data.information)
38
38
  }
39
39