@ottochain/sdk 1.0.3 → 1.1.1

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 (181) hide show
  1. package/dist/cjs/apps/contracts/state-machines/contract.json +21 -63
  2. package/dist/cjs/apps/contracts/state-machines/escrow.json +23 -69
  3. package/dist/cjs/apps/governance/state-machines/dao-multisig.json +22 -66
  4. package/dist/cjs/apps/governance/state-machines/dao-single.json +14 -42
  5. package/dist/cjs/apps/governance/state-machines/dao-threshold.json +18 -54
  6. package/dist/cjs/apps/governance/state-machines/dao-token.json +21 -63
  7. package/dist/cjs/apps/governance/state-machines/governance-constitution.json +22 -66
  8. package/dist/cjs/apps/governance/state-machines/governance-executive.json +27 -81
  9. package/dist/cjs/apps/governance/state-machines/governance-judiciary.json +34 -102
  10. package/dist/cjs/apps/governance/state-machines/governance-legislature.json +32 -96
  11. package/dist/cjs/apps/governance/state-machines/governance-simple.json +27 -81
  12. package/dist/cjs/apps/identity/state-machines/agent-identity.json +25 -75
  13. package/dist/cjs/apps/markets/state-machines/market-universal.json +377 -110
  14. package/dist/cjs/apps/oracles/state-machines/oracle.json +22 -66
  15. package/dist/cjs/generated/index.js +11 -1
  16. package/dist/cjs/metakit/drop-nulls.js +50 -0
  17. package/dist/cjs/metakit/normalize.js +147 -0
  18. package/dist/cjs/ottochain/metagraph-client.js +147 -0
  19. package/dist/cjs/validation.js +1 -1
  20. package/dist/esm/apps/contracts/state-machines/contract.json +21 -63
  21. package/dist/esm/apps/contracts/state-machines/escrow.json +23 -69
  22. package/dist/esm/apps/governance/state-machines/dao-multisig.json +22 -66
  23. package/dist/esm/apps/governance/state-machines/dao-single.json +14 -42
  24. package/dist/esm/apps/governance/state-machines/dao-threshold.json +18 -54
  25. package/dist/esm/apps/governance/state-machines/dao-token.json +21 -63
  26. package/dist/esm/apps/governance/state-machines/governance-constitution.json +22 -66
  27. package/dist/esm/apps/governance/state-machines/governance-executive.json +27 -81
  28. package/dist/esm/apps/governance/state-machines/governance-judiciary.json +34 -102
  29. package/dist/esm/apps/governance/state-machines/governance-legislature.json +32 -96
  30. package/dist/esm/apps/governance/state-machines/governance-simple.json +27 -81
  31. package/dist/esm/apps/identity/state-machines/agent-identity.json +25 -75
  32. package/dist/esm/apps/markets/state-machines/market-universal.json +377 -110
  33. package/dist/esm/apps/oracles/state-machines/oracle.json +22 -66
  34. package/dist/esm/generated/index.js +11 -1
  35. package/dist/esm/metakit/drop-nulls.js +46 -0
  36. package/dist/esm/metakit/normalize.js +140 -0
  37. package/dist/esm/ottochain/metagraph-client.js +147 -0
  38. package/dist/esm/validation.js +1 -1
  39. package/dist/types/generated/index.d.ts +11 -1
  40. package/dist/types/metakit/drop-nulls.d.ts +29 -0
  41. package/dist/types/metakit/normalize.d.ts +67 -0
  42. package/dist/types/ottochain/index.d.ts +1 -1
  43. package/dist/types/ottochain/metagraph-client.d.ts +90 -0
  44. package/package.json +12 -12
  45. package/dist/apps/contracts/index.d.ts +0 -21
  46. package/dist/apps/contracts/index.js +0 -39
  47. package/dist/apps/contracts/types.d.ts +0 -24
  48. package/dist/apps/contracts/types.js +0 -48
  49. package/dist/apps/identity/index.d.ts +0 -22
  50. package/dist/apps/identity/index.js +0 -40
  51. package/dist/apps/identity/types.d.ts +0 -30
  52. package/dist/apps/identity/types.js +0 -53
  53. package/dist/apps/index.d.ts +0 -29
  54. package/dist/apps/index.js +0 -60
  55. package/dist/apps/markets/index.d.ts +0 -26
  56. package/dist/apps/markets/index.js +0 -46
  57. package/dist/apps/markets/types.d.ts +0 -185
  58. package/dist/apps/markets/types.js +0 -252
  59. package/dist/apps/oracles/index.d.ts +0 -26
  60. package/dist/apps/oracles/index.js +0 -46
  61. package/dist/apps/oracles/types.d.ts +0 -211
  62. package/dist/apps/oracles/types.js +0 -306
  63. package/dist/cjs/apps/contracts/types.js +0 -48
  64. package/dist/cjs/apps/corporate/types.js +0 -44
  65. package/dist/cjs/apps/governance/types.js +0 -42
  66. package/dist/cjs/apps/identity/types.js +0 -53
  67. package/dist/cjs/apps/markets/types.js +0 -219
  68. package/dist/cjs/apps/oracles/types.js +0 -282
  69. package/dist/cjs/generated/ottochain/apps/contracts/v1/contract_pb.js +0 -100
  70. package/dist/cjs/generated/ottochain/apps/corporate/v1/corporate_pb.js +0 -392
  71. package/dist/cjs/generated/ottochain/apps/governance/v1/governance_pb.js +0 -235
  72. package/dist/cjs/generated/ottochain/apps/identity/v1/agent_pb.js +0 -116
  73. package/dist/cjs/generated/ottochain/apps/identity/v1/attestation_pb.js +0 -79
  74. package/dist/cjs/generated/ottochain/apps/markets/v1/market_pb.js +0 -151
  75. package/dist/cjs/generated/ottochain/apps/oracles/v1/oracle_pb.js +0 -109
  76. package/dist/cjs/generated/ottochain/v1/common_pb.js +0 -37
  77. package/dist/cjs/generated/ottochain/v1/fiber_pb.js +0 -86
  78. package/dist/cjs/generated/ottochain/v1/messages_pb.js +0 -44
  79. package/dist/cjs/generated/ottochain/v1/records_pb.js +0 -44
  80. package/dist/errors.d.ts +0 -221
  81. package/dist/errors.js +0 -293
  82. package/dist/esm/apps/contracts/types.js +0 -44
  83. package/dist/esm/apps/corporate/types.js +0 -38
  84. package/dist/esm/apps/governance/types.js +0 -35
  85. package/dist/esm/apps/identity/types.js +0 -50
  86. package/dist/esm/apps/markets/types.js +0 -206
  87. package/dist/esm/apps/oracles/types.js +0 -267
  88. package/dist/esm/generated/ottochain/apps/contracts/v1/contract_pb.js +0 -97
  89. package/dist/esm/generated/ottochain/apps/corporate/v1/corporate_pb.js +0 -389
  90. package/dist/esm/generated/ottochain/apps/governance/v1/governance_pb.js +0 -232
  91. package/dist/esm/generated/ottochain/apps/identity/v1/agent_pb.js +0 -113
  92. package/dist/esm/generated/ottochain/apps/identity/v1/attestation_pb.js +0 -76
  93. package/dist/esm/generated/ottochain/apps/markets/v1/market_pb.js +0 -148
  94. package/dist/esm/generated/ottochain/apps/oracles/v1/oracle_pb.js +0 -106
  95. package/dist/esm/generated/ottochain/v1/common_pb.js +0 -34
  96. package/dist/esm/generated/ottochain/v1/fiber_pb.js +0 -83
  97. package/dist/esm/generated/ottochain/v1/messages_pb.js +0 -41
  98. package/dist/esm/generated/ottochain/v1/records_pb.js +0 -41
  99. package/dist/generated/index.d.ts +0 -15
  100. package/dist/generated/index.js +0 -34
  101. package/dist/generated/ottochain/apps/contracts/v1/contract_pb.d.ts +0 -274
  102. package/dist/generated/ottochain/apps/contracts/v1/contract_pb.js +0 -100
  103. package/dist/generated/ottochain/apps/identity/v1/agent_pb.d.ts +0 -211
  104. package/dist/generated/ottochain/apps/identity/v1/agent_pb.js +0 -116
  105. package/dist/generated/ottochain/apps/identity/v1/attestation_pb.d.ts +0 -238
  106. package/dist/generated/ottochain/apps/identity/v1/attestation_pb.js +0 -79
  107. package/dist/generated/ottochain/apps/markets/v1/market_pb.d.ts +0 -436
  108. package/dist/generated/ottochain/apps/markets/v1/market_pb.js +0 -151
  109. package/dist/generated/ottochain/apps/oracles/v1/oracle_pb.d.ts +0 -393
  110. package/dist/generated/ottochain/apps/oracles/v1/oracle_pb.js +0 -109
  111. package/dist/generated/ottochain/v1/common_pb.d.ts +0 -86
  112. package/dist/generated/ottochain/v1/common_pb.js +0 -37
  113. package/dist/generated/ottochain/v1/fiber_pb.d.ts +0 -292
  114. package/dist/generated/ottochain/v1/fiber_pb.js +0 -86
  115. package/dist/generated/ottochain/v1/messages_pb.d.ts +0 -190
  116. package/dist/generated/ottochain/v1/messages_pb.js +0 -44
  117. package/dist/generated/ottochain/v1/records_pb.d.ts +0 -221
  118. package/dist/generated/ottochain/v1/records_pb.js +0 -44
  119. package/dist/index.d.ts +0 -21
  120. package/dist/index.js +0 -77
  121. package/dist/metakit/binary.d.ts +0 -38
  122. package/dist/metakit/binary.js +0 -58
  123. package/dist/metakit/canonicalize.d.ts +0 -26
  124. package/dist/metakit/canonicalize.js +0 -40
  125. package/dist/metakit/codec.d.ts +0 -16
  126. package/dist/metakit/codec.js +0 -45
  127. package/dist/metakit/currency-transaction.d.ts +0 -157
  128. package/dist/metakit/currency-transaction.js +0 -319
  129. package/dist/metakit/currency-types.d.ts +0 -55
  130. package/dist/metakit/currency-types.js +0 -13
  131. package/dist/metakit/hash.d.ts +0 -50
  132. package/dist/metakit/hash.js +0 -84
  133. package/dist/metakit/index.d.ts +0 -23
  134. package/dist/metakit/index.js +0 -74
  135. package/dist/metakit/network/client.d.ts +0 -23
  136. package/dist/metakit/network/client.js +0 -78
  137. package/dist/metakit/network/currency-l1-client.d.ts +0 -71
  138. package/dist/metakit/network/currency-l1-client.js +0 -101
  139. package/dist/metakit/network/data-l1-client.d.ts +0 -57
  140. package/dist/metakit/network/data-l1-client.js +0 -76
  141. package/dist/metakit/network/index.d.ts +0 -10
  142. package/dist/metakit/network/index.js +0 -16
  143. package/dist/metakit/network/types.d.ts +0 -74
  144. package/dist/metakit/network/types.js +0 -20
  145. package/dist/metakit/sign.d.ts +0 -65
  146. package/dist/metakit/sign.js +0 -120
  147. package/dist/metakit/signed-object.d.ts +0 -66
  148. package/dist/metakit/signed-object.js +0 -100
  149. package/dist/metakit/types.d.ts +0 -67
  150. package/dist/metakit/types.js +0 -14
  151. package/dist/metakit/verify.d.ts +0 -55
  152. package/dist/metakit/verify.js +0 -217
  153. package/dist/metakit/wallet.d.ts +0 -70
  154. package/dist/metakit/wallet.js +0 -127
  155. package/dist/ottochain/index.d.ts +0 -13
  156. package/dist/ottochain/index.js +0 -45
  157. package/dist/ottochain/metagraph-client.d.ts +0 -111
  158. package/dist/ottochain/metagraph-client.js +0 -157
  159. package/dist/ottochain/snapshot.d.ts +0 -86
  160. package/dist/ottochain/snapshot.js +0 -110
  161. package/dist/ottochain/types.d.ts +0 -278
  162. package/dist/ottochain/types.js +0 -11
  163. package/dist/types/apps/contracts/types.d.ts +0 -24
  164. package/dist/types/apps/corporate/types.d.ts +0 -9861
  165. package/dist/types/apps/governance/types.d.ts +0 -344
  166. package/dist/types/apps/identity/types.d.ts +0 -30
  167. package/dist/types/apps/markets/types.d.ts +0 -155
  168. package/dist/types/apps/oracles/types.d.ts +0 -193
  169. package/dist/types/generated/ottochain/apps/contracts/v1/contract_pb.d.ts +0 -274
  170. package/dist/types/generated/ottochain/apps/corporate/v1/corporate_pb.d.ts +0 -1172
  171. package/dist/types/generated/ottochain/apps/governance/v1/governance_pb.d.ts +0 -772
  172. package/dist/types/generated/ottochain/apps/identity/v1/agent_pb.d.ts +0 -211
  173. package/dist/types/generated/ottochain/apps/identity/v1/attestation_pb.d.ts +0 -238
  174. package/dist/types/generated/ottochain/apps/markets/v1/market_pb.d.ts +0 -436
  175. package/dist/types/generated/ottochain/apps/oracles/v1/oracle_pb.d.ts +0 -393
  176. package/dist/types/generated/ottochain/v1/common_pb.d.ts +0 -86
  177. package/dist/types/generated/ottochain/v1/fiber_pb.d.ts +0 -292
  178. package/dist/types/generated/ottochain/v1/messages_pb.d.ts +0 -190
  179. package/dist/types/generated/ottochain/v1/records_pb.d.ts +0 -221
  180. package/dist/validation.d.ts +0 -449
  181. package/dist/validation.js +0 -312
