@privy-io/node 0.8.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 (108) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/client.d.mts +17 -10
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +17 -10
  5. package/client.d.ts.map +1 -1
  6. package/client.js +17 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +17 -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 +213 -2
  18. package/resources/aggregations.d.mts.map +1 -1
  19. package/resources/aggregations.d.ts +213 -2
  20. package/resources/aggregations.d.ts.map +1 -1
  21. package/resources/client-auth.d.mts +168 -2
  22. package/resources/client-auth.d.mts.map +1 -1
  23. package/resources/client-auth.d.ts +168 -2
  24. package/resources/client-auth.d.ts.map +1 -1
  25. package/resources/index.d.mts +6 -4
  26. package/resources/index.d.mts.map +1 -1
  27. package/resources/index.d.ts +6 -4
  28. package/resources/index.d.ts.map +1 -1
  29. package/resources/index.js +5 -1
  30. package/resources/index.js.map +1 -1
  31. package/resources/index.mjs +2 -0
  32. package/resources/index.mjs.map +1 -1
  33. package/resources/policies.d.mts +2 -4
  34. package/resources/policies.d.mts.map +1 -1
  35. package/resources/policies.d.ts +2 -4
  36. package/resources/policies.d.ts.map +1 -1
  37. package/resources/users.d.mts +16 -6
  38. package/resources/users.d.mts.map +1 -1
  39. package/resources/users.d.ts +16 -6
  40. package/resources/users.d.ts.map +1 -1
  41. package/resources/wallets/balance.d.mts +10 -5
  42. package/resources/wallets/balance.d.mts.map +1 -1
  43. package/resources/wallets/balance.d.ts +10 -5
  44. package/resources/wallets/balance.d.ts.map +1 -1
  45. package/resources/wallets/balance.js +1 -2
  46. package/resources/wallets/balance.js.map +1 -1
  47. package/resources/wallets/balance.mjs +1 -2
  48. package/resources/wallets/balance.mjs.map +1 -1
  49. package/resources/wallets/index.d.mts +1 -1
  50. package/resources/wallets/index.d.mts.map +1 -1
  51. package/resources/wallets/index.d.ts +1 -1
  52. package/resources/wallets/index.d.ts.map +1 -1
  53. package/resources/wallets/index.js.map +1 -1
  54. package/resources/wallets/index.mjs.map +1 -1
  55. package/resources/wallets/transactions.d.mts +2 -2
  56. package/resources/wallets/transactions.d.mts.map +1 -1
  57. package/resources/wallets/transactions.d.ts +2 -2
  58. package/resources/wallets/transactions.d.ts.map +1 -1
  59. package/resources/wallets/wallets.d.mts +133 -13
  60. package/resources/wallets/wallets.d.mts.map +1 -1
  61. package/resources/wallets/wallets.d.ts +133 -13
  62. package/resources/wallets/wallets.d.ts.map +1 -1
  63. package/resources/wallets/wallets.js.map +1 -1
  64. package/resources/wallets/wallets.mjs.map +1 -1
  65. package/resources/webhooks.d.mts +940 -0
  66. package/resources/webhooks.d.mts.map +1 -0
  67. package/resources/webhooks.d.ts +940 -0
  68. package/resources/webhooks.d.ts.map +1 -0
  69. package/resources/webhooks.js +9 -0
  70. package/resources/webhooks.js.map +1 -0
  71. package/resources/webhooks.mjs +5 -0
  72. package/resources/webhooks.mjs.map +1 -0
  73. package/resources/yield.d.mts +264 -0
  74. package/resources/yield.d.mts.map +1 -0
  75. package/resources/yield.d.ts +264 -0
  76. package/resources/yield.d.ts.map +1 -0
  77. package/resources/yield.js +9 -0
  78. package/resources/yield.js.map +1 -0
  79. package/resources/yield.mjs +5 -0
  80. package/resources/yield.mjs.map +1 -0
  81. package/src/client.ts +179 -9
  82. package/src/internal/parse.ts +6 -0
  83. package/src/resources/aggregations.ts +361 -5
  84. package/src/resources/client-auth.ts +288 -1
  85. package/src/resources/index.ts +79 -3
  86. package/src/resources/policies.ts +2 -4
  87. package/src/resources/users.ts +52 -35
  88. package/src/resources/wallets/balance.ts +15 -5
  89. package/src/resources/wallets/index.ts +6 -2
  90. package/src/resources/wallets/transactions.ts +2 -2
  91. package/src/resources/wallets/wallets.ts +176 -30
  92. package/src/resources/webhooks.ts +1287 -0
  93. package/src/resources/yield.ts +330 -0
  94. package/src/types/x402.d.ts +18 -0
  95. package/src/version.ts +1 -1
  96. package/src/x402.ts +87 -0
  97. package/version.d.mts +1 -1
  98. package/version.d.ts +1 -1
  99. package/version.js +1 -1
  100. package/version.mjs +1 -1
  101. package/x402.d.mts +54 -0
  102. package/x402.d.mts.map +1 -0
  103. package/x402.d.ts +54 -0
  104. package/x402.d.ts.map +1 -0
  105. package/x402.js +75 -0
  106. package/x402.js.map +1 -0
  107. package/x402.mjs +72 -0
  108. package/x402.mjs.map +1 -0
