wowok 1.6.65 → 1.6.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wowok",
3
- "version": "1.6.65",
3
+ "version": "1.6.67",
4
4
  "description": "Create, collaborate, and transact on your own terms with the AI-driven web3 collaboration protocol.",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
package/src/entity.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Protocol, FnCallType, TxbObject, ResourceAddress, PermissionObject, ResourceObject} from './protocol';
2
2
  import { IsValidDesription, IsValidAddress, IsValidName, isValidHttpUrl, Bcs, IsValidArray, } from './utils';
3
3
  import { ERROR, Errors } from './exception';
4
- import { MarkName, Resource } from './resource';
5
- import { Transaction as TransactionBlock } from '@mysten/sui/transactions';
4
+ import { GroupName, Resource } from './resource';
5
+ import { Transaction as TransactionBlock, TransactionResult } from '@mysten/sui/transactions';
6
6
 
7
7
  export interface Safer {
8
8
  name: string;
@@ -33,13 +33,15 @@ export class Entity {
33
33
  return r
34
34
  }
35
35
 
36
- mark(resource:Resource, address:string, like:MarkName.LikeName | MarkName.DislikeName) {
37
- if (!IsValidAddress(address)) ERROR(Errors.IsValidAddress, like);
36
+ mark(resource:Resource, address:string | TransactionResult, like:GroupName.LikeName | GroupName.DislikeName) {
37
+ if (typeof(address) === 'string' && !IsValidAddress(address)) {
38
+ ERROR(Errors.IsValidAddress, like);
39
+ }
38
40
 
39
41
  this.txb.moveCall({
40
42
  target:Protocol.Instance().entityFn(like) as FnCallType,
41
43
  arguments:[Protocol.TXB_OBJECT(this.txb, this.object), Protocol.TXB_OBJECT(this.txb, resource.get_object()),
42
- this.txb.pure.address(address)]
44
+ typeof(address) === 'string' ? this.txb.pure.address(address) : address]
43
45
  })
44
46
  }
45
47
  /*
package/src/exception.ts CHANGED
@@ -24,6 +24,7 @@ export enum Errors {
24
24
  IsValidUserDefinedIndex = 'invalid user defined permission index',
25
25
  bcsTypeInvalid = 'invalid bcs type',
26
26
  IsValidServiceItemName = 'invalid service item name',
27
+ IsValidCoinType = 'not the coin type',
27
28
  noPermission = 'no permission',
28
29
  }
29
30
 
package/src/guard.ts CHANGED
@@ -29,6 +29,254 @@ export interface GuardAnswer {
29
29
 
30
30
  export type OnQueryAnswer = (answer: GuardAnswer) => void;
31
31
 
32
+ export const GUARD_QUERIES:any[] = [
33
+ // module, 'name', 'id', [input], output
34
+ [MODULES.permission, 'Owner', 1, [], ValueType.TYPE_ADDRESS, "Owner's address."],
35
+ [MODULES.permission, 'Is Admin', 2, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is a certain address an administrator?', ['address']],
36
+ [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']],
37
+ [MODULES.permission, 'Contains Address', 4, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address is included in the personnel permission table?', ['address']],
38
+ [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']],
39
+ [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']],
40
+ [MODULES.permission, 'Permission Guard', 7, [ValueType.TYPE_ADDRESS, ValueType.TYPE_U64], ValueType.TYPE_ADDRESS, 'Permission guard for a certain address.', ['address', 'permission index']],
41
+ [MODULES.permission, 'Number of Entities', 8, [], ValueType.TYPE_U64, 'Number of entities in the personnel permission table.', []],
42
+ [MODULES.permission, 'Number of Admin', 9, [], ValueType.TYPE_U64, 'Number of administrators.', []],
43
+
44
+ [MODULES.repository, 'Permission', 100, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
45
+ [MODULES.repository, 'Contains Policy', 101, [ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Is a consensus policy included?', ['the filed name']],
46
+ [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']],
47
+ [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']],
48
+ [MODULES.repository, 'Value Type of Policy', 104, [ValueType.TYPE_STRING], ValueType.TYPE_U8, 'Data types defined by consensus policy.', ['the policy name']],
49
+ [MODULES.repository, 'Contains Data', 105, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Does it contain data for a certain field of an address?', ['address','the field name']],
50
+ [MODULES.repository, 'Raw data without Type', 106, [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']],
51
+ [MODULES.repository, 'Raw data', 107, [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']],
52
+ [MODULES.repository, 'Type', 108, [], ValueType.TYPE_U8, 'The repository Type. 0: Normal; 1: Wowok greenee.', []],
53
+ [MODULES.repository, 'Policy Mode', 109, [], ValueType.TYPE_U8, 'Policy Mode. 0: Free mode; 1: Strict mode.', []],
54
+ [MODULES.repository, 'Reference Count', 110, [], ValueType.TYPE_U64, 'The number of times it is referenced by other objects.', []],
55
+ [MODULES.repository, 'Is Referenced by An Object', 111, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is it referenced by an object?', ['address']],
56
+ [MODULES.repository, 'Number Data', 112, [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']],
57
+ [MODULES.repository, 'String Data', 113, [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']],
58
+ [MODULES.repository, 'Address Data', 114, [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']],
59
+ [MODULES.repository, 'Bool Data', 115, [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']],
60
+ [MODULES.repository, 'Number Vector Data', 116, [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']],
61
+ [MODULES.repository, 'String Vector Data', 117, [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']],
62
+ [MODULES.repository, 'Address Vector Data', 118, [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']],
63
+ [MODULES.repository, 'Bool Vector Data', 119, [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']],
64
+
65
+ [MODULES.entity, 'Has Entity', 200, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is an entity already registered?', ['address']],
66
+ [MODULES.entity, 'Likes', 201, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The number of likes for an address by other addresses.', ['address']],
67
+ [MODULES.entity, 'Dislikes', 202, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The number of dislikes for an address by other addresses.', ['address']],
68
+ [MODULES.entity, 'Entity Info', 203, [ValueType.TYPE_ADDRESS], ValueType.TYPE_VEC_U8, 'Public information about an entity.', ['address']],
69
+ [MODULES.entity, 'Has Resource by Entity?', 204, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an entity created a resource?', ['address']],
70
+ [MODULES.entity, 'Entity Resource', 205, [ValueType.TYPE_ADDRESS], ValueType.TYPE_ADDRESS, 'The address of a resource object created by an entity.', ['address']],
71
+
72
+ [MODULES.demand, 'Permission', 300, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
73
+ [MODULES.demand, 'Deadline', 302, [], ValueType.TYPE_U64, 'The expiration time of presenting.', []],
74
+ [MODULES.demand, 'Bounty Count', 303, [], ValueType.TYPE_U64, 'Number of Bounties.', []],
75
+ [MODULES.demand, 'Has Guard', 304, [], ValueType.TYPE_BOOL, 'Whether the present guard is set?', []],
76
+ [MODULES.demand, 'Guard', 305, [], ValueType.TYPE_ADDRESS, 'The present guard address.', []],
77
+ [MODULES.demand, 'Has Service Picked', 306, [], ValueType.TYPE_BOOL, 'Whether a service has been picked and bounties given?', []],
78
+ [MODULES.demand, 'Service Picked', 307, [], ValueType.TYPE_ADDRESS, 'Service address that has been picked.', []],
79
+ [MODULES.demand, 'Presenter Count', 308, [], ValueType.TYPE_U64, 'Number of presenters.', []],
80
+ [MODULES.demand, 'Has Presenter', 309, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is a certain address a presenter?', ['address']],
81
+ [MODULES.demand, 'Who Got Bounty', 310, [ValueType.TYPE_ADDRESS], ValueType.TYPE_ADDRESS, 'The address that bounties given.', ['address']],
82
+
83
+ [MODULES.service, 'Permission', 400, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
84
+ [MODULES.service, 'Payee', 401, [], ValueType.TYPE_ADDRESS, 'Payee address, that all order withdrawals will be collected to this address.', []],
85
+ [MODULES.service, 'Has Buying Guard', 402, [], ValueType.TYPE_BOOL, 'Is the guard condition of buying set?', []],
86
+ [MODULES.service, 'Buying Guard', 403, [], ValueType.TYPE_ADDRESS, 'Buying guard, that Purchase only if you meet the conditions of the guard.', []],
87
+ [MODULES.service, 'Contains Repository', 404, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, "Is a certain repository one of the service's consensus repositories?", ['address']],
88
+ [MODULES.service, 'Has Withdrawing Guard', 405, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether a certain guard is set when withdrawing money?', ['address']],
89
+ [MODULES.service, 'Withdrawing Guard Percent', 406, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The percentage of withdrawals allowed by a certain withdrawal guard.', ['address']],
90
+ [MODULES.service, 'Has Refunding Guard', 407, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether a certain guard is set when refunding money?', ['address']],
91
+ [MODULES.service, 'Refunding Guard Percent', 408, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The percentage of refund allowed by a certain refund guard.', ['address']],
92
+ [MODULES.service, 'Has Sales Item', 409, [ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Is there a sales item for the service?', ['the item name']],
93
+ [MODULES.service, 'Sale Item Price', 410, [ValueType.TYPE_STRING], ValueType.TYPE_U64, 'What is the price of a certain sale item?', ['the item name']],
94
+ [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']],
95
+ [MODULES.service, 'Has Machine', 412, [], ValueType.TYPE_BOOL, "Has the machine(progress generator) that serves the order been set up?", []],
96
+ [MODULES.service, 'Machine', 413, [], ValueType.TYPE_ADDRESS, 'Machine address, that generate progresses serving the execution process of order.', []],
97
+ [MODULES.service, 'Paused', 414, [], ValueType.TYPE_BOOL, 'Pause the creation of new order?'],
98
+ [MODULES.service, 'Published', 415, [], ValueType.TYPE_BOOL, 'Is it allowed to create orders?'],
99
+ [MODULES.service, 'Has Required Info', 416, [], ValueType.TYPE_BOOL, 'Whether the necessary information that needs to be provided by the customer is set?', []],
100
+ [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.', []],
101
+ [MODULES.service, 'Required Info', 418, [], ValueType.TYPE_VEC_STRING, 'Names of the required information item that needs to be provided by the customer.', []],
102
+ [MODULES.service, 'Number of Treasuries', 419, [], ValueType.TYPE_U64, 'The number of treasuries that can be externally withdrawn for purposes such as compensation or incentives.', []],
103
+ [MODULES.service, 'Contains Treasury', 420, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Does it contain externally withdrawable Treasury for purposes such as compensation or incentives?', ['treasury address']],
104
+ [MODULES.service, 'Number of Arbitrations', 421, [], ValueType.TYPE_U64, 'The number of arbitrations that allows a refund to be made from the order at any time based on the arbitration result.', []],
105
+ [MODULES.service, 'Contains Arbitration', 422, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Does it contain an arbitration that allows a refund to be made from the order at any time based on the arbitration result.?', ['arbitration address']],
106
+
107
+ [MODULES.order, 'Amount', 500, [], ValueType.TYPE_U64, 'Order amount.', []],
108
+ [MODULES.order, 'Payer', 501, [], ValueType.TYPE_ADDRESS, 'Order payer.', []],
109
+ [MODULES.order, 'Service', 502, [], ValueType.TYPE_ADDRESS, 'Service for creating orders.', []],
110
+ [MODULES.order, 'Has Progress', 503, [], ValueType.TYPE_BOOL, 'Is there a Progress for executing the order process?', []],
111
+ [MODULES.order, 'Progress', 504, [], ValueType.TYPE_ADDRESS, 'Progress address for executing the order process.', []],
112
+ [MODULES.order, 'Required Info', 505, [], ValueType.TYPE_BOOL, 'Is Required Info set?', []],
113
+ [MODULES.order, 'Discount Used', 506, [], ValueType.TYPE_BOOL, 'Discount coupon used for this order?', []],
114
+ [MODULES.order, 'Discount', 507, [], ValueType.TYPE_ADDRESS, 'Discount address that already used.', []],
115
+ [MODULES.order, 'Balance', 508, [], ValueType.TYPE_U64, 'The amount currently in the order.', []],
116
+ // [MODULES.order, 'Refunded', 509, [], ValueType.TYPE_BOOL, 'Whether a refund has occurred?', []],
117
+ // [MODULES.order, 'Withdrawed', 510, [], ValueType.TYPE_BOOL, 'Whether a service provider withdrawal has occurred?', []],
118
+ [MODULES.order, 'Number of Agents', 511, [], ValueType.TYPE_U64, 'The number of agents for the order.', []],
119
+ [MODULES.order, 'Has Agent', 512, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address is an order agent?', ['agent address']],
120
+ [MODULES.order, 'Number of Disputes', 513, [], ValueType.TYPE_U64, 'Number of arbitrations for the order.', []],
121
+ [MODULES.order, 'Has Arb', 514, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Does the order contain an Arb for arbitration?', ['arb address']],
122
+ /* @Deprecated
123
+ [MODULES.reward, 'Permission', 600, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
124
+ [MODULES.reward, 'Rewards Remaining', 601, [], ValueType.TYPE_U64, 'Number of rewards to be claimed.', []],
125
+ [MODULES.reward, 'Reward Count Supplied', 602, [], ValueType.TYPE_U64, 'Total rewards supplied.', []],
126
+ [MODULES.reward, 'Guard Count', 603, [], ValueType.TYPE_U64, 'The number of claiming guards.', []],
127
+ [MODULES.reward, 'Has Guard', 604, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether a claiming guard is set up?', ['address']],
128
+ [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']],
129
+ [MODULES.reward, 'Deadline', 606, [], ValueType.TYPE_U64, 'The expiration time of claiming.', []],
130
+ [MODULES.reward, 'Has Claimed by An Address', 607, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether a certain address has claimed rewards?', ['address']],
131
+ [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.', []],
132
+ [MODULES.reward, 'Number of Addresses Claimed', 609, [], ValueType.TYPE_U64, 'Number of addresses that have claimed rewards.', []],
133
+ [MODULES.reward, 'Is Sponsor', 620, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address is a sponsor of the reward pool?', ['address']],
134
+ [MODULES.reward, 'Portions by A Sponsor', 611, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The portions of sponsorship reward pools for a certain address.', ['address']],
135
+ [MODULES.reward, 'Number of Sponsors', 612, [], ValueType.TYPE_U64, 'Number of sponsors in the sponsorship reward pool.', []],
136
+ [MODULES.reward, 'Allow Repeated Claims', 613, [], ValueType.TYPE_BOOL, 'Whether to allow repeated claims?', []],
137
+ */
138
+
139
+ [MODULES.machine, 'Permission', 700, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
140
+ [MODULES.machine, 'Paused', 701, [], ValueType.TYPE_BOOL, 'Pause the creation of new Progress?', []],
141
+ [MODULES.machine, 'Published', 702, [], ValueType.TYPE_BOOL, 'Is it allowed to create Progress?', []],
142
+ [MODULES.machine, 'Is Consensus Repository', 703, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address is a consensus repository?', ['adddress']],
143
+ [MODULES.machine, 'Has Endpoint', 704, [], ValueType.TYPE_BOOL, 'Is the endpoint set?', []],
144
+ [MODULES.machine, 'Endpoint', 705, [], ValueType.TYPE_STRING, 'Endpoint url/ipfs.', []],
145
+
146
+ [MODULES.progress, 'Machine', 800, [], ValueType.TYPE_ADDRESS, 'The Machine object that created this Progress.', []],
147
+ [MODULES.progress, 'Current Node', 801, [], ValueType.TYPE_STRING, 'The name of the currently running node.', []],
148
+ [MODULES.progress, 'Has Parent', 802, [], ValueType.TYPE_BOOL, 'Is the parent Progress defined?', []],
149
+ [MODULES.progress, 'Parent', 803, [], ValueType.TYPE_ADDRESS, 'The parent Progress, that contains some child Progress.', []],
150
+ [MODULES.progress, 'Has Task', 804, [], ValueType.TYPE_BOOL, 'Does it contain clear task(eg. an Order)?', []],
151
+ [MODULES.progress, 'Task', 805, [], ValueType.TYPE_ADDRESS, 'Task object address.', []],
152
+ [MODULES.progress, 'Has Unique Permission', 806, [ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Does Progress define a unique operation permission?', ['operator name']],
153
+ [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']],
154
+ [MODULES.progress, 'Has Context Repository', 808, [], ValueType.TYPE_BOOL, 'Whether the repository reference for Progress is set?', []],
155
+ [MODULES.progress, 'Context Repository', 809, [], ValueType.TYPE_ADDRESS, 'Repository reference for Progress.', []],
156
+ [MODULES.progress, 'Last Session Time', 810, [], ValueType.TYPE_U64, 'Time when the previous session was completed.', []],
157
+ [MODULES.progress, 'Last Session Node', 811, [], ValueType.TYPE_STRING, 'The name of the last completed node.', []],
158
+ [MODULES.progress, 'Current Session-id', 812, [], ValueType.TYPE_U64, 'The session id of ongoing node.', []],
159
+ [MODULES.progress, 'Parent Session-id', 813, [], ValueType.TYPE_U64, 'The child process was started in the Session-id phase of the parent process.', []],
160
+ [MODULES.progress, 'Parent Next Node', 814, [], ValueType.TYPE_STRING, 'The child process is started at the next node stage of the parent process.', []],
161
+ [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.', []],
162
+ [MODULES.progress, 'Parent Node', 816, [], ValueType.TYPE_STRING, 'The node name of the parent process where the child process is located.', []],
163
+ [MODULES.progress, 'Forward Accomplished', 817, [ValueType.TYPE_U64, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Has the forward been accomplished?', ['session-id', 'next node name', 'forward name']],
164
+ [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']],
165
+ [MODULES.progress, 'Forward Message', 819, [ValueType.TYPE_U64, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_STRING, 'The forward message.', ['session-id', 'next node name', 'forward name']],
166
+ [MODULES.progress, 'Forward Order Count', 820, [ValueType.TYPE_U64, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_U64, 'The forward Order count.', ['session-id', 'next node name', 'forward name']],
167
+ [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']],
168
+ [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']],
169
+ [MODULES.progress, 'Closest Forward Accomplished', 823, [ValueType.TYPE_STRING, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Has the forward been accomplished?', ['node name', 'next node name', 'forward name']],
170
+ [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']],
171
+ [MODULES.progress, 'Closest Forward Message', 825, [ValueType.TYPE_STRING, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_STRING, 'The message of the forward that closest time to the current node.', ['node name', 'next node name', 'forward name']],
172
+ [MODULES.progress, 'Closest Forward Order Count', 826, [ValueType.TYPE_STRING, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_U64, 'The Order count of the forward that closest time to the current node.', ['node name', 'next node name', 'forward name']],
173
+ [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']],
174
+
175
+ [MODULES.wowok, 'Builder', 900, [], ValueType.TYPE_ADDRESS, 'Builder address of Wowok.', []],
176
+ [MODULES.wowok, 'Everyone Guard', 901, [], ValueType.TYPE_ADDRESS, 'A guard that all addresses can pass through.', []],
177
+ [MODULES.wowok, 'Object of Entities', 902, [], ValueType.TYPE_ADDRESS, 'The address of entity information object.', []],
178
+ [MODULES.wowok, 'Grantor Count', 903, [], ValueType.TYPE_U64, 'Number of registered grantors.', []],
179
+ [MODULES.wowok, 'Has Grantor', 904, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address has been registered as a grantor?', ['address']],
180
+ [MODULES.wowok, 'Grantor Name', 905, [ValueType.TYPE_ADDRESS], ValueType.TYPE_STRING, "Name of a grantor.", ['address']],
181
+ [MODULES.wowok, 'Grantor Registration Time', 906, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'Registration time of a grantor.', ['address']],
182
+ [MODULES.wowok, 'Grantor Expired Time', 907, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The expiration time of a grantor.', ['address']],
183
+ [MODULES.wowok, 'Grantee Object for Grantor', 908, [ValueType.TYPE_ADDRESS], ValueType.TYPE_ADDRESS, 'Grantee repository address of a grantor.', ['address']],
184
+ /* @Deprecated
185
+ [MODULES.vote, 'Permission', 1101, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
186
+ [MODULES.vote, 'Be Voting', 1102, [], ValueType.TYPE_BOOL, 'Whether to start voting and options will not be changed?', []],
187
+ [MODULES.vote, 'Deadline Locked', 1103, [], ValueType.TYPE_BOOL, 'Whether the deadline cannot be modified?', []],
188
+ [MODULES.vote, 'Vote-Guard Locked', 1104, [], ValueType.TYPE_BOOL, 'Whether the Guard for voting cannot be modified?', []],
189
+ [MODULES.vote, 'Max Choice Count', 1105, [], ValueType.TYPE_U8, 'The maximum number of options that can be selected in one vote.', []],
190
+ [MODULES.vote, 'Deadline', 1106, [], ValueType.TYPE_U64, 'Deadline for voting.', []],
191
+ [MODULES.vote, 'Has Reference', 1107, [], ValueType.TYPE_BOOL, 'Whether to vote for a reference Object?', []],
192
+ [MODULES.vote, 'Reference', 1108, [], ValueType.TYPE_ADDRESS, 'Reference Object that voting for.', []],
193
+ [MODULES.vote, 'Has Vote-Guard', 1109, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is a certain Guard included in the Vote-Guard settings?', ['guard address']],
194
+ [MODULES.vote, 'Vote-Guard Wight', 1110, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The voting weight corresponding to the Vote-Guard.', ['guard address']],
195
+ [MODULES.vote, 'Has Voted by Address', 1111, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address has already voted?', ['address']],
196
+ [MODULES.vote, 'Voted Weight by Address', 1112, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The weight of whether an address has been voted on.', ['adddress']],
197
+ [MODULES.vote, 'Has Option', 1113, [ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Whether a voting option is included?', ['option content']],
198
+ [MODULES.vote, 'Has Object of Option', 1114, [ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Whether a voting option refers to an object?', ['option content']],
199
+ [MODULES.vote, 'Option Object', 1115, [ValueType.TYPE_STRING], ValueType.TYPE_ADDRESS, 'The object referenced by a voting option.', ['option content']],
200
+ [MODULES.vote, 'Option Counts', 1116, [ValueType.TYPE_STRING], ValueType.TYPE_U64, 'The number of votes for the voting option.', ['option content']],
201
+ [MODULES.vote, 'Option Votes', 1117, [ValueType.TYPE_STRING], ValueType.TYPE_U64, 'The number of voted addresses for the voting option.', ['option content']],
202
+ [MODULES.vote, 'Address Count Voted', 1118, [], ValueType.TYPE_U64, 'Total number of addresses voted.', []],
203
+ [MODULES.vote, 'Top1 Option by Addresses', 1119, [], ValueType.TYPE_STRING, 'The content of the voting option ranked first by the number of voting addresses.', []],
204
+ [MODULES.vote, 'Top1 Counts by Addresses', 1120, [], ValueType.TYPE_U64, 'Number of votes for the top voting option by number of voting addresses.', []],
205
+ [MODULES.vote, 'Top1 Option by Votes', 1121, [], ValueType.TYPE_STRING, 'The content of the voting option ranked first by the number of votes.', []],
206
+ [MODULES.vote, 'Top1 Counts by Votes', 1122, [], ValueType.TYPE_U64, 'Number of votes for the top voting option by number of votes.', []],
207
+ [MODULES.vote, 'Voted Time by Address', 1113, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The time of whether an address has been voted on.', ['adddress']],
208
+ */
209
+ [MODULES.payment, 'Sender', 1200, [], ValueType.TYPE_ADDRESS, 'Payment originator address.', []],
210
+ [MODULES.payment, 'Total Amount', 1201, [], ValueType.TYPE_U128, "Payment amount.", []],
211
+ [MODULES.payment, 'Remark', 1202, [], ValueType.TYPE_STRING, 'Payment remark.', ['address']],
212
+ [MODULES.payment, 'Has Guard for Perpose', 1203, [], ValueType.TYPE_BOOL, 'Whether the payment references a Guard?', []],
213
+ [MODULES.payment, 'Has Object for Perpose', 1204, [], ValueType.TYPE_BOOL, 'Whether the payment references an Object?', []],
214
+ [MODULES.payment, 'Guard for Perpose', 1205, [], ValueType.TYPE_ADDRESS, 'The Guard referenced by this payment.', []],
215
+ [MODULES.payment, 'Object for Perpose', 1206, [], ValueType.TYPE_ADDRESS, "The Object referenced by this payment.", []],
216
+ [MODULES.payment, 'Number of Recipients', 1207, [], ValueType.TYPE_U64, 'Number of recipients to receive payment from.', []],
217
+ [MODULES.payment, 'Is a Recipient', 1208, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is a recipient received the payment?', ['address']],
218
+ [MODULES.payment, 'Amount for a Recipient', 1209, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The amount of payment received by an address.', ['address']],
219
+ [MODULES.payment, 'Time', 1210, [], ValueType.TYPE_U64, 'Payment time', []],
220
+ [MODULES.payment, 'Is from Treasury', 1211, [], ValueType.TYPE_BOOL, 'Whether the payment comes from a Treasury?', []],
221
+ [MODULES.payment, 'Treasury Address', 1212, [], ValueType.TYPE_ADDRESS, 'The Treasury from which the payment comes.', []],
222
+ [MODULES.payment, 'Biz-ID', 1213, [], ValueType.TYPE_U64, 'Bisiness ID number of the payment.', []],
223
+
224
+ [MODULES.treasury, 'Permission', 1400, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
225
+ [MODULES.treasury, 'Balance', 1401, [], ValueType.TYPE_U64, "Treasury balance.", []],
226
+ [MODULES.treasury, 'Number of Flow Records', 1402, [], ValueType.TYPE_U64, 'Number of treasury transactions.', []],
227
+ [MODULES.treasury, 'Inflow Amount', 1403, [], ValueType.TYPE_U128, 'Treasury inflow amount.', []],
228
+ [MODULES.treasury, 'Outflow Amount', 1404, [], ValueType.TYPE_U128, 'Treasury outflow amount.', []],
229
+ [MODULES.treasury, 'Has Deposit Guard', 1405, [], ValueType.TYPE_BOOL, 'Whether the deposit Guard set?', []],
230
+ [MODULES.treasury, 'Deposit Guard', 1406, [], ValueType.TYPE_ADDRESS, 'Deposit Guard address.', []],
231
+ [MODULES.treasury, 'Number of Withdraw Guards', 1407, [], ValueType.TYPE_U64, 'Number of withdraw guards.', []],
232
+ [MODULES.treasury, 'Has Withdraw Guard', 1408, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Has a Withdraw Guard added?', ['guard address']],
233
+ [MODULES.treasury, 'Withdrawal Amount with Guard', 1409, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'withdrawal amount corresponding the Guard.', ['guard address']],
234
+ [MODULES.treasury, 'Recent Time with Operation', 1410, [ValueType.TYPE_U8], ValueType.TYPE_U64, 'Time of the most recent fund operation.', ['operation']],
235
+ [MODULES.treasury, 'Recent Signer with Operation', 1411, [ValueType.TYPE_U8], ValueType.TYPE_ADDRESS, 'Signer address of the most recent fund operation.', ['operation']],
236
+ [MODULES.treasury, 'Recent Payment with Operation', 1412, [ValueType.TYPE_U8], ValueType.TYPE_ADDRESS, 'Payment address of the most recent fund operation.', ['operation']],
237
+ [MODULES.treasury, 'Recent Amount with Operation', 1413, [ValueType.TYPE_U8], ValueType.TYPE_U64, 'Amount of the most recent fund operation.', ['operation']],
238
+ [MODULES.treasury, 'Recent Time with Op/Pmt', 1414, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'Time of the most recent fund operation with payment specified.', ['operation', 'payment address']],
239
+ [MODULES.treasury, 'Recent Signer with Op&Pmt', 1415, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS], ValueType.TYPE_ADDRESS, 'Signer of the most recent fund operationwith payment specified.', ['operation', 'payment address']],
240
+ [MODULES.treasury, 'Recent Amount with Op/Pmt', 1416, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'Amount of the most recent fund operation with payment specified.', ['operation', 'payment address']],
241
+ [MODULES.treasury, 'Recent Time with Op/Sgr', 1417, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'Time of the most recent fund operation with signer specified.', ['operation', 'signer address']],
242
+ [MODULES.treasury, 'Recent Payment with Op/Sgr', 1418, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS], ValueType.TYPE_ADDRESS, 'Payment of the most recent fund operation with singner specified.', ['operation', 'signer address']],
243
+ [MODULES.treasury, 'Recent Amount with Op/Sgr', 1419, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'Amount of the most recent fund operation with singer specified.', ['operation', 'signer address']],
244
+ [MODULES.treasury, 'Recent Time with Op/Pmt/Sgr', 1420, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS, ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'Time of the most recent fund operation.', ['operation', 'payment address', 'singer address']],
245
+ [MODULES.treasury, 'Recent Amount with Op/Pmt/Sgr', 1421, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS, ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'Amount of the most recent fund operation.', ['operation', 'payment address', 'singer address']],
246
+ [MODULES.treasury, 'Has Operation', 1422, [ValueType.TYPE_U8], ValueType.TYPE_BOOL, 'Whether there was a fund operation?', ['operation']],
247
+ [MODULES.treasury, 'Has Operation with Pmt', 1423, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether there was a fund operation with payment specified?', ['operation', 'payment address']],
248
+ [MODULES.treasury, 'Has Operation with Sgr', 1424, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether there was a fund operation with singer specified?', ['operation', 'singer address']],
249
+ [MODULES.treasury, 'Has Operation with Pmt/Sgr', 1425, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS, ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether there was a fund operation?', ['operation', 'payment address', 'singer address']],
250
+ [MODULES.treasury, 'Operation at Least Times', 1426, [ValueType.TYPE_U8, ValueType.TYPE_U8], ValueType.TYPE_BOOL, 'Does it operate at least a certain number of times?', ['operation', 'at least times']],
251
+ [MODULES.treasury, 'Operation at Least Times by a Signer', 1427, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS, ValueType.TYPE_U8], ValueType.TYPE_BOOL, 'Does it operate at least a certain number of times by a signer?', ['operation', 'signer address', 'at least times']],
252
+
253
+ [MODULES.arbitration, 'Permission', 1500, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
254
+ [MODULES.arbitration, 'Paused', 1501, [], ValueType.TYPE_BOOL, "Is it allowed to create Arb?", []],
255
+ [MODULES.arbitration, 'Fee', 1502, [], ValueType.TYPE_U64, 'Cost of arbitration.', []],
256
+ [MODULES.arbitration, 'Has Endpoint', 1503, [], ValueType.TYPE_BOOL, 'Is the endpoint set?', []],
257
+ [MODULES.arbitration, 'Endpoint', 1504, [], ValueType.TYPE_STRING, 'Endpoint url/ipfs.', []],
258
+ [MODULES.arbitration, 'Has Customer Guard', 1505, [], ValueType.TYPE_BOOL, 'Is there Guard set to apply for arbitration?', []],
259
+ [MODULES.arbitration, 'Customer Guard', 1506, [], ValueType.TYPE_ADDRESS, 'Guard to apply for arbitration.', []],
260
+ [MODULES.arbitration, 'Number of Voting Guard', 1507, [], ValueType.TYPE_U64, 'Number of voting guards.', []],
261
+ [MODULES.arbitration, 'Has Voting Guard', 1508, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Has the voting Guard added?', ['guard address']],
262
+ [MODULES.arbitration, 'Voting Weight', 1509, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'Voting weight of the voting Guard.', ['guard address']],
263
+ [MODULES.arbitration, 'Treasury', 1510, [], ValueType.TYPE_ADDRESS, 'The address of the Treasury where fees was collected at the time of withdrawal.', []],
264
+
265
+ [MODULES.arb, 'Order', 1600, [], ValueType.TYPE_ADDRESS, 'Order under arbitration.', []],
266
+ [MODULES.arb, 'Arbitration', 1601, [], ValueType.TYPE_ADDRESS, "Arbitration object address.", []],
267
+ [MODULES.arb, 'Feedback', 1602, [], ValueType.TYPE_STRING, 'Arbitration feedback.', []],
268
+ [MODULES.arb, 'Has Compensation', 1603, [], ValueType.TYPE_BOOL, 'Whether there is an arbitration result?', []],
269
+ [MODULES.arb, 'Compensation', 1604, [], ValueType.TYPE_U64, 'Compensation should be given to the order payer.', []],
270
+ [MODULES.arb, 'Unclaimed Arbitration Costs', 1605, [], ValueType.TYPE_U64, 'Unclaimed arbitration costs.', []],
271
+ [MODULES.arb, 'Turnout', 1606, [], ValueType.TYPE_U64, 'The number of addresses have voted.', []],
272
+ [MODULES.arb, 'Has voted', 1607, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Has someone voted?', ['voter address']],
273
+ [MODULES.arb, 'Voting weight', 1608, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The weight of a complete vote for the address.', ['voter address']],
274
+ [MODULES.arb, 'Voting Time', 1609, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The time of a complete vote for the address.', ['voter address']],
275
+ [MODULES.arb, 'Voting Option', 1610, [ValueType.TYPE_ADDRESS, ValueType.TYPE_U8], ValueType.TYPE_BOOL, 'Does an address complete voting for the option?', ['voter address', 'option index']],
276
+ [MODULES.arb, 'Number of Options', 1611, [], ValueType.TYPE_U64, 'Number of voting options.', []],
277
+ [MODULES.arb, 'Number of Votes', 1612, [ValueType.TYPE_U8], ValueType.TYPE_U64, 'The number of votes received for an option.', ['option index']],
278
+ ];
279
+
32
280
  export class Guard {
33
281
  static MAX_INPUT_LENGTH = 10240;
34
282
  // static MAX_PAYLOADS_LENGTH = 4096;
@@ -133,260 +381,13 @@ export class Guard {
133
381
  })
134
382
  }
135
383
 
136
- static QUERIES:any[] = [
137
- // module, 'name', 'id', [input], output
138
- [MODULES.permission, 'Owner', 1, [], ValueType.TYPE_ADDRESS, "Owner's address."],
139
- [MODULES.permission, 'Is Admin', 2, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is a certain address an administrator?', ['address']],
140
- [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']],
141
- [MODULES.permission, 'Contains Address', 4, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address is included in the personnel permission table?', ['address']],
142
- [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']],
143
- [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']],
144
- [MODULES.permission, 'Permission Guard', 7, [ValueType.TYPE_ADDRESS, ValueType.TYPE_U64], ValueType.TYPE_ADDRESS, 'Permission guard for a certain address.', ['address', 'permission index']],
145
- [MODULES.permission, 'Number of Entities', 8, [], ValueType.TYPE_U64, 'Number of entities in the personnel permission table.', []],
146
- [MODULES.permission, 'Number of Admin', 9, [], ValueType.TYPE_U64, 'Number of administrators.', []],
147
-
148
- [MODULES.repository, 'Permission', 100, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
149
- [MODULES.repository, 'Contains Policy', 101, [ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Is a consensus policy included?', ['the filed name']],
150
- [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']],
151
- [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']],
152
- [MODULES.repository, 'Value Type of Policy', 104, [ValueType.TYPE_STRING], ValueType.TYPE_U8, 'Data types defined by consensus policy.', ['the policy name']],
153
- [MODULES.repository, 'Contains Data', 105, [ValueType.TYPE_ADDRESS, ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Does it contain data for a certain field of an address?', ['address','the field name']],
154
- [MODULES.repository, 'Raw data without Type', 106, [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']],
155
- [MODULES.repository, 'Raw data', 107, [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']],
156
- [MODULES.repository, 'Type', 108, [], ValueType.TYPE_U8, 'The repository Type. 0: Normal; 1: Wowok greenee.', []],
157
- [MODULES.repository, 'Policy Mode', 109, [], ValueType.TYPE_U8, 'Policy Mode. 0: Free mode; 1: Strict mode.', []],
158
- [MODULES.repository, 'Reference Count', 110, [], ValueType.TYPE_U64, 'The number of times it is referenced by other objects.', []],
159
- [MODULES.repository, 'Is Referenced by An Object', 111, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is it referenced by an object?', ['address']],
160
- [MODULES.repository, 'Number Data', 112, [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']],
161
- [MODULES.repository, 'String Data', 113, [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']],
162
- [MODULES.repository, 'Address Data', 114, [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']],
163
- [MODULES.repository, 'Bool Data', 115, [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']],
164
- [MODULES.repository, 'Number Vector Data', 116, [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']],
165
- [MODULES.repository, 'String Vector Data', 117, [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']],
166
- [MODULES.repository, 'Address Vector Data', 118, [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']],
167
- [MODULES.repository, 'Bool Vector Data', 119, [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']],
168
-
169
- [MODULES.entity, 'Has Entity', 200, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is an entity already registered?', ['address']],
170
- [MODULES.entity, 'Likes', 201, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The number of likes for an address by other addresses.', ['address']],
171
- [MODULES.entity, 'Dislikes', 202, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The number of dislikes for an address by other addresses.', ['address']],
172
- [MODULES.entity, 'Entity Info', 203, [ValueType.TYPE_ADDRESS], ValueType.TYPE_VEC_U8, 'Public information about an entity.', ['address']],
173
- [MODULES.entity, 'Has Resource by Entity?', 204, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an entity created a resource?', ['address']],
174
- [MODULES.entity, 'Entity Resource', 205, [ValueType.TYPE_ADDRESS], ValueType.TYPE_ADDRESS, 'The address of a resource object created by an entity.', ['address']],
175
-
176
- [MODULES.demand, 'Permission', 300, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
177
- [MODULES.demand, 'Deadline', 302, [], ValueType.TYPE_U64, 'The expiration time of presenting.', []],
178
- [MODULES.demand, 'Bounty Count', 303, [], ValueType.TYPE_U64, 'Number of Bounties.', []],
179
- [MODULES.demand, 'Has Guard', 304, [], ValueType.TYPE_BOOL, 'Whether the present guard is set?', []],
180
- [MODULES.demand, 'Guard', 305, [], ValueType.TYPE_ADDRESS, 'The present guard address.', []],
181
- [MODULES.demand, 'Has Service Picked', 306, [], ValueType.TYPE_BOOL, 'Whether a service has been picked and bounties given?', []],
182
- [MODULES.demand, 'Service Picked', 307, [], ValueType.TYPE_ADDRESS, 'Service address that has been picked.', []],
183
- [MODULES.demand, 'Presenter Count', 308, [], ValueType.TYPE_U64, 'Number of presenters.', []],
184
- [MODULES.demand, 'Has Presenter', 309, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is a certain address a presenter?', ['address']],
185
- [MODULES.demand, 'Who Got Bounty', 310, [ValueType.TYPE_ADDRESS], ValueType.TYPE_ADDRESS, 'The address that bounties given.', ['address']],
186
-
187
- [MODULES.service, 'Permission', 400, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
188
- [MODULES.service, 'Payee', 401, [], ValueType.TYPE_ADDRESS, 'Payee address, that all order withdrawals will be collected to this address.', []],
189
- [MODULES.service, 'Has Buying Guard', 402, [], ValueType.TYPE_BOOL, 'Is the guard condition of buying set?', []],
190
- [MODULES.service, 'Buying Guard', 403, [], ValueType.TYPE_ADDRESS, 'Buying guard, that Purchase only if you meet the conditions of the guard.', []],
191
- [MODULES.service, 'Contains Repository', 404, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, "Is a certain repository one of the service's consensus repositories?", ['address']],
192
- [MODULES.service, 'Has Withdrawing Guard', 405, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether a certain guard is set when withdrawing money?', ['address']],
193
- [MODULES.service, 'Withdrawing Guard Percent', 406, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The percentage of withdrawals allowed by a certain withdrawal guard.', ['address']],
194
- [MODULES.service, 'Has Refunding Guard', 407, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether a certain guard is set when refunding money?', ['address']],
195
- [MODULES.service, 'Refunding Guard Percent', 408, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The percentage of refund allowed by a certain refund guard.', ['address']],
196
- [MODULES.service, 'Has Sales Item', 409, [ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Is there a sales item for the service?', ['the item name']],
197
- [MODULES.service, 'Sale Item Price', 410, [ValueType.TYPE_STRING], ValueType.TYPE_U64, 'What is the price of a certain sale item?', ['the item name']],
198
- [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']],
199
- [MODULES.service, 'Has Machine', 412, [], ValueType.TYPE_BOOL, "Has the machine(progress generator) that serves the order been set up?", []],
200
- [MODULES.service, 'Machine', 413, [], ValueType.TYPE_ADDRESS, 'Machine address, that generate progresses serving the execution process of order.', []],
201
- [MODULES.service, 'Paused', 414, [], ValueType.TYPE_BOOL, 'Pause the creation of new order?'],
202
- [MODULES.service, 'Published', 415, [], ValueType.TYPE_BOOL, 'Is it allowed to create orders?'],
203
- [MODULES.service, 'Has Required Info', 416, [], ValueType.TYPE_BOOL, 'Whether the necessary information that needs to be provided by the customer is set?', []],
204
- [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.', []],
205
- [MODULES.service, 'Required Info', 418, [], ValueType.TYPE_VEC_STRING, 'Names of the required information item that needs to be provided by the customer.', []],
206
- [MODULES.service, 'Number of Treasuries', 419, [], ValueType.TYPE_U64, 'The number of treasuries that can be externally withdrawn for purposes such as compensation or incentives.', []],
207
- [MODULES.service, 'Contains Treasury', 420, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Does it contain externally withdrawable Treasury for purposes such as compensation or incentives?', ['treasury address']],
208
- [MODULES.service, 'Number of Arbitrations', 421, [], ValueType.TYPE_U64, 'The number of arbitrations that allows a refund to be made from the order at any time based on the arbitration result.', []],
209
- [MODULES.service, 'Contains Arbitration', 422, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Does it contain an arbitration that allows a refund to be made from the order at any time based on the arbitration result.?', ['arbitration address']],
210
-
211
- [MODULES.order, 'Amount', 500, [], ValueType.TYPE_U64, 'Order amount.', []],
212
- [MODULES.order, 'Payer', 501, [], ValueType.TYPE_ADDRESS, 'Order payer.', []],
213
- [MODULES.order, 'Service', 502, [], ValueType.TYPE_ADDRESS, 'Service for creating orders.', []],
214
- [MODULES.order, 'Has Progress', 503, [], ValueType.TYPE_BOOL, 'Is there a Progress for executing the order process?', []],
215
- [MODULES.order, 'Progress', 504, [], ValueType.TYPE_ADDRESS, 'Progress address for executing the order process.', []],
216
- [MODULES.order, 'Required Info', 505, [], ValueType.TYPE_BOOL, 'Is Required Info set?', []],
217
- [MODULES.order, 'Discount Used', 506, [], ValueType.TYPE_BOOL, 'Discount coupon used for this order?', []],
218
- [MODULES.order, 'Discount', 507, [], ValueType.TYPE_ADDRESS, 'Discount address that already used.', []],
219
- [MODULES.order, 'Balance', 508, [], ValueType.TYPE_U64, 'The amount currently in the order.', []],
220
- // [MODULES.order, 'Refunded', 509, [], ValueType.TYPE_BOOL, 'Whether a refund has occurred?', []],
221
- // [MODULES.order, 'Withdrawed', 510, [], ValueType.TYPE_BOOL, 'Whether a service provider withdrawal has occurred?', []],
222
- [MODULES.order, 'Number of Agents', 511, [], ValueType.TYPE_U64, 'The number of agents for the order.', []],
223
- [MODULES.order, 'Has Agent', 512, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address is an order agent?', ['agent address']],
224
- [MODULES.order, 'Number of Disputes', 513, [], ValueType.TYPE_U64, 'Number of arbitrations for the order.', []],
225
- [MODULES.order, 'Has Arb', 514, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Does the order contain an Arb for arbitration?', ['arb address']],
226
- /* @Deprecated
227
- [MODULES.reward, 'Permission', 600, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
228
- [MODULES.reward, 'Rewards Remaining', 601, [], ValueType.TYPE_U64, 'Number of rewards to be claimed.', []],
229
- [MODULES.reward, 'Reward Count Supplied', 602, [], ValueType.TYPE_U64, 'Total rewards supplied.', []],
230
- [MODULES.reward, 'Guard Count', 603, [], ValueType.TYPE_U64, 'The number of claiming guards.', []],
231
- [MODULES.reward, 'Has Guard', 604, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether a claiming guard is set up?', ['address']],
232
- [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']],
233
- [MODULES.reward, 'Deadline', 606, [], ValueType.TYPE_U64, 'The expiration time of claiming.', []],
234
- [MODULES.reward, 'Has Claimed by An Address', 607, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether a certain address has claimed rewards?', ['address']],
235
- [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.', []],
236
- [MODULES.reward, 'Number of Addresses Claimed', 609, [], ValueType.TYPE_U64, 'Number of addresses that have claimed rewards.', []],
237
- [MODULES.reward, 'Is Sponsor', 620, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address is a sponsor of the reward pool?', ['address']],
238
- [MODULES.reward, 'Portions by A Sponsor', 611, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The portions of sponsorship reward pools for a certain address.', ['address']],
239
- [MODULES.reward, 'Number of Sponsors', 612, [], ValueType.TYPE_U64, 'Number of sponsors in the sponsorship reward pool.', []],
240
- [MODULES.reward, 'Allow Repeated Claims', 613, [], ValueType.TYPE_BOOL, 'Whether to allow repeated claims?', []],
241
- */
242
384
 
243
- [MODULES.machine, 'Permission', 700, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
244
- [MODULES.machine, 'Paused', 701, [], ValueType.TYPE_BOOL, 'Pause the creation of new Progress?', []],
245
- [MODULES.machine, 'Published', 702, [], ValueType.TYPE_BOOL, 'Is it allowed to create Progress?', []],
246
- [MODULES.machine, 'Is Consensus Repository', 703, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address is a consensus repository?', ['adddress']],
247
- [MODULES.machine, 'Has Endpoint', 704, [], ValueType.TYPE_BOOL, 'Is the endpoint set?', []],
248
- [MODULES.machine, 'Endpoint', 705, [], ValueType.TYPE_STRING, 'Endpoint url/ipfs.', []],
249
-
250
- [MODULES.progress, 'Machine', 800, [], ValueType.TYPE_ADDRESS, 'The Machine object that created this Progress.', []],
251
- [MODULES.progress, 'Current Node', 801, [], ValueType.TYPE_STRING, 'The name of the currently running node.', []],
252
- [MODULES.progress, 'Has Parent', 802, [], ValueType.TYPE_BOOL, 'Is the parent Progress defined?', []],
253
- [MODULES.progress, 'Parent', 803, [], ValueType.TYPE_ADDRESS, 'The parent Progress, that contains some child Progress.', []],
254
- [MODULES.progress, 'Has Task', 804, [], ValueType.TYPE_BOOL, 'Does it contain clear task(eg. an Order)?', []],
255
- [MODULES.progress, 'Task', 805, [], ValueType.TYPE_ADDRESS, 'Task object address.', []],
256
- [MODULES.progress, 'Has Unique Permission', 806, [ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Does Progress define a unique operation permission?', ['operator name']],
257
- [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']],
258
- [MODULES.progress, 'Has Context Repository', 808, [], ValueType.TYPE_BOOL, 'Whether the repository reference for Progress is set?', []],
259
- [MODULES.progress, 'Context Repository', 809, [], ValueType.TYPE_ADDRESS, 'Repository reference for Progress.', []],
260
- [MODULES.progress, 'Last Session Time', 810, [], ValueType.TYPE_U64, 'Time when the previous session was completed.', []],
261
- [MODULES.progress, 'Last Session Node', 811, [], ValueType.TYPE_STRING, 'The name of the last completed node.', []],
262
- [MODULES.progress, 'Current Session-id', 812, [], ValueType.TYPE_U64, 'The session id of ongoing node.', []],
263
- [MODULES.progress, 'Parent Session-id', 813, [], ValueType.TYPE_U64, 'The child process was started in the Session-id phase of the parent process.', []],
264
- [MODULES.progress, 'Parent Next Node', 814, [], ValueType.TYPE_STRING, 'The child process is started at the next node stage of the parent process.', []],
265
- [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.', []],
266
- [MODULES.progress, 'Parent Node', 816, [], ValueType.TYPE_STRING, 'The node name of the parent process where the child process is located.', []],
267
- [MODULES.progress, 'Forward Accomplished', 817, [ValueType.TYPE_U64, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Has the forward been accomplished?', ['session-id', 'next node name', 'forward name']],
268
- [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']],
269
- [MODULES.progress, 'Forward Message', 819, [ValueType.TYPE_U64, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_STRING, 'The forward message.', ['session-id', 'next node name', 'forward name']],
270
- [MODULES.progress, 'Forward Order Count', 820, [ValueType.TYPE_U64, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_U64, 'The forward Order count.', ['session-id', 'next node name', 'forward name']],
271
- [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']],
272
- [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']],
273
- [MODULES.progress, 'Closest Forward Accomplished', 823, [ValueType.TYPE_STRING, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Has the forward been accomplished?', ['node name', 'next node name', 'forward name']],
274
- [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']],
275
- [MODULES.progress, 'Closest Forward Message', 825, [ValueType.TYPE_STRING, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_STRING, 'The message of the forward that closest time to the current node.', ['node name', 'next node name', 'forward name']],
276
- [MODULES.progress, 'Closest Forward Order Count', 826, [ValueType.TYPE_STRING, ValueType.TYPE_STRING, ValueType.TYPE_STRING], ValueType.TYPE_U64, 'The Order count of the forward that closest time to the current node.', ['node name', 'next node name', 'forward name']],
277
- [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']],
278
-
279
- [MODULES.wowok, 'Builder', 900, [], ValueType.TYPE_ADDRESS, 'Builder address of Wowok.', []],
280
- [MODULES.wowok, 'Everyone Guard', 901, [], ValueType.TYPE_ADDRESS, 'A guard that all addresses can pass through.', []],
281
- [MODULES.wowok, 'Object of Entities', 902, [], ValueType.TYPE_ADDRESS, 'The address of entity information object.', []],
282
- [MODULES.wowok, 'Grantor Count', 903, [], ValueType.TYPE_U64, 'Number of registered grantors.', []],
283
- [MODULES.wowok, 'Has Grantor', 904, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address has been registered as a grantor?', ['address']],
284
- [MODULES.wowok, 'Grantor Name', 905, [ValueType.TYPE_ADDRESS], ValueType.TYPE_STRING, "Name of a grantor.", ['address']],
285
- [MODULES.wowok, 'Grantor Registration Time', 906, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'Registration time of a grantor.', ['address']],
286
- [MODULES.wowok, 'Grantor Expired Time', 907, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The expiration time of a grantor.', ['address']],
287
- [MODULES.wowok, 'Grantee Object for Grantor', 908, [ValueType.TYPE_ADDRESS], ValueType.TYPE_ADDRESS, 'Grantee repository address of a grantor.', ['address']],
288
- /* @Deprecated
289
- [MODULES.vote, 'Permission', 1101, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
290
- [MODULES.vote, 'Be Voting', 1102, [], ValueType.TYPE_BOOL, 'Whether to start voting and options will not be changed?', []],
291
- [MODULES.vote, 'Deadline Locked', 1103, [], ValueType.TYPE_BOOL, 'Whether the deadline cannot be modified?', []],
292
- [MODULES.vote, 'Vote-Guard Locked', 1104, [], ValueType.TYPE_BOOL, 'Whether the Guard for voting cannot be modified?', []],
293
- [MODULES.vote, 'Max Choice Count', 1105, [], ValueType.TYPE_U8, 'The maximum number of options that can be selected in one vote.', []],
294
- [MODULES.vote, 'Deadline', 1106, [], ValueType.TYPE_U64, 'Deadline for voting.', []],
295
- [MODULES.vote, 'Has Reference', 1107, [], ValueType.TYPE_BOOL, 'Whether to vote for a reference Object?', []],
296
- [MODULES.vote, 'Reference', 1108, [], ValueType.TYPE_ADDRESS, 'Reference Object that voting for.', []],
297
- [MODULES.vote, 'Has Vote-Guard', 1109, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is a certain Guard included in the Vote-Guard settings?', ['guard address']],
298
- [MODULES.vote, 'Vote-Guard Wight', 1110, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The voting weight corresponding to the Vote-Guard.', ['guard address']],
299
- [MODULES.vote, 'Has Voted by Address', 1111, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether an address has already voted?', ['address']],
300
- [MODULES.vote, 'Voted Weight by Address', 1112, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The weight of whether an address has been voted on.', ['adddress']],
301
- [MODULES.vote, 'Has Option', 1113, [ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Whether a voting option is included?', ['option content']],
302
- [MODULES.vote, 'Has Object of Option', 1114, [ValueType.TYPE_STRING], ValueType.TYPE_BOOL, 'Whether a voting option refers to an object?', ['option content']],
303
- [MODULES.vote, 'Option Object', 1115, [ValueType.TYPE_STRING], ValueType.TYPE_ADDRESS, 'The object referenced by a voting option.', ['option content']],
304
- [MODULES.vote, 'Option Counts', 1116, [ValueType.TYPE_STRING], ValueType.TYPE_U64, 'The number of votes for the voting option.', ['option content']],
305
- [MODULES.vote, 'Option Votes', 1117, [ValueType.TYPE_STRING], ValueType.TYPE_U64, 'The number of voted addresses for the voting option.', ['option content']],
306
- [MODULES.vote, 'Address Count Voted', 1118, [], ValueType.TYPE_U64, 'Total number of addresses voted.', []],
307
- [MODULES.vote, 'Top1 Option by Addresses', 1119, [], ValueType.TYPE_STRING, 'The content of the voting option ranked first by the number of voting addresses.', []],
308
- [MODULES.vote, 'Top1 Counts by Addresses', 1120, [], ValueType.TYPE_U64, 'Number of votes for the top voting option by number of voting addresses.', []],
309
- [MODULES.vote, 'Top1 Option by Votes', 1121, [], ValueType.TYPE_STRING, 'The content of the voting option ranked first by the number of votes.', []],
310
- [MODULES.vote, 'Top1 Counts by Votes', 1122, [], ValueType.TYPE_U64, 'Number of votes for the top voting option by number of votes.', []],
311
- [MODULES.vote, 'Voted Time by Address', 1113, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The time of whether an address has been voted on.', ['adddress']],
312
- */
313
- [MODULES.payment, 'Sender', 1200, [], ValueType.TYPE_ADDRESS, 'Payment originator address.', []],
314
- [MODULES.payment, 'Total Amount', 1201, [], ValueType.TYPE_U128, "Payment amount.", []],
315
- [MODULES.payment, 'Remark', 1202, [], ValueType.TYPE_STRING, 'Payment remark.', ['address']],
316
- [MODULES.payment, 'Has Guard for Perpose', 1203, [], ValueType.TYPE_BOOL, 'Whether the payment references a Guard?', []],
317
- [MODULES.payment, 'Has Object for Perpose', 1204, [], ValueType.TYPE_BOOL, 'Whether the payment references an Object?', []],
318
- [MODULES.payment, 'Guard for Perpose', 1205, [], ValueType.TYPE_ADDRESS, 'The Guard referenced by this payment.', []],
319
- [MODULES.payment, 'Object for Perpose', 1206, [], ValueType.TYPE_ADDRESS, "The Object referenced by this payment.", []],
320
- [MODULES.payment, 'Number of Recipients', 1207, [], ValueType.TYPE_U64, 'Number of recipients to receive payment from.', []],
321
- [MODULES.payment, 'Is a Recipient', 1208, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Is a recipient received the payment?', ['address']],
322
- [MODULES.payment, 'Amount for a Recipient', 1209, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The amount of payment received by an address.', ['address']],
323
- [MODULES.payment, 'Time', 1210, [], ValueType.TYPE_U64, 'Payment time', []],
324
- [MODULES.payment, 'Is from Treasury', 1211, [], ValueType.TYPE_BOOL, 'Whether the payment comes from a Treasury?', []],
325
- [MODULES.payment, 'Treasury Address', 1212, [], ValueType.TYPE_ADDRESS, 'The Treasury from which the payment comes.', []],
326
- [MODULES.payment, 'Biz-ID', 1213, [], ValueType.TYPE_U64, 'Bisiness ID number of the payment.', []],
327
-
328
- [MODULES.treasury, 'Permission', 1400, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
329
- [MODULES.treasury, 'Balance', 1401, [], ValueType.TYPE_U64, "Treasury balance.", []],
330
- [MODULES.treasury, 'Number of Flow Records', 1402, [], ValueType.TYPE_U64, 'Number of treasury transactions.', []],
331
- [MODULES.treasury, 'Inflow Amount', 1403, [], ValueType.TYPE_U128, 'Treasury inflow amount.', []],
332
- [MODULES.treasury, 'Outflow Amount', 1404, [], ValueType.TYPE_U128, 'Treasury outflow amount.', []],
333
- [MODULES.treasury, 'Has Deposit Guard', 1405, [], ValueType.TYPE_BOOL, 'Whether the deposit Guard set?', []],
334
- [MODULES.treasury, 'Deposit Guard', 1406, [], ValueType.TYPE_ADDRESS, 'Deposit Guard address.', []],
335
- [MODULES.treasury, 'Number of Withdraw Guards', 1407, [], ValueType.TYPE_U64, 'Number of withdraw guards.', []],
336
- [MODULES.treasury, 'Has Withdraw Guard', 1408, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Has a Withdraw Guard added?', ['guard address']],
337
- [MODULES.treasury, 'Withdrawal Amount with Guard', 1409, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'withdrawal amount corresponding the Guard.', ['guard address']],
338
- [MODULES.treasury, 'Recent Time with Operation', 1410, [ValueType.TYPE_U8], ValueType.TYPE_U64, 'Time of the most recent fund operation.', ['operation']],
339
- [MODULES.treasury, 'Recent Signer with Operation', 1411, [ValueType.TYPE_U8], ValueType.TYPE_ADDRESS, 'Signer address of the most recent fund operation.', ['operation']],
340
- [MODULES.treasury, 'Recent Payment with Operation', 1412, [ValueType.TYPE_U8], ValueType.TYPE_ADDRESS, 'Payment address of the most recent fund operation.', ['operation']],
341
- [MODULES.treasury, 'Recent Amount with Operation', 1413, [ValueType.TYPE_U8], ValueType.TYPE_U64, 'Amount of the most recent fund operation.', ['operation']],
342
- [MODULES.treasury, 'Recent Time with Op/Pmt', 1414, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'Time of the most recent fund operation with payment specified.', ['operation', 'payment address']],
343
- [MODULES.treasury, 'Recent Signer with Op&Pmt', 1415, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS], ValueType.TYPE_ADDRESS, 'Signer of the most recent fund operationwith payment specified.', ['operation', 'payment address']],
344
- [MODULES.treasury, 'Recent Amount with Op/Pmt', 1416, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'Amount of the most recent fund operation with payment specified.', ['operation', 'payment address']],
345
- [MODULES.treasury, 'Recent Time with Op/Sgr', 1417, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'Time of the most recent fund operation with signer specified.', ['operation', 'signer address']],
346
- [MODULES.treasury, 'Recent Payment with Op/Sgr', 1418, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS], ValueType.TYPE_ADDRESS, 'Payment of the most recent fund operation with singner specified.', ['operation', 'signer address']],
347
- [MODULES.treasury, 'Recent Amount with Op/Sgr', 1419, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'Amount of the most recent fund operation with singer specified.', ['operation', 'signer address']],
348
- [MODULES.treasury, 'Recent Time with Op/Pmt/Sgr', 1420, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS, ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'Time of the most recent fund operation.', ['operation', 'payment address', 'singer address']],
349
- [MODULES.treasury, 'Recent Amount with Op/Pmt/Sgr', 1421, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS, ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'Amount of the most recent fund operation.', ['operation', 'payment address', 'singer address']],
350
- [MODULES.treasury, 'Has Operation', 1422, [ValueType.TYPE_U8], ValueType.TYPE_BOOL, 'Whether there was a fund operation?', ['operation']],
351
- [MODULES.treasury, 'Has Operation with Pmt', 1423, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether there was a fund operation with payment specified?', ['operation', 'payment address']],
352
- [MODULES.treasury, 'Has Operation with Sgr', 1424, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether there was a fund operation with singer specified?', ['operation', 'singer address']],
353
- [MODULES.treasury, 'Has Operation with Pmt/Sgr', 1425, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS, ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Whether there was a fund operation?', ['operation', 'payment address', 'singer address']],
354
- [MODULES.treasury, 'Operation at Least Times', 1426, [ValueType.TYPE_U8, ValueType.TYPE_U8], ValueType.TYPE_BOOL, 'Does it operate at least a certain number of times?', ['operation', 'at least times']],
355
- [MODULES.treasury, 'Operation at Least Times by a Signer', 1427, [ValueType.TYPE_U8, ValueType.TYPE_ADDRESS, ValueType.TYPE_U8], ValueType.TYPE_BOOL, 'Does it operate at least a certain number of times by a signer?', ['operation', 'signer address', 'at least times']],
356
-
357
- [MODULES.arbitration, 'Permission', 1500, [], ValueType.TYPE_ADDRESS, 'Permission object address.', []],
358
- [MODULES.arbitration, 'Paused', 1501, [], ValueType.TYPE_BOOL, "Is it allowed to create Arb?", []],
359
- [MODULES.arbitration, 'Fee', 1502, [], ValueType.TYPE_U64, 'Cost of arbitration.', []],
360
- [MODULES.arbitration, 'Has Endpoint', 1503, [], ValueType.TYPE_BOOL, 'Is the endpoint set?', []],
361
- [MODULES.arbitration, 'Endpoint', 1504, [], ValueType.TYPE_STRING, 'Endpoint url/ipfs.', []],
362
- [MODULES.arbitration, 'Has Customer Guard', 1505, [], ValueType.TYPE_BOOL, 'Is there Guard set to apply for arbitration?', []],
363
- [MODULES.arbitration, 'Customer Guard', 1506, [], ValueType.TYPE_ADDRESS, 'Guard to apply for arbitration.', []],
364
- [MODULES.arbitration, 'Number of Voting Guard', 1507, [], ValueType.TYPE_U64, 'Number of voting guards.', []],
365
- [MODULES.arbitration, 'Has Voting Guard', 1508, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Has the voting Guard added?', ['guard address']],
366
- [MODULES.arbitration, 'Voting Weight', 1509, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'Voting weight of the voting Guard.', ['guard address']],
367
- [MODULES.arbitration, 'Treasury', 1510, [], ValueType.TYPE_ADDRESS, 'The address of the Treasury where fees was collected at the time of withdrawal.', []],
368
-
369
- [MODULES.arb, 'Order', 1600, [], ValueType.TYPE_ADDRESS, 'Order under arbitration.', []],
370
- [MODULES.arb, 'Arbitration', 1601, [], ValueType.TYPE_ADDRESS, "Arbitration object address.", []],
371
- [MODULES.arb, 'Feedback', 1602, [], ValueType.TYPE_STRING, 'Arbitration feedback.', []],
372
- [MODULES.arb, 'Has Compensation', 1603, [], ValueType.TYPE_BOOL, 'Whether there is an arbitration result?', []],
373
- [MODULES.arb, 'Compensation', 1604, [], ValueType.TYPE_U64, 'Compensation should be given to the order payer.', []],
374
- [MODULES.arb, 'Unclaimed Arbitration Costs', 1605, [], ValueType.TYPE_U64, 'Unclaimed arbitration costs.', []],
375
- [MODULES.arb, 'Turnout', 1606, [], ValueType.TYPE_U64, 'The number of addresses have voted.', []],
376
- [MODULES.arb, 'Has voted', 1607, [ValueType.TYPE_ADDRESS], ValueType.TYPE_BOOL, 'Has someone voted?', ['voter address']],
377
- [MODULES.arb, 'Voting weight', 1608, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The weight of a complete vote for the address.', ['voter address']],
378
- [MODULES.arb, 'Voting Time', 1609, [ValueType.TYPE_ADDRESS], ValueType.TYPE_U64, 'The time of a complete vote for the address.', ['voter address']],
379
- [MODULES.arb, 'Voting Option', 1610, [ValueType.TYPE_ADDRESS, ValueType.TYPE_U8], ValueType.TYPE_BOOL, 'Does an address complete voting for the option?', ['voter address', 'option index']],
380
- [MODULES.arb, 'Number of Options', 1611, [], ValueType.TYPE_U64, 'Number of voting options.', []],
381
- [MODULES.arb, 'Number of Votes', 1612, [ValueType.TYPE_U8], ValueType.TYPE_U64, 'The number of votes received for an option.', ['option index']],
382
- ];
383
-
384
- static BoolCmd = Guard.QUERIES.filter(q => q[4] === ValueType.TYPE_BOOL);
385
+ static BoolCmd = GUARD_QUERIES.filter(q => q[4] === ValueType.TYPE_BOOL);
385
386
  static IsBoolCmd = (cmd:number) : boolean => { return Guard.BoolCmd.includes((q:any) => {return q[2] == cmd}) }
386
387
 
387
- static CmdFilter = (retType:ValueType) => { return Guard.QUERIES.filter((q)=> q[4] === retType)}
388
+ static CmdFilter = (retType:ValueType) => { return GUARD_QUERIES.filter((q)=> q[4] === retType)}
388
389
  static GetCmd = (cmd:number | undefined) : any => {
389
- return Guard.QUERIES.find((q:any) => {return q[2] == cmd}) ;
390
+ return GUARD_QUERIES.find((q:any) => {return q[2] == cmd}) ;
390
391
  }
391
392
  static GetCmdOption = (cmd:number) : Guard_Options | undefined => {
392
393
  const r = Guard.GetCmd(cmd);
@@ -430,7 +431,7 @@ export class Guard {
430
431
  }
431
432
 
432
433
  static AllOptions = () : Guard_Options[] => {
433
- var r:Guard_Options[] = Guard.QUERIES.map((v)=>{return {from:'query', name:v[1], value:v[2], group:FirstLetterUppercase(v[0])}});
434
+ var r:Guard_Options[] = GUARD_QUERIES.map((v)=>{return {from:'query', name:v[1], value:v[2], group:FirstLetterUppercase(v[0])}});
434
435
  return [...r, ...Guard.Crunchings, ...Guard.Logics(), Guard.Signer, Guard.Time, Guard.Guard]
435
436
  }
436
437
 
@@ -444,7 +445,7 @@ export class Guard {
444
445
  return [...n1, ...Guard.Logics()];
445
446
  }
446
447
  static AddressOptions = () : Guard_Options[] => {
447
- 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])}});
448
+ 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])}});
448
449
  n1.push(Guard.Signer); n1.push(Guard.Guard);
449
450
  return [...n1]
450
451
  }
@@ -485,7 +486,7 @@ export class GuardMaker {
485
486
  return GuardMaker._const_index--
486
487
  }
487
488
  static IsValidIndentifier = (identifier:number) : boolean => {
488
- if (!IsValidU8(identifier) || identifier > 255) return false;
489
+ if (!IsValidU8(identifier) || identifier < 1) return false;
489
490
  return true
490
491
  }
491
492
  constructor() { }
@@ -573,7 +574,7 @@ export class GuardMaker {
573
574
 
574
575
  // object_address_from: string for static address; number as identifier inconstant
575
576
  add_query(module:MODULES, query_name:string, object_address_from:string | number) : GuardMaker {
576
- let query_index = Guard.QUERIES.findIndex((q) => {
577
+ let query_index = GUARD_QUERIES.findIndex((q) => {
577
578
  return q[0] == module && q[1] == query_name
578
579
  })
579
580
  if (query_index == -1) {
@@ -590,13 +591,13 @@ export class GuardMaker {
590
591
  }
591
592
  }
592
593
 
593
- let offset = this.type_validator.length - Guard.QUERIES[query_index][3].length;
594
+ let offset = this.type_validator.length - GUARD_QUERIES[query_index][3].length;
594
595
  if (offset < 0) {
595
596
  ERROR(Errors.InvalidParam, 'offset:'+query_name);
596
597
  }
597
598
 
598
599
  let types = this.type_validator.slice(offset);
599
- if (!array_equal(types, Guard.QUERIES[query_index][3])) { // type validate
600
+ if (!array_equal(types, GUARD_QUERIES[query_index][3])) { // type validate
600
601
  ERROR(Errors.Fail, 'array_equal:'+query_name);
601
602
  }
602
603
 
@@ -615,9 +616,9 @@ export class GuardMaker {
615
616
  }
616
617
  }
617
618
 
618
- this.data.push(Bcs.getInstance().ser('u16', Guard.QUERIES[query_index][2])); // cmd(u16)
619
- this.type_validator.splice(offset, Guard.QUERIES[query_index][3].length); // delete type stack
620
- this.type_validator.push(Guard.QUERIES[query_index][4]); // add the return value type to type stack
619
+ this.data.push(Bcs.getInstance().ser('u16', GUARD_QUERIES[query_index][2])); // cmd(u16)
620
+ this.type_validator.splice(offset, GUARD_QUERIES[query_index][3].length); // delete type stack
621
+ this.type_validator.push(GUARD_QUERIES[query_index][4]); // add the return value type to type stack
621
622
  return this;
622
623
  }
623
624
 
package/src/index.ts CHANGED
@@ -17,7 +17,7 @@ export * from './arbitration'
17
17
  export * from './exception'
18
18
  export { BCS, getSuiMoveConfig, } from '@mysten/bcs';
19
19
  export { Transaction as TransactionBlock, type TransactionArgument, type TransactionResult} from '@mysten/sui/transactions';
20
- export { SuiClient, type SuiObjectResponse, type SuiTransactionBlockResponseOptions, type DynamicFieldPage,
20
+ export { SuiClient, type SuiObjectResponse, type SuiTransactionBlockResponseOptions, type DynamicFieldPage, type CoinBalance, type CoinStruct,
21
21
  type SuiTransactionBlockResponse as CallResponse} from '@mysten/sui/client';
22
22
  export { Ed25519Keypair, } from '@mysten/sui/keypairs/ed25519';
23
23
  export { fromHEX, toHEX } from '@mysten/bcs';
package/src/protocol.ts CHANGED
@@ -160,9 +160,9 @@ export const IsNumberType = (type:ValueType | any) : boolean => { return type===
160
160
  }
161
161
 
162
162
  export enum ContextType {
163
- TYPE_SIGNER = 60,
164
- TYPE_CLOCK = 61,
165
- TYPE_GUARD = 62, // current guard address
163
+ TYPE_SIGNER = 60, // address type; the signer address on verifying
164
+ TYPE_CLOCK = 61, // u64 type; On-chain time at validation
165
+ TYPE_GUARD = 62, // address type; the address of the guard being verified
166
166
  //TYPE_STACK_ADDRESS = 63, // object queried from current stack top
167
167
  TYPE_CONSTANT = 80,
168
168
  }
package/src/resource.ts CHANGED
@@ -13,7 +13,7 @@ export interface ResourceData { // personal folder
13
13
  name: string; // folder name
14
14
  address: string[]; // objects in folder
15
15
  }
16
- export enum MarkName {
16
+ export enum GroupName {
17
17
  LikeName = "like",
18
18
  DislikeName = "dislike",
19
19
  FavorName = "favor",
@@ -48,6 +48,8 @@ export class Resource {
48
48
  });
49
49
  }
50
50
  add(name:string, object:string[] | TransactionResult[]) {
51
+ if (object.length === 0) return;
52
+
51
53
  var bString = true;
52
54
  if (!IsValidName(name)) ERROR(Errors.IsValidName, 'add.name');
53
55
  if (!IsValidArray(object, (item:any) => {
@@ -76,10 +78,11 @@ export class Resource {
76
78
  }
77
79
  }
78
80
 
79
- add2(object:TxbObject, name:string[]) {
80
- if (typeof(object) === 'string' && !IsValidAddress(object)) ERROR(Errors.IsValidAddress, 'add2');
81
- if (!IsValidArray(name, IsValidName)) ERROR(Errors.IsValidArray, 'add2');
82
- if (!name) return
81
+ add2(object:TransactionResult | string, name:string[]) {
82
+ if (name.length === 0) return;
83
+
84
+ if (typeof(object) === 'string' && !IsValidAddress(object)) ERROR(Errors.IsValidAddress, 'add2.object');
85
+ if (!IsValidArray(name, IsValidName)) ERROR(Errors.IsValidArray, 'add2.name');
83
86
 
84
87
  this.txb.moveCall({
85
88
  target:Protocol.Instance().resourceFn('add2') as FnCallType,
@@ -88,34 +91,47 @@ export class Resource {
88
91
  });
89
92
  }
90
93
 
91
- remove(name:string, object:string[], removeall?:boolean) {
92
- if (!IsValidName(name)) ERROR(Errors.IsValidName, 'Resource: remove');
94
+ remove(name:string, object:string[] | TransactionResult[], removeall?:boolean) {
93
95
  if (object.length===0 && !removeall) return;
96
+ if (!IsValidName(name)) ERROR(Errors.IsValidName, 'Resource: remove');
94
97
 
98
+ var bString = true;
99
+ if (!IsValidArray(object, (item:any) => {
100
+ if (typeof(item) === 'string') {
101
+ return IsValidAddress(item)
102
+ } else {
103
+ bString = false;
104
+ }
105
+ return true;
106
+ })) {
107
+ ERROR(Errors.IsValidArray, 'remove.object');
108
+ }
109
+
95
110
  if (removeall) {
96
111
  this.txb.moveCall({
97
112
  target:Protocol.Instance().resourceFn('remove_all') as FnCallType,
98
113
  arguments:[Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.string(name)]
99
114
  });
100
115
  } else if(object) {
101
- if (!IsValidArray(object, IsValidAddress)) ERROR(Errors.IsValidArray, 'Resource: remove');
102
-
103
116
  this.txb.moveCall({
104
117
  target:Protocol.Instance().resourceFn('remove') as FnCallType,
105
118
  arguments:[Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.string(name),
106
- this.txb.pure.vector('address', object)]
119
+ bString ? this.txb.pure.vector('address', object as string[]) : this.txb.makeMoveVec({elements:object as TransactionResult[], type:'address'})]
107
120
  });
108
121
  }
109
122
  }
110
123
 
111
- remove2(object:string, name:string[]) {
112
- if (!IsValidAddress(object)) ERROR(Errors.IsValidAddress, 'Resource: remove2');
124
+ remove2(object:TransactionResult | string, name:string[]) {
125
+ if (typeof(object) === 'string' && !IsValidAddress(object)) {
126
+ ERROR(Errors.IsValidAddress, 'Resource: remove2');
127
+ }
113
128
  if (!IsValidArray(name, IsValidName)) ERROR(Errors.InvalidParam, 'Resource: remove2');
114
129
  if (!name) return
115
130
 
116
131
  this.txb.moveCall({
117
132
  target:Protocol.Instance().resourceFn('remove2') as FnCallType,
118
- arguments:[Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.address(object),
133
+ arguments:[Protocol.TXB_OBJECT(this.txb, this.object),
134
+ typeof(object) === 'string' ? this.txb.pure.address(object) : object,
119
135
  this.txb.pure.vector('string', name)]
120
136
  });
121
137
  }
@@ -130,29 +146,39 @@ export class Resource {
130
146
  });
131
147
  }
132
148
 
133
- add_tags(object:string, nick:string, tags:string[]) {
134
- if (!IsValidAddress(object)) ERROR(Errors.IsValidAddress, 'add_tags');
135
- if (!nick || !tags) return;
136
- if (!IsValidName(nick)) ERROR(Errors.IsValidName, 'add_tags');
137
- if (!IsValidArray(tags, IsValidName)) ERROR(Errors.IsValidArray, 'add_tags');
138
- if (tags.length > Resource.MAX_TAGS) ERROR(Errors.InvalidParam, 'add_tags');
149
+ add_tags(object:TransactionResult | string, nick:string, tags:string[]) {
150
+ if (!nick && tags.length === 0) return;
151
+
152
+ if (typeof(object) === 'string' && !IsValidAddress(object)) {
153
+ ERROR(Errors.IsValidAddress, 'Resource: add_tags.object');
154
+ }
155
+
156
+ if (nick && !IsValidName(nick)) ERROR(Errors.IsValidName, 'Resource: add_tags.nick');
157
+ if (!IsValidArray(tags, IsValidName)) ERROR(Errors.IsValidArray, 'Resource: add_tags.tags');
158
+ if (tags.length > Resource.MAX_TAGS) {
159
+ tags = tags.slice(0, Resource.MAX_TAGS)
160
+ }
139
161
 
140
- const encode = new TextEncoder();
141
162
  this.txb.moveCall({
142
163
  target:Protocol.Instance().resourceFn('tags_add') as FnCallType,
143
- arguments:[Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.address(object),
164
+ arguments:[Protocol.TXB_OBJECT(this.txb, this.object),
165
+ typeof(object) === 'string' ? this.txb.pure.address(object) : object,
144
166
  this.txb.pure.string(nick),
145
167
  this.txb.pure.vector('string', tags)
146
168
  ]
147
169
  });
148
170
  }
149
171
 
150
- remove_tags(object:string) {
151
- if (!IsValidAddress(object)) ERROR(Errors.IsValidAddress, 'Resource: remove_tags');
172
+ remove_tags(object:TransactionResult | string) {
173
+ if (typeof(object) === 'string' && !IsValidAddress(object)) {
174
+ ERROR(Errors.IsValidAddress, 'Resource: remove_tags');
175
+ }
152
176
 
153
177
  this.txb.moveCall({
154
178
  target:Protocol.Instance().resourceFn('tags_remove') as FnCallType,
155
- arguments:[Protocol.TXB_OBJECT(this.txb, this.object), this.txb.pure.address(object)]
179
+ arguments:[Protocol.TXB_OBJECT(this.txb, this.object),
180
+ typeof(object) === 'string' ? this.txb.pure.address(object) : object,
181
+ ]
156
182
  });
157
183
  }
158
184
  }
package/src/utils.ts CHANGED
@@ -402,6 +402,13 @@ export const IsValidAddress = (addr:string | undefined) : boolean => {
402
402
  }
403
403
  return true
404
404
  }
405
+ export const IsValidCoinType = (coin_type:string | undefined) : boolean => {
406
+ if (!coin_type) {
407
+ return false;
408
+ }
409
+ return coin_type.startsWith('0x2::coin::Coin') || coin_type.startsWith('0x0000000000000000000000000000000000000000000000000000000000000002')
410
+ }
411
+
405
412
  export const IsValidBigint = (value:string | number | undefined | bigint, max:bigint=MAX_U256, min?:bigint) : boolean => {
406
413
  if (value === '' || value === undefined) return false;
407
414
  try {
@@ -622,7 +629,12 @@ export const query_object = (param:query_object_param) => {
622
629
  }
623
630
  }
624
631
 
625
- export const FirstLetterUppercase = (str:string|undefined|null) : string => {
632
+ export const FirstLetterUppercase = (str:string|undefined|null) : string => {
626
633
  if (!str) return '';
627
634
  return str.substring(0, 1).toUpperCase() + str.substring(1);
628
- }
635
+ }
636
+
637
+
638
+ export function hasDuplicates<T>(array: T[]): boolean {
639
+ return array.some((item, index) => array.findIndex(i => i === item) !== index);
640
+ }