@privy-io/api-types 0.9.0 → 0.11.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 (180) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/client.d.mts +40 -43
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +40 -43
  5. package/client.d.ts.map +1 -1
  6. package/client.js +28 -20
  7. package/client.js.map +1 -1
  8. package/client.mjs +29 -21
  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 +931 -947
  28. package/resources/client-auth.d.mts.map +1 -1
  29. package/resources/client-auth.d.ts +931 -947
  30. package/resources/client-auth.d.ts.map +1 -1
  31. package/resources/client-auth.js.map +1 -1
  32. package/resources/client-auth.mjs.map +1 -1
  33. package/resources/embedded-wallets.d.mts +122 -122
  34. package/resources/embedded-wallets.d.mts.map +1 -1
  35. package/resources/embedded-wallets.d.ts +122 -122
  36. package/resources/embedded-wallets.d.ts.map +1 -1
  37. package/resources/fiat.d.mts +110 -0
  38. package/resources/fiat.d.mts.map +1 -0
  39. package/resources/fiat.d.ts +110 -0
  40. package/resources/fiat.d.ts.map +1 -0
  41. package/resources/fiat.js +9 -0
  42. package/resources/fiat.js.map +1 -0
  43. package/resources/fiat.mjs +5 -0
  44. package/resources/fiat.mjs.map +1 -0
  45. package/resources/funding.d.mts +86 -86
  46. package/resources/funding.d.mts.map +1 -1
  47. package/resources/funding.d.ts +86 -86
  48. package/resources/funding.d.ts.map +1 -1
  49. package/resources/index.d.mts +20 -18
  50. package/resources/index.d.mts.map +1 -1
  51. package/resources/index.d.ts +20 -18
  52. package/resources/index.d.ts.map +1 -1
  53. package/resources/index.js +5 -1
  54. package/resources/index.js.map +1 -1
  55. package/resources/index.mjs +3 -1
  56. package/resources/index.mjs.map +1 -1
  57. package/resources/intents.d.mts +269 -265
  58. package/resources/intents.d.mts.map +1 -1
  59. package/resources/intents.d.ts +269 -265
  60. package/resources/intents.d.ts.map +1 -1
  61. package/resources/key-quorums.d.mts +15 -146
  62. package/resources/key-quorums.d.mts.map +1 -1
  63. package/resources/key-quorums.d.ts +15 -146
  64. package/resources/key-quorums.d.ts.map +1 -1
  65. package/resources/key-quorums.js +0 -92
  66. package/resources/key-quorums.js.map +1 -1
  67. package/resources/key-quorums.mjs +0 -92
  68. package/resources/key-quorums.mjs.map +1 -1
  69. package/resources/kraken-embed.d.mts +12 -20
  70. package/resources/kraken-embed.d.mts.map +1 -1
  71. package/resources/kraken-embed.d.ts +12 -20
  72. package/resources/kraken-embed.d.ts.map +1 -1
  73. package/resources/organizations.d.mts +65 -0
  74. package/resources/organizations.d.mts.map +1 -0
  75. package/resources/organizations.d.ts +65 -0
  76. package/resources/organizations.d.ts.map +1 -0
  77. package/resources/organizations.js +9 -0
  78. package/resources/organizations.js.map +1 -0
  79. package/resources/organizations.mjs +5 -0
  80. package/resources/organizations.mjs.map +1 -0
  81. package/resources/policies.d.mts +261 -553
  82. package/resources/policies.d.mts.map +1 -1
  83. package/resources/policies.d.ts +261 -553
  84. package/resources/policies.d.ts.map +1 -1
  85. package/resources/policies.js +0 -229
  86. package/resources/policies.js.map +1 -1
  87. package/resources/policies.mjs +0 -229
  88. package/resources/policies.mjs.map +1 -1
  89. package/resources/shared.d.mts +28 -28
  90. package/resources/shared.d.mts.map +1 -1
  91. package/resources/shared.d.ts +28 -28
  92. package/resources/shared.d.ts.map +1 -1
  93. package/resources/swaps.d.mts +6 -9
  94. package/resources/swaps.d.mts.map +1 -1
  95. package/resources/swaps.d.ts +6 -9
  96. package/resources/swaps.d.ts.map +1 -1
  97. package/resources/swaps.js.map +1 -1
  98. package/resources/swaps.mjs.map +1 -1
  99. package/resources/transactions.d.mts +80 -96
  100. package/resources/transactions.d.mts.map +1 -1
  101. package/resources/transactions.d.ts +80 -96
  102. package/resources/transactions.d.ts.map +1 -1
  103. package/resources/transactions.js +0 -17
  104. package/resources/transactions.js.map +1 -1
  105. package/resources/transactions.mjs +0 -17
  106. package/resources/transactions.mjs.map +1 -1
  107. package/resources/users.d.mts +480 -815
  108. package/resources/users.d.mts.map +1 -1
  109. package/resources/users.d.ts +480 -815
  110. package/resources/users.d.ts.map +1 -1
  111. package/resources/users.js +0 -272
  112. package/resources/users.js.map +1 -1
  113. package/resources/users.mjs +0 -272
  114. package/resources/users.mjs.map +1 -1
  115. package/resources/wallet-actions.d.mts +302 -145
  116. package/resources/wallet-actions.d.mts.map +1 -1
  117. package/resources/wallet-actions.d.ts +302 -145
  118. package/resources/wallet-actions.d.ts.map +1 -1
  119. package/resources/wallets/index.d.mts +1 -1
  120. package/resources/wallets/index.d.mts.map +1 -1
  121. package/resources/wallets/index.d.ts +1 -1
  122. package/resources/wallets/index.d.ts.map +1 -1
  123. package/resources/wallets/index.js.map +1 -1
  124. package/resources/wallets/index.mjs.map +1 -1
  125. package/resources/wallets/transactions.d.mts +7 -2
  126. package/resources/wallets/transactions.d.mts.map +1 -1
  127. package/resources/wallets/transactions.d.ts +7 -2
  128. package/resources/wallets/transactions.d.ts.map +1 -1
  129. package/resources/wallets/transactions.js +1 -1
  130. package/resources/wallets/transactions.mjs +1 -1
  131. package/resources/wallets/wallets.d.mts +1592 -1580
  132. package/resources/wallets/wallets.d.mts.map +1 -1
  133. package/resources/wallets/wallets.d.ts +1592 -1580
  134. package/resources/wallets/wallets.d.ts.map +1 -1
  135. package/resources/wallets/wallets.js +45 -103
  136. package/resources/wallets/wallets.js.map +1 -1
  137. package/resources/wallets/wallets.mjs +45 -103
  138. package/resources/wallets/wallets.mjs.map +1 -1
  139. package/resources/webhooks.d.mts +935 -877
  140. package/resources/webhooks.d.mts.map +1 -1
  141. package/resources/webhooks.d.ts +935 -877
  142. package/resources/webhooks.d.ts.map +1 -1
  143. package/resources/yield.d.mts +157 -157
  144. package/resources/yield.d.mts.map +1 -1
  145. package/resources/yield.d.ts +157 -157
  146. package/resources/yield.d.ts.map +1 -1
  147. package/src/client.ts +650 -618
  148. package/src/internal/types.ts +6 -8
  149. package/src/resources/accounts.ts +157 -103
  150. package/src/resources/aggregations.ts +55 -55
  151. package/src/resources/apps.ts +221 -178
  152. package/src/resources/client-auth.ts +1271 -1315
  153. package/src/resources/embedded-wallets.ts +160 -160
  154. package/src/resources/fiat.ts +177 -0
  155. package/src/resources/funding.ts +130 -130
  156. package/src/resources/index.ts +551 -542
  157. package/src/resources/intents.ts +326 -322
  158. package/src/resources/key-quorums.ts +16 -218
  159. package/src/resources/kraken-embed.ts +14 -22
  160. package/src/resources/organizations.ts +82 -0
  161. package/src/resources/policies.ts +383 -848
  162. package/src/resources/shared.ts +34 -34
  163. package/src/resources/swaps.ts +5 -10
  164. package/src/resources/transactions.ts +116 -136
  165. package/src/resources/users.ts +693 -1160
  166. package/src/resources/wallet-actions.ts +392 -185
  167. package/src/resources/wallets/index.ts +160 -156
  168. package/src/resources/wallets/transactions.ts +18 -3
  169. package/src/resources/wallets/wallets.ts +2123 -2113
  170. package/src/resources/webhooks.ts +1172 -1100
  171. package/src/resources/yield.ts +188 -188
  172. package/src/version.ts +1 -1
  173. package/version.d.mts +1 -1
  174. package/version.d.mts.map +1 -1
  175. package/version.d.ts +1 -1
  176. package/version.d.ts.map +1 -1
  177. package/version.js +1 -1
  178. package/version.js.map +1 -1
  179. package/version.mjs +1 -1
  180. package/version.mjs.map +1 -1
