@privy-io/api-types 0.8.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 (167) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/client.d.mts +35 -32
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +35 -32
  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 +22 -8
  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/internal/utils/env.js +2 -2
  15. package/internal/utils/env.js.map +1 -1
  16. package/internal/utils/env.mjs +2 -2
  17. package/internal/utils/env.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/resources/accounts.d.mts +128 -86
  20. package/resources/accounts.d.mts.map +1 -1
  21. package/resources/accounts.d.ts +128 -86
  22. package/resources/accounts.d.ts.map +1 -1
  23. package/resources/aggregations.d.mts +43 -43
  24. package/resources/aggregations.d.mts.map +1 -1
  25. package/resources/aggregations.d.ts +43 -43
  26. package/resources/aggregations.d.ts.map +1 -1
  27. package/resources/apps.d.mts +177 -129
  28. package/resources/apps.d.mts.map +1 -1
  29. package/resources/apps.d.ts +177 -129
  30. package/resources/apps.d.ts.map +1 -1
  31. package/resources/client-auth.d.mts +650 -648
  32. package/resources/client-auth.d.mts.map +1 -1
  33. package/resources/client-auth.d.ts +650 -648
  34. package/resources/client-auth.d.ts.map +1 -1
  35. package/resources/embedded-wallets.d.mts +84 -84
  36. package/resources/embedded-wallets.d.mts.map +1 -1
  37. package/resources/embedded-wallets.d.ts +84 -84
  38. package/resources/embedded-wallets.d.ts.map +1 -1
  39. package/resources/funding.d.mts +42 -42
  40. package/resources/funding.d.mts.map +1 -1
  41. package/resources/funding.d.ts +42 -42
  42. package/resources/funding.d.ts.map +1 -1
  43. package/resources/index.d.mts +19 -18
  44. package/resources/index.d.mts.map +1 -1
  45. package/resources/index.d.ts +19 -18
  46. package/resources/index.d.ts.map +1 -1
  47. package/resources/index.js +3 -1
  48. package/resources/index.js.map +1 -1
  49. package/resources/index.mjs +2 -1
  50. package/resources/index.mjs.map +1 -1
  51. package/resources/intents.d.mts +270 -266
  52. package/resources/intents.d.mts.map +1 -1
  53. package/resources/intents.d.ts +270 -266
  54. package/resources/intents.d.ts.map +1 -1
  55. package/resources/key-quorums.d.mts +20 -20
  56. package/resources/key-quorums.d.mts.map +1 -1
  57. package/resources/key-quorums.d.ts +20 -20
  58. package/resources/key-quorums.d.ts.map +1 -1
  59. package/resources/kraken-embed.d.mts +62 -19
  60. package/resources/kraken-embed.d.mts.map +1 -1
  61. package/resources/kraken-embed.d.ts +62 -19
  62. package/resources/kraken-embed.d.ts.map +1 -1
  63. package/resources/organizations.d.mts +65 -0
  64. package/resources/organizations.d.mts.map +1 -0
  65. package/resources/organizations.d.ts +65 -0
  66. package/resources/organizations.d.ts.map +1 -0
  67. package/resources/organizations.js +9 -0
  68. package/resources/organizations.js.map +1 -0
  69. package/resources/organizations.mjs +5 -0
  70. package/resources/organizations.mjs.map +1 -0
  71. package/resources/policies.d.mts +360 -231
  72. package/resources/policies.d.mts.map +1 -1
  73. package/resources/policies.d.ts +360 -231
  74. package/resources/policies.d.ts.map +1 -1
  75. package/resources/shared.d.mts +28 -28
  76. package/resources/shared.d.mts.map +1 -1
  77. package/resources/shared.d.ts +28 -28
  78. package/resources/shared.d.ts.map +1 -1
  79. package/resources/swaps.d.mts +8 -11
  80. package/resources/swaps.d.mts.map +1 -1
  81. package/resources/swaps.d.ts +8 -11
  82. package/resources/swaps.d.ts.map +1 -1
  83. package/resources/swaps.js.map +1 -1
  84. package/resources/swaps.mjs.map +1 -1
  85. package/resources/transactions.d.mts +56 -66
  86. package/resources/transactions.d.mts.map +1 -1
  87. package/resources/transactions.d.ts +56 -66
  88. package/resources/transactions.d.ts.map +1 -1
  89. package/resources/users.d.mts +457 -448
  90. package/resources/users.d.mts.map +1 -1
  91. package/resources/users.d.ts +457 -448
  92. package/resources/users.d.ts.map +1 -1
  93. package/resources/wallet-actions.d.mts +450 -41
  94. package/resources/wallet-actions.d.mts.map +1 -1
  95. package/resources/wallet-actions.d.ts +450 -41
  96. package/resources/wallet-actions.d.ts.map +1 -1
  97. package/resources/wallets/balance.d.mts +2 -1
  98. package/resources/wallets/balance.d.mts.map +1 -1
  99. package/resources/wallets/balance.d.ts +2 -1
  100. package/resources/wallets/balance.d.ts.map +1 -1
  101. package/resources/wallets/balance.js.map +1 -1
  102. package/resources/wallets/balance.mjs.map +1 -1
  103. package/resources/wallets/index.d.mts +1 -1
  104. package/resources/wallets/index.d.mts.map +1 -1
  105. package/resources/wallets/index.d.ts +1 -1
  106. package/resources/wallets/index.d.ts.map +1 -1
  107. package/resources/wallets/index.js.map +1 -1
  108. package/resources/wallets/index.mjs.map +1 -1
  109. package/resources/wallets/transactions.d.mts +16 -31
  110. package/resources/wallets/transactions.d.mts.map +1 -1
  111. package/resources/wallets/transactions.d.ts +16 -31
  112. package/resources/wallets/transactions.d.ts.map +1 -1
  113. package/resources/wallets/transactions.js +1 -1
  114. package/resources/wallets/transactions.js.map +1 -1
  115. package/resources/wallets/transactions.mjs +1 -1
  116. package/resources/wallets/transactions.mjs.map +1 -1
  117. package/resources/wallets/wallets.d.mts +1475 -1172
  118. package/resources/wallets/wallets.d.mts.map +1 -1
  119. package/resources/wallets/wallets.d.ts +1475 -1172
  120. package/resources/wallets/wallets.d.ts.map +1 -1
  121. package/resources/wallets/wallets.js +10 -6
  122. package/resources/wallets/wallets.js.map +1 -1
  123. package/resources/wallets/wallets.mjs +10 -6
  124. package/resources/wallets/wallets.mjs.map +1 -1
  125. package/resources/webhooks.d.mts +1345 -582
  126. package/resources/webhooks.d.mts.map +1 -1
  127. package/resources/webhooks.d.ts +1345 -582
  128. package/resources/webhooks.d.ts.map +1 -1
  129. package/resources/yield.d.mts +157 -157
  130. package/resources/yield.d.mts.map +1 -1
  131. package/resources/yield.d.ts +157 -157
  132. package/resources/yield.d.ts.map +1 -1
  133. package/src/client.ts +661 -455
  134. package/src/internal/types.ts +6 -8
  135. package/src/internal/utils/env.ts +2 -2
  136. package/src/resources/accounts.ts +157 -103
  137. package/src/resources/aggregations.ts +55 -55
  138. package/src/resources/apps.ts +232 -166
  139. package/src/resources/client-auth.ts +890 -890
  140. package/src/resources/embedded-wallets.ts +123 -123
  141. package/src/resources/funding.ts +66 -66
  142. package/src/resources/index.ts +521 -431
  143. package/src/resources/intents.ts +326 -322
  144. package/src/resources/key-quorums.ts +23 -23
  145. package/src/resources/kraken-embed.ts +116 -19
  146. package/src/resources/organizations.ts +82 -0
  147. package/src/resources/policies.ts +495 -339
  148. package/src/resources/shared.ts +34 -34
  149. package/src/resources/swaps.ts +9 -14
  150. package/src/resources/transactions.ts +88 -115
  151. package/src/resources/users.ts +664 -653
  152. package/src/resources/wallet-actions.ts +585 -56
  153. package/src/resources/wallets/balance.ts +2 -1
  154. package/src/resources/wallets/index.ts +158 -138
  155. package/src/resources/wallets/transactions.ts +20 -83
  156. package/src/resources/wallets/wallets.ts +1997 -1563
  157. package/src/resources/webhooks.ts +1652 -700
  158. package/src/resources/yield.ts +188 -188
  159. package/src/version.ts +1 -1
  160. package/version.d.mts +1 -1
  161. package/version.d.mts.map +1 -1
  162. package/version.d.ts +1 -1
  163. package/version.d.ts.map +1 -1
  164. package/version.js +1 -1
  165. package/version.js.map +1 -1
  166. package/version.mjs +1 -1
  167. package/version.mjs.map +1 -1
