@wowok/agent-mcp 2.2.13 → 2.2.14

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 (126) hide show
  1. package/dist/index.js +42 -98
  2. package/dist/schema-query/index.d.ts +29 -0
  3. package/dist/schema-query/index.js +149 -0
  4. package/dist/schemas/account_operation.schema.json +255 -0
  5. package/dist/schemas/guard2file.schema.json +71 -0
  6. package/dist/schemas/index.json +139 -0
  7. package/dist/schemas/local_info_operation.schema.json +142 -0
  8. package/dist/schemas/local_mark_operation.schema.json +119 -0
  9. package/dist/schemas/machineNode2file.schema.json +71 -0
  10. package/dist/schemas/messenger_operation.schema.json +1393 -0
  11. package/dist/schemas/onchain_events.schema.json +113 -0
  12. package/dist/schemas/onchain_operations.schema.json +376 -0
  13. package/dist/schemas/onchain_operations_allocation.schema.json +914 -0
  14. package/dist/schemas/onchain_operations_arbitration.schema.json +1166 -0
  15. package/dist/schemas/onchain_operations_contact.schema.json +853 -0
  16. package/dist/schemas/onchain_operations_demand.schema.json +984 -0
  17. package/dist/schemas/onchain_operations_gen_passport.schema.json +1141 -0
  18. package/dist/schemas/onchain_operations_guard.schema.json +713 -0
  19. package/dist/schemas/onchain_operations_machine.schema.json +1347 -0
  20. package/dist/schemas/onchain_operations_order.schema.json +830 -0
  21. package/dist/schemas/onchain_operations_payment.schema.json +717 -0
  22. package/dist/schemas/onchain_operations_permission.schema.json +1088 -0
  23. package/dist/schemas/onchain_operations_personal.schema.json +1282 -0
  24. package/dist/schemas/onchain_operations_progress.schema.json +751 -0
  25. package/dist/schemas/onchain_operations_repository.schema.json +1572 -0
  26. package/dist/schemas/onchain_operations_reward.schema.json +955 -0
  27. package/dist/schemas/onchain_operations_service.schema.json +1411 -0
  28. package/dist/schemas/onchain_operations_treasury.schema.json +1155 -0
  29. package/dist/schemas/onchain_table_data.schema.json +35 -0
  30. package/dist/schemas/operations/guard.json +163 -0
  31. package/dist/schemas/operations/permission.json +22 -0
  32. package/dist/schemas/query_toolkit.schema.json +32 -0
  33. package/dist/schemas/schema_query.schema.json +33 -0
  34. package/dist/schemas/wip_file.schema.json +27 -0
  35. package/dist/schemas/wowok_buildin_info.schema.json +487 -0
  36. package/package.json +7 -5
  37. package/dist/docs/index.d.ts +0 -3
  38. package/dist/docs/index.js +0 -2
  39. package/dist/docs/loader.d.ts +0 -12
  40. package/dist/docs/loader.js +0 -177
  41. package/dist/docs/search.d.ts +0 -17
  42. package/dist/docs/search.js +0 -325
  43. package/dist/docs/types.d.ts +0 -55
  44. package/dist/docs/types.js +0 -1
  45. package/docs/README.md +0 -249
  46. package/docs/WIP.md +0 -388
  47. package/docs/WTS.md +0 -536
  48. package/docs/docs/account.md +0 -914
  49. package/docs/docs/allocation.md +0 -635
  50. package/docs/docs/arbitration.md +0 -1804
  51. package/docs/docs/arbitration_state_machine.md +0 -270
  52. package/docs/docs/contact.md +0 -709
  53. package/docs/docs/demand.md +0 -948
  54. package/docs/docs/guard.md +0 -1465
  55. package/docs/docs/localinfo.md +0 -432
  56. package/docs/docs/localmark.md +0 -583
  57. package/docs/docs/machine.md +0 -2490
  58. package/docs/docs/messenger.md +0 -2098
  59. package/docs/docs/onchain_events.md +0 -267
  60. package/docs/docs/order.md +0 -1001
  61. package/docs/docs/payment.md +0 -512
  62. package/docs/docs/permission.md +0 -1438
  63. package/docs/docs/personal.md +0 -742
  64. package/docs/docs/progress.md +0 -1748
  65. package/docs/docs/query.md +0 -467
  66. package/docs/docs/repository.md +0 -1043
  67. package/docs/docs/reward.md +0 -833
  68. package/docs/docs/service.md +0 -2130
  69. package/docs/docs/stage-01-introduction.md +0 -243
  70. package/docs/docs/stage-02-trust.md +0 -302
  71. package/docs/docs/stage-03-collaboration.md +0 -337
  72. package/docs/docs/stage-04-transaction.md +0 -277
  73. package/docs/docs/stage-05-business.md +0 -151
  74. package/docs/docs/stage-06-personal.md +0 -203
  75. package/docs/docs/stage-07-query.md +0 -572
  76. package/docs/docs/stage-08-examples.md +0 -184
  77. package/docs/docs/treasury.md +0 -1149
  78. package/docs/docs/wowok_buildin_info.md +0 -740
  79. package/docs/examples/Insurance/Insurance.md +0 -594
  80. package/docs/examples/Insurance/Insurance_TestResults.md +0 -481
  81. package/docs/examples/Insurance/insurance_complete_guard_v1.json +0 -50
  82. package/docs/examples/MyShop/MyShop.md +0 -1353
  83. package/docs/examples/MyShop/MyShop_TestResults.md +0 -1003
  84. package/docs/examples/MyShop_Advanced/MyShop_Advanced.md +0 -1898
  85. package/docs/examples/MyShop_Advanced/MyShop_Advanced_MerchantSystem_TestResults.md +0 -1297
  86. package/docs/examples/MyShop_Advanced/MyShop_Advanced_OrderFlow_TestResults.md +0 -743
  87. package/docs/examples/MyShop_Advanced/machine_nodes.json +0 -222
  88. package/docs/examples/ThreeBody_Signature/ThreeBody_Signature.md +0 -776
  89. package/docs/examples/ThreeBody_Signature/ThreeBody_Signature_TestResults.md +0 -599
  90. package/docs/examples/Travel/Travel.md +0 -1157
  91. package/docs/examples/Travel/Travel_TestResults.md +0 -743
  92. package/docs/examples/Travel/calc-weather-timestamps.js +0 -8
  93. package/docs/examples/Travel/travel_machine_v2_export.json +0 -104
  94. package/docs/examples/Travel/weather_check_guard_v1.json +0 -51
  95. package/docs/skills/WOWOK.md +0 -650
  96. package/docs/skills/onchain_operations/_common.md +0 -406
  97. package/docs/skills/onchain_operations/_index.md +0 -196
  98. package/docs/skills/onchain_operations/allocation.md +0 -28
  99. package/docs/skills/onchain_operations/arbitration.md +0 -106
  100. package/docs/skills/onchain_operations/contact.md +0 -40
  101. package/docs/skills/onchain_operations/demand.md +0 -53
  102. package/docs/skills/onchain_operations/gen_passport.md +0 -23
  103. package/docs/skills/onchain_operations/guard.md +0 -56
  104. package/docs/skills/onchain_operations/machine.md +0 -89
  105. package/docs/skills/onchain_operations/order.md +0 -56
  106. package/docs/skills/onchain_operations/payment.md +0 -24
  107. package/docs/skills/onchain_operations/permission.md +0 -68
  108. package/docs/skills/onchain_operations/personal.md +0 -58
  109. package/docs/skills/onchain_operations/progress.md +0 -38
  110. package/docs/skills/onchain_operations/repository.md +0 -70
  111. package/docs/skills/onchain_operations/reward.md +0 -38
  112. package/docs/skills/onchain_operations/service.md +0 -78
  113. package/docs/skills/onchain_operations/treasury.md +0 -68
  114. package/docs/skills/schema-account_operation.md +0 -402
  115. package/docs/skills/schema-guard2file.md +0 -153
  116. package/docs/skills/schema-local_info_operation.md +0 -160
  117. package/docs/skills/schema-local_mark_operation.md +0 -148
  118. package/docs/skills/schema-machineNode2file.md +0 -155
  119. package/docs/skills/schema-messenger_operation.md +0 -547
  120. package/docs/skills/schema-onchain_events.md +0 -201
  121. package/docs/skills/schema-onchain_table_data.md +0 -334
  122. package/docs/skills/schema-query_toolkit.md +0 -395
  123. package/docs/skills/schema-wip_file.md +0 -240
  124. package/docs/skills/schema-wowok_buildin_info.md +0 -296
  125. package/docs/wip-examples/three_body.html +0 -57
  126. package/docs/wip-examples/three_body.wip +0 -30