@@ -1,449 +0,0 @@
1
- /**
2
- * Input Validation with Zod Schemas
3
- *
4
- * Provides runtime validation for SDK types using Zod.
5
- *
6
- * @packageDocumentation
7
- */
8
- import { z } from 'zod';
9
- import { ValidationError } from './errors.js';
10
- /**
11
- * Schema for a DAG address
12
- */
13
- export declare const DagAddressSchema: z.ZodString;
14
- /**
15
- * Schema for a private key (64-character hex string)
16
- */
17
- export declare const PrivateKeySchema: z.ZodString;
18
- /**
19
- * Schema for a public key (128 or 130 character hex string)
20
- */
21
- export declare const PublicKeySchema: z.ZodString;
22
- /**
23
- * Schema for a KeyPair
24
- */
25
- export declare const KeyPairSchema: z.ZodObject<{
26
- /** Private key in hex format */
27
- privateKey: z.ZodString;
28
- /** Public key in hex format (uncompressed, with 04 prefix) */
29
- publicKey: z.ZodString;
30
- /** DAG address derived from the public key */
31
- address: z.ZodString;
32
- }, "strip", z.ZodTypeAny, {
33
- privateKey: string;
34
- publicKey: string;
35
- address: string;
36
- }, {
37
- privateKey: string;
38
- publicKey: string;
39
- address: string;
40
- }>;
41
- /**
42
- * Type for a validated KeyPair
43
- */
44
- export type ValidatedKeyPair = z.infer<typeof KeyPairSchema>;
45
- /**
46
- * Schema for a SignatureProof
47
- */
48
- export declare const SignatureProofSchema: z.ZodObject<{
49
- /** Public key hex (uncompressed, without 04 prefix) - 128 characters */
50
- id: z.ZodString;
51
- /** DER-encoded ECDSA signature in hex format */
52
- signature: z.ZodString;
53
- }, "strip", z.ZodTypeAny, {
54
- id: string;
55
- signature: string;
56
- }, {
57
- id: string;
58
- signature: string;
59
- }>;
60
- /**
61
- * Type for a validated SignatureProof
62
- */
63
- export type ValidatedSignatureProof = z.infer<typeof SignatureProofSchema>;
64
- /**
65
- * Schema for a Signed object (generic)
66
- */
67
- export declare const SignedSchema: <T extends z.ZodTypeAny>(valueSchema: T) => z.ZodObject<{
68
- value: T;
69
- proofs: z.ZodArray<z.ZodObject<{
70
- /** Public key hex (uncompressed, without 04 prefix) - 128 characters */
71
- id: z.ZodString;
72
- /** DER-encoded ECDSA signature in hex format */
73
- signature: z.ZodString;
74
- }, "strip", z.ZodTypeAny, {
75
- id: string;
76
- signature: string;
77
- }, {
78
- id: string;
79
- signature: string;
80
- }>, "many">;
81
- }, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
82
- value: T;
83
- proofs: z.ZodArray<z.ZodObject<{
84
- /** Public key hex (uncompressed, without 04 prefix) - 128 characters */
85
- id: z.ZodString;
86
- /** DER-encoded ECDSA signature in hex format */
87
- signature: z.ZodString;
88
- }, "strip", z.ZodTypeAny, {
89
- id: string;
90
- signature: string;
91
- }, {
92
- id: string;
93
- signature: string;
94
- }>, "many">;
95
- }>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
96
- value: T;
97
- proofs: z.ZodArray<z.ZodObject<{
98
- /** Public key hex (uncompressed, without 04 prefix) - 128 characters */
99
- id: z.ZodString;
100
- /** DER-encoded ECDSA signature in hex format */
101
- signature: z.ZodString;
102
- }, "strip", z.ZodTypeAny, {
103
- id: string;
104
- signature: string;
105
- }, {
106
- id: string;
107
- signature: string;
108
- }>, "many">;
109
- }>, any>[k]; } : never, z.baseObjectInputType<{
110
- value: T;
111
- proofs: z.ZodArray<z.ZodObject<{
112
- /** Public key hex (uncompressed, without 04 prefix) - 128 characters */
113
- id: z.ZodString;
114
- /** DER-encoded ECDSA signature in hex format */
115
- signature: z.ZodString;
116
- }, "strip", z.ZodTypeAny, {
117
- id: string;
118
- signature: string;
119
- }, {
120
- id: string;
121
- signature: string;
122
- }>, "many">;
123
- }> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
124
- value: T;
125
- proofs: z.ZodArray<z.ZodObject<{
126
- /** Public key hex (uncompressed, without 04 prefix) - 128 characters */
127
- id: z.ZodString;
128
- /** DER-encoded ECDSA signature in hex format */
129
- signature: z.ZodString;
130
- }, "strip", z.ZodTypeAny, {
131
- id: string;
132
- signature: string;
133
- }, {
134
- id: string;
135
- signature: string;
136
- }>, "many">;
137
- }>[k_1]; } : never>;
138
- /**
139
- * Schema for TransactionReference
140
- */
141
- export declare const TransactionReferenceSchema: z.ZodObject<{
142
- ordinal: z.ZodNumber;
143
- hash: z.ZodString;
144
- }, "strip", z.ZodTypeAny, {
145
- hash: string;
146
- ordinal: number;
147
- }, {
148
- hash: string;
149
- ordinal: number;
150
- }>;
151
- /**
152
- * Schema for CurrencyTransactionValue
153
- */
154
- export declare const CurrencyTransactionValueSchema: z.ZodObject<{
155
- source: z.ZodString;
156
- destination: z.ZodString;
157
- amount: z.ZodNumber;
158
- fee: z.ZodDefault<z.ZodNumber>;
159
- }, "strip", z.ZodTypeAny, {
160
- source: string;
161
- destination: string;
162
- amount: number;
163
- fee: number;
164
- }, {
165
- source: string;
166
- destination: string;
167
- amount: number;
168
- fee?: number | undefined;
169
- }>;
170
- /**
171
- * Schema for CurrencyTransaction
172
- */
173
- export declare const CurrencyTransactionSchema: z.ZodObject<{
174
- value: z.ZodObject<{
175
- source: z.ZodString;
176
- destination: z.ZodString;
177
- amount: z.ZodNumber;
178
- fee: z.ZodDefault<z.ZodNumber>;
179
- }, "strip", z.ZodTypeAny, {
180
- source: string;
181
- destination: string;
182
- amount: number;
183
- fee: number;
184
- }, {
185
- source: string;
186
- destination: string;
187
- amount: number;
188
- fee?: number | undefined;
189
- }>;
190
- parent: z.ZodObject<{
191
- ordinal: z.ZodNumber;
192
- hash: z.ZodString;
193
- }, "strip", z.ZodTypeAny, {
194
- hash: string;
195
- ordinal: number;
196
- }, {
197
- hash: string;
198
- ordinal: number;
199
- }>;
200
- }, "strip", z.ZodTypeAny, {
201
- value: {
202
- source: string;
203
- destination: string;
204
- amount: number;
205
- fee: number;
206
- };
207
- parent: {
208
- hash: string;
209
- ordinal: number;
210
- };
211
- }, {
212
- value: {
213
- source: string;
214
- destination: string;
215
- amount: number;
216
- fee?: number | undefined;
217
- };
218
- parent: {
219
- hash: string;
220
- ordinal: number;
221
- };
222
- }>;
223
- /**
224
- * Type for a validated CurrencyTransaction
225
- */
226
- export type ValidatedCurrencyTransaction = z.infer<typeof CurrencyTransactionSchema>;
227
- /**
228
- * Schema for TransferParams
229
- */
230
- export declare const TransferParamsSchema: z.ZodObject<{
231
- from: z.ZodString;
232
- to: z.ZodString;
233
- amount: z.ZodNumber;
234
- fee: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
235
- }, "strip", z.ZodTypeAny, {
236
- amount: number;
237
- fee: number;
238
- from: string;
239
- to: string;
240
- }, {
241
- amount: number;
242
- from: string;
243
- to: string;
244
- fee?: number | undefined;
245
- }>;
246
- /**
247
- * Type for validated TransferParams
248
- */
249
- export type ValidatedTransferParams = z.infer<typeof TransferParamsSchema>;
250
- /**
251
- * Schema for AgentIdentity registration
252
- */
253
- export declare const AgentIdentityRegistrationSchema: z.ZodObject<{
254
- /** Public key in hex format */
255
- publicKey: z.ZodString;
256
- /** Display name for the agent */
257
- displayName: z.ZodString;
258
- /** Initial reputation (default: 10) */
259
- reputation: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
260
- }, "strip", z.ZodTypeAny, {
261
- publicKey: string;
262
- displayName: string;
263
- reputation: number;
264
- }, {
265
- publicKey: string;
266
- displayName: string;
267
- reputation?: number | undefined;
268
- }>;
269
- /**
270
- * Type for validated AgentIdentity registration
271
- */
272
- export type ValidatedAgentIdentityRegistration = z.infer<typeof AgentIdentityRegistrationSchema>;
273
- /**
274
- * Schema for PlatformLink
275
- */
276
- export declare const PlatformLinkSchema: z.ZodObject<{
277
- platform: z.ZodEnum<["DISCORD", "TELEGRAM", "TWITTER", "GITHUB", "CUSTOM"]>;
278
- platformUserId: z.ZodString;
279
- platformUsername: z.ZodString;
280
- verified: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
281
- }, "strip", z.ZodTypeAny, {
282
- platform: "DISCORD" | "TELEGRAM" | "TWITTER" | "GITHUB" | "CUSTOM";
283
- platformUserId: string;
284
- platformUsername: string;
285
- verified: boolean;
286
- }, {
287
- platform: "DISCORD" | "TELEGRAM" | "TWITTER" | "GITHUB" | "CUSTOM";
288
- platformUserId: string;
289
- platformUsername: string;
290
- verified?: boolean | undefined;
291
- }>;
292
- /**
293
- * Type for validated PlatformLink
294
- */
295
- export type ValidatedPlatformLink = z.infer<typeof PlatformLinkSchema>;
296
- /**
297
- * Schema for contract terms (flexible structure)
298
- */
299
- export declare const ContractTermsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
300
- /**
301
- * Schema for ProposeContractRequest
302
- */
303
- export declare const ProposeContractRequestSchema: z.ZodObject<{
304
- /** Proposer's DAG address */
305
- proposer: z.ZodString;
306
- /** Counterparty's DAG address */
307
- counterparty: z.ZodString;
308
- /** Contract terms */
309
- terms: z.ZodRecord<z.ZodString, z.ZodUnknown>;
310
- /** Human-readable description */
311
- description: z.ZodString;
312
- }, "strip", z.ZodTypeAny, {
313
- proposer: string;
314
- counterparty: string;
315
- terms: Record<string, unknown>;
316
- description: string;
317
- }, {
318
- proposer: string;
319
- counterparty: string;
320
- terms: Record<string, unknown>;
321
- description: string;
322
- }>;
323
- /**
324
- * Type for validated ProposeContractRequest
325
- */
326
- export type ValidatedProposeContractRequest = z.infer<typeof ProposeContractRequestSchema>;
327
- /**
328
- * Schema for AcceptContractRequest
329
- */
330
- export declare const AcceptContractRequestSchema: z.ZodObject<{
331
- /** Contract ID to accept */
332
- contractId: z.ZodString;
333
- /** Acceptor's DAG address */
334
- acceptor: z.ZodString;
335
- }, "strip", z.ZodTypeAny, {
336
- contractId: string;
337
- acceptor: string;
338
- }, {
339
- contractId: string;
340
- acceptor: string;
341
- }>;
342
- /**
343
- * Type for validated AcceptContractRequest
344
- */
345
- export type ValidatedAcceptContractRequest = z.infer<typeof AcceptContractRequestSchema>;
346
- /**
347
- * Schema for CompleteContractRequest
348
- */
349
- export declare const CompleteContractRequestSchema: z.ZodObject<{
350
- /** Contract ID to complete */
351
- contractId: z.ZodString;
352
- /** Completer's DAG address */
353
- completer: z.ZodString;
354
- /** Proof of completion */
355
- proof: z.ZodString;
356
- }, "strip", z.ZodTypeAny, {
357
- contractId: string;
358
- completer: string;
359
- proof: string;
360
- }, {
361
- contractId: string;
362
- completer: string;
363
- proof: string;
364
- }>;
365
- /**
366
- * Type for validated CompleteContractRequest
367
- */
368
- export type ValidatedCompleteContractRequest = z.infer<typeof CompleteContractRequestSchema>;
369
- /**
370
- * Validate data against a Zod schema
371
- *
372
- * @param schema - Zod schema to validate against
373
- * @param data - Data to validate
374
- * @param fieldName - Optional field name for error context
375
- * @returns Validated and typed data
376
- * @throws {ValidationError} If validation fails
377
- *
378
- * @example
379
- * ```typescript
380
- * const keyPair = validate(KeyPairSchema, inputData, 'keyPair');
381
- * // keyPair is now typed as ValidatedKeyPair
382
- * ```
383
- */
384
- export declare function validate<T extends z.ZodTypeAny>(schema: T, data: unknown, fieldName?: string): z.infer<T>;
385
- /**
386
- * Validate a private key
387
- *
388
- * @param privateKey - Private key to validate
389
- * @returns Validated private key
390
- * @throws {ValidationError} If validation fails
391
- */
392
- export declare function validatePrivateKey(privateKey: unknown): string;
393
- /**
394
- * Validate a public key
395
- *
396
- * @param publicKey - Public key to validate
397
- * @returns Validated public key
398
- * @throws {ValidationError} If validation fails
399
- */
400
- export declare function validatePublicKey(publicKey: unknown): string;
401
- /**
402
- * Validate a DAG address
403
- *
404
- * @param address - Address to validate
405
- * @returns Validated address
406
- * @throws {ValidationError} If validation fails
407
- */
408
- export declare function validateAddress(address: unknown): string;
409
- /**
410
- * Validate a KeyPair
411
- *
412
- * @param keyPair - KeyPair to validate
413
- * @returns Validated KeyPair
414
- * @throws {ValidationError} If validation fails
415
- */
416
- export declare function validateKeyPair(keyPair: unknown): ValidatedKeyPair;
417
- /**
418
- * Safe validation that returns a result object instead of throwing
419
- *
420
- * @param schema - Zod schema to validate against
421
- * @param data - Data to validate
422
- * @returns Object with success status and data or error
423
- *
424
- * @example
425
- * ```typescript
426
- * const result = safeParse(KeyPairSchema, inputData);
427
- * if (result.success) {
428
- * console.log(result.data.address);
429
- * } else {
430
- * console.log(result.error.message);
431
- * }
432
- * ```
433
- */
434
- export declare function safeParse<T extends z.ZodTypeAny>(schema: T, data: unknown): {
435
- success: true;
436
- data: z.infer<T>;
437
- } | {
438
- success: false;
439
- error: ValidationError;
440
- };
441
- /**
442
- * Assert that a condition is true, throwing ValidationError if not
443
- *
444
- * @param condition - Condition to check
445
- * @param message - Error message if condition is false
446
- * @param field - Optional field name for context
447
- * @throws {ValidationError} If condition is false
448
- */
449
- export declare function assert(condition: boolean, message: string, field?: string): asserts condition;