@@ -1,35 +1,6 @@
1
1
  import { APIResource } from "../core/resource.js";
2
2
  export declare class WalletActions extends APIResource {
3
3
  }
4
- /**
5
- * Type of wallet action
6
- */
7
- export type WalletActionType = 'swap' | 'transfer' | 'earn_deposit' | 'earn_withdraw' | 'earn_incentive_claim';
8
- /**
9
- * Status of a wallet action.
10
- */
11
- export type WalletActionStatus = 'pending' | 'succeeded' | 'rejected' | 'failed';
12
- /**
13
- * Type of a wallet action step.
14
- */
15
- export type WalletActionStepType = 'evm_transaction' | 'evm_user_operation';
16
- /**
17
- * Status of an EVM step in a wallet action.
18
- */
19
- export type EvmWalletActionStepStatus = 'preparing' | 'queued' | 'pending' | 'retrying' | 'confirmed' | 'rejected' | 'reverted' | 'replaced' | 'abandoned';
20
- /**
21
- * A description of why a wallet action (or a step within a wallet action) failed.
22
- */
23
- export interface FailureReason {
24
- /**
25
- * Human-readable failure message.
26
- */
27
- message: string;
28
- /**
29
- * Additional error details, if available.
30
- */
31
- details?: unknown;
32
- }
33
4
  /**
34
5
  * A wallet action step consisting of an EVM transaction.
35
6
  */
