wowok_agent 1.6.6 → 2.1.8

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.

Potentially problematic release.


This version of wowok_agent might be problematic. Click here for more details.

Files changed (181) hide show
  1. package/README.md +20 -40
  2. package/dist/index.d.ts +13528 -27
  3. package/dist/index.js +1026 -27
  4. package/dist/schema/call/allocation.d.ts +1370 -0
  5. package/dist/schema/call/allocation.js +27 -0
  6. package/dist/schema/call/arbitration.d.ts +1902 -0
  7. package/dist/schema/call/arbitration.js +106 -0
  8. package/dist/schema/call/base.d.ts +6381 -0
  9. package/dist/schema/call/base.js +152 -0
  10. package/dist/schema/call/contact.d.ts +898 -0
  11. package/dist/schema/call/contact.js +41 -0
  12. package/dist/schema/call/demand.d.ts +1193 -0
  13. package/dist/schema/call/demand.js +51 -0
  14. package/dist/schema/call/guard.d.ts +819 -0
  15. package/dist/schema/call/guard.js +67 -0
  16. package/dist/schema/call/handler.d.ts +80 -0
  17. package/dist/schema/call/handler.js +177 -0
  18. package/dist/schema/call/index.d.ts +18 -0
  19. package/dist/schema/call/index.js +19 -0
  20. package/dist/schema/call/machine.d.ts +3906 -0
  21. package/dist/schema/call/machine.js +164 -0
  22. package/dist/schema/call/order.d.ts +994 -0
  23. package/dist/schema/call/order.js +39 -0
  24. package/dist/schema/call/payment.d.ts +408 -0
  25. package/dist/schema/call/payment.js +20 -0
  26. package/dist/schema/call/permission.d.ts +2945 -0
  27. package/dist/schema/call/permission.js +118 -0
  28. package/dist/schema/call/personal.d.ts +1498 -0
  29. package/dist/schema/call/personal.js +81 -0
  30. package/dist/schema/call/progress.d.ts +847 -0
  31. package/dist/schema/call/progress.js +37 -0
  32. package/dist/schema/call/proof.d.ts +328 -0
  33. package/dist/schema/call/proof.js +27 -0
  34. package/dist/schema/call/repository.d.ts +2220 -0
  35. package/dist/schema/call/repository.js +85 -0
  36. package/dist/schema/call/reward.d.ts +1178 -0
  37. package/dist/schema/call/reward.js +46 -0
  38. package/dist/schema/call/service.d.ts +3534 -0
  39. package/dist/schema/call/service.js +87 -0
  40. package/dist/schema/call/treasury.d.ts +2399 -0
  41. package/dist/schema/call/treasury.js +76 -0
  42. package/dist/schema/common/index.d.ts +623 -0
  43. package/dist/schema/common/index.js +331 -0
  44. package/dist/schema/index.d.ts +7 -0
  45. package/dist/schema/index.js +8 -0
  46. package/dist/schema/local/index.d.ts +7824 -0
  47. package/dist/schema/local/index.js +913 -0
  48. package/dist/schema/local/wip.d.ts +781 -0
  49. package/dist/schema/local/wip.js +229 -0
  50. package/dist/schema/messenger/index.d.ts +3624 -0
  51. package/dist/schema/messenger/index.js +407 -0
  52. package/dist/schema/query/index.d.ts +27176 -0
  53. package/dist/schema/query/index.js +1313 -0
  54. package/dist/schema/utils/guard-parser.d.ts +20 -0
  55. package/dist/schema/utils/guard-parser.js +410 -0
  56. package/dist/schema/utils/guard-query-utils.d.ts +5 -0
  57. package/dist/schema/utils/guard-query-utils.js +22 -0
  58. package/dist/schema/utils/node-parser.d.ts +59 -0
  59. package/dist/schema/utils/node-parser.js +382 -0
  60. package/dist/schema/utils/permission-index-utils.d.ts +2 -0
  61. package/dist/schema/utils/permission-index-utils.js +10 -0
  62. package/package.json +31 -49
  63. package/LICENSE +0 -201
  64. package/dist/call/arbitration.d.ts +0 -57
  65. package/dist/call/arbitration.d.ts.map +0 -1
  66. package/dist/call/arbitration.js +0 -245
  67. package/dist/call/arbitration.js.map +0 -1
  68. package/dist/call/base.d.ts +0 -85
  69. package/dist/call/base.d.ts.map +0 -1
  70. package/dist/call/base.js +0 -231
  71. package/dist/call/base.js.map +0 -1
  72. package/dist/call/call.d.ts +0 -95
  73. package/dist/call/call.d.ts.map +0 -1
  74. package/dist/call/call.js +0 -149
  75. package/dist/call/call.js.map +0 -1
  76. package/dist/call/demand.d.ts +0 -46
  77. package/dist/call/demand.d.ts.map +0 -1
  78. package/dist/call/demand.js +0 -201
  79. package/dist/call/demand.js.map +0 -1
  80. package/dist/call/guard.d.ts +0 -53
  81. package/dist/call/guard.d.ts.map +0 -1
  82. package/dist/call/guard.js +0 -386
  83. package/dist/call/guard.js.map +0 -1
  84. package/dist/call/machine.d.ts +0 -97
  85. package/dist/call/machine.d.ts.map +0 -1
  86. package/dist/call/machine.js +0 -342
  87. package/dist/call/machine.js.map +0 -1
  88. package/dist/call/object_permission.d.ts +0 -14
  89. package/dist/call/object_permission.d.ts.map +0 -1
  90. package/dist/call/object_permission.js +0 -59
  91. package/dist/call/object_permission.js.map +0 -1
  92. package/dist/call/permission.d.ts +0 -63
  93. package/dist/call/permission.d.ts.map +0 -1
  94. package/dist/call/permission.js +0 -137
  95. package/dist/call/permission.js.map +0 -1
  96. package/dist/call/personal.d.ts +0 -47
  97. package/dist/call/personal.d.ts.map +0 -1
  98. package/dist/call/personal.js +0 -119
  99. package/dist/call/personal.js.map +0 -1
  100. package/dist/call/repository.d.ts +0 -117
  101. package/dist/call/repository.d.ts.map +0 -1
  102. package/dist/call/repository.js +0 -408
  103. package/dist/call/repository.js.map +0 -1
  104. package/dist/call/service.d.ts +0 -115
  105. package/dist/call/service.d.ts.map +0 -1
  106. package/dist/call/service.js +0 -550
  107. package/dist/call/service.js.map +0 -1
  108. package/dist/call/treasury.d.ts +0 -46
  109. package/dist/call/treasury.d.ts.map +0 -1
  110. package/dist/call/treasury.js +0 -222
  111. package/dist/call/treasury.js.map +0 -1
  112. package/dist/common.d.ts +0 -12
  113. package/dist/common.d.ts.map +0 -1
  114. package/dist/common.js +0 -71
  115. package/dist/common.js.map +0 -1
  116. package/dist/index.d.ts.map +0 -1
  117. package/dist/index.js.map +0 -1
  118. package/dist/local/.d.ts +0 -20
  119. package/dist/local/.d.ts.map +0 -1
  120. package/dist/local/.js +0 -76
  121. package/dist/local/.js.map +0 -1
  122. package/dist/local/account.d.ts +0 -42
  123. package/dist/local/account.d.ts.map +0 -1
  124. package/dist/local/account.js +0 -335
  125. package/dist/local/account.js.map +0 -1
  126. package/dist/local/cache.d.ts +0 -32
  127. package/dist/local/cache.d.ts.map +0 -1
  128. package/dist/local/cache.js +0 -77
  129. package/dist/local/cache.js.map +0 -1
  130. package/dist/local/coin.d.ts +0 -22
  131. package/dist/local/coin.d.ts.map +0 -1
  132. package/dist/local/coin.js +0 -123
  133. package/dist/local/coin.js.map +0 -1
  134. package/dist/local/config.d.ts +0 -20
  135. package/dist/local/config.d.ts.map +0 -1
  136. package/dist/local/config.js +0 -75
  137. package/dist/local/config.js.map +0 -1
  138. package/dist/local/index.d.ts +0 -110
  139. package/dist/local/index.d.ts.map +0 -1
  140. package/dist/local/index.js +0 -122
  141. package/dist/local/index.js.map +0 -1
  142. package/dist/local/local.d.ts +0 -55
  143. package/dist/local/local.d.ts.map +0 -1
  144. package/dist/local/local.js +0 -248
  145. package/dist/local/local.js.map +0 -1
  146. package/dist/query/events.d.ts +0 -65
  147. package/dist/query/events.d.ts.map +0 -1
  148. package/dist/query/events.js +0 -75
  149. package/dist/query/events.js.map +0 -1
  150. package/dist/query/objects.d.ts +0 -346
  151. package/dist/query/objects.d.ts.map +0 -1
  152. package/dist/query/objects.js +0 -472
  153. package/dist/query/objects.js.map +0 -1
  154. package/dist/query/permission.d.ts +0 -15
  155. package/dist/query/permission.d.ts.map +0 -1
  156. package/dist/query/permission.js +0 -45
  157. package/dist/query/permission.js.map +0 -1
  158. package/dist/query/received.d.ts +0 -16
  159. package/dist/query/received.d.ts.map +0 -1
  160. package/dist/query/received.js +0 -16
  161. package/dist/query/received.js.map +0 -1
  162. package/dist/schema/call.d.ts +0 -13005
  163. package/dist/schema/call.d.ts.map +0 -1
  164. package/dist/schema/call.js +0 -997
  165. package/dist/schema/call.js.map +0 -1
  166. package/dist/schema/const.d.ts +0 -254
  167. package/dist/schema/const.d.ts.map +0 -1
  168. package/dist/schema/const.js +0 -305
  169. package/dist/schema/const.js.map +0 -1
  170. package/dist/schema/local.d.ts +0 -702
  171. package/dist/schema/local.d.ts.map +0 -1
  172. package/dist/schema/local.js +0 -150
  173. package/dist/schema/local.js.map +0 -1
  174. package/dist/schema/query.d.ts +0 -1465
  175. package/dist/schema/query.d.ts.map +0 -1
  176. package/dist/schema/query.js +0 -224
  177. package/dist/schema/query.js.map +0 -1
  178. package/dist/schema/util.d.ts +0 -71
  179. package/dist/schema/util.d.ts.map +0 -1
  180. package/dist/schema/util.js +0 -139
  181. package/dist/schema/util.js.map +0 -1