@@ -5,19 +5,71 @@ import { APIResource } from '../core/resource';
5
5
  export class WalletActions extends APIResource {}
6
6
 
7
7
  /**
8
- * Type of wallet action
8
+ * A wallet action step consisting of an EVM transaction.
9
9
  */
10
- export type WalletActionType = 'swap' | 'transfer';
10
+ export interface EvmTransactionWalletActionStep {
11
+ /**
12
+ * CAIP-2 chain identifier of the transaction, containing the chain ID.
13
+ */
14
+ caip2: string;
11
15
 
12
- /**
13
- * Status of a wallet action.
14
- */
15
- export type WalletActionStatus = 'pending' | 'succeeded' | 'rejected' | 'failed';
16
+ /**
17
+ * Status of an EVM step in a wallet action.
18
+ */
19
+ status: EvmWalletActionStepStatus;
20
+
21
+ /**
22
+ * The transaction hash for this step. May change while the step status is
23
+ * non-terminal.
24
+ */
25
+ transaction_hash: string | null;
26
+
27
+ type: 'evm_transaction';
28
+
29
+ /**
30
+ * A description of why a wallet action (or a step within a wallet action) failed.
31
+ */
32
+ failure_reason?: FailureReason;
33
+ }
16
34
 
17
35
  /**
18
- * Type of a wallet action step.
36
+ * A wallet action step consisting of an EVM user operation.
19
37
  */