@@ -86,19 +57,40 @@ export interface EvmUserOperationWalletActionStep {
86
57
  failure_reason?: FailureReason;
87
58
  }
88
59
  /**
89
- * A step within a wallet action, representing a single onchain action.
60
+ * Status of an EVM step in a wallet action.
90
61
  */
91
- export type WalletActionStep = EvmTransactionWalletActionStep | EvmUserOperationWalletActionStep;
62
+ export type EvmWalletActionStepStatus = 'preparing' | 'queued' | 'pending' | 'retrying' | 'confirmed' | 'rejected' | 'reverted' | 'replaced' | 'abandoned';
92
63
  /**
93
- * Response for a swap action.
64
+ * Asset metadata for an earn vault position.
94
65
  */
95
- export interface SwapActionResponse {
66
+ export interface EarnAsset {
67
+ /**
68
+ * Token contract address.
69
+ */
70
+ address: string;
71
+ /**
72
+ * Number of decimals for the asset (e.g. 6 for USDC).
73
+ */
74
+ decimals: number;
75
+ /**
76
+ * Lowercase token symbol (e.g. "usdc").
77
+ */
78
+ symbol: string;
79
+ }
80
+ /**
81
+ * Response for an earn deposit action.
82
+ */
83
+ export interface EarnDepositActionResponse {
96
84
  /**
97
85
  * The ID of the wallet action.
98
86
  */
99
87
  id: string;
100
88
  /**
101
- * CAIP-2 chain identifier for the swap.
89
+ * Underlying asset token address.
90
+ */
91
+ asset_address: string;
92
+ /**
93
+ * CAIP-2 chain identifier.
102
94
  */
103
95
  caip2: string;
104
96
  /**
@@ -106,30 +98,45 @@ export interface SwapActionResponse {
106
98
  */
107
99
  created_at: string;
108
100
  /**
109
- * Exact base-unit amount of input token. Populated after on-chain confirmation.
101
+ * Base-unit amount of asset deposited (e.g. "1500000").
110
102
  */
111
- input_amount: string | null;
103
+ raw_amount: string;
112
104
  /**
113
- * Token address or "native" for the token being sold.
105
+ * Vault shares received in base units. Populated after on-chain confirmation.
114
106
  */
115
- input_token: string;
107
+ share_amount: string | null;
116
108
  /**
117
- * Exact base-unit amount of output token. Populated after on-chain confirmation.
109
+ * Status of a wallet action.
118
110
  */
119
- output_amount: string | null;
111
+ status: WalletActionStatus;
112
+ type: 'earn_deposit';
120
113
  /**
121
- * Token address or "native" for the token being bought.
114
+ * ERC-4626 vault contract address.
122
115
  */
123
- output_token: string;
116
+ vault_address: string;
124
117
  /**
125
- * Status of a wallet action.
118
+ * The vault ID.
126
119
  */
127
- status: WalletActionStatus;
128
- type: 'swap';
120
+ vault_id: string;
129
121
  /**
130
122
  * The ID of the wallet involved in the action.
131
123
  */
132
124
  wallet_id: string;
125
+ /**
126
+ * Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when
127
+ * the token is known in the asset registry.
128
+ */
129
+ amount?: string;
130
+ /**
131
+ * Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in
132
+ * the asset registry.
133
+ */
134
+ asset?: string;
135
+ /**
136
+ * Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only
137
+ * present when the token is known in the asset registry.
138
+ */
139
+ decimals?: number;
133
140
  /**
134
141
  * A description of why a wallet action (or a step within a wallet action) failed.
135
142
  */
@@ -140,38 +147,50 @@ export interface SwapActionResponse {
140
147
  steps?: Array<WalletActionStep>;
141
148
  }
142
149
  /**
143
- * Response for a transfer action.
150
+ * Input for depositing assets into an ERC-4626 vault. Exactly one of `amount` or
151
+ * `raw_amount` must be provided.
144
152
  */
145
- export interface TransferActionResponse {
153
+ export interface EarnDepositRequestBody {
146
154
  /**
147
- * The ID of the wallet action.
155
+ * The ID of the vault to deposit into.
148
156
  */
149
- id: string;
157
+ vault_id: string;
150
158
  /**
151
- * ISO 8601 timestamp of when the wallet action was created.
159
+ * Human-readable decimal amount to deposit (e.g. "1.5" for 1.5 USDC). Exactly one
160
+ * of `amount` or `raw_amount` must be provided.
152
161
  */
153
- created_at: string;
162
+ amount?: string;
154
163
  /**
155
- * Recipient address.
164
+ * Amount in smallest unit to deposit (e.g. "1500000" for 1.5 USDC with 6
165
+ * decimals). Exactly one of `amount` or `raw_amount` must be provided.
156
166
  */
157
- destination_address: string;
167
+ raw_amount?: string;
168
+ }
169
+ /**
170
+ * Response for an earn incentive claim action.
171
+ */
172
+ export interface EarnIncentiveClaimActionResponse {
158
173
  /**
159
- * Decimal amount as the user provided (e.g. "1.5").
174
+ * The ID of the wallet action.
160
175
  */
161
- source_amount: string;
176
+ id: string;
162
177
  /**
163
- * Asset identifier (e.g. "usdc", "eth").
178
+ * EVM chain name (e.g. "base", "ethereum").
164
179
  */
165
- source_asset: string;
180
+ chain: string;
166
181
  /**
167
- * Chain name (e.g. "base", "ethereum").
182
+ * ISO 8601 timestamp of when the wallet action was created.
168
183
  */
169
- source_chain: string;
184
+ created_at: string;
185
+ /**
186
+ * Claimed reward tokens. Populated after the preparation step fetches from Merkl.
187
+ */
188
+ rewards: Array<EarnIncetiveClaimRewardEntry> | null;
170
189
  /**
171
190
  * Status of a wallet action.
172
191
  */
173
192
  status: WalletActionStatus;
174
- type: 'transfer';
193
+ type: 'earn_incentive_claim';
175
194
  /**
176
195
  * The ID of the wallet involved in the action.
177
196
  */
@@ -185,6 +204,17 @@ export interface TransferActionResponse {
185
204
  */
186
205
  steps?: Array<WalletActionStep>;
187
206
  }
207
+ /**
208
+ * Input for claiming incentive rewards.
209
+ */
210
+ export interface EarnIncentiveClaimRequestBody {
211
+ /**
212
+ * The blockchain network on which to perform the incentive claim. Supported chains
213
+ * include: 'ethereum', 'base', 'arbitrum', 'polygon', 'solana', and more, along
214
+ * with their respective testnets.
215
+ */
216
+ chain: string;
217
+ }
188
218
  /**
189
219
  * A specific reward token and amount associated with an earn incentive claim.
190
220
  */
@@ -201,11 +231,15 @@ export interface EarnIncetiveClaimRewardEntry {
201
231
  * Symbol of the reward token (e.g. "MORPHO").
202
232
  */
203
233
  token_symbol: string;
234
+ /**
235
+ * Number of decimal places for the reward token.
236
+ */
237
+ token_decimals?: number;
204
238
  }
205
239
  /**
206
- * Response for an earn deposit action.
240
+ * Response for an earn withdraw action.
207
241
  */
208
- export interface EarnDepositActionResponse {
242
+ export interface EarnWithdrawActionResponse {
209
243
  /**
210
244
  * The ID of the wallet action.
211
245
  */
@@ -223,18 +257,18 @@ export interface EarnDepositActionResponse {
223
257
  */
224
258
  created_at: string;
225
259
  /**
226
- * Base-unit amount of asset deposited (e.g. "1500000").
260
+ * Base-unit amount of asset withdrawn (e.g. "1500000").
227
261
  */
228
262
  raw_amount: string;
229
263
  /**
230
- * Vault shares received in base units. Populated after on-chain confirmation.
264
+ * Vault shares burned in base units. Populated after on-chain confirmation.
231
265
  */
232
266
  share_amount: string | null;
233
267
  /**
234
268
  * Status of a wallet action.
235
269
  */
236
270
  status: WalletActionStatus;
237
- type: 'earn_deposit';
271
+ type: 'earn_withdraw';
238
272
  /**
239
273
  * ERC-4626 vault contract address.
240
274
  */
@@ -248,7 +282,7 @@ export interface EarnDepositActionResponse {
248
282
  */
249
283
  wallet_id: string;
250
284
  /**
251
- * Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when
285
+ * Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when
252
286
  * the token is known in the asset registry.
253
287
  */
254
288
  amount?: string;
@@ -272,99 +306,186 @@ export interface EarnDepositActionResponse {
272
306
  steps?: Array<WalletActionStep>;
273
307
  }
274
308
  /**
275
- * Response for an earn withdraw action.
309
+ * Input for withdrawing assets from an ERC-4626 vault. Exactly one of `amount` or
310
+ * `raw_amount` must be provided.
276
311
  */
277
- export interface EarnWithdrawActionResponse {
312
+ export interface EarnWithdrawRequestBody {
278
313
  /**
279
- * The ID of the wallet action.
314
+ * The ID of the vault to withdraw from.
315
+ */
316
+ vault_id: string;
317
+ /**
318
+ * Human-readable decimal amount to withdraw (e.g. "1.5" for 1.5 USDC). Exactly one
319
+ * of `amount` or `raw_amount` must be provided.
320
+ */
321
+ amount?: string;
322
+ /**
323
+ * Amount in smallest unit to withdraw (e.g. "1500000" for 1.5 USDC with 6
324
+ * decimals). Exactly one of `amount` or `raw_amount` must be provided.
325
+ */
326
+ raw_amount?: string;
327
+ }
328
+ /**
329
+ * Query parameters for fetching an earn vault position.
330
+ */
331
+ export interface EthereumEarnPositionQuery {
332
+ /**
333
+ * The vault ID to get position for.
334
+ */
335
+ vault_id: string;
336
+ }
337
+ /**
338
+ * A wallet's position in an earn vault.
339
+ */
340
+ export interface EthereumEarnPositionResponse {
341
+ /**
342
+ * Asset metadata for an earn vault position.
343
+ */
344
+ asset: EarnAsset;
345
+ /**
346
+ * Current asset value in the vault (realtime from ERC-4626), in smallest unit.
347
+ */
348
+ assets_in_vault: string;
349
+ /**
350
+ * Current vault shares held (realtime from ERC-4626).
351
+ */
352
+ shares_in_vault: string;
353
+ /**
354
+ * Total amount deposited into the vault, in smallest unit.
355
+ */
356
+ total_deposited: string;
357
+ /**
358
+ * Total amount withdrawn from the vault, in smallest unit.
359
+ */
360
+ total_withdrawn: string;
361
+ }
362
+ /**
363
+ * Supported earn provider protocols.
364
+ */
365
+ export type EthereumEarnProvider = 'morpho' | 'aave';
366
+ /**
367
+ * Detailed vault information including current APY, liquidity, and asset metadata.
368
+ */
369
+ export interface EthereumEarnVaultDetailsResponse {
370
+ /**
371
+ * Vault identifier.
280
372
  */
281
373
  id: string;
282
374
  /**
283
- * Underlying asset token address.
375
+ * Annual percentage yield earned by the app from fee wrapper fees, in basis
376
+ * points.
284
377
  */
285
- asset_address: string;
378
+ app_apy: number | null;
286
379
  /**
287
- * CAIP-2 chain identifier.
380
+ * Asset metadata for an earn vault position.
381
+ */
382
+ asset: EarnAsset;
383
+ /**
384
+ * Available liquidity in USD.
385
+ */
386
+ available_liquidity_usd: number | null;
387
+ /**
388
+ * CAIP-2 chain identifier (e.g. "eip155:8453").
288
389
  */
289
390
  caip2: string;
290
391
  /**
291
- * ISO 8601 timestamp of when the wallet action was created.
392
+ * Human-readable vault name from the yield provider.
292
393
  */
293
- created_at: string;
394
+ name: string;
294
395
  /**
295
- * Base-unit amount of asset withdrawn (e.g. "1500000").
396
+ * Supported earn provider protocols.
296
397
  */
297
- raw_amount: string;
398
+ provider: EthereumEarnProvider;
298
399
  /**
299
- * Vault shares burned in base units. Populated after on-chain confirmation.
400
+ * Total value locked in USD.
300
401
  */
301
- share_amount: string | null;
402
+ tvl_usd: number | null;
302
403
  /**
303
- * Status of a wallet action.
404
+ * Current annual percentage yield in basis points (e.g. 500 for 5%). 1 basis point
405
+ * = 0.01%.
304
406
  */
305
- status: WalletActionStatus;
306
- type: 'earn_withdraw';
407
+ user_apy: number | null;
307
408
  /**
308
- * ERC-4626 vault contract address.
409
+ * Onchain vault contract address.
309
410
  */
310
411
  vault_address: string;
412
+ }
413
+ /**
414
+ * A description of why a wallet action (or a step within a wallet action) failed.
415
+ */
416
+ export interface FailureReason {
311
417
  /**
312
- * The vault ID.
418
+ * Human-readable failure message.
313
419
  */
314
- vault_id: string;
420
+ message: string;
315
421
  /**
316
- * The ID of the wallet involved in the action.
422
+ * Additional error details, if available.
317
423
  */
318
- wallet_id: string;
424
+ details?: unknown;
425
+ }
426
+ /**
427
+ * A wallet action step consisting of an SVM (Solana) transaction.
428
+ */
429
+ export interface SvmTransactionWalletActionStep {
319
430
  /**
320
- * Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when
321
- * the token is known in the asset registry.
431
+ * CAIP-2 chain identifier for the Solana network.
322
432
  */
323
- amount?: string;
433
+ caip2: string;
324
434
  /**
325
- * Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in
326
- * the asset registry.
435
+ * Status of an SVM step in a wallet action.
327
436
  */
328
- asset?: string;
437
+ status: SvmWalletActionStepStatus;
329
438
  /**
330
- * Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only
331
- * present when the token is known in the asset registry.
439
+ * The Solana transaction signature (base58-encoded). Null until broadcast.
332
440
  */
333
- decimals?: number;
441
+ transaction_signature: string | null;
442
+ type: 'svm_transaction';
334
443
  /**
335
444
  * A description of why a wallet action (or a step within a wallet action) failed.
336
445
  */
337
446
  failure_reason?: FailureReason;
338
- /**
339
- * The steps of the wallet action. Only returned if `?include=steps` is provided.
340
- */
341
- steps?: Array<WalletActionStep>;
342
447
  }
343
448
  /**
344
- * Response for an earn incentive claim action.
449
+ * Status of an SVM step in a wallet action.
345
450
  */
346
- export interface EarnIncentiveClaimActionResponse {
451
+ export type SvmWalletActionStepStatus = 'preparing' | 'queued' | 'pending' | 'confirmed' | 'finalized' | 'rejected' | 'reverted' | 'failed';
452
+ /**
453
+ * Response for a swap action.
454
+ */
455
+ export interface SwapActionResponse {
347
456
  /**
348
457
  * The ID of the wallet action.
349
458
  */
350
459
  id: string;
351
460
  /**
352
- * EVM chain name (e.g. "base", "ethereum").
461
+ * CAIP-2 chain identifier for the swap.
353
462
  */
354
- chain: string;
463
+ caip2: string;
355
464
  /**
356
465
  * ISO 8601 timestamp of when the wallet action was created.
357
466
  */
358
467
  created_at: string;
359
468
  /**
360
- * Claimed reward tokens. Populated after the preparation step fetches from Merkl.
469
+ * Exact base-unit amount of input token. Populated after on-chain confirmation.
361
470
  */
362
- rewards: Array<EarnIncetiveClaimRewardEntry> | null;
471
+ input_amount: string | null;
472
+ /**
473
+ * Token address or "native" for the token being sold.
474
+ */
475
+ input_token: string;
476
+ /**
477
+ * Exact base-unit amount of output token. Populated after on-chain confirmation.
478
+ */
479
+ output_amount: string | null;
480
+ /**
481
+ * Token address or "native" for the token being bought.
482
+ */
483
+ output_token: string;
363
484
  /**
364
485
  * Status of a wallet action.
365
486
  */
366
487
  status: WalletActionStatus;
367
- type: 'earn_incentive_claim';
488
+ type: 'swap';
368
489
  /**
369
490
  * The ID of the wallet involved in the action.
370
491
  */
@@ -379,61 +500,97 @@ export interface EarnIncentiveClaimActionResponse {
379
500
  steps?: Array<WalletActionStep>;
380
501
  }
381
502
  /**
382
- * Response for a wallet action, discriminated on type.
383
- */
384
- export type WalletActionResponse = SwapActionResponse | TransferActionResponse | EarnDepositActionResponse | EarnWithdrawActionResponse | EarnIncentiveClaimActionResponse;
385
- /**
386
- * Input for depositing assets into an ERC-4626 vault. Exactly one of `amount` or
387
- * `raw_amount` must be provided.
503
+ * Response for a transfer action.
388
504
  */
389
- export interface EarnDepositRequestBody {
505
+ export interface TransferActionResponse {
390
506
  /**
391
- * The ID of the vault to deposit into.
507
+ * The ID of the wallet action.
392
508
  */
393
- vault_id: string;
509
+ id: string;
394
510
  /**
395
- * Human-readable decimal amount to deposit (e.g. "1.5" for 1.5 USDC). Exactly one
396
- * of `amount` or `raw_amount` must be provided.
511
+ * ISO 8601 timestamp of when the wallet action was created.
397
512
  */
398
- amount?: string;
513
+ created_at: string;
399
514
  /**
400
- * Amount in smallest unit to deposit (e.g. "1500000" for 1.5 USDC with 6
401
- * decimals). Exactly one of `amount` or `raw_amount` must be provided.
515
+ * Recipient address.
402
516
  */
403
- raw_amount?: string;
404
- }
405
- /**
406
- * Input for withdrawing assets from an ERC-4626 vault. Exactly one of `amount` or
407
- * `raw_amount` must be provided.
408
- */
409
- export interface EarnWithdrawRequestBody {
517
+ destination_address: string;
410
518
  /**
411
- * The ID of the vault to withdraw from.
519
+ * Chain name (e.g. "base", "ethereum").
412
520
  */
413
- vault_id: string;
521
+ source_chain: string;
414
522
  /**
415
- * Human-readable decimal amount to withdraw (e.g. "1.5" for 1.5 USDC). Exactly one
416
- * of `amount` or `raw_amount` must be provided.
523
+ * Status of a wallet action.
417
524
  */
418
- amount?: string;
525
+ status: WalletActionStatus;
526
+ type: 'transfer';
419
527
  /**
420
- * Amount in smallest unit to withdraw (e.g. "1500000" for 1.5 USDC with 6
421
- * decimals). Exactly one of `amount` or `raw_amount` must be provided.
528
+ * The ID of the wallet involved in the action.
422
529
  */
423
- raw_amount?: string;
424
- }
425
- /**
426
- * Input for claiming incentive rewards.
427
- */
428
- export interface EarnIncentiveClaimRequestBody {
530
+ wallet_id: string;
429
531
  /**
430
- * The blockchain network on which to perform the incentive claim. Supported chains
431
- * include: 'ethereum', 'base', 'arbitrum', 'polygon', 'solana', and more, along
432
- * with their respective testnets.
532
+ * Amount received on the destination chain. Populated immediately for exact_output
533
+ * transfers, or after fill confirmation for exact_input transfers.
433
534
  */
434
- chain: string;
535
+ destination_amount?: string;
536
+ /**
537
+ * Destination asset for cross-asset transfers. Omitted for same-asset transfers.
538
+ */
539
+ destination_asset?: string;
540
+ /**
541
+ * Destination chain for cross-chain transfers. Omitted for same-chain transfers.
542
+ */
543
+ destination_chain?: string;
544
+ /**
545
+ * A description of why a wallet action (or a step within a wallet action) failed.
546
+ */
547
+ failure_reason?: FailureReason;
548
+ /**
549
+ * Decimal amount sent on the source chain (e.g. "1.5"). Omitted for exact_output
550
+ * cross-chain transfers until the source amount is determined.
551
+ */
552
+ source_amount?: string;
553
+ /**
554
+ * Asset identifier (e.g. "usdc", "eth"). Present when the transfer was initiated
555
+ * with a named asset; omitted for custom-token transfers.
556
+ */
557
+ source_asset?: string;
558
+ /**
559
+ * Token contract address (EVM) or mint address (Solana). Present when the transfer
560
+ * was initiated with `asset_address`.
561
+ */
562
+ source_asset_address?: string;
563
+ /**
564
+ * Number of decimals for the transferred token. Present when the transfer was
565
+ * initiated with `asset_address` and the decimals were resolved on-chain.
566
+ */
567
+ source_asset_decimals?: number;
568
+ /**
569
+ * The steps of the wallet action. Only returned if `?include=steps` is provided.
570
+ */
571
+ steps?: Array<WalletActionStep>;
435
572
  }
573
+ /**
574
+ * Response for a wallet action, discriminated on type.
575
+ */
576
+ export type WalletActionResponse = SwapActionResponse | TransferActionResponse | EarnDepositActionResponse | EarnWithdrawActionResponse | EarnIncentiveClaimActionResponse;
577
+ /**
578
+ * Status of a wallet action.
579
+ */
580
+ export type WalletActionStatus = 'pending' | 'succeeded' | 'rejected' | 'failed';
581
+ /**
582
+ * A step within a wallet action, representing a single onchain action.
583
+ */
584
+ export type WalletActionStep = EvmTransactionWalletActionStep | EvmUserOperationWalletActionStep | SvmTransactionWalletActionStep;
585
+ /**
586
+ * Type of a wallet action step.
587
+ */
588
+ export type WalletActionStepType = 'evm_transaction' | 'evm_user_operation' | 'svm_transaction';
589
+ /**
590
+ * Type of wallet action
591
+ */
592
+ export type WalletActionType = 'swap' | 'transfer' | 'earn_deposit' | 'earn_withdraw' | 'earn_incentive_claim';
436
593
  export declare namespace WalletActions {
437
- export { type WalletActionType as WalletActionType, type WalletActionStatus as WalletActionStatus, type WalletActionStepType as WalletActionStepType, type EvmWalletActionStepStatus as EvmWalletActionStepStatus, type FailureReason as FailureReason, type EvmTransactionWalletActionStep as EvmTransactionWalletActionStep, type EvmUserOperationWalletActionStep as EvmUserOperationWalletActionStep, type WalletActionStep as WalletActionStep, type SwapActionResponse as SwapActionResponse, type TransferActionResponse as TransferActionResponse, type EarnIncetiveClaimRewardEntry as EarnIncetiveClaimRewardEntry, type EarnDepositActionResponse as EarnDepositActionResponse, type EarnWithdrawActionResponse as EarnWithdrawActionResponse, type EarnIncentiveClaimActionResponse as EarnIncentiveClaimActionResponse, type WalletActionResponse as WalletActionResponse, type EarnDepositRequestBody as EarnDepositRequestBody, type EarnWithdrawRequestBody as EarnWithdrawRequestBody, type EarnIncentiveClaimRequestBody as EarnIncentiveClaimRequestBody, };
594
+ export { type EvmTransactionWalletActionStep as EvmTransactionWalletActionStep, type EvmUserOperationWalletActionStep as EvmUserOperationWalletActionStep, type EvmWalletActionStepStatus as EvmWalletActionStepStatus, type EarnAsset as EarnAsset, type EarnDepositActionResponse as EarnDepositActionResponse, type EarnDepositRequestBody as EarnDepositRequestBody, type EarnIncentiveClaimActionResponse as EarnIncentiveClaimActionResponse, type EarnIncentiveClaimRequestBody as EarnIncentiveClaimRequestBody, type EarnIncetiveClaimRewardEntry as EarnIncetiveClaimRewardEntry, type EarnWithdrawActionResponse as EarnWithdrawActionResponse, type EarnWithdrawRequestBody as EarnWithdrawRequestBody, type EthereumEarnPositionQuery as EthereumEarnPositionQuery, type EthereumEarnPositionResponse as EthereumEarnPositionResponse, type EthereumEarnProvider as EthereumEarnProvider, type EthereumEarnVaultDetailsResponse as EthereumEarnVaultDetailsResponse, type FailureReason as FailureReason, type SvmTransactionWalletActionStep as SvmTransactionWalletActionStep, type SvmWalletActionStepStatus as SvmWalletActionStepStatus, type SwapActionResponse as SwapActionResponse, type TransferActionResponse as TransferActionResponse, type WalletActionResponse as WalletActionResponse, type WalletActionStatus as WalletActionStatus, type WalletActionStep as WalletActionStep, type WalletActionStepType as WalletActionStepType, type WalletActionType as WalletActionType, };
438
595
  }
439
596
  //# sourceMappingURL=wallet-actions.d.ts.map