package/src/client.ts CHANGED
@@ -22,6 +22,7 @@ import { APIPromise } from './core/api-promise';
22
22
  import {
23
23
  Aggregation,
24
24
  AggregationGroupBy,
25
+ AggregationInput,
25
26
  AggregationMethod,
26
27
  AggregationMetric,
27
28
  AggregationWindow,
@@ -30,10 +31,32 @@ import {
30
31
  import { Analytics, AnalyticsEventInput } from './resources/analytics';
31
32
  import { AppResponse, Apps } from './resources/apps';
32
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,
33
50
  ClientAuth,
51
+ CreateOrUpdateFiatCustomerRequestInput,
34
52
  CustomOAuthProviderID,
35
53
  ExternalOAuthProviderID,
54
+ FiatCustomerResponse,
55
+ FiatVirtualAccountRequest,
56
+ FiatVirtualAccountResponse,
57
+ GetFiatCustomerRequestInput,
36
58
  OAuthProviderID,
59
+ OnrampProvider,
37
60
  PrivyOAuthProviderID,
38
61
  } from './resources/client-auth';
39
62
  import {
@@ -106,6 +129,7 @@ import {
106
129
  LinkedAccountLinkedInInput,
107
130
  LinkedAccountLinkedInOAuth,
108
131
  LinkedAccountPasskey,
132
+ LinkedAccountPasskeyInput,
109
133
  LinkedAccountPhone,
110
134
  LinkedAccountPhoneInput,
111
135
  LinkedAccountSmartWallet,
@@ -153,6 +177,54 @@ import {
153
177
  Users,
154
178
  UsersCursor,
155
179
  } from './resources/users';
180
+ import {
181
+ FundsDepositedWebhookPayload,
182
+ FundsWithdrawnWebhookPayload,
183
+ KrakenEmbedQuoteCancelledWebhookPayload,
184
+ KrakenEmbedQuoteExecutedWebhookPayload,
185
+ KrakenEmbedQuoteExecutionFailedWebhookPayload,
186
+ KrakenEmbedUserClosedWebhookPayload,
187
+ KrakenEmbedUserDisabledWebhookPayload,
188
+ KrakenEmbedUserVerifiedWebhookPayload,
189
+ KrakenEmbedVerificationCompletedWebhookPayload,
190
+ KrakenEmbedVerificationFailedWebhookPayload,
191
+ MfaDisabledWebhookPayload,
192
+ MfaEnabledWebhookPayload,
193
+ PrivateKeyExportWebhookPayload,
194
+ TransactionBroadcastedWebhookPayload,
195
+ TransactionConfirmedWebhookPayload,
196
+ TransactionExecutionRevertedWebhookPayload,
197
+ TransactionFailedWebhookPayload,
198
+ TransactionProviderErrorWebhookPayload,
199
+ TransactionReplacedWebhookPayload,
200
+ TransactionStillPendingWebhookPayload,
201
+ UserAuthenticatedWebhookPayload,
202
+ UserCreatedWebhookPayload,
203
+ UserLinkedAccountWebhookPayload,
204
+ UserTransferredAccountWebhookPayload,
205
+ UserUnlinkedAccountWebhookPayload,
206
+ UserUpdatedAccountWebhookPayload,
207
+ UserWalletCreatedWebhookPayload,
208
+ WalletRecoveredWebhookPayload,
209
+ WalletRecoverySetupWebhookPayload,
210
+ Webhooks,
211
+ } from './resources/webhooks';
212
+ import {
213
+ EthereumVaultDetailsInput,
214
+ EthereumVaultDetailsResponse,
215
+ EthereumVaultPosition,
216
+ EthereumVaultResponse,
217
+ EthereumYieldDepositInput,
218
+ EthereumYieldPositionResponse,
219
+ EthereumYieldPositionsInput,
220
+ EthereumYieldProvider,
221
+ EthereumYieldSweepIDInput,
222
+ EthereumYieldSweepResponse,
223
+ EthereumYieldSweepStatus,
224
+ EthereumYieldSweepType,
225
+ EthereumYieldWithdrawInput,
226
+ Yield,
227
+ } from './resources/yield';
156
228
  import {
157
229
  CurveSigningChainType,
158
230
  CustodialWallet,
@@ -186,6 +258,10 @@ import {
186
258
  Wallet,
187
259
  WalletAuthenticateWithJwtParams,
188
260
  WalletAuthenticateWithJwtResponse,
261
+ WalletBatchCreateInput,
262
+ WalletBatchCreateResponse,
263
+ WalletBatchCreateResult,
264
+ WalletBatchItemInput,
189
265
  WalletChainType,
190
266
  WalletCreateParams,
191
267
  WalletCreateWalletsWithRecoveryParams,
@@ -678,7 +754,7 @@ export class PrivyAPI {
678
754
  loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
679
755
 
680
756
  const errText = await response.text().catch((err: any) => castToError(err).message);
681
- const errJSON = safeJSON(errText);
757
+ const errJSON = safeJSON(errText) as any;
682
758
  const errMessage = errJSON ? undefined : errText;
683
759
 
684
760
  loggerFor(this).debug(
@@ -715,9 +791,14 @@ export class PrivyAPI {
715
791
  getAPIList<Item, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(
716
792
  path: string,
717
793
  Page: new (...args: any[]) => PageClass,
718
- opts?: RequestOptions,
794
+ opts?: PromiseOrValue<RequestOptions>,
719
795
  ): Pagination.PagePromise<PageClass, Item> {
720
- return this.requestAPIList(Page, { method: 'get', path, ...opts });
796
+ return this.requestAPIList(
797
+ Page,
798
+ opts && 'then' in opts ?
799
+ opts.then((opts) => ({ method: 'get', path, ...opts }))
800
+ : { method: 'get', path, ...opts },
801
+ );
721
802
  }
722
803
 
723
804
  requestAPIList<
@@ -725,7 +806,7 @@ export class PrivyAPI {
725
806
  PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>,
726
807
  >(
727
808
  Page: new (...args: ConstructorParameters<typeof Pagination.AbstractPage>) => PageClass,
728
- options: FinalRequestOptions,
809
+ options: PromiseOrValue<FinalRequestOptions>,
729
810
  ): Pagination.PagePromise<PageClass, Item> {
730
811
  const request = this.makeRequest(options, null, undefined);
731
812
  return new Pagination.PagePromise<PageClass, Item>(this as any as PrivyAPI, request, Page);
@@ -738,9 +819,10 @@ export class PrivyAPI {
738
819
  controller: AbortController,
739
820
  ): Promise<Response> {
740
821
  const { signal, method, ...options } = init || {};
741
- if (signal) signal.addEventListener('abort', () => controller.abort());
822
+ const abort = this._makeAbort(controller);
823
+ if (signal) signal.addEventListener('abort', abort, { once: true });
742
824
 
743
- const timeout = setTimeout(() => controller.abort(), ms);
825
+ const timeout = setTimeout(abort, ms);
744
826
 
745
827
  const isReadableBody =
746
828
  ((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
@@ -908,6 +990,12 @@ export class PrivyAPI {
908
990
  return headers.values;
909
991
  }
910
992
 
993
+ private _makeAbort(controller: AbortController) {
994
+ // note: we can't just inline this method inside `fetchWithTimeout()` because then the closure
995
+ // would capture all request options, and cause a memory leak.
996
+ return () => controller.abort();
997
+ }
998
+
911
999
  private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
912
1000
  bodyHeaders: HeadersLike;
913
1001
  body: BodyInit | undefined;
@@ -973,6 +1061,8 @@ export class PrivyAPI {
973
1061
  analytics: API.Analytics = new API.Analytics(this);
974
1062
  apps: API.Apps = new API.Apps(this);
975
1063
  aggregations: API.Aggregations = new API.Aggregations(this);
1064
+ webhooks: API.Webhooks = new API.Webhooks(this);
1065
+ yield: API.Yield = new API.Yield(this);
976
1066
  }
977
1067
 
978
1068
  PrivyAPI.Wallets = Wallets;
@@ -984,6 +1074,8 @@ PrivyAPI.ClientAuth = ClientAuth;
984
1074
  PrivyAPI.Analytics = Analytics;
985
1075
  PrivyAPI.Apps = Apps;
986
1076
  PrivyAPI.Aggregations = Aggregations;
1077
+ PrivyAPI.Webhooks = Webhooks;
1078
+ PrivyAPI.Yield = Yield;
987
1079
 
988
1080
  export declare namespace PrivyAPI {
989
1081
  export type RequestOptions = Opts.RequestOptions;
@@ -993,11 +1085,11 @@ export declare namespace PrivyAPI {
993
1085
 
994
1086
  export {
995
1087
  Wallets as Wallets,
1088
+ type Wallet as Wallet,
996
1089
  type CurveSigningChainType as CurveSigningChainType,
1090
+ type ExtendedChainType as ExtendedChainType,
997
1091
  type FirstClassChainType as FirstClassChainType,
998
- type Wallet as Wallet,
999
1092
  type WalletChainType as WalletChainType,
1000
- type ExtendedChainType as ExtendedChainType,
1001
1093
  type WalletCustodian as WalletCustodian,
1002
1094
  type CustodialWalletProvider as CustodialWalletProvider,
1003
1095
  type CustodialWalletChainType as CustodialWalletChainType,
@@ -1005,6 +1097,10 @@ export declare namespace PrivyAPI {
1005
1097
  type CustodialWallet as CustodialWallet,
1006
1098
  type HpkeImportConfig as HpkeImportConfig,
1007
1099
  type SuiCommandName as SuiCommandName,
1100
+ type WalletBatchItemInput as WalletBatchItemInput,
1101
+ type WalletBatchCreateInput as WalletBatchCreateInput,
1102
+ type WalletBatchCreateResult as WalletBatchCreateResult,
1103
+ type WalletBatchCreateResponse as WalletBatchCreateResponse,
1008
1104
  type EthereumPersonalSignRpcInput as EthereumPersonalSignRpcInput,
1009
1105
  type EthereumSignTransactionRpcInput as EthereumSignTransactionRpcInput,
1010
1106
  type EthereumSendTransactionRpcInput as EthereumSendTransactionRpcInput,
@@ -1047,7 +1143,6 @@ export declare namespace PrivyAPI {
1047
1143
  export {
1048
1144
  Users as Users,
1049
1145
  type AuthenticatedUser as AuthenticatedUser,
1050
- type LinkedAccount as LinkedAccount,
1051
1146
  type User as User,
1052
1147
  type LinkedAccountEmail as LinkedAccountEmail,
1053
1148
  type LinkedAccountPhone as LinkedAccountPhone,
@@ -1084,6 +1179,7 @@ export declare namespace PrivyAPI {
1084
1179
  type CrossAppSmartWallet as CrossAppSmartWallet,
1085
1180
  type LinkedAccountCrossApp as LinkedAccountCrossApp,
1086
1181
  type LinkedAccountAuthorizationKey as LinkedAccountAuthorizationKey,
1182
+ type LinkedAccount as LinkedAccount,
1087
1183
  type LinkedAccountType as LinkedAccountType,
1088
1184
  type CustomMetadata as CustomMetadata,
1089
1185
  type LinkedAccountWalletInput as LinkedAccountWalletInput,
@@ -1103,6 +1199,7 @@ export declare namespace PrivyAPI {
1103
1199
  type LinkedAccountFarcasterInput as LinkedAccountFarcasterInput,
1104
1200
  type LinkedAccountTelegramInput as LinkedAccountTelegramInput,
1105
1201
  type LinkedAccountCustomJwtInput as LinkedAccountCustomJwtInput,
1202
+ type LinkedAccountPasskeyInput as LinkedAccountPasskeyInput,
1106
1203
  type LinkedAccountInput as LinkedAccountInput,
1107
1204
  type UserBatchCreateInput as UserBatchCreateInput,
1108
1205
  type SMSMfaMethod as SMSMfaMethod,
@@ -1171,6 +1268,28 @@ export declare namespace PrivyAPI {
1171
1268
  type PrivyOAuthProviderID as PrivyOAuthProviderID,
1172
1269
  type CustomOAuthProviderID as CustomOAuthProviderID,
1173
1270
  type OAuthProviderID as OAuthProviderID,
1271
+ type OnrampProvider as OnrampProvider,
1272
+ type GetFiatCustomerRequestInput as GetFiatCustomerRequestInput,
1273
+ type CreateOrUpdateFiatCustomerRequestInput as CreateOrUpdateFiatCustomerRequestInput,
1274
+ type BridgeFiatCustomerResponse as BridgeFiatCustomerResponse,
1275
+ type BridgeSandboxFiatCustomerResponse as BridgeSandboxFiatCustomerResponse,
1276
+ type FiatCustomerResponse as FiatCustomerResponse,
1277
+ type BridgeDestinationAsset as BridgeDestinationAsset,
1278
+ type BridgeSourceAsset as BridgeSourceAsset,
1279
+ type BridgeFiatVirtualAccountSource as BridgeFiatVirtualAccountSource,
1280
+ type BridgeFiatVirtualAccountDestination as BridgeFiatVirtualAccountDestination,
1281
+ type BridgeFiatVirtualAccountRequest as BridgeFiatVirtualAccountRequest,
1282
+ type BridgeSandboxFiatVirtualAccountRequest as BridgeSandboxFiatVirtualAccountRequest,
1283
+ type FiatVirtualAccountRequest as FiatVirtualAccountRequest,
1284
+ type BridgeUsdFiatVirtualAccountDepositInstructions as BridgeUsdFiatVirtualAccountDepositInstructions,
1285
+ type BridgeEurFiatVirtualAccountDepositInstructions as BridgeEurFiatVirtualAccountDepositInstructions,
1286
+ type BridgeMxnFiatVirtualAccountDepositInstructions as BridgeMxnFiatVirtualAccountDepositInstructions,
1287
+ type BridgeBrlFiatVirtualAccountDepositInstructions as BridgeBrlFiatVirtualAccountDepositInstructions,
1288
+ type BridgeGbpFiatVirtualAccountDepositInstructions as BridgeGbpFiatVirtualAccountDepositInstructions,
1289
+ type BridgeFiatVirtualAccountDepositInstructions as BridgeFiatVirtualAccountDepositInstructions,
1290
+ type BridgeFiatVirtualAccountResponse as BridgeFiatVirtualAccountResponse,
1291
+ type BridgeSandboxFiatVirtualAccountResponse as BridgeSandboxFiatVirtualAccountResponse,
1292
+ type FiatVirtualAccountResponse as FiatVirtualAccountResponse,
1174
1293
  };
1175
1294
 
1176
1295
  export { Analytics as Analytics, type AnalyticsEventInput as AnalyticsEventInput };
@@ -1184,5 +1303,56 @@ export declare namespace PrivyAPI {
1184
1303
  type AggregationWindow as AggregationWindow,
1185
1304
  type AggregationGroupBy as AggregationGroupBy,
1186
1305
  type Aggregation as Aggregation,
1306
+ type AggregationInput as AggregationInput,
1307
+ };
1308
+
1309
+ export {
1310
+ Webhooks as Webhooks,
1311
+ type UserCreatedWebhookPayload as UserCreatedWebhookPayload,
1312
+ type UserAuthenticatedWebhookPayload as UserAuthenticatedWebhookPayload,
1313
+ type UserLinkedAccountWebhookPayload as UserLinkedAccountWebhookPayload,
1314
+ type UserUnlinkedAccountWebhookPayload as UserUnlinkedAccountWebhookPayload,
1315
+ type UserUpdatedAccountWebhookPayload as UserUpdatedAccountWebhookPayload,
1316
+ type UserTransferredAccountWebhookPayload as UserTransferredAccountWebhookPayload,
1317
+ type UserWalletCreatedWebhookPayload as UserWalletCreatedWebhookPayload,
1318
+ type TransactionBroadcastedWebhookPayload as TransactionBroadcastedWebhookPayload,
1319
+ type TransactionConfirmedWebhookPayload as TransactionConfirmedWebhookPayload,
1320
+ type TransactionExecutionRevertedWebhookPayload as TransactionExecutionRevertedWebhookPayload,
1321
+ type TransactionStillPendingWebhookPayload as TransactionStillPendingWebhookPayload,
1322
+ type TransactionFailedWebhookPayload as TransactionFailedWebhookPayload,
1323
+ type TransactionReplacedWebhookPayload as TransactionReplacedWebhookPayload,
1324
+ type TransactionProviderErrorWebhookPayload as TransactionProviderErrorWebhookPayload,
1325
+ type FundsDepositedWebhookPayload as FundsDepositedWebhookPayload,
1326
+ type FundsWithdrawnWebhookPayload as FundsWithdrawnWebhookPayload,
1327
+ type PrivateKeyExportWebhookPayload as PrivateKeyExportWebhookPayload,
1328
+ type WalletRecoverySetupWebhookPayload as WalletRecoverySetupWebhookPayload,
1329
+ type WalletRecoveredWebhookPayload as WalletRecoveredWebhookPayload,
1330
+ type MfaEnabledWebhookPayload as MfaEnabledWebhookPayload,
1331
+ type MfaDisabledWebhookPayload as MfaDisabledWebhookPayload,
1332
+ type KrakenEmbedVerificationCompletedWebhookPayload as KrakenEmbedVerificationCompletedWebhookPayload,
1333
+ type KrakenEmbedVerificationFailedWebhookPayload as KrakenEmbedVerificationFailedWebhookPayload,
1334
+ type KrakenEmbedQuoteExecutedWebhookPayload as KrakenEmbedQuoteExecutedWebhookPayload,
1335
+ type KrakenEmbedQuoteExecutionFailedWebhookPayload as KrakenEmbedQuoteExecutionFailedWebhookPayload,
1336
+ type KrakenEmbedQuoteCancelledWebhookPayload as KrakenEmbedQuoteCancelledWebhookPayload,
1337
+ type KrakenEmbedUserVerifiedWebhookPayload as KrakenEmbedUserVerifiedWebhookPayload,
1338
+ type KrakenEmbedUserDisabledWebhookPayload as KrakenEmbedUserDisabledWebhookPayload,
1339
+ type KrakenEmbedUserClosedWebhookPayload as KrakenEmbedUserClosedWebhookPayload,
1340
+ };
1341
+
1342
+ export {
1343
+ Yield as Yield,
1344
+ type EthereumYieldProvider as EthereumYieldProvider,
1345
+ type EthereumYieldSweepType as EthereumYieldSweepType,
1346
+ type EthereumYieldSweepStatus as EthereumYieldSweepStatus,
1347
+ type EthereumYieldDepositInput as EthereumYieldDepositInput,
1348
+ type EthereumYieldWithdrawInput as EthereumYieldWithdrawInput,
1349
+ type EthereumYieldSweepResponse as EthereumYieldSweepResponse,
1350
+ type EthereumVaultDetailsInput as EthereumVaultDetailsInput,
1351
+ type EthereumYieldSweepIDInput as EthereumYieldSweepIDInput,
1352
+ type EthereumVaultResponse as EthereumVaultResponse,
1353
+ type EthereumVaultDetailsResponse as EthereumVaultDetailsResponse,
1354
+ type EthereumYieldPositionsInput as EthereumYieldPositionsInput,
1355
+ type EthereumVaultPosition as EthereumVaultPosition,
1356
+ type EthereumYieldPositionResponse as EthereumYieldPositionResponse,
1187
1357
  };
1188
1358
  }
@@ -29,6 +29,12 @@ export async function defaultParseResponse<T>(client: PrivyAPI, props: APIRespon
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
  }