wowok 1.4.19 → 1.4.21

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/src/guard.ts CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- import { Protocol, LogicsInfo, GuardAddress, FnCallType, Data_Type, MODULES, ContextType, ValueType, OperatorType, ConstantType, SER_VALUE} from './protocol';
3
+ import { Protocol, LogicsInfo, GuardAddress, FnCallType, Data_Type, MODULES, ContextType, ValueType, OperatorType, SER_VALUE} from './protocol';
4
4
  import { concatenate, array_equal } from './utils';
5
5
  import { IsValidDesription, Bcs, IsValidInt, IsValidAddress, FirstLetterUppercase, insertAtHead } from './utils';
6
6
  import { ERROR, Errors } from './exception';
@@ -9,9 +9,9 @@ import { Transaction as TransactionBlock } from '@mysten/sui/transactions';
9
9
  export type GuardConstant = Map<number, Guard_Variable>;
10
10
 
11
11
  export interface Guard_Variable {
12
- type: ConstantType ,
12
+ type: ValueType ,
13
13
  value?: Uint8Array,
14
- witness?: Uint8Array,
14
+ bWitness : boolean,
15
15
  }
16
16
 
17
17
  export interface Guard_Options {
@@ -39,8 +39,9 @@ export class Guard {
39
39
 
40
40
  let bValid = true;
41
41
  constants?.forEach((v, k) => {
42
- if (!GuardConstantHelper.IsValidIndentifier(k)) bValid = false;
43
- if (!v.value && !v.witness) bValid = false;
42
+ if (!GuardMaker.IsValidIndentifier(k)) bValid = false;
43
+ if (v.value && v.bWitness) bValid = false;
44
+ if (v.value === undefined && !v.bWitness) bValid = false;
44
45
  })
45
46
  if (!bValid) {
46
47
  ERROR(Errors.InvalidParam, 'launch constants')
@@ -53,25 +54,19 @@ export class Guard {
53
54
  target: Protocol.Instance().GuardFn('new') as FnCallType,
54
55
  arguments: [txb.pure.string(description), txb.pure.vector('u8', [].slice.call(input.reverse()))],
55
56
  });
56
-
57
+ console.log(constants)
57
58
  constants?.forEach((v, k) => {
58
- if (v.type == ContextType.TYPE_WITNESS_ID) {
59
- if (!v.witness) {
60
- ERROR(Errors.InvalidParam, 'constants type')
61
- }
62
- const n = insertAtHead(v.witness!, v.type);
59
+ if (v.bWitness) {
60
+ const n = new Uint8Array(1); n.set([v.type], 0);
63
61
  txb.moveCall({
64
62
  target:Protocol.Instance().GuardFn("constant_add") as FnCallType,
65
- arguments:[guard, txb.pure.u8(k), txb.pure.vector('u8', [].slice.call(n)), txb.pure.bool(true)]
66
- })
63
+ arguments:[guard, txb.pure.u8(k), txb.pure.bool(true), txb.pure.vector('u8', [].slice.call(n)), txb.pure.bool(true)]
64
+ })
67
65
  } else {
68
- if (!v.value) {
69
- ERROR(Errors.InvalidParam, 'constants type')
70
- }
71
66
  const n = insertAtHead(v.value!, v.type);
72
67
  txb.moveCall({
73
68
  target:Protocol.Instance().GuardFn("constant_add") as FnCallType,
74
- arguments:[guard, txb.pure.u8(k), txb.pure.vector('u8', [].slice.call(n)), txb.pure.bool(true)]
69
+ arguments:[guard, txb.pure.u8(k), txb.pure.bool(false), txb.pure.vector('u8', [].slice.call(n)), txb.pure.bool(true)]
75
70
  })
76
71
  }
77
72
  });
@@ -95,156 +90,193 @@ export class Guard {
95
90
  arguments: []
96
91
  });
97
92
  }
