@wowok/skills 1.0.6 → 1.1.0

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.
@@ -1,81 +1,70 @@
1
1
  # onchain_operations / repository
2
2
 
3
- Read/write database with consensus field + address as key, strongly-typed data as value.
3
+ Define trusted data sources with typed policies, data read/write rules, and contribution incentives.
4
+
5
+ > **CREATE vs MODIFY**: See [_common.md](./_common.md) for the unified pattern.
6
+ > Repository uses `WithPermissionObject`: object shape = CREATE, string = MODIFY.
4
7
 
5
8
  ## Data Schema
6
9
 
7
10
  ```typescript
8
11
  CallRepository_Data {
9
12
  // Object reference - string (existing) or object (create new)
13
+ // See _common.md: WithPermissionObject
10
14
  object: WithPermissionObject;
11
15
 
12
- description?: string; // Repository description
16
+ description?: string; // Repository description (max 4000 bcs chars)
13
17
 
14
- // Policy rules (discriminated by op)
18
+ // Policy rules (discriminated union)
15
19
  policies?: {
16
20
  op: "add" | "set";
17
- policy: PolicyRule[];
21
+ policy: PolicyRule[]; // Policy rule list
18
22
  } | {
19
23
  op: "remove";
20
- policy: string[]; // Policy names to remove
24
+ policy: string[]; // Policy rule names to remove
21
25
  } | {
22
26
  op: "clear";
23
27
  };
24
28
 
25
- // Add data (discriminated union)
26
- data_add?: {
27
- name: string;
28
- write_guard?: string;
29
- data: SupportedValue;
30
- } | {
31
- name: string;
32
- items: {
33
- data: {
34
- id: string | number;
35
- data: SupportedValue;
36
- }[];
37
- write_guard?: string;
38
- }[];
39
- };
29
+ // Add data
30
+ data_add?:
31
+ | {
32
+ name: string; // Data item name (must match PolicyRule)
33
+ write_guard?: NameOrAddress; // Guard for write permissions
34
+ data: SupportedValue; // Data value (ID = timestamp or signer)
35
+ }
36
+ | {
37
+ name: string; // Data item name
38
+ items: {
39
+ data: {
40
+ id: AccountOrMark_Address | number; // Data item ID
41
+ data: SupportedValue; // Data value
42
+ }[];
43
+ write_guard?: NameOrAddress; // Guard for write permissions
44
+ }[];
45
+ };
40
46
 
41
- // Remove data (discriminated union)
42
- data_remove?: {
43
- name: string;
44
- write_guard?: string;
45
- } | {
46
- name: string;
47
- items: {
48
- id: (string | number)[];
49
- write_guard?: string;
50
- }[];
51
- };
47
+ // Remove data
48
+ data_remove?:
49
+ | {
50
+ name: string; // Data item name
51
+ write_guard?: NameOrAddress; // Guard for verifying deletion permission
52
+ }
53
+ | {
54
+ name: string;
55
+ items: {
56
+ id: (AccountOrMark_Address | number)[]; // Data item IDs
57
+ write_guard?: NameOrAddress; // Guard for verifying deletion permission
58
+ }[];
59
+ };
52
60
 
53
- rewards?: ObjectsOp; // Reward operations
61
+ rewards?: ObjectsOp; // Reward object list (contribution incentives)
54
62
  owner_receive?: ReceivedObjectsOrRecently;
55
- um?: string | null; // Contact object
56
- }
57
- ```
58
-
59
- ### PolicyRule
60
-
61
- ```typescript
62
- PolicyWriteGuard {
63
- guard: string; // Guard object ID
64
- id_from_submission?: number; // Guard table index for data ID (omit = user specifies)
65
- data_from_submission?: number; // Guard table index for data value (omit = user specifies)
66
- }
67
-
68
- PolicyRule {
69
- name: string; // Policy rule name
70
- description: string; // Policy rule description
71
- write_guard: PolicyWriteGuard[]; // Guard list for write verification
72
- quote_guard?: string | null; // Guard for on-chain quote verification (null = no verification required)
73
- id_from: 0 | 1 | 2 | "None" | "Clock" | "Signer" | "none" | "clock" | "signer";
74
- // Data ID source: 0/None = user-specified, 1/Clock = timestamp, 2/Signer = signer ID
75
- value_type: ValueType; // Type of data value
63
+ um?: NameOrAddress | null; // Contact object
76
64
  }
77
65
  ```
