@privy-io/api-types 0.9.0 → 0.10.0

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 (153) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/client.d.mts +33 -30
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +33 -30
  5. package/client.d.ts.map +1 -1
  6. package/client.js +22 -8
  7. package/client.js.map +1 -1
  8. package/client.mjs +23 -9
  9. package/client.mjs.map +1 -1
  10. package/internal/types.d.mts +6 -6
  11. package/internal/types.d.mts.map +1 -1
  12. package/internal/types.d.ts +6 -6
  13. package/internal/types.d.ts.map +1 -1
  14. package/package.json +1 -1
  15. package/resources/accounts.d.mts +128 -86
  16. package/resources/accounts.d.mts.map +1 -1
  17. package/resources/accounts.d.ts +128 -86
  18. package/resources/accounts.d.ts.map +1 -1
  19. package/resources/aggregations.d.mts +43 -43
  20. package/resources/aggregations.d.mts.map +1 -1
  21. package/resources/aggregations.d.ts +43 -43
  22. package/resources/aggregations.d.ts.map +1 -1
  23. package/resources/apps.d.mts +169 -135
  24. package/resources/apps.d.mts.map +1 -1
  25. package/resources/apps.d.ts +169 -135
  26. package/resources/apps.d.ts.map +1 -1
  27. package/resources/client-auth.d.mts +646 -644
  28. package/resources/client-auth.d.mts.map +1 -1
  29. package/resources/client-auth.d.ts +646 -644
  30. package/resources/client-auth.d.ts.map +1 -1
  31. package/resources/embedded-wallets.d.mts +114 -114
  32. package/resources/embedded-wallets.d.mts.map +1 -1
  33. package/resources/embedded-wallets.d.ts +114 -114
  34. package/resources/embedded-wallets.d.ts.map +1 -1
  35. package/resources/funding.d.mts +42 -42
  36. package/resources/funding.d.mts.map +1 -1
  37. package/resources/funding.d.ts +42 -42
  38. package/resources/funding.d.ts.map +1 -1
  39. package/resources/index.d.mts +19 -18
  40. package/resources/index.d.mts.map +1 -1
  41. package/resources/index.d.ts +19 -18
  42. package/resources/index.d.ts.map +1 -1
  43. package/resources/index.js +3 -1
  44. package/resources/index.js.map +1 -1
  45. package/resources/index.mjs +2 -1
  46. package/resources/index.mjs.map +1 -1
  47. package/resources/intents.d.mts +269 -265
  48. package/resources/intents.d.mts.map +1 -1
  49. package/resources/intents.d.ts +269 -265
  50. package/resources/intents.d.ts.map +1 -1
  51. package/resources/key-quorums.d.mts +20 -20
  52. package/resources/key-quorums.d.mts.map +1 -1
  53. package/resources/key-quorums.d.ts +20 -20
  54. package/resources/key-quorums.d.ts.map +1 -1
  55. package/resources/kraken-embed.d.mts +12 -20
  56. package/resources/kraken-embed.d.mts.map +1 -1
  57. package/resources/kraken-embed.d.ts +12 -20
  58. package/resources/kraken-embed.d.ts.map +1 -1
  59. package/resources/organizations.d.mts +65 -0
  60. package/resources/organizations.d.mts.map +1 -0
  61. package/resources/organizations.d.ts +65 -0
  62. package/resources/organizations.d.ts.map +1 -0
  63. package/resources/organizations.js +9 -0
  64. package/resources/organizations.js.map +1 -0
  65. package/resources/organizations.mjs +5 -0
  66. package/resources/organizations.mjs.map +1 -0
  67. package/resources/policies.d.mts +258 -240
  68. package/resources/policies.d.mts.map +1 -1
  69. package/resources/policies.d.ts +258 -240
  70. package/resources/policies.d.ts.map +1 -1
  71. package/resources/shared.d.mts +28 -28
  72. package/resources/shared.d.mts.map +1 -1
  73. package/resources/shared.d.ts +28 -28
  74. package/resources/shared.d.ts.map +1 -1
  75. package/resources/swaps.d.mts +6 -9
  76. package/resources/swaps.d.mts.map +1 -1
  77. package/resources/swaps.d.ts +6 -9
  78. package/resources/swaps.d.ts.map +1 -1
  79. package/resources/swaps.js.map +1 -1
  80. package/resources/swaps.mjs.map +1 -1
  81. package/resources/transactions.d.mts +53 -53
  82. package/resources/transactions.d.mts.map +1 -1
  83. package/resources/transactions.d.ts +53 -53
  84. package/resources/transactions.d.ts.map +1 -1
  85. package/resources/users.d.mts +468 -459
  86. package/resources/users.d.mts.map +1 -1
  87. package/resources/users.d.ts +468 -459
  88. package/resources/users.d.ts.map +1 -1
  89. package/resources/wallet-actions.d.mts +302 -145
  90. package/resources/wallet-actions.d.mts.map +1 -1
  91. package/resources/wallet-actions.d.ts +302 -145
  92. package/resources/wallet-actions.d.ts.map +1 -1
  93. package/resources/wallets/index.d.mts +1 -1
  94. package/resources/wallets/index.d.mts.map +1 -1
  95. package/resources/wallets/index.d.ts +1 -1
  96. package/resources/wallets/index.d.ts.map +1 -1
  97. package/resources/wallets/index.js.map +1 -1
  98. package/resources/wallets/index.mjs.map +1 -1
  99. package/resources/wallets/transactions.d.mts +7 -2
  100. package/resources/wallets/transactions.d.mts.map +1 -1
  101. package/resources/wallets/transactions.d.ts +7 -2
  102. package/resources/wallets/transactions.d.ts.map +1 -1
  103. package/resources/wallets/transactions.js +1 -1
  104. package/resources/wallets/transactions.mjs +1 -1
  105. package/resources/wallets/wallets.d.mts +1424 -1227
  106. package/resources/wallets/wallets.d.mts.map +1 -1
  107. package/resources/wallets/wallets.d.ts +1424 -1227
  108. package/resources/wallets/wallets.d.ts.map +1 -1
  109. package/resources/wallets/wallets.js +4 -1
  110. package/resources/wallets/wallets.js.map +1 -1
  111. package/resources/wallets/wallets.mjs +4 -1
  112. package/resources/wallets/wallets.mjs.map +1 -1
  113. package/resources/webhooks.d.mts +935 -877
  114. package/resources/webhooks.d.mts.map +1 -1
  115. package/resources/webhooks.d.ts +935 -877
  116. package/resources/webhooks.d.ts.map +1 -1
  117. package/resources/yield.d.mts +157 -157
  118. package/resources/yield.d.mts.map +1 -1
  119. package/resources/yield.d.ts +157 -157
  120. package/resources/yield.d.ts.map +1 -1
  121. package/src/client.ts +594 -516
  122. package/src/internal/types.ts +6 -8
  123. package/src/resources/accounts.ts +157 -103
  124. package/src/resources/aggregations.ts +55 -55
  125. package/src/resources/apps.ts +221 -178
  126. package/src/resources/client-auth.ts +887 -887
  127. package/src/resources/embedded-wallets.ts +150 -150
  128. package/src/resources/funding.ts +66 -66
  129. package/src/resources/index.ts +504 -475
  130. package/src/resources/intents.ts +326 -322
  131. package/src/resources/key-quorums.ts +23 -23
  132. package/src/resources/kraken-embed.ts +14 -22
  133. package/src/resources/organizations.ts +82 -0
  134. package/src/resources/policies.ts +379 -352
  135. package/src/resources/shared.ts +34 -34
  136. package/src/resources/swaps.ts +5 -10
  137. package/src/resources/transactions.ts +86 -86
  138. package/src/resources/users.ts +707 -696
  139. package/src/resources/wallet-actions.ts +392 -185
  140. package/src/resources/wallets/index.ts +157 -148
  141. package/src/resources/wallets/transactions.ts +18 -3
  142. package/src/resources/wallets/wallets.ts +1937 -1686
  143. package/src/resources/webhooks.ts +1172 -1100
  144. package/src/resources/yield.ts +188 -188
  145. package/src/version.ts +1 -1
  146. package/version.d.mts +1 -1
  147. package/version.d.mts.map +1 -1
  148. package/version.d.ts +1 -1
  149. package/version.d.ts.map +1 -1
  150. package/version.js +1 -1
  151. package/version.js.map +1 -1
  152. package/version.mjs +1 -1
  153. package/version.mjs.map +1 -1