98
-
99
93
  static QUERIES:any[] = [
100
94
  // module, 'name', 'id', [input], output
101
95
  [MODULES.permission, 'Owner', 1, [], ValueType.TYPE_ADDRESS, "Owner's address."],
102
- [MODULES.permission, 'Is Admin', 2, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is a certain address an administrator?', 'Input:address'],
103
- [MODULES.permission, 'Has Rights', 3, [ValueType.TYPE_ADDRESS, ValueType.TYPE_U64], ValueType.TYPE_BOOL, 'Does an address have a certain permission(Admin always have permissions)?', 'Input 1:address; Input 2:permission index'],
104
- [MODULES.permission, 'Contains Address', 4, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address is included in the personnel permission table?', 'Input:address'],
105
- [MODULES.permission, 'Contains Permission', 5, [ValueType.TYPE_ADDRESS, ValueType.TYPE_U64], ValueType.TYPE_BOOL, 'Whether a certain permission for a certain address is defined in the personnel permission table?', 'Input 1:address; Input 2:permission index'],
106
- [MODULES.permission, 'Contains Permission Guard', 6, [ValueType.TYPE_ADDRESS, ValueType.TYPE_U64], ValueType.TYPE_BOOL, 'Whether a permission guard for a certain address is defined in the personnel permission table?', 'Input 1:address; Input 2:permission index'],
107
- [MODULES.permission, 'Permission Guard', 7, [ValueType.TYPE_ADDRESS, ValueType.TYPE_U64], ValueType.TYPE_ADDRESS, 'Permission guard for a certain address.', 'Input 1:address; Input 2:permission index'],
108
- [MODULES.permission, 'Number of Entities', 8, [], ValueType.TYPE_U64, 'Number of entities in the personnel permission table.'],
109
- [MODULES.permission, 'Number of Admin', 9, [], ValueType.TYPE_U64, 'Number of administrators.'],
96
+ [MODULES.permission, 'Is Admin', 2, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is a certain address an administrator?', ['address']],
97
+ [MODULES.permission, 'Has Rights', 3, [ValueType.TYPE_ADDRESS, ValueType.TYPE_U64], ValueType.TYPE_BOOL, 'Does an address have a certain permission(Admin always have permissions)?', ['address', 'permission index']],
98
+ [MODULES.permission, 'Contains Address', 4, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address is included in the personnel permission table?', ['address']],
99
+ [MODULES.permission, 'Contains Permission', 5, [ValueType.TYPE_ADDRESS, ValueType.TYPE_U64], ValueType.TYPE_BOOL, 'Whether a certain permission for a certain address is defined in the personnel permission table?', ['address', 'permission index']],
100
+ [MODULES.permission, 'Contains Permission Guard', 6, [ValueType.TYPE_ADDRESS, ValueType.TYPE_U64], ValueType.TYPE_BOOL, 'Whether a permission guard for a certain address is defined in the personnel permission table?', ['address', 'permission index']],
101
+ [MODULES.permission, 'Permission Guard', 7, [ValueType.TYPE_ADDRESS, ValueType.TYPE_U64], ValueType.TYPE_ADDRESS, 'Permission guard for a certain address.', ['address', 'permission index']],
102
+ [MODULES.permission, 'Number of Entities', 8, [], ValueType.TYPE_U64, 'Number of entities in the personnel permission table.', []],
103
+ [MODULES.permission, 'Number of Admin', 9, [], ValueType.TYPE_U64, 'Number of administrators.', []],
110
104
 
111
- [MODULES.repository, 'Permission', 100, [], ValueType.TYPE_ADDRESS, 'Permission object address.'],
112
- [MODULES.repository, 'Contains Policy', 101, [ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Is a consensus policy included?', 'Input:the filed name'],
113
- [MODULES.repository, 'Is Permission set of Policy', 102, [ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Does a certain consensus policy set data operation permissions?', 'Input:the policy name'],
114
- [MODULES.repository, 'Permission of Policy', 103, [ValueType.TYPE_STRING], ValueType.TYPE_U64, 'The permission index of a certain consensus policy in the Permission object.', 'Input:the policy name'],
115
- [MODULES.repository, 'Value Type of Policy', 104, [ValueType.TYPE_STRING], ValueType.TYPE_U8, 'Data types defined by consensus policy.', 'Input:the policy name'],
116
- [MODULES.repository, 'Contains Data for An Address', 105, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether data exists at a certain address?', 'Input:address'],
117
- [MODULES.repository, 'Contains Data', 106, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Does it contain data for a certain field of an address?', 'Input 1:address, Input 2:the field name'],
118
- [MODULES.repository, 'Raw data without Type', 107, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_VEC_U8, 'Data for a field at an address and does not contain data type information.', 'Input 1:address, Input 2:the field name'],
119
- [MODULES.repository, 'Raw data', 108, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_VEC_U8, 'Data for a field at an address, and the first byte contains data type information.', 'Input 1:address, Input 2:the field name'],
120
- [MODULES.repository, 'Type', 109, [], ValueType.TYPE_U8, 'The repository Type. 0: Normal; 1: Wowok greenee.'],
121
- [MODULES.repository, 'Policy Mode', 110, [], ValueType.TYPE_U8, 'Policy Mode. 0: Free mode; 1: Strict mode.'],
122
- [MODULES.repository, 'Reference Count', 111, [], ValueType.TYPE_U64, 'The number of times it is referenced by other objects.'],
123
- [MODULES.repository, 'Is Referenced by An Object', 112, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is it referenced by an object?', 'Input:address'],
124
- [MODULES.repository, 'Data Number', 113, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_U256, 'Data for a field at an address and get unsigned integer type data.', 'Input 1:address, Input 2:the field name'],
125
- [MODULES.repository, 'Data String', 114, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_STRING, 'Data for a field at an address and get string type data.', 'Input 1:address, Input 2:the field name'],
126
- [MODULES.repository, 'Data Address', 115, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_ADDRESS, 'Data for a field at an address and get address type data.', 'Input 1:address, Input 2:the field name'],
127
- [MODULES.repository, 'Data Bool', 116, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Data for a field at an address and get bool type data.', 'Input 1:address, Input 2:the field name'],
128
- [MODULES.repository, 'Data Number Vector', 117, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_VEC_U256, 'Data for a field at an address and get unsigned integer vector type data.', 'Input 1:address, Input 2:the field name'],
129
- [MODULES.repository, 'Data String Vector', 118, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_VEC_STRING, 'Data for a field at an address and get string vector type data.', 'Input 1:address, Input 2:the field name'],
130
- [MODULES.repository, 'Data Address Vector', 119, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_VEC_ADDRESS, 'Data for a field at an address and get address vector type data.', 'Input 1:address, Input 2:the field name'],
131
- [MODULES.repository, 'Data Bool Vector', 120, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_VEC_BOOL, 'Data for a field at an address and get bool vector type data.', 'Input 1:address, Input 2:the field name'],
105
+ [MODULES.repository, 'Permission', 100, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
106
+ [MODULES.repository, 'Contains Policy', 101, [ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Is a consensus policy included?', ['the filed name']],
107
+ [MODULES.repository, 'Is Permission set of Policy', 102, [ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Does a certain consensus policy set data operation permissions?', ['the policy name']],
108
+ [MODULES.repository, 'Permission of Policy', 103, [ValueType.TYPE_STRING], ValueType.TYPE_U64, 'The permission index of a certain consensus policy in the Permission object.', ['the policy name']],
109
+ [MODULES.repository, 'Value Type of Policy', 104, [ValueType.TYPE_STRING], ValueType.TYPE_U8, 'Data types defined by consensus policy.', ['the policy name']],
110
+ [MODULES.repository, 'Contains Data for An Address', 105, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether data exists at a certain address?', ['address']],
111
+ [MODULES.repository, 'Contains Data', 106, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Does it contain data for a certain field of an address?', ['address','the field name']],
112
+ [MODULES.repository, 'Raw data without Type', 107, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_VEC_U8, 'Data for a field at an address and does not contain data type information.', ['address', 'the field name']],
113
+ [MODULES.repository, 'Raw data', 108, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_VEC_U8, 'Data for a field at an address, and the first byte contains data type information.', ['address', 'the field name']],
114
+ [MODULES.repository, 'Type', 109, [], ValueType.TYPE_U8, 'The repository Type. 0: Normal; 1: Wowok greenee.', []],
115
+ [MODULES.repository, 'Policy Mode', 110, [], ValueType.TYPE_U8, 'Policy Mode. 0: Free mode; 1: Strict mode.', []],
116
+ [MODULES.repository, 'Reference Count', 111, [], ValueType.TYPE_U64, 'The number of times it is referenced by other objects.', []],
117
+ [MODULES.repository, 'Is Referenced by An Object', 112, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is it referenced by an object?', ['address']],
118
+ [MODULES.repository, 'Number Data', 113, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_U256, 'Data for a field at an address and get unsigned integer type data.', ['address', 'the field name']],
119
+ [MODULES.repository, 'String Data', 114, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_STRING, 'Data for a field at an address and get string type data.', ['address', 'the field name']],
120
+ [MODULES.repository, 'Address Data', 115, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_ADDRESS, 'Data for a field at an address and get address type data.', ['address', 'the field name']],
121
+ [MODULES.repository, 'Bool Data', 116, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Data for a field at an address and get bool type data.', ['address', 'the field name']],
122
+ [MODULES.repository, 'Number Vector Data', 117, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_VEC_U256, 'Data for a field at an address and get unsigned integer vector type data.', ['address', 'the field name']],
123
+ [MODULES.repository, 'String Vector Data', 118, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_VEC_STRING, 'Data for a field at an address and get string vector type data.', ['address', 'the field name']],
124
+ [MODULES.repository, 'Address Vector Data', 119, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_VEC_ADDRESS, 'Data for a field at an address and get address vector type data.', ['address', 'the field name']],
125
+ [MODULES.repository, 'Bool Vector Data', 120, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_VEC_BOOL, 'Data for a field at an address and get bool vector type data.', ['address', 'the field name']],
132
126
 
133
- [MODULES.entity, 'Contains Entity?', 200, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is an entity already registered?', 'Input:address'],
134
- [MODULES.entity, 'Likes', 201, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The number of likes for an address by other addresses.', 'Input:address'],
135
- [MODULES.entity, 'Dislikes', 202, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The number of dislikes for an address by other addresses.', 'Input:address'],
136
- [MODULES.entity, 'Entity Info', 203, [ValueType.TYPE_ADDRESS], ValueType.TYPE_VEC_U8, 'Public information about an entity.', 'Input:address'],
137
- [MODULES.entity, 'Has Resource by Entity?', 204, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an entity created a resource?', 'Input:address'],
138
- [MODULES.entity, 'Entity Resource', 205, [ValueType.TYPE_ADDRESS], ValueType.TYPE_ADDRESS, 'The address of a resource object created by an entity.', 'Input:address'],
139
-
140
- [MODULES.demand, 'Permission', 300, [], ValueType.TYPE_ADDRESS, 'Permission object address.'],
141
- [MODULES.demand, 'Has Deadline', 301, [], ValueType.TYPE_BOOL, 'Whether to set the expiration time of presenting?'],
142
- [MODULES.demand, 'Deadline', 302, [], ValueType.TYPE_U64, 'The expiration time of presenting.'],
143
- [MODULES.demand, 'Bounty Count', 303, [], ValueType.TYPE_U64, 'Number of Bounties.'],
144
- [MODULES.demand, 'Has Guard', 304, [], ValueType.TYPE_BOOL, 'Whether the present guard is set?'],
145
- [MODULES.demand, 'Guard', 305, [], ValueType.TYPE_ADDRESS, 'The present guard address.'],
146
- [MODULES.demand, 'Has Service Picked', 306, [], ValueType.TYPE_BOOL, 'Whether a service has been picked and bounties given?'],
147
- [MODULES.demand, 'Service Picked', 307, [], ValueType.TYPE_ADDRESS, 'Service address that has been picked.'],
148
- [MODULES.demand, 'Presenter Count', 308, [], ValueType.TYPE_U64, 'Number of presenters.'],
149
- [MODULES.demand, 'Has Presenter', 309, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is a certain address a presenter?', 'Input:address'],
150
- [MODULES.demand, 'Who Got Bounty', 310, [ValueType.TYPE_ADDRESS], ValueType.TYPE_ADDRESS, 'The address that bounties given.', 'Input:address'],
127
+ [MODULES.entity, 'Contains Entity?', 200, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is an entity already registered?', ['address']],
128
+ [MODULES.entity, 'Likes', 201, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The number of likes for an address by other addresses.', ['address']],
129
+ [MODULES.entity, 'Dislikes', 202, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The number of dislikes for an address by other addresses.', ['address']],
130
+ [MODULES.entity, 'Entity Info', 203, [ValueType.TYPE_ADDRESS], ValueType.TYPE_VEC_U8, 'Public information about an entity.', ['address']],
131
+ [MODULES.entity, 'Has Resource by Entity?', 204, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an entity created a resource?', ['address']],
132
+ [MODULES.entity, 'Entity Resource', 205, [ValueType.TYPE_ADDRESS], ValueType.TYPE_ADDRESS, 'The address of a resource object created by an entity.', ['address']],
133
+
134
+ [MODULES.demand, 'Permission', 300, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
135
+ [MODULES.demand, 'Has Deadline', 301, [], ValueType.TYPE_BOOL, 'Whether to set the expiration time of presenting?', []],
136
+ [MODULES.demand, 'Deadline', 302, [], ValueType.TYPE_U64, 'The expiration time of presenting.', []],
137
+ [MODULES.demand, 'Bounty Count', 303, [], ValueType.TYPE_U64, 'Number of Bounties.', []],
138
+ [MODULES.demand, 'Has Guard', 304, [], ValueType.TYPE_BOOL, 'Whether the present guard is set?', []],
139
+ [MODULES.demand, 'Guard', 305, [], ValueType.TYPE_ADDRESS, 'The present guard address.', []],
140
+ [MODULES.demand, 'Has Service Picked', 306, [], ValueType.TYPE_BOOL, 'Whether a service has been picked and bounties given?', []],
141
+ [MODULES.demand, 'Service Picked', 307, [], ValueType.TYPE_ADDRESS, 'Service address that has been picked.', []],
142
+ [MODULES.demand, 'Presenter Count', 308, [], ValueType.TYPE_U64, 'Number of presenters.', []],
143
+ [MODULES.demand, 'Has Presenter', 309, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is a certain address a presenter?', ['address']],
144
+ [MODULES.demand, 'Who Got Bounty', 310, [ValueType.TYPE_ADDRESS], ValueType.TYPE_ADDRESS, 'The address that bounties given.', ['address']],
151
145
 
152
- [MODULES.service, 'Permission', 400, [], ValueType.TYPE_ADDRESS, 'Permission object address.'],
153
- [MODULES.service, 'Payee', 401, [], ValueType.TYPE_ADDRESS, 'Payee address, that all order withdrawals will be collected to this address.'],
154
- [MODULES.service, 'Has Buying Guard', 402, [], ValueType.TYPE_BOOL, 'Is the guard condition of buying set?'],
155
- [MODULES.service, 'Buying Guard', 403, [], ValueType.TYPE_ADDRESS, 'Buying guard, that Purchase only if you meet the conditions of the guard.'],
156
- [MODULES.service, 'Contains Repository', 404, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, "Is a certain repository one of the service's consensus repositories?", 'Input:address'],
157
- [MODULES.service, 'Has Withdrawing Guard', 405, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether a certain guard is set when withdrawing money?', 'Input:address'],
158
- [MODULES.service, 'Withdrawing Guard Percent', 406, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The percentage of withdrawals allowed by a certain withdrawal guard.', 'Input:address'],
159
- [MODULES.service, 'Has Refunding Guard', 407, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether a certain guard is set when refunding money?', 'Input:address'],
160
- [MODULES.service, 'Refunding Guard Percent', 408, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The percentage of refund allowed by a certain refund guard.', 'Input:address'],
161
- [MODULES.service, 'Has Sales Item', 409, [ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Is there a sales item for the service?', 'Input:the item name'],
162
- [MODULES.service, 'Sale Item Price', 410, [ValueType.TYPE_STRING], ValueType.TYPE_U64, 'What is the price of a certain sale item?', 'Input:the item name'],
163
- [MODULES.service, 'Sale Item Inventory', 411, [ValueType.TYPE_STRING], ValueType.TYPE_U64, 'How much inventory is there for a certain sales item?', 'Input:the item name'],
164
- [MODULES.service, 'Has Machine', 412, [], ValueType.TYPE_BOOL, "Has the machine(progress generator) that serves the order been set up?"],
165
- [MODULES.service, 'Machine', 413, [], ValueType.TYPE_ADDRESS, 'Machine address, that generate progresses serving the execution process of order.'],
146
+ [MODULES.service, 'Permission', 400, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
147
+ [MODULES.service, 'Payee', 401, [], ValueType.TYPE_ADDRESS, 'Payee address, that all order withdrawals will be collected to this address.', []],
148
+ [MODULES.service, 'Has Buying Guard', 402, [], ValueType.TYPE_BOOL, 'Is the guard condition of buying set?', []],
149
+ [MODULES.service, 'Buying Guard', 403, [], ValueType.TYPE_ADDRESS, 'Buying guard, that Purchase only if you meet the conditions of the guard.', []],
150
+ [MODULES.service, 'Contains Repository', 404, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, "Is a certain repository one of the service's consensus repositories?", ['address']],
151
+ [MODULES.service, 'Has Withdrawing Guard', 405, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether a certain guard is set when withdrawing money?', ['address']],
152
+ [MODULES.service, 'Withdrawing Guard Percent', 406, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The percentage of withdrawals allowed by a certain withdrawal guard.', ['address']],
153
+ [MODULES.service, 'Has Refunding Guard', 407, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether a certain guard is set when refunding money?', ['address']],
154
+ [MODULES.service, 'Refunding Guard Percent', 408, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The percentage of refund allowed by a certain refund guard.', ['address']],
155
+ [MODULES.service, 'Has Sales Item', 409, [ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Is there a sales item for the service?', ['the item name']],
156
+ [MODULES.service, 'Sale Item Price', 410, [ValueType.TYPE_STRING], ValueType.TYPE_U64, 'What is the price of a certain sale item?', ['the item name']],
157
+ [MODULES.service, 'Sale Item Inventory', 411, [ValueType.TYPE_STRING], ValueType.TYPE_U64, 'How much inventory is there for a certain sales item?', ['the item name']],
158
+ [MODULES.service, 'Has Machine', 412, [], ValueType.TYPE_BOOL, "Has the machine(progress generator) that serves the order been set up?", []],
159
+ [MODULES.service, 'Machine', 413, [], ValueType.TYPE_ADDRESS, 'Machine address, that generate progresses serving the execution process of order.', []],
166
160
  [MODULES.service, 'Paused', 414, [], ValueType.TYPE_BOOL, 'Pause the creation of new order?'],
167
161
  [MODULES.service, 'Published', 415, [], ValueType.TYPE_BOOL, 'Is it allowed to create orders?'],
168
- [MODULES.service, 'Has Required Info', 416, [], ValueType.TYPE_BOOL, 'Whether the necessary information that needs to be provided by the customer is set?'],
169
- [MODULES.service, 'Required Info of Service-Pubkey', 417, [], ValueType.TYPE_STRING, 'The public key used to encrypt customer information, and only the service provider can decrypt and view customer information.'],
170
- [MODULES.service, 'Required Info', 418, [], ValueType.TYPE_VEC_STRING, 'Names of the required information item that needs to be provided by the customer.'],
171
-
172
- [MODULES.order, 'Amount', 500, [], ValueType.TYPE_U64, 'Order amount.'],
173
- [MODULES.order, 'Payer', 501, [], ValueType.TYPE_ADDRESS, 'Order payer.'],
174
- [MODULES.order, 'Service', 502, [], ValueType.TYPE_ADDRESS, 'Service for creating orders.'],
175
- [MODULES.order, 'Has Progress', 503, [], ValueType.TYPE_BOOL, 'Is there a Progress for executing the order process?'],
176
- [MODULES.order, 'Progress', 504, [], ValueType.TYPE_ADDRESS, 'Progress address for executing the order process.'],
177
- [MODULES.order, 'Required Info Counts', 505, [], ValueType.TYPE_U64, 'How much customer information is required for this order?'],
178
- [MODULES.order, 'Discount Used', 506, [], ValueType.TYPE_BOOL, 'Discount coupon used for this order?'],
179
- [MODULES.order, 'Discount', 507, [], ValueType.TYPE_ADDRESS, 'Discount address that already used.'],
180
- [MODULES.order, 'Balance', 508, [], ValueType.TYPE_U64, 'The amount currently in the order.'],
181
- [MODULES.order, 'Refunded', 509, [], ValueType.TYPE_BOOL, 'Whether a refund has occurred?'],
182
- [MODULES.order, 'Withdrawed', 510, [], ValueType.TYPE_BOOL, 'Whether a service provider withdrawal has occurred?'],
162
+ [MODULES.service, 'Has Required Info', 416, [], ValueType.TYPE_BOOL, 'Whether the necessary information that needs to be provided by the customer is set?', []],
163
+ [MODULES.service, 'Required Info of Service-Pubkey', 417, [], ValueType.TYPE_STRING, 'The public key used to encrypt customer information, and only the service provider can decrypt and view customer information.', []],
164
+ [MODULES.service, 'Required Info', 418, [], ValueType.TYPE_VEC_STRING, 'Names of the required information item that needs to be provided by the customer.', []],
165
+
166
+ [MODULES.order, 'Amount', 500, [], ValueType.TYPE_U64, 'Order amount.', []],
167
+ [MODULES.order, 'Payer', 501, [], ValueType.TYPE_ADDRESS, 'Order payer.', []],
168
+ [MODULES.order, 'Service', 502, [], ValueType.TYPE_ADDRESS, 'Service for creating orders.', []],
169
+ [MODULES.order, 'Has Progress', 503, [], ValueType.TYPE_BOOL, 'Is there a Progress for executing the order process?', []],
170
+ [MODULES.order, 'Progress', 504, [], ValueType.TYPE_ADDRESS, 'Progress address for executing the order process.', []],
171
+ [MODULES.order, 'Required Info Counts', 505, [], ValueType.TYPE_U64, 'How much customer information is required for this order?', []],
172
+ [MODULES.order, 'Discount Used', 506, [], ValueType.TYPE_BOOL, 'Discount coupon used for this order?', []],
173
+ [MODULES.order, 'Discount', 507, [], ValueType.TYPE_ADDRESS, 'Discount address that already used.', []],
174
+ [MODULES.order, 'Balance', 508, [], ValueType.TYPE_U64, 'The amount currently in the order.', []],
175
+ [MODULES.order, 'Refunded', 509, [], ValueType.TYPE_BOOL, 'Whether a refund has occurred?', []],
176
+ [MODULES.order, 'Withdrawed', 510, [], ValueType.TYPE_BOOL, 'Whether a service provider withdrawal has occurred?', []],
183
177
 
184
- [MODULES.reward, 'Permission', 600, [], ValueType.TYPE_ADDRESS, 'Permission object address.'],
185
- [MODULES.reward, 'Rewards Remaining', 601, [], ValueType.TYPE_U64, 'Number of rewards to be claimed.'],
186
- [MODULES.reward, 'Reward Count Supplied', 602, [], ValueType.TYPE_U64, 'Total rewards supplied.'],
187
- [MODULES.reward, 'Guard Count', 603, [], ValueType.TYPE_U64, 'The number of claiming guards.'],
188
- [MODULES.reward, 'Has Guard', 604, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether a claiming guard is set up?', 'Input:address'],
189
- [MODULES.reward, 'Guard Portion', 605, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The portions of rewards, that can be claimed if a certain guard condition is met.', 'Input:address'],
190
- [MODULES.reward, 'Deadline', 606, [], ValueType.TYPE_U64, 'The expiration time of claiming.'],
191
- [MODULES.reward, 'Has Claimed by An Address', 607, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether a certain address has claimed rewards?', 'Input:address'],
192
- [MODULES.reward, 'Portions Claimed by An Address', 608, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The portions of rewards that have been claimed by a certain address.'],
193
- [MODULES.reward, 'Number of Addresses Claimed', 609, [], ValueType.TYPE_U64, 'Number of addresses that have claimed rewards.'],
194
- [MODULES.reward, 'Is Sponsor', 620, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address is a sponsor of the reward pool?', 'Input:address'],
195
- [MODULES.reward, 'Portions by A Sponsor', 611, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The portions of sponsorship reward pools for a certain address.', 'Input:address'],
196
- [MODULES.reward, 'Number of Sponsors', 612, [], ValueType.TYPE_U64, 'Number of sponsors in the sponsorship reward pool.'],
197
- [MODULES.reward, 'Allow Repeated Claims', 613, [], ValueType.TYPE_BOOL, 'Whether to allow repeated claims?'],
178
+ [MODULES.reward, 'Permission', 600, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
179
+ [MODULES.reward, 'Rewards Remaining', 601, [], ValueType.TYPE_U64, 'Number of rewards to be claimed.', []],
180
+ [MODULES.reward, 'Reward Count Supplied', 602, [], ValueType.TYPE_U64, 'Total rewards supplied.', []],
181
+ [MODULES.reward, 'Guard Count', 603, [], ValueType.TYPE_U64, 'The number of claiming guards.', []],
182
+ [MODULES.reward, 'Has Guard', 604, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether a claiming guard is set up?', ['address']],
183
+ [MODULES.reward, 'Guard Portion', 605, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The portions of rewards, that can be claimed if a certain guard condition is met.', ['address']],
184
+ [MODULES.reward, 'Deadline', 606, [], ValueType.TYPE_U64, 'The expiration time of claiming.', []],
185
+ [MODULES.reward, 'Has Claimed by An Address', 607, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether a certain address has claimed rewards?', ['address']],
186
+ [MODULES.reward, 'Portions Claimed by An Address', 608, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The portions of rewards that have been claimed by a certain address.', []],
187
+ [MODULES.reward, 'Number of Addresses Claimed', 609, [], ValueType.TYPE_U64, 'Number of addresses that have claimed rewards.', []],
188
+ [MODULES.reward, 'Is Sponsor', 620, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address is a sponsor of the reward pool?', ['address']],
189
+ [MODULES.reward, 'Portions by A Sponsor', 611, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The portions of sponsorship reward pools for a certain address.', ['address']],
190
+ [MODULES.reward, 'Number of Sponsors', 612, [], ValueType.TYPE_U64, 'Number of sponsors in the sponsorship reward pool.', []],
191
+ [MODULES.reward, 'Allow Repeated Claims', 613, [], ValueType.TYPE_BOOL, 'Whether to allow repeated claims?', []],
198
192
 
199
193
  // , means that data fields and data outside the consensus policy definition are allowed to be written
200
194
  // , means that only data fields and data defined by the consensus policy are allowed to be written.
201
- [MODULES.machine, 'Permission', 700, [], ValueType.TYPE_ADDRESS, 'Permission object address.'],
202
- [MODULES.machine, 'Paused', 701, [], ValueType.TYPE_BOOL, 'Pause the creation of new Progress?'],
203
- [MODULES.machine, 'Published', 702, [], ValueType.TYPE_BOOL, 'Is it allowed to create Progress?'],
204
- [MODULES.machine, 'Is Consensus Repository', 703, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address is a consensus repository?', 'Input:adddress'],
205
- [MODULES.machine, 'Has Endpoint', 704, [], ValueType.TYPE_BOOL, 'Is the endpoint set?'],
206
- [MODULES.machine, 'Endpoint', 705, [], ValueType.TYPE_STRING, 'Endpoint url/ipfs.'],
195
+ [MODULES.machine, 'Permission', 700, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
196
+ [MODULES.machine, 'Paused', 701, [], ValueType.TYPE_BOOL, 'Pause the creation of new Progress?', []],
197
+ [MODULES.machine, 'Published', 702, [], ValueType.TYPE_BOOL, 'Is it allowed to create Progress?', []],
198
+ [MODULES.machine, 'Is Consensus Repository', 703, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address is a consensus repository?', ['adddress']],
199
+ [MODULES.machine, 'Has Endpoint', 704, [], ValueType.TYPE_BOOL, 'Is the endpoint set?', []],
200
+ [MODULES.machine, 'Endpoint', 705, [], ValueType.TYPE_STRING, 'Endpoint url/ipfs.', []],
207
201
 
208
- [MODULES.progress, 'Machine', 800, [], ValueType.TYPE_ADDRESS, 'The Machine object that created this Progress.'],
209
- [MODULES.progress, 'Current Node', 801, [], ValueType.TYPE_STRING, 'The name of the currently running node.'],
210
- [MODULES.progress, 'Has Parent', 802, [], ValueType.TYPE_BOOL, 'Is the parent Progress defined?'],
211
- [MODULES.progress, 'Parent', 803, [], ValueType.TYPE_ADDRESS, 'The parent Progress, that contains some child Progress.'],
212
- [MODULES.progress, 'Has Task', 804, [], ValueType.TYPE_BOOL, 'Does it contain clear task(eg. an Order)?'],
213
- [MODULES.progress, 'Task', 805, [], ValueType.TYPE_ADDRESS, 'Task object address.'],
214
- [MODULES.progress, 'Has Unique Permission', 806, [ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Does Progress define a unique operation permission?', 'Input:opertor name'],
215
- [MODULES.progress, 'Is Unique Permission Operator', 807, [ValueType.TYPE_STRING, ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is an address an operator with unique permissions?', 'Input 1:operator name; Input 2:address'],
216
- [MODULES.progress, 'Has Context Repository', 808, [], ValueType.TYPE_BOOL, 'Whether the repository reference for Progress is set?'],
217
- [MODULES.progress, 'Context Repository', 809, [], ValueType.TYPE_ADDRESS, 'Repository reference for Progress.'],
218
- [MODULES.progress, 'Last Session Time', 810, [], ValueType.TYPE_U64, 'Time when the previous session was completed.'],
219
- [MODULES.progress, 'Last Session Node', 811, [], ValueType.TYPE_STRING, 'The name of the last completed node.'],
220
- [MODULES.progress, 'Current Session-id', 812, [], ValueType.TYPE_U64, 'The session id of ongoing node.'],
221
- [MODULES.progress, 'Parent Session-id', 813, [], ValueType.TYPE_U64, 'The child process was started in the Session-id phase of the parent process.'],
222
- [MODULES.progress, 'Parent Next Node', 814, [], ValueType.TYPE_STRING, 'The child process is started at the next node stage of the parent process.'],
223
- [MODULES.progress, 'Parent Forward', 815, [], ValueType.TYPE_STRING, 'The child process is started in the Forward phase of the next node of the parent process.'],
224
- [MODULES.progress, 'Parent Node', 816, [], ValueType.TYPE_STRING, 'The node name of the parent process where the child process is located.'],
225
- [MODULES.progress, 'Forward Accomplished', 817, [ValueType.TYPE_U64, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Has a forward been accomplished?', 'Input 1:session-id; Input 2:next node name; Input 3:forward name'],
226
- [MODULES.progress, 'Forward Operator', 818, [ValueType.TYPE_U64, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_ADDRESS, 'The forward operator.', 'Input 1:session-id; Input 2:next node name; Input 3:forward name'],
227
- [MODULES.progress, 'Forward Sub-progress', 819, [ValueType.TYPE_U64, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_ADDRESS, 'The forward child process address(if set).', 'Input 1:session-id; Input 2:next node name; Input 3:forward name'],
228
- [MODULES.progress, 'Forward Deliverables', 820, [ValueType.TYPE_U64, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_ADDRESS, 'The forward deliverable(if set).', 'Input 1:session-id; Input 2:next node name; Input 3:forward name'],
229
- [MODULES.progress, 'Forward time', 821, [ValueType.TYPE_U64, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_U64, 'The time when the forward was last triggered.', 'Input 1:session-id; Input 2:next node name; Input 3:forward name'],
230
- [MODULES.progress, 'Closest Session Time', 822, [ValueType.TYPE_STRING], ValueType.TYPE_U64, 'The time a node that closest time to the current node completes its session.', 'Input:the node name'],
231
- [MODULES.progress, 'Closest Forward Accomplished', 823, [ValueType.TYPE_STRING, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Has a forward been accomplished?', 'Input 1:node name; Input 2:next node name; Input 3:forward name'],
232
- [MODULES.progress, 'Closest Forward Operator', 824, [ValueType.TYPE_STRING, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_ADDRESS, 'The operator of the forward that closest time to the current node.', 'Input 1:node name; Input 2:next node name; Input 3:forward name'],
233
- [MODULES.progress, 'Closest Forward Sub-progress', 825, [ValueType.TYPE_STRING, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_ADDRESS, 'The child process address(if set) of the forward that closest time to the current node.', 'Input 1:node name; Input 2:next node name; Input 3:forward name'],
234
- [MODULES.progress, 'Closest Forward Deliverables', 826, [ValueType.TYPE_STRING, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_ADDRESS, 'The deliverable(if set) of the forward that closest time to the current node.', 'Input 1:node name; Input 2:next node name; Input 3:forward name'],
235
- [MODULES.progress, 'Closest Forward time', 827, [ValueType.TYPE_STRING, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_U64, 'The time when the forward that closest time to the current node was last triggered.', 'Input 1:node name; Input 2:next node name; Input 3:forward name'],
236
-
237
- [MODULES.wowok, 'Builder', 900, [], ValueType.TYPE_ADDRESS, 'Builder address of Wowok.'],
238
- [MODULES.wowok, 'Everyone Guard', 901, [], ValueType.TYPE_ADDRESS, 'A guard that all addresses can pass through.'],
239
- [MODULES.wowok, 'Object of Entities', 902, [], ValueType.TYPE_ADDRESS, 'The address of entity information object.'],
240
- [MODULES.wowok, 'Grantor Count', 903, [], ValueType.TYPE_U64, 'Number of registered grantors.'],
241
- [MODULES.wowok, 'Has Grantor', 904, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address has been registered as a grantor?', , 'Input:address'],
242
- [MODULES.wowok, 'Grantor Name', 905, [ValueType.TYPE_ADDRESS], ValueType.TYPE_STRING, "Name of a grantor.", 'Input:address'],
243
- [MODULES.wowok, 'Grantor Registration Time', 906, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'Registration time of a grantor.', 'Input:address'],
244
- [MODULES.wowok, 'Grantor Expired Time', 907, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The expiration time of a grantor.', 'Input:address'],
245
- [MODULES.wowok, 'Grantee Object for Grantor', 908, [ValueType.TYPE_ADDRESS], ValueType.TYPE_ADDRESS, 'Grantee repository address of a grantor.', 'Input:address'],
202
+ [MODULES.progress, 'Machine', 800, [], ValueType.TYPE_ADDRESS, 'The Machine object that created this Progress.', []],
203
+ [MODULES.progress, 'Current Node', 801, [], ValueType.TYPE_STRING, 'The name of the currently running node.', []],
204
+ [MODULES.progress, 'Has Parent', 802, [], ValueType.TYPE_BOOL, 'Is the parent Progress defined?', []],
205
+ [MODULES.progress, 'Parent', 803, [], ValueType.TYPE_ADDRESS, 'The parent Progress, that contains some child Progress.', []],
206
+ [MODULES.progress, 'Has Task', 804, [], ValueType.TYPE_BOOL, 'Does it contain clear task(eg. an Order)?', []],
207
+ [MODULES.progress, 'Task', 805, [], ValueType.TYPE_ADDRESS, 'Task object address.', []],
208
+ [MODULES.progress, 'Has Unique Permission', 806, [ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Does Progress define a unique operation permission?', ['operator name']],
209
+ [MODULES.progress, 'Is Unique Permission Operator', 807, [ValueType.TYPE_STRING, ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is an address an operator with unique permissions?', ['operator name','address']],
210
+ [MODULES.progress, 'Has Context Repository', 808, [], ValueType.TYPE_BOOL, 'Whether the repository reference for Progress is set?', []],
211
+ [MODULES.progress, 'Context Repository', 809, [], ValueType.TYPE_ADDRESS, 'Repository reference for Progress.', []],
212
+ [MODULES.progress, 'Last Session Time', 810, [], ValueType.TYPE_U64, 'Time when the previous session was completed.', []],
213
+ [MODULES.progress, 'Last Session Node', 811, [], ValueType.TYPE_STRING, 'The name of the last completed node.', []],
214
+ [MODULES.progress, 'Current Session-id', 812, [], ValueType.TYPE_U64, 'The session id of ongoing node.', []],
215
+ [MODULES.progress, 'Parent Session-id', 813, [], ValueType.TYPE_U64, 'The child process was started in the Session-id phase of the parent process.', []],
216
+ [MODULES.progress, 'Parent Next Node', 814, [], ValueType.TYPE_STRING, 'The child process is started at the next node stage of the parent process.', []],
217
+ [MODULES.progress, 'Parent Forward', 815, [], ValueType.TYPE_STRING, 'The child process is started in the Forward phase of the next node of the parent process.', []],
218
+ [MODULES.progress, 'Parent Node', 816, [], ValueType.TYPE_STRING, 'The node name of the parent process where the child process is located.', []],
219
+ [MODULES.progress, 'Forward Accomplished', 817, [ValueType.TYPE_U64, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Has a forward been accomplished?', ['session-id', 'next node name', 'forward name']],
220
+ [MODULES.progress, 'Forward Operator', 818, [ValueType.TYPE_U64, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_ADDRESS, 'The forward operator.', ['session-id', 'next node name', 'forward name']],
221
+ [MODULES.progress, 'Forward Sub-progress', 819, [ValueType.TYPE_U64, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_ADDRESS, 'The forward child process address(if set).', ['session-id', 'next node name', 'forward name']],
222
+ [MODULES.progress, 'Forward Deliverables', 820, [ValueType.TYPE_U64, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_ADDRESS, 'The forward deliverable(if set).', ['session-id', 'next node name', 'forward name']],
223
+ [MODULES.progress, 'Forward time', 821, [ValueType.TYPE_U64, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_U64, 'The time when the forward was last triggered.', ['session-id', 'next node name', 'forward name']],
224
+ [MODULES.progress, 'Closest Session Time', 822, [ValueType.TYPE_STRING], ValueType.TYPE_U64, 'The time a node that closest time to the current node completes its session.', ['node name']],
225
+ [MODULES.progress, 'Closest Forward Accomplished', 823, [ValueType.TYPE_STRING, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Has a forward been accomplished?', ['node name', 'next node name', 'forward name']],
226
+ [MODULES.progress, 'Closest Forward Operator', 824, [ValueType.TYPE_STRING, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_ADDRESS, 'The operator of the forward that closest time to the current node.', ['node name', 'next node name', 'forward name']],
227
+ [MODULES.progress, 'Closest Forward Sub-progress', 825, [ValueType.TYPE_STRING, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_ADDRESS, 'The child process address(if set) of the forward that closest time to the current node.', ['node name', 'next node name', 'forward name']],
228
+ [MODULES.progress, 'Closest Forward Deliverables', 826, [ValueType.TYPE_STRING, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_ADDRESS, 'The deliverable(if set) of the forward that closest time to the current node.', ['node name', 'next node name', 'forward name']],
229
+ [MODULES.progress, 'Closest Forward time', 827, [ValueType.TYPE_STRING, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_U64, 'The time when the forward that closest time to the current node was last triggered.', ['node name', 'next node name', 'forward name']],
230
+
231
+ [MODULES.wowok, 'Builder', 900, [], ValueType.TYPE_ADDRESS, 'Builder address of Wowok.', []],
232
+ [MODULES.wowok, 'Everyone Guard', 901, [], ValueType.TYPE_ADDRESS, 'A guard that all addresses can pass through.', []],
233
+ [MODULES.wowok, 'Object of Entities', 902, [], ValueType.TYPE_ADDRESS, 'The address of entity information object.', []],
234
+ [MODULES.wowok, 'Grantor Count', 903, [], ValueType.TYPE_U64, 'Number of registered grantors.', []],
235
+ [MODULES.wowok, 'Has Grantor', 904, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address has been registered as a grantor?', ['address']],
236
+ [MODULES.wowok, 'Grantor Name', 905, [ValueType.TYPE_ADDRESS], ValueType.TYPE_STRING, "Name of a grantor.", ['address']],
237
+ [MODULES.wowok, 'Grantor Registration Time', 906, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'Registration time of a grantor.', ['address']],
238
+ [MODULES.wowok, 'Grantor Expired Time', 907, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The expiration time of a grantor.', ['address']],
239
+ [MODULES.wowok, 'Grantee Object for Grantor', 908, [ValueType.TYPE_ADDRESS], ValueType.TYPE_ADDRESS, 'Grantee repository address of a grantor.', ['address']],
246
240
 
247
-
241
+ [MODULES.payment, 'Sender', 1200, [], ValueType.TYPE_ADDRESS, 'Payment originator address.', []],
242
+ [MODULES.payment, 'Total Amount', 1201, [], ValueType.TYPE_U64, "Payment amount.", []],
243
+ [MODULES.payment, 'Tips', 1202, [], ValueType.TYPE_STRING, 'Payment remarks.', ['address']],
244
+ [MODULES.payment, 'Has Guard for Perpose', 1203, [], ValueType.TYPE_BOOL, 'Whether the payment references a Guard?', []],
245
+ [MODULES.payment, 'Has Object for Perpose', 1204, [], ValueType.TYPE_BOOL, 'Whether the payment references an Object?', []],
246
+ [MODULES.payment, 'Guard for Perpose', 1205, [], ValueType.TYPE_ADDRESS, 'The Guard referenced by this payment.', []],
247
+ [MODULES.payment, 'Object for Perpose', 1206, [], ValueType.TYPE_ADDRESS, "The Object referenced by this payment.", []],
248
+ [MODULES.payment, 'Number of Transfer', 1207, [], ValueType.TYPE_U64, 'Number of recipients to receive payment from.', []],
249
+ [MODULES.payment, 'Is a Recipient', 1208, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is a recipient received the payment?', ['address']],
250
+ [MODULES.payment, 'Amount for a Recipient', 1209, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The amount of payment received by an address.', ['address']],
251
+ [MODULES.payment, 'Time', 1210, [], ValueType.TYPE_U64, 'Payment time', []],
252
+ [MODULES.payment, 'Is from Treasury', 1211, [], ValueType.TYPE_BOOL, 'Whether the payment comes from a Treasury?', []],
253
+ [MODULES.payment, 'Treasury Address', 1212, [], ValueType.TYPE_ADDRESS, 'The Treasury from which the payment comes.', []],
254
+ [MODULES.payment, 'Index', 1213, [], ValueType.TYPE_U64, 'Payment index or id.', []],
255
+
256
+ [MODULES.withholding, 'Has Deposited', 1300, [], ValueType.TYPE_BOOL, 'Whether assets have been deposited?' , []],
257
+ [MODULES.withholding, 'Original Type Deposited', 1301, [], ValueType.TYPE_STRING, "Original type name of asserts deposited.", []],
258
+ [MODULES.withholding, 'Original Package', 1302, [], ValueType.TYPE_ADDRESS, 'Original package address of asserts deposited.', []],
259
+ [MODULES.withholding, 'Original Module', 1303, [], ValueType.TYPE_STRING, 'Original module name of asserts deposited.', []],
260
+ [MODULES.withholding, 'Type Deposited', 1304, [], ValueType.TYPE_STRING, 'Type name of asserts deposited.', []],
261
+ [MODULES.withholding, 'Package', 1305, [], ValueType.TYPE_ADDRESS, 'Package address of asserts deposited.', , []],
262
+ [MODULES.withholding, 'Module', 1306, [], ValueType.TYPE_STRING, 'Module name of asserts deposited.', []],
263
+ [MODULES.withholding, 'Withdrawal Guard', 1307, [], ValueType.TYPE_ADDRESS, 'Withdrawal Guard address.', []],
264
+ [MODULES.withholding, 'Deposit Time', 1308, [], ValueType.TYPE_U64, 'Deposit time.', []],
265
+ [MODULES.withholding, 'Withdrawal Time', 1309, [], ValueType.TYPE_U64, 'Withdrawal time.' , []],
266
+ [MODULES.withholding, 'Depositor Address', 1310, [], ValueType.TYPE_ADDRESS, 'Depositor address.', []],
267
+ [MODULES.withholding, 'Withdrawal Address', 1311, [], ValueType.TYPE_ADDRESS, 'Withdrawal address.', []],
268
+ [MODULES.withholding, 'From Treasury', 1312, [], ValueType.TYPE_BOOL, 'Is it the deposit from a treasury?', []],
269
+ [MODULES.withholding, 'Treasury Address', 1314, [], ValueType.TYPE_ADDRESS, 'Treasury address that asserts deposited.', ['address']],
270
+
271
+ [MODULES.treasury, 'Permission', 1400, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
272
+ [MODULES.treasury, 'Balance', 1401, [], ValueType.TYPE_U64, "Treasury balance.", []],
273
+ [MODULES.treasury, 'Number of Flow Records', 1402, [], ValueType.TYPE_U64, 'Number of treasury transactions.', []],
274
+ [MODULES.treasury, 'Deposit Flow', 1403, [], ValueType.TYPE_U128, 'Treasury inflow amount.', []],
275
+ [MODULES.treasury, 'Take Flow', 1404, [], ValueType.TYPE_U128, 'Treasury outflow amount.', []],
276
+ [MODULES.treasury, 'Flow over a Period of Time', 1405, [ValueType.TYPE_U64, ValueType.TYPE_U64], ValueType.TYPE_U128, 'The flow amount between certain periods.', ['begin time', 'end time']],
277
+ [MODULES.treasury, 'Deposit Flow over a Period of Time', 1406, [ValueType.TYPE_U64, ValueType.TYPE_U64], ValueType.TYPE_U128, "The inflow amount between certain periods.", ['begin time', 'end time']],
278
+ [MODULES.treasury, 'Take Flow over a Period of Time', 1407, [ValueType.TYPE_U64, ValueType.TYPE_U64], ValueType.TYPE_U128, 'The outflow amount between certain periods.', ['begin time', 'end time']],
279
+
248
280
  /* [MODULES.vote, 'Permission', 171, [], ValueType.TYPE_ADDRESS],
249
281
  [MODULES.vote, 'Options Locked', 172, [], ValueType.TYPE_BOOL],
250
282
  [MODULES.vote, 'Deadline Locked', 173, [], ValueType.TYPE_BOOL],
@@ -301,6 +333,8 @@ export class Guard {
301
333
 
302
334
  static Signer:Guard_Options = {from:'type', name:'Txn Signer', value:ContextType.TYPE_SIGNER, group:'Txn Functions'};
303
335
  static Time:Guard_Options = {from:'type', name:'Txn Time', value:ContextType.TYPE_CLOCK, group:'Txn Functions'};
336
+ static Guard:Guard_Options = {from:'type', name:'Guard Address', value:ContextType.TYPE_GUARD, group:'Txn Functions'};
337
+
304
338
  static Logics = () :Guard_Options[] => LogicsInfo.map((v) => { return {from:'type', name:v[1] as string, value:v[0] as number, group:'Compare or Logic'}});
305
339
  static Crunchings: Guard_Options[] = [
306
340
  {from:'type', name:'Txn Time', value:ContextType.TYPE_CLOCK, group:'Txn Functions'},
@@ -317,7 +351,7 @@ export class Guard {
317
351
 
318
352
  static AllOptions = () : Guard_Options[] => {
319
353
  var r:Guard_Options[] = Guard.QUERIES.map((v)=>{return {from:'query', name:v[1], value:v[2], group:FirstLetterUppercase(v[0])}});
320
- return [...r, ...Guard.Crunchings, ...Guard.Logics(), Guard.Signer, Guard.Time]
354
+ return [...r, ...Guard.Crunchings, ...Guard.Logics(), Guard.Signer, Guard.Time, Guard.Guard]
321
355
  }
322
356
 
323
357
  static StringOptions = () : Guard_Options[] => {
@@ -331,7 +365,7 @@ export class Guard {
331
365
  }
332
366
  static AddressOptions = () : Guard_Options[] => {
333
367
  const n1:Guard_Options[] = Guard.QUERIES.filter(q => q[4] === ValueType.TYPE_ADDRESS).map((v)=> { return {from:'query', name:v[1], value:v[2], group:FirstLetterUppercase(v[0])}});
334
- n1.push(Guard.Signer);
368
+ n1.push(Guard.Signer); n1.push(Guard.Guard);
335
369
  return [...n1]
336
370
  }
337
371
 
@@ -351,89 +385,6 @@ export class Guard {
351
385
  return Guard.CommonOptions(ret_type);
352
386
  }
353
387
  }
354
-
355
- export class GuardConstantHelper {
356
- static IsValidIndentifier = (identifier:number) : boolean => {
357
- if (!IsValidInt(identifier) || identifier > 255) return false;
358
- return true
359
- }
360
- static get_constant_value(constants:GuardConstant, identifier:number, type:ConstantType) : Uint8Array | undefined {
361
- if (constants.has(identifier)) {
362
- let v = constants.get(identifier);
363
- if (v?.value && v.type == type) {
364
- return v.value;
365
- }
366
- }
367
- }
368
- static get_constant_witness(constants:GuardConstant, identifier:number) : Uint8Array | undefined {
369
- if (constants.has(identifier)) {
370
- let v = constants.get(identifier);
371
- if (v?.witness && v.type == ContextType.TYPE_WITNESS_ID) {
372
- return v.witness;
373
- }
374
- }
375
- }
376
-
377
- static add_future_constant(constants:GuardConstant, identifier:number, witness:any, value?:any, bNeedSerialize=true) {
378
- if (!GuardConstantHelper.IsValidIndentifier(identifier)) ERROR(Errors.IsValidIndentifier, 'add_future_constant');
379
- if (!witness && !value) ERROR(Errors.InvalidParam, 'both witness and value invalid');
380
- let v = constants.get(identifier);
381
- if (!v || v.type == ContextType.TYPE_WITNESS_ID) {
382
- if (bNeedSerialize) {
383
- constants.set(identifier, {type:ContextType.TYPE_WITNESS_ID, value:value ? Bcs.getInstance().ser(ValueType.TYPE_ADDRESS, value) : undefined,
384
- witness:witness ? Bcs.getInstance().ser(ValueType.TYPE_ADDRESS, witness) : undefined})
385
- } else {
386
- constants.set(identifier, {type:ContextType.TYPE_WITNESS_ID, value:value?value:undefined, witness:witness?witness:undefined});
387
- }
388
- }
389
- }
390
-
391
- static add_constant(constants:GuardConstant, identifier:number, type:ValueType, value:any, bNeedSerialize=true) {
392
- const e = SER_VALUE.find((v:any)=>v.type===type)?.name ?? '' + ' invalid';
393
- if (!GuardConstantHelper.IsValidIndentifier(identifier)) {
394
- ERROR(Errors.InvalidParam, 'add_constant identifier')
395
- }
396
- if (value === undefined) {
397
- ERROR(Errors.InvalidParam, 'add_constant value')
398
- }
399
-
400
- switch (type) {
401
- case ValueType.TYPE_BOOL:
402
- case ValueType.TYPE_ADDRESS:
403
- case ValueType.TYPE_U64:
404
- case ValueType.TYPE_U8:
405
- case ValueType.TYPE_U128:
406
- case ValueType.TYPE_U256:
407
- case ValueType.TYPE_VEC_U64:
408
- case ValueType.TYPE_VEC_VEC_U8:
409
- case ValueType.TYPE_OPTION_ADDRESS:
410
- case ValueType.TYPE_OPTION_BOOL:
411
- case ValueType.TYPE_OPTION_U128:
412
- case ValueType.TYPE_OPTION_U256:
413
- case ValueType.TYPE_OPTION_U64:
414
- case ValueType.TYPE_OPTION_U8:
415
- case ValueType.TYPE_VEC_ADDRESS:
416
- case ValueType.TYPE_VEC_BOOL:
417
- case ValueType.TYPE_VEC_U128:
418
- case ValueType.TYPE_VEC_U256:
419
- case ValueType.TYPE_STRING:
420
- case ValueType.TYPE_VEC_U8:
421
- case ValueType.TYPE_OPTION_STRING:
422
- case ValueType.TYPE_OPTION_VEC_U8:
423
- case ValueType.TYPE_VEC_STRING:
424
- let ser = SER_VALUE.find(s=>s.type==type);
425
- if (!ser) ERROR(Errors.Fail, 'add_constant: invalid type:'+e);
426
- if (bNeedSerialize) {
427
- constants.set(identifier, {type:type, value:Bcs.getInstance().ser(type, value)})
428
- } else {
429
- constants.set(identifier, {type:type, value:value})
430
- }
431
- return
432
- default:
433
- ERROR(Errors.Fail, 'add_constant serialize not impl yet:'+e)
434
- }
435
- }
436
- }
437
388
  export class GuardMaker {
438
389
  protected data : Uint8Array[] = [];
439
390
  protected type_validator : Data_Type[] = [];
@@ -446,32 +397,27 @@ export class GuardMaker {
446
397
  }
447
398
  return GuardMaker.index++
448
399
  }
449
-
400
+ static IsValidIndentifier = (identifier:number) : boolean => {
401
+ if (!IsValidInt(identifier) || identifier > 255) return false;
402
+ return true
403
+ }
450
404
  constructor() { }
451
405
 
452
- add_constant(type:ConstantType, value:any, identifier?:number, bNeedSerialize=true) : number {
406
+ // undefined value means witness
407
+ add_constant(type:ValueType, value?:any, identifier?:number, bNeedSerialize=true) : number {
453
408
  if (identifier === undefined) identifier = GuardMaker.get_index();
454
- if (type === ContextType.TYPE_WITNESS_ID) {
455
- // add witness to constant
456
- GuardConstantHelper.add_future_constant(this.constant, identifier, value, undefined, bNeedSerialize);
457
- } else {
458
- GuardConstantHelper.add_constant(this.constant, identifier, type, value, bNeedSerialize);
459
- }
409
+ let v = this.constant.get(identifier);
410
+ if (!v) {
411
+ if (bNeedSerialize && value !== undefined) {
412
+ value = Bcs.getInstance().ser(type, value);
413
+ }
414
+ this.constant.set(identifier, {type:type, value:value===undefined ? undefined:value, bWitness:value===undefined ? true:false});
415
+ }
460
416
  return identifier
461
417
  }
462
418
 
463
- private serValueParam(type:ValueType, param?:any) {
464
- if (param === undefined) ERROR(Errors.InvalidParam, 'param');
465
- this.data.push(Bcs.getInstance().ser(ValueType.TYPE_U8, type));
466
- let ser = SER_VALUE.find(s=>s.type==type);
467
- if (!ser) ERROR(Errors.Fail, 'serValueParam: invalid type');
468
- this.data.push(Bcs.getInstance().ser(ser!.type as number, param));
469
- this.type_validator.push(type);
470
- }
471
-
472
- // serialize const & data
419
+ // serialize const & data, WITNESS use constants only.
473
420
  add_param(type:ValueType | ContextType, param?:any) : GuardMaker {
474
- const e = SER_VALUE.find((v:any)=>v.type===type)?.name ?? '' + ' invalid';
475
421
  switch(type) {
476
422
  case ValueType.TYPE_ADDRESS:
477
423
  case ValueType.TYPE_BOOL:
@@ -491,12 +437,14 @@ export class GuardMaker {
491
437
  case ValueType.TYPE_OPTION_U256:
492
438
  case ValueType.TYPE_OPTION_U8:
493
439
  case ValueType.TYPE_VEC_U256:
494
- this.serValueParam(type, param);
440
+ this.data.push(Bcs.getInstance().ser(ValueType.TYPE_U8, type));
441
+ this.data.push(Bcs.getInstance().ser(type as number, param));
442
+ this.type_validator.push(type);
495
443
  break;
496
444
  case ValueType.TYPE_STRING:
497
445
  case ValueType.TYPE_VEC_U8:
498
- if (!param) ERROR(Errors.InvalidParam, 'param:'+e);
499
- this.data.push(Bcs.getInstance().ser(ValueType.TYPE_U8, type)); //@ USE VEC-U8
446
+ if (!param) ERROR(Errors.InvalidParam, 'param: ' + type);
447
+ this.data.push(Bcs.getInstance().ser(ValueType.TYPE_U8, type));
500
448
  if (typeof(param) == 'string') {
501
449
  this.data.push(Bcs.getInstance().ser(ValueType.TYPE_STRING, param));
502
450
  } else {
@@ -508,49 +456,40 @@ export class GuardMaker {
508
456
  this.data.push(Bcs.getInstance().ser(ValueType.TYPE_U8, type));
509
457
  this.type_validator.push(ValueType.TYPE_ADDRESS);
510
458
  break;
459
+ case ContextType.TYPE_GUARD:
460
+ this.data.push(Bcs.getInstance().ser(ValueType.TYPE_U8, type));
461
+ this.type_validator.push(ValueType.TYPE_ADDRESS);
462
+ break;
511
463
  case ContextType.TYPE_CLOCK:
512
464
  this.data.push(Bcs.getInstance().ser(ValueType.TYPE_U8, type));
513
465
  this.type_validator.push(ValueType.TYPE_U64);
514
466
  break;
515
- case ContextType.TYPE_WITNESS_ID:
516
- if (!param) ERROR(Errors.InvalidParam, 'param:'+e);
517
- this.data.push(Bcs.getInstance().ser(ValueType.TYPE_U8, type));
518
- this.data.push(Bcs.getInstance().ser(ValueType.TYPE_ADDRESS, param));
519
- this.type_validator.push(ValueType.TYPE_ADDRESS);
520
- break;
521
467
  case ContextType.TYPE_CONSTANT:
522
- if (!param) {
523
- ERROR(Errors.InvalidParam, 'param invalid:'+e);
524
- }
525
- if (typeof(param) != 'number' || !IsValidInt(param) || param > 255) {
468
+ if (typeof(param) !== 'number' || !IsValidInt(param) || param > 255) {
526
469
  ERROR(Errors.InvalidParam, 'add_param param:'+type);
527
470
  }
528
471
 
529
472
  var v = this.constant.get(param);
530
- if (!v) ERROR(Errors.Fail, 'identifier not in constant:'+e);
531
- var t = v!.type;
532
- if (v?.type === ContextType.TYPE_WITNESS_ID) {
533
- t = ValueType.TYPE_ADDRESS;
534
- }
535
- this.type_validator.push(t); //@ type validator convert
473
+ if (!v) ERROR(Errors.Fail, 'identifier not in constant:'+param);
474
+ this.type_validator.push(v!.type); //@ type validator convert
536
475
  this.data.push(Bcs.getInstance().ser(ValueType.TYPE_U8, type)); // constant flag
537
476
  this.data.push(Bcs.getInstance().ser(ValueType.TYPE_U8, param)); // identifier
538
477
  break;
539
478
  default:
540
- ERROR(Errors.InvalidParam, 'add_param type:'+e);
479
+ ERROR(Errors.InvalidParam, 'add_param type:'+type);
541
480
  };
542
481
  return this;
543
482
  }
544
483
 
545
484
  // object_address_from: string for static address; number as identifier inconstant
546
- add_query(module:MODULES, query_name:string, object_address_from:string | number, bWitness:boolean=false) : GuardMaker {
485
+ add_query(module:MODULES, query_name:string, object_address_from:string | number) : GuardMaker {
547
486
  let query_index = Guard.QUERIES.findIndex((q) => { return q[0] == module && q[1] == query_name})
548
487
  if (query_index == -1) {
549
488
  ERROR(Errors.InvalidParam, 'query_name:'+query_name);
550
489
  }
551
490
 
552
491
  if (typeof(object_address_from) == 'number' ) {
553
- if (!GuardConstantHelper.IsValidIndentifier(object_address_from)) {
492
+ if (!GuardMaker.IsValidIndentifier(object_address_from)) {
554
493
  ERROR(Errors.InvalidParam, 'object_address_from:'+query_name);
555
494
  }
556
495
  } else {
@@ -571,13 +510,12 @@ export class GuardMaker {
571
510
 
572
511
  this.data.push(Bcs.getInstance().ser(ValueType.TYPE_U8, OperatorType.TYPE_QUERY)); // QUERY TYPE
573
512
  if (typeof(object_address_from) == 'string') {
574
- bWitness ? this.data.push(Bcs.getInstance().ser(ValueType.TYPE_U8, ContextType.TYPE_WITNESS_ID)) :
575
- this.data.push(Bcs.getInstance().ser(ValueType.TYPE_U8, ValueType.TYPE_ADDRESS));
513
+ this.data.push(Bcs.getInstance().ser(ValueType.TYPE_U8, ValueType.TYPE_ADDRESS));
576
514
  this.data.push(Bcs.getInstance().ser(ValueType.TYPE_ADDRESS, object_address_from)); // object address
577
515
  } else {
578
516
  let v = this.constant.get(object_address_from);
579
517
  if (!v) ERROR(Errors.Fail, 'object_address_from not in constant:'+query_name);
580
- if ((bWitness && v?.type == ContextType.TYPE_WITNESS_ID) || (!bWitness && v?.type == ValueType.TYPE_ADDRESS)) {
518
+ if (v?.type == ValueType.TYPE_ADDRESS) {
581
519
  this.data.push(Bcs.getInstance().ser(ValueType.TYPE_U8, ContextType.TYPE_CONSTANT));
582
520
  this.data.push(Bcs.getInstance().ser(ValueType.TYPE_U8, object_address_from)); // object identifer in constants
583
521
  } else {
@@ -694,13 +632,13 @@ export class GuardMaker {
694
632
  if (!otherBuilt.IsReady() || !this.IsReady()) { ERROR(Errors.Fail, 'both should built yet')};
695
633
  let maker = new GuardMaker();
696
634
  this.constant.forEach((v, k) => {
697
- maker.constant.set(k, {type:v.type, value:v.value, witness:v.witness});
635
+ maker.constant.set(k, {type:v.type, value:v.value, bWitness:v.bWitness});
698
636
  })
699
637
  otherBuilt.constant.forEach((v, k) => {
700
638
  if (maker.constant.has(k) && !bCombinConstant) {
701
639
  ERROR(Errors.Fail, 'constant identifier exist');
702
640
  }
703
- maker.constant.set(k, {type:v.type, value:v.value, witness:v.witness});
641
+ maker.constant.set(k, {type:v.type, value:v.value, bWitness:v.bWitness});
704
642
  })
705
643
  let op = bAnd ? OperatorType.TYPE_LOGIC_AND : OperatorType.TYPE_LOGIC_OR;
706
644
  maker.data.push(concatenate(Uint8Array, ...this.data, ...otherBuilt.data, Bcs.getInstance().ser(ValueType.TYPE_U8, op), Bcs.getInstance().ser(ValueType.TYPE_U8, 2)));