@waiaas/core 2.11.0-rc → 2.11.0-rc.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 (97) hide show
  1. package/dist/caip/asset-resolve.d.ts +39 -0
  2. package/dist/caip/asset-resolve.d.ts.map +1 -0
  3. package/dist/caip/asset-resolve.js +33 -0
  4. package/dist/caip/asset-resolve.js.map +1 -0
  5. package/dist/caip/index.d.ts +2 -0
  6. package/dist/caip/index.d.ts.map +1 -1
  7. package/dist/caip/index.js +4 -0
  8. package/dist/caip/index.js.map +1 -1
  9. package/dist/caip/response-enrichment.d.ts +70 -0
  10. package/dist/caip/response-enrichment.d.ts.map +1 -0
  11. package/dist/caip/response-enrichment.js +132 -0
  12. package/dist/caip/response-enrichment.js.map +1 -0
  13. package/dist/enums/chain.d.ts.map +1 -1
  14. package/dist/enums/chain.js +8 -0
  15. package/dist/enums/chain.js.map +1 -1
  16. package/dist/enums/index.d.ts +1 -0
  17. package/dist/enums/index.d.ts.map +1 -1
  18. package/dist/enums/index.js +1 -0
  19. package/dist/enums/index.js.map +1 -1
  20. package/dist/enums/notification.d.ts +2 -2
  21. package/dist/enums/notification.d.ts.map +1 -1
  22. package/dist/enums/notification.js +6 -0
  23. package/dist/enums/notification.js.map +1 -1
  24. package/dist/enums/policy.d.ts +2 -2
  25. package/dist/enums/policy.d.ts.map +1 -1
  26. package/dist/enums/policy.js +2 -0
  27. package/dist/enums/policy.js.map +1 -1
  28. package/dist/enums/signing-scheme.d.ts +16 -0
  29. package/dist/enums/signing-scheme.d.ts.map +1 -0
  30. package/dist/enums/signing-scheme.js +22 -0
  31. package/dist/enums/signing-scheme.js.map +1 -0
  32. package/dist/enums/transaction.d.ts +2 -2
  33. package/dist/enums/transaction.d.ts.map +1 -1
  34. package/dist/enums/transaction.js +1 -0
  35. package/dist/enums/transaction.js.map +1 -1
  36. package/dist/erc8128/types.d.ts +6 -6
  37. package/dist/errors/error-codes.d.ts +45 -2
  38. package/dist/errors/error-codes.d.ts.map +1 -1
  39. package/dist/errors/error-codes.js +46 -1
  40. package/dist/errors/error-codes.js.map +1 -1
  41. package/dist/events/event-bus.d.ts +4 -0
  42. package/dist/events/event-bus.d.ts.map +1 -1
  43. package/dist/events/event-bus.js +7 -0
  44. package/dist/events/event-bus.js.map +1 -1
  45. package/dist/i18n/en.d.ts.map +1 -1
  46. package/dist/i18n/en.js +13 -0
  47. package/dist/i18n/en.js.map +1 -1
  48. package/dist/i18n/ko.d.ts.map +1 -1
  49. package/dist/i18n/ko.js +13 -0
  50. package/dist/i18n/ko.js.map +1 -1
  51. package/dist/index.d.ts +5 -4
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +9 -3
  54. package/dist/index.js.map +1 -1
  55. package/dist/interfaces/action-provider.types.d.ts +57 -12
  56. package/dist/interfaces/action-provider.types.d.ts.map +1 -1
  57. package/dist/interfaces/action-provider.types.js +5 -1
  58. package/dist/interfaces/action-provider.types.js.map +1 -1
  59. package/dist/interfaces/index.d.ts +2 -2
  60. package/dist/interfaces/index.d.ts.map +1 -1
  61. package/dist/interfaces/index.js +1 -1
  62. package/dist/interfaces/index.js.map +1 -1
  63. package/dist/interfaces/nft-indexer.types.d.ts +4 -4
  64. package/dist/interfaces/perp-provider.types.d.ts +2 -2
  65. package/dist/interfaces/x402.types.d.ts +6 -6
  66. package/dist/schemas/audit.schema.d.ts +13 -13
  67. package/dist/schemas/audit.schema.d.ts.map +1 -1
  68. package/dist/schemas/audit.schema.js +3 -1
  69. package/dist/schemas/audit.schema.js.map +1 -1
  70. package/dist/schemas/credential.schema.d.ts +102 -0
  71. package/dist/schemas/credential.schema.d.ts.map +1 -0
  72. package/dist/schemas/credential.schema.js +54 -0
  73. package/dist/schemas/credential.schema.js.map +1 -0
  74. package/dist/schemas/incoming-transaction.schema.d.ts +2 -2
  75. package/dist/schemas/index.d.ts +2 -1
  76. package/dist/schemas/index.d.ts.map +1 -1
  77. package/dist/schemas/index.js +4 -0
  78. package/dist/schemas/index.js.map +1 -1
  79. package/dist/schemas/policy.schema.d.ts +14 -14
  80. package/dist/schemas/resolved-action.schema.d.ts +718 -0
  81. package/dist/schemas/resolved-action.schema.d.ts.map +1 -0
  82. package/dist/schemas/resolved-action.schema.js +136 -0
  83. package/dist/schemas/resolved-action.schema.js.map +1 -0
  84. package/dist/schemas/signing-protocol.d.ts +2 -2
  85. package/dist/schemas/signing-protocol.d.ts.map +1 -1
  86. package/dist/schemas/signing-protocol.js +12 -0
  87. package/dist/schemas/signing-protocol.js.map +1 -1
  88. package/dist/schemas/simulation.schema.d.ts +6 -6
  89. package/dist/schemas/transaction.schema.d.ts +432 -277
  90. package/dist/schemas/transaction.schema.d.ts.map +1 -1
  91. package/dist/schemas/transaction.schema.js +74 -25
  92. package/dist/schemas/transaction.schema.js.map +1 -1
  93. package/dist/schemas/userop.schema.d.ts +273 -166
  94. package/dist/schemas/userop.schema.d.ts.map +1 -1
  95. package/dist/schemas/webhook.schema.d.ts +8 -8
  96. package/dist/schemas/webhook.schema.d.ts.map +1 -1
  97. package/package.json +2 -2