@@ -4,55 +4,6 @@ import { APIResource } from '../core/resource';
4
4
 
5
5
  export class WalletActions extends APIResource {}
6
6
 
7
- /**
8
- * Type of wallet action
9
- */
10
- export type WalletActionType =
11
- | 'swap'
12
- | 'transfer'
13
- | 'earn_deposit'
14
- | 'earn_withdraw'
15
- | 'earn_incentive_claim';
16
-
17
- /**
18
- * Status of a wallet action.
19
- */
20
- export type WalletActionStatus = 'pending' | 'succeeded' | 'rejected' | 'failed';
21
-
22
- /**
23
- * Type of a wallet action step.
24
- */
25
- export type WalletActionStepType = 'evm_transaction' | 'evm_user_operation';
26
-
27
- /**
28
- * Status of an EVM step in a wallet action.
29
- */
30
- export type EvmWalletActionStepStatus =
31
- | 'preparing'
32
- | 'queued'
33
- | 'pending'
34
- | 'retrying'
35
- | 'confirmed'
36
- | 'rejected'
37
- | 'reverted'
38
- | 'replaced'
39
- | 'abandoned';
40
-
41
- /**
42
- * A description of why a wallet action (or a step within a wallet action) failed.
43
- */
44
- export interface FailureReason {
45
- /**
46
- * Human-readable failure message.
47
- */
48
- message: string;
49
-
50
- /**
51
- * Additional error details, if available.
52
- */
53
- details?: unknown;
54
- }
55
-
56
7
  /**
57
8
  * A wallet action step consisting of an EVM transaction.
58
9
  */
