@privy-io/api-types 0.6.1 → 0.8.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 (197) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/client.d.mts +53 -29
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +53 -29
  5. package/client.d.ts.map +1 -1
  6. package/client.js +32 -7
  7. package/client.js.map +1 -1
  8. package/client.mjs +34 -9
  9. package/client.mjs.map +1 -1
  10. package/package.json +12 -1
  11. package/resources/accounts.d.mts +146 -4
  12. package/resources/accounts.d.mts.map +1 -1
  13. package/resources/accounts.d.ts +146 -4
  14. package/resources/accounts.d.ts.map +1 -1
  15. package/resources/accounts.js.map +1 -1
  16. package/resources/accounts.mjs.map +1 -1
  17. package/resources/aggregations.d.mts +18 -392
  18. package/resources/aggregations.d.mts.map +1 -1
  19. package/resources/aggregations.d.ts +18 -392
  20. package/resources/aggregations.d.ts.map +1 -1
  21. package/resources/aggregations.js.map +1 -1
  22. package/resources/aggregations.mjs.map +1 -1
  23. package/resources/apps.d.mts +197 -70
  24. package/resources/apps.d.mts.map +1 -1
  25. package/resources/apps.d.ts +197 -70
  26. package/resources/apps.d.ts.map +1 -1
  27. package/resources/apps.js.map +1 -1
  28. package/resources/apps.mjs.map +1 -1
  29. package/resources/client-auth.d.mts +975 -463
  30. package/resources/client-auth.d.mts.map +1 -1
  31. package/resources/client-auth.d.ts +975 -463
  32. package/resources/client-auth.d.ts.map +1 -1
  33. package/resources/client-auth.js.map +1 -1
  34. package/resources/client-auth.mjs.map +1 -1
  35. package/resources/cross-app.d.mts +14 -13
  36. package/resources/cross-app.d.mts.map +1 -1
  37. package/resources/cross-app.d.ts +14 -13
  38. package/resources/cross-app.d.ts.map +1 -1
  39. package/resources/embedded-wallets.d.mts +165 -81
  40. package/resources/embedded-wallets.d.mts.map +1 -1
  41. package/resources/embedded-wallets.d.ts +165 -81
  42. package/resources/embedded-wallets.d.ts.map +1 -1
  43. package/resources/embedded-wallets.js.map +1 -1
  44. package/resources/embedded-wallets.mjs.map +1 -1
  45. package/resources/funding.d.mts +150 -64
  46. package/resources/funding.d.mts.map +1 -1
  47. package/resources/funding.d.ts +150 -64
  48. package/resources/funding.d.ts.map +1 -1
  49. package/resources/funding.js.map +1 -1
  50. package/resources/funding.mjs.map +1 -1
  51. package/resources/index.d.mts +18 -14
  52. package/resources/index.d.mts.map +1 -1
  53. package/resources/index.d.ts +18 -14
  54. package/resources/index.d.ts.map +1 -1
  55. package/resources/index.js +9 -1
  56. package/resources/index.js.map +1 -1
  57. package/resources/index.mjs +6 -2
  58. package/resources/index.mjs.map +1 -1
  59. package/resources/intents.d.mts +446 -31
  60. package/resources/intents.d.mts.map +1 -1
  61. package/resources/intents.d.ts +446 -31
  62. package/resources/intents.d.ts.map +1 -1
  63. package/resources/intents.js.map +1 -1
  64. package/resources/intents.mjs.map +1 -1
  65. package/resources/key-quorums.d.mts +108 -17
  66. package/resources/key-quorums.d.mts.map +1 -1
  67. package/resources/key-quorums.d.ts +108 -17
  68. package/resources/key-quorums.d.ts.map +1 -1
  69. package/resources/key-quorums.js +26 -9
  70. package/resources/key-quorums.js.map +1 -1
  71. package/resources/key-quorums.mjs +26 -9
  72. package/resources/key-quorums.mjs.map +1 -1
  73. package/resources/kraken-embed.d.mts +62 -0
  74. package/resources/kraken-embed.d.mts.map +1 -0
  75. package/resources/kraken-embed.d.ts +62 -0
  76. package/resources/kraken-embed.d.ts.map +1 -0
  77. package/resources/kraken-embed.js +9 -0
  78. package/resources/kraken-embed.js.map +1 -0
  79. package/resources/kraken-embed.mjs +5 -0
  80. package/resources/kraken-embed.mjs.map +1 -0
  81. package/resources/policies.d.mts +342 -926
  82. package/resources/policies.d.mts.map +1 -1
  83. package/resources/policies.d.ts +342 -926
  84. package/resources/policies.d.ts.map +1 -1
  85. package/resources/policies.js +51 -41
  86. package/resources/policies.js.map +1 -1
  87. package/resources/policies.mjs +51 -41
  88. package/resources/policies.mjs.map +1 -1
  89. package/resources/shared.d.mts +59 -0
  90. package/resources/shared.d.mts.map +1 -0
  91. package/resources/shared.d.ts +59 -0
  92. package/resources/shared.d.ts.map +1 -0
  93. package/resources/shared.js +9 -0
  94. package/resources/shared.js.map +1 -0
  95. package/resources/shared.mjs +5 -0
  96. package/resources/shared.mjs.map +1 -0
  97. package/resources/swaps.d.mts +108 -0
  98. package/resources/swaps.d.mts.map +1 -0
  99. package/resources/swaps.d.ts +108 -0
  100. package/resources/swaps.d.ts.map +1 -0
  101. package/resources/swaps.js +9 -0
  102. package/resources/swaps.js.map +1 -0
  103. package/resources/swaps.mjs +5 -0
  104. package/resources/swaps.mjs.map +1 -0
  105. package/resources/transactions.d.mts +158 -93
  106. package/resources/transactions.d.mts.map +1 -1
  107. package/resources/transactions.d.ts +158 -93
  108. package/resources/transactions.d.ts.map +1 -1
  109. package/resources/transactions.js +3 -0
  110. package/resources/transactions.js.map +1 -1
  111. package/resources/transactions.mjs +3 -0
  112. package/resources/transactions.mjs.map +1 -1
  113. package/resources/users.d.mts +64 -94
  114. package/resources/users.d.mts.map +1 -1
  115. package/resources/users.d.ts +64 -94
  116. package/resources/users.d.ts.map +1 -1
  117. package/resources/users.js +3 -0
  118. package/resources/users.js.map +1 -1
  119. package/resources/users.mjs +3 -0
  120. package/resources/users.mjs.map +1 -1
  121. package/resources/wallet-actions.d.mts +187 -0
  122. package/resources/wallet-actions.d.mts.map +1 -0
  123. package/resources/wallet-actions.d.ts +187 -0
  124. package/resources/wallet-actions.d.ts.map +1 -0
  125. package/resources/wallet-actions.js +9 -0
  126. package/resources/wallet-actions.js.map +1 -0
  127. package/resources/wallet-actions.mjs +5 -0
  128. package/resources/wallet-actions.mjs.map +1 -0
  129. package/resources/wallets/balance.d.mts +7 -4
  130. package/resources/wallets/balance.d.mts.map +1 -1
  131. package/resources/wallets/balance.d.ts +7 -4
  132. package/resources/wallets/balance.d.ts.map +1 -1
  133. package/resources/wallets/balance.js +3 -0
  134. package/resources/wallets/balance.js.map +1 -1
  135. package/resources/wallets/balance.mjs +3 -0
  136. package/resources/wallets/balance.mjs.map +1 -1
  137. package/resources/wallets/index.d.mts +1 -1
  138. package/resources/wallets/index.d.mts.map +1 -1
  139. package/resources/wallets/index.d.ts +1 -1
  140. package/resources/wallets/index.d.ts.map +1 -1
  141. package/resources/wallets/index.js.map +1 -1
  142. package/resources/wallets/index.mjs.map +1 -1
  143. package/resources/wallets/transactions.d.mts +10 -6
  144. package/resources/wallets/transactions.d.mts.map +1 -1
  145. package/resources/wallets/transactions.d.ts +10 -6
  146. package/resources/wallets/transactions.d.ts.map +1 -1
  147. package/resources/wallets/transactions.js +3 -0
  148. package/resources/wallets/transactions.js.map +1 -1
  149. package/resources/wallets/transactions.mjs +3 -0
  150. package/resources/wallets/transactions.mjs.map +1 -1
  151. package/resources/wallets/wallets.d.mts +2399 -936
  152. package/resources/wallets/wallets.d.mts.map +1 -1
  153. package/resources/wallets/wallets.d.ts +2399 -936
  154. package/resources/wallets/wallets.d.ts.map +1 -1
  155. package/resources/wallets/wallets.js +28 -10
  156. package/resources/wallets/wallets.js.map +1 -1
  157. package/resources/wallets/wallets.mjs +28 -10
  158. package/resources/wallets/wallets.mjs.map +1 -1
  159. package/resources/webhooks.d.mts +780 -339
  160. package/resources/webhooks.d.mts.map +1 -1
  161. package/resources/webhooks.d.ts +780 -339
  162. package/resources/webhooks.d.ts.map +1 -1
  163. package/resources/webhooks.js.map +1 -1
  164. package/resources/webhooks.mjs.map +1 -1
  165. package/resources/yield.d.mts +50 -9
  166. package/resources/yield.d.mts.map +1 -1
  167. package/resources/yield.d.ts +50 -9
  168. package/resources/yield.d.ts.map +1 -1
  169. package/src/client.ts +884 -99
  170. package/src/resources/accounts.ts +179 -3
  171. package/src/resources/aggregations.ts +18 -702
  172. package/src/resources/apps.ts +250 -85
  173. package/src/resources/client-auth.ts +1453 -786
  174. package/src/resources/cross-app.ts +19 -15
  175. package/src/resources/embedded-wallets.ts +219 -123
  176. package/src/resources/funding.ts +263 -173
  177. package/src/resources/index.ts +444 -61
  178. package/src/resources/intents.ts +575 -37
  179. package/src/resources/key-quorums.ts +137 -21
  180. package/src/resources/kraken-embed.ts +85 -0
  181. package/src/resources/policies.ts +582 -1550
  182. package/src/resources/shared.ts +79 -0
  183. package/src/resources/swaps.ts +136 -0
  184. package/src/resources/transactions.ts +188 -91
  185. package/src/resources/users.ts +82 -132
  186. package/src/resources/wallet-actions.ts +251 -0
  187. package/src/resources/wallets/balance.ts +9 -2
  188. package/src/resources/wallets/index.ts +146 -16
  189. package/src/resources/wallets/transactions.ts +12 -4
  190. package/src/resources/wallets/wallets.ts +2922 -974
  191. package/src/resources/webhooks.ts +970 -454
  192. package/src/resources/yield.ts +68 -10
  193. package/src/version.ts +1 -1
  194. package/version.d.mts +1 -1
  195. package/version.d.ts +1 -1
  196. package/version.js +1 -1
  197. package/version.mjs +1 -1