20
- export type WalletActionStepType = 'evm_transaction' | 'evm_user_operation';
38
+ export interface EvmUserOperationWalletActionStep {
39
+ /**
40
+ * Transaction hash of the bundle in which this user operation was included. Null
41
+ * until included by a bundler.
42
+ */
43
+ bundle_transaction_hash: string | null;
44
+
45
+ /**
46
+ * CAIP-2 network identifier, containing the chain ID of the user operation.
47
+ */
48
+ caip2: string;
49
+
50
+ /**
51
+ * The entrypoint version of the user operation.
52
+ */
53
+ entrypoint_version: '0.6' | '0.7' | '0.8' | '0.9';
54
+
55
+ /**
56
+ * Status of an EVM step in a wallet action.
57
+ */
58
+ status: EvmWalletActionStepStatus;
59
+
60
+ type: 'evm_user_operation';
61
+
62
+ /**
63
+ * The user operation hash for this step. May change while the step status is
64
+ * non-terminal.
65
+ */
66
+ user_operation_hash: string | null;
67
+
68
+ /**
69
+ * A description of why a wallet action (or a step within a wallet action) failed.
70
+ */
71
+ failure_reason?: FailureReason;
72
+ }
21
73
 
22
74
  /**
23
75
  * Status of an EVM step in a wallet action.
@@ -34,91 +86,481 @@ export type EvmWalletActionStepStatus =
34
86
  | 'abandoned';
35
87
 
36
88
  /**
37
- * A description of why a wallet action (or a step within a wallet action) failed.
89
+ * Asset metadata for an earn vault position.
38
90
  */
