@privy-io/node 0.7.0 → 0.9.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 (117) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/client.d.mts +18 -8
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +18 -8
  5. package/client.d.ts.map +1 -1
  6. package/client.js +20 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +20 -3
  9. package/client.mjs.map +1 -1
  10. package/internal/parse.d.mts.map +1 -1
  11. package/internal/parse.d.ts.map +1 -1
  12. package/internal/parse.js +5 -0
  13. package/internal/parse.js.map +1 -1
  14. package/internal/parse.mjs +5 -0
  15. package/internal/parse.mjs.map +1 -1
  16. package/package.json +21 -1
  17. package/resources/aggregations.d.mts +507 -0
  18. package/resources/aggregations.d.mts.map +1 -0
  19. package/resources/aggregations.d.ts +507 -0
  20. package/resources/aggregations.d.ts.map +1 -0
  21. package/resources/aggregations.js +9 -0
  22. package/resources/aggregations.js.map +1 -0
  23. package/resources/aggregations.mjs +5 -0
  24. package/resources/aggregations.mjs.map +1 -0
  25. package/resources/client-auth.d.mts +168 -2
  26. package/resources/client-auth.d.mts.map +1 -1
  27. package/resources/client-auth.d.ts +168 -2
  28. package/resources/client-auth.d.ts.map +1 -1
  29. package/resources/index.d.mts +6 -3
  30. package/resources/index.d.mts.map +1 -1
  31. package/resources/index.d.ts +6 -3
  32. package/resources/index.d.ts.map +1 -1
  33. package/resources/index.js +7 -1
  34. package/resources/index.js.map +1 -1
  35. package/resources/index.mjs +3 -0
  36. package/resources/index.mjs.map +1 -1
  37. package/resources/key-quorums.d.mts +4 -1
  38. package/resources/key-quorums.d.mts.map +1 -1
  39. package/resources/key-quorums.d.ts +4 -1
  40. package/resources/key-quorums.d.ts.map +1 -1
  41. package/resources/policies.d.mts +21 -20
  42. package/resources/policies.d.mts.map +1 -1
  43. package/resources/policies.d.ts +21 -20
  44. package/resources/policies.d.ts.map +1 -1
  45. package/resources/users.d.mts +21 -11
  46. package/resources/users.d.mts.map +1 -1
  47. package/resources/users.d.ts +21 -11
  48. package/resources/users.d.ts.map +1 -1
  49. package/resources/wallets/balance.d.mts +11 -6
  50. package/resources/wallets/balance.d.mts.map +1 -1
  51. package/resources/wallets/balance.d.ts +11 -6
  52. package/resources/wallets/balance.d.ts.map +1 -1
  53. package/resources/wallets/balance.js +1 -2
  54. package/resources/wallets/balance.js.map +1 -1
  55. package/resources/wallets/balance.mjs +1 -2
  56. package/resources/wallets/balance.mjs.map +1 -1
  57. package/resources/wallets/index.d.mts +1 -1
  58. package/resources/wallets/index.d.mts.map +1 -1
  59. package/resources/wallets/index.d.ts +1 -1
  60. package/resources/wallets/index.d.ts.map +1 -1
  61. package/resources/wallets/index.js.map +1 -1
  62. package/resources/wallets/index.mjs.map +1 -1
  63. package/resources/wallets/transactions.d.mts +3 -3
  64. package/resources/wallets/transactions.d.mts.map +1 -1
  65. package/resources/wallets/transactions.d.ts +3 -3
  66. package/resources/wallets/transactions.d.ts.map +1 -1
  67. package/resources/wallets/wallets.d.mts +249 -61
  68. package/resources/wallets/wallets.d.mts.map +1 -1
  69. package/resources/wallets/wallets.d.ts +249 -61
  70. package/resources/wallets/wallets.d.ts.map +1 -1
  71. package/resources/wallets/wallets.js.map +1 -1
  72. package/resources/wallets/wallets.mjs.map +1 -1
  73. package/resources/webhooks.d.mts +940 -0
  74. package/resources/webhooks.d.mts.map +1 -0
  75. package/resources/webhooks.d.ts +940 -0
  76. package/resources/webhooks.d.ts.map +1 -0
  77. package/resources/webhooks.js +9 -0
  78. package/resources/webhooks.js.map +1 -0
  79. package/resources/webhooks.mjs +5 -0
  80. package/resources/webhooks.mjs.map +1 -0
  81. package/resources/yield.d.mts +264 -0
  82. package/resources/yield.d.mts.map +1 -0
  83. package/resources/yield.d.ts +264 -0
  84. package/resources/yield.d.ts.map +1 -0
  85. package/resources/yield.js +9 -0
  86. package/resources/yield.js.map +1 -0
  87. package/resources/yield.mjs +5 -0
  88. package/resources/yield.mjs.map +1 -0
  89. package/src/client.ts +198 -9
  90. package/src/internal/parse.ts +6 -0
  91. package/src/resources/aggregations.ts +853 -0
  92. package/src/resources/client-auth.ts +288 -1
  93. package/src/resources/index.ts +87 -3
  94. package/src/resources/key-quorums.ts +4 -1
  95. package/src/resources/policies.ts +21 -20
  96. package/src/resources/users.ts +58 -41
  97. package/src/resources/wallets/balance.ts +24 -6
  98. package/src/resources/wallets/index.ts +6 -2
  99. package/src/resources/wallets/transactions.ts +11 -3
  100. package/src/resources/wallets/wallets.ts +333 -78
  101. package/src/resources/webhooks.ts +1287 -0
  102. package/src/resources/yield.ts +330 -0
  103. package/src/types/x402.d.ts +18 -0
  104. package/src/version.ts +1 -1
  105. package/src/x402.ts +87 -0
  106. package/version.d.mts +1 -1
  107. package/version.d.ts +1 -1
  108. package/version.js +1 -1
  109. package/version.mjs +1 -1
  110. package/x402.d.mts +54 -0
  111. package/x402.d.mts.map +1 -0
  112. package/x402.d.ts +54 -0
  113. package/x402.d.ts.map +1 -0
  114. package/x402.js +75 -0
  115. package/x402.js.map +1 -0
  116. package/x402.mjs +72 -0
  117. package/x402.mjs.map +1 -0
