@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.
Files changed (93) hide show
  1. package/dist/docs/index.d.ts +3 -0
  2. package/dist/docs/index.js +2 -0
  3. package/dist/docs/loader.d.ts +12 -0
  4. package/dist/docs/loader.js +177 -0
  5. package/dist/docs/search.d.ts +17 -0
  6. package/dist/docs/search.js +325 -0
  7. package/dist/docs/types.d.ts +55 -0
  8. package/dist/docs/types.js +1 -0
  9. package/dist/index.d.ts +12 -0
  10. package/dist/index.js +146 -39
  11. package/docs/README.md +249 -0
  12. package/docs/WIP.md +388 -0
  13. package/docs/WTS.md +536 -0
  14. package/docs/docs/account.md +914 -0
  15. package/docs/docs/allocation.md +635 -0
  16. package/docs/docs/arbitration.md +1804 -0
  17. package/docs/docs/arbitration_state_machine.md +270 -0
  18. package/docs/docs/contact.md +709 -0
  19. package/docs/docs/demand.md +948 -0
  20. package/docs/docs/guard.md +1465 -0
  21. package/docs/docs/localinfo.md +432 -0
  22. package/docs/docs/localmark.md +583 -0
  23. package/docs/docs/machine.md +2490 -0
  24. package/docs/docs/messenger.md +2098 -0
  25. package/docs/docs/onchain_events.md +267 -0
  26. package/docs/docs/order.md +1001 -0
  27. package/docs/docs/payment.md +512 -0
  28. package/docs/docs/permission.md +1438 -0
  29. package/docs/docs/personal.md +742 -0
  30. package/docs/docs/progress.md +1748 -0
  31. package/docs/docs/query.md +467 -0
  32. package/docs/docs/repository.md +1043 -0
  33. package/docs/docs/reward.md +833 -0
  34. package/docs/docs/service.md +2130 -0
  35. package/docs/docs/stage-01-introduction.md +243 -0
  36. package/docs/docs/stage-02-trust.md +302 -0
  37. package/docs/docs/stage-03-collaboration.md +337 -0
  38. package/docs/docs/stage-04-transaction.md +277 -0
  39. package/docs/docs/stage-05-business.md +151 -0
  40. package/docs/docs/stage-06-personal.md +203 -0
  41. package/docs/docs/stage-07-query.md +572 -0
  42. package/docs/docs/stage-08-examples.md +184 -0
  43. package/docs/docs/treasury.md +1149 -0
  44. package/docs/docs/wowok_buildin_info.md +740 -0
  45. package/docs/examples/Insurance/Insurance.md +594 -0
  46. package/docs/examples/Insurance/Insurance_TestResults.md +481 -0
  47. package/docs/examples/Insurance/insurance_complete_guard_v1.json +50 -0
  48. package/docs/examples/MyShop/MyShop.md +1353 -0
  49. package/docs/examples/MyShop/MyShop_TestResults.md +1003 -0
  50. package/docs/examples/MyShop_Advanced/MyShop_Advanced.md +1898 -0
  51. package/docs/examples/MyShop_Advanced/MyShop_Advanced_MerchantSystem_TestResults.md +1297 -0
  52. package/docs/examples/MyShop_Advanced/MyShop_Advanced_OrderFlow_TestResults.md +743 -0
  53. package/docs/examples/MyShop_Advanced/machine_nodes.json +222 -0
  54. package/docs/examples/ThreeBody_Signature/ThreeBody_Signature.md +776 -0
  55. package/docs/examples/ThreeBody_Signature/ThreeBody_Signature_TestResults.md +599 -0
  56. package/docs/examples/Travel/Travel.md +1157 -0
  57. package/docs/examples/Travel/Travel_TestResults.md +743 -0
  58. package/docs/examples/Travel/calc-weather-timestamps.js +8 -0
  59. package/docs/examples/Travel/travel_machine_v2_export.json +104 -0
  60. package/docs/examples/Travel/weather_check_guard_v1.json +51 -0
  61. package/docs/skills/WOWOK.md +650 -0
  62. package/docs/skills/onchain_operations/_common.md +406 -0
  63. package/docs/skills/onchain_operations/_index.md +196 -0
  64. package/docs/skills/onchain_operations/allocation.md +28 -0
  65. package/docs/skills/onchain_operations/arbitration.md +106 -0
  66. package/docs/skills/onchain_operations/contact.md +40 -0
  67. package/docs/skills/onchain_operations/demand.md +53 -0
  68. package/docs/skills/onchain_operations/gen_passport.md +23 -0
  69. package/docs/skills/onchain_operations/guard.md +56 -0
  70. package/docs/skills/onchain_operations/machine.md +89 -0
  71. package/docs/skills/onchain_operations/order.md +56 -0
  72. package/docs/skills/onchain_operations/payment.md +24 -0
  73. package/docs/skills/onchain_operations/permission.md +68 -0
  74. package/docs/skills/onchain_operations/personal.md +58 -0
  75. package/docs/skills/onchain_operations/progress.md +38 -0
  76. package/docs/skills/onchain_operations/repository.md +70 -0
  77. package/docs/skills/onchain_operations/reward.md +38 -0
  78. package/docs/skills/onchain_operations/service.md +78 -0
  79. package/docs/skills/onchain_operations/treasury.md +68 -0
  80. package/docs/skills/schema-account_operation.md +402 -0
  81. package/docs/skills/schema-guard2file.md +153 -0
  82. package/docs/skills/schema-local_info_operation.md +160 -0
  83. package/docs/skills/schema-local_mark_operation.md +148 -0
  84. package/docs/skills/schema-machineNode2file.md +155 -0
  85. package/docs/skills/schema-messenger_operation.md +547 -0
  86. package/docs/skills/schema-onchain_events.md +201 -0
  87. package/docs/skills/schema-onchain_table_data.md +334 -0
  88. package/docs/skills/schema-query_toolkit.md +395 -0
  89. package/docs/skills/schema-wip_file.md +240 -0
  90. package/docs/skills/schema-wowok_buildin_info.md +296 -0
  91. package/docs/wip-examples/three_body.html +57 -0
  92. package/docs/wip-examples/three_body.wip +30 -0
  93. package/package.json +3 -2