@@ -1,914 +0,0 @@
1
- # Account Component (🔒 Wallet Management)
2
-
3
- ---
4
-
5
- ## Component Overview
6
-
7
- The Account component manages local wallets, all operations are stored exclusively on the local device. Users can use names to reference and operate on corresponding accounts.
8
-
9
- > **Note**: Use the `watch_and_query` tool to query all or filtered accounts.
10
-
11
- ---
12
-
13
- ## Function List
14
-
15
- | Function Name | Purpose | Usage Scenario | Significance |
16
- |---------------|---------|----------------|-------------|
17
- | **Generate Account** | Create new wallet accounts | Set up new identities, team members | Foundation for all wallet operations |
18
- | **Get Test Coins** | Fund accounts for testing | Development, testing on testnet | Enables on-chain testing without real funds |
19
- | **Suspend Account** | Disable account temporarily | Security, account management | Prevents unauthorized transactions |
20
- | **Resume Account** | Reactivate suspended accounts | Restore access, account recovery | Regains control of suspended accounts |
21
- | **Rename Account** | Change account identifier | Organization, name changes | Keeps accounts manageable and identifiable |
22
- | **Swap Names** | Exchange identifiers between accounts | Team restructuring, role changes | Flexible account management |
23
- | **Transfer Tokens** | Send funds between accounts | Payments, settlements | Core transaction functionality |
24
- | **Query Account** | Get balance and coin objects | Prepare transactions, check funds | Ensures sufficient balance for operations |
25
- | **Sign Data** | Cryptographically sign messages | Transaction authorization, proofs | Enables secure on-chain operations |
26
- | **Messenger Config** | Enable/disable encrypted messaging | Communication, team coordination | Integrates wallet with messaging |
27
-
28
- ---
29
-
30
- ## Complete Tool Call Structure
31
-
32
-
33
- ```json
34
- {
35
- "gen": { ... }, // Generate new account
36
- "faucet": { ... }, // Get test coins
37
- "suspend": { ... }, // Suspend account
38
- "resume": { ... }, // Resume account
39
- "rename": { ... }, // Rename account
40
- "swap_name": { ... }, // Swap account names
41
- "transfer": { ... }, // Transfer tokens
42
- "get": { ... }, // Query account/get coin object
43
- "signData": { ... }, // Sign data
44
- "messenger": { ... } // Enable/disable messenger
45
- }
46
- ```
47
-
48
- ---
49
-
50
- ## Sub-feature 1: Generate New Account (gen)
51
-
52
- ### Feature Description
53
-
54
- Generate a new WoWok account, optionally specifying a name, whether to replace an existing name, and whether to enable messenger.
55
-
56
- ### Parameter Description
57
-
58
- | Parameter Name | Type | Required | Description | Constraints |
59
- |----------------|------|----------|-------------|-------------|
60
- | `name` | string | No | Account name | Max 64 BCS characters, cannot start with '0x'. Omit or empty string uses default account |
61
- | `replaceExistName` | boolean | No | Whether to replace existing name | true=replace; false=error if name exists (default) |
62
- | `m` | string | null | No | Messenger name | Max 64 BCS characters. null=disable messenger; omit=no change |
63
-
64
- ### Return Result
65
-
66
- ```json
67
- {
68
- "gen": {
69
- "address": "0x1234...abcd",
70
- "name": "my_account",
71
- "m": "my_messenger"
72
- }
73
- }
74
- ```
75
-
76
- ---
77
-
78
- ### Examples
79
-
80
- #### Example 1.1: Generate Default Account (No Name)
81
-
82
- **Prompt**: Generate a new account without specifying a name. This will create a default account without any custom name. The account will be stored locally on your device.
83
-
84
- ```json
85
- { "gen": {} }
86
- ```
87
-
88
- **Execution Result**:
89
- ```json
90
- {
91
- "gen": {
92
- "address": "0xd836...d681",
93
- "name": ""
94
- }
95
- }
96
- ```
97
-
98
- #### Example 1.2: Generate Account with Name (Alice)
99
-
100
- **Prompt**: Generate a new account with the name "alice". Do not replace an existing name if it already exists - this will throw an error if the name is already taken.
101
-
102
- ```json
103
- { "gen": { "name": "alice" } }
104
- ```
105
-
106
- **Execution Result**:
107
- ```json
108
- {
109
- "gen": {
110
- "address": "0x0596...4b7d",
111
- "name": "alice"
112
- }
113
- }
114
- ```
115
-
116
- #### Example 1.3: Generate Account with Name (Bob)
117
-
118
- **Prompt**: Generate a new account with the name "bob".
119
-
120
- ```json
121
- { "gen": { "name": "bob" } }
122
- ```
123
-
124
- **Execution Result**:
125
- ```json
126
- {
127
- "gen": {
128
- "address": "0x56bf...b5d7",
129
- "name": "bob",
130
- "m": "bob_messenger"
131
- }
132
- }
133
- ```
134
-
135
- #### Example 1.4: Generate Account with Name (Grace)
136
-
137
- **Prompt**: Generate a new account with the name "grace".
138
-
139
- ```json
140
- { "gen": { "name": "grace" } }
141
- ```
142
-
143
- **Execution Result**:
144
- ```json
145
- {
146
- "gen": {
147
- "address": "0xbc11...b0b0",
148
- "name": "grace"
149
- }
150
- }
151
- ```
152
-
153
- #### Example 1.5: Generate Account and Enable Messenger
154
-
155
- **Prompt**: Generate a new account with the name "test_messenger" and enable messenger functionality with the messenger name "my_messenger". This account will be ready for encrypted messaging.
156
-
157
- ```json
158
- { "gen": { "name": "test_messenger", "m": "my_messenger" } }
159
- ```
160
-
161
- **Execution Result**:
162
- ```json
163
- {
164
- "gen": {
165
- "address": "0xb580...f4f4",
166
- "name": "test_messenger",
167
- "m": "my_messenger"
168
- }
169
- }
170
- ```
171
-
172
- #### Example 1.6: Generate Account with Replace Existing Name
173
-
174
- **Prompt**: Generate a new account with the name "alice", and if this name already exists, replace the existing name assignment. This ensures the new account gets the name even if it was previously used.
175
-
176
- ```json
177
- { "gen": { "name": "alice", "replaceExistName": true } }
178
- ```
179
- ```
180
-
181
- ---
182
-
183
- ## Sub-feature 2: Get Test Coins (faucet)
184
-
185
- ### Feature Description
186
-
187
- Get test coins from the faucet to a specified account. Only supports localnet and testnet networks.
188
-
189
- ### Parameter Description
190
-
191
- | Parameter Name | Type | Required | Description | Constraints |
192
- |----------------|------|----------|-------------|-------------|
193
- | `name_or_address` | string | No | Account name or address | Empty string '' uses default account |
194
- | `network` | enum | Yes | Network type | "localnet" or "testnet" |
195
-
196
- ### Return Result
197
-
198
- ```json
199
- {
200
- "faucet": {
201
- "name_or_address": "my_account",
202
- "result": [
203
- { "amount": 10000000000, "id": "0x...", "transferTxDigest": "0x..." }
204
- ],
205
- "network": "testnet"
206
- }
207
- }
208
- ```
209
-
210
- ---
211
-
212
- ### Examples
213
-
214
- #### Example 2.1: Get Test Coins for Default Account (testnet)
215
-
216
- **Prompt**: Get test coins from the faucet for the default account on the testnet network. This will distribute test tokens to your default wallet for testing purposes.
217
-
218
- ```json
219
- { "faucet": { "network": "testnet" } }
220
- ```
221
-
222
- **Execution Result**:
223
- ```json
224
- {
225
- "faucet": {
226
- "network": "testnet",
227
- "result": [
228
- { "amount": 1000000000, "id": "0x0a74...f9b0", "transferTxDigest": "83Xaah4ArwMa8xMGDQbTDTe4W4m8gwjpYXJgTDFG3BY5" }
229
- ]
230
- }
231
- }
232
- ```
233
-
234
- #### Example 2.2: Get Test Coins for Named Account
235
-
236
- **Prompt**: Get test coins from the faucet for the account named "bob" on the testnet network. This is useful when you want to fund a specific named account instead of the default one.
237
-
238
- ```json
239
- { "faucet": { "name_or_address": "bob", "network": "testnet" } }
240
- ```
241
-
242
- **Execution Result**:
243
- ```json
244
- {
245
- "faucet": {
246
- "name_or_address": "bob",
247
- "network": "testnet",
248
- "result": [
249
- { "amount": 1000000000, "id": "0x0a74...f9b0", "transferTxDigest": "83Xaah4ArwMa8xMGDQbTDTe4W4m8gwjpYXJgTDFG3BY5" }
250
- ]
251
- }
252
- }
253
- ```
254
-
255
- #### Example 2.3: Get Test Coins for Named Account (Charlie)
256
-
257
- **Prompt**: Get test coins from the faucet for the account named "charlie" on the testnet network.
258
-
259
- ```json
260
- { "faucet": { "name_or_address": "charlie", "network": "testnet" } }
261
- ```
262
-
263
- **Execution Result**:
264
- ```json
265
- {
266
- "faucet": {
267
- "name_or_address": "charlie",
268
- "network": "testnet",
269
- "result": [
270
- { "amount": 1000000000, "id": "0x1849...fda8", "transferTxDigest": "13f1D7WRXm4zPUP2GhuQXe5MkMfMcUJumBsKnpV3eDnq" }
271
- ]
272
- }
273
- }
274
- ```
275
-
276
- ---
277
-
278
- ## Sub-feature 3: Suspend Account (suspend)
279
-
280
- ### Feature Description
281
-
282
- Remove an account from the active account list. After suspension, the account cannot sign transactions, and its name is deleted.
283
-
284
- ### Parameter Description
285
-
286
- | Parameter Name | Type | Required | Description | Constraints |
287
- |----------------|------|----------|-------------|-------------|
288
- | `name_or_address` | string | No | Account name or address | Empty string '' uses default account |
289
-
290
- ### Return Result
291
-
292
- ```json
293
- {
294
- "suspend": {
295
- "name_or_address": "my_account",
296
- "success": true
297
- }
298
- }
299
- ```
300
-
301
- ---
302
-
303
- ### Examples
304
-
305
- #### Example 3.1: Suspend Default Account
306
-
307
- **Prompt**: Suspend the default account. This will remove it from the active accounts list and delete any name associated with it. The account will no longer be able to sign transactions.
308
-
309
- ```json
310
- { "suspend": {"name_or_address": "" } }
311
- ```
312
-
313
- **Execution Result**:
314
- ```json
315
- {
316
- "suspend": {
317
- "name_or_address": "",
318
- "success": true
319
- }
320
- }
321
- ```
322
-
323
- #### Example 3.2: Suspend Named Account (Grace)
324
-
325
- **Prompt**: Suspend the account named "grace". This will remove it from active accounts, delete its name, and prevent it from signing transactions.
326
-
327
- ```json
328
- { "suspend": { "name_or_address": "grace" } }
329
- ```
330
-
331
- **Execution Result**:
332
- ```json
333
- {
334
- "suspend": {
335
- "name_or_address": "grace",
336
- "success": true
337
- }
338
- }
339
- ```
340
-
341
- #### Example 3.3: Suspend Named Account (Eve)
342
-
343
- **Prompt**: Suspend the account named "eve". This will remove it from active accounts.
344
-
345
- ```json
346
- { "suspend": { "name_or_address": "eve" } }
347
- ```
348
-
349
- **Execution Result**:
350
- ```json
351
- {
352
- "suspend": {
353
- "name_or_address": "eve",
354
- "success": true
355
- }
356
- }
357
- ```
358
- ```
359
-
360
- ---
361
-
362
- ## Sub-feature 4: Resume Account (resume)
363
-
364
- ### Feature Description
365
-
366
- Add a suspended account back to the active account list, optionally specifying a new name.
367
-
368
- ### Parameter Description
369
-
370
- | Parameter Name | Type | Required | Description | Constraints |
371
- |----------------|------|----------|-------------|-------------|
372
- | `address` | string | Yes | Account address | Format: 0x + 64 hex characters |
373
- | `name` | string | No | New name | Max 64 BCS characters, cannot start with '0x' |
374
-
375
- ### Return Result
376
-
377
- ```json
378
- {
379
- "resume": {
380
- "address": "0x1234...abcd",
381
- "name": "my_account",
382
- "success": true
383
- }
384
- }
385
- ```
386
-
387
- ---
388
-
389
- ### Examples
390
-
391
- #### Example 4.1: Resume Account with New Name
392
-
393
- **Prompt**: Resume the account with address "0xbe60...a7c7" and assign it the new name "resumed_account". This will add the account back to active accounts with the specified name.
394
-
395
- ```json
396
- { "resume": { "address": "0xbe60d74b6a4e3e42d3959a48e5a01ce2896a5384efa75e38a7fba89fe50aa7c7", "name": "resumed_account" } }
397
- ```
398
-
399
- **Execution Result**:
400
- ```json
401
- {
402
- "resume": {
403
- "address": "0xbe60d74b6a4e3e42d3959a48e5a01ce2896a5384efa75e38a7fba89fe50aa7c7",
404
- "name": "resumed_account",
405
- "success": true
406
- }
407
- }
408
- ```
409
-
410
- #### Example 4.2: Resume Account with New Name (Second Account)
411
-
412
- **Prompt**: Resume the account with address "0xd903...34a2" and assign it the new name "resumed_acc2".
413
-
414
- ```json
415
- { "resume": { "address": "0xd903a1b6f06b01f7f47d7bad8a9cea94054e6882daf85ed2c6d0fc2e859434a2", "name": "resumed_acc2" } }
416
- ```
417
-
418
- **Execution Result**:
419
- ```json
420
- {
421
- "resume": {
422
- "address": "0xd903a1b6f06b01f7f47d7bad8a9cea94054e6882daf85ed2c6d0fc2e859434a2",
423
- "name": "resumed_acc2",
424
- "success": true
425
- }
426
- }
427
- ```
428
- ```
429
-
430
- ---
431
-
432
- ## Sub-feature 5: Rename Account (rename)
433
-
434
- ### Feature Description
435
-
436
- Change an account's name. If the new name already exists, an error will be thrown.
437
-
438
- ### Parameter Description
439
-
440
- | Parameter Name | Type | Required | Description | Constraints |
441
- |----------------|------|----------|-------------|-------------|
442
- | `name_or_address` | string | No | Original account name or address | Empty string '' uses default account |
443
- | `new_name` | string | Yes | New account name | Max 64 BCS characters, cannot start with '0x' |
444
-
445
- ### Return Result
446
-
447
- ```json
448
- {
449
- "rename": {
450
- "name_or_address": "old_name",
451
- "new_name": "new_name",
452
- "success": true
453
- }
454
- }
455
- ```
456
-
457
- ---
458
-
459
- ### Examples
460
-
461
- #### Example 5.1: Rename Default Account
462
-
463
- **Prompt**: Rename the default account to "alice2". This will assign the new name to the default account that was previously unnamed or had a different name.
464
-
465
- ```json
466
- { "rename": { "new_name": "alice2" } }
467
- ```
468
-
469
- **Execution Result**:
470
- ```json
471
- {
472
- "rename": {
473
- "new_name": "alice2",
474
- "success": true
475
- }
476
- }
477
- ```
478
-
479
- #### Example 5.2: Rename by Name
480
-
481
- **Prompt**: Rename the account currently named "alice2" to "alice3". This operation will fail if "alice3" is already being used by another account.
482
-
483
- ```json
484
- { "rename": { "name_or_address": "alice2", "new_name": "alice3" } }
485
- ```
486
-
487
- **Execution Result**:
488
- ```json
489
- {
490
- "rename": {
491
- "name_or_address": "alice2",
492
- "new_name": "alice3",
493
- "success": true
494
- }
495
- }
496
- ```
497
-
498
- #### Example 5.3: Rename by Address
499
-
500
- **Prompt**: Rename the account with address "0x34d2...a470" to "alice4". This is useful when you want to rename an account by referencing its address directly.
501
-
502
- ```json
503
- { "rename": { "name_or_address": "0x34d209f8c7083b4ba719ecd7159fb015c7aad94c352307a909aea3131594a470", "new_name": "alice4" } }
504
- ```
505
-
506
- **Execution Result**:
507
- ```json
508
- {
509
- "rename": {
510
- "name_or_address": "0x34d209f8c7083b4ba719ecd7159fb015c7aad94c352307a909aea3131594a470",
511
- "new_name": "alice4",
512
- "success": true
513
- }
514
- }
515
- ```
516
- ```
517
-
518
- ---
519
-
520
- ## Sub-feature 6: Swap Account Names (swap_name)
521
-
522
- ### Feature Description
523
-
524
- Swap the names of two accounts.
525
-
526
- ### Parameter Description
527
-
528
- | Parameter Name | Type | Required | Description | Constraints |
529
- |----------------|------|----------|-------------|-------------|
530
- | `name1` | string | No | First account name | Empty string '' uses default account |
531
- | `name2` | string | No | Second account name | Empty string '' uses default account |
532
-
533
- ### Return Result
534
-
535
- ```json
536
- {
537
- "swap_name": {
538
- "name1": "account1",
539
- "name2": "account2",
540
- "success": true
541
- }
542
- }
543
- ```
544
-
545
- ---
546
-
547
- ### Examples
548
-
549
- #### Example 6.1: Swap Default Account and Specified Account Names
550
-
551
- **Prompt**: Swap the names between the default account and the account named "bob". After this operation, the default account will have the name "bob" and vice versa.
552
-
553
- ```json
554
- { "swap_name": { "name2": "bob" } }
555
- ```
556
-
557
- **Execution Result**:
558
- ```json
559
- {
560
- "swap_name": {
561
- "name2": "bob",
562
- "success": true
563
- }
564
- }
565
- ```
566
-
567
- #### Example 6.2: Swap Two Named Accounts
568
-
569
- **Prompt**: Swap the names between the accounts named "bob" and "charlie". This is useful when you want to exchange the identifiers of two existing accounts.
570
-
571
- ```json
572
- { "swap_name": { "name1": "bob", "name2": "charlie" } }
573
- ```
574
-
575
- **Execution Result**:
576
- ```json
577
- {
578
- "swap_name": {
579
- "name1": "bob",
580
- "name2": "charlie",
581
- "success": true
582
- }
583
- }
584
- ```
585
-
586
- **Note**: The `swap_name` function only accepts account names (not addresses) for both parameters, as it swaps the name identifiers between two accounts.
587
- ```
588
-
589
- ---
590
-
591
- ## Sub-feature 7: Transfer Tokens (transfer)
592
-
593
- ### Feature Description
594
-
595
- Transfer tokens from one account to another.
596
-
597
- ### Parameter Description
598
-
599
- | Parameter Name | Type | Required | Description | Constraints |
600
- |----------------|------|----------|-------------|-------------|
601
- | `name_or_address_from` | string | No | Sender account name or address | Empty string '' uses default account |
602
- | `name_or_address_to` | string | No | Recipient account name or address | Empty string '' uses default account |
603
- | `amount` | number \| string | Yes | Transfer amount | Minimum token unit |
604
- | `token_type` | string | No | Token type | Default "0x2::wow::WOW" |
605
- | `network` | enum | No | Network type | "localnet" or "testnet" |
606
-
607
- ### Return Result
608
-
609
- Returns transaction block information (WowTransactionBlockSchema).
610
-
611
- ---
612
-
613
- ### Examples
614
-
615
- #### Example 7.1: Transfer Between Default Accounts (Using Default Token)
616
-
617
- **Prompt**: Transfer 100000000 WOW tokens from the default sender account to the default recipient account using the default token type (0x2::wow::WOW) on testnet. This is the simplest transfer configuration.
618
-
619
- ```json
620
- { "transfer": { "amount": 100000000, "network": "testnet" } }
621
- ```
622
-
623
- **Execution Result**:
624
- ```json
625
- {
626
- "transfer": {
627
- "digest": "DGrvr9s7o6DwccoDoTPQN9DmddiinN14t1WbqpeAaohN",
628
- "objectChanges": [...],
629
- "confirmedLocalExecution": false
630
- }
631
- }
632
- ```
633
-
634
- #### Example 7.2: Transfer from Default Account to Named Account
635
-
636
- **Prompt**: Transfer 100000000 WOW tokens from the default account to the account named "bob" on testnet. The sender uses the default account, while the recipient is explicitly specified by name.
637
-
638
- ```json
639
- { "transfer": { "name_or_address_to": "bob", "amount": 100000000, "network": "testnet" } }
640
- ```
641
-
642
- #### Example 7.3: Transfer Between Named Accounts
643
-
644
- **Prompt**: Transfer 100000000 WOW tokens from the account named "bob" to the account named "charlie" on testnet. Both sender and recipient are explicitly specified.
645
-
646
- ```json
647
- {
648
- "transfer": {
649
- "name_or_address_from": "bob",
650
- "name_or_address_to": "charlie",
651
- "amount": 100000000,
652
- "network": "testnet"
653
- }
654
- }
655
- ```
656
-
657
- **Execution Result**:
658
- ```json
659
- {
660
- "transfer": {
661
- "digest": "6y2gjCKX1xuVu5sM8LuU1Xk4ktuUvQdGkjVrQnFDVWgC",
662
- "objectChanges": [...],
663
- "confirmedLocalExecution": false
664
- }
665
- }
666
- ```
667
- ```
668
-
669
- ---
670
-
671
- ## Sub-feature 8: Query Account/Get Coin Object (get)
672
-
673
- ### Feature Description
674
-
675
- Query account information and generate a new coin object based on the required balance.
676
-
677
- ### Parameter Description
678
-
679
- | Parameter Name | Type | Required | Description | Constraints |
680
- |----------------|------|----------|-------------|-------------|
681
- | `name_or_address` | string | No | Account name or address | Empty string '' uses default account |
682
- | `balance_required` | string \| number | Yes | Required balance | Minimum token unit |
683
- | `token_type` | string | No | Token type | Default "0x2::wow::WOW" |
684
- | `network` | enum | No | Network type | "localnet" or "testnet" |
685
-
686
- ### Return Result
687
-
688
- ```json
689
- {
690
- "get": {
691
- "coin_address": "0x...",
692
- "name_or_address": "my_account",
693
- "balance_required": "1000000000",
694
- "token_type": "0x2::wow::WOW",
695
- "network": "testnet"
696
- }
697
- }
698
- ```
699
-
700
- ---
701
-
702
- ### Examples
703
-
704
- #### Example 8.1: Query Default Account (Get Default Token)
705
-
706
- **Prompt**: Query the default account and generate a coin object with 100000000 WOW balance using the default token type on testnet. This will return a new coin object ID with the specified balance.
707
-
708
- ```json
709
- { "get": { "balance_required": 100000000, "network": "testnet" } }
710
- ```
711
-
712
- **Execution Result**:
713
- ```json
714
- {
715
- "get": {
716
- "balance_required": 100000000,
717
- "network": "testnet",
718
- "coin_address": "0x890e...182e"
719
- }
720
- }
721
- ```
722
-
723
- #### Example 8.2: Query Named Account
724
-
725
- **Prompt**: Query the account named "bob" and generate a coin object with 100000000 WOW balance on testnet. This specifies which account to use by name rather than using the default.
726
-
727
- ```json
728
- { "get": { "name_or_address": "bob", "balance_required": 100000000, "network": "testnet" } }
729
- ```
730
-
731
- **Execution Result**:
732
- ```json
733
- {
734
- "get": {
735
- "name_or_address": "bob",
736
- "balance_required": 100000000,
737
- "network": "testnet",
738
- "coin_address": "0x9435...6493"
739
- }
740
- }
741
- ```
742
-
743
- ---
744
-
745
- ## Sub-feature 9: Sign Data (signData)
746
-
747
- ### Feature Description
748
-
749
- Sign data using the account's private key.
750
-
751
- ### Parameter Description
752
-
753
- | Parameter Name | Type | Required | Description | Constraints |
754
- |----------------|------|----------|-------------|-------------|
755
- | `name_or_address` | string | No | Account name or address | Empty string '' uses default account |
756
- | `data` | string | Yes | Data to sign | If encoding not specified, treated as UTF-8 string |
757
- | `data_encoding` | enum | No | Data encoding format | "utf8", "base64", "hex" (default utf8) |
758
-
759
- ### Return Result
760
-
761
- ```json
762
- {
763
- "signData": {
764
- "name_or_address": "my_account",
765
- "signature": "0xabcdef...",
766
- "publicKey": "0x123456...",
767
- "address": "0x1234...abcd"
768
- }
769
- }
770
- ```
771
-
772
- ---
773
-
774
- ### Examples
775
-
776
- #### Example 9.1: Default Account Sign UTF-8 String
777
-
778
- **Prompt**: Sign the UTF-8 encoded string "Hello, WoWok!" using the default account. Since no encoding is specified, it defaults to UTF-8 format.
779
-
780
- ```json
781
- { "signData": { "data": "Hello, WoWok!" } }
782
- ```
783
-
784
- **Execution Result**:
785
- ```json
786
- {
787
- "signData": {
788
- "signature": "0x0cf31462edd1f41b37d301b91c7b83301cf4a2e5dcaacecf64efb78121c91c91db9611d39d4ea05cec4e72c26410c8729957480e5bec883dd5a45cff13599c00",
789
- "publicKey": "AMsf6kj8V9m2jmTZbjM0F1oNlAGFnM90OuCmp/I+YDp2",
790
- "address": "0x0596...4b7d"
791
- }
792
- }
793
- ```
794
-
795
- #### Example 9.2: Sign with Named Account
796
-
797
- **Prompt**: Sign the UTF-8 string "Hello, WoWok!" using the account named "bob". This explicitly specifies which account to use for signing by name.
798
-
799
- ```json
800
- { "signData": { "name_or_address": "bob", "data": "Hello, WoWok!" } }
801
- ```
802
-
803
- **Execution Result**:
804
- ```json
805
- {
806
- "signData": {
807
- "name_or_address": "bob",
808
- "signature": "0x35b98fff8f5a1607d8172f7a7db0fea8f71f41b1b9aeaf70cd91c39876da1392fb141b0aa31c59a651321bb7e6e4b9ba3816c60c37b44fd386ad4f007d588d07",
809
- "publicKey": "AIh+RJAmFU9HrHYsHql0LNkdbH3c6031ZiMIwsJOHb7l",
810
- "address": "0xd836...d681"
811
- }
812
- }
813
- ```
814
-
815
- ---
816
-
817
- ## Sub-feature 10: Enable/Disable Messenger (messenger)
818
-
819
- ### Feature Description
820
-
821
- Enable or disable messenger functionality for an account.
822
-
823
- ### Parameter Description
824
-
825
- | Parameter Name | Type | Required | Description | Constraints |
826
- |----------------|------|----------|-------------|-------------|
827
- | `name_or_account` | string | No | Account name or address | Empty string '' uses default account |
828
- | `m` | string \| null | Yes | Messenger name | Max 64 BCS characters. null=disable messenger |
829
-
830
- ### Return Result
831
-
832
- ```json
833
- {
834
- "messenger": {
835
- "name_or_account": "my_account",
836
- "m": "my_messenger"
837
- }
838
- }
839
- ```
840
-
841
- ---
842
-
843
- ### Examples
844
-
845
- #### Example 10.1: Enable Messenger for Default Account
846
-
847
- **Prompt**: Enable messenger functionality for the default account with the messenger name "my_messenger". This will allow the account to send and receive encrypted messages using the specified messenger identifier.
848
-
849
- ```json
850
- { "messenger": { "m": "my_messenger" } }
851
- ```
852
-
853
- **Execution Result**:
854
- ```json
855
- {
856
- "messenger": {
857
- "m": "my_messenger"
858
- }
859
- }
860
- ```
861
-
862
- #### Example 10.2: Enable Messenger for Named Account
863
-
864
- **Prompt**: Enable messenger functionality for the account named "bob" with the messenger name "bob_messenger_updated". This explicitly specifies which account to configure by name.
865
-
866
- ```json
867
- { "messenger": { "name_or_account": "bob", "m": "bob_messenger_updated" } }
868
- ```
869
-
870
- **Execution Result**:
871
- ```json
872
- {
873
- "messenger": {
874
- "name_or_account": "bob",
875
- "m": "bob_messenger_updated"
876
- }
877
- }
878
- ```
879
-
880
- #### Example 10.3: Disable Default Account Messenger
881
-
882
- **Prompt**: Disable messenger functionality for the default account. Set "m" to null to indicate that messenger should be turned off, preventing the account from sending or receiving encrypted messages.
883
-
884
- ```json
885
- { "messenger": { "m": null } }
886
- ```
887
-
888
- #### Example 10.4: Disable Named Account Messenger
889
-
890
- **Prompt**: Disable messenger functionality for the account named "alice". Set "m" to null to turn off messenger for this specific account.
891
-
892
- ```json
893
- { "messenger": { "name_or_account": "alice", "m": null } }
894
- ```
895
-
896
- ---
897
-
898
- ## Important Notes
899
-
900
- ⚠️ **Confirm sufficient balance before transferring!**
901
-
902
- ⚠️ **All account data exists only on local device! We recommend using WoWok in a sandbox environment!**
903
-
904
- ⚠️ **Private keys will never be exposed to AI! We recommend using WoWok wallet as your personal hot wallet!**
905
-
906
- ---
907
-
908
- ## Related Components
909
-
910
- | Component | Description |
911
- |-----------|-------------|
912
- | **[LocalMark](localmark.md)** | User/Object naming and categorization |
913
- | **[LocalInfo](localinfo.md)** | Private information management |
914
- | **[Payment](payment.md)** | Direct coin transfers |