@wowok/agent-mcp 2.2.11 → 2.2.13
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/dist/docs/index.d.ts +3 -0
- package/dist/docs/index.js +2 -0
- package/dist/docs/loader.d.ts +12 -0
- package/dist/docs/loader.js +177 -0
- package/dist/docs/search.d.ts +17 -0
- package/dist/docs/search.js +325 -0
- package/dist/docs/types.d.ts +55 -0
- package/dist/docs/types.js +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +146 -39
- package/docs/README.md +249 -0
- package/docs/WIP.md +388 -0
- package/docs/WTS.md +536 -0
- package/docs/docs/account.md +914 -0
- package/docs/docs/allocation.md +635 -0
- package/docs/docs/arbitration.md +1804 -0
- package/docs/docs/arbitration_state_machine.md +270 -0
- package/docs/docs/contact.md +709 -0
- package/docs/docs/demand.md +948 -0
- package/docs/docs/guard.md +1465 -0
- package/docs/docs/localinfo.md +432 -0
- package/docs/docs/localmark.md +583 -0
- package/docs/docs/machine.md +2490 -0
- package/docs/docs/messenger.md +2098 -0
- package/docs/docs/onchain_events.md +267 -0
- package/docs/docs/order.md +1001 -0
- package/docs/docs/payment.md +512 -0
- package/docs/docs/permission.md +1438 -0
- package/docs/docs/personal.md +742 -0
- package/docs/docs/progress.md +1748 -0
- package/docs/docs/query.md +467 -0
- package/docs/docs/repository.md +1043 -0
- package/docs/docs/reward.md +833 -0
- package/docs/docs/service.md +2130 -0
- package/docs/docs/stage-01-introduction.md +243 -0
- package/docs/docs/stage-02-trust.md +302 -0
- package/docs/docs/stage-03-collaboration.md +337 -0
- package/docs/docs/stage-04-transaction.md +277 -0
- package/docs/docs/stage-05-business.md +151 -0
- package/docs/docs/stage-06-personal.md +203 -0
- package/docs/docs/stage-07-query.md +572 -0
- package/docs/docs/stage-08-examples.md +184 -0
- package/docs/docs/treasury.md +1149 -0
- package/docs/docs/wowok_buildin_info.md +740 -0
- package/docs/examples/Insurance/Insurance.md +594 -0
- package/docs/examples/Insurance/Insurance_TestResults.md +481 -0
- package/docs/examples/Insurance/insurance_complete_guard_v1.json +50 -0
- package/docs/examples/MyShop/MyShop.md +1353 -0
- package/docs/examples/MyShop/MyShop_TestResults.md +1003 -0
- package/docs/examples/MyShop_Advanced/MyShop_Advanced.md +1898 -0
- package/docs/examples/MyShop_Advanced/MyShop_Advanced_MerchantSystem_TestResults.md +1297 -0
- package/docs/examples/MyShop_Advanced/MyShop_Advanced_OrderFlow_TestResults.md +743 -0
- package/docs/examples/MyShop_Advanced/machine_nodes.json +222 -0
- package/docs/examples/ThreeBody_Signature/ThreeBody_Signature.md +776 -0
- package/docs/examples/ThreeBody_Signature/ThreeBody_Signature_TestResults.md +599 -0
- package/docs/examples/Travel/Travel.md +1157 -0
- package/docs/examples/Travel/Travel_TestResults.md +743 -0
- package/docs/examples/Travel/calc-weather-timestamps.js +8 -0
- package/docs/examples/Travel/travel_machine_v2_export.json +104 -0
- package/docs/examples/Travel/weather_check_guard_v1.json +51 -0
- package/docs/skills/WOWOK.md +650 -0
- package/docs/skills/onchain_operations/_common.md +406 -0
- package/docs/skills/onchain_operations/_index.md +196 -0
- package/docs/skills/onchain_operations/allocation.md +28 -0
- package/docs/skills/onchain_operations/arbitration.md +106 -0
- package/docs/skills/onchain_operations/contact.md +40 -0
- package/docs/skills/onchain_operations/demand.md +53 -0
- package/docs/skills/onchain_operations/gen_passport.md +23 -0
- package/docs/skills/onchain_operations/guard.md +56 -0
- package/docs/skills/onchain_operations/machine.md +89 -0
- package/docs/skills/onchain_operations/order.md +56 -0
- package/docs/skills/onchain_operations/payment.md +24 -0
- package/docs/skills/onchain_operations/permission.md +68 -0
- package/docs/skills/onchain_operations/personal.md +58 -0
- package/docs/skills/onchain_operations/progress.md +38 -0
- package/docs/skills/onchain_operations/repository.md +70 -0
- package/docs/skills/onchain_operations/reward.md +38 -0
- package/docs/skills/onchain_operations/service.md +78 -0
- package/docs/skills/onchain_operations/treasury.md +68 -0
- package/docs/skills/schema-account_operation.md +402 -0
- package/docs/skills/schema-guard2file.md +153 -0
- package/docs/skills/schema-local_info_operation.md +160 -0
- package/docs/skills/schema-local_mark_operation.md +148 -0
- package/docs/skills/schema-machineNode2file.md +155 -0
- package/docs/skills/schema-messenger_operation.md +547 -0
- package/docs/skills/schema-onchain_events.md +201 -0
- package/docs/skills/schema-onchain_table_data.md +334 -0
- package/docs/skills/schema-query_toolkit.md +395 -0
- package/docs/skills/schema-wip_file.md +240 -0
- package/docs/skills/schema-wowok_buildin_info.md +296 -0
- package/docs/wip-examples/three_body.html +57 -0
- package/docs/wip-examples/three_body.wip +30 -0
- package/package.json +3 -2
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# On-Chain Events Tool Schema
|
|
2
|
+
|
|
3
|
+
> **Tool Name**: `onchain_events`
|
|
4
|
+
> **Description**: Watch on-chain WOWOK events by type. Supports arbitration events, new order events, progress events, demand presentation events, demand feedback events, and new entity registration events. Use pagination cursor for fetching large result sets.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Tool Schema
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
onchain_events: OnchainEventsInput
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Input Schema
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
OnchainEventsInput {
|
|
20
|
+
type: EventType, // REQUIRED - Event type to query
|
|
21
|
+
cursor?: EventCursor | null, // OPTIONAL - Pagination cursor for fetching next page
|
|
22
|
+
limit?: number | null, // OPTIONAL - Maximum number of events to return per query
|
|
23
|
+
order?: "ascending" | "descending" | null, // OPTIONAL - Sort order
|
|
24
|
+
no_cache?: boolean, // OPTIONAL - Whether to bypass cache
|
|
25
|
+
network?: "localnet" | "testnet" // OPTIONAL - Network to query
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Sub Schemas
|
|
32
|
+
|
|
33
|
+
### EventType
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
EventType =
|
|
37
|
+
| "ArbEvent" // Arbitration events
|
|
38
|
+
| "NewOrderEvent" // New order events
|
|
39
|
+
| "ProgressEvent" // Progress events
|
|
40
|
+
| "DemandPresentEvent" // Demand presentation events
|
|
41
|
+
| "DemandFeedbackEvent" // Demand feedback events
|
|
42
|
+
| "NewEntityEvent" // New entity registration events
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### EventCursor
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
EventCursor {
|
|
49
|
+
eventSeq: string, // Event sequence number
|
|
50
|
+
txDigest: string // Transaction digest
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Output Schema
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
OnchainEventsResult {
|
|
60
|
+
result: EventAnswer | null // Event query result or null if no data
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
EventAnswer {
|
|
64
|
+
data: EventBase[], // Event object data array
|
|
65
|
+
hasNextPage: boolean, // Whether there is a next page
|
|
66
|
+
nextCursor?: EventCursor | null, // Next page cursor
|
|
67
|
+
cache_expire?: number | "INFINITE" // Cache expiration time
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Event Type Schemas
|
|
74
|
+
|
|
75
|
+
### EventBase
|
|
76
|
+
|
|
77
|
+
Base schema for all event types.
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
EventBase {
|
|
81
|
+
id: EventCursor, // Event identifier
|
|
82
|
+
sender: string, // Event sender ID
|
|
83
|
+
type: EventType | string, // Event type
|
|
84
|
+
type_raw: string, // Raw event type
|
|
85
|
+
time: string // Event occurrence time
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### ArbEvent
|
|
90
|
+
|
|
91
|
+
Arbitration event schema.
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
ArbEvent extends EventBase {
|
|
95
|
+
arb: string, // Arbitration object ID
|
|
96
|
+
arbitration: string, // Arbitration object ID (alias)
|
|
97
|
+
order: string, // Order object ID
|
|
98
|
+
status: ArbStatus // Arbitration status
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
ArbStatus =
|
|
102
|
+
| "voting" // Voting in progress
|
|
103
|
+
| "completed" // Completed
|
|
104
|
+
| "cancelled" // Cancelled
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### NewOrderEvent
|
|
108
|
+
|
|
109
|
+
New order event schema.
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
NewOrderEvent extends EventBase {
|
|
113
|
+
order: string, // Order object ID
|
|
114
|
+
service: string, // Service object ID
|
|
115
|
+
progress?: string | null, // Progress object ID
|
|
116
|
+
discount?: string | null, // Discount object ID
|
|
117
|
+
allocation?: string | null, // Allocation object ID
|
|
118
|
+
amount: BalanceType // Order amount
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### ProgressEvent
|
|
123
|
+
|
|
124
|
+
Progress event schema.
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
ProgressEvent extends EventBase {
|
|
128
|
+
progress: string, // Progress object ID
|
|
129
|
+
machine: string, // Machine object ID
|
|
130
|
+
task?: string | null, // Task object ID
|
|
131
|
+
node: string, // Current node name
|
|
132
|
+
forward?: string | null, // Forward operation name
|
|
133
|
+
hold?: boolean | null // Whether it is a hold operation
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### DemandPresentEvent
|
|
138
|
+
|
|
139
|
+
Demand presentation event schema.
|
|
140
|
+
|
|
141
|
+
```typescript
|
|
142
|
+
DemandPresentEvent extends EventBase {
|
|
143
|
+
demand: string, // Demand object ID
|
|
144
|
+
service?: string | null, // Service object ID
|
|
145
|
+
recommend: string // Recommendation letter
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### DemandFeedbackEvent
|
|
150
|
+
|
|
151
|
+
Demand feedback event schema.
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
DemandFeedbackEvent extends EventBase {
|
|
155
|
+
demand: string, // Demand object ID
|
|
156
|
+
service?: string | null, // Service object ID
|
|
157
|
+
feedback: string, // Feedback content
|
|
158
|
+
acceptance_score?: number | null // Acceptance score
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### NewEntityEvent
|
|
163
|
+
|
|
164
|
+
New entity registration event schema.
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
NewEntityEvent extends EventBase {
|
|
168
|
+
address: string, // User ID
|
|
169
|
+
resource: string, // ID mark object ID owned by user
|
|
170
|
+
referrer?: string | null // Referrer ID
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Event Type Selection Guide
|
|
177
|
+
|
|
178
|
+
| Event Type | Use Case | Key Fields |
|
|
179
|
+
|------------|----------|------------|
|
|
180
|
+
| `ArbEvent` | Monitor arbitration status changes | `arb`, `order`, `status` |
|
|
181
|
+
| `NewOrderEvent` | Track new orders created | `order`, `service`, `amount` |
|
|
182
|
+
| `ProgressEvent` | Monitor workflow progress | `progress`, `machine`, `node` |
|
|
183
|
+
| `DemandPresentEvent` | Track demand presentations | `demand`, `service`, `recommend` |
|
|
184
|
+
| `DemandFeedbackEvent` | Monitor demand feedback | `demand`, `feedback`, `acceptance_score` |
|
|
185
|
+
| `NewEntityEvent` | Track new user registrations | `address`, `resource`, `referrer` |
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Pagination Guide
|
|
190
|
+
|
|
191
|
+
1. **First Query**: Set `cursor` to `null` to get the first page
|
|
192
|
+
2. **Subsequent Queries**: Use `nextCursor` from previous response
|
|
193
|
+
3. **Check `hasNextPage`**: Stop when `hasNextPage` is `false`
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Complete Event Union Type
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
Event = ArbEvent | NewOrderEvent | ProgressEvent | DemandPresentEvent | DemandFeedbackEvent | NewEntityEvent
|
|
201
|
+
```
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
# Schema: onchain_table_data
|
|
2
|
+
|
|
3
|
+
> **Tool Name**: `onchain_table_data`
|
|
4
|
+
> **Description**: Query dynamic table data of on-chain objects — supports paginated table queries and specific table item lookups. Each table item belongs to a parent object type and has a specific meaning.
|
|
5
|
+
>
|
|
6
|
+
> This tool was split from `query_toolkit` to handle the unique characteristics of dynamic table queries — objects have fixed size, but their table data can grow dynamically.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Top-Level Structure
|
|
11
|
+
|
|
12
|
+
```typescript
|
|
13
|
+
// Discriminated union by query_type — exactly ONE query per call
|
|
14
|
+
OnchainTableData = {
|
|
15
|
+
query_type: "onchain_table" | "onchain_table_item_repository_data" |
|
|
16
|
+
"onchain_table_item_permission_perm" | "onchain_table_item_entity_registrar" |
|
|
17
|
+
"onchain_table_item_entity_linker" | "onchain_table_item_reward_record" |
|
|
18
|
+
"onchain_table_item_demand_presenter" | "onchain_table_item_treasury_history" |
|
|
19
|
+
"onchain_table_item_machine_node" | "onchain_table_item_progress_history" |
|
|
20
|
+
"onchain_table_item_address_mark" | "onchain_table_item_generic";
|
|
21
|
+
// ... query-specific parameters (see below)
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Common Parameters (All Queries)
|
|
28
|
+
|
|
29
|
+
| Parameter | Type | Description |
|
|
30
|
+
|-----------|------|-------------|
|
|
31
|
+
| `no_cache` | `boolean` (optional) | Set to `true` to bypass cache and fetch fresh on-chain data |
|
|
32
|
+
| `network` | `"localnet" \| "testnet"` (optional) | Network to query; defaults to the configured default network |
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Common Parameters (Paginated Queries)
|
|
37
|
+
|
|
38
|
+
| Parameter | Type | Applies To | Description |
|
|
39
|
+
|-----------|------|-----------|-------------|
|
|
40
|
+
| `cursor` | `string \| null` (optional) | onchain_table | Pagination cursor from previous page's `nextCursor` |
|
|
41
|
+
| `limit` | `number \| null` (optional) | onchain_table | Max items per page |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Query Types
|
|
46
|
+
|
|
47
|
+
### 1. onchain_table
|
|
48
|
+
|
|
49
|
+
Paginated query of ANY object's dynamic fields table. Returns all entries with keys, types, and object IDs. Use to explore all sub-items of an object.
|
|
50
|
+
|
|
51
|
+
**Parent**: Any object
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
{
|
|
55
|
+
query_type: "onchain_table";
|
|
56
|
+
parent: string; // Parent object ID whose dynamic fields table to query
|
|
57
|
+
cursor?: string | null; // Pagination cursor from previous page's nextCursor
|
|
58
|
+
limit?: number | null; // Max items per page
|
|
59
|
+
no_cache?: boolean;
|
|
60
|
+
network?: "localnet" | "testnet";
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Result**: `TableAnswer | undefined`
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
TableAnswer {
|
|
68
|
+
items: TableItem[];
|
|
69
|
+
hasNextPage: boolean;
|
|
70
|
+
nextCursor?: string | null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
TableItem {
|
|
74
|
+
object: string; // Object ID of the table item
|
|
75
|
+
type: string; // Type of the table item
|
|
76
|
+
version: number; // Version of the table item
|
|
77
|
+
key: { // Key of the dynamic field entry
|
|
78
|
+
type: string; // Key type (e.g., "address", "string", "u64")
|
|
79
|
+
value: string; // Key value
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
### 2. onchain_table_item_repository_data
|
|
87
|
+
|
|
88
|
+
Query a record from a Repository's on-chain key-value database.
|
|
89
|
+
|
|
90
|
+
**Parent**: Repository | **Key**: name + entity (address or number)
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
{
|
|
94
|
+
query_type: "onchain_table_item_repository_data";
|
|
95
|
+
parent: string; // Parent Repository object ID
|
|
96
|
+
name: string; // Name/key of the record to retrieve
|
|
97
|
+
entity: string | number; // Entity ID or address that owns/identifies the record
|
|
98
|
+
no_cache?: boolean;
|
|
99
|
+
network?: "localnet" | "testnet";
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Result**: `TableItem_RepositoryData | undefined`
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
### 3. onchain_table_item_permission_perm
|
|
108
|
+
|
|
109
|
+
Query a permission entry from a Permission object's access control table. Returns the permission list (perm[]) granted to that user/guard.
|
|
110
|
+
|
|
111
|
+
**Parent**: Permission | **Key**: user address or Guard ID
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
{
|
|
115
|
+
query_type: "onchain_table_item_permission_perm";
|
|
116
|
+
parent: string; // Parent Permission object ID
|
|
117
|
+
address: string; // User address or Guard ID whose permissions to check
|
|
118
|
+
no_cache?: boolean;
|
|
119
|
+
network?: "localnet" | "testnet";
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Result**: `TableItem_PermissionPerm | undefined`
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
TableItem_PermissionPerm {
|
|
127
|
+
object: string;
|
|
128
|
+
type: string;
|
|
129
|
+
type_raw: string;
|
|
130
|
+
owner: object;
|
|
131
|
+
version: string;
|
|
132
|
+
previousTransaction: string;
|
|
133
|
+
address: string; // The entity address
|
|
134
|
+
perm: number[]; // List of permission indexes granted
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
### 4. onchain_table_item_entity_registrar
|
|
141
|
+
|
|
142
|
+
Query an entity's registration record from the GLOBAL EntityRegistrar. Returns registration info: description, referrer, records, mark_object.
|
|
143
|
+
|
|
144
|
+
**Parent**: System EntityRegistrar | **Key**: user address
|
|
145
|
+
|
|
146
|
+
```typescript
|
|
147
|
+
{
|
|
148
|
+
query_type: "onchain_table_item_entity_registrar";
|
|
149
|
+
address: string; // User address to look up in the global EntityRegistrar
|
|
150
|
+
no_cache?: boolean;
|
|
151
|
+
network?: "localnet" | "testnet";
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Result**: `TableItem_EntityRegistrar | undefined`
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
### 5. onchain_table_item_entity_linker
|
|
160
|
+
|
|
161
|
+
Query community votes/endorsements for an entity from the GLOBAL EntityLinker. Returns vote records (likes/dislikes) showing community trust.
|
|
162
|
+
|
|
163
|
+
**Parent**: System EntityLinker | **Key**: entity address
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
{
|
|
167
|
+
query_type: "onchain_table_item_entity_linker";
|
|
168
|
+
address: string; // Entity address whose community votes to query
|
|
169
|
+
no_cache?: boolean;
|
|
170
|
+
network?: "localnet" | "testnet";
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Result**: `TableItem_EntityLinker | undefined`
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
### 6. onchain_table_item_reward_record
|
|
179
|
+
|
|
180
|
+
Query a reward claim record from a Reward object's distribution table. Returns claim history: guard used, total claimed, per-claim details.
|
|
181
|
+
|
|
182
|
+
**Parent**: Reward | **Key**: recipient address
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
{
|
|
186
|
+
query_type: "onchain_table_item_reward_record";
|
|
187
|
+
parent: string; // Parent Reward object ID
|
|
188
|
+
address: string; // User address that claimed the reward
|
|
189
|
+
no_cache?: boolean;
|
|
190
|
+
network?: "localnet" | "testnet";
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Result**: `TableItem_RewardRecord | undefined`
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
### 7. onchain_table_item_demand_presenter
|
|
199
|
+
|
|
200
|
+
Query a demand submission from a Demand object's presenter table. Returns submission details: recommendation, service, feedback, acceptance score.
|
|
201
|
+
|
|
202
|
+
**Parent**: Demand | **Key**: presenter address
|
|
203
|
+
|
|
204
|
+
```typescript
|
|
205
|
+
{
|
|
206
|
+
query_type: "onchain_table_item_demand_presenter";
|
|
207
|
+
parent: string; // Parent Demand object ID
|
|
208
|
+
address: string; // Presenter address that submitted the demand
|
|
209
|
+
no_cache?: boolean;
|
|
210
|
+
network?: "localnet" | "testnet";
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**Result**: `TableItem_DemandPresenter | undefined`
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
### 8. onchain_table_item_treasury_history
|
|
219
|
+
|
|
220
|
+
Query a payment record from a Treasury's history table. Returns payment details: operation type, signer, amount, external guard.
|
|
221
|
+
|
|
222
|
+
**Parent**: Treasury | **Key**: payment ID (address)
|
|
223
|
+
|
|
224
|
+
```typescript
|
|
225
|
+
{
|
|
226
|
+
query_type: "onchain_table_item_treasury_history";
|
|
227
|
+
parent: string; // Parent Treasury object ID
|
|
228
|
+
address: string; // Payment ID whose treasury record to look up
|
|
229
|
+
no_cache?: boolean;
|
|
230
|
+
network?: "localnet" | "testnet";
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
**Result**: `TableItem_TreasuryHistory | undefined`
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
### 9. onchain_table_item_machine_node
|
|
239
|
+
|
|
240
|
+
Query a workflow node definition from a Machine object's node table. Returns node configuration: pairs, forwards, guards, thresholds.
|
|
241
|
+
|
|
242
|
+
**Parent**: Machine | **Key**: node name (string)
|
|
243
|
+
|
|
244
|
+
```typescript
|
|
245
|
+
{
|
|
246
|
+
query_type: "onchain_table_item_machine_node";
|
|
247
|
+
parent: string; // Parent Machine object ID
|
|
248
|
+
key: string; // Node name (string key) in the Machine's workflow definition
|
|
249
|
+
no_cache?: boolean;
|
|
250
|
+
network?: "localnet" | "testnet";
|
|
251
|
+
}
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
**Result**: `TableItem_MachineNode | undefined`
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
### 10. onchain_table_item_progress_history
|
|
259
|
+
|
|
260
|
+
Query a progress step record from a Progress object's history table. Returns step details: node, next_node, session state, time.
|
|
261
|
+
|
|
262
|
+
**Parent**: Progress | **Key**: sequence number (u64)
|
|
263
|
+
|
|
264
|
+
```typescript
|
|
265
|
+
{
|
|
266
|
+
query_type: "onchain_table_item_progress_history";
|
|
267
|
+
parent: string; // Parent Progress object ID
|
|
268
|
+
u64: number | string; // Sequence number (u64) of the progress step to query
|
|
269
|
+
no_cache?: boolean;
|
|
270
|
+
network?: "localnet" | "testnet";
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
**Result**: `TableItem_ProgressHistory | undefined`
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
### 11. onchain_table_item_address_mark
|
|
279
|
+
|
|
280
|
+
Query a PUBLIC on-chain name/tag mark from an AddressMark object's table. Unlike local marks, these are published on-chain. Returns public labels: entity, name, tags[].
|
|
281
|
+
|
|
282
|
+
**Parent**: AddressMark | **Key**: address
|
|
283
|
+
|
|
284
|
+
```typescript
|
|
285
|
+
{
|
|
286
|
+
query_type: "onchain_table_item_address_mark";
|
|
287
|
+
parent: string; // Parent AddressMark object ID
|
|
288
|
+
address: string; // Address whose PUBLIC on-chain name/tags to look up
|
|
289
|
+
no_cache?: boolean;
|
|
290
|
+
network?: "localnet" | "testnet";
|
|
291
|
+
}
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
**Result**: `TableItem_AddressMark | undefined`
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
### 12. onchain_table_item_generic
|
|
299
|
+
|
|
300
|
+
Query a generic table item from ANY object's dynamic fields. Supports arbitrary key types and values for non-WoWok objects or custom queries. Use for general-purpose table lookups.
|
|
301
|
+
|
|
302
|
+
**Parent**: Any object | **Key**: arbitrary (key_type + key_value)
|
|
303
|
+
|
|
304
|
+
```typescript
|
|
305
|
+
{
|
|
306
|
+
query_type: "onchain_table_item_generic";
|
|
307
|
+
parent: string; // Parent object ID whose dynamic field to query
|
|
308
|
+
key_type: string; // Type of the key (e.g., "address", "u64", "string", "0x2::object::ID")
|
|
309
|
+
key_value: any; // Value of the key — must match key_type format
|
|
310
|
+
no_cache?: boolean;
|
|
311
|
+
network?: "localnet" | "testnet";
|
|
312
|
+
}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
**Result**: `ObjectBase | undefined`
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
## Output Schema
|
|
320
|
+
|
|
321
|
+
All queries return results wrapped in a unified `z.object({ result: ... })` structure with strict schema validation:
|
|
322
|
+
|
|
323
|
+
```typescript
|
|
324
|
+
OnchainTableDataResult {
|
|
325
|
+
result: {
|
|
326
|
+
query_type: string; // Echoes the requested query_type
|
|
327
|
+
result: TableAnswer | TableItem_* | undefined; // Query-specific result
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
The output schema validates all 12 query types with their specific return types. Each query's `result` field is strictly typed:
|
|
333
|
+
- `onchain_table` returns `TableAnswer | undefined` (items[], nextCursor, hasNextPage)
|
|
334
|
+
- All `onchain_table_item_*` queries return their specific `TableItem_* | undefined`
|