78
66
 
79
67
  ---
80
68
 
81
- See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, WithPermissionObject, ValueType, ObjectsOp, ReceivedObjectsOrRecently.
69
+ See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, WithPermissionObject, ObjectsOp, ReceivedObjectsOrRecently.
70
+ `PolicyRule` schema is defined in the MCP source at `src/schema/query/index.ts`.
@@ -1,40 +1,38 @@
1
1
  # onchain_operations / reward
2
2
 
3
- Create reward pools and set claim conditions by Guard verification.
3
+ Create and manage token rewards with Guards and distribution rules.
4
+
5
+ > **CREATE vs MODIFY**: See [_common.md](./_common.md) for the unified pattern.
6
+ > Reward uses `TypedPermissionObject`: object shape = CREATE, string = MODIFY.
4
7
 
5
8
  ## Data Schema
6
9
 
7
10
  ```typescript
8
11
  CallReward_Data {
9
12
  // Object reference - string (existing) or object (create new)
13
+ // See _common.md: TypedPermissionObject
10
14
  object: TypedPermissionObject;
11
15
 
12
- claim?: string; // Guard object ID for claiming
13
- description?: string; // Reward description
14
- coin_add?: CoinParam; // Add funds
15
- receive?: ReceivedBalanceOrRecently; // Unwrap CoinWrapper
16
-
17
- // Add reward Guards (each specifies a claim condition)
18
- guard_add?: {
19
- guard: string; // Guard object ID to verify
20
- recipient: Recipient; // Who receives reward
21
- amount: { // Amount (discriminated union)
22
- type: "GuardU64Identifier";
23
- value: number; // Identifier 0-255 in Guard table
24
- } | {
25
- type: "Fixed";
26
- value: number; // Fixed amount
27
- };
28
- expiration_time?: number; // Expiration timestamp (ms)
29
- store_from_id?: number | null; // Guard table storage identifier
30
- }[];
31
-
32
- guard_remove_expired?: boolean; // Remove expired Guards
33
- guard_expiration_time?: number | null; // Lock adding new Guards until this time (ms)
16
+ claim?: NameOrAddress; // Guard object ID verify Guard to trigger reward distribution
17
+
18
+ description?: string; // Reward description (max 4000 bcs chars)
19
+
20
+ coin_add?: CoinParam; // Add amount to Reward object
21
+
22
+ // Unwrap received CoinWrappers and store in pending balance
23
+ receive?: ReceivedBalanceOrRecently;
24
+
25
+ guard_add?: RewardGuard[]; // Add Guard to Reward object
26
+
27
+ guard_remove_expired?: boolean; // Whether to remove expired Guards
28
+
29
+ guard_expiration_time?: number | null; // Expiration time (ms, >= 1) — blocks new Guard additions until expired
30
+
34
31
  owner_receive?: ReceivedObjectsOrRecently;
35
- um?: string | null; // Contact object
32
+ um?: NameOrAddress | null; // Contact object
36
33
  }
34
+ ```
37
35
 
38
36
  ---
39
37
 
40
- See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, TypedPermissionObject, CoinParam, ReceivedBalanceOrRecently, ReceivedObjectsOrRecently, Recipient.
38
+ See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, TypedPermissionObject, CoinParam, RewardGuard, ReceivedBalanceOrRecently, ReceivedObjectsOrRecently.
@@ -2,103 +2,77 @@
2
2
 
3
3
  Create and manage product/service listings with transparent promises, bind workflow templates, set pricing, issue discount coupons.
4
4
 
5
+ > **CREATE vs MODIFY**: See [_common.md](./_common.md) for the unified pattern.
6
+ > Service uses `TypedPermissionObject`: object shape = CREATE, string = MODIFY.
7
+
5
8
  ## Data Schema
6
9
 