@@ -121,21 +72,55 @@ export interface EvmUserOperationWalletActionStep {
121
72
  }
122
73
 
123
74
  /**
124
- * A step within a wallet action, representing a single onchain action.
75
+ * Status of an EVM step in a wallet action.
76
+ */
77
+ export type EvmWalletActionStepStatus =
78
+ | 'preparing'
79
+ | 'queued'
80
+ | 'pending'
81
+ | 'retrying'
82
+ | 'confirmed'
83
+ | 'rejected'
84
+ | 'reverted'
85
+ | 'replaced'
86
+ | 'abandoned';
87
+
88
+ /**
89
+ * Asset metadata for an earn vault position.
125
90
  */
126
- export type WalletActionStep = EvmTransactionWalletActionStep | EvmUserOperationWalletActionStep;
91
+ export interface EarnAsset {
92
+ /**
93
+ * Token contract address.
94
+ */
95
+ address: string;
96
+
97
+ /**
98
+ * Number of decimals for the asset (e.g. 6 for USDC).
99
+ */
100
+ decimals: number;
101
+
102
+ /**
103
+ * Lowercase token symbol (e.g. "usdc").
104
+ */
105
+ symbol: string;
106
+ }
127
107
 
128
108
  /**
129
- * Response for a swap action.
109
+ * Response for an earn deposit action.
130
110
  */