@@ -3,6 +3,8 @@
3
3
  import { APIResource } from '../core/resource';
4
4
  import * as UsersAPI from './users';
5
5
  import * as ClientAuthAPI from './client-auth';
6
+ import * as EmbeddedWalletsAPI from './embedded-wallets';
7
+ import * as SharedAPI from './shared';
6
8
  import * as WalletsAPI from './wallets/wallets';
7
9
  import { APIPromise } from '../core/api-promise';
8
10
  import { Cursor, type CursorParams, PagePromise } from '../core/pagination';
@@ -10,6 +12,9 @@ import { buildHeaders } from '../internal/headers';
10
12
  import { RequestOptions } from '../internal/request-options';
11
13
  import { path } from '../internal/utils/path';
12
14
 
15
+ /**
16
+ * Operations related to users
17
+ */
13
18
  export class Users extends APIResource {
14
19
  /**
15
20
  * Create a new user with linked accounts. Optionally pre-generate embedded wallets
@@ -386,17 +391,6 @@ export interface LinkedAccountEthereum {
386
391
  wallet_client_type?: string;
387
392
  }
388
393
 
389
- /**
390
- * The provider for a smart wallet.
391
- */
392
- export type SmartWalletType =
393
- | 'safe'
394
- | 'kernel'
395
- | 'light_account'
396
- | 'biconomy'
397
- | 'coinbase_smart_wallet'
398
- | 'thirdweb';
399
-
400
394
  /**
401
395
  * A smart wallet account linked to the user.
402
396
  */
@@ -408,9 +402,9 @@ export interface LinkedAccountSmartWallet {
408
402
  latest_verified_at: number | null;
409
403
 
410
404
  /**
411
- * The provider for a smart wallet.
405
+ * The supported smart wallet providers.
412
406
  */
413
- smart_wallet_type: SmartWalletType;
407
+ smart_wallet_type: EmbeddedWalletsAPI.SmartWalletType;
414
408
 
415
409
  type: 'smart_wallet';
416
410
 
@@ -1167,11 +1161,74 @@ export type LinkedAccountType =
1167
1161
  | 'authorization_key'
1168
1162
  | ClientAuthAPI.CustomOAuthProviderID;
1169
1163
 
1164
+ /**
1165
+ * A SMS MFA method.
1166
+ */
1167
+ export interface SMSMfaMethod {
1168
+ type: 'sms';
1169
+
1170
+ verified_at: number;
1171
+ }
1172
+
1173
+ /**
1174
+ * A TOTP MFA method.
1175
+ */
1176
+ export interface TotpMfaMethod {
1177
+ type: 'totp';
1178
+
1179
+ verified_at: number;
1180
+ }
1181
+
1182
+ /**
1183
+ * A Passkey MFA method.
1184
+ */
1185
+ export interface PasskeyMfaMethod {
1186
+ type: 'passkey';
1187
+
1188
+ verified_at: number;
1189
+ }
1190
+
1191
+ /**
1192
+ * A multi-factor authentication method linked to the user.
1193
+ */
1194
+ export type LinkedMfaMethod = SMSMfaMethod | TotpMfaMethod | PasskeyMfaMethod;
1195
+
1170
1196
  /**
1171
1197
  * Custom metadata associated with the user.
1172
1198
  */
1173
1199
  export type CustomMetadata = { [key: string]: string | number | boolean };
1174
1200
 
1201
+ /**
1202
+ * A Privy user object.
1203
+ */
1204
+ export interface User {
1205
+ id: string;
1206
+
1207
+ /**
1208
+ * Unix timestamp of when the user was created in seconds.
1209
+ */
1210
+ created_at: number;
1211
+
1212
+ /**
1213
+ * Indicates if the user has accepted the terms of service.
1214
+ */
1215
+ has_accepted_terms: boolean;
1216
+
1217
+ /**
1218
+ * Indicates if the user is a guest account user.
1219
+ */
1220
+ is_guest: boolean;
1221
+
1222
+ linked_accounts: Array<LinkedAccount>;
1223
+
1224
+ mfa_methods: Array<LinkedMfaMethod>;
1225
+
1226
+ /**
1227
+ * Custom metadata associated with the user.
1228
+ */
1229
+ custom_metadata?: CustomMetadata;
1230
+ }
1231
+
1175
1232
  /**
1176
1233
  * The payload for importing a wallet account.
1177
1234
  */
@@ -1459,96 +1516,13 @@ export namespace UserBatchCreateInput {
1459
1516
  */
1460
1517
  custom_metadata?: UsersAPI.CustomMetadata;
1461
1518
 
1462
- wallets?: Array<User.Wallet>;
1463
- }
1464
-
1465
- export namespace User {
1466
- export interface Wallet {
1467
- /**
1468
- * The wallet chain types.
1469
- */
1470
- chain_type: WalletsAPI.WalletChainType;
1471
-
1472
- additional_signers?: Array<Wallet.AdditionalSigner>;
1473
-
1474
- create_smart_wallet?: boolean;
1475
-
1476
- policy_ids?: Array<string>;
1477
- }
1478
-
1479
- export namespace Wallet {
1480
- export interface AdditionalSigner {
1481
- signer_id: string;
1482
-
1483
- override_policy_ids?: Array<string>;
1484
- }
1485
- }
1519
+ /**
1520
+ * Wallets to create.
1521
+ */
1522
+ wallets?: Array<EmbeddedWalletsAPI.WalletCreationInput>;
1486
1523
  }
1487
1524
  }
1488
1525
 
1489
- /**
1490
- * A SMS MFA method.
1491
- */
1492
- export interface SMSMfaMethod {
1493
- type: 'sms';
1494
-
1495
- verified_at: number;
1496
- }
1497
-
1498
- /**
1499
- * A TOTP MFA method.
1500
- */
1501
- export interface TotpMfaMethod {
1502
- type: 'totp';
1503
-
1504
- verified_at: number;
1505
- }
1506
-
1507
- /**
1508
- * A Passkey MFA method.
1509
- */
1510
- export interface PasskeyMfaMethod {
1511
- type: 'passkey';
1512
-
1513
- verified_at: number;
1514
- }
1515
-
1516
- /**
1517
- * A multi-factor authentication method linked to the user.
1518
- */
1519
- export type LinkedMfaMethod = SMSMfaMethod | TotpMfaMethod | PasskeyMfaMethod;
1520
-
1521
- /**
1522
- * A Privy user object.
1523
- */
1524
- export interface User {
1525
- id: string;
1526
-
1527
- /**
1528
- * Unix timestamp of when the user was created in milliseconds.
1529
- */
1530
- created_at: number;
1531
-
1532
- /**
1533
- * Indicates if the user has accepted the terms of service.
1534
- */
1535
- has_accepted_terms: boolean;
1536
-
1537
- /**
1538
- * Indicates if the user is a guest account user.
1539
- */
1540
- is_guest: boolean;
1541
-
1542
- linked_accounts: Array<LinkedAccount>;
1543
-
1544
- mfa_methods: Array<LinkedMfaMethod>;
1545
-
1546
- /**
1547
- * Custom metadata associated with the user.
1548
- */
1549
- custom_metadata?: CustomMetadata;
1550
- }
1551
-
1552
1526
  /**
1553
1527
  * OAuth tokens associated with the user.
1554
1528
  */
@@ -1650,9 +1624,9 @@ export namespace UserCreateParams {
1650
1624
  export namespace Wallet {
1651
1625
  export interface AdditionalSigner {
1652
1626
  /**
1653
- * The key quorum ID for the signer.
1627
+ * A unique identifier for a key quorum.
1654
1628
  */
1655
- signer_id: string;
1629
+ signer_id: SharedAPI.KeyQuorumID;
1656
1630
 
1657
1631
  /**
1658
1632
  * The array of policy IDs that will be applied to wallet requests. If specified,
@@ -1715,30 +1689,7 @@ export interface UserGetByWalletAddressParams {
1715
1689
  }
1716
1690
 
1717
1691
  export interface UserPregenerateWalletsParams {
1718
- wallets: Array<UserPregenerateWalletsParams.Wallet>;
1719
- }
1720
-
1721
- export namespace UserPregenerateWalletsParams {
1722
- export interface Wallet {
1723
- /**
1724
- * The wallet chain types.
1725
- */
1726
- chain_type: WalletsAPI.WalletChainType;
1727
-
1728
- additional_signers?: Array<Wallet.AdditionalSigner>;
1729
-
1730
- create_smart_wallet?: boolean;
1731
-
1732
- policy_ids?: Array<string>;
1733
- }
1734
-
1735
- export namespace Wallet {
1736
- export interface AdditionalSigner {
1737
- signer_id: string;
1738
-
1739
- override_policy_ids?: Array<string>;
1740
- }
1741
- }
1692
+ wallets: Array<EmbeddedWalletsAPI.WalletCreationInput>;
1742
1693
  }
1743
1694
 
1744
1695
  export type UserSearchParams = UserSearchParams.Variant0 | UserSearchParams.Variant1;
@@ -1781,7 +1732,6 @@ export declare namespace Users {
1781
1732
  type LinkedAccountPhone as LinkedAccountPhone,
1782
1733
  type LinkedAccountBaseWallet as LinkedAccountBaseWallet,
1783
1734
  type LinkedAccountEthereum as LinkedAccountEthereum,
1784
- type SmartWalletType as SmartWalletType,
1785
1735
  type LinkedAccountSmartWallet as LinkedAccountSmartWallet,
1786
1736
  type LinkedAccountSolana as LinkedAccountSolana,
1787
1737
  type LinkedAccountFarcaster as LinkedAccountFarcaster,
@@ -1814,7 +1764,12 @@ export declare namespace Users {
1814
1764
  type LinkedAccountAuthorizationKey as LinkedAccountAuthorizationKey,
1815
1765
  type LinkedAccount as LinkedAccount,
1816
1766
  type LinkedAccountType as LinkedAccountType,
1767
+ type SMSMfaMethod as SMSMfaMethod,
1768
+ type TotpMfaMethod as TotpMfaMethod,
1769
+ type PasskeyMfaMethod as PasskeyMfaMethod,
1770
+ type LinkedMfaMethod as LinkedMfaMethod,
1817
1771
  type CustomMetadata as CustomMetadata,
1772
+ type User as User,
1818
1773
  type LinkedAccountWalletInput as LinkedAccountWalletInput,
1819
1774
  type LinkedAccountEmailInput as LinkedAccountEmailInput,
1820
1775
  type LinkedAccountPhoneInput as LinkedAccountPhoneInput,
@@ -1835,11 +1790,6 @@ export declare namespace Users {
1835
1790
  type LinkedAccountPasskeyInput as LinkedAccountPasskeyInput,
1836
1791
  type LinkedAccountInput as LinkedAccountInput,
1837
1792
  type UserBatchCreateInput as UserBatchCreateInput,
1838
- type SMSMfaMethod as SMSMfaMethod,
1839
- type TotpMfaMethod as TotpMfaMethod,
1840
- type PasskeyMfaMethod as PasskeyMfaMethod,
1841
- type LinkedMfaMethod as LinkedMfaMethod,
1842
- type User as User,
1843
1793
  type OAuthTokens as OAuthTokens,
1844
1794
  type UserWithIdentityToken as UserWithIdentityToken,
1845
1795
  type AuthenticatedUser as AuthenticatedUser,
@@ -0,0 +1,251 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+
5
+ export class WalletActions extends APIResource {}
6
+
7
+ /**
8
+ * Type of wallet action
9
+ */
10
+ export type WalletActionType = 'swap' | 'transfer';
11
+
12
+ /**
13
+ * Status of a wallet action.
14
+ */
15
+ export type WalletActionStatus = 'pending' | 'succeeded' | 'rejected' | 'failed';
16
+
17
+ /**
18
+ * Type of a wallet action step.
19
+ */
20
+ export type WalletActionStepType = 'evm_transaction' | 'evm_user_operation';
21
+
22
+ /**
23
+ * Status of an EVM step in a wallet action.
24
+ */
25
+ export type EvmWalletActionStepStatus =
26
+ | 'preparing'
27
+ | 'queued'
28
+ | 'pending'
29
+ | 'retrying'
30
+ | 'confirmed'
31
+ | 'rejected'
32
+ | 'reverted'
33
+ | 'replaced'
34
+ | 'abandoned';
35
+
36
+ /**
37
+ * A description of why a wallet action (or a step within a wallet action) failed.
38
+ */
39
+ export interface FailureReason {
40
+ /**
41
+ * Human-readable failure message.
42
+ */
43
+ message: string;
44
+
45
+ /**
46
+ * Additional error details, if available.
47
+ */
48
+ details?: unknown;
49
+ }
50
+
51
+ /**
52
+ * A wallet action step consisting of an EVM transaction.
53
+ */
54
+ export interface EvmTransactionWalletActionStep {
55
+ /**
56
+ * CAIP-2 chain identifier of the transaction, containing the chain ID.
57
+ */
58
+ caip2: string;
59
+
60
+ /**
61
+ * Status of an EVM step in a wallet action.
62
+ */
63
+ status: EvmWalletActionStepStatus;
64
+
65
+ /**
66
+ * The transaction hash for this step. May change while the step status is
67
+ * non-terminal.
68
+ */
69
+ transaction_hash: string | null;
70
+
71
+ type: 'evm_transaction';
72
+
73
+ /**
74
+ * A description of why a wallet action (or a step within a wallet action) failed.
75
+ */
76
+ failure_reason?: FailureReason;
77
+ }
78
+
79
+ /**
80
+ * A wallet action step consisting of an EVM user operation.
81
+ */
82
+ export interface EvmUserOperationWalletActionStep {
83
+ /**
84
+ * Transaction hash of the bundle in which this user operation was included. Null
85
+ * until included by a bundler.
86
+ */
87
+ bundle_transaction_hash: string | null;
88
+
89
+ /**
90
+ * CAIP-2 network identifier, containing the chain ID of the user operation.
91
+ */
92
+ caip2: string;
93
+
94
+ /**
95
+ * The entrypoint version of the user operation.
96
+ */
97
+ entrypoint_version: '0.6' | '0.7' | '0.8' | '0.9';
98
+
99
+ /**
100
+ * Status of an EVM step in a wallet action.
101
+ */
102
+ status: EvmWalletActionStepStatus;
103
+
104
+ type: 'evm_user_operation';
105
+
106
+ /**
107
+ * The user operation hash for this step. May change while the step status is
108
+ * non-terminal.
109
+ */
110
+ user_operation_hash: string | null;
111
+
112
+ /**
113
+ * A description of why a wallet action (or a step within a wallet action) failed.
114
+ */
115
+ failure_reason?: FailureReason;
116
+ }
117
+
118
+ /**
119
+ * A step within a wallet action, representing a single onchain action.
120
+ */
121
+ export type WalletActionStep = EvmTransactionWalletActionStep | EvmUserOperationWalletActionStep;
122
+
123
+ /**
124
+ * Response for a swap action.
125
+ */
126
+ export interface SwapActionResponse {
127
+ /**
128
+ * The ID of the wallet action.
129
+ */
130
+ id: string;
131
+
132
+ /**
133
+ * CAIP-2 chain identifier for the swap.
134
+ */
135
+ caip2: string;
136
+
137
+ /**
138
+ * ISO 8601 timestamp of when the wallet action was created.
139
+ */
140
+ created_at: string;
141
+
142
+ /**
143
+ * Exact base-unit amount of input token. Populated after on-chain confirmation.
144
+ */
145
+ input_amount: string | null;
146
+
147
+ /**
148
+ * Token address or "native" for the token being sold.
149
+ */
150
+ input_token: string;
151
+
152
+ /**
153
+ * Exact base-unit amount of output token. Populated after on-chain confirmation.
154
+ */
155
+ output_amount: string | null;
156
+
157
+ /**
158
+ * Token address or "native" for the token being bought.
159
+ */
160
+ output_token: string;
161
+
162
+ /**
163
+ * Status of a wallet action.
164
+ */
165
+ status: WalletActionStatus;
166
+
167
+ type: 'swap';
168
+
169
+ /**
170
+ * The ID of the wallet involved in the action.
171
+ */
172
+ wallet_id: string;
173
+
174
+ /**
175
+ * The steps of the wallet action. Only returned if `?include=steps` is provided.
176
+ */
177
+ steps?: Array<WalletActionStep>;
178
+ }
179
+
180
+ /**
181
+ * Response for a transfer action.
182
+ */
183
+ export interface TransferActionResponse {
184
+ /**
185
+ * The ID of the wallet action.
186
+ */
187
+ id: string;
188
+
189
+ /**
190
+ * ISO 8601 timestamp of when the wallet action was created.
191
+ */
192
+ created_at: string;
193
+
194
+ /**
195
+ * Recipient address.
196
+ */
197
+ destination_address: string;
198
+
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
+ /**
210
+ * Chain name (e.g. "base", "ethereum").
211
+ */
212
+ source_chain: string;
213
+
214
+ /**
215
+ * Status of a wallet action.
216
+ */
217
+ status: WalletActionStatus;
218
+
219
+ type: 'transfer';
220
+
221
+ /**
222
+ * The ID of the wallet involved in the action.
223
+ */
224
+ wallet_id: string;
225
+
226
+ /**
227
+ * The steps of the wallet action. Only returned if `?include=steps` is provided.
228
+ */
229
+ steps?: Array<WalletActionStep>;
230
+ }
231
+
232
+ /**
233
+ * Response for a wallet action, discriminated on type.
234
+ */
235
+ export type WalletActionResponse = SwapActionResponse | TransferActionResponse;
236
+
237
+ export declare namespace WalletActions {
238
+ 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
+ type EvmTransactionWalletActionStep as EvmTransactionWalletActionStep,
245
+ type EvmUserOperationWalletActionStep as EvmUserOperationWalletActionStep,
246
+ type WalletActionStep as WalletActionStep,
247
+ type SwapActionResponse as SwapActionResponse,
248
+ type TransferActionResponse as TransferActionResponse,
249
+ type WalletActionResponse as WalletActionResponse,
250
+ };
251
+ }
@@ -5,6 +5,9 @@ import { APIPromise } from '../../core/api-promise';
5
5
  import { RequestOptions } from '../../internal/request-options';
6
6
  import { path } from '../../internal/utils/path';
7
7
 
8
+ /**
9
+ * Operations related to wallets
10
+ */
8
11
  export class Balance extends APIResource {
9
12
  /**
10
13
  * Get the balance of a wallet by wallet ID.
@@ -31,12 +34,13 @@ export interface BalanceGetResponse {
31
34
 
32
35
  export namespace BalanceGetResponse {
33
36
  export interface Balance {
34
- asset: 'usdc' | 'eth' | 'pol' | 'usdt' | 'eurc' | 'usdb' | 'sol' | (string & {});
37
+ asset: 'usdc' | 'usdc.e' | 'eth' | 'pol' | 'usdt' | 'eurc' | 'usdb' | 'sol' | (string & {});
35
38
 
36
39
  chain:
37
40
  | 'ethereum'
38
41
  | 'arbitrum'
39
42
  | 'base'
43
+ | 'tempo'
40
44
  | 'linea'
41
45
  | 'optimism'
42
46
  | 'polygon'
@@ -69,18 +73,20 @@ export interface BalanceGetParams {
69
73
 
70
74
  asset?:
71
75
  | 'usdc'
76
+ | 'usdc.e'
72
77
  | 'eth'
73
78
  | 'pol'
74
79
  | 'usdt'
75
80
  | 'eurc'
76
81
  | 'usdb'
77
82
  | 'sol'
78
- | Array<'usdc' | 'eth' | 'pol' | 'usdt' | 'eurc' | 'usdb' | 'sol'>;
83
+ | Array<'usdc' | 'usdc.e' | 'eth' | 'pol' | 'usdt' | 'eurc' | 'usdb' | 'sol'>;
79
84
 
80
85
  chain?:
81
86
  | 'ethereum'
82
87
  | 'arbitrum'
83
88
  | 'base'
89
+ | 'tempo'
84
90
  | 'linea'
85
91
  | 'optimism'
86
92
  | 'polygon'
@@ -98,6 +104,7 @@ export interface BalanceGetParams {
98
104
  | 'ethereum'
99
105
  | 'arbitrum'
100
106
  | 'base'
107
+ | 'tempo'
101
108
  | 'linea'
102
109
  | 'optimism'
103
110
  | 'polygon'