@@ -0,0 +1,709 @@
1
+ # Contact Component (💬 Communication Hub)
2
+
3
+ ---
4
+
5
+ ## Component Overview
6
+
7
+ The Contact component is used to manage on-chain instant messaging contact profiles, serving as the core for secure IM address management.
8
+
9
+ **Key Role in Secure Communication:**
10
+
11
+ The Contact component is the **foundation of end-to-end encrypted messaging** in the WoWok protocol. It serves as the bridge between on-chain identity and off-chain secure communication through the [Messenger](messenger.md) system.
12
+
13
+ **How Contact Enables Secure Messaging:**
14
+
15
+ 1. **On-Chain Identity**: Contact objects are published on-chain, providing a verifiable public identity that anyone can look up
16
+ 2. **Messenger Integration**: Each Contact object can be linked to a Messenger account, enabling encrypted communication
17
+ 3. **Privacy Protection**: While the Contact identity is public, all actual communication is **end-to-end encrypted** and **never stored on-chain**
18
+ 4. **Service Communication**: In [Service](service.md) transactions, Contact objects enable customers and service providers to exchange sensitive information (shipping addresses, phone numbers, etc.) securely without exposing this data on the blockchain
19
+
20
+ **Typical Usage Flow:**
21
+
22
+ ```
23
+ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
24
+ │ Create Contact │────▶│ Enable Messenger │────▶│ Secure Chat │
25
+ │ (On-chain) │ │ (Encrypted IM) │ │ (E2E Encrypted)│
26
+ └─────────────────┘ └─────────────────┘ └─────────────────┘
27
+ │ │
28
+ │ │
29
+ ▼ ▼
30
+ ┌─────────────────┐ ┌─────────────────┐
31
+ │ Share Contact │ │ Exchange Info │
32
+ │ with Others │ │ (Private) │
33
+ └─────────────────┘ └─────────────────┘
34
+ ```
35
+
36
+ **Important Links:**
37
+ - **[Messenger](messenger.md)** - End-to-end encrypted messaging system
38
+ - **[Service](service.md)** - Uses Contact for secure customer-service provider communication
39
+ - **[Order](order.md)** - Uses Contact via `required_info` field for private information exchange
40
+
41
+ ---
42
+
43
+ ## Why Contact is Essential
44
+
45
+ | Scenario | Without Contact | With Contact |
46
+ |----------|----------------|--------------|
47
+ | **Service Purchase** | No way to send shipping address privately | Customer sends encrypted address via Messenger linked to Contact |
48
+ | **Dispute Resolution** | No verifiable communication history | WTS (Witness Timestamped Snapshot) provides cryptographic proof of conversations |
49
+ | **Team Collaboration** | No secure team communication channel | Team members communicate via encrypted channels linked to Contact identities |
50
+ | **Customer Support** | Public on-chain messages expose sensitive data | Private end-to-end encrypted support conversations |
51
+
52
+ **Privacy & Security Guarantees:**
53
+ - ✅ **End-to-end encryption** - Only conversation participants can read messages
54
+ - ✅ **No on-chain storage** - Message content is never published to the blockchain
55
+ - ✅ **Verifiable identity** - Contact provides cryptographic proof of who you're communicating with
56
+ - ✅ **WTS support** - Generate cryptographically verifiable conversation records for [Arbitration](arbitration.md) if needed
57
+
58
+ ---
59
+
60
+ ## Function List
61
+
62
+ | Function Name | Purpose | Usage Scenario | Significance |
63
+ |---------------|---------|----------------|-------------|
64
+ | **Create Contact** | Set up IM contact profile | Establish team communication, service support | Creates on-chain identity for [Messenger](messenger.md) encrypted messaging |
65
+ | **Manage IM List** | Add/remove contact entries | Update communication partners | Controls who can initiate encrypted conversations with you |
66
+ | **Set Status** | Update availability message | Indicate online presence, response times | Improves communication efficiency |
67
+ | **Enable Messenger** | Link Contact to encrypted messaging | Enable end-to-end encrypted chat | Foundation for secure private communication |
68
+ | **Service Integration** | Connect Contact to Service/Order | Allow customers to send private info | Enables secure exchange of shipping addresses, phone numbers, etc. |
69
+
70
+
71
+ ---
72
+
73
+ ## Schema Tree (4-Level Structure)
74
+
75
+ ```
76
+ Contact Component
77
+ ├── operation_type: "contact"
78
+ ├── data
79
+ │ ├── object
80
+ │ │ ├── Option 1: Name or Address (string)
81
+ │ │ │ └── [contact_name or contact_id]
82
+ │ │ └── Option 2: Named Object with Permission
83
+ │ │ ├── name (string, optional)
84
+ │ │ ├── tags (array of strings, optional)
85
+ │ │ ├── onChain (boolean, optional)
86
+ │ │ ├── replaceExistName (boolean, optional)
87
+ │ │ └── permission
88
+ │ │ ├── Option 1: Name or Address (string)
89
+ │ │ │ └── [permission_name or permission_id]
90
+ │ │ └── Option 2: Named Object with Description
91
+ │ │ ├── name (string, optional)
92
+ │ │ ├── tags (array of strings, optional)
93
+ │ │ ├── onChain (boolean, optional)
94
+ │ │ ├── replaceExistName (boolean, optional)
95
+ │ │ └── description (string, optional)
96
+ │ ├── my_status (string, optional)
97
+ │ ├── description (string, optional)
98
+ │ ├── location (string, optional)
99
+ │ ├── ims (optional)
100
+ │ │ ├── op: "add"
101
+ │ │ │ └── im (array)
102
+ │ │ │ ├── at (string)
103
+ │ │ │ └── description (string, optional) - max 256 bcs characters
104
+ │ │ ├── op: "set"
105
+ │ │ │ └── im (array)
106
+ │ │ │ ├── at (string)
107
+ │ │ │ └── description (string, optional) - max 256 bcs characters
108
+ │ │ ├── op: "remove"
109
+ │ │ │ └── im (array of strings)
110
+ │ │ ├── op: "clear"
111
+ │ ├── owner_receive (transfer received coins or NFT objects to owner, optional)
112
+ │ │ ├── Option 1: "recently" (string) - receive all recent objects
113
+ │ │ ├── Option 2: Array of received objects
114
+ │ │ │ └── [{ id: "object_id", type: "object_type" }]
115
+ │ │ └── Option 3: Received balance object
116
+ │ │ ├── balance (number or string)
117
+ │ │ ├── token_type (string)
118
+ │ │ └── received (array of received items)
119
+ ├── env (optional, execution environment)
120
+ │ ├── account (string, optional) - account name or address, empty string for default
121
+ │ ├── network (string, optional) - "testnet" or "localnet"
122
+ │ ├── permission_guard (array, optional) - list of permission guard IDs
123
+ │ ├── no_cache (boolean, optional) - disable caching
124
+ │ └── referrer (string, optional) - referrer ID
125
+ └── submission (optional, submission data)
126
+ ├── type (string) - fixed value "submission"
127
+ ├── guard (array) - list of guards to verify
128
+ │ └── [{ object: "guard_id", impack: boolean }]
129
+ └── submission (array) - submission data for guards
130
+ └── [{ guard: "guard_id", submission: [guard_submission_items] }]
131
+ └── guard_submission_items
132
+ ├── identifier (number, 0-255) - Guard table item identifier
133
+ ├── b_submission (boolean) - whether this item requires submission
134
+ ├── value_type (number | string) - value type (e.g., 6 or "U64" for U64 type)
135
+ ├── **value (any) - submitted value**
136
+ └── name (string, optional) - item name
137
+ ```
138
+
139
+ ---
140
+
141
+ ### ⚠️ Important Note About Submission
142
+
143
+ If the execution returns a `submission` field in the response, it indicates that additional Guard verification data is required. You must:
144
+
145
+ 1. Complete all required submission data within the `submission` structure
146
+ 2. Resubmit the operation with the completed submission data
147
+ 3. **Do not modify any other parts of the structure** - only fill in the required submission values
148
+
149
+ The submission structure will specify which Guard objects need verification and what data needs to be provided for each Guard table item.
150
+
151
+ **Query Value Types**: Use the `wowok_buildin_info` tool with `{ "info": "value types" }` to query all supported value types with their numeric and string representations. This helps you understand what `value_type` values are valid for submission data.
152
+
153
+ ---
154
+
155
+ ## Sub-function 1: Create New Contact
156
+
157
+ ### Function Description
158
+
159
+ Create a new Contact object for managing instant messaging contacts.
160
+
161
+ ### Parameter Description
162
+
163
+ | Parameter | Type | Required | Description | Constraints |
164
+ |-----------|------|----------|-------------|-------------|
165
+ | `object.name` | string | No | Local mark name | Max 64 BCS bytes, cannot start with "0x" |
166
+ | `object.id` | string | No | Object ID | 0x prefix + 64 hex characters |
167
+ | `object.permission` | string/object | No | Permission object | Can be existing permission ID/name, or new permission object |
168
+ | `description` | string | No | Contact object description or public information | Max 4000 BCS characters |
169
+ | `location` | string | No | Physical or virtual location of the Contact | Max 256 BCS characters |
170
+ | `ims` | object | No | IM contact operations | See description below |
171
+
172
+ ### Examples
173
+
174
+ #### Example 1.1: Create Simple Contact
175
+
176
+ **Prompt:** Create a new contact object named "service_support" with an existing permission, set description to "Customer support contact information", and location to "Online service".
177
+
178
+ ```json
179
+ {
180
+ "operation_type": "contact",
181
+ "data": {
182
+ "object": {
183
+ "name": "service_support",
184
+ "permission": "existing_permission"
185
+ },
186
+ "description": "Customer support contact information",
187
+ "location": "Online service"
188
+ }
189
+ }
190
+ ```
191
+
192
+ **Execution Result**:
193
+ ```json
194
+ {
195
+ "status": "success",
196
+ "object": "0xb607...190c",
197
+ "type": "Contact",
198
+ "version": "93060",
199
+ "change": "created"
200
+ }
201
+ ```
202
+
203
+ #### Example 1.2: Create Contact with New Permission
204
+
205
+ **Prompt:** Create a new contact named "team_contact", create a new permission object named "team_permission", set description to "Team contact information", and add "alice" with description "Product Manager" to the IM list.
206
+
207
+ ```json
208
+ {
209
+ "operation_type": "contact",
210
+ "data": {
211
+ "object": {
212
+ "name": "team_contact",
213
+ "permission": {
214
+ "name": "team_permission"
215
+ }
216
+ },
217
+ "description": "Team contact information",
218
+ "ims": {
219
+ "op": "add",
220
+ "im": [
221
+ {
222
+ "at": "alice",
223
+ "description": "Product Manager"
224
+ }
225
+ ]
226
+ }
227
+ }
228
+ }
229
+ ```
230
+
231
+ **Execution Result**:
232
+ ```json
233
+ {
234
+ "status": "success",
235
+ "object": "0x3c06...c965",
236
+ "type": "Contact",
237
+ "version": "93537",
238
+ "change": "created"
239
+ }
240
+ ```
241
+
242
+ ---
243
+
244
+ ## Sub-function 2: Manage IM Contact List (ims)
245
+
246
+ ### Function Description
247
+
248
+ Manage the Contact object's instant messaging contact list, supporting add, set, remove, and clear operations.
249
+
250
+ ### Parameter Description
251
+
252
+ | Parameter | Type | Required | Description |
253
+ |-----------|------|----------|-------------|
254
+ | `ims.op` | string | Yes | Operation type: add/set/remove/clear |
255
+ | `ims.im` | array | Required for add/set | IM contact list |
256
+ | `ims.im[].at` | string | Yes | Contact account address or name |
257
+ | `ims.im[].description` | string | No | Contact note or description | Max 256 BCS characters |
258
+
259
+ ### Constraints
260
+
261
+ ⚠️ **Maximum IM Contact Limit**: 200 contacts per Contact object.
262
+
263
+ ### Operation Type Description
264
+
265
+ | Operation Type | Description |
266
+ |----------------|-------------|
267
+ | `add` | Add new contacts to existing list |
268
+ | `set` | Replace entire contact list |
269
+ | `remove` | Remove specified contacts (use address or name) |
270
+ | `clear` | Clear all contacts |
271
+
272
+ ### Important Notes
273
+
274
+ ⚠️ **my_status is only valid when your account is already in the IM list**.
275
+
276
+ ### Examples
277
+
278
+ #### Example 2.1: Add Contacts
279
+
280
+ **Prompt:** Use the existing contact "service_support" and add a new contact: "testuser1" with description "Technical Support".
281
+
282
+ ```json
283
+ {
284
+ "operation_type": "contact",
285
+ "data": {
286
+ "object": "service_support",
287
+ "ims": {
288
+ "op": "add",
289
+ "im": [
290
+ {
291
+ "at": "testuser1",
292
+ "description": "Technical Support"
293
+ }
294
+ ]
295
+ }
296
+ }
297
+ }
298
+ ```
299
+
300
+ **Execution Result**:
301
+ ```json
302
+ {
303
+ "status": "success",
304
+ "object": "0xb607...190c",
305
+ "type": "Contact",
306
+ "version": "94028",
307
+ "change": "mutated"
308
+ }
309
+ ```
310
+
311
+ #### Example 2.2: Set Contact List (Replace)
312
+
313
+ **Prompt:** Use the existing contact "team_contact" and replace the entire IM list with "alice" (description: "Designer") and "testuser1" (description: "Developer").
314
+
315
+ ```json
316
+ {
317
+ "operation_type": "contact",
318
+ "data": {
319
+ "object": "team_contact",
320
+ "ims": {
321
+ "op": "set",
322
+ "im": [
323
+ {
324
+ "at": "alice",
325
+ "description": "Designer"
326
+ },
327
+ {
328
+ "at": "testuser1",
329
+ "description": "Developer"
330
+ }
331
+ ]
332
+ }
333
+ }
334
+ }
335
+ ```
336
+
337
+ **Execution Result**:
338
+ ```json
339
+ {
340
+ "status": "success",
341
+ "object": "0x3c06...c965",
342
+ "type": "Contact",
343
+ "version": "94531",
344
+ "change": "mutated"
345
+ }
346
+ ```
347
+
348
+ #### Example 2.3: Remove Contacts
349
+
350
+ **Prompt:** Use the existing contact "service_support" and remove the contact named "testuser1" from the IM list.
351
+
352
+ ```json
353
+ {
354
+ "operation_type": "contact",
355
+ "data": {
356
+ "object": "service_support",
357
+ "ims": {
358
+ "op": "remove",
359
+ "im": ["testuser1"]
360
+ }
361
+ }
362
+ }
363
+ ```
364
+
365
+ **Execution Result**:
366
+ ```json
367
+ {
368
+ "status": "success",
369
+ "object": "0xb607...190c",
370
+ "type": "Contact",
371
+ "version": "94532",
372
+ "change": "mutated"
373
+ }
374
+ ```
375
+
376
+ #### Example 2.4: Clear Contacts
377
+
378
+ **Prompt:** Use the existing contact "team_contact" and clear all contacts from the IM list.
379
+
380
+ ```json
381
+ {
382
+ "operation_type": "contact",
383
+ "data": {
384
+ "object": "team_contact",
385
+ "ims": {
386
+ "op": "clear"
387
+ }
388
+ }
389
+ }
390
+ ```
391
+
392
+ **Execution Result**:
393
+ ```json
394
+ {
395
+ "status": "success",
396
+ "object": "0x3c06...c965",
397
+ "type": "Contact",
398
+ "version": "94533",
399
+ "change": "mutated"
400
+ }
401
+ ```
402
+
403
+ ---
404
+
405
+ ## Sub-function 3: Set Personal Status (my_status)
406
+
407
+ ### Function Description
408
+
409
+ Set your status message in this contact list.
410
+
411
+ ### Parameter Description
412
+
413
+ | Parameter | Type | Required | Description | Constraints |
414
+ |-----------|------|----------|-------------|-------------|
415
+ | `my_status` | string | Yes | Status message | Max 64 BCS bytes, cannot start with "0x" |
416
+
417
+ ### Important Notes
418
+
419
+ ⚠️ **Only valid when your account is already in the IM list**.
420
+
421
+ ### Example
422
+
423
+ **Prompt:** Use the existing contact "service_support" and set your personal status to "Online, available for contact".
424
+
425
+ ```json
426
+ {
427
+ "operation_type": "contact",
428
+ "data": {
429
+ "object": "service_support",
430
+ "my_status": "Online, available for contact"
431
+ }
432
+ }
433
+ ```
434
+
435
+ **Execution Result**:
436
+ ```json
437
+ {
438
+ "status": "success",
439
+ "object": "0xb607...190c",
440
+ "type": "Contact",
441
+ "version": "95965",
442
+ "change": "mutated"
443
+ }
444
+ ```
445
+
446
+ ---
447
+
448
+ ## Sub-function 4: Receive Objects (owner_receive)
449
+
450
+ ### Function Description
451
+
452
+ Receive objects sent to this Contact object and unwrap them to send to the permission owner.
453
+
454
+ This function allows the Contact object owner to receive objects (including CoinWrapper from Payment) that were sent to the Contact object address.
455
+
456
+ ### Parameter Description
457
+
458
+ | Parameter | Type | Required | Description |
459
+ |-----------|------|----------|-------------|
460
+ | `owner_receive` | string or array | Yes | Receive configuration: "recently" to receive all recent objects, or array of received object IDs |
461
+
462
+ ### Important Notes
463
+
464
+ ⚠️ **The Contact object must have a Permission object associated with it** to use owner_receive.
465
+
466
+ ⚠️ **Only the Permission owner can execute owner_receive**.
467
+
468
+ ### Examples
469
+
470
+ #### Example 4.1: Receive All Recently Received Objects
471
+
472
+ **Prerequisites**: Before receiving objects, you need to send a Payment to the Contact object. Here are the steps:
473
+
474
+ **Step 1**: Create a Contact object
475
+
476
+ ```json
477
+ {
478
+ "operation_type": "contact",
479
+ "data": {
480
+ "object": {
481
+ "name": "contact_receive_test_v3"
482
+ },
483
+ "description": "Contact for testing owner receive functionality"
484
+ }
485
+ }
486
+ ```
487
+
488
+ **Step 2**: Send a Payment to the Contact object
489
+
490
+ ```json
491
+ {
492
+ "operation_type": "payment",
493
+ "data": {
494
+ "object": {
495
+ "name": "payment_to_contact_v3"
496
+ },
497
+ "revenue": [
498
+ {
499
+ "recipient": {
500
+ "name_or_address": "contact_receive_test_v3"
501
+ },
502
+ "amount": {
503
+ "balance": 1000000000
504
+ }
505
+ }
506
+ ],
507
+ "info": {
508
+ "remark": "Test payment to contact",
509
+ "index": 11
510
+ }
511
+ }
512
+ }
513
+ ```
514
+
515
+ **Step 3**: Receive the objects from the Contact object
516
+
517
+ **Prompt:** Use the existing contact "contact_receive_test_v3" and receive all recently sent objects.
518
+
519
+ ```json
520
+ {
521
+ "operation_type": "contact",
522
+ "data": {
523
+ "object": "contact_receive_test_v3",
524
+ "owner_receive": "recently"
525
+ }
526
+ }
527
+ ```
528
+
529
+ **Execution Result**:
530
+ ```json
531
+ {
532
+ "status": "success",
533
+ "object": "0xaee9...1db7",
534
+ "type": "Contact",
535
+ "version": "14541",
536
+ "change": "mutated"
537
+ }
538
+ ```
539
+
540
+ #### Example 4.2: Receive Specific Objects
541
+
542
+ **Prompt:** Use the existing contact "contact_receive_test_v3" and receive specific objects by their IDs.
543
+
544
+ ```json
545
+ {
546
+ "operation_type": "contact",
547
+ "data": {
548
+ "object": "contact_receive_test_v3",
549
+ "owner_receive": [
550
+ {
551
+ "id": "0xaee9b75f7903d05dbfb4ee2abe9e036503c66f4bc552d835543b9b49d3851db7",
552
+ "type": "0x2::payment::CoinWrapper<0x2::wow::WOW>"
553
+ }
554
+ ]
555
+ }
556
+ }
557
+ ```
558
+
559
+ **Execution Result**:
560
+ ```json
561
+ {
562
+ "status": "success",
563
+ "object": "0xaee9...1db7",
564
+ "type": "Contact",
565
+ "version": "14542",
566
+ "change": "mutated"
567
+ }
568
+ ```
569
+
570
+ ---
571
+
572
+ ## Sub-function 5: Combined Operations
573
+
574
+ ### Function Description
575
+
576
+ Execute multiple operations in a single call.
577
+
578
+ ### Example
579
+
580
+ #### Example 5.1: Create Contact and Add Contacts
581
+
582
+ **Prompt:** Create a new contact named "customer_service" with existing permission "service_permission", set description to "Customer service team contact information", set location to "7x24 Online Support", add "alice" (Pre-sales Consulting) and "testuser1" (After-sales Support) to IM list.
583
+
584
+ ```json
585
+ {
586
+ "operation_type": "contact",
587
+ "data": {
588
+ "object": {
589
+ "name": "customer_service",
590
+ "permission": "service_permission"
591
+ },
592
+ "description": "Customer service team contact information",
593
+ "location": "7x24 Online Support",
594
+ "ims": {
595
+ "op": "add",
596
+ "im": [
597
+ {
598
+ "at": "alice",
599
+ "description": "Pre-sales Consulting"
600
+ },
601
+ {
602
+ "at": "testuser1",
603
+ "description": "After-sales Support"
604
+ }
605
+ ]
606
+ }
607
+ }
608
+ }
609
+ ```
610
+
611
+ **Execution Result**:
612
+ ```json
613
+ {
614
+ "status": "success",
615
+ "object": "0x7a22...080b",
616
+ "type": "Contact",
617
+ "version": "96881",
618
+ "change": "created"
619
+ }
620
+ ```
621
+
622
+ ---
623
+
624
+ ## Contact + Messenger Integration Guide
625
+
626
+ ### Step 1: Create Your Contact Object
627
+
628
+ Create a Contact object that will serve as your public identity for secure messaging.
629
+
630
+ ```json
631
+ {
632
+ "operation_type": "contact",
633
+ "data": {
634
+ "object": {
635
+ "name": "my_contact",
636
+ "onChain": true
637
+ },
638
+ "description": "My secure contact for encrypted messaging"
639
+ }
640
+ }
641
+ ```
642
+
643
+ ### Step 2: Enable Messenger for Your Account
644
+
645
+ Use the [account operation](account.md) to enable Messenger for your account, linking it to your Contact object:
646
+
647
+ ```json
648
+ {
649
+ "operation": "account_operation",
650
+ "account": "my_account",
651
+ "messenger": "my_contact"
652
+ }
653
+ ```
654
+
655
+ See [account.md](account.md) for detailed messenger configuration.
656
+
657
+ ### Step 3: Start Secure Conversations
658
+
659
+ Once Messenger is enabled, you can send encrypted messages to any Contact object:
660
+
661
+ ```json
662
+ {
663
+ "operation": "send_message",
664
+ "from": "my_account",
665
+ "to": "recipient_contact",
666
+ "content": "Hello! This message is end-to-end encrypted."
667
+ }
668
+ ```
669
+
670
+ See [Messenger Documentation](messenger.md) for full messaging capabilities.
671
+
672
+ ### Step 4: Use Contact in Service/Order (For Private Information Exchange)
673
+
674
+ When purchasing from a Service that requires private information:
675
+
676
+ **For Customers:**
677
+ 1. Attach your Contact to the order via `required_info` field (see [Order](order.md#function-2-set-required-information-required_info))
678
+ 2. Use Messenger to send shipping address, phone number, etc. to the service's Contact
679
+
680
+ **For Service Providers:**
681
+ 1. Configure your Service with a Contact object (see [Service](service.md#sub-feature-7-configure-contact-um))
682
+ 2. Customers will use this Contact to send you encrypted private information
683
+
684
+ ---
685
+
686
+ ## Important Notes
687
+
688
+ ⚠️ **my_status is only valid when your account is already in the IM list**.
689
+
690
+ ⚠️ **Contact information is publicly visible on-chain**, please set carefully. Never include sensitive personal information in the Contact description or location fields.
691
+
692
+ ⚠️ **Messenger encryption**: While your Contact identity is public, all messages sent via Messenger are **end-to-end encrypted** and **never stored on-chain**. Only conversation participants can read the message content.
693
+
694
+ ⚠️ **WTS for Arbitration**: If you need to prove what was discussed in a conversation (e.g., for dispute resolution), use [Messenger's WTS feature](messenger.md#example-7-generate-wts) to create a cryptographically verifiable record.
695
+
696
+ ---
697
+
698
+ ## Related Components
699
+
700
+ | Component | Description |
701
+ |-----------|-------------|
702
+ | **[Service](service.md)** | WYSIWYG product trading - uses Contact for secure customer communication |
703
+ | **[Order](order.md)** | Order management - uses `required_info` field for private information exchange |
704
+ | **[Messenger](messenger.md)** | Secure end-to-end encrypted chat system |
705
+ | **[Account](account.md)** | Account management - includes Messenger enablement |
706
+ | **[Personal](personal.md)** | Personal on-chain portal |
707
+ | **[LocalInfo](localinfo.md)** | Private information management |
708
+ | **[Permission](permission.md)** | Permission management |
709
+ | **[Arbitration](arbitration.md)** | Dispute resolution - can use WTS from Messenger as evidence |