7
10
  ```typescript
8
11
  CallService_Data {
9
12
  // Object reference - string (existing) or object (create new)
13
+ // See _common.md: TypedPermissionObject
10
14
  object: TypedPermissionObject;
11
15
 
12
16
  // Create new order (customer purchase)
13
17
  order_new?: {
14
18
  buy: {
15
19
  items: {
16
- name: string; // Product name
17
- stock: number; // Quantity
18
- wip_hash: string; // WIP file hash
20
+ name: string; // Product name (max 256 bcs chars)
21
+ stock: string | number; // Quantity
22
+ wip_hash: string; // WIP file hash
19
23
  }[];
20
- total_pay: CoinParam; // Payment amount
21
- discount?: string; // Discount object ID
22
- payment_remark?: string;
23
- payment_index?: number;
24
+ total_pay: CoinParam; // Payment amount
25
+ discount?: string; // Discount object ID
26
+ payment_remark?: string; // Payment remark
27
+ payment_index?: number; // Payment index
24
28
  };
25
29
  agents?: ManyAccountOrMark_Address; // Order agents
26
- order_required_info?: string; // Contact or WTS proof
30
+ order_required_info?: string; // Contact object ID or WTS Proof
27
31
  transfer?: AccountOrMark_Address; // New order owner
28
32
  namedNewOrder?: NamedObject; // Name for new Order
29
33
  namedNewAllocation?: NamedObject; // Name for new Allocation
30
34
  namedNewProgress?: NamedObject; // Name for new Progress
31
35
  };
32
36
 
33
- description?: string; // Service description
34
- location?: string; // Service location
37
+ description?: string; // Service description (max 4000 bcs chars)
38
+ location?: string; // Service location (max 256 bcs chars)
35
39
 
36
40
  // Sales operations (discriminated union)
37
41
  sales?: {
38
42
  op: "add" | "set";
39
- sales: { // Array of sale items (REQUIRED)
40
- name: string; // Product name
41
- price: number; // Price
42
- stock: number; // Stock quantity
43
- suspension: boolean; // Whether suspended
44
- wip: string; // WIP file URL
45
- wip_hash: string; // WIP hash
46
- }[];
43
+ sales: ServiceSale[]; // Array of sale items (REQUIRED for add/set)
47
44
  } | {
48
45
  op: "remove";
49
- sales_name: string[]; // Sale names to remove (REQUIRED)
46
+ sales_name: string[]; // Sale names to remove (REQUIRED) (each max 256 bcs chars)
50
47
  } | {
51
48
  op: "clear";
52
49
  };
53
50
 
54
- repositories?: ObjectsOp; // Repository operations
55
- rewards?: ObjectsOp; // Reward operations
56
- arbitrations?: ObjectsOp; // Arbitration operations
57
- machine?: string | null; // Machine object ID
51
+ repositories?: ObjectsOp; // Repository operations
52
+ rewards?: ObjectsOp; // Reward operations
53
+ arbitrations?: ObjectsOp; // Arbitration operations
54
+ machine?: NameOrAddress | null; // Machine object ID
58
55
 
59
56
  // Discount coupon
60
- discount?: {
61
- name: string;
62
- discount_type: 0 | 1; // 0 = RATES (percentage), 1 = FIXED (fixed amount)
63
- discount_value: number;
64
- benchmark?: number;
65
- time_ms_start?: number;
66
- time_ms_end?: number;
67
- count?: number;
68
- recipient: ManyAccountOrMark_Address;
69
- transferable?: boolean;
70
- };
57
+ discount?: Discount;
71
58
 
72
- discount_destroy?: string[]; // Discount IDs to destroy
73
- customer_required?: string[]; // Required info (phone, email, etc.)
59
+ discount_destroy?: NameOrAddress[]; // Discount IDs to destroy
60
+ customer_required?: NotEmptyName[]; // Required info names (non-empty strings)
74
61
 
75
62
  // Order fund allocators
76
- order_allocators?: {
77
- description: string;
78
- threshold: number;
79
- allocators: {
80
- guard: string; // Guard object ID
81
- sharing: {
82
- who: Recipient; // Recipient specification
83
- sharing: number; // Amount or rate
84
- mode: "Amount" | "Rate" | "Surplus";
85
- }[];
86
- fix?: number; // Fixed amount
87
- max?: number; // Maximum amount
88
- }[];
89
- } | null;
63
+ order_allocators?: Allocators | null;
90
64
 
91
- buy_guard?: string | null; // Purchase Guard
92
- compensation_fund_add?: CoinParam;
93
- setting_locked_time_add?: number;
65
+ buy_guard?: NameOrAddress | null; // Purchase Guard ID or name
66
+ compensation_fund_add?: CoinParam; // Compensation fund
67
+ setting_locked_time_add?: number; // Additional lock time (ms), extends 30-day default
94
68
  compensation_fund_receive?: ReceivedBalanceOrRecently;
95
69
  owner_receive?: ReceivedObjectsOrRecently;
96
- um?: string | null; // Contact object
97
- pause?: boolean; // Pause new orders
98
- publish?: boolean; // Publish service (immutable)
70
+ um?: NameOrAddress | null; // Contact object ID or name
71
+ pause?: boolean; // Pause new orders
72
+ publish?: boolean; // Publish service (immutable after)
99
73
  }
100
74
  ```