131
- export interface SwapActionResponse {
111
+ export interface EarnDepositActionResponse {
132
112
  /**
133
113
  * The ID of the wallet action.
134
114
  */
135
115
  id: string;
136
116
 
137
117
  /**
138
- * CAIP-2 chain identifier for the swap.
118
+ * Underlying asset token address.
119
+ */
120
+ asset_address: string;
121
+
122
+ /**
123
+ * CAIP-2 chain identifier.
139
124
  */
140
125
  caip2: string;
141
126
 
@@ -145,37 +130,55 @@ export interface SwapActionResponse {
145
130
  created_at: string;
146
131
 
147
132
  /**
148
- * Exact base-unit amount of input token. Populated after on-chain confirmation.
133
+ * Base-unit amount of asset deposited (e.g. "1500000").
149
134
  */
150
- input_amount: string | null;
135
+ raw_amount: string;
151
136
 
152
137
  /**
153
- * Token address or "native" for the token being sold.
138
+ * Vault shares received in base units. Populated after on-chain confirmation.
154
139
  */
155
- input_token: string;
140
+ share_amount: string | null;
156
141
 
157
142
  /**
158
- * Exact base-unit amount of output token. Populated after on-chain confirmation.
143
+ * Status of a wallet action.
159
144
  */
160
- output_amount: string | null;
145
+ status: WalletActionStatus;
146
+
147
+ type: 'earn_deposit';
161
148
 
162
149
  /**
163
- * Token address or "native" for the token being bought.
150
+ * ERC-4626 vault contract address.
164
151
  */
165
- output_token: string;
152
+ vault_address: string;
166
153
 
167
154
  /**
168
- * Status of a wallet action.
155
+ * The vault ID.
169
156
  */
170
- status: WalletActionStatus;
171
-
172
- type: 'swap';
157
+ vault_id: string;
173
158
 
174
159
  /**
175
160
  * The ID of the wallet involved in the action.
176
161
  */
177
162
  wallet_id: string;
178
163
 
164
+ /**
165
+ * Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when
166
+ * the token is known in the asset registry.
167
+ */
168
+ amount?: string;
169
+
170
+ /**
171
+ * Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in
172
+ * the asset registry.
173
+ */
174
+ asset?: string;
175
+
176
+ /**
177
+ * Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only
178
+ * present when the token is known in the asset registry.
179
+ */
180
+ decimals?: number;
181
+
179
182
  /**
180
183
  * A description of why a wallet action (or a step within a wallet action) failed.
181
184
  */
@@ -188,45 +191,58 @@ export interface SwapActionResponse {
188
191
  }
189
192
 
190
193
  /**
191
- * Response for a transfer action.
194
+ * Input for depositing assets into an ERC-4626 vault. Exactly one of `amount` or
195
+ * `raw_amount` must be provided.
192
196
  */
193
- export interface TransferActionResponse {
197
+ export interface EarnDepositRequestBody {
194
198
  /**
195
- * The ID of the wallet action.
199
+ * The ID of the vault to deposit into.
196
200
  */
197
- id: string;
201
+ vault_id: string;
198
202
 
199
203
  /**
200
- * ISO 8601 timestamp of when the wallet action was created.
204
+ * Human-readable decimal amount to deposit (e.g. "1.5" for 1.5 USDC). Exactly one
205
+ * of `amount` or `raw_amount` must be provided.
201
206
  */
202
- created_at: string;
207
+ amount?: string;
203
208
 
204
209
  /**
205
- * Recipient address.
210
+ * Amount in smallest unit to deposit (e.g. "1500000" for 1.5 USDC with 6
211
+ * decimals). Exactly one of `amount` or `raw_amount` must be provided.
206
212
  */
207
- destination_address: string;
213
+ raw_amount?: string;
214
+ }
215
+
216
+ /**
217
+ * Response for an earn incentive claim action.
218
+ */
219
+ export interface EarnIncentiveClaimActionResponse {
220
+ /**
221
+ * The ID of the wallet action.
222
+ */
223
+ id: string;
208
224
 
209
225
  /**
210
- * Decimal amount as the user provided (e.g. "1.5").
226
+ * EVM chain name (e.g. "base", "ethereum").
211
227
  */
212
- source_amount: string;
228
+ chain: string;
213
229
 
214
230
  /**
215
- * Asset identifier (e.g. "usdc", "eth").
231
+ * ISO 8601 timestamp of when the wallet action was created.
216
232
  */
217
- source_asset: string;
233
+ created_at: string;
218
234
 
219
235
  /**
220
- * Chain name (e.g. "base", "ethereum").
236
+ * Claimed reward tokens. Populated after the preparation step fetches from Merkl.
221
237
  */
222
- source_chain: string;
238
+ rewards: Array<EarnIncetiveClaimRewardEntry> | null;
223
239
 
224
240
  /**
225
241
  * Status of a wallet action.
226
242
  */
227
243
  status: WalletActionStatus;
228
244
 
229
- type: 'transfer';
245
+ type: 'earn_incentive_claim';
230
246
 
231
247
  /**
232
248
  * The ID of the wallet involved in the action.
@@ -244,6 +260,18 @@ export interface TransferActionResponse {
244
260
  steps?: Array<WalletActionStep>;
245
261
  }
246
262
 
263
+ /**
264
+ * Input for claiming incentive rewards.
265
+ */
266
+ export interface EarnIncentiveClaimRequestBody {
267
+ /**
268
+ * The blockchain network on which to perform the incentive claim. Supported chains
269
+ * include: 'ethereum', 'base', 'arbitrum', 'polygon', 'solana', and more, along
270
+ * with their respective testnets.
271
+ */
272
+ chain: string;
273
+ }
274
+
247
275
  /**
248
276
  * A specific reward token and amount associated with an earn incentive claim.
249
277
  */
@@ -262,12 +290,17 @@ export interface EarnIncetiveClaimRewardEntry {
262
290
  * Symbol of the reward token (e.g. "MORPHO").
263
291
  */
264
292
  token_symbol: string;
293
+
294
+ /**
295
+ * Number of decimal places for the reward token.
296
+ */
297
+ token_decimals?: number;
265
298
  }
266
299
 
267
300
  /**
268
- * Response for an earn deposit action.
301
+ * Response for an earn withdraw action.
269
302
  */
270
- export interface EarnDepositActionResponse {
303
+ export interface EarnWithdrawActionResponse {
271
304
  /**
272
305
  * The ID of the wallet action.
273
306
  */
@@ -289,12 +322,12 @@ export interface EarnDepositActionResponse {
289
322
  created_at: string;
290
323
 
291
324
  /**
292
- * Base-unit amount of asset deposited (e.g. "1500000").
325
+ * Base-unit amount of asset withdrawn (e.g. "1500000").
293
326
  */
294
327
  raw_amount: string;
295
328
 
296
329
  /**
297
- * Vault shares received in base units. Populated after on-chain confirmation.
330
+ * Vault shares burned in base units. Populated after on-chain confirmation.
298
331
  */
299
332
  share_amount: string | null;
300
333
 
@@ -303,7 +336,7 @@ export interface EarnDepositActionResponse {
303
336
  */
304
337
  status: WalletActionStatus;
305
338
 
306
- type: 'earn_deposit';
339
+ type: 'earn_withdraw';
307
340
 
308
341
  /**
309
342
  * ERC-4626 vault contract address.
@@ -321,7 +354,7 @@ export interface EarnDepositActionResponse {
321
354
  wallet_id: string;
322
355
 
323
356
  /**
324
- * Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when
357
+ * Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when
325
358
  * the token is known in the asset registry.
326
359
  */
327
360
  amount?: string;
@@ -350,103 +383,198 @@ export interface EarnDepositActionResponse {
350
383
  }
351
384
 
352
385
  /**
353
- * Response for an earn withdraw action.
386
+ * Input for withdrawing assets from an ERC-4626 vault. Exactly one of `amount` or
387
+ * `raw_amount` must be provided.
354
388
  */
355
- export interface EarnWithdrawActionResponse {
389
+ export interface EarnWithdrawRequestBody {
356
390
  /**
357
- * The ID of the wallet action.
391
+ * The ID of the vault to withdraw from.
392
+ */
393
+ vault_id: string;
394
+
395
+ /**
396
+ * Human-readable decimal amount to withdraw (e.g. "1.5" for 1.5 USDC). Exactly one
397
+ * of `amount` or `raw_amount` must be provided.
398
+ */
399
+ amount?: string;
400
+
401
+ /**
402
+ * Amount in smallest unit to withdraw (e.g. "1500000" for 1.5 USDC with 6
403
+ * decimals). Exactly one of `amount` or `raw_amount` must be provided.
404
+ */
405
+ raw_amount?: string;
406
+ }
407
+
408
+ /**
409
+ * Query parameters for fetching an earn vault position.
410
+ */
411
+ export interface EthereumEarnPositionQuery {
412
+ /**
413
+ * The vault ID to get position for.
414
+ */
415
+ vault_id: string;
416
+ }
417
+
418
+ /**
419
+ * A wallet's position in an earn vault.
420
+ */
421
+ export interface EthereumEarnPositionResponse {
422
+ /**
423
+ * Asset metadata for an earn vault position.
424
+ */
425
+ asset: EarnAsset;
426
+
427
+ /**
428
+ * Current asset value in the vault (realtime from ERC-4626), in smallest unit.
429
+ */
430
+ assets_in_vault: string;
431
+
432
+ /**
433
+ * Current vault shares held (realtime from ERC-4626).
434
+ */
435
+ shares_in_vault: string;
436
+
437
+ /**
438
+ * Total amount deposited into the vault, in smallest unit.
439
+ */
440
+ total_deposited: string;
441
+
442
+ /**
443
+ * Total amount withdrawn from the vault, in smallest unit.
444
+ */
445
+ total_withdrawn: string;
446
+ }
447
+
448
+ /**
449
+ * Supported earn provider protocols.
450
+ */
451
+ export type EthereumEarnProvider = 'morpho' | 'aave';
452
+
453
+ /**
454
+ * Detailed vault information including current APY, liquidity, and asset metadata.
455
+ */
456
+ export interface EthereumEarnVaultDetailsResponse {
457
+ /**
458
+ * Vault identifier.
358
459
  */
359
460
  id: string;
360
461
 
361
462
  /**
362
- * Underlying asset token address.
463
+ * Annual percentage yield earned by the app from fee wrapper fees, in basis
464
+ * points.
363
465
  */
364
- asset_address: string;
466
+ app_apy: number | null;
365
467
 
366
468
  /**
367
- * CAIP-2 chain identifier.
469
+ * Asset metadata for an earn vault position.
368
470
  */
369
- caip2: string;
471
+ asset: EarnAsset;
370
472
 
371
473
  /**
372
- * ISO 8601 timestamp of when the wallet action was created.
474
+ * Available liquidity in USD.
373
475
  */
374
- created_at: string;
476
+ available_liquidity_usd: number | null;
375
477
 
376
478
  /**
377
- * Base-unit amount of asset withdrawn (e.g. "1500000").
479
+ * CAIP-2 chain identifier (e.g. "eip155:8453").
378
480
  */
379
- raw_amount: string;
481
+ caip2: string;
380
482
 
381
483
  /**
382
- * Vault shares burned in base units. Populated after on-chain confirmation.
484
+ * Human-readable vault name from the yield provider.
383
485
  */
384
- share_amount: string | null;
486
+ name: string;
385
487
 
386
488
  /**
387
- * Status of a wallet action.
489
+ * Supported earn provider protocols.
388
490
  */
389
- status: WalletActionStatus;
491
+ provider: EthereumEarnProvider;
390
492
 
391
- type: 'earn_withdraw';
493
+ /**
494
+ * Total value locked in USD.
495
+ */
496
+ tvl_usd: number | null;
392
497
 
393
498
  /**
394
- * ERC-4626 vault contract address.
499
+ * Current annual percentage yield in basis points (e.g. 500 for 5%). 1 basis point
500
+ * = 0.01%.
395
501
  */
396
- vault_address: string;
502
+ user_apy: number | null;
397
503
 
398
504
  /**
399
- * The vault ID.
505
+ * Onchain vault contract address.
400
506
  */
401
- vault_id: string;
507
+ vault_address: string;
508
+ }
402
509
 
510
+ /**
511
+ * A description of why a wallet action (or a step within a wallet action) failed.
512
+ */
513
+ export interface FailureReason {
403
514
  /**
404
- * The ID of the wallet involved in the action.
515
+ * Human-readable failure message.
405
516
  */
406
- wallet_id: string;
517
+ message: string;
407
518
 
408
519
  /**
409
- * Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when
410
- * the token is known in the asset registry.
520
+ * Additional error details, if available.
411
521
  */
412
- amount?: string;
522
+ details?: unknown;
523
+ }
413
524
 
525
+ /**
526
+ * A wallet action step consisting of an SVM (Solana) transaction.
527
+ */
528
+ export interface SvmTransactionWalletActionStep {
414
529
  /**
415
- * Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in
416
- * the asset registry.
530
+ * CAIP-2 chain identifier for the Solana network.
417
531
  */
418
- asset?: string;
532
+ caip2: string;
419
533
 
420
534
  /**
421
- * Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only
422
- * present when the token is known in the asset registry.
535
+ * Status of an SVM step in a wallet action.
423
536
  */
424
- decimals?: number;
537
+ status: SvmWalletActionStepStatus;
425
538
 
426
539
  /**
427
- * A description of why a wallet action (or a step within a wallet action) failed.
540
+ * The Solana transaction signature (base58-encoded). Null until broadcast.
428
541
  */
429
- failure_reason?: FailureReason;
542
+ transaction_signature: string | null;
543
+
544
+ type: 'svm_transaction';
430
545
 
431
546
  /**
432
- * The steps of the wallet action. Only returned if `?include=steps` is provided.
547
+ * A description of why a wallet action (or a step within a wallet action) failed.
433
548
  */
434
- steps?: Array<WalletActionStep>;
549
+ failure_reason?: FailureReason;
435
550
  }
436
551
 
437
552
  /**
438
- * Response for an earn incentive claim action.
553
+ * Status of an SVM step in a wallet action.
439
554
  */
440
- export interface EarnIncentiveClaimActionResponse {
555
+ export type SvmWalletActionStepStatus =
556
+ | 'preparing'
557
+ | 'queued'
558
+ | 'pending'
559
+ | 'confirmed'
560
+ | 'finalized'
561
+ | 'rejected'
562
+ | 'reverted'
563
+ | 'failed';
564
+
565
+ /**
566
+ * Response for a swap action.
567
+ */
568
+ export interface SwapActionResponse {
441
569
  /**
442
570
  * The ID of the wallet action.
443
571
  */
444
572
  id: string;
445
573
 
446
574
  /**
447
- * EVM chain name (e.g. "base", "ethereum").
575
+ * CAIP-2 chain identifier for the swap.
448
576
  */
449
- chain: string;
577
+ caip2: string;
450
578
 
451
579
  /**
452
580
  * ISO 8601 timestamp of when the wallet action was created.
@@ -454,16 +582,31 @@ export interface EarnIncentiveClaimActionResponse {
454
582
  created_at: string;
455
583
 
456
584
  /**
457
- * Claimed reward tokens. Populated after the preparation step fetches from Merkl.
585
+ * Exact base-unit amount of input token. Populated after on-chain confirmation.
458
586
  */
459
- rewards: Array<EarnIncetiveClaimRewardEntry> | null;
587
+ input_amount: string | null;
588
+
589
+ /**
590
+ * Token address or "native" for the token being sold.
591
+ */
592
+ input_token: string;
593
+
594
+ /**
595
+ * Exact base-unit amount of output token. Populated after on-chain confirmation.
596
+ */
597
+ output_amount: string | null;
598
+
599
+ /**
600
+ * Token address or "native" for the token being bought.
601
+ */
602
+ output_token: string;
460
603
 
461
604
  /**
462
605
  * Status of a wallet action.
463
606
  */
464
607
  status: WalletActionStatus;
465
608
 
466
- type: 'earn_incentive_claim';
609
+ type: 'swap';
467
610
 
468
611
  /**
469
612
  * The ID of the wallet involved in the action.
@@ -482,92 +625,156 @@ export interface EarnIncentiveClaimActionResponse {
482
625
  }
483
626
 
484
627
  /**
485
- * Response for a wallet action, discriminated on type.
628
+ * Response for a transfer action.
486
629
  */
487
- export type WalletActionResponse =
488
- | SwapActionResponse
489
- | TransferActionResponse
490
- | EarnDepositActionResponse
491
- | EarnWithdrawActionResponse
492
- | EarnIncentiveClaimActionResponse;
630
+ export interface TransferActionResponse {
631
+ /**
632
+ * The ID of the wallet action.
633
+ */
634
+ id: string;
493
635
 
494
- /**
495
- * Input for depositing assets into an ERC-4626 vault. Exactly one of `amount` or
496
- * `raw_amount` must be provided.
497
- */
498
- export interface EarnDepositRequestBody {
499
636
  /**
500
- * The ID of the vault to deposit into.
637
+ * ISO 8601 timestamp of when the wallet action was created.
501
638
  */
502
- vault_id: string;
639
+ created_at: string;
503
640
 
504
641
  /**
505
- * Human-readable decimal amount to deposit (e.g. "1.5" for 1.5 USDC). Exactly one
506
- * of `amount` or `raw_amount` must be provided.
642
+ * Recipient address.
507
643
  */
508
- amount?: string;
644
+ destination_address: string;
509
645
 
510
646
  /**
511
- * Amount in smallest unit to deposit (e.g. "1500000" for 1.5 USDC with 6
512
- * decimals). Exactly one of `amount` or `raw_amount` must be provided.
647
+ * Chain name (e.g. "base", "ethereum").
513
648
  */
514
- raw_amount?: string;
515
- }
649
+ source_chain: string;
516
650
 
517
- /**
518
- * Input for withdrawing assets from an ERC-4626 vault. Exactly one of `amount` or
519
- * `raw_amount` must be provided.
520
- */
521
- export interface EarnWithdrawRequestBody {
522
651
  /**
523
- * The ID of the vault to withdraw from.
652
+ * Status of a wallet action.
524
653
  */
525
- vault_id: string;
654
+ status: WalletActionStatus;
655
+
656
+ type: 'transfer';
526
657
 
527
658
  /**
528
- * Human-readable decimal amount to withdraw (e.g. "1.5" for 1.5 USDC). Exactly one
529
- * of `amount` or `raw_amount` must be provided.
659
+ * The ID of the wallet involved in the action.
530
660
  */
531
- amount?: string;
661
+ wallet_id: string;
532
662
 
533
663
  /**
534
- * Amount in smallest unit to withdraw (e.g. "1500000" for 1.5 USDC with 6
535
- * decimals). Exactly one of `amount` or `raw_amount` must be provided.
664
+ * Amount received on the destination chain. Populated immediately for exact_output
665
+ * transfers, or after fill confirmation for exact_input transfers.
536
666
  */
537
- raw_amount?: string;
538
- }
667
+ destination_amount?: string;
539
668
 
540
- /**
541
- * Input for claiming incentive rewards.
542
- */
543
- export interface EarnIncentiveClaimRequestBody {
544
669
  /**
545
- * The blockchain network on which to perform the incentive claim. Supported chains
546
- * include: 'ethereum', 'base', 'arbitrum', 'polygon', 'solana', and more, along
547
- * with their respective testnets.
670
+ * Destination asset for cross-asset transfers. Omitted for same-asset transfers.
548
671
  */
549
- chain: string;
672
+ destination_asset?: string;
673
+
674
+ /**
675
+ * Destination chain for cross-chain transfers. Omitted for same-chain transfers.
676
+ */
677
+ destination_chain?: string;
678
+
679
+ /**
680
+ * A description of why a wallet action (or a step within a wallet action) failed.
681
+ */
682
+ failure_reason?: FailureReason;
683
+
684
+ /**
685
+ * Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output
686
+ * cross-chain transfers until the source amount is determined.
687
+ */
688
+ source_amount?: string;
689
+
690
+ /**
691
+ * Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated
692
+ * with a named asset; omitted for custom-token transfers.
693
+ */
694
+ source_asset?: string;
695
+
696
+ /**
697
+ * Token contract address (EVM) or mint address (Solana). Present when the transfer
698
+ * was initiated with `asset_address`.
699
+ */
700
+ source_asset_address?: string;
701
+
702
+ /**
703
+ * Number of decimals for the transferred token. Present when the transfer was
704
+ * initiated with `asset_address` and the decimals were resolved on-chain.
705
+ */
706
+ source_asset_decimals?: number;
707
+
708
+ /**
709
+ * The steps of the wallet action. Only returned if `?include=steps` is provided.
710
+ */
711
+ steps?: Array<WalletActionStep>;
550
712
  }
551
713
 
714
+ /**
715
+ * Response for a wallet action, discriminated on type.
716
+ */
717
+ export type WalletActionResponse =
718
+ | SwapActionResponse
719
+ | TransferActionResponse
720
+ | EarnDepositActionResponse
721
+ | EarnWithdrawActionResponse
722
+ | EarnIncentiveClaimActionResponse;
723
+
724
+ /**
725
+ * Status of a wallet action.
726
+ */
727
+ export type WalletActionStatus = 'pending' | 'succeeded' | 'rejected' | 'failed';
728
+
729
+ /**
730
+ * A step within a wallet action, representing a single onchain action.
731
+ */
732
+ export type WalletActionStep =
733
+ | EvmTransactionWalletActionStep
734
+ | EvmUserOperationWalletActionStep
735
+ | SvmTransactionWalletActionStep;
736
+
737
+ /**
738
+ * Type of a wallet action step.
739
+ */
740
+ export type WalletActionStepType = 'evm_transaction' | 'evm_user_operation' | 'svm_transaction';
741
+
742
+ /**
743
+ * Type of wallet action
744
+ */
745
+ export type WalletActionType =
746
+ | 'swap'
747
+ | 'transfer'
748
+ | 'earn_deposit'
749
+ | 'earn_withdraw'
750
+ | 'earn_incentive_claim';
751
+
552
752
  export declare namespace WalletActions {
553
753
  export {
554
- type WalletActionType as WalletActionType,
555
- type WalletActionStatus as WalletActionStatus,
556
- type WalletActionStepType as WalletActionStepType,
557
- type EvmWalletActionStepStatus as EvmWalletActionStepStatus,
558
- type FailureReason as FailureReason,
559
754
  type EvmTransactionWalletActionStep as EvmTransactionWalletActionStep,
560
755
  type EvmUserOperationWalletActionStep as EvmUserOperationWalletActionStep,
561
- type WalletActionStep as WalletActionStep,
562
- type SwapActionResponse as SwapActionResponse,
563
- type TransferActionResponse as TransferActionResponse,
564
- type EarnIncetiveClaimRewardEntry as EarnIncetiveClaimRewardEntry,
756
+ type EvmWalletActionStepStatus as EvmWalletActionStepStatus,
757
+ type EarnAsset as EarnAsset,
565
758
  type EarnDepositActionResponse as EarnDepositActionResponse,
566
- type EarnWithdrawActionResponse as EarnWithdrawActionResponse,
567
- type EarnIncentiveClaimActionResponse as EarnIncentiveClaimActionResponse,
568
- type WalletActionResponse as WalletActionResponse,
569
759
  type EarnDepositRequestBody as EarnDepositRequestBody,
570
- type EarnWithdrawRequestBody as EarnWithdrawRequestBody,
760
+ type EarnIncentiveClaimActionResponse as EarnIncentiveClaimActionResponse,
571
761
  type EarnIncentiveClaimRequestBody as EarnIncentiveClaimRequestBody,
762
+ type EarnIncetiveClaimRewardEntry as EarnIncetiveClaimRewardEntry,
763
+ type EarnWithdrawActionResponse as EarnWithdrawActionResponse,
764
+ type EarnWithdrawRequestBody as EarnWithdrawRequestBody,
765
+ type EthereumEarnPositionQuery as EthereumEarnPositionQuery,
766
+ type EthereumEarnPositionResponse as EthereumEarnPositionResponse,
767
+ type EthereumEarnProvider as EthereumEarnProvider,
768
+ type EthereumEarnVaultDetailsResponse as EthereumEarnVaultDetailsResponse,
769
+ type FailureReason as FailureReason,
770
+ type SvmTransactionWalletActionStep as SvmTransactionWalletActionStep,
771
+ type SvmWalletActionStepStatus as SvmWalletActionStepStatus,
772
+ type SwapActionResponse as SwapActionResponse,
773
+ type TransferActionResponse as TransferActionResponse,
774
+ type WalletActionResponse as WalletActionResponse,
775
+ type WalletActionStatus as WalletActionStatus,
776
+ type WalletActionStep as WalletActionStep,
777
+ type WalletActionStepType as WalletActionStepType,
778
+ type WalletActionType as WalletActionType,
572
779
  };
573
780
  }