@privy-io/api-types 0.3.4 → 0.5.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 (118) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/LICENSE +1 -1
  3. package/README.md +31 -0
  4. package/client.d.mts +21 -11
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +21 -11
  7. package/client.d.ts.map +1 -1
  8. package/client.js +20 -3
  9. package/client.js.map +1 -1
  10. package/client.mjs +20 -3
  11. package/client.mjs.map +1 -1
  12. package/internal/parse.d.mts.map +1 -1
  13. package/internal/parse.d.ts.map +1 -1
  14. package/internal/parse.js +5 -0
  15. package/internal/parse.js.map +1 -1
  16. package/internal/parse.mjs +5 -0
  17. package/internal/parse.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/resources/aggregations.d.mts +507 -0
  20. package/resources/aggregations.d.mts.map +1 -0
  21. package/resources/aggregations.d.ts +507 -0
  22. package/resources/aggregations.d.ts.map +1 -0
  23. package/resources/aggregations.js +9 -0
  24. package/resources/aggregations.js.map +1 -0
  25. package/resources/aggregations.mjs +5 -0
  26. package/resources/aggregations.mjs.map +1 -0
  27. package/resources/client-auth.d.mts +183 -24
  28. package/resources/client-auth.d.mts.map +1 -1
  29. package/resources/client-auth.d.ts +183 -24
  30. package/resources/client-auth.d.ts.map +1 -1
  31. package/resources/funding.d.mts +4 -4
  32. package/resources/funding.d.mts.map +1 -1
  33. package/resources/funding.d.ts +4 -4
  34. package/resources/funding.d.ts.map +1 -1
  35. package/resources/index.d.mts +7 -4
  36. package/resources/index.d.mts.map +1 -1
  37. package/resources/index.d.ts +7 -4
  38. package/resources/index.d.ts.map +1 -1
  39. package/resources/index.js +7 -1
  40. package/resources/index.js.map +1 -1
  41. package/resources/index.mjs +3 -0
  42. package/resources/index.mjs.map +1 -1
  43. package/resources/key-quorums.d.mts +4 -1
  44. package/resources/key-quorums.d.mts.map +1 -1
  45. package/resources/key-quorums.d.ts +4 -1
  46. package/resources/key-quorums.d.ts.map +1 -1
  47. package/resources/policies.d.mts +89 -135
  48. package/resources/policies.d.mts.map +1 -1
  49. package/resources/policies.d.ts +89 -135
  50. package/resources/policies.d.ts.map +1 -1
  51. package/resources/policies.js.map +1 -1
  52. package/resources/policies.mjs.map +1 -1
  53. package/resources/users.d.mts +679 -415
  54. package/resources/users.d.mts.map +1 -1
  55. package/resources/users.d.ts +679 -415
  56. package/resources/users.d.ts.map +1 -1
  57. package/resources/wallets/balance.d.mts +11 -6
  58. package/resources/wallets/balance.d.mts.map +1 -1
  59. package/resources/wallets/balance.d.ts +11 -6
  60. package/resources/wallets/balance.d.ts.map +1 -1
  61. package/resources/wallets/balance.js +1 -2
  62. package/resources/wallets/balance.js.map +1 -1
  63. package/resources/wallets/balance.mjs +1 -2
  64. package/resources/wallets/balance.mjs.map +1 -1
  65. package/resources/wallets/index.d.mts +1 -1
  66. package/resources/wallets/index.d.mts.map +1 -1
  67. package/resources/wallets/index.d.ts +1 -1
  68. package/resources/wallets/index.d.ts.map +1 -1
  69. package/resources/wallets/index.js.map +1 -1
  70. package/resources/wallets/index.mjs.map +1 -1
  71. package/resources/wallets/transactions.d.mts +3 -3
  72. package/resources/wallets/transactions.d.mts.map +1 -1
  73. package/resources/wallets/transactions.d.ts +3 -3
  74. package/resources/wallets/transactions.d.ts.map +1 -1
  75. package/resources/wallets/wallets.d.mts +347 -65
  76. package/resources/wallets/wallets.d.mts.map +1 -1
  77. package/resources/wallets/wallets.d.ts +347 -65
  78. package/resources/wallets/wallets.d.ts.map +1 -1
  79. package/resources/wallets/wallets.js +1 -1
  80. package/resources/wallets/wallets.js.map +1 -1
  81. package/resources/wallets/wallets.mjs +1 -1
  82. package/resources/wallets/wallets.mjs.map +1 -1
  83. package/resources/webhooks.d.mts +940 -0
  84. package/resources/webhooks.d.mts.map +1 -0
  85. package/resources/webhooks.d.ts +940 -0
  86. package/resources/webhooks.d.ts.map +1 -0
  87. package/resources/webhooks.js +9 -0
  88. package/resources/webhooks.js.map +1 -0
  89. package/resources/webhooks.mjs +5 -0
  90. package/resources/webhooks.mjs.map +1 -0
  91. package/resources/yield.d.mts +264 -0
  92. package/resources/yield.d.mts.map +1 -0
  93. package/resources/yield.d.ts +264 -0
  94. package/resources/yield.d.ts.map +1 -0
  95. package/resources/yield.js +9 -0
  96. package/resources/yield.js.map +1 -0
  97. package/resources/yield.mjs +5 -0
  98. package/resources/yield.mjs.map +1 -0
  99. package/src/client.ts +331 -16
  100. package/src/internal/parse.ts +6 -0
  101. package/src/resources/aggregations.ts +853 -0
  102. package/src/resources/client-auth.ts +309 -35
  103. package/src/resources/funding.ts +4 -1
  104. package/src/resources/index.ts +156 -9
  105. package/src/resources/key-quorums.ts +4 -1
  106. package/src/resources/policies.ts +129 -214
  107. package/src/resources/users.ts +974 -650
  108. package/src/resources/wallets/balance.ts +24 -6
  109. package/src/resources/wallets/index.ts +13 -3
  110. package/src/resources/wallets/transactions.ts +11 -3
  111. package/src/resources/wallets/wallets.ts +468 -91
  112. package/src/resources/webhooks.ts +1287 -0
  113. package/src/resources/yield.ts +330 -0
  114. package/src/version.ts +1 -1
  115. package/version.d.mts +1 -1
  116. package/version.d.ts +1 -1
  117. package/version.js +1 -1
  118. package/version.mjs +1 -1