101
75
 
102
76
  ---
103
77
 
104
- See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, TypedPermissionObject, ObjectsOp, CoinParam, NamedObject, AccountOrMark_Address, ManyAccountOrMark_Address, ReceivedBalanceOrRecently, ReceivedObjectsOrRecently, Recipient.
78
+ See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, TypedPermissionObject, NamedObject, CoinParam, ObjectsOp, ServiceSale, Discount, Allocators, AccountOrMark_Address, ManyAccountOrMark_Address, ReceivedBalanceOrRecently, ReceivedObjectsOrRecently.
@@ -1,74 +1,68 @@
1
1
  # onchain_operations / treasury
2
2
 
3
- Create and manage treasury for team funds with deposit/withdrawal rules.
3
+ Create secure shared pools for managing deposits, withdrawals, and fund allocation scheduling.
4
+
5
+ > **CREATE vs MODIFY**: See [_common.md](./_common.md) for the unified pattern.
6
+ > Treasury uses `TypedPermissionObject`: object shape = CREATE, string = MODIFY.
4
7
 
5
8
  ## Data Schema
6
9
 
7
10
  ```typescript
8
11
  CallTreasury_Data {
9
12
  // Object reference - string (existing) or object (create new)
13
+ // See _common.md: TypedPermissionObject
10
14
  object: TypedPermissionObject;
11
15
 
12
- description?: string; // Treasury description
13
- receive?: ReceivedBalanceOrRecently; // Receive CoinWrapper
16
+ description?: string; // Treasury description (max 4000 bcs chars)
17
+
18
+ // Unwrap and deposit received CoinWrappers
19
+ receive?: ReceivedBalanceOrRecently;
14
20
 
15
- // Deposit funds
21
+ // Deposit to Treasury
16
22
  deposit?: {
17
- coin: CoinParam;
18
- by_external_deposit_guard?: string;
19
- payment_info: {
20
- remark?: string;
21
- index?: number;
22
- };
23
- namedNewPayment?: NamedObject;
23
+ coin: CoinParam; // Asset to deposit
24
+ by_external_deposit_guard?: string; // Deposit via Guard verification (not Permission)
25
+ payment_info: PaymentInfo;
26
+ namedNewPayment?: NamedObject; // Name for new Payment object
24
27
  };
25
28
 
26
- // Withdraw funds
29
+ // Withdraw from Treasury
27
30
  withdraw?: {
28
- amount: { fixed: number } | { by_external_withdraw_guard: string };
29
- recipient: AccountOrMark_Address;
30
- payment_info: {
31
- remark?: string;
32
- index?: number;
33
- };
34
- namedNewPayment?: NamedObject;
31
+ amount:
32
+ | { fixed: string | number } // Fixed amount (Permission-based)
33
+ | { by_external_withdraw_guard: string }; // Guard-based (amount from Guard index)
34
+ recipient: AccountOrMark_Address; // Recipient ID or account
35
+ payment_info: PaymentInfo;
36
+ namedNewPayment?: NamedObject; // Name for new Payment object
35
37
  };
36
38
 
37
- // External deposit Guards (discriminated union)
39
+ // External deposit Guard operations
38
40
  external_deposit_guard?: {
39
41
  op: "add" | "set";
40
- guards: { // Array of Guard configs (REQUIRED for add/set)
41
- guard: string; // Guard object ID or name
42
- identifier?: number | null; // Guard table index for deposit amount limit (null = unlimited)
43
- store_from_id?: number | null; // Guard table index for record storage
44
- }[];
42
+ guards: AmountFromDepositGuard[]; // Deposit Guard list
45
43
  } | {
46
44
  op: "remove";
47
- guards: string[]; // Guard IDs/names to remove (REQUIRED)
45
+ guards: NameOrAddress[]; // Guard IDs or names to remove
48
46
  } | {
49
47
  op: "clear";
50
48
  };
51
49
 
52
- // External withdraw Guards (discriminated union)
50
+ // External withdraw Guard operations
53
51
  external_withdraw_guard?: {
54
52
  op: "add" | "set";
55
- guards: { // Array of Guard configs (REQUIRED for add/set)
56
- guard: string; // Guard object ID or name
57
- identifier?: number | null; // Guard table index for withdrawal amount limit (null = unlimited)
58
- store_from_id?: number | null; // Guard table index for record storage
59
- }[];
53
+ guards: AmountFromWithdrawGuard[]; // Withdraw Guard list
60
54
  } | {
61
55
  op: "remove";
62
- guards: string[]; // Guard IDs/names to remove (REQUIRED)
56
+ guards: NameOrAddress[]; // Guard IDs or names to remove
63
57
  } | {
64
58
  op: "clear";
65
59
  };
66
60
 
67
61
  owner_receive?: ReceivedObjectsOrRecently;
68
- um?: string | null; // Contact object
62
+ um?: NamedObject | null; // Contact object ({ name?, tags?, onChain?, replaceExistName? })
69
63
  }
70
64
  ```