@@ -0,0 +1,718 @@
1
+ /**
2
+ * ResolvedAction 3-kind Zod discriminatedUnion for External Action framework.
3
+ *
4
+ * Three action kinds:
5
+ * - contractCall: existing on-chain transactions (backward compatible)
6
+ * - signedData: off-chain signed data (EIP-712, HMAC, RSA-PSS, etc.)
7
+ * - signedHttp: signed HTTP requests (ERC-8128 or HMAC-based)
8
+ *
9
+ * SSoT: doc-81 D1.3~D1.5, D1.8 (External Action Framework design).
10
+ *
11
+ * @since v31.12
12
+ */
13
+ import { z } from 'zod';
14
+ /** Tracking configuration for async off-chain actions. */
15
+ export declare const SignedDataActionTrackingSchema: z.ZodObject<{
16
+ trackerName: z.ZodString;
17
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ metadata: Record<string, unknown>;
20
+ trackerName: string;
21
+ }, {
22
+ trackerName: string;
23
+ metadata?: Record<string, unknown> | undefined;
24
+ }>;
25
+ /** Action category for policy evaluation. */
26
+ export declare const ActionCategoryEnum: z.ZodEnum<["swap", "perp", "lending", "staking", "bridge", "prediction", "governance", "custom"]>;
27
+ /** Policy context for spending limit / category-based policy evaluation. */
28
+ export declare const SignedDataActionPolicyContextSchema: z.ZodObject<{
29
+ actionCategory: z.ZodEnum<["swap", "perp", "lending", "staking", "bridge", "prediction", "governance", "custom"]>;
30
+ notionalUsd: z.ZodOptional<z.ZodNumber>;
31
+ leverage: z.ZodOptional<z.ZodNumber>;
32
+ expiry: z.ZodOptional<z.ZodNumber>;
33
+ hasWithdrawCapability: z.ZodDefault<z.ZodBoolean>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ actionCategory: "custom" | "swap" | "perp" | "lending" | "staking" | "bridge" | "prediction" | "governance";
36
+ hasWithdrawCapability: boolean;
37
+ notionalUsd?: number | undefined;
38
+ leverage?: number | undefined;
39
+ expiry?: number | undefined;
40
+ }, {
41
+ actionCategory: "custom" | "swap" | "perp" | "lending" | "staking" | "bridge" | "prediction" | "governance";
42
+ notionalUsd?: number | undefined;
43
+ leverage?: number | undefined;
44
+ expiry?: number | undefined;
45
+ hasWithdrawCapability?: boolean | undefined;
46
+ }>;
47
+ /** Off-chain signed data action (EIP-712 typed data, HMAC signatures, etc.). */
48
+ export declare const SignedDataActionSchema: z.ZodObject<{
49
+ kind: z.ZodLiteral<"signedData">;
50
+ signingScheme: z.ZodEnum<["eip712", "personal", "hmac-sha256", "rsa-pss", "ecdsa-secp256k1", "ed25519", "erc8128"]>;
51
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
52
+ venue: z.ZodString;
53
+ operation: z.ZodString;
54
+ credentialRef: z.ZodOptional<z.ZodString>;
55
+ tracking: z.ZodOptional<z.ZodObject<{
56
+ trackerName: z.ZodString;
57
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
58
+ }, "strip", z.ZodTypeAny, {
59
+ metadata: Record<string, unknown>;
60
+ trackerName: string;
61
+ }, {
62
+ trackerName: string;
63
+ metadata?: Record<string, unknown> | undefined;
64
+ }>>;
65
+ policyContext: z.ZodOptional<z.ZodObject<{
66
+ actionCategory: z.ZodEnum<["swap", "perp", "lending", "staking", "bridge", "prediction", "governance", "custom"]>;
67
+ notionalUsd: z.ZodOptional<z.ZodNumber>;
68
+ leverage: z.ZodOptional<z.ZodNumber>;
69
+ expiry: z.ZodOptional<z.ZodNumber>;
70
+ hasWithdrawCapability: z.ZodDefault<z.ZodBoolean>;
71
+ }, "strip", z.ZodTypeAny, {
72
+ actionCategory: "custom" | "swap" | "perp" | "lending" | "staking" | "bridge" | "prediction" | "governance";
73
+ hasWithdrawCapability: boolean;
74
+ notionalUsd?: number | undefined;
75
+ leverage?: number | undefined;
76
+ expiry?: number | undefined;
77
+ }, {
78
+ actionCategory: "custom" | "swap" | "perp" | "lending" | "staking" | "bridge" | "prediction" | "governance";
79
+ notionalUsd?: number | undefined;
80
+ leverage?: number | undefined;
81
+ expiry?: number | undefined;
82
+ hasWithdrawCapability?: boolean | undefined;
83
+ }>>;
84
+ actionProvider: z.ZodOptional<z.ZodString>;
85
+ actionName: z.ZodOptional<z.ZodString>;
86
+ }, "strict", z.ZodTypeAny, {
87
+ kind: "signedData";
88
+ signingScheme: "eip712" | "personal" | "hmac-sha256" | "rsa-pss" | "ecdsa-secp256k1" | "ed25519" | "erc8128";
89
+ payload: Record<string, unknown>;
90
+ venue: string;
91
+ operation: string;
92
+ actionProvider?: string | undefined;
93
+ actionName?: string | undefined;
94
+ credentialRef?: string | undefined;
95
+ tracking?: {
96
+ metadata: Record<string, unknown>;
97
+ trackerName: string;
98
+ } | undefined;
99
+ policyContext?: {
100
+ actionCategory: "custom" | "swap" | "perp" | "lending" | "staking" | "bridge" | "prediction" | "governance";
101
+ hasWithdrawCapability: boolean;
102
+ notionalUsd?: number | undefined;
103
+ leverage?: number | undefined;
104
+ expiry?: number | undefined;
105
+ } | undefined;
106
+ }, {
107
+ kind: "signedData";
108
+ signingScheme: "eip712" | "personal" | "hmac-sha256" | "rsa-pss" | "ecdsa-secp256k1" | "ed25519" | "erc8128";
109
+ payload: Record<string, unknown>;
110
+ venue: string;
111
+ operation: string;
112
+ actionProvider?: string | undefined;
113
+ actionName?: string | undefined;
114
+ credentialRef?: string | undefined;
115
+ tracking?: {
116
+ trackerName: string;
117
+ metadata?: Record<string, unknown> | undefined;
118
+ } | undefined;
119
+ policyContext?: {
120
+ actionCategory: "custom" | "swap" | "perp" | "lending" | "staking" | "bridge" | "prediction" | "governance";
121
+ notionalUsd?: number | undefined;
122
+ leverage?: number | undefined;
123
+ expiry?: number | undefined;
124
+ hasWithdrawCapability?: boolean | undefined;
125
+ } | undefined;
126
+ }>;
127
+ /** Signed HTTP request action (ERC-8128 or HMAC-based HTTP signing). */
128
+ export declare const SignedHttpActionSchema: z.ZodObject<{
129
+ kind: z.ZodLiteral<"signedHttp">;
130
+ method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
131
+ url: z.ZodString;
132
+ headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
133
+ body: z.ZodOptional<z.ZodString>;
134
+ signingScheme: z.ZodEnum<["erc8128", "hmac-sha256"]>;
135
+ coveredComponents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
136
+ preset: z.ZodOptional<z.ZodString>;
137
+ ttlSec: z.ZodOptional<z.ZodNumber>;
138
+ nonce: z.ZodOptional<z.ZodString>;
139
+ venue: z.ZodString;
140
+ operation: z.ZodString;
141
+ credentialRef: z.ZodOptional<z.ZodString>;
142
+ tracking: z.ZodOptional<z.ZodObject<{
143
+ trackerName: z.ZodString;
144
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
145
+ }, "strip", z.ZodTypeAny, {
146
+ metadata: Record<string, unknown>;
147
+ trackerName: string;
148
+ }, {
149
+ trackerName: string;
150
+ metadata?: Record<string, unknown> | undefined;
151
+ }>>;
152
+ policyContext: z.ZodOptional<z.ZodObject<{
153
+ actionCategory: z.ZodEnum<["swap", "perp", "lending", "staking", "bridge", "prediction", "governance", "custom"]>;
154
+ notionalUsd: z.ZodOptional<z.ZodNumber>;
155
+ leverage: z.ZodOptional<z.ZodNumber>;
156
+ expiry: z.ZodOptional<z.ZodNumber>;
157
+ hasWithdrawCapability: z.ZodDefault<z.ZodBoolean>;
158
+ }, "strip", z.ZodTypeAny, {
159
+ actionCategory: "custom" | "swap" | "perp" | "lending" | "staking" | "bridge" | "prediction" | "governance";
160
+ hasWithdrawCapability: boolean;
161
+ notionalUsd?: number | undefined;
162
+ leverage?: number | undefined;
163
+ expiry?: number | undefined;
164
+ }, {
165
+ actionCategory: "custom" | "swap" | "perp" | "lending" | "staking" | "bridge" | "prediction" | "governance";
166
+ notionalUsd?: number | undefined;
167
+ leverage?: number | undefined;
168
+ expiry?: number | undefined;
169
+ hasWithdrawCapability?: boolean | undefined;
170
+ }>>;
171
+ actionProvider: z.ZodOptional<z.ZodString>;
172
+ actionName: z.ZodOptional<z.ZodString>;
173
+ }, "strict", z.ZodTypeAny, {
174
+ url: string;
175
+ kind: "signedHttp";
176
+ signingScheme: "hmac-sha256" | "erc8128";
177
+ venue: string;
178
+ operation: string;
179
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
180
+ headers: Record<string, string>;
181
+ actionProvider?: string | undefined;
182
+ actionName?: string | undefined;
183
+ nonce?: string | undefined;
184
+ credentialRef?: string | undefined;
185
+ tracking?: {
186
+ metadata: Record<string, unknown>;
187
+ trackerName: string;
188
+ } | undefined;
189
+ policyContext?: {
190
+ actionCategory: "custom" | "swap" | "perp" | "lending" | "staking" | "bridge" | "prediction" | "governance";
191
+ hasWithdrawCapability: boolean;
192
+ notionalUsd?: number | undefined;
193
+ leverage?: number | undefined;
194
+ expiry?: number | undefined;
195
+ } | undefined;
196
+ body?: string | undefined;
197
+ coveredComponents?: string[] | undefined;
198
+ preset?: string | undefined;
199
+ ttlSec?: number | undefined;
200
+ }, {
201
+ url: string;
202
+ kind: "signedHttp";
203
+ signingScheme: "hmac-sha256" | "erc8128";
204
+ venue: string;
205
+ operation: string;
206
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
207
+ actionProvider?: string | undefined;
208
+ actionName?: string | undefined;
209
+ nonce?: string | undefined;
210
+ credentialRef?: string | undefined;
211
+ tracking?: {
212
+ trackerName: string;
213
+ metadata?: Record<string, unknown> | undefined;
214
+ } | undefined;
215
+ policyContext?: {
216
+ actionCategory: "custom" | "swap" | "perp" | "lending" | "staking" | "bridge" | "prediction" | "governance";
217
+ notionalUsd?: number | undefined;
218
+ leverage?: number | undefined;
219
+ expiry?: number | undefined;
220
+ hasWithdrawCapability?: boolean | undefined;
221
+ } | undefined;
222
+ headers?: Record<string, string> | undefined;
223
+ body?: string | undefined;
224
+ coveredComponents?: string[] | undefined;
225
+ preset?: string | undefined;
226
+ ttlSec?: number | undefined;
227
+ }>;
228
+ /**
229
+ * ContractCallRequest extended with kind:'contractCall'.
230
+ * Does NOT modify the original ContractCallRequestSchema.
231
+ */
232
+ export declare const NormalizedContractCallSchema: z.ZodObject<{
233
+ gasCondition: z.ZodOptional<z.ZodEffects<z.ZodObject<{
234
+ maxGasPrice: z.ZodOptional<z.ZodString>;
235
+ maxPriorityFee: z.ZodOptional<z.ZodString>;
236
+ timeout: z.ZodOptional<z.ZodNumber>;
237
+ }, "strip", z.ZodTypeAny, {
238
+ maxGasPrice?: string | undefined;
239
+ maxPriorityFee?: string | undefined;
240
+ timeout?: number | undefined;
241
+ }, {
242
+ maxGasPrice?: string | undefined;
243
+ maxPriorityFee?: string | undefined;
244
+ timeout?: number | undefined;
245
+ }>, {
246
+ maxGasPrice?: string | undefined;
247
+ maxPriorityFee?: string | undefined;
248
+ timeout?: number | undefined;
249
+ }, {
250
+ maxGasPrice?: string | undefined;
251
+ maxPriorityFee?: string | undefined;
252
+ timeout?: number | undefined;
253
+ }>>;
254
+ type: z.ZodLiteral<"CONTRACT_CALL">;
255
+ to: z.ZodString;
256
+ calldata: z.ZodOptional<z.ZodString>;
257
+ abi: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
258
+ value: z.ZodOptional<z.ZodString>;
259
+ programId: z.ZodOptional<z.ZodString>;
260
+ instructionData: z.ZodOptional<z.ZodString>;
261
+ accounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
262
+ pubkey: z.ZodString;
263
+ isSigner: z.ZodBoolean;
264
+ isWritable: z.ZodBoolean;
265
+ }, "strip", z.ZodTypeAny, {
266
+ pubkey: string;
267
+ isSigner: boolean;
268
+ isWritable: boolean;
269
+ }, {
270
+ pubkey: string;
271
+ isSigner: boolean;
272
+ isWritable: boolean;
273
+ }>, "many">>;
274
+ preInstructions: z.ZodOptional<z.ZodArray<z.ZodObject<{
275
+ programId: z.ZodString;
276
+ data: z.ZodString;
277
+ accounts: z.ZodArray<z.ZodObject<{
278
+ pubkey: z.ZodString;
279
+ isSigner: z.ZodBoolean;
280
+ isWritable: z.ZodBoolean;
281
+ }, "strip", z.ZodTypeAny, {
282
+ pubkey: string;
283
+ isSigner: boolean;
284
+ isWritable: boolean;
285
+ }, {
286
+ pubkey: string;
287
+ isSigner: boolean;
288
+ isWritable: boolean;
289
+ }>, "many">;
290
+ }, "strip", z.ZodTypeAny, {
291
+ programId: string;
292
+ accounts: {
293
+ pubkey: string;
294
+ isSigner: boolean;
295
+ isWritable: boolean;
296
+ }[];
297
+ data: string;
298
+ }, {
299
+ programId: string;
300
+ accounts: {
301
+ pubkey: string;
302
+ isSigner: boolean;
303
+ isWritable: boolean;
304
+ }[];
305
+ data: string;
306
+ }>, "many">>;
307
+ network: z.ZodOptional<z.ZodEffects<z.ZodEnum<["solana-mainnet", "solana-devnet", "solana-testnet", "ethereum-mainnet", "ethereum-sepolia", "polygon-mainnet", "polygon-amoy", "arbitrum-mainnet", "arbitrum-sepolia", "optimism-mainnet", "optimism-sepolia", "base-mainnet", "base-sepolia", "hyperevm-mainnet", "hyperevm-testnet"]>, "solana-mainnet" | "solana-devnet" | "solana-testnet" | "ethereum-mainnet" | "ethereum-sepolia" | "polygon-mainnet" | "polygon-amoy" | "arbitrum-mainnet" | "arbitrum-sepolia" | "optimism-mainnet" | "optimism-sepolia" | "base-mainnet" | "base-sepolia" | "hyperevm-mainnet" | "hyperevm-testnet", unknown>>;
308
+ actionProvider: z.ZodOptional<z.ZodString>;
309
+ actionName: z.ZodOptional<z.ZodString>;
310
+ } & {
311
+ kind: z.ZodLiteral<"contractCall">;
312
+ }, "strip", z.ZodTypeAny, {
313
+ type: "CONTRACT_CALL";
314
+ to: string;
315
+ kind: "contractCall";
316
+ network?: "solana-mainnet" | "solana-devnet" | "solana-testnet" | "ethereum-mainnet" | "ethereum-sepolia" | "polygon-mainnet" | "polygon-amoy" | "arbitrum-mainnet" | "arbitrum-sepolia" | "optimism-mainnet" | "optimism-sepolia" | "base-mainnet" | "base-sepolia" | "hyperevm-mainnet" | "hyperevm-testnet" | undefined;
317
+ value?: string | undefined;
318
+ gasCondition?: {
319
+ maxGasPrice?: string | undefined;
320
+ maxPriorityFee?: string | undefined;
321
+ timeout?: number | undefined;
322
+ } | undefined;
323
+ calldata?: string | undefined;
324
+ abi?: Record<string, unknown>[] | undefined;
325
+ programId?: string | undefined;
326
+ instructionData?: string | undefined;
327
+ accounts?: {
328
+ pubkey: string;
329
+ isSigner: boolean;
330
+ isWritable: boolean;
331
+ }[] | undefined;
332
+ preInstructions?: {
333
+ programId: string;
334
+ accounts: {
335
+ pubkey: string;
336
+ isSigner: boolean;
337
+ isWritable: boolean;
338
+ }[];
339
+ data: string;
340
+ }[] | undefined;
341
+ actionProvider?: string | undefined;
342
+ actionName?: string | undefined;
343
+ }, {
344
+ type: "CONTRACT_CALL";
345
+ to: string;
346
+ kind: "contractCall";
347
+ network?: unknown;
348
+ value?: string | undefined;
349
+ gasCondition?: {
350
+ maxGasPrice?: string | undefined;
351
+ maxPriorityFee?: string | undefined;
352
+ timeout?: number | undefined;
353
+ } | undefined;
354
+ calldata?: string | undefined;
355
+ abi?: Record<string, unknown>[] | undefined;
356
+ programId?: string | undefined;
357
+ instructionData?: string | undefined;
358
+ accounts?: {
359
+ pubkey: string;
360
+ isSigner: boolean;
361
+ isWritable: boolean;
362
+ }[] | undefined;
363
+ preInstructions?: {
364
+ programId: string;
365
+ accounts: {
366
+ pubkey: string;
367
+ isSigner: boolean;
368
+ isWritable: boolean;
369
+ }[];
370
+ data: string;
371
+ }[] | undefined;
372
+ actionProvider?: string | undefined;
373
+ actionName?: string | undefined;
374
+ }>;
375
+ /**
376
+ * 3-kind discriminatedUnion: dispatches on `kind` field.
377
+ * - contractCall: on-chain transactions (existing pipeline)
378
+ * - signedData: off-chain signed payloads (new pipeline)
379
+ * - signedHttp: signed HTTP requests (new pipeline)
380
+ */
381
+ export declare const ResolvedActionSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
382
+ gasCondition: z.ZodOptional<z.ZodEffects<z.ZodObject<{
383
+ maxGasPrice: z.ZodOptional<z.ZodString>;
384
+ maxPriorityFee: z.ZodOptional<z.ZodString>;
385
+ timeout: z.ZodOptional<z.ZodNumber>;
386
+ }, "strip", z.ZodTypeAny, {
387
+ maxGasPrice?: string | undefined;
388
+ maxPriorityFee?: string | undefined;
389
+ timeout?: number | undefined;
390
+ }, {
391
+ maxGasPrice?: string | undefined;
392
+ maxPriorityFee?: string | undefined;
393
+ timeout?: number | undefined;
394
+ }>, {
395
+ maxGasPrice?: string | undefined;
396
+ maxPriorityFee?: string | undefined;
397
+ timeout?: number | undefined;
398
+ }, {
399
+ maxGasPrice?: string | undefined;
400
+ maxPriorityFee?: string | undefined;
401
+ timeout?: number | undefined;
402
+ }>>;
403
+ type: z.ZodLiteral<"CONTRACT_CALL">;
404
+ to: z.ZodString;
405
+ calldata: z.ZodOptional<z.ZodString>;
406
+ abi: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
407
+ value: z.ZodOptional<z.ZodString>;
408
+ programId: z.ZodOptional<z.ZodString>;
409
+ instructionData: z.ZodOptional<z.ZodString>;
410
+ accounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
411
+ pubkey: z.ZodString;
412
+ isSigner: z.ZodBoolean;
413
+ isWritable: z.ZodBoolean;
414
+ }, "strip", z.ZodTypeAny, {
415
+ pubkey: string;
416
+ isSigner: boolean;
417
+ isWritable: boolean;
418
+ }, {
419
+ pubkey: string;
420
+ isSigner: boolean;
421
+ isWritable: boolean;
422
+ }>, "many">>;
423
+ preInstructions: z.ZodOptional<z.ZodArray<z.ZodObject<{
424
+ programId: z.ZodString;
425
+ data: z.ZodString;
426
+ accounts: z.ZodArray<z.ZodObject<{
427
+ pubkey: z.ZodString;
428
+ isSigner: z.ZodBoolean;
429
+ isWritable: z.ZodBoolean;
430
+ }, "strip", z.ZodTypeAny, {
431
+ pubkey: string;
432
+ isSigner: boolean;
433
+ isWritable: boolean;
434
+ }, {
435
+ pubkey: string;
436
+ isSigner: boolean;
437
+ isWritable: boolean;
438
+ }>, "many">;
439
+ }, "strip", z.ZodTypeAny, {
440
+ programId: string;
441
+ accounts: {
442
+ pubkey: string;
443
+ isSigner: boolean;
444
+ isWritable: boolean;
445
+ }[];
446
+ data: string;
447
+ }, {
448
+ programId: string;
449
+ accounts: {
450
+ pubkey: string;
451
+ isSigner: boolean;
452
+ isWritable: boolean;
453
+ }[];
454
+ data: string;
455
+ }>, "many">>;
456
+ network: z.ZodOptional<z.ZodEffects<z.ZodEnum<["solana-mainnet", "solana-devnet", "solana-testnet", "ethereum-mainnet", "ethereum-sepolia", "polygon-mainnet", "polygon-amoy", "arbitrum-mainnet", "arbitrum-sepolia", "optimism-mainnet", "optimism-sepolia", "base-mainnet", "base-sepolia", "hyperevm-mainnet", "hyperevm-testnet"]>, "solana-mainnet" | "solana-devnet" | "solana-testnet" | "ethereum-mainnet" | "ethereum-sepolia" | "polygon-mainnet" | "polygon-amoy" | "arbitrum-mainnet" | "arbitrum-sepolia" | "optimism-mainnet" | "optimism-sepolia" | "base-mainnet" | "base-sepolia" | "hyperevm-mainnet" | "hyperevm-testnet", unknown>>;
457
+ actionProvider: z.ZodOptional<z.ZodString>;
458
+ actionName: z.ZodOptional<z.ZodString>;
459
+ } & {
460
+ kind: z.ZodLiteral<"contractCall">;
461
+ }, "strip", z.ZodTypeAny, {
462
+ type: "CONTRACT_CALL";
463
+ to: string;
464
+ kind: "contractCall";
465
+ network?: "solana-mainnet" | "solana-devnet" | "solana-testnet" | "ethereum-mainnet" | "ethereum-sepolia" | "polygon-mainnet" | "polygon-amoy" | "arbitrum-mainnet" | "arbitrum-sepolia" | "optimism-mainnet" | "optimism-sepolia" | "base-mainnet" | "base-sepolia" | "hyperevm-mainnet" | "hyperevm-testnet" | undefined;
466
+ value?: string | undefined;
467
+ gasCondition?: {
468
+ maxGasPrice?: string | undefined;
469
+ maxPriorityFee?: string | undefined;
470
+ timeout?: number | undefined;
471
+ } | undefined;
472
+ calldata?: string | undefined;
473
+ abi?: Record<string, unknown>[] | undefined;
474
+ programId?: string | undefined;
475
+ instructionData?: string | undefined;
476
+ accounts?: {
477
+ pubkey: string;
478
+ isSigner: boolean;
479
+ isWritable: boolean;
480
+ }[] | undefined;
481
+ preInstructions?: {
482
+ programId: string;
483
+ accounts: {
484
+ pubkey: string;
485
+ isSigner: boolean;
486
+ isWritable: boolean;
487
+ }[];
488
+ data: string;
489
+ }[] | undefined;
490
+ actionProvider?: string | undefined;
491
+ actionName?: string | undefined;
492
+ }, {
493
+ type: "CONTRACT_CALL";
494
+ to: string;
495
+ kind: "contractCall";
496
+ network?: unknown;
497
+ value?: string | undefined;
498
+ gasCondition?: {
499
+ maxGasPrice?: string | undefined;
500
+ maxPriorityFee?: string | undefined;
501
+ timeout?: number | undefined;
502
+ } | undefined;
503
+ calldata?: string | undefined;
504
+ abi?: Record<string, unknown>[] | undefined;
505
+ programId?: string | undefined;
506
+ instructionData?: string | undefined;
507
+ accounts?: {
508
+ pubkey: string;
509
+ isSigner: boolean;
510
+ isWritable: boolean;
511
+ }[] | undefined;
512
+ preInstructions?: {
513
+ programId: string;
514
+ accounts: {
515
+ pubkey: string;
516
+ isSigner: boolean;
517
+ isWritable: boolean;
518
+ }[];
519
+ data: string;
520
+ }[] | undefined;
521
+ actionProvider?: string | undefined;
522
+ actionName?: string | undefined;
523
+ }>, z.ZodObject<{
524
+ kind: z.ZodLiteral<"signedData">;
525
+ signingScheme: z.ZodEnum<["eip712", "personal", "hmac-sha256", "rsa-pss", "ecdsa-secp256k1", "ed25519", "erc8128"]>;
526
+ payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
527
+ venue: z.ZodString;
528
+ operation: z.ZodString;
529
+ credentialRef: z.ZodOptional<z.ZodString>;
530
+ tracking: z.ZodOptional<z.ZodObject<{
531
+ trackerName: z.ZodString;
532
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
533
+ }, "strip", z.ZodTypeAny, {
534
+ metadata: Record<string, unknown>;
535
+ trackerName: string;
536
+ }, {
537
+ trackerName: string;
538
+ metadata?: Record<string, unknown> | undefined;
539
+ }>>;
540
+ policyContext: z.ZodOptional<z.ZodObject<{
541
+ actionCategory: z.ZodEnum<["swap", "perp", "lending", "staking", "bridge", "prediction", "governance", "custom"]>;
542
+ notionalUsd: z.ZodOptional<z.ZodNumber>;
543
+ leverage: z.ZodOptional<z.ZodNumber>;
544
+ expiry: z.ZodOptional<z.ZodNumber>;
545
+ hasWithdrawCapability: z.ZodDefault<z.ZodBoolean>;
546
+ }, "strip", z.ZodTypeAny, {
547
+ actionCategory: "custom" | "swap" | "perp" | "lending" | "staking" | "bridge" | "prediction" | "governance";
548
+ hasWithdrawCapability: boolean;
549
+ notionalUsd?: number | undefined;
550
+ leverage?: number | undefined;
551
+ expiry?: number | undefined;
552
+ }, {
553
+ actionCategory: "custom" | "swap" | "perp" | "lending" | "staking" | "bridge" | "prediction" | "governance";
554
+ notionalUsd?: number | undefined;
555
+ leverage?: number | undefined;
556
+ expiry?: number | undefined;
557
+ hasWithdrawCapability?: boolean | undefined;
558
+ }>>;
559
+ actionProvider: z.ZodOptional<z.ZodString>;
560
+ actionName: z.ZodOptional<z.ZodString>;
561
+ }, "strict", z.ZodTypeAny, {
562
+ kind: "signedData";
563
+ signingScheme: "eip712" | "personal" | "hmac-sha256" | "rsa-pss" | "ecdsa-secp256k1" | "ed25519" | "erc8128";
564
+ payload: Record<string, unknown>;
565
+ venue: string;
566
+ operation: string;
567
+ actionProvider?: string | undefined;
568
+ actionName?: string | undefined;
569
+ credentialRef?: string | undefined;
570
+ tracking?: {
571
+ metadata: Record<string, unknown>;
572
+ trackerName: string;
573
+ } | undefined;
574
+ policyContext?: {
575
+ actionCategory: "custom" | "swap" | "perp" | "lending" | "staking" | "bridge" | "prediction" | "governance";
576
+ hasWithdrawCapability: boolean;
577
+ notionalUsd?: number | undefined;
578
+ leverage?: number | undefined;
579
+ expiry?: number | undefined;
580
+ } | undefined;
581
+ }, {
582
+ kind: "signedData";
583
+ signingScheme: "eip712" | "personal" | "hmac-sha256" | "rsa-pss" | "ecdsa-secp256k1" | "ed25519" | "erc8128";
584
+ payload: Record<string, unknown>;
585
+ venue: string;
586
+ operation: string;
587
+ actionProvider?: string | undefined;
588
+ actionName?: string | undefined;
589
+ credentialRef?: string | undefined;
590
+ tracking?: {
591
+ trackerName: string;
592
+ metadata?: Record<string, unknown> | undefined;
593
+ } | undefined;
594
+ policyContext?: {
595
+ actionCategory: "custom" | "swap" | "perp" | "lending" | "staking" | "bridge" | "prediction" | "governance";
596
+ notionalUsd?: number | undefined;
597
+ leverage?: number | undefined;
598
+ expiry?: number | undefined;
599
+ hasWithdrawCapability?: boolean | undefined;
600
+ } | undefined;
601
+ }>, z.ZodObject<{
602
+ kind: z.ZodLiteral<"signedHttp">;
603
+ method: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
604
+ url: z.ZodString;
605
+ headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
606
+ body: z.ZodOptional<z.ZodString>;
607
+ signingScheme: z.ZodEnum<["erc8128", "hmac-sha256"]>;
608
+ coveredComponents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
609
+ preset: z.ZodOptional<z.ZodString>;
610
+ ttlSec: z.ZodOptional<z.ZodNumber>;
611
+ nonce: z.ZodOptional<z.ZodString>;
612
+ venue: z.ZodString;
613
+ operation: z.ZodString;
614
+ credentialRef: z.ZodOptional<z.ZodString>;
615
+ tracking: z.ZodOptional<z.ZodObject<{
616
+ trackerName: z.ZodString;
617
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
618
+ }, "strip", z.ZodTypeAny, {
619
+ metadata: Record<string, unknown>;
620
+ trackerName: string;
621
+ }, {
622
+ trackerName: string;
623
+ metadata?: Record<string, unknown> | undefined;
624
+ }>>;
625
+ policyContext: z.ZodOptional<z.ZodObject<{
626
+ actionCategory: z.ZodEnum<["swap", "perp", "lending", "staking", "bridge", "prediction", "governance", "custom"]>;
627
+ notionalUsd: z.ZodOptional<z.ZodNumber>;
628
+ leverage: z.ZodOptional<z.ZodNumber>;
629
+ expiry: z.ZodOptional<z.ZodNumber>;
630
+ hasWithdrawCapability: z.ZodDefault<z.ZodBoolean>;
631
+ }, "strip", z.ZodTypeAny, {
632
+ actionCategory: "custom" | "swap" | "perp" | "lending" | "staking" | "bridge" | "prediction" | "governance";
633
+ hasWithdrawCapability: boolean;
634
+ notionalUsd?: number | undefined;
635
+ leverage?: number | undefined;
636
+ expiry?: number | undefined;
637
+ }, {
638
+ actionCategory: "custom" | "swap" | "perp" | "lending" | "staking" | "bridge" | "prediction" | "governance";
639
+ notionalUsd?: number | undefined;
640
+ leverage?: number | undefined;
641
+ expiry?: number | undefined;
642
+ hasWithdrawCapability?: boolean | undefined;
643
+ }>>;
644
+ actionProvider: z.ZodOptional<z.ZodString>;
645
+ actionName: z.ZodOptional<z.ZodString>;
646
+ }, "strict", z.ZodTypeAny, {
647
+ url: string;
648
+ kind: "signedHttp";
649
+ signingScheme: "hmac-sha256" | "erc8128";
650
+ venue: string;
651
+ operation: string;
652
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
653
+ headers: Record<string, string>;
654
+ actionProvider?: string | undefined;
655
+ actionName?: string | undefined;
656
+ nonce?: string | undefined;
657
+ credentialRef?: string | undefined;
658
+ tracking?: {
659
+ metadata: Record<string, unknown>;
660
+ trackerName: string;
661
+ } | undefined;
662
+ policyContext?: {
663
+ actionCategory: "custom" | "swap" | "perp" | "lending" | "staking" | "bridge" | "prediction" | "governance";
664
+ hasWithdrawCapability: boolean;
665
+ notionalUsd?: number | undefined;
666
+ leverage?: number | undefined;
667
+ expiry?: number | undefined;
668
+ } | undefined;
669
+ body?: string | undefined;
670
+ coveredComponents?: string[] | undefined;
671
+ preset?: string | undefined;
672
+ ttlSec?: number | undefined;
673
+ }, {
674
+ url: string;
675
+ kind: "signedHttp";
676
+ signingScheme: "hmac-sha256" | "erc8128";
677
+ venue: string;
678
+ operation: string;
679
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
680
+ actionProvider?: string | undefined;
681
+ actionName?: string | undefined;
682
+ nonce?: string | undefined;
683
+ credentialRef?: string | undefined;
684
+ tracking?: {
685
+ trackerName: string;
686
+ metadata?: Record<string, unknown> | undefined;
687
+ } | undefined;
688
+ policyContext?: {
689
+ actionCategory: "custom" | "swap" | "perp" | "lending" | "staking" | "bridge" | "prediction" | "governance";
690
+ notionalUsd?: number | undefined;
691
+ leverage?: number | undefined;
692
+ expiry?: number | undefined;
693
+ hasWithdrawCapability?: boolean | undefined;
694
+ } | undefined;
695
+ headers?: Record<string, string> | undefined;
696
+ body?: string | undefined;
697
+ coveredComponents?: string[] | undefined;
698
+ preset?: string | undefined;
699
+ ttlSec?: number | undefined;
700
+ }>]>;
701
+ export type SignedDataAction = z.infer<typeof SignedDataActionSchema>;
702
+ export type SignedHttpAction = z.infer<typeof SignedHttpActionSchema>;
703
+ export type NormalizedContractCall = z.infer<typeof NormalizedContractCallSchema>;
704
+ export type ResolvedAction = z.infer<typeof ResolvedActionSchema>;
705
+ export type ActionCategory = z.infer<typeof ActionCategoryEnum>;
706
+ /**
707
+ * Normalize a raw action result into a typed ResolvedAction.
708
+ *
709
+ * - If `kind` is present: parse directly via ResolvedActionSchema
710
+ * - If `kind` is absent but `type === 'CONTRACT_CALL'`: add kind:'contractCall' and parse
711
+ * - Otherwise: throw error
712
+ */
713
+ export declare function normalizeResolvedAction(raw: unknown): ResolvedAction;
714
+ /**
715
+ * Normalize one or more raw action results into ResolvedAction[].
716
+ */
717
+ export declare function normalizeResolvedActions(raw: unknown | unknown[]): ResolvedAction[];
718
+ //# sourceMappingURL=resolved-action.schema.d.ts.map