@@ -348,39 +348,6 @@ export interface AuthenticatedUser {
348
348
  oauth_tokens?: OAuthTokens;
349
349
  }
350
350
 
351
- /**
352
- * A linked account for the user.
353
- */
354
- export type LinkedAccount =
355
- | LinkedAccountEmail
356
- | LinkedAccountPhone
357
- | LinkedAccountEthereum
358
- | LinkedAccountSolana
359
- | LinkedAccountSmartWallet
360
- | LinkedAccountEthereumEmbeddedWallet
361
- | LinkedAccountSolanaEmbeddedWallet
362
- | LinkedAccountBitcoinSegwitEmbeddedWallet
363
- | LinkedAccountBitcoinTaprootEmbeddedWallet
364
- | LinkedAccountCurveSigningEmbeddedWallet
365
- | LinkedAccountGoogleOAuth
366
- | LinkedAccountTwitterOAuth
367
- | LinkedAccountDiscordOAuth
368
- | LinkedAccountGitHubOAuth
369
- | LinkedAccountSpotifyOAuth
370
- | LinkedAccountInstagramOAuth
371
- | LinkedAccountTiktokOAuth
372
- | LinkedAccountLineOAuth
373
- | LinkedAccountTwitchOAuth
374
- | LinkedAccountLinkedInOAuth
375
- | LinkedAccountAppleOAuth
376
- | LinkedAccountCustomOAuth
377
- | LinkedAccountCustomJwt
378
- | LinkedAccountFarcaster
379
- | LinkedAccountPasskey
380
- | LinkedAccountTelegram
381
- | LinkedAccountCrossApp
382
- | LinkedAccountAuthorizationKey;
383
-
384
351
  /**
385
352
  * A Privy user object.
386
353
  */