71
65
 
72
66
  ---
73
67
 
74
- See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, TypedPermissionObject, CoinParam, NamedObject, AccountOrMark_Address, ReceivedBalanceOrRecently, ReceivedObjectsOrRecently.
68
+ See [_common.md](./_common.md) for shared types: CallEnv, SubmissionCall, TypedPermissionObject, CoinParam, NamedObject, PaymentInfo, AccountOrMark_Address, AmountFromDepositGuard, AmountFromWithdrawGuard, ReceivedBalanceOrRecently, ReceivedObjectsOrRecently.
@@ -8,7 +8,7 @@
8
8
 
9
9
  ```typescript
10
10
  MessengerOperation {
11
- operation: string; // One of 15 operation types (see below)
11
+ operation: string; // One of 16 operation types (see below)
12
12
  // Operation-specific fields
13
13
  ...
14
14
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  > WOWOK data query toolkit: Query local naming info (accounts, names, Object IDs), and query on-chain WOWOK objects, received tokens, user profile, etc.
4
4
  >
5
- > **LOCAL** (device-only, never on-chain): `local_mark_list` | `account_list` | `local_info_list` | `token_list` | `account_balance`
5
+ > **LOCAL** (device-only, never on-chain): `local_mark_list` | `account_list` | `local_info_list` | `local_names` | `token_list` | `account_balance`
6
6
  >
7
7
  > **ONCHAIN** (blockchain): `onchain_personal_profile` | `onchain_objects` | `onchain_received`
8
8
  >
@@ -17,9 +17,9 @@
17
17
  ```typescript
18
18
  // Discriminated union by query_type — exactly ONE query per call
19
19
  QueryToolkit = {
20
- query_type: "local_mark_list" | "account_list" | "local_info_list" | "token_list" |
21
- "account_balance" | "onchain_personal_profile" | "onchain_objects" |
22
- "onchain_received";
20
+ query_type: "local_mark_list" | "account_list" | "local_info_list" | "local_names" |
21
+ "token_list" | "account_balance" | "onchain_personal_profile" |
22
+ "onchain_objects" | "onchain_received";
23
23
  // ... query-specific parameters (see below)
24
24
  }