package/src/client.ts CHANGED
@@ -19,10 +19,36 @@ import { AbstractPage, type CursorParams, CursorResponse } from './core/paginati
19
19
  import * as Uploads from './core/uploads';
20
20
  import * as API from './resources/index';
21
21
  import { APIPromise } from './core/api-promise';
22
+ import {
23
+ Aggregation,
24
+ AggregationGroupBy,
25
+ AggregationInput,
26
+ AggregationMethod,
27
+ AggregationMetric,
28
+ AggregationWindow,
29
+ Aggregations,
30
+ } from './resources/aggregations';
22
31
  import { Analytics, AnalyticsEventInput } from './resources/analytics';
23
32
  import { AppResponse, Apps } from './resources/apps';
24
33
  import {
34
+ BridgeBrlFiatVirtualAccountDepositInstructions,
35
+ BridgeDestinationAsset,
36
+ BridgeEurFiatVirtualAccountDepositInstructions,
37
+ BridgeFiatCustomerResponse,
38
+ BridgeFiatVirtualAccountDepositInstructions,
39
+ BridgeFiatVirtualAccountDestination,
40
+ BridgeFiatVirtualAccountRequest,
41
+ BridgeFiatVirtualAccountResponse,
42
+ BridgeFiatVirtualAccountSource,
43
+ BridgeGbpFiatVirtualAccountDepositInstructions,
44
+ BridgeMxnFiatVirtualAccountDepositInstructions,
45
+ BridgeSandboxFiatCustomerResponse,
46
+ BridgeSandboxFiatVirtualAccountRequest,
47
+ BridgeSandboxFiatVirtualAccountResponse,
48
+ BridgeSourceAsset,
49
+ BridgeUsdFiatVirtualAccountDepositInstructions,
25
50
  ClientAuth,
51
+ CreateOrUpdateFiatCustomerRequestInput,
26
52
  CustomJwtAuthenticateRequestBody,
27
53
  CustomJwtLinkRequestBody,
28
54
  CustomOAuthProviderID,
@@ -40,6 +66,10 @@ import {
40
66
  FarcasterV2AuthenticateRequestBody,
41
67
  FarcasterV2InitRequestBody,
42
68
  FarcasterV2InitResponseBody,
69
+ FiatCustomerResponse,
70
+ FiatVirtualAccountRequest,
71
+ FiatVirtualAccountResponse,
72
+ GetFiatCustomerRequestInput,
43
73
  GuestAuthenticateRequestBody,
44
74
  MfaPasskeyEnrollmentRequestBody,
45
75
  MfaPasskeyInitRequestBody,
@@ -61,6 +91,7 @@ import {
61
91
  OAuthUnlinkRequestBody,
62
92
  OAuthVerifyRequestBody,
63
93
  OAuthVerifyResponseBody,
94
+ OnrampProvider,
64
95
  OptionalRefreshTokenInput,
65
96
  PasskeyAuthenticateRequestBody,
66
97
  PasskeyInitAuthenticateResponseBody,
@@ -141,6 +172,11 @@ import {
141
172
  PolicyUpdateParams,
142
173
  PolicyUpdateRuleParams,
143
174
  PolicyUpdateRuleResponse,
175
+ SuiTransactionCommandCondition,
176
+ SuiTransactionCommandOperator,
177
+ SuiTransferObjectsCommandCondition,
178
+ SuiTransferObjectsCommandField,
179
+ TronTransactionCondition,
144
180
  } from './resources/policies';
145
181
  import {
146
182
  TransactionGetResponse,
@@ -150,17 +186,70 @@ import {
150
186
  } from './resources/transactions';
151
187
  import {
152
188
  AuthenticatedUser,
189
+ CrossAppEmbeddedWallet,
190
+ CrossAppSmartWallet,
191
+ CustomMetadata,
192
+ EmbeddedWalletRecoveryMethod,
153
193
  LinkedAccount,
194
+ LinkedAccountAppleInput,
195
+ LinkedAccountAppleOAuth,
196
+ LinkedAccountAuthorizationKey,
197
+ LinkedAccountBaseWallet,
154
198
  LinkedAccountBitcoinSegwitEmbeddedWallet,
155
199
  LinkedAccountBitcoinTaprootEmbeddedWallet,
200
+ LinkedAccountCrossApp,
156
201
  LinkedAccountCurveSigningEmbeddedWallet,
202
+ LinkedAccountCustomJwt,
203
+ LinkedAccountCustomJwtInput,
204
+ LinkedAccountCustomOAuth,
205
+ LinkedAccountDiscordInput,
206
+ LinkedAccountDiscordOAuth,
207
+ LinkedAccountEmail,
208
+ LinkedAccountEmailInput,
157
209
  LinkedAccountEmbeddedWallet,
158
210
  LinkedAccountEmbeddedWalletWithID,
211
+ LinkedAccountEthereum,
159
212
  LinkedAccountEthereumEmbeddedWallet,
213
+ LinkedAccountFarcaster,
214
+ LinkedAccountFarcasterInput,
215
+ LinkedAccountGitHubInput,
216
+ LinkedAccountGitHubOAuth,
217
+ LinkedAccountGoogleInput,
218
+ LinkedAccountGoogleOAuth,
219
+ LinkedAccountInput,
220
+ LinkedAccountInstagramInput,
221
+ LinkedAccountInstagramOAuth,
222
+ LinkedAccountLineInput,
223
+ LinkedAccountLineOAuth,
224
+ LinkedAccountLinkedInInput,
225
+ LinkedAccountLinkedInOAuth,
226
+ LinkedAccountPasskey,
227
+ LinkedAccountPasskeyInput,
228
+ LinkedAccountPhone,
229
+ LinkedAccountPhoneInput,
160
230
  LinkedAccountSmartWallet,
231
+ LinkedAccountSolana,
161
232
  LinkedAccountSolanaEmbeddedWallet,
233
+ LinkedAccountSpotifyInput,
234
+ LinkedAccountSpotifyOAuth,
235
+ LinkedAccountTelegram,
236
+ LinkedAccountTelegramInput,
237
+ LinkedAccountTiktokInput,
238
+ LinkedAccountTiktokOAuth,
239
+ LinkedAccountTwitchInput,
240
+ LinkedAccountTwitchOAuth,
241
+ LinkedAccountTwitterInput,
242
+ LinkedAccountTwitterOAuth,
243
+ LinkedAccountType,
244
+ LinkedAccountWalletInput,
245
+ LinkedMfaMethod,
246
+ OAuthTokens,
247
+ PasskeyMfaMethod,
248
+ SMSMfaMethod,
162
249
  SmartWalletType,
250
+ TotpMfaMethod,
163
251
  User,
252
+ UserBatchCreateInput,
164
253
  UserCreateParams,
165
254
  UserGetByCustomAuthIDParams,
166
255
  UserGetByDiscordUsernameParams,
@@ -183,8 +272,60 @@ import {
183
272
  Users,
184
273
  UsersCursor,
185
274
  } from './resources/users';
275
+ import {
276
+ FundsDepositedWebhookPayload,
277
+ FundsWithdrawnWebhookPayload,
278
+ KrakenEmbedQuoteCancelledWebhookPayload,
279
+ KrakenEmbedQuoteExecutedWebhookPayload,
280
+ KrakenEmbedQuoteExecutionFailedWebhookPayload,
281
+ KrakenEmbedUserClosedWebhookPayload,
282
+ KrakenEmbedUserDisabledWebhookPayload,
283
+ KrakenEmbedUserVerifiedWebhookPayload,
284
+ KrakenEmbedVerificationCompletedWebhookPayload,
285
+ KrakenEmbedVerificationFailedWebhookPayload,
286
+ MfaDisabledWebhookPayload,
287
+ MfaEnabledWebhookPayload,
288
+ PrivateKeyExportWebhookPayload,
289
+ TransactionBroadcastedWebhookPayload,
290
+ TransactionConfirmedWebhookPayload,
291
+ TransactionExecutionRevertedWebhookPayload,
292
+ TransactionFailedWebhookPayload,
293
+ TransactionProviderErrorWebhookPayload,
294
+ TransactionReplacedWebhookPayload,
295
+ TransactionStillPendingWebhookPayload,
296
+ UserAuthenticatedWebhookPayload,
297
+ UserCreatedWebhookPayload,
298
+ UserLinkedAccountWebhookPayload,
299
+ UserTransferredAccountWebhookPayload,
300
+ UserUnlinkedAccountWebhookPayload,
301
+ UserUpdatedAccountWebhookPayload,
302
+ UserWalletCreatedWebhookPayload,
303
+ WalletRecoveredWebhookPayload,
304
+ WalletRecoverySetupWebhookPayload,
305
+ Webhooks,
306
+ } from './resources/webhooks';
307
+ import {
308
+ EthereumVaultDetailsInput,
309
+ EthereumVaultDetailsResponse,
310
+ EthereumVaultPosition,
311
+ EthereumVaultResponse,
312
+ EthereumYieldDepositInput,
313
+ EthereumYieldPositionResponse,
314
+ EthereumYieldPositionsInput,
315
+ EthereumYieldProvider,
316
+ EthereumYieldSweepIDInput,
317
+ EthereumYieldSweepResponse,
318
+ EthereumYieldSweepStatus,
319
+ EthereumYieldSweepType,
320
+ EthereumYieldWithdrawInput,
321
+ Yield,
322
+ } from './resources/yield';
186
323
  import {
187
324
  CurveSigningChainType,
325
+ CustodialWallet,
326
+ CustodialWalletChainType,
327
+ CustodialWalletCreateInput,
328
+ CustodialWalletProvider,
188
329
  EthereumPersonalSignRpcInput,
189
330
  EthereumPersonalSignRpcResponse,
190
331
  EthereumSecp256k1SignRpcInput,
@@ -201,15 +342,21 @@ import {
201
342
  EthereumSignUserOperationRpcResponse,
202
343
  ExtendedChainType,
203
344
  FirstClassChainType,
345
+ HpkeImportConfig,
204
346
  SolanaSignAndSendTransactionRpcInput,
205
347
  SolanaSignAndSendTransactionRpcResponse,
206
348
  SolanaSignMessageRpcInput,
207
349
  SolanaSignMessageRpcResponse,
208
350
  SolanaSignTransactionRpcInput,
209
351
  SolanaSignTransactionRpcResponse,
352
+ SuiCommandName,
210
353
  Wallet,
211
354
  WalletAuthenticateWithJwtParams,
212
355
  WalletAuthenticateWithJwtResponse,
356
+ WalletBatchCreateInput,
357
+ WalletBatchCreateResponse,
358
+ WalletBatchCreateResult,
359
+ WalletBatchItemInput,
213
360
  WalletChainType,
214
361
  WalletCreateParams,
215
362
  WalletCreateWalletsWithRecoveryParams,
@@ -350,7 +497,7 @@ export class Privy {
350
497
  baseURL: string;
351
498
  maxRetries: number;
352
499
  timeout: number;
353
- logger: Logger | undefined;
500
+ logger: Logger;
354
501
  logLevel: LogLevel | undefined;
355
502
  fetchOptions: MergedRequestInit | undefined;
356
503
 
@@ -703,7 +850,7 @@ export class Privy {
703
850
  loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
704
851
 
705
852
  const errText = await response.text().catch((err: any) => castToError(err).message);
706
- const errJSON = safeJSON(errText);
853
+ const errJSON = safeJSON(errText) as any;
707
854
  const errMessage = errJSON ? undefined : errText;
708
855
 
709
856
  loggerFor(this).debug(
@@ -740,9 +887,14 @@ export class Privy {
740
887
  getAPIList<Item, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(
741
888
  path: string,
742
889
  Page: new (...args: any[]) => PageClass,
743
- opts?: RequestOptions,
890
+ opts?: PromiseOrValue<RequestOptions>,
744
891
  ): Pagination.PagePromise<PageClass, Item> {
745
- return this.requestAPIList(Page, { method: 'get', path, ...opts });
892
+ return this.requestAPIList(
893
+ Page,
894
+ opts && 'then' in opts ?
895
+ opts.then((opts) => ({ method: 'get', path, ...opts }))
896
+ : { method: 'get', path, ...opts },
897
+ );
746
898
  }
747
899
 
748
900
  requestAPIList<
@@ -750,7 +902,7 @@ export class Privy {
750
902
  PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>,
751
903
  >(
752
904
  Page: new (...args: ConstructorParameters<typeof Pagination.AbstractPage>) => PageClass,
753
- options: FinalRequestOptions,
905
+ options: PromiseOrValue<FinalRequestOptions>,
754
906
  ): Pagination.PagePromise<PageClass, Item> {
755
907
  const request = this.makeRequest(options, null, undefined);
756
908
  return new Pagination.PagePromise<PageClass, Item>(this as any as Privy, request, Page);
@@ -763,9 +915,10 @@ export class Privy {
763
915
  controller: AbortController,
764
916
  ): Promise<Response> {
765
917
  const { signal, method, ...options } = init || {};
766
- if (signal) signal.addEventListener('abort', () => controller.abort());
918
+ const abort = this._makeAbort(controller);
919
+ if (signal) signal.addEventListener('abort', abort, { once: true });
767
920
 
768
- const timeout = setTimeout(() => controller.abort(), ms);
921
+ const timeout = setTimeout(abort, ms);
769
922
 
770
923
  const isReadableBody =
771
924
  ((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
@@ -933,6 +1086,12 @@ export class Privy {
933
1086
  return headers.values;
934
1087
  }
935
1088
 
1089
+ private _makeAbort(controller: AbortController) {
1090
+ // note: we can't just inline this method inside `fetchWithTimeout()` because then the closure
1091
+ // would capture all request options, and cause a memory leak.
1092
+ return () => controller.abort();
1093
+ }
1094
+
936
1095
  private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
937
1096
  bodyHeaders: HeadersLike;
938
1097
  body: BodyInit | undefined;
@@ -1000,6 +1159,9 @@ export class Privy {
1000
1159
  policies: API.Policies = new API.Policies(this);
1001
1160
  transactions: API.Transactions = new API.Transactions(this);
1002
1161
  keyQuorums: API.KeyQuorums = new API.KeyQuorums(this);
1162
+ aggregations: API.Aggregations = new API.Aggregations(this);
1163
+ webhooks: API.Webhooks = new API.Webhooks(this);
1164
+ yield: API.Yield = new API.Yield(this);
1003
1165
  }
1004
1166
 
1005
1167
  Privy.Wallets = Wallets;
@@ -1013,6 +1175,9 @@ Privy.Analytics = Analytics;
1013
1175
  Privy.Policies = Policies;
1014
1176
  Privy.Transactions = Transactions;
1015
1177
  Privy.KeyQuorums = KeyQuorums;
1178
+ Privy.Aggregations = Aggregations;
1179
+ Privy.Webhooks = Webhooks;
1180
+ Privy.Yield = Yield;
1016
1181
 
1017
1182
  export declare namespace Privy {
1018
1183
  export type RequestOptions = Opts.RequestOptions;
@@ -1022,13 +1187,23 @@ export declare namespace Privy {
1022
1187
 
1023
1188
  export {
1024
1189
  Wallets as Wallets,
1190
+ type WalletRevokeResponse as WalletRevokeResponse,
1025
1191
  type CurveSigningChainType as CurveSigningChainType,
1192
+ type ExtendedChainType as ExtendedChainType,
1026
1193
  type FirstClassChainType as FirstClassChainType,
1027
- type Wallet as Wallet,
1028
1194
  type WalletChainType as WalletChainType,
1029
- type WalletRevokeResponse as WalletRevokeResponse,
1030
- type ExtendedChainType as ExtendedChainType,
1031
1195
  type WalletCustodian as WalletCustodian,
1196
+ type CustodialWalletProvider as CustodialWalletProvider,
1197
+ type CustodialWalletChainType as CustodialWalletChainType,
1198
+ type CustodialWalletCreateInput as CustodialWalletCreateInput,
1199
+ type CustodialWallet as CustodialWallet,
1200
+ type HpkeImportConfig as HpkeImportConfig,
1201
+ type SuiCommandName as SuiCommandName,
1202
+ type Wallet as Wallet,
1203
+ type WalletBatchItemInput as WalletBatchItemInput,
1204
+ type WalletBatchCreateInput as WalletBatchCreateInput,
1205
+ type WalletBatchCreateResult as WalletBatchCreateResult,
1206
+ type WalletBatchCreateResponse as WalletBatchCreateResponse,
1032
1207
  type EthereumPersonalSignRpcInput as EthereumPersonalSignRpcInput,
1033
1208
  type EthereumSignTransactionRpcInput as EthereumSignTransactionRpcInput,
1034
1209
  type EthereumSendTransactionRpcInput as EthereumSendTransactionRpcInput,
@@ -1158,6 +1333,28 @@ export declare namespace Privy {
1158
1333
  type PrivyOAuthProviderID as PrivyOAuthProviderID,
1159
1334
  type CustomOAuthProviderID as CustomOAuthProviderID,
1160
1335
  type OAuthProviderID as OAuthProviderID,
1336
+ type OnrampProvider as OnrampProvider,
1337
+ type GetFiatCustomerRequestInput as GetFiatCustomerRequestInput,
1338
+ type CreateOrUpdateFiatCustomerRequestInput as CreateOrUpdateFiatCustomerRequestInput,
1339
+ type BridgeFiatCustomerResponse as BridgeFiatCustomerResponse,
1340
+ type BridgeSandboxFiatCustomerResponse as BridgeSandboxFiatCustomerResponse,
1341
+ type FiatCustomerResponse as FiatCustomerResponse,
1342
+ type BridgeDestinationAsset as BridgeDestinationAsset,
1343
+ type BridgeSourceAsset as BridgeSourceAsset,
1344
+ type BridgeFiatVirtualAccountSource as BridgeFiatVirtualAccountSource,
1345
+ type BridgeFiatVirtualAccountDestination as BridgeFiatVirtualAccountDestination,
1346
+ type BridgeFiatVirtualAccountRequest as BridgeFiatVirtualAccountRequest,
1347
+ type BridgeSandboxFiatVirtualAccountRequest as BridgeSandboxFiatVirtualAccountRequest,
1348
+ type FiatVirtualAccountRequest as FiatVirtualAccountRequest,
1349
+ type BridgeUsdFiatVirtualAccountDepositInstructions as BridgeUsdFiatVirtualAccountDepositInstructions,
1350
+ type BridgeEurFiatVirtualAccountDepositInstructions as BridgeEurFiatVirtualAccountDepositInstructions,
1351
+ type BridgeMxnFiatVirtualAccountDepositInstructions as BridgeMxnFiatVirtualAccountDepositInstructions,
1352
+ type BridgeBrlFiatVirtualAccountDepositInstructions as BridgeBrlFiatVirtualAccountDepositInstructions,
1353
+ type BridgeGbpFiatVirtualAccountDepositInstructions as BridgeGbpFiatVirtualAccountDepositInstructions,
1354
+ type BridgeFiatVirtualAccountDepositInstructions as BridgeFiatVirtualAccountDepositInstructions,
1355
+ type BridgeFiatVirtualAccountResponse as BridgeFiatVirtualAccountResponse,
1356
+ type BridgeSandboxFiatVirtualAccountResponse as BridgeSandboxFiatVirtualAccountResponse,
1357
+ type FiatVirtualAccountResponse as FiatVirtualAccountResponse,
1161
1358
  };
1162
1359
 
1163
1360
  export { CrossApp as CrossApp, type CrossAppConnectionsResponse as CrossAppConnectionsResponse };
@@ -1173,10 +1370,17 @@ export declare namespace Privy {
1173
1370
 
1174
1371
  export {
1175
1372
  Users as Users,
1176
- type AuthenticatedUser as AuthenticatedUser,
1177
- type LinkedAccount as LinkedAccount,
1178
- type User as User,
1179
- type UserWithIdentityToken as UserWithIdentityToken,
1373
+ type LinkedAccountEmail as LinkedAccountEmail,
1374
+ type LinkedAccountPhone as LinkedAccountPhone,
1375
+ type LinkedAccountBaseWallet as LinkedAccountBaseWallet,
1376
+ type LinkedAccountEthereum as LinkedAccountEthereum,
1377
+ type SmartWalletType as SmartWalletType,
1378
+ type LinkedAccountSmartWallet as LinkedAccountSmartWallet,
1379
+ type LinkedAccountSolana as LinkedAccountSolana,
1380
+ type LinkedAccountFarcaster as LinkedAccountFarcaster,
1381
+ type LinkedAccountPasskey as LinkedAccountPasskey,
1382
+ type LinkedAccountTelegram as LinkedAccountTelegram,
1383
+ type EmbeddedWalletRecoveryMethod as EmbeddedWalletRecoveryMethod,
1180
1384
  type LinkedAccountEthereumEmbeddedWallet as LinkedAccountEthereumEmbeddedWallet,
1181
1385
  type LinkedAccountSolanaEmbeddedWallet as LinkedAccountSolanaEmbeddedWallet,
1182
1386
  type LinkedAccountBitcoinSegwitEmbeddedWallet as LinkedAccountBitcoinSegwitEmbeddedWallet,
@@ -1184,8 +1388,54 @@ export declare namespace Privy {
1184
1388
  type LinkedAccountCurveSigningEmbeddedWallet as LinkedAccountCurveSigningEmbeddedWallet,
1185
1389
  type LinkedAccountEmbeddedWallet as LinkedAccountEmbeddedWallet,
1186
1390
  type LinkedAccountEmbeddedWalletWithID as LinkedAccountEmbeddedWalletWithID,
1187
- type SmartWalletType as SmartWalletType,
1188
- type LinkedAccountSmartWallet as LinkedAccountSmartWallet,
1391
+ type LinkedAccountGoogleOAuth as LinkedAccountGoogleOAuth,
1392
+ type LinkedAccountTwitterOAuth as LinkedAccountTwitterOAuth,
1393
+ type LinkedAccountDiscordOAuth as LinkedAccountDiscordOAuth,
1394
+ type LinkedAccountGitHubOAuth as LinkedAccountGitHubOAuth,
1395
+ type LinkedAccountLinkedInOAuth as LinkedAccountLinkedInOAuth,
1396
+ type LinkedAccountSpotifyOAuth as LinkedAccountSpotifyOAuth,
1397
+ type LinkedAccountInstagramOAuth as LinkedAccountInstagramOAuth,
1398
+ type LinkedAccountTiktokOAuth as LinkedAccountTiktokOAuth,
1399
+ type LinkedAccountLineOAuth as LinkedAccountLineOAuth,
1400
+ type LinkedAccountTwitchOAuth as LinkedAccountTwitchOAuth,
1401
+ type LinkedAccountAppleOAuth as LinkedAccountAppleOAuth,
1402
+ type LinkedAccountCustomOAuth as LinkedAccountCustomOAuth,
1403
+ type LinkedAccountCustomJwt as LinkedAccountCustomJwt,
1404
+ type CrossAppEmbeddedWallet as CrossAppEmbeddedWallet,
1405
+ type CrossAppSmartWallet as CrossAppSmartWallet,
1406
+ type LinkedAccountCrossApp as LinkedAccountCrossApp,
1407
+ type LinkedAccountAuthorizationKey as LinkedAccountAuthorizationKey,
1408
+ type LinkedAccount as LinkedAccount,
1409
+ type LinkedAccountType as LinkedAccountType,
1410
+ type CustomMetadata as CustomMetadata,
1411
+ type LinkedAccountWalletInput as LinkedAccountWalletInput,
1412
+ type LinkedAccountEmailInput as LinkedAccountEmailInput,
1413
+ type LinkedAccountPhoneInput as LinkedAccountPhoneInput,
1414
+ type LinkedAccountGoogleInput as LinkedAccountGoogleInput,
1415
+ type LinkedAccountTwitterInput as LinkedAccountTwitterInput,
1416
+ type LinkedAccountDiscordInput as LinkedAccountDiscordInput,
1417
+ type LinkedAccountGitHubInput as LinkedAccountGitHubInput,
1418
+ type LinkedAccountSpotifyInput as LinkedAccountSpotifyInput,
1419
+ type LinkedAccountInstagramInput as LinkedAccountInstagramInput,
1420
+ type LinkedAccountTiktokInput as LinkedAccountTiktokInput,
1421
+ type LinkedAccountLineInput as LinkedAccountLineInput,
1422
+ type LinkedAccountTwitchInput as LinkedAccountTwitchInput,
1423
+ type LinkedAccountAppleInput as LinkedAccountAppleInput,
1424
+ type LinkedAccountLinkedInInput as LinkedAccountLinkedInInput,
1425
+ type LinkedAccountFarcasterInput as LinkedAccountFarcasterInput,
1426
+ type LinkedAccountTelegramInput as LinkedAccountTelegramInput,
1427
+ type LinkedAccountCustomJwtInput as LinkedAccountCustomJwtInput,
1428
+ type LinkedAccountPasskeyInput as LinkedAccountPasskeyInput,
1429
+ type LinkedAccountInput as LinkedAccountInput,
1430
+ type UserBatchCreateInput as UserBatchCreateInput,
1431
+ type SMSMfaMethod as SMSMfaMethod,
1432
+ type TotpMfaMethod as TotpMfaMethod,
1433
+ type PasskeyMfaMethod as PasskeyMfaMethod,
1434
+ type LinkedMfaMethod as LinkedMfaMethod,
1435
+ type User as User,
1436
+ type OAuthTokens as OAuthTokens,
1437
+ type UserWithIdentityToken as UserWithIdentityToken,
1438
+ type AuthenticatedUser as AuthenticatedUser,
1189
1439
  type UsersCursor as UsersCursor,
1190
1440
  type UserCreateParams as UserCreateParams,
1191
1441
  type UserListParams as UserListParams,
@@ -1211,6 +1461,11 @@ export declare namespace Privy {
1211
1461
 
1212
1462
  export {
1213
1463
  Policies as Policies,
1464
+ type SuiTransactionCommandOperator as SuiTransactionCommandOperator,
1465
+ type SuiTransferObjectsCommandField as SuiTransferObjectsCommandField,
1466
+ type TronTransactionCondition as TronTransactionCondition,
1467
+ type SuiTransactionCommandCondition as SuiTransactionCommandCondition,
1468
+ type SuiTransferObjectsCommandCondition as SuiTransferObjectsCommandCondition,
1214
1469
  type Policy as Policy,
1215
1470
  type PolicyCreateRuleResponse as PolicyCreateRuleResponse,
1216
1471
  type PolicyDeleteResponse as PolicyDeleteResponse,
@@ -1241,4 +1496,64 @@ export declare namespace Privy {
1241
1496
  type KeyQuorumDeleteParams as KeyQuorumDeleteParams,
1242
1497
  type KeyQuorumUpdateParams as KeyQuorumUpdateParams,
1243
1498
  };
1499
+
1500
+ export {
1501
+ Aggregations as Aggregations,
1502
+ type AggregationMethod as AggregationMethod,
1503
+ type AggregationMetric as AggregationMetric,
1504
+ type AggregationWindow as AggregationWindow,
1505
+ type AggregationGroupBy as AggregationGroupBy,
1506
+ type Aggregation as Aggregation,
1507
+ type AggregationInput as AggregationInput,
1508
+ };
1509
+
1510
+ export {
1511
+ Webhooks as Webhooks,
1512
+ type UserCreatedWebhookPayload as UserCreatedWebhookPayload,
1513
+ type UserAuthenticatedWebhookPayload as UserAuthenticatedWebhookPayload,
1514
+ type UserLinkedAccountWebhookPayload as UserLinkedAccountWebhookPayload,
1515
+ type UserUnlinkedAccountWebhookPayload as UserUnlinkedAccountWebhookPayload,
1516
+ type UserUpdatedAccountWebhookPayload as UserUpdatedAccountWebhookPayload,
1517
+ type UserTransferredAccountWebhookPayload as UserTransferredAccountWebhookPayload,
1518
+ type UserWalletCreatedWebhookPayload as UserWalletCreatedWebhookPayload,
1519
+ type TransactionBroadcastedWebhookPayload as TransactionBroadcastedWebhookPayload,
1520
+ type TransactionConfirmedWebhookPayload as TransactionConfirmedWebhookPayload,
1521
+ type TransactionExecutionRevertedWebhookPayload as TransactionExecutionRevertedWebhookPayload,
1522
+ type TransactionStillPendingWebhookPayload as TransactionStillPendingWebhookPayload,
1523
+ type TransactionFailedWebhookPayload as TransactionFailedWebhookPayload,
1524
+ type TransactionReplacedWebhookPayload as TransactionReplacedWebhookPayload,
1525
+ type TransactionProviderErrorWebhookPayload as TransactionProviderErrorWebhookPayload,
1526
+ type FundsDepositedWebhookPayload as FundsDepositedWebhookPayload,
1527
+ type FundsWithdrawnWebhookPayload as FundsWithdrawnWebhookPayload,
1528
+ type PrivateKeyExportWebhookPayload as PrivateKeyExportWebhookPayload,
1529
+ type WalletRecoverySetupWebhookPayload as WalletRecoverySetupWebhookPayload,
1530
+ type WalletRecoveredWebhookPayload as WalletRecoveredWebhookPayload,
1531
+ type MfaEnabledWebhookPayload as MfaEnabledWebhookPayload,
1532
+ type MfaDisabledWebhookPayload as MfaDisabledWebhookPayload,
1533
+ type KrakenEmbedVerificationCompletedWebhookPayload as KrakenEmbedVerificationCompletedWebhookPayload,
1534
+ type KrakenEmbedVerificationFailedWebhookPayload as KrakenEmbedVerificationFailedWebhookPayload,
1535
+ type KrakenEmbedQuoteExecutedWebhookPayload as KrakenEmbedQuoteExecutedWebhookPayload,
1536
+ type KrakenEmbedQuoteExecutionFailedWebhookPayload as KrakenEmbedQuoteExecutionFailedWebhookPayload,
1537
+ type KrakenEmbedQuoteCancelledWebhookPayload as KrakenEmbedQuoteCancelledWebhookPayload,
1538
+ type KrakenEmbedUserVerifiedWebhookPayload as KrakenEmbedUserVerifiedWebhookPayload,
1539
+ type KrakenEmbedUserDisabledWebhookPayload as KrakenEmbedUserDisabledWebhookPayload,
1540
+ type KrakenEmbedUserClosedWebhookPayload as KrakenEmbedUserClosedWebhookPayload,
1541
+ };
1542
+
1543
+ export {
1544
+ Yield as Yield,
1545
+ type EthereumYieldProvider as EthereumYieldProvider,
1546
+ type EthereumYieldSweepType as EthereumYieldSweepType,
1547
+ type EthereumYieldSweepStatus as EthereumYieldSweepStatus,
1548
+ type EthereumYieldDepositInput as EthereumYieldDepositInput,
1549
+ type EthereumYieldWithdrawInput as EthereumYieldWithdrawInput,
1550
+ type EthereumYieldSweepResponse as EthereumYieldSweepResponse,
1551
+ type EthereumVaultDetailsInput as EthereumVaultDetailsInput,
1552
+ type EthereumYieldSweepIDInput as EthereumYieldSweepIDInput,
1553
+ type EthereumVaultResponse as EthereumVaultResponse,
1554
+ type EthereumVaultDetailsResponse as EthereumVaultDetailsResponse,
1555
+ type EthereumYieldPositionsInput as EthereumYieldPositionsInput,
1556
+ type EthereumVaultPosition as EthereumVaultPosition,
1557
+ type EthereumYieldPositionResponse as EthereumYieldPositionResponse,
1558
+ };
1244
1559
  }
@@ -29,6 +29,12 @@ export async function defaultParseResponse<T>(client: Privy, props: APIResponseP
29
29
  const mediaType = contentType?.split(';')[0]?.trim();
30
30
  const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
31
31
  if (isJSON) {
32
+ const contentLength = response.headers.get('content-length');
33
+ if (contentLength === '0') {
34
+ // if there is no content we can't do anything
35
+ return undefined as T;
36
+ }
37
+
32
38
  const json = await response.json();
33
39
  return json as T;
34
40
  }