@@ -1119,6 +1086,12 @@ export interface LinkedAccountCustomOAuth {
1119
1086
 
1120
1087
  subject: string;
1121
1088
 
1089
+ /**
1090
+ * The ID of a custom OAuth provider, set up for this app. Must start with
1091
+ * "custom:".
1092
+ */
1093
+ type: ClientAuthAPI.CustomOAuthProviderID;
1094
+
1122
1095
  verified_at: number;
1123
1096
 
1124
1097
  email?: string;
@@ -1127,12 +1100,6 @@ export interface LinkedAccountCustomOAuth {
1127
1100
 
1128
1101
  profile_picture_url?: string;
1129
1102
 
1130
- /**
1131
- * The ID of a custom OAuth provider, set up for this app. Must start with
1132
- * "custom:".
1133
- */
1134
- type?: ClientAuthAPI.CustomOAuthProviderID;
1135
-
1136
1103
  username?: string;
1137
1104
  }
1138
1105
 
@@ -1201,6 +1168,39 @@ export interface LinkedAccountAuthorizationKey {
1201
1168
  verified_at: number;
1202
1169
  }
1203
1170
 
1171
+ /**
1172
+ * A linked account for the user.
1173
+ */
1174
+ export type LinkedAccount =
1175
+ | LinkedAccountEmail
1176
+ | LinkedAccountPhone
1177
+ | LinkedAccountEthereum
1178
+ | LinkedAccountSolana
1179
+ | LinkedAccountSmartWallet
1180
+ | LinkedAccountEthereumEmbeddedWallet
1181
+ | LinkedAccountSolanaEmbeddedWallet
1182
+ | LinkedAccountBitcoinSegwitEmbeddedWallet
1183
+ | LinkedAccountBitcoinTaprootEmbeddedWallet
1184
+ | LinkedAccountCurveSigningEmbeddedWallet
1185
+ | LinkedAccountGoogleOAuth
1186
+ | LinkedAccountTwitterOAuth
1187
+ | LinkedAccountDiscordOAuth
1188
+ | LinkedAccountGitHubOAuth
1189
+ | LinkedAccountSpotifyOAuth
1190
+ | LinkedAccountInstagramOAuth
1191
+ | LinkedAccountTiktokOAuth
1192
+ | LinkedAccountLineOAuth
1193
+ | LinkedAccountTwitchOAuth
1194
+ | LinkedAccountLinkedInOAuth
1195
+ | LinkedAccountAppleOAuth
1196
+ | LinkedAccountCustomOAuth
1197
+ | LinkedAccountCustomJwt
1198
+ | LinkedAccountFarcaster
1199
+ | LinkedAccountPasskey
1200
+ | LinkedAccountTelegram
1201
+ | LinkedAccountCrossApp
1202
+ | LinkedAccountAuthorizationKey;
1203
+
1204
1204
  /**
1205
1205
  * The possible types of linked accounts.
1206
1206
  */
@@ -1454,6 +1454,21 @@ export interface LinkedAccountCustomJwtInput {
1454
1454
  type: 'custom_auth';
1455
1455
  }
1456
1456
 
1457
+ /**
1458
+ * The payload for importing a passkey account.
1459
+ */
1460
+ export interface LinkedAccountPasskeyInput {
1461
+ credential_device_type: 'singleDevice' | 'multiDevice';
1462
+
1463
+ credential_id: string;
1464
+
1465
+ credential_public_key: string;
1466
+
1467
+ credential_username: string;
1468
+
1469
+ type: 'passkey';
1470
+ }
1471
+
1457
1472
  /**
1458
1473
  * The input for adding a linked account to a user.
1459
1474
  */
@@ -1474,7 +1489,8 @@ export type LinkedAccountInput =
1474
1489
  | LinkedAccountLinkedInInput
1475
1490
  | LinkedAccountFarcasterInput
1476
1491
  | LinkedAccountTelegramInput
1477
- | LinkedAccountCustomJwtInput;
1492
+ | LinkedAccountCustomJwtInput
1493
+ | LinkedAccountPasskeyInput;
1478
1494
 
1479
1495
  /**
1480
1496
  * The payload for batch creating users.
@@ -1762,7 +1778,6 @@ export interface UserUnlinkLinkedAccountParams {
1762
1778
  export declare namespace Users {
1763
1779
  export {
1764
1780
  type AuthenticatedUser as AuthenticatedUser,
1765
- type LinkedAccount as LinkedAccount,
1766
1781
  type User as User,
1767
1782
  type LinkedAccountEmail as LinkedAccountEmail,
1768
1783
  type LinkedAccountPhone as LinkedAccountPhone,
@@ -1799,6 +1814,7 @@ export declare namespace Users {
1799
1814
  type CrossAppSmartWallet as CrossAppSmartWallet,
1800
1815
  type LinkedAccountCrossApp as LinkedAccountCrossApp,
1801
1816
  type LinkedAccountAuthorizationKey as LinkedAccountAuthorizationKey,
1817
+ type LinkedAccount as LinkedAccount,
1802
1818
  type LinkedAccountType as LinkedAccountType,
1803
1819
  type CustomMetadata as CustomMetadata,
1804
1820
  type LinkedAccountWalletInput as LinkedAccountWalletInput,
@@ -1818,6 +1834,7 @@ export declare namespace Users {
1818
1834
  type LinkedAccountFarcasterInput as LinkedAccountFarcasterInput,
1819
1835
  type LinkedAccountTelegramInput as LinkedAccountTelegramInput,
1820
1836
  type LinkedAccountCustomJwtInput as LinkedAccountCustomJwtInput,
1837
+ type LinkedAccountPasskeyInput as LinkedAccountPasskeyInput,
1821
1838
  type LinkedAccountInput as LinkedAccountInput,
1822
1839
  type UserBatchCreateInput as UserBatchCreateInput,
1823
1840
  type SMSMfaMethod as SMSMfaMethod,
@@ -13,11 +13,14 @@ export class Balance extends APIResource {
13
13
  * ```ts
14
14
  * const balance = await client.wallets.balance.get(
15
15
  * 'wallet_id',
16
- * { asset: 'usdc', chain: 'ethereum' },
17
16
  * );
18
17
  * ```
19
18
  */
20
- get(walletID: string, query: BalanceGetParams, options?: RequestOptions): APIPromise<BalanceGetResponse> {
19
+ get(
20
+ walletID: string,
21
+ query: BalanceGetParams | null | undefined = {},
22
+ options?: RequestOptions,
23
+ ): APIPromise<BalanceGetResponse> {
21
24
  return this._client.get(path`/v1/wallets/${walletID}/balance`, { query, ...options });
22
25
  }
23
26
  }
@@ -28,7 +31,7 @@ export interface BalanceGetResponse {
28
31
 
29
32
  export namespace BalanceGetResponse {
30
33
  export interface Balance {
31
- asset: 'usdc' | 'eth' | 'pol' | 'usdt' | 'sol';
34
+ asset: 'usdc' | 'eth' | 'pol' | 'usdt' | 'eurc' | 'usdb' | 'sol' | (string & {});
32
35
 
33
36
  chain:
34
37
  | 'ethereum'
@@ -57,9 +60,24 @@ export namespace BalanceGetResponse {
57
60
  }
58
61
 
59
62
  export interface BalanceGetParams {
60
- asset: 'usdc' | 'eth' | 'pol' | 'usdt' | 'sol' | Array<'usdc' | 'eth' | 'pol' | 'usdt' | 'sol'>;
63
+ /**
64
+ * The token contract address(es) to query in format "chain:address" (e.g.,
65
+ * "base:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" or
66
+ * "solana:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v").
67
+ */
68
+ token?: string | Array<string>;
69
+
70
+ asset?:
71
+ | 'usdc'
72
+ | 'eth'
73
+ | 'pol'
74
+ | 'usdt'
75
+ | 'eurc'
76
+ | 'usdb'
77
+ | 'sol'
78
+ | Array<'usdc' | 'eth' | 'pol' | 'usdt' | 'eurc' | 'usdb' | 'sol'>;
61
79
 
62
- chain:
80
+ chain?:
63
81
  | 'ethereum'
64
82
  | 'arbitrum'
65
83
  | 'base'
@@ -95,7 +113,7 @@ export interface BalanceGetParams {
95
113
  | 'solana_testnet'
96
114
  >;
97
115
 
98
- include_currency?: 'usd';
116
+ include_currency?: 'usd' | 'eur';
99
117
  }
100
118
 
101
119
  export declare namespace Balance {
@@ -4,11 +4,11 @@ export { Balance, type BalanceGetResponse, type BalanceGetParams } from './balan
4
4
  export { Transactions, type TransactionGetResponse, type TransactionGetParams } from './transactions';
5
5
  export {
6
6
  Wallets,
7
+ type Wallet,
7
8
  type CurveSigningChainType,
9
+ type ExtendedChainType,
8
10
  type FirstClassChainType,
9
- type Wallet,
10
11
  type WalletChainType,
11
- type ExtendedChainType,
12
12
  type WalletCustodian,
13
13
  type CustodialWalletProvider,
14
14
  type CustodialWalletChainType,
@@ -16,6 +16,10 @@ export {
16
16
  type CustodialWallet,
17
17
  type HpkeImportConfig,
18
18
  type SuiCommandName,
19
+ type WalletBatchItemInput,
20
+ type WalletBatchCreateInput,
21
+ type WalletBatchCreateResult,
22
+ type WalletBatchCreateResponse,
19
23
  type EthereumPersonalSignRpcInput,
20
24
  type EthereumSignTransactionRpcInput,
21
25
  type EthereumSendTransactionRpcInput,
@@ -61,7 +61,7 @@ export namespace TransactionGetResponse {
61
61
 
62
62
  export namespace Transaction {
63
63
  export interface UnionMember0 {
64
- asset: 'usdc' | 'eth' | 'pol' | 'usdt' | 'sol';
64
+ asset: 'usdc' | 'eth' | 'pol' | 'usdt' | 'eurc' | 'usdb' | 'sol' | (string & {});
65
65
 
66
66
  chain:
67
67
  | 'ethereum'
@@ -99,7 +99,7 @@ export namespace TransactionGetResponse {
99
99
  }
100
100
 
101
101
  export interface UnionMember1 {
102
- asset: 'usdc' | 'eth' | 'pol' | 'usdt' | 'sol';
102
+ asset: 'usdc' | 'eth' | 'pol' | 'usdt' | 'eurc' | 'usdb' | 'sol' | (string & {});
103
103
 
104
104
  chain:
105
105
  | 'ethereum'
@@ -139,7 +139,15 @@ export namespace TransactionGetResponse {
139
139
  }
140
140
 
141
141
  export interface TransactionGetParams {
142
- asset: 'usdc' | 'eth' | 'pol' | 'usdt' | 'sol' | Array<'usdc' | 'eth' | 'pol' | 'usdt' | 'sol'>;
142
+ asset:
143
+ | 'usdc'
144
+ | 'eth'
145
+ | 'pol'
146
+ | 'usdt'
147
+ | 'eurc'
148
+ | 'usdb'
149
+ | 'sol'
150
+ | Array<'usdc' | 'eth' | 'pol' | 'usdt' | 'eurc' | 'usdb' | 'sol'>;
143
151
 
144
152
  chain: 'ethereum' | 'arbitrum' | 'base' | 'linea' | 'optimism' | 'polygon' | 'solana' | 'sepolia';
145
153