@@ -0,0 +1,331 @@
1
+ import { z } from "zod";
2
+ import { isValidAddress, ValueType as WowValueType, ObjectType as WowObjectType, ENTRYPOINT, isValidWowAddress, isValidName, isValidDescription, MAX_DESCRIPTION_LENGTH, isValidLongName, MAX_LONG_NAME_LENGTH } from "wowok";
3
+ // ============================================================
4
+ // Address Schema - Address format validation
5
+ // ============================================================
6
+ const isValidMoveIdentifier = (s) => {
7
+ if (s.length === 0)
8
+ return false;
9
+ const firstChar = s[0];
10
+ if (firstChar === '_') {
11
+ return s.length > 1 && /^[a-zA-Z0-9_]+$/.test(s.slice(1));
12
+ }
13
+ if (/^[a-zA-Z]$/.test(firstChar)) {
14
+ return /^[a-zA-Z0-9_]*$/.test(s.slice(1));
15
+ }
16
+ return false;
17
+ };
18
+ export const DescriptionSchema = z
19
+ .string()
20
+ .refine(isValidDescription, {
21
+ message: `Description string (max ${MAX_DESCRIPTION_LENGTH} bcs characters)`
22
+ })
23
+ .describe(`Description string (max ${MAX_DESCRIPTION_LENGTH} bcs characters)`);
24
+ export const LongNameSchema = z
25
+ .string()
26
+ .refine(isValidLongName, {
27
+ message: `max ${MAX_LONG_NAME_LENGTH} bcs characters`
28
+ });
29
+ export const WowAddressSchema = z
30
+ .string()
31
+ .refine(isValidAddress, {
32
+ // or a builtin ID (0x5-0x9, @0xaaa, @0xaab, @0x403, @0xacc, @0xc)
33
+ message: "Invalid ID format: must be '0x' prefix followed by 64 hex characters"
34
+ })
35
+ .describe("Valid ID: 0x prefix + 64 hex characters, or builtin ID (0x5-0x9, @0xaaa, @0xaab, @0x403, @0xacc, @0xc)");
36
+ // ============================================================
37
+ // TokenType Schema - Token type format validation
38
+ // ============================================================
39
+ const WOW_TOKEN_TYPE = "0x2::wow::WOW";
40
+ export const TokenTypeSchema = z
41
+ .string()
42
+ .refine((val) => {
43
+ if (val === WOW_TOKEN_TYPE)
44
+ return true;
45
+ const parts = val.split("::");
46
+ if (parts.length !== 3)
47
+ return false;
48
+ const [address, module, structName] = parts;
49
+ if (!isValidWowAddress(address))
50
+ return false;
51
+ if (!isValidMoveIdentifier(module))
52
+ return false;
53
+ if (!isValidMoveIdentifier(structName))
54
+ return false;
55
+ return true;
56
+ }, {
57
+ message: "Invalid token type format. Expected: {address}::{module}::{struct} where address is 0x+64hex, module/struct are valid Move identifiers, or '0x2::wow::WOW'"
58
+ })
59
+ .describe("Token type in format: {address}::{module}::{struct}. Example: 0x2::wow::WOW");
60
+ export const TokenTypeWithDefaultSchema = TokenTypeSchema
61
+ .default(WOW_TOKEN_TYPE)
62
+ .describe("Token type in format: {address}::{module}::{struct}. Default: 0x2::wow::WOW");
63
+ // ============================================================
64
+ // Name Schema - Name format validation
65
+ // ============================================================
66
+ export const NameSchema = z
67
+ .string()
68
+ .refine(isValidName, "Name string (max 64 bcs characters, must not start with '0x')");
69
+ export const NotEmptyNameSchema = z.string().nonempty()
70
+ .refine(isValidName, "Name string (at least 1 character, max length 64 bcs characters)");
71
+ // ============================================================
72
+ // NameOrAddress Schema - Name or address
73
+ // ============================================================
74
+ export const NameOrAddressSchema = z
75
+ .string()
76
+ .refine((val) => {
77
+ if (isValidWowAddress(val))
78
+ return true;
79
+ if (isValidName(val))
80
+ return true;
81
+ return false;
82
+ }, {
83
+ message: "Invalid ID format: must be '0x' prefix, or a builtin ID (0x5-0x9, @0xaaa, @0xaab, @0x403, @0xacc, @0xc)"
84
+ }).describe("Account/Object name or ID. If specifying an account, use empty string '' for the default account. " +
85
+ "If it starts with '0x', it will be treated as an ID. " +
86
+ "Otherwise, it will be treated as a name (max 64 bcs characters).");
87
+ // Define AccountOrMark_Address schema
88
+ export const AccountOrMark_AddressSchema = z.object({
89
+ name_or_address: NameOrAddressSchema.optional(),
90
+ local_mark_first: z.boolean().optional().describe("Whether to prioritize local marks, if true, prioritize local marks, otherwise prioritize global marks"),
91
+ }).strict().describe("Account or address lookup object. Use this to specify which account to use for an operation. " +
92
+ "EXAMPLE: { name_or_address: 'testor2' } - looks up account by name; " +
93
+ "EXAMPLE: { name_or_address: '0x1234...' } - uses address directly; " +
94
+ "If name_or_address is empty string '', uses the default local account.");
95
+ // Define ManyAccountOrMark_Address schema
96
+ export const ManyAccountOrMark_AddressSchema = z.object({
97
+ entities: z.array(AccountOrMark_AddressSchema),
98
+ check_all_founded: z.boolean().optional().describe("Whether to check all entities are found, if true, all entities must be found (abort and throw exception if any ID not found); if false, only return found IDs"),
99
+ }).strict().describe("Used to batch find account or object IDs by name");
100
+ // Define ObjectOwner schema
101
+ export const ObjectOwnerSchema = z.union([
102
+ z.object({
103
+ AddressOwner: z.string().describe("Address owner"),
104
+ }).strict(),
105
+ z.object({
106
+ ObjectOwner: z.string().describe("Object owner"),
107
+ }).strict(),
108
+ z.object({
109
+ Shared: z.object({
110
+ initial_shared_version: z.union([z.string(), z.number()]).describe("Version when object became shared"),
111
+ }).strict().describe("Shared object"),
112
+ }).strict(),
113
+ z.literal("Immutable"),
114
+ z.object({
115
+ ConsensusAddressOwner: z.object({
116
+ owner: z.string().describe("Consensus ID owner"),
117
+ start_version: z.union([z.string(), z.number()]).describe("Version when object recently became consensus object"),
118
+ }).strict().describe("Consensus ID owner"),
119
+ }).strict(),
120
+ ]).describe("Object owner");
121
+ // Define ValueType string names for user convenience
122
+ const ValueTypeStringNames = [
123
+ "Bool", "Address", "String", "U8", "U16", "U32", "U64", "U128", "U256",
124
+ "VecBool", "VecAddress", "VecString", "VecU8", "VecU16", "VecU32", "VecU64", "VecU128", "VecU256", "VecVecU8"
125
+ ];
126
+ // Define user available ValueType enum (supports both number and string)
127
+ export const ValueTypeUserSchema = z.union([
128
+ z.literal(WowValueType.Bool).describe("Bool (0)"),
129
+ z.literal(WowValueType.Address).describe("Address (1)"),
130
+ z.literal(WowValueType.String).describe("String (2)"),
131
+ z.literal(WowValueType.U8).describe("U8 (3)"),
132
+ z.literal(WowValueType.U16).describe("U16 (4)"),
133
+ z.literal(WowValueType.U32).describe("U32 (5)"),
134
+ z.literal(WowValueType.U64).describe("U64 (6)"),
135
+ z.literal(WowValueType.U128).describe("U128 (7)"),
136
+ z.literal(WowValueType.U256).describe("U256 (8)"),
137
+ z.literal(WowValueType.VecBool).describe("VecBool (9)"),
138
+ z.literal(WowValueType.VecAddress).describe("VecAddress (10)"),
139
+ z.literal(WowValueType.VecString).describe("VecString (11)"),
140
+ z.literal(WowValueType.VecU8).describe("VecU8 (12)"),
141
+ z.literal(WowValueType.VecU16).describe("VecU16 (13)"),
142
+ z.literal(WowValueType.VecU32).describe("VecU32 (14)"),
143
+ z.literal(WowValueType.VecU64).describe("VecU64 (15)"),
144
+ z.literal(WowValueType.VecU128).describe("VecU128 (16)"),
145
+ z.literal(WowValueType.VecU256).describe("VecU256 (17)"),
146
+ z.literal(WowValueType.VecVecU8).describe("VecVecU8 (18)"),
147
+ // String representations (all case variants)
148
+ z.literal("Bool").describe("Bool"),
149
+ z.literal("Address").describe("Address"),
150
+ z.literal("String").describe("String"),
151
+ z.literal("U8").describe("U8"),
152
+ z.literal("U16").describe("U16"),
153
+ z.literal("U32").describe("U32"),
154
+ z.literal("U64").describe("U64"),
155
+ z.literal("U128").describe("U128"),
156
+ z.literal("U256").describe("U256"),
157
+ z.literal("VecBool").describe("VecBool"),
158
+ z.literal("VecAddress").describe("VecAddress"),
159
+ z.literal("VecString").describe("VecString"),
160
+ z.literal("VecU8").describe("VecU8"),
161
+ z.literal("VecU16").describe("VecU16"),
162
+ z.literal("VecU32").describe("VecU32"),
163
+ z.literal("VecU64").describe("VecU64"),
164
+ z.literal("VecU128").describe("VecU128"),
165
+ z.literal("VecU256").describe("VecU256"),
166
+ z.literal("VecVecU8").describe("VecVecU8"),
167
+ // Lowercase variants
168
+ z.literal("bool").describe("bool"),
169
+ z.literal("address").describe("address"),
170
+ z.literal("string").describe("string"),
171
+ z.literal("u8").describe("u8"),
172
+ z.literal("u16").describe("u16"),
173
+ z.literal("u32").describe("u32"),
174
+ z.literal("u64").describe("u64"),
175
+ z.literal("u128").describe("u128"),
176
+ z.literal("u256").describe("u256"),
177
+ z.literal("vecbool").describe("vecbool"),
178
+ z.literal("vecaddress").describe("vecaddress"),
179
+ z.literal("vecstring").describe("vecstring"),
180
+ z.literal("vecu8").describe("vecu8"),
181
+ z.literal("vecu16").describe("vecu16"),
182
+ z.literal("vecu32").describe("vecu32"),
183
+ z.literal("vecu64").describe("vecu64"),
184
+ z.literal("vecu128").describe("vecu128"),
185
+ z.literal("vecu256").describe("vecu256"),
186
+ z.literal("vecvecu8").describe("vecvecu8"),
187
+ ]).describe("User available value type (number or string, e.g., 6 or 'U64' or 'u64')");
188
+ // Define ValueType enum (system use, includes Value)
189
+ export const ValueTypeSchema = ValueTypeUserSchema.or(z.literal(WowValueType.Value).describe("Value (19)")).or(z.literal("Value").describe("Value"))
190
+ .describe("Value type (number or string, e.g., 6 or 'U64')");
191
+ // Define ObjectType enum
192
+ export const ObjectTypeSchema = z.enum([
193
+ WowObjectType.Permission,
194
+ WowObjectType.Repository,
195
+ WowObjectType.Arb,
196
+ WowObjectType.Arbitration,
197
+ WowObjectType.Service,
198
+ WowObjectType.Machine,
199
+ WowObjectType.Order,
200
+ WowObjectType.Progress,
201
+ WowObjectType.Payment,
202
+ WowObjectType.Treasury,
203
+ WowObjectType.Guard,
204
+ WowObjectType.Demand,
205
+ WowObjectType.Passport,
206
+ WowObjectType.Allocation,
207
+ WowObjectType.Resource,
208
+ WowObjectType.Reward,
209
+ WowObjectType.Discount,
210
+ WowObjectType.EntityRegistrar,
211
+ WowObjectType.EntityLinker,
212
+ WowObjectType.Proof,
213
+ WowObjectType.WReceivedObject,
214
+ WowObjectType.Contact,
215
+ WowObjectType.TableItem_ProgressHistory,
216
+ WowObjectType.TableItem_PermissionPerm,
217
+ WowObjectType.TableItem_DemandPresenter,
218
+ WowObjectType.TableItem_MachineNode,
219
+ WowObjectType.TableItem_TreasuryHistory,
220
+ WowObjectType.TableItem_RepositoryData,
221
+ WowObjectType.TableItem_RewardRecord,
222
+ WowObjectType.TableItem_EntityLinker,
223
+ WowObjectType.TableItem_AddressMark,
224
+ WowObjectType.TableItem_EntityRegistrar,
225
+ ]).describe("Wowok object type");
226
+ // Define BalanceType schema
227
+ export const BalanceTypeSchema = z.union([z.number(), z.string()]).describe("Balance type");
228
+ // Define QueryIdSchema
229
+ export const QueryIdSchema = z.number().int().min(0).describe("Query ID");
230
+ // Define CacheExpireType schema
231
+ export const CacheExpireTypeSchema = z.union([z.number(), z.literal("INFINITE")]).describe("Cache expiration time type");
232
+ // Define ValueContainer schema
233
+ export const ValueContainerSchema = z.lazy(() => z.object({
234
+ valueType: ValueTypeSchema.describe("Value type"),
235
+ value: SupportedValueSchema.describe("Value"),
236
+ }).strict().describe("Value container with type and value"));
237
+ // Define user available SupportedValue schema
238
+ export const SupportedValueUserSchema = z.union([
239
+ z.boolean(),
240
+ z.union([AccountOrMark_AddressSchema, z.string()]),
241
+ z.string(),
242
+ z.number(),
243
+ z.array(z.boolean()),
244
+ z.union([ManyAccountOrMark_AddressSchema, z.array(z.string())]),
245
+ z.array(z.string()),
246
+ z.array(z.number()),
247
+ z.array(z.array(z.number())),
248
+ ]).describe("User available supported value type");
249
+ // Define SupportedValue schema (system use, includes Value)
250
+ export const SupportedValueSchema = SupportedValueUserSchema.or(ValueContainerSchema).describe("Supported value type");
251
+ export const GuardIdentifierSchema = z.number().int().min(0).max(255).describe("Identifier (0-255) for data lookup in Guard table.");
252
+ export const GuardTableItemBaseSchema = z.object({
253
+ identifier: GuardIdentifierSchema,
254
+ b_submission: z.boolean().describe("Whether user submission is required for this data"),
255
+ value_type: ValueTypeUserSchema.describe("Type of the value"),
256
+ value: SupportedValueUserSchema.optional().describe("The actual value data"),
257
+ name: z.string().default("").describe("Name or description of this data"),
258
+ }).strict().describe("Guard table item");
259
+ export const GuardTableItemSchema = GuardTableItemBaseSchema.extend({
260
+ object_type: ObjectTypeSchema.optional().describe("Object type when value_type is Address and represents a specific object"),
261
+ }).strict().describe("Guard table item");
262
+ // Define Entrypoint schema
263
+ export const EntrypointSchema = z.enum([
264
+ ENTRYPOINT.Localnet,
265
+ ENTRYPOINT.Testnet,
266
+ ]).describe("Network entrypoint: Specifies which network the operation occurs on");
267
+ export const FaucetNetworkSchema = z.enum([
268
+ ENTRYPOINT.Localnet,
269
+ ENTRYPOINT.Testnet,
270
+ ]).describe("Network entrypoint for Faucet: Specifies which network the operation occurs on");
271
+ // Define ObjectBase schema
272
+ export const ObjectBaseSchema = z.object({
273
+ object: z.string().describe("Object ID"),
274
+ type: ObjectTypeSchema.optional().describe("Object type"),
275
+ type_raw: z.string().optional().describe("Raw object type"),
276
+ owner: z.union([ObjectOwnerSchema, z.null()]).optional().describe("Object owner"),
277
+ version: z.string().optional().describe("Object version"),
278
+ previousTransaction: z.string().optional().describe("Previous transaction ID"),
279
+ cache_expire: CacheExpireTypeSchema.optional().describe("Cache expiration time"),
280
+ query_name: z.string().optional().describe("Original query name or address used to retrieve this object"),
281
+ }).strict().describe("Object base information");
282
+ // ================================================
283
+ // Received related type definitions
284
+ // ================================================
285
+ // Define QueryEnv schema
286
+ export const QueryEnvSchema = z.object({
287
+ no_cache: z.boolean().optional().describe("Whether to disable cache"),
288
+ network: EntrypointSchema.optional(),
289
+ }).strict().describe("Query environment parameters");
290
+ // Define QueryReceived schema
291
+ export const QueryReceivedSchema = QueryEnvSchema.extend({
292
+ object: z.string().describe("Object ID to query"),
293
+ all_type: z.boolean().optional().describe("Whether to query all types of received objects"),
294
+ cursor: z.union([z.string(), z.null()]).optional().describe("Pagination cursor"),
295
+ limit: z.union([z.number(), z.null()]).optional().describe("Number of records returned per page"),
296
+ }).strict().describe("Request parameters for querying object's received objects");
297
+ // Define ReceivedBalanceObject schema
298
+ export const ReceivedBalanceObjectSchema = z.object({
299
+ id: z.string().describe("Received CoinWrapper object ID"),
300
+ balance: BalanceTypeSchema,
301
+ payment: z.string().describe("Payment object ID"),
302
+ }).strict().describe("Received CoinWrapper object record");
303
+ // Define ReceivedBalance schema
304
+ export const ReceivedBalanceSchema = z.object({
305
+ balance: BalanceTypeSchema,
306
+ token_type: TokenTypeSchema.describe("Asset type of Coin objects"),
307
+ received: z.array(ReceivedBalanceObjectSchema).describe("Received records of Coin objects"),
308
+ }).strict().describe("Received record of Coin objects");
309
+ // Define ReceivedBalanceOrRecently schema
310
+ export const ReceivedBalanceOrRecentlySchema = z.union([
311
+ ReceivedBalanceSchema,
312
+ z.literal("recently")
313
+ ]).describe("Specified received balance record or all recently received balance record");
314
+ // Define ReceivedNormal schema
315
+ export const ReceivedNormalSchema = z.object({
316
+ id: z.string().nonempty().describe("Received object ID"),
317
+ type: z.string().nonempty().describe("Object type")
318
+ }).strict().describe("Received normal object record");
319
+ // Define ReceivedObjectsOrRecently schema
320
+ export const ReceivedObjectsOrRecentlySchema = z.union([
321
+ z.array(ReceivedNormalSchema),
322
+ ReceivedBalanceSchema,
323
+ z.literal("recently"),
324
+ ]).describe("Specified received object records or all recently received object records");
325
+ // Define QueryReceivedResult schema
326
+ export const QueryReceivedResultSchema = z.object({
327
+ result: z.union([
328
+ ReceivedBalanceSchema,
329
+ z.array(ReceivedNormalSchema),
330
+ ]).describe("Received CoinWrapper object record or received other objects array")
331
+ }).strict().describe("Query received result");
@@ -0,0 +1,7 @@
1
+ export * from './call/index.js';
2
+ export * from './query/index.js';
3
+ export * from './local/index.js';
4
+ export * from './messenger/index.js';
5
+ export * from './common/index.js';
6
+ export * from './utils/guard-parser.js';
7
+ export * from './utils/node-parser.js';
@@ -0,0 +1,8 @@
1
+ // Package entry point
2
+ export * from './call/index.js';
3
+ export * from './query/index.js';
4
+ export * from './local/index.js';
5
+ export * from './messenger/index.js';
6
+ export * from './common/index.js';
7
+ export * from './utils/guard-parser.js';
8
+ export * from './utils/node-parser.js';