39
- export interface FailureReason {
91
+ export interface EarnAsset {
40
92
  /**
41
- * Human-readable failure message.
93
+ * Token contract address.
42
94
  */
43
- message: string;
95
+ address: string;
44
96
 
45
97
  /**
46
- * Additional error details, if available.
98
+ * Number of decimals for the asset (e.g. 6 for USDC).
47
99
  */
48
- details?: unknown;
100
+ decimals: number;
101
+
102
+ /**
103
+ * Lowercase token symbol (e.g. "usdc").
104
+ */
105
+ symbol: string;
49
106
  }
50
107
 
51
108
  /**
52
- * A wallet action step consisting of an EVM transaction.
109
+ * Response for an earn deposit action.
53
110
  */
54
- export interface EvmTransactionWalletActionStep {
111
+ export interface EarnDepositActionResponse {
55
112
  /**
56
- * CAIP-2 chain identifier of the transaction, containing the chain ID.
113
+ * The ID of the wallet action.
114
+ */
115
+ id: string;
116
+
117
+ /**
118
+ * Underlying asset token address.
119
+ */
120
+ asset_address: string;
121
+
122
+ /**
123
+ * CAIP-2 chain identifier.
57
124
  */
58
125
  caip2: string;
59
126
 
60
127
  /**
61
- * Status of an EVM step in a wallet action.
128
+ * ISO 8601 timestamp of when the wallet action was created.
62
129
  */
63
- status: EvmWalletActionStepStatus;
130
+ created_at: string;
64
131
 
65
132
  /**
66
- * The transaction hash for this step. May change while the step status is
67
- * non-terminal.
133
+ * Base-unit amount of asset deposited (e.g. "1500000").
68
134
  */
69
- transaction_hash: string | null;
135
+ raw_amount: string;
70
136
 
71
- type: 'evm_transaction';
137
+ /**
138
+ * Vault shares received in base units. Populated after on-chain confirmation.
139
+ */
140
+ share_amount: string | null;
141
+
142
+ /**
143
+ * Status of a wallet action.
144
+ */
145
+ status: WalletActionStatus;
146
+
147
+ type: 'earn_deposit';
148
+
149
+ /**
150
+ * ERC-4626 vault contract address.
151
+ */
152
+ vault_address: string;
153
+
154
+ /**
155
+ * The vault ID.
156
+ */
157
+ vault_id: string;
158
+
159
+ /**
160
+ * The ID of the wallet involved in the action.
161
+ */
162
+ wallet_id: string;
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;
72
181
 
73
182
  /**
74
183
  * A description of why a wallet action (or a step within a wallet action) failed.
75
184
  */
76
185
  failure_reason?: FailureReason;
186
+
187
+ /**
188
+ * The steps of the wallet action. Only returned if `?include=steps` is provided.
189
+ */
190
+ steps?: Array<WalletActionStep>;
77
191
  }
78
192
 
79
193
  /**
80
- * A wallet action step consisting of an EVM user operation.
194
+ * Input for depositing assets into an ERC-4626 vault. Exactly one of `amount` or
195
+ * `raw_amount` must be provided.
81
196
  */
82
- export interface EvmUserOperationWalletActionStep {
197
+ export interface EarnDepositRequestBody {
83
198
  /**
84
- * Transaction hash of the bundle in which this user operation was included. Null
85
- * until included by a bundler.
199
+ * The ID of the vault to deposit into.
86
200
  */
87
- bundle_transaction_hash: string | null;
201
+ vault_id: string;
88
202
 
89
203
  /**
90
- * CAIP-2 network identifier, containing the chain ID of the user operation.
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.
206
+ */
207
+ amount?: string;
208
+
209
+ /**
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.
212
+ */
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;
224
+
225
+ /**
226
+ * EVM chain name (e.g. "base", "ethereum").
227
+ */
228
+ chain: string;
229
+
230
+ /**
231
+ * ISO 8601 timestamp of when the wallet action was created.
232
+ */
233
+ created_at: string;
234
+
235
+ /**
236
+ * Claimed reward tokens. Populated after the preparation step fetches from Merkl.
237
+ */
238
+ rewards: Array<EarnIncetiveClaimRewardEntry> | null;
239
+
240
+ /**
241
+ * Status of a wallet action.
242
+ */
243
+ status: WalletActionStatus;
244
+
245
+ type: 'earn_incentive_claim';
246
+
247
+ /**
248
+ * The ID of the wallet involved in the action.
249
+ */
250
+ wallet_id: string;
251
+
252
+ /**
253
+ * A description of why a wallet action (or a step within a wallet action) failed.
254
+ */
255
+ failure_reason?: FailureReason;
256
+
257
+ /**
258
+ * The steps of the wallet action. Only returned if `?include=steps` is provided.
259
+ */
260
+ steps?: Array<WalletActionStep>;
261
+ }
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
+
275
+ /**
276
+ * A specific reward token and amount associated with an earn incentive claim.
277
+ */
278
+ export interface EarnIncetiveClaimRewardEntry {
279
+ /**
280
+ * Claimable amount in base units.
281
+ */
282
+ amount: string;
283
+
284
+ /**
285
+ * Address of the reward token.
286
+ */
287
+ token_address: string;
288
+
289
+ /**
290
+ * Symbol of the reward token (e.g. "MORPHO").
291
+ */
292
+ token_symbol: string;
293
+
294
+ /**
295
+ * Number of decimal places for the reward token.
296
+ */
297
+ token_decimals?: number;
298
+ }
299
+
300
+ /**
301
+ * Response for an earn withdraw action.
302
+ */
303
+ export interface EarnWithdrawActionResponse {
304
+ /**
305
+ * The ID of the wallet action.
306
+ */
307
+ id: string;
308
+
309
+ /**
310
+ * Underlying asset token address.
311
+ */
312
+ asset_address: string;
313
+
314
+ /**
315
+ * CAIP-2 chain identifier.
91
316
  */
92
317
  caip2: string;
93
318
 
94
319
  /**
95
- * The entrypoint version of the user operation.
320
+ * ISO 8601 timestamp of when the wallet action was created.
96
321
  */
97
- entrypoint_version: '0.6' | '0.7' | '0.8' | '0.9';
322
+ created_at: string;
98
323
 
99
324
  /**
100
- * Status of an EVM step in a wallet action.
325
+ * Base-unit amount of asset withdrawn (e.g. "1500000").
101
326
  */
102
- status: EvmWalletActionStepStatus;
327
+ raw_amount: string;
103
328
 
104
- type: 'evm_user_operation';
329
+ /**
330
+ * Vault shares burned in base units. Populated after on-chain confirmation.
331
+ */
332
+ share_amount: string | null;
105
333
 
106
334
  /**
107
- * The user operation hash for this step. May change while the step status is
108
- * non-terminal.
335
+ * Status of a wallet action.
109
336
  */
110
- user_operation_hash: string | null;
337
+ status: WalletActionStatus;
338
+
339
+ type: 'earn_withdraw';
340
+
341
+ /**
342
+ * ERC-4626 vault contract address.
343
+ */
344
+ vault_address: string;
345
+
346
+ /**
347
+ * The vault ID.
348
+ */
349
+ vault_id: string;
350
+
351
+ /**
352
+ * The ID of the wallet involved in the action.
353
+ */
354
+ wallet_id: string;
355
+
356
+ /**
357
+ * Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when
358
+ * the token is known in the asset registry.
359
+ */
360
+ amount?: string;
361
+
362
+ /**
363
+ * Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in
364
+ * the asset registry.
365
+ */
366
+ asset?: string;
367
+
368
+ /**
369
+ * Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only
370
+ * present when the token is known in the asset registry.
371
+ */
372
+ decimals?: number;
111
373
 
112
374
  /**
113
375
  * A description of why a wallet action (or a step within a wallet action) failed.
114
376
  */
115
377
  failure_reason?: FailureReason;
378
+
379
+ /**
380
+ * The steps of the wallet action. Only returned if `?include=steps` is provided.
381
+ */
382
+ steps?: Array<WalletActionStep>;
116
383
  }
117
384
 
118
385
  /**
119
- * A step within a wallet action, representing a single onchain action.
386
+ * Input for withdrawing assets from an ERC-4626 vault. Exactly one of `amount` or
387
+ * `raw_amount` must be provided.
388
+ */
389
+ export interface EarnWithdrawRequestBody {
390
+ /**
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.
459
+ */
460
+ id: string;
461
+
462
+ /**
463
+ * Annual percentage yield earned by the app from fee wrapper fees, in basis
464
+ * points.
465
+ */
466
+ app_apy: number | null;
467
+
468
+ /**
469
+ * Asset metadata for an earn vault position.
470
+ */
471
+ asset: EarnAsset;
472
+
473
+ /**
474
+ * Available liquidity in USD.
475
+ */
476
+ available_liquidity_usd: number | null;
477
+
478
+ /**
479
+ * CAIP-2 chain identifier (e.g. "eip155:8453").
480
+ */
481
+ caip2: string;
482
+
483
+ /**
484
+ * Human-readable vault name from the yield provider.
485
+ */
486
+ name: string;
487
+
488
+ /**
489
+ * Supported earn provider protocols.
490
+ */
491
+ provider: EthereumEarnProvider;
492
+
493
+ /**
494
+ * Total value locked in USD.
495
+ */
496
+ tvl_usd: number | null;
497
+
498
+ /**
499
+ * Current annual percentage yield in basis points (e.g. 500 for 5%). 1 basis point
500
+ * = 0.01%.
501
+ */
502
+ user_apy: number | null;
503
+
504
+ /**
505
+ * Onchain vault contract address.
506
+ */
507
+ vault_address: string;
508
+ }
509
+
510
+ /**
511
+ * A description of why a wallet action (or a step within a wallet action) failed.
512
+ */
513
+ export interface FailureReason {
514
+ /**
515
+ * Human-readable failure message.
516
+ */
517
+ message: string;
518
+
519
+ /**
520
+ * Additional error details, if available.
521
+ */
522
+ details?: unknown;
523
+ }
524
+
525
+ /**
526
+ * A wallet action step consisting of an SVM (Solana) transaction.
527
+ */
528
+ export interface SvmTransactionWalletActionStep {
529
+ /**
530
+ * CAIP-2 chain identifier for the Solana network.
531
+ */
532
+ caip2: string;
533
+
534
+ /**
535
+ * Status of an SVM step in a wallet action.
536
+ */
537
+ status: SvmWalletActionStepStatus;
538
+
539
+ /**
540
+ * The Solana transaction signature (base58-encoded). Null until broadcast.
541
+ */
542
+ transaction_signature: string | null;
543
+
544
+ type: 'svm_transaction';
545
+
546
+ /**
547
+ * A description of why a wallet action (or a step within a wallet action) failed.
548
+ */
549
+ failure_reason?: FailureReason;
550
+ }
551
+
552
+ /**
553
+ * Status of an SVM step in a wallet action.
120
554
  */
121
- export type WalletActionStep = EvmTransactionWalletActionStep | EvmUserOperationWalletActionStep;
555
+ export type SvmWalletActionStepStatus =
556
+ | 'preparing'
557
+ | 'queued'
558
+ | 'pending'
559
+ | 'confirmed'
560
+ | 'finalized'
561
+ | 'rejected'
562
+ | 'reverted'
563
+ | 'failed';
122
564
 
123
565
  /**
124
566
  * Response for a swap action.
@@ -171,6 +613,11 @@ export interface SwapActionResponse {
171
613
  */
172
614
  wallet_id: string;
173
615
 
616
+ /**
617
+ * A description of why a wallet action (or a step within a wallet action) failed.
618
+ */
619
+ failure_reason?: FailureReason;
620
+
174
621
  /**
175
622
  * The steps of the wallet action. Only returned if `?include=steps` is provided.
176
623
  */
@@ -196,16 +643,6 @@ export interface TransferActionResponse {
196
643
  */
197
644
  destination_address: string;
198
645
 
199
- /**
200
- * Decimal amount as the user provided (e.g. "1.5").
201
- */
202
- source_amount: string;
203
-
204
- /**
205
- * Asset identifier (e.g. "usdc", "eth").
206
- */
207
- source_asset: string;
208
-
209
646
  /**
210
647
  * Chain name (e.g. "base", "ethereum").
211
648
  */
@@ -223,6 +660,51 @@ export interface TransferActionResponse {
223
660
  */
224
661
  wallet_id: string;
225
662
 
663
+ /**
664
+ * Amount received on the destination chain. Populated immediately for exact_output
665
+ * transfers, or after fill confirmation for exact_input transfers.
666
+ */
667
+ destination_amount?: string;
668
+
669
+ /**
670
+ * Destination asset for cross-asset transfers. Omitted for same-asset transfers.
671
+ */
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
+
226
708
  /**
227
709
  * The steps of the wallet action. Only returned if `?include=steps` is provided.
228
710
  */
@@ -232,20 +714,67 @@ export interface TransferActionResponse {
232
714
  /**
233
715
  * Response for a wallet action, discriminated on type.
234
716
  */
235
- export type WalletActionResponse = SwapActionResponse | TransferActionResponse;
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';
236
751
 
237
752
  export declare namespace WalletActions {
238
753
  export {
239
- type WalletActionType as WalletActionType,
240
- type WalletActionStatus as WalletActionStatus,
241
- type WalletActionStepType as WalletActionStepType,
242
- type EvmWalletActionStepStatus as EvmWalletActionStepStatus,
243
- type FailureReason as FailureReason,
244
754
  type EvmTransactionWalletActionStep as EvmTransactionWalletActionStep,
245
755
  type EvmUserOperationWalletActionStep as EvmUserOperationWalletActionStep,
246
- type WalletActionStep as WalletActionStep,
756
+ type EvmWalletActionStepStatus as EvmWalletActionStepStatus,
757
+ type EarnAsset as EarnAsset,
758
+ type EarnDepositActionResponse as EarnDepositActionResponse,
759
+ type EarnDepositRequestBody as EarnDepositRequestBody,
760
+ type EarnIncentiveClaimActionResponse as EarnIncentiveClaimActionResponse,
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,
247
772
  type SwapActionResponse as SwapActionResponse,
248
773
  type TransferActionResponse as TransferActionResponse,
249
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,
250
779
  };
251
780
  }