@wowok/skills 1.0.6 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -30
- package/dist/cli.js +114 -19
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/skills.d.ts +46 -1
- package/dist/skills.d.ts.map +1 -1
- package/dist/skills.js +154 -16
- package/dist/skills.js.map +1 -1
- package/dist/types.d.ts +31 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -4
- package/scripts/install.js +5 -3
- package/wowok-arbitrator/SKILL.md +279 -0
- package/wowok-guard/SKILL.md +166 -139
- package/wowok-machine/SKILL.md +215 -280
- package/wowok-order/SKILL.md +290 -404
- package/wowok-provider/SKILL.md +453 -0
- package/wowok-safety/SKILL.md +176 -279
- package/wowok-tools/SKILL.md +329 -344
- package/schemas/onchain_operations/_common.md +0 -236
- package/schemas/onchain_operations/_index.md +0 -22
- package/schemas/onchain_operations/allocation.md +0 -50
- package/schemas/onchain_operations/arbitration.md +0 -95
- package/schemas/onchain_operations/contact.md +0 -36
- package/schemas/onchain_operations/demand.md +0 -52
- package/schemas/onchain_operations/gen_passport.md +0 -43
- package/schemas/onchain_operations/guard.md +0 -136
- package/schemas/onchain_operations/machine.md +0 -70
- package/schemas/onchain_operations/order.md +0 -57
- package/schemas/onchain_operations/payment.md +0 -32
- package/schemas/onchain_operations/permission.md +0 -57
- package/schemas/onchain_operations/personal.md +0 -59
- package/schemas/onchain_operations/progress.md +0 -35
- package/schemas/onchain_operations/repository.md +0 -81
- package/schemas/onchain_operations/reward.md +0 -40
- package/schemas/onchain_operations/service.md +0 -104
- package/schemas/onchain_operations/treasury.md +0 -74
- package/schemas/schema-account_operation.md +0 -402
- package/schemas/schema-guard2file.md +0 -153
- package/schemas/schema-local_info_operation.md +0 -160
- package/schemas/schema-local_mark_operation.md +0 -148
- package/schemas/schema-machineNode2file.md +0 -155
- package/schemas/schema-messenger_operation.md +0 -547
- package/schemas/schema-onchain_events.md +0 -201
- package/schemas/schema-onchain_table_data.md +0 -334
- package/schemas/schema-query_toolkit.md +0 -375
- package/schemas/schema-wip_file.md +0 -240
- package/schemas/schema-wowok_buildin_info.md +0 -296
- package/wowok-build/SKILL.md +0 -606
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
# onchain_operations / Common Types
|
|
2
|
-
|
|
3
|
-
Shared types referenced by all `onchain_operations` operation types.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Top-Level Structure
|
|
8
|
-
|
|
9
|
-
Most operations follow this standard wrapper:
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
OnchainOperations {
|
|
13
|
-
operation_type: string; // One of 16 types
|
|
14
|
-
data: object; // Type-specific data (required)
|
|
15
|
-
env?: CallEnv; // Optional environment
|
|
16
|
-
submission?: SubmissionCall; // Optional Guard submission data
|
|
17
|
-
}
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
### Exceptions
|
|
21
|
-
|
|
22
|
-
| Operation | Structure | Notes |
|
|
23
|
-
|-----------|-----------|-------|
|
|
24
|
-
| `gen_passport` | `{ guard, info?, env? }` | FLAT — no `data` wrapper, no `submission` |
|
|
25
|
-
| `guard` | `{ data, env? }` | No `submission` field |
|
|
26
|
-
| `payment` | `{ data, env? }` | No `submission` field |
|
|
27
|
-
| `personal` | `{ data, env? }` | No `submission` field |
|
|
28
|
-
|
|
29
|
-
## CallEnv
|
|
30
|
-
|
|
31
|
-
```typescript
|
|
32
|
-
CallEnv {
|
|
33
|
-
account?: string; // Operating account (empty = default)
|
|
34
|
-
permission_guard?: string[]; // Permission Guard ID list
|
|
35
|
-
no_cache?: boolean; // Disable cache
|
|
36
|
-
network?: "localnet" | "testnet"; // Target network
|
|
37
|
-
referrer?: string; // Referrer ID
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## SubmissionCall
|
|
42
|
-
|
|
43
|
-
```typescript
|
|
44
|
-
SubmissionCall {
|
|
45
|
-
type: "submission";
|
|
46
|
-
guard: {
|
|
47
|
-
object: string; // Guard object name or ID
|
|
48
|
-
impack: boolean; // Whether affects final outcome
|
|
49
|
-
}[];
|
|
50
|
-
submission: {
|
|
51
|
-
guard: string; // Guard object name or ID
|
|
52
|
-
submission: {
|
|
53
|
-
identifier: number; // 0-255
|
|
54
|
-
b_submission: boolean; // Whether user submission is required
|
|
55
|
-
value_type: ValueType; // Expected type
|
|
56
|
-
value?: SupportedValue; // User-provided value (optional)
|
|
57
|
-
name: string; // Name/description (default: "")
|
|
58
|
-
object_type?: ObjectType; // Object type when value is Address
|
|
59
|
-
}[];
|
|
60
|
-
}[];
|
|
61
|
-
}
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## Common Sub-Schemas
|
|
67
|
-
|
|
68
|
-
### TypedPermissionObject
|
|
69
|
-
|
|
70
|
-
```typescript
|
|
71
|
-
TypedPermissionObject =
|
|
72
|
-
| string // Object ID or name (existing)
|
|
73
|
-
| {
|
|
74
|
-
name?: string; // Name for new object
|
|
75
|
-
tags?: string[]; // Tags for discoverability
|
|
76
|
-
onChain?: boolean; // Register name on-chain
|
|
77
|
-
replaceExistName?: boolean; // Force claim existing name
|
|
78
|
-
type_parameter: string; // Token type parameter (default: "0x2::wow::WOW")
|
|
79
|
-
permission?: DescriptionObject; // Permission for the new object
|
|
80
|
-
};
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### WithPermissionObject
|
|
84
|
-
|
|
85
|
-
```typescript
|
|
86
|
-
WithPermissionObject =
|
|
87
|
-
| string // Existing object ID or name
|
|
88
|
-
| {
|
|
89
|
-
name?: string;
|
|
90
|
-
tags?: string[];
|
|
91
|
-
onChain?: boolean;
|
|
92
|
-
replaceExistName?: boolean;
|
|
93
|
-
permission?: DescriptionObject;
|
|
94
|
-
};
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### DescriptionObject
|
|
98
|
-
|
|
99
|
-
```typescript
|
|
100
|
-
DescriptionObject =
|
|
101
|
-
| string // Existing object ID or name
|
|
102
|
-
| {
|
|
103
|
-
name?: string;
|
|
104
|
-
tags?: string[];
|
|
105
|
-
onChain?: boolean;
|
|
106
|
-
replaceExistName?: boolean;
|
|
107
|
-
description?: string;
|
|
108
|
-
};
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
### NormalObject
|
|
112
|
-
|
|
113
|
-
```typescript
|
|
114
|
-
NormalObject =
|
|
115
|
-
| string // Existing object ID or name
|
|
116
|
-
| {
|
|
117
|
-
name?: string;
|
|
118
|
-
tags?: string[];
|
|
119
|
-
onChain?: boolean;
|
|
120
|
-
replaceExistName?: boolean;
|
|
121
|
-
};
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### NamedObject
|
|
125
|
-
|
|
126
|
-
```typescript
|
|
127
|
-
NamedObject {
|
|
128
|
-
name?: string;
|
|
129
|
-
tags?: string[];
|
|
130
|
-
onChain?: boolean;
|
|
131
|
-
replaceExistName?: boolean;
|
|
132
|
-
}
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
### CoinParam
|
|
136
|
-
|
|
137
|
-
```typescript
|
|
138
|
-
CoinParam =
|
|
139
|
-
| { balance: string | number } // Amount (can include unit like "10WOW")
|
|
140
|
-
| { coin: string }; // Specific coin object ID
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### ObjectsOp
|
|
144
|
-
|
|
145
|
-
```typescript
|
|
146
|
-
ObjectsOp = {
|
|
147
|
-
op: "add" | "set" | "remove";
|
|
148
|
-
objects: string[];
|
|
149
|
-
} | {
|
|
150
|
-
op: "clear";
|
|
151
|
-
};
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
### AccountOrMark_Address
|
|
155
|
-
|
|
156
|
-
```typescript
|
|
157
|
-
AccountOrMark_Address = {
|
|
158
|
-
name_or_address?: string;
|
|
159
|
-
local_mark_first?: boolean;
|
|
160
|
-
};
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
### ManyAccountOrMark_Address
|
|
164
|
-
|
|
165
|
-
```typescript
|
|
166
|
-
ManyAccountOrMark_Address = {
|
|
167
|
-
entities: AccountOrMark_Address[];
|
|
168
|
-
check_all_founded?: boolean;
|
|
169
|
-
};
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### ReceivedBalanceOrRecently
|
|
173
|
-
|
|
174
|
-
```typescript
|
|
175
|
-
ReceivedBalanceOrRecently =
|
|
176
|
-
| {
|
|
177
|
-
balance: string | number; // Balance amount
|
|
178
|
-
token_type: string; // Token type
|
|
179
|
-
received: { // Unwrapped coin objects
|
|
180
|
-
id: string; // CoinWrapper object ID
|
|
181
|
-
balance: string | number; // Amount
|
|
182
|
-
payment: string; // Info string, usually the payment object ID @any
|
|
183
|
-
}[];
|
|
184
|
-
}
|
|
185
|
-
| "recently"; // Shortcut: automatically unwrap most recently received CoinWrapper
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
### ReceivedObjectsOrRecently
|
|
189
|
-
|
|
190
|
-
```typescript
|
|
191
|
-
ReceivedObjectsOrRecently =
|
|
192
|
-
| {
|
|
193
|
-
id: string; // Object ID
|
|
194
|
-
type: string; // Object type
|
|
195
|
-
content_raw?: any; // Raw content (optional)
|
|
196
|
-
}[]
|
|
197
|
-
| ReceivedBalanceOrRecently; // Or: empty/clear then receive CoinWrapper objects
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
---
|
|
201
|
-
|
|
202
|
-
## Value Types
|
|
203
|
-
|
|
204
|
-
| Type | ID | Description |
|
|
205
|
-
|------|-----|-------------|
|
|
206
|
-
| Bool | 0 | Boolean true/false |
|
|
207
|
-
| Address | 1 | Object or account address |
|
|
208
|
-
| String | 2 | UTF-8 string |
|
|
209
|
-
| U8 | 3 | 8-bit unsigned integer |
|
|
210
|
-
| U16 | 4 | 16-bit unsigned integer |
|
|
211
|
-
| U32 | 5 | 32-bit unsigned integer |
|
|
212
|
-
| U64 | 6 | 64-bit unsigned integer |
|
|
213
|
-
| U128 | 7 | 128-bit unsigned integer |
|
|
214
|
-
| U256 | 8 | 256-bit unsigned integer |
|
|
215
|
-
| VecBool | 9 | Vector of booleans |
|
|
216
|
-
| VecAddress | 10 | Vector of addresses |
|
|
217
|
-
| VecString | 11 | Vector of strings |
|
|
218
|
-
| VecU8 | 12 | Vector of U8 |
|
|
219
|
-
| VecU16 | 13 | Vector of U16 |
|
|
220
|
-
| VecU32 | 14 | Vector of U32 |
|
|
221
|
-
| VecU64 | 15 | Vector of U64 |
|
|
222
|
-
| VecU128 | 16 | Vector of U128 |
|
|
223
|
-
| VecU256 | 17 | Vector of U256 |
|
|
224
|
-
| VecVecU8 | 18 | Vector of VecU8 |
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
### Recipient
|
|
229
|
-
Used by `service` (order allocators), `reward` (guard recipients), and `allocation` (who field).
|
|
230
|
-
|
|
231
|
-
```typescript
|
|
232
|
-
Recipient =
|
|
233
|
-
| { GuardIdentifier: number }
|
|
234
|
-
| { Entity: AccountOrMark_Address }
|
|
235
|
-
| { Signer: "signer" }
|
|
236
|
-
```
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# onchain_operations / Index
|
|
2
|
-
|
|
3
|
-
16 discriminated operation types. Each links to its schema file. Common types (CallEnv, SubmissionCall, Recipient, NamedObject, CoinParam, ValueTypes, etc.) are in [_common.md](./_common.md).
|
|
4
|
-
|
|
5
|
-
| operation_type | File | Description |
|
|
6
|
-
|---|---|---|
|
|
7
|
-
| `service` | [service.md](./service.md) | Create/manage product listings, pricing, discounts, bind workflows, customer purchases via order_new |
|
|
8
|
-
| `machine` | [machine.md](./machine.md) | Design/deploy workflow templates with node/forward structures |
|
|
9
|
-
| `progress` | [progress.md](./progress.md) | Track active workflows, advance through nodes |
|
|
10
|
-
| `repository` | [repository.md](./repository.md) | Consensus database with typed policies and data read/write |
|
|
11
|
-
| `arbitration` | [arbitration.md](./arbitration.md) | Transparent on-chain arbitration, dispute/vote/resolve lifecycle |
|
|
12
|
-
| `contact` | [contact.md](./contact.md) | On-chain IM contact profiles |
|
|
13
|
-
| `treasury` | [treasury.md](./treasury.md) | Team fund management with deposit/withdraw Guard rules |
|
|
14
|
-
| `reward` | [reward.md](./reward.md) | Reward pools with Guard-verified claiming |
|
|
15
|
-
| `allocation` | [allocation.md](./allocation.md) | Auto-distribution plans to multiple recipients |
|
|
16
|
-
| `permission` | [permission.md](./permission.md) | Access control indices for object operations |
|
|
17
|
-
| `guard` | [guard.md](./guard.md) | Programmable boolean validation rules (recursive GuardNode tree) |
|
|
18
|
-
| `personal` | [personal.md](./personal.md) | PUBLIC on-chain identity — everything permanently visible |
|
|
19
|
-
| `payment` | [payment.md](./payment.md) | Irreversible coin transfers to wallets |
|
|
20
|
-
| `demand` | [demand.md](./demand.md) | Service request postings with reward pools |
|
|
21
|
-
| `order` | [order.md](./order.md) | Order lifecycle: progress, arbitration, refunds, ownership |
|
|
22
|
-
| `gen_passport` | [gen_passport.md](./gen_passport.md) | Immutable verified credentials after Guard validation |
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# onchain_operations / allocation
|
|
2
|
-
|
|
3
|
-
Create distribution plans to auto-distribute funds to multiple recipients.
|
|
4
|
-
|
|
5
|
-
## Data Schema
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
// Allocation has TWO modes — discriminated by object format
|
|
9
|
-
|
|
10
|
-
// MODE 1: Create a new Allocation with allocators
|
|
11
|
-
CallAllocation_Create {
|
|
12
|
-
object: {
|
|
13
|
-
name?: string; // Object name
|
|
14
|
-
tags?: string[]; // Tags
|
|
15
|
-
onChain?: boolean; // Public on-chain name
|
|
16
|
-
replaceExistName?: boolean; // Force claim name
|
|
17
|
-
type_parameter?: string; // Token type (default: "0x2::wow::WOW")
|
|
18
|
-
};
|
|
19
|
-
allocators: {
|
|
20
|
-
description: string; // Allocator list description
|
|
21
|
-
threshold: number; // Trigger threshold
|
|
22
|
-
allocators: {
|
|
23
|
-
guard: string; // Guard object ID — allocation triggers on verify
|
|
24
|
-
sharing: {
|
|
25
|
-
who: Recipient; // Recipient specification
|
|
26
|
-
sharing: number; // Amount or rate
|
|
27
|
-
mode: "Amount" | "Rate" | "Surplus";
|
|
28
|
-
}[];
|
|
29
|
-
fix?: number; // Fixed amount per recipient
|
|
30
|
-
max?: number | null; // Maximum allocation amount
|
|
31
|
-
}[];
|
|
32
|
-
};
|
|
33
|
-
coin: CoinParam; // Initial funding
|
|
34
|
-
payment_info: {
|
|
35
|
-
remark?: string;
|
|
36
|
-
index?: number;
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// MODE 2: Operate existing Allocation
|
|
41
|
-
CallAllocation_Operate {
|
|
42
|
-
object: string; // Allocation object ID or name (required)
|
|
43
|
-
received_coins?: ReceivedBalanceOrRecently; // Unwrap CoinWrapper
|
|
44
|
-
alloc_by_guard?: string; // Verify Guard and trigger allocation
|
|
45
|
-
}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, CoinParam, Recipient, ReceivedBalanceOrRecently.
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
# onchain_operations / arbitration
|
|
2
|
-
|
|
3
|
-
Access a transparent on-chain arbitration system for resolving order conflicts.
|
|
4
|
-
|
|
5
|
-
## Data Schema
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
CallArbitration_Data {
|
|
9
|
-
// Object reference - string (existing) or object (create new)
|
|
10
|
-
object: TypedPermissionObject;
|
|
11
|
-
|
|
12
|
-
// Create new Arb for order
|
|
13
|
-
dispute?: {
|
|
14
|
-
order: string; // Order ID
|
|
15
|
-
description?: string;
|
|
16
|
-
proposition: string[]; // Dispute propositions
|
|
17
|
-
fee: CoinParam; // Arbitration fee
|
|
18
|
-
namedArb?: NamedObject; // Name for new Arb
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
description?: string; // Institution description
|
|
22
|
-
location?: string; // Arbitration location
|
|
23
|
-
fee?: number; // Arbitration fee
|
|
24
|
-
pause?: boolean; // Pause arbitration
|
|
25
|
-
|
|
26
|
-
// Confirm user's materials
|
|
27
|
-
confirm?: {
|
|
28
|
-
arb: string; // Arb object ID
|
|
29
|
-
voting_deadline: number | null;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
// Modify voting deadline
|
|
33
|
-
voting_deadline_change?: {
|
|
34
|
-
arb: string;
|
|
35
|
-
voting_deadline: number | null;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
// Vote on propositions
|
|
39
|
-
vote?: {
|
|
40
|
-
arb: string;
|
|
41
|
-
votes: number[]; // Supported proposition indices
|
|
42
|
-
voting_guard?: string; // Guard for voting
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// Arbitration feedback
|
|
46
|
-
feedback?: {
|
|
47
|
-
arb: string;
|
|
48
|
-
feedback: string;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
// Final arbitration result
|
|
52
|
-
arbitration?: {
|
|
53
|
-
arb: string;
|
|
54
|
-
feedback: string;
|
|
55
|
-
indemnity: number; // Compensation amount
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
// Request resubmission
|
|
59
|
-
reset?: {
|
|
60
|
-
arb: string;
|
|
61
|
-
feedback: string;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
// Withdraw arbitration fee
|
|
65
|
-
arb_withdraw?: {
|
|
66
|
-
arb: string;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
// Distribute fees
|
|
70
|
-
fees_transfer?: {
|
|
71
|
-
to: { allocation: string } | { treasury: string };
|
|
72
|
-
payment_remark: string;
|
|
73
|
-
payment_index: number;
|
|
74
|
-
newPayment?: NamedObject;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
usage_guard?: string | null; // Guard for applying
|
|
78
|
-
|
|
79
|
-
// Guard for voting
|
|
80
|
-
voting_guard?: {
|
|
81
|
-
op: "add" | "set" | "remove" | "clear";
|
|
82
|
-
guards?: {
|
|
83
|
-
guard: string;
|
|
84
|
-
service_identifier?: number;
|
|
85
|
-
}[];
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
owner_receive?: ReceivedObjectsOrRecently;
|
|
89
|
-
um?: string | null; // Contact object
|
|
90
|
-
}
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
---
|
|
94
|
-
|
|
95
|
-
See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, TypedPermissionObject, CoinParam, NamedObject, ReceivedObjectsOrRecently.
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# onchain_operations / contact
|
|
2
|
-
|
|
3
|
-
Manage on-chain instant messaging contact profiles.
|
|
4
|
-
|
|
5
|
-
## Data Schema
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
CallContact_Data {
|
|
9
|
-
// Object reference - string (existing) or object (create new)
|
|
10
|
-
object: WithPermissionObject;
|
|
11
|
-
|
|
12
|
-
my_status?: string; // Status message
|
|
13
|
-
description?: string; // Contact description
|
|
14
|
-
location?: string; // Location
|
|
15
|
-
|
|
16
|
-
// IM contact list (discriminated union)
|
|
17
|
-
ims?: {
|
|
18
|
-
op: "add" | "set";
|
|
19
|
-
im: { // Contact entries
|
|
20
|
-
at: string; // IM address
|
|
21
|
-
description?: string; // Optional note
|
|
22
|
-
}[];
|
|
23
|
-
} | {
|
|
24
|
-
op: "remove";
|
|
25
|
-
im: string[]; // Addresses/names to remove
|
|
26
|
-
} | {
|
|
27
|
-
op: "clear";
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
owner_receive?: ReceivedObjectsOrRecently;
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
See [_common.md](./_common.md) for shared types: CallEnv, WithPermissionObject, ReceivedObjectsOrRecently.
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# onchain_operations / demand
|
|
2
|
-
|
|
3
|
-
Post service requests with reward pools on-chain.
|
|
4
|
-
|
|
5
|
-
## Data Schema
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
CallDemand_Data {
|
|
9
|
-
// Object reference - string (existing) or object (create new)
|
|
10
|
-
object: WithPermissionObject;
|
|
11
|
-
|
|
12
|
-
// Recommend Service to Demand
|
|
13
|
-
present?: {
|
|
14
|
-
recommend: string; // Recommendation text
|
|
15
|
-
by_guard?: string; // Guard to verify through
|
|
16
|
-
service?: string; // Service ID or name
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
description?: string; // Demand description
|
|
20
|
-
location?: string; // Demand location
|
|
21
|
-
|
|
22
|
-
rewards?: ObjectsOp; // Reward operations
|
|
23
|
-
|
|
24
|
-
// Service Guard list (discriminated union)
|
|
25
|
-
guards?: {
|
|
26
|
-
op: "add" | "set";
|
|
27
|
-
guard: {
|
|
28
|
-
guard: string; // Guard object ID
|
|
29
|
-
service_identifier?: number | null; // Service identifier in Guard
|
|
30
|
-
}[];
|
|
31
|
-
} | {
|
|
32
|
-
op: "remove";
|
|
33
|
-
guard: string[]; // Guard IDs/names to remove
|
|
34
|
-
} | {
|
|
35
|
-
op: "clear";
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
// Feedback on presenters (array — multiple feedback entries)
|
|
39
|
-
feedback?: {
|
|
40
|
-
who: AccountOrMark_Address; // Presenter's account
|
|
41
|
-
acceptance_score?: number; // 0-255 acceptance score
|
|
42
|
-
feedback?: string; // Feedback content
|
|
43
|
-
}[];
|
|
44
|
-
|
|
45
|
-
owner_receive?: ReceivedObjectsOrRecently;
|
|
46
|
-
um?: string | null; // Contact object
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, WithPermissionObject, ObjectsOp, AccountOrMark_Address, ReceivedObjectsOrRecently.
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# onchain_operations / gen_passport
|
|
2
|
-
|
|
3
|
-
Create immutable verified credentials after Guard validation passes.
|
|
4
|
-
|
|
5
|
-
> **IMPORTANT**: Unlike other onchain operations, `gen_passport` uses a FLAT input structure — fields `guard`, `info`, `env` are directly at the top level, NOT nested under a `data` wrapper.
|
|
6
|
-
|
|
7
|
-
## Input Schema
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
CallGenPassport_Input {
|
|
11
|
-
guard: string | string[]; // Guard object ID(s) to verify. Can be a single guard or an array of guards.
|
|
12
|
-
info?: SubmissionCall; // Optional submission data
|
|
13
|
-
env?: CallEnv; // Optional environment configuration
|
|
14
|
-
}
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Features
|
|
18
|
-
|
|
19
|
-
- **Single Guard**: Pass a single guard ID or name as a string
|
|
20
|
-
- **Multiple Guards**: Pass an array of guard IDs or names to verify multiple guards at once
|
|
21
|
-
- **Name Resolution**: Supports both guard addresses and LocalMark names
|
|
22
|
-
|
|
23
|
-
## Examples
|
|
24
|
-
|
|
25
|
-
### Single Guard
|
|
26
|
-
```typescript
|
|
27
|
-
{
|
|
28
|
-
guard: "my-guard-name", // or "0x1234567890abcdef..."
|
|
29
|
-
env: { network: "testnet" }
|
|
30
|
-
}
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### Multiple Guards
|
|
34
|
-
```typescript
|
|
35
|
-
{
|
|
36
|
-
guard: ["guard-1", "guard-2", "0x1234567890abcdef..."],
|
|
37
|
-
env: { network: "testnet" }
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall.
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
# onchain_operations / guard
|
|
2
|
-
|
|
3
|
-
Create immutable programmable validation rules that return boolean results.
|
|
4
|
-
|
|
5
|
-
## Data Schema
|
|
6
|
-
|
|
7
|
-
```typescript
|
|
8
|
-
CallGuard_Data {
|
|
9
|
-
namedNew?: NamedObject; // Name for new Guard
|
|
10
|
-
description?: string; // Guard description
|
|
11
|
-
|
|
12
|
-
// Data table definitions
|
|
13
|
-
table?: {
|
|
14
|
-
identifier: number; // 0-255
|
|
15
|
-
b_submission: boolean; // User submission required
|
|
16
|
-
value_type: ValueType; // Expected type
|
|
17
|
-
value?: SupportedValue; // Default value (if b_submission=false)
|
|
18
|
-
name?: string; // Description
|
|
19
|
-
}[];
|
|
20
|
-
|
|
21
|
-
// Rule tree root (required)
|
|
22
|
-
root: {
|
|
23
|
-
type: "node";
|
|
24
|
-
node: GuardNode; // Direct node tree
|
|
25
|
-
} | {
|
|
26
|
-
type: "file";
|
|
27
|
-
file_path: string; // Load from file
|
|
28
|
-
format?: "json" | "markdown";
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
// Dependent Guards
|
|
32
|
-
rely?: {
|
|
33
|
-
guards: string[];
|
|
34
|
-
logic_or?: boolean; // OR vs AND logic
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// GuardNode (recursive structure)
|
|
39
|
-
//
|
|
40
|
-
// The GuardNode is a recursive, strongly-typed computational tree.
|
|
41
|
-
// Each node has a `type` field that discriminates its behavior.
|
|
42
|
-
// Below are the major categories:
|
|
43
|
-
//
|
|
44
|
-
// Logic & Comparison:
|
|
45
|
-
// logic_and (nodes[], 2-8) → Bool: ALL must be true
|
|
46
|
-
// logic_or (nodes[], 2-8) → Bool: ANY must be true
|
|
47
|
-
// logic_not (node, 1) → Bool: Inverts boolean
|
|
48
|
-
// logic_equal (nodes[], 2-8) → Bool: Type+value equality
|
|
49
|
-
// logic_string_contains (nodes[], 2-8) → Bool: Substring (case-sensitive)
|
|
50
|
-
// logic_string_nocase_contains (nodes[], 2-8) → Bool: Substring (case-insensitive)
|
|
51
|
-
// logic_string_nocase_equal (nodes[], 2-8) → Bool: String equality (ci)
|
|
52
|
-
// logic_as_u256_equal (nodes[], 2-8) → Bool: Numeric equality
|
|
53
|
-
// logic_as_u256_greater (nodes[], 2-8) → Bool: First > all others
|
|
54
|
-
// logic_as_u256_lesser (nodes[], 2-8) → Bool: First < all others
|
|
55
|
-
// logic_as_u256_greater_or_equal (nodes[], 2-8) → Bool: First >= all others
|
|
56
|
-
// logic_as_u256_lesser_or_equal (nodes[], 2-8) → Bool: First <= all others
|
|
57
|
-
//
|
|
58
|
-
// Arithmetic (calc_*):
|
|
59
|
-
// calc_number_add (nodes[], 2-8) → U256: Sequential addition
|
|
60
|
-
// calc_number_subtract (nodes[], 2-8) → U256: Sequential subtraction
|
|
61
|
-
// calc_number_multiply (nodes[], 2-8) → U256: Sequential multiplication
|
|
62
|
-
// calc_number_divide (nodes[], 2-8) → U256: Sequential division
|
|
63
|
-
// calc_number_mod (nodes[], 2-8) → U256: Sequential modulo
|
|
64
|
-
// calc_string_length (node, 1) → U64: UTF-8 byte length
|
|
65
|
-
// calc_string_contains (nodes[], 2-8) → Bool: cs substring check
|
|
66
|
-
// calc_string_nocase_contains (nodes[], 2-8) → Bool: ci substring check
|
|
67
|
-
// calc_string_nocase_equal (nodes[], 2-8) → Bool: ci string equality
|
|
68
|
-
// calc_string_indexof (left+right+order) → U64: Find substring index
|
|
69
|
-
// calc_string_nocase_indexof (left+right+order) → U64: Find substring index (ci)
|
|
70
|
-
//
|
|
71
|
-
// Type Conversion (convert_*):
|
|
72
|
-
// convert_number_address (node, 1) → Address: Number → Address
|
|
73
|
-
// convert_address_number (node, 1) → U256: Address → Number
|
|
74
|
-
// convert_number_string (node, 1) → String: Number → String
|
|
75
|
-
// convert_string_number (node, 1) → U256: Parse string as number
|
|
76
|
-
// convert_safe_u8..convert_safe_u256 (node, 1) → U8..U256: Safe numeric cast
|
|
77
|
-
//
|
|
78
|
-
// Vector Operations (vec_*):
|
|
79
|
-
// vec_length (node, 1) → U64: Element count
|
|
80
|
-
// vec_contains_bool (nodes[], 2-8) → Bool: All values present
|
|
81
|
-
// vec_contains_address (nodes[], 2-8) → Bool: Address containment
|
|
82
|
-
// vec_contains_string (nodes[], 2-8) → Bool: String containment (cs)
|
|
83
|
-
// vec_contains_string_nocase (nodes[], 2-8) → Bool: String containment (ci)
|
|
84
|
-
// vec_contains_number (nodes[], 2-8) → Bool: Number containment
|
|
85
|
-
// vec_indexof_* (left+right+order) → U64: Find index in vector
|
|
86
|
-
//
|
|
87
|
-
// WoWok Object Query:
|
|
88
|
-
// query (query + object + parameters) → varies: Query on-chain data
|
|
89
|
-
// identifier (identifier 0-255) → varies: Read from Guard table
|
|
90
|
-
// value_type (node, 1) → U8: Get ValueType of child result
|
|
91
|
-
//
|
|
92
|
-
// Record Check Operations (record_*):
|
|
93
|
-
// record_check_recipient_order (...) → Bool: Order count by recipient
|
|
94
|
-
// record_check_recipient_progress (...) → Bool: Progress count by recipient
|
|
95
|
-
// record_check_recipient_reward (...) → Bool: Reward count by recipient
|
|
96
|
-
// record_check_treasury_history_item (...) → Bool: Treasury history
|
|
97
|
-
// record_check_progress_history_item (...) → Bool: Progress history
|
|
98
|
-
//
|
|
99
|
-
// For the complete canonical list of all 70+ types, see
|
|
100
|
-
// the MCP source at `src/schema/query/index.ts` `GuardNodeSchema`.
|
|
101
|
-
GuardNode = {
|
|
102
|
-
// Multi-operand nodes (2-8 children)
|
|
103
|
-
logic?: "and" | "or";
|
|
104
|
-
nodes: GuardNode[];
|
|
105
|
-
} | {
|
|
106
|
-
// Single-operand nodes
|
|
107
|
-
logic?: "not";
|
|
108
|
-
node: GuardNode;
|
|
109
|
-
} | {
|
|
110
|
-
// Query nodes
|
|
111
|
-
type: "query";
|
|
112
|
-
query: number | string;
|
|
113
|
-
object: {
|
|
114
|
-
identifier: number;
|
|
115
|
-
convert_witness?: number;
|
|
116
|
-
};
|
|
117
|
-
parameters: GuardNode[];
|
|
118
|
-
} | {
|
|
119
|
-
// Context nodes
|
|
120
|
-
type: "context";
|
|
121
|
-
context: "Signer" | "Clock" | "Guard";
|
|
122
|
-
} | {
|
|
123
|
-
// Identifier nodes
|
|
124
|
-
type: "identifier";
|
|
125
|
-
identifier: number;
|
|
126
|
-
} | {
|
|
127
|
-
// Constant value nodes
|
|
128
|
-
type: "constant";
|
|
129
|
-
value_type: ValueType;
|
|
130
|
-
value: SupportedValue;
|
|
131
|
-
}
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, NamedObject.
|