25
25
  ```
@@ -150,7 +150,29 @@ InfoData {
150
150
 
151
151
  ---
152
152
 
153
- ### 4. token_list
153
+ ### 4. local_names
154
+
155
+ Batch reverse lookup — query local names by a list of addresses.
156
+
157
+ ```typescript
158
+ {
159
+ query_type: "local_names";
160
+ addresses: string[]; // Array of account addresses (0x...) to look up
161
+ }
162
+ ```
163
+
164
+ **Result**: `{ address: string; name?: string }[]`
165
+
166
+ ```typescript
167
+ {
168
+ address: string; // The queried address
169
+ name?: string; // Local name assigned to this address, undefined if none
170
+ }
171
+ ```
172
+
173
+ ---
174
+
175
+ ### 5. token_list
154
176
 
155
177
  Query cached token metadata — symbol, decimals, icon URL, description.
156
178
 
@@ -161,12 +183,9 @@ Query cached token metadata — symbol, decimals, icon URL, description.
161
183
  }
162
184
 
163
185
  TokenDataFilter {
186
+ alias_or_name?: string; // Filter by alias or name (max 64 bcs characters)
187
+ symbol?: string; // Filter by symbol
164
188
  type?: string; // Filter by token type (e.g., "0x2::wow::WOW")
165
- alias?: string; // Filter by alias
166
- name?: string; // Filter by name (fuzzy)
167
- symbol?: string; // Filter by symbol (fuzzy)
168
- decimals?: number; // Filter by decimals
169
- iconUrl?: string; // Filter by icon URL
170
189
  }
171
190
  ```
172
191
 
@@ -179,14 +198,15 @@ TokenTypeInfo {
179
198
  name: string;
180
199
  symbol: string;
181
200
  decimals: number;
182
- iconUrl?: string;
183
- description?: string;
201
+ description: string; // Token description (required)
202
+ iconUrl?: string | null; // URL for the token logo (may be null)
203
+ id?: string | null; // Object ID for the CoinMetadata object (may be null)
184
204
  }
185
205
  ```
186
206
 
187
207
  ---
188
208
 
189
- ### 5. account_balance
209
+ ### 6. account_balance
190
210
 
191
211
  Query an account's coin balance OR paginated coin objects.
192
212
 
@@ -242,7 +262,7 @@ CoinStruct {
242
262
 
243
263
  ---
244
264
 
245
- ### 6. onchain_personal_profile
265
+ ### 7. onchain_personal_profile
246
266
 
247
267
  Query any user's PUBLIC on-chain profile — social links, reputation, personal info, voting history, referrer.
248
268
 
@@ -290,7 +310,7 @@ PersonalVote {
290
310
 
291
311
  ---
292
312
 
293
- ### 7. onchain_objects
313
+ ### 8. onchain_objects
294
314
 
295
315
  Batch query on-chain WOWOK objects by ID — supports Service, Machine, Order, Treasury, Reward, Arb, Personal, Contact, and more.
296
316
 
@@ -318,7 +338,7 @@ ObjectBase {
318
338
 
319
339
  ---
320
340
 
321
- ### 8. onchain_received
341
+ ### 9. onchain_received
322
342
 
323
343
  Query objects (payments, tokens, NFTs) received by an on-chain object.
324
344
 
@@ -368,7 +388,7 @@ WatchQueryOperationsResult {
368
388
  }
369
389
  ```
370
390
 
371
- The output schema validates all 8 query types with their specific return types. Each query's `result` field is strictly typed:
391
+ The output schema validates all 9 query types with their specific return types. Each query's `result` field is strictly typed:
372
392
  - Local queries return arrays (`MarkData[]`, `AccountData[]`, `InfoData[]`, `TokenTypeInfo[]`)
373
393
  - `account_balance` returns `{ address, balance? | coin? }`
374
394
  - Onchain queries return `ObjectType | undefined` or `{ objects: ObjectBase[] }`