@privy-io/api-types 0.4.0 → 0.6.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 (142) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/client.d.mts +25 -12
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +25 -12
  5. package/client.d.ts.map +1 -1
  6. package/client.js +32 -5
  7. package/client.js.map +1 -1
  8. package/client.mjs +32 -5
  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/internal/tslib.js +17 -17
  17. package/internal/utils/query.d.mts +2 -0
  18. package/internal/utils/query.d.mts.map +1 -0
  19. package/internal/utils/query.d.ts +2 -0
  20. package/internal/utils/query.d.ts.map +1 -0
  21. package/internal/utils/query.js +10 -0
  22. package/internal/utils/query.js.map +1 -0
  23. package/internal/utils/query.mjs +6 -0
  24. package/internal/utils/query.mjs.map +1 -0
  25. package/internal/utils.d.mts +1 -0
  26. package/internal/utils.d.ts +1 -0
  27. package/internal/utils.js +1 -0
  28. package/internal/utils.js.map +1 -1
  29. package/internal/utils.mjs +1 -0
  30. package/package.json +1 -1
  31. package/resources/accounts.d.mts +85 -0
  32. package/resources/accounts.d.mts.map +1 -0
  33. package/resources/accounts.d.ts +85 -0
  34. package/resources/accounts.d.ts.map +1 -0
  35. package/resources/accounts.js +9 -0
  36. package/resources/accounts.js.map +1 -0
  37. package/resources/accounts.mjs +5 -0
  38. package/resources/accounts.mjs.map +1 -0
  39. package/resources/aggregations.d.mts +213 -2
  40. package/resources/aggregations.d.mts.map +1 -1
  41. package/resources/aggregations.d.ts +213 -2
  42. package/resources/aggregations.d.ts.map +1 -1
  43. package/resources/client-auth.d.mts +181 -1
  44. package/resources/client-auth.d.mts.map +1 -1
  45. package/resources/client-auth.d.ts +181 -1
  46. package/resources/client-auth.d.ts.map +1 -1
  47. package/resources/funding.d.mts +4 -4
  48. package/resources/funding.d.mts.map +1 -1
  49. package/resources/funding.d.ts +4 -4
  50. package/resources/funding.d.ts.map +1 -1
  51. package/resources/index.d.mts +9 -5
  52. package/resources/index.d.mts.map +1 -1
  53. package/resources/index.d.ts +9 -5
  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 +4 -0
  58. package/resources/index.mjs.map +1 -1
  59. package/resources/intents.d.mts +104 -0
  60. package/resources/intents.d.mts.map +1 -0
  61. package/resources/intents.d.ts +104 -0
  62. package/resources/intents.d.ts.map +1 -0
  63. package/resources/intents.js +9 -0
  64. package/resources/intents.js.map +1 -0
  65. package/resources/intents.mjs +5 -0
  66. package/resources/intents.mjs.map +1 -0
  67. package/resources/key-quorums.d.mts +14 -0
  68. package/resources/key-quorums.d.mts.map +1 -1
  69. package/resources/key-quorums.d.ts +14 -0
  70. package/resources/key-quorums.d.ts.map +1 -1
  71. package/resources/policies.d.mts +66 -68
  72. package/resources/policies.d.mts.map +1 -1
  73. package/resources/policies.d.ts +66 -68
  74. package/resources/policies.d.ts.map +1 -1
  75. package/resources/users.d.mts +72 -62
  76. package/resources/users.d.mts.map +1 -1
  77. package/resources/users.d.ts +72 -62
  78. package/resources/users.d.ts.map +1 -1
  79. package/resources/wallets/balance.d.mts +10 -5
  80. package/resources/wallets/balance.d.mts.map +1 -1
  81. package/resources/wallets/balance.d.ts +10 -5
  82. package/resources/wallets/balance.d.ts.map +1 -1
  83. package/resources/wallets/balance.js +1 -2
  84. package/resources/wallets/balance.js.map +1 -1
  85. package/resources/wallets/balance.mjs +1 -2
  86. package/resources/wallets/balance.mjs.map +1 -1
  87. package/resources/wallets/index.d.mts +1 -1
  88. package/resources/wallets/index.d.mts.map +1 -1
  89. package/resources/wallets/index.d.ts +1 -1
  90. package/resources/wallets/index.d.ts.map +1 -1
  91. package/resources/wallets/index.js.map +1 -1
  92. package/resources/wallets/index.mjs.map +1 -1
  93. package/resources/wallets/transactions.d.mts +2 -2
  94. package/resources/wallets/transactions.d.mts.map +1 -1
  95. package/resources/wallets/transactions.d.ts +2 -2
  96. package/resources/wallets/transactions.d.ts.map +1 -1
  97. package/resources/wallets/wallets.d.mts +203 -76
  98. package/resources/wallets/wallets.d.mts.map +1 -1
  99. package/resources/wallets/wallets.d.ts +203 -76
  100. package/resources/wallets/wallets.d.ts.map +1 -1
  101. package/resources/wallets/wallets.js.map +1 -1
  102. package/resources/wallets/wallets.mjs.map +1 -1
  103. package/resources/webhooks.d.mts +977 -0
  104. package/resources/webhooks.d.mts.map +1 -0
  105. package/resources/webhooks.d.ts +977 -0
  106. package/resources/webhooks.d.ts.map +1 -0
  107. package/resources/webhooks.js +9 -0
  108. package/resources/webhooks.js.map +1 -0
  109. package/resources/webhooks.mjs +5 -0
  110. package/resources/webhooks.mjs.map +1 -0
  111. package/resources/yield.d.mts +311 -0
  112. package/resources/yield.d.mts.map +1 -0
  113. package/resources/yield.d.ts +311 -0
  114. package/resources/yield.d.ts.map +1 -0
  115. package/resources/yield.js +9 -0
  116. package/resources/yield.js.map +1 -0
  117. package/resources/yield.mjs +5 -0
  118. package/resources/yield.mjs.map +1 -0
  119. package/src/client.ts +240 -18
  120. package/src/internal/parse.ts +6 -0
  121. package/src/internal/utils/query.ts +7 -0
  122. package/src/internal/utils.ts +1 -0
  123. package/src/resources/accounts.ts +106 -0
  124. package/src/resources/aggregations.ts +361 -5
  125. package/src/resources/client-auth.ts +309 -0
  126. package/src/resources/funding.ts +4 -1
  127. package/src/resources/index.ts +101 -8
  128. package/src/resources/intents.ts +138 -0
  129. package/src/resources/key-quorums.ts +17 -0
  130. package/src/resources/policies.ts +86 -88
  131. package/src/resources/users.ts +128 -111
  132. package/src/resources/wallets/balance.ts +15 -5
  133. package/src/resources/wallets/index.ts +7 -3
  134. package/src/resources/wallets/transactions.ts +2 -2
  135. package/src/resources/wallets/wallets.ts +250 -96
  136. package/src/resources/webhooks.ts +1347 -0
  137. package/src/resources/yield.ts +389 -0
  138. package/src/version.ts +1 -1
  139. package/version.d.mts +1 -1
  140. package/version.d.ts +1 -1
  141. package/version.js +1 -1
  142. package/version.mjs +1 -1
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Yield = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ class Yield extends resource_1.APIResource {
7
+ }
8
+ exports.Yield = Yield;
9
+ //# sourceMappingURL=yield.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yield.js","sourceRoot":"","sources":["../src/resources/yield.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,MAAa,KAAM,SAAQ,sBAAW;CAAG;AAAzC,sBAAyC"}
@@ -0,0 +1,5 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ export class Yield extends APIResource {
4
+ }
5
+ //# sourceMappingURL=yield.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"yield.mjs","sourceRoot":"","sources":["../src/resources/yield.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAEtB,MAAM,OAAO,KAAM,SAAQ,WAAW;CAAG"}
package/src/client.ts CHANGED
@@ -11,7 +11,7 @@ import type { APIResponseProps } from './internal/parse';
11
11
  import { getPlatformHeaders } from './internal/detect-platform';
12
12
  import * as Shims from './internal/shims';
13
13
  import * as Opts from './internal/request-options';
14
- import * as qs from './internal/qs';
14
+ import { stringifyQuery } from './internal/utils/query';
15
15
  import { VERSION } from './version';
16
16
  import * as Errors from './core/error';
17
17
  import * as Pagination from './core/pagination';
@@ -19,9 +19,18 @@ 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
+ AccountResponse,
24
+ AccountWallet,
25
+ AccountWalletConfigurationItem,
26
+ Accounts,
27
+ AccountsListResponse,
28
+ CreateAccountInput,
29
+ } from './resources/accounts';
22
30
  import {
23
31
  Aggregation,
24
32
  AggregationGroupBy,
33
+ AggregationInput,
25
34
  AggregationMethod,
26
35
  AggregationMetric,
27
36
  AggregationWindow,
@@ -30,7 +39,26 @@ import {
30
39
  import { Analytics, AnalyticsEventInput } from './resources/analytics';
31
40
  import { AppResponse, Apps } from './resources/apps';
32
41
  import {
42
+ BridgeBrlFiatVirtualAccountDepositInstructions,
43
+ BridgeDestinationAsset,
44
+ BridgeEurFiatVirtualAccountDepositInstructions,
45
+ BridgeFiatCustomerResponse,
46
+ BridgeFiatRejectionReason,
47
+ BridgeFiatVirtualAccountDepositInstructions,
48
+ BridgeFiatVirtualAccountDestination,
49
+ BridgeFiatVirtualAccountRequest,
50
+ BridgeFiatVirtualAccountResponse,
51
+ BridgeFiatVirtualAccountSource,
52
+ BridgeGbpFiatVirtualAccountDepositInstructions,
53
+ BridgeMxnFiatVirtualAccountDepositInstructions,
54
+ BridgeOnrampProvider,
55
+ BridgeSandboxFiatCustomerResponse,
56
+ BridgeSandboxFiatVirtualAccountRequest,
57
+ BridgeSandboxFiatVirtualAccountResponse,
58
+ BridgeSourceAsset,
59
+ BridgeUsdFiatVirtualAccountDepositInstructions,
33
60
  ClientAuth,
61
+ CreateOrUpdateFiatCustomerRequestInput,
34
62
  CustomJwtAuthenticateRequestBody,
35
63
  CustomJwtLinkRequestBody,
36
64
  CustomOAuthProviderID,
@@ -48,6 +76,10 @@ import {
48
76
  FarcasterV2AuthenticateRequestBody,
49
77
  FarcasterV2InitRequestBody,
50
78
  FarcasterV2InitResponseBody,
79
+ FiatCustomerResponse,
80
+ FiatVirtualAccountRequest,
81
+ FiatVirtualAccountResponse,
82
+ GetFiatCustomerRequestInput,
51
83
  GuestAuthenticateRequestBody,
52
84
  MfaPasskeyEnrollmentRequestBody,
53
85
  MfaPasskeyInitRequestBody,
@@ -69,6 +101,7 @@ import {
69
101
  OAuthUnlinkRequestBody,
70
102
  OAuthVerifyRequestBody,
71
103
  OAuthVerifyResponseBody,
104
+ OnrampProvider,
72
105
  OptionalRefreshTokenInput,
73
106
  PasskeyAuthenticateRequestBody,
74
107
  PasskeyInitAuthenticateResponseBody,
@@ -126,6 +159,7 @@ import {
126
159
  MoonpayOnRampSignInput,
127
160
  MoonpayOnRampSignResponse,
128
161
  } from './resources/funding';
162
+ import { IntentAuthorizationKeyQuorumMember, IntentAuthorizationMember, Intents } from './resources/intents';
129
163
  import {
130
164
  KeyQuorum,
131
165
  KeyQuorumCreateParams,
@@ -201,6 +235,7 @@ import {
201
235
  LinkedAccountLinkedInInput,
202
236
  LinkedAccountLinkedInOAuth,
203
237
  LinkedAccountPasskey,
238
+ LinkedAccountPasskeyInput,
204
239
  LinkedAccountPhone,
205
240
  LinkedAccountPhoneInput,
206
241
  LinkedAccountSmartWallet,
@@ -248,6 +283,60 @@ import {
248
283
  Users,
249
284
  UsersCursor,
250
285
  } from './resources/users';
286
+ import {
287
+ FundsDepositedWebhookPayload,
288
+ FundsWithdrawnWebhookPayload,
289
+ KrakenEmbedQuoteCancelledWebhookPayload,
290
+ KrakenEmbedQuoteExecutedWebhookPayload,
291
+ KrakenEmbedQuoteExecutionFailedWebhookPayload,
292
+ KrakenEmbedUserClosedWebhookPayload,
293
+ KrakenEmbedUserDisabledWebhookPayload,
294
+ KrakenEmbedUserVerifiedWebhookPayload,
295
+ KrakenEmbedVerificationCompletedWebhookPayload,
296
+ KrakenEmbedVerificationFailedWebhookPayload,
297
+ MfaDisabledWebhookPayload,
298
+ MfaEnabledWebhookPayload,
299
+ PrivateKeyExportWebhookPayload,
300
+ TransactionBroadcastedWebhookPayload,
301
+ TransactionConfirmedWebhookPayload,
302
+ TransactionExecutionRevertedWebhookPayload,
303
+ TransactionFailedWebhookPayload,
304
+ TransactionProviderErrorWebhookPayload,
305
+ TransactionReplacedWebhookPayload,
306
+ TransactionStillPendingWebhookPayload,
307
+ UserAuthenticatedWebhookPayload,
308
+ UserCreatedWebhookPayload,
309
+ UserLinkedAccountWebhookPayload,
310
+ UserTransferredAccountWebhookPayload,
311
+ UserUnlinkedAccountWebhookPayload,
312
+ UserUpdatedAccountWebhookPayload,
313
+ UserWalletCreatedWebhookPayload,
314
+ WalletRecoveredWebhookPayload,
315
+ WalletRecoverySetupWebhookPayload,
316
+ Webhooks,
317
+ YieldDepositConfirmedWebhookPayload,
318
+ YieldWithdrawConfirmedWebhookPayload,
319
+ } from './resources/webhooks';
320
+ import {
321
+ EthereumVaultDetailsInput,
322
+ EthereumVaultDetailsResponse,
323
+ EthereumVaultPosition,
324
+ EthereumVaultResponse,
325
+ EthereumYieldClaimInput,
326
+ EthereumYieldClaimResponse,
327
+ EthereumYieldClaimReward,
328
+ EthereumYieldDepositInput,
329
+ EthereumYieldPositionResponse,
330
+ EthereumYieldPositionsInput,
331
+ EthereumYieldProvider,
332
+ EthereumYieldSweepIDInput,
333
+ EthereumYieldSweepResponse,
334
+ EthereumYieldSweepStatus,
335
+ EthereumYieldSweepType,
336
+ EthereumYieldWithdrawInput,
337
+ EvmCaip2ChainID,
338
+ Yield,
339
+ } from './resources/yield';
251
340
  import {
252
341
  CurveSigningChainType,
253
342
  CustodialWallet,
@@ -281,6 +370,10 @@ import {
281
370
  Wallet,
282
371
  WalletAuthenticateWithJwtParams,
283
372
  WalletAuthenticateWithJwtResponse,
373
+ WalletBatchCreateInput,
374
+ WalletBatchCreateResponse,
375
+ WalletBatchCreateResult,
376
+ WalletBatchItemInput,
284
377
  WalletChainType,
285
378
  WalletCreateParams,
286
379
  WalletCreateWalletsWithRecoveryParams,
@@ -552,8 +645,8 @@ export class Privy {
552
645
  return buildHeaders([{ Authorization }]);
553
646
  }
554
647
 
555
- protected stringifyQuery(query: Record<string, unknown>): string {
556
- return qs.stringify(query, { arrayFormat: 'comma' });
648
+ protected stringifyQuery(query: object | Record<string, unknown>): string {
649
+ return stringifyQuery(query);
557
650
  }
558
651
 
559
652
  private getUserAgent(): string {
@@ -590,7 +683,7 @@ export class Privy {
590
683
  }
591
684
 
592
685
  if (typeof query === 'object' && query && !Array.isArray(query)) {
593
- url.search = this.stringifyQuery(query as Record<string, unknown>);
686
+ url.search = this.stringifyQuery(query);
594
687
  }
595
688
 
596
689
  return url.toString();
@@ -774,7 +867,7 @@ export class Privy {
774
867
  loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
775
868
 
776
869
  const errText = await response.text().catch((err: any) => castToError(err).message);
777
- const errJSON = safeJSON(errText);
870
+ const errJSON = safeJSON(errText) as any;
778
871
  const errMessage = errJSON ? undefined : errText;
779
872
 
780
873
  loggerFor(this).debug(
@@ -811,9 +904,14 @@ export class Privy {
811
904
  getAPIList<Item, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(
812
905
  path: string,
813
906
  Page: new (...args: any[]) => PageClass,
814
- opts?: RequestOptions,
907
+ opts?: PromiseOrValue<RequestOptions>,
815
908
  ): Pagination.PagePromise<PageClass, Item> {
816
- return this.requestAPIList(Page, { method: 'get', path, ...opts });
909
+ return this.requestAPIList(
910
+ Page,
911
+ opts && 'then' in opts ?
912
+ opts.then((opts) => ({ method: 'get', path, ...opts }))
913
+ : { method: 'get', path, ...opts },
914
+ );
817
915
  }
818
916
 
819
917
  requestAPIList<
@@ -821,7 +919,7 @@ export class Privy {
821
919
  PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>,
822
920
  >(
823
921
  Page: new (...args: ConstructorParameters<typeof Pagination.AbstractPage>) => PageClass,
824
- options: FinalRequestOptions,
922
+ options: PromiseOrValue<FinalRequestOptions>,
825
923
  ): Pagination.PagePromise<PageClass, Item> {
826
924
  const request = this.makeRequest(options, null, undefined);
827
925
  return new Pagination.PagePromise<PageClass, Item>(this as any as Privy, request, Page);
@@ -834,9 +932,10 @@ export class Privy {
834
932
  controller: AbortController,
835
933
  ): Promise<Response> {
836
934
  const { signal, method, ...options } = init || {};
837
- if (signal) signal.addEventListener('abort', () => controller.abort());
935
+ const abort = this._makeAbort(controller);
936
+ if (signal) signal.addEventListener('abort', abort, { once: true });
838
937
 
839
- const timeout = setTimeout(() => controller.abort(), ms);
938
+ const timeout = setTimeout(abort, ms);
840
939
 
841
940
  const isReadableBody =
842
941
  ((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
@@ -1004,6 +1103,12 @@ export class Privy {
1004
1103
  return headers.values;
1005
1104
  }
1006
1105
 
1106
+ private _makeAbort(controller: AbortController) {
1107
+ // note: we can't just inline this method inside `fetchWithTimeout()` because then the closure
1108
+ // would capture all request options, and cause a memory leak.
1109
+ return () => controller.abort();
1110
+ }
1111
+
1007
1112
  private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
1008
1113
  bodyHeaders: HeadersLike;
1009
1114
  body: BodyInit | undefined;
@@ -1036,6 +1141,14 @@ export class Privy {
1036
1141
  (Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
1037
1142
  ) {
1038
1143
  return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
1144
+ } else if (
1145
+ typeof body === 'object' &&
1146
+ headers.values.get('content-type') === 'application/x-www-form-urlencoded'
1147
+ ) {
1148
+ return {
1149
+ bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
1150
+ body: this.stringifyQuery(body),
1151
+ };
1039
1152
  } else {
1040
1153
  return this.#encoder({ body, headers });
1041
1154
  }
@@ -1072,6 +1185,10 @@ export class Privy {
1072
1185
  transactions: API.Transactions = new API.Transactions(this);
1073
1186
  keyQuorums: API.KeyQuorums = new API.KeyQuorums(this);
1074
1187
  aggregations: API.Aggregations = new API.Aggregations(this);
1188
+ webhooks: API.Webhooks = new API.Webhooks(this);
1189
+ accounts: API.Accounts = new API.Accounts(this);
1190
+ yield: API.Yield = new API.Yield(this);
1191
+ intents: API.Intents = new API.Intents(this);
1075
1192
  }
1076
1193
 
1077
1194
  Privy.Wallets = Wallets;
@@ -1086,6 +1203,10 @@ Privy.Policies = Policies;
1086
1203
  Privy.Transactions = Transactions;
1087
1204
  Privy.KeyQuorums = KeyQuorums;
1088
1205
  Privy.Aggregations = Aggregations;
1206
+ Privy.Webhooks = Webhooks;
1207
+ Privy.Accounts = Accounts;
1208
+ Privy.Yield = Yield;
1209
+ Privy.Intents = Intents;
1089
1210
 
1090
1211
  export declare namespace Privy {
1091
1212
  export type RequestOptions = Opts.RequestOptions;
@@ -1095,12 +1216,11 @@ export declare namespace Privy {
1095
1216
 
1096
1217
  export {
1097
1218
  Wallets as Wallets,
1219
+ type WalletRevokeResponse as WalletRevokeResponse,
1098
1220
  type CurveSigningChainType as CurveSigningChainType,
1221
+ type ExtendedChainType as ExtendedChainType,
1099
1222
  type FirstClassChainType as FirstClassChainType,
1100
- type Wallet as Wallet,
1101
1223
  type WalletChainType as WalletChainType,
1102
- type WalletRevokeResponse as WalletRevokeResponse,
1103
- type ExtendedChainType as ExtendedChainType,
1104
1224
  type WalletCustodian as WalletCustodian,
1105
1225
  type CustodialWalletProvider as CustodialWalletProvider,
1106
1226
  type CustodialWalletChainType as CustodialWalletChainType,
@@ -1108,6 +1228,11 @@ export declare namespace Privy {
1108
1228
  type CustodialWallet as CustodialWallet,
1109
1229
  type HpkeImportConfig as HpkeImportConfig,
1110
1230
  type SuiCommandName as SuiCommandName,
1231
+ type Wallet as Wallet,
1232
+ type WalletBatchItemInput as WalletBatchItemInput,
1233
+ type WalletBatchCreateInput as WalletBatchCreateInput,
1234
+ type WalletBatchCreateResult as WalletBatchCreateResult,
1235
+ type WalletBatchCreateResponse as WalletBatchCreateResponse,
1111
1236
  type EthereumPersonalSignRpcInput as EthereumPersonalSignRpcInput,
1112
1237
  type EthereumSignTransactionRpcInput as EthereumSignTransactionRpcInput,
1113
1238
  type EthereumSendTransactionRpcInput as EthereumSendTransactionRpcInput,
@@ -1237,6 +1362,30 @@ export declare namespace Privy {
1237
1362
  type PrivyOAuthProviderID as PrivyOAuthProviderID,
1238
1363
  type CustomOAuthProviderID as CustomOAuthProviderID,
1239
1364
  type OAuthProviderID as OAuthProviderID,
1365
+ type BridgeOnrampProvider as BridgeOnrampProvider,
1366
+ type OnrampProvider as OnrampProvider,
1367
+ type GetFiatCustomerRequestInput as GetFiatCustomerRequestInput,
1368
+ type CreateOrUpdateFiatCustomerRequestInput as CreateOrUpdateFiatCustomerRequestInput,
1369
+ type BridgeFiatRejectionReason as BridgeFiatRejectionReason,
1370
+ type BridgeFiatCustomerResponse as BridgeFiatCustomerResponse,
1371
+ type BridgeSandboxFiatCustomerResponse as BridgeSandboxFiatCustomerResponse,
1372
+ type FiatCustomerResponse as FiatCustomerResponse,
1373
+ type BridgeDestinationAsset as BridgeDestinationAsset,
1374
+ type BridgeSourceAsset as BridgeSourceAsset,
1375
+ type BridgeFiatVirtualAccountSource as BridgeFiatVirtualAccountSource,
1376
+ type BridgeFiatVirtualAccountDestination as BridgeFiatVirtualAccountDestination,
1377
+ type BridgeFiatVirtualAccountRequest as BridgeFiatVirtualAccountRequest,
1378
+ type BridgeSandboxFiatVirtualAccountRequest as BridgeSandboxFiatVirtualAccountRequest,
1379
+ type FiatVirtualAccountRequest as FiatVirtualAccountRequest,
1380
+ type BridgeUsdFiatVirtualAccountDepositInstructions as BridgeUsdFiatVirtualAccountDepositInstructions,
1381
+ type BridgeEurFiatVirtualAccountDepositInstructions as BridgeEurFiatVirtualAccountDepositInstructions,
1382
+ type BridgeMxnFiatVirtualAccountDepositInstructions as BridgeMxnFiatVirtualAccountDepositInstructions,
1383
+ type BridgeBrlFiatVirtualAccountDepositInstructions as BridgeBrlFiatVirtualAccountDepositInstructions,
1384
+ type BridgeGbpFiatVirtualAccountDepositInstructions as BridgeGbpFiatVirtualAccountDepositInstructions,
1385
+ type BridgeFiatVirtualAccountDepositInstructions as BridgeFiatVirtualAccountDepositInstructions,
1386
+ type BridgeFiatVirtualAccountResponse as BridgeFiatVirtualAccountResponse,
1387
+ type BridgeSandboxFiatVirtualAccountResponse as BridgeSandboxFiatVirtualAccountResponse,
1388
+ type FiatVirtualAccountResponse as FiatVirtualAccountResponse,
1240
1389
  };
1241
1390
 
1242
1391
  export { CrossApp as CrossApp, type CrossAppConnectionsResponse as CrossAppConnectionsResponse };
@@ -1252,10 +1401,6 @@ export declare namespace Privy {
1252
1401
 
1253
1402
  export {
1254
1403
  Users as Users,
1255
- type AuthenticatedUser as AuthenticatedUser,
1256
- type LinkedAccount as LinkedAccount,
1257
- type User as User,
1258
- type UserWithIdentityToken as UserWithIdentityToken,
1259
1404
  type LinkedAccountEmail as LinkedAccountEmail,
1260
1405
  type LinkedAccountPhone as LinkedAccountPhone,
1261
1406
  type LinkedAccountBaseWallet as LinkedAccountBaseWallet,
@@ -1291,6 +1436,7 @@ export declare namespace Privy {
1291
1436
  type CrossAppSmartWallet as CrossAppSmartWallet,
1292
1437
  type LinkedAccountCrossApp as LinkedAccountCrossApp,
1293
1438
  type LinkedAccountAuthorizationKey as LinkedAccountAuthorizationKey,
1439
+ type LinkedAccount as LinkedAccount,
1294
1440
  type LinkedAccountType as LinkedAccountType,
1295
1441
  type CustomMetadata as CustomMetadata,
1296
1442
  type LinkedAccountWalletInput as LinkedAccountWalletInput,
@@ -1310,13 +1456,17 @@ export declare namespace Privy {
1310
1456
  type LinkedAccountFarcasterInput as LinkedAccountFarcasterInput,
1311
1457
  type LinkedAccountTelegramInput as LinkedAccountTelegramInput,
1312
1458
  type LinkedAccountCustomJwtInput as LinkedAccountCustomJwtInput,
1459
+ type LinkedAccountPasskeyInput as LinkedAccountPasskeyInput,
1313
1460
  type LinkedAccountInput as LinkedAccountInput,
1314
1461
  type UserBatchCreateInput as UserBatchCreateInput,
1315
1462
  type SMSMfaMethod as SMSMfaMethod,
1316
1463
  type TotpMfaMethod as TotpMfaMethod,
1317
1464
  type PasskeyMfaMethod as PasskeyMfaMethod,
1318
1465
  type LinkedMfaMethod as LinkedMfaMethod,
1466
+ type User as User,
1319
1467
  type OAuthTokens as OAuthTokens,
1468
+ type UserWithIdentityToken as UserWithIdentityToken,
1469
+ type AuthenticatedUser as AuthenticatedUser,
1320
1470
  type UsersCursor as UsersCursor,
1321
1471
  type UserCreateParams as UserCreateParams,
1322
1472
  type UserListParams as UserListParams,
@@ -1342,12 +1492,12 @@ export declare namespace Privy {
1342
1492
 
1343
1493
  export {
1344
1494
  Policies as Policies,
1345
- type Policy as Policy,
1346
1495
  type SuiTransactionCommandOperator as SuiTransactionCommandOperator,
1347
1496
  type SuiTransferObjectsCommandField as SuiTransferObjectsCommandField,
1348
1497
  type TronTransactionCondition as TronTransactionCondition,
1349
1498
  type SuiTransactionCommandCondition as SuiTransactionCommandCondition,
1350
1499
  type SuiTransferObjectsCommandCondition as SuiTransferObjectsCommandCondition,
1500
+ type Policy as Policy,
1351
1501
  type PolicyCreateRuleResponse as PolicyCreateRuleResponse,
1352
1502
  type PolicyDeleteResponse as PolicyDeleteResponse,
1353
1503
  type PolicyDeleteRuleResponse as PolicyDeleteRuleResponse,
@@ -1385,5 +1535,77 @@ export declare namespace Privy {
1385
1535
  type AggregationWindow as AggregationWindow,
1386
1536
  type AggregationGroupBy as AggregationGroupBy,
1387
1537
  type Aggregation as Aggregation,
1538
+ type AggregationInput as AggregationInput,
1539
+ };
1540
+
1541
+ export {
1542
+ Webhooks as Webhooks,
1543
+ type UserCreatedWebhookPayload as UserCreatedWebhookPayload,
1544
+ type UserAuthenticatedWebhookPayload as UserAuthenticatedWebhookPayload,
1545
+ type UserLinkedAccountWebhookPayload as UserLinkedAccountWebhookPayload,
1546
+ type UserUnlinkedAccountWebhookPayload as UserUnlinkedAccountWebhookPayload,
1547
+ type UserUpdatedAccountWebhookPayload as UserUpdatedAccountWebhookPayload,
1548
+ type UserTransferredAccountWebhookPayload as UserTransferredAccountWebhookPayload,
1549
+ type UserWalletCreatedWebhookPayload as UserWalletCreatedWebhookPayload,
1550
+ type TransactionBroadcastedWebhookPayload as TransactionBroadcastedWebhookPayload,
1551
+ type TransactionConfirmedWebhookPayload as TransactionConfirmedWebhookPayload,
1552
+ type TransactionExecutionRevertedWebhookPayload as TransactionExecutionRevertedWebhookPayload,
1553
+ type TransactionStillPendingWebhookPayload as TransactionStillPendingWebhookPayload,
1554
+ type TransactionFailedWebhookPayload as TransactionFailedWebhookPayload,
1555
+ type TransactionReplacedWebhookPayload as TransactionReplacedWebhookPayload,
1556
+ type TransactionProviderErrorWebhookPayload as TransactionProviderErrorWebhookPayload,
1557
+ type FundsDepositedWebhookPayload as FundsDepositedWebhookPayload,
1558
+ type FundsWithdrawnWebhookPayload as FundsWithdrawnWebhookPayload,
1559
+ type PrivateKeyExportWebhookPayload as PrivateKeyExportWebhookPayload,
1560
+ type WalletRecoverySetupWebhookPayload as WalletRecoverySetupWebhookPayload,
1561
+ type WalletRecoveredWebhookPayload as WalletRecoveredWebhookPayload,
1562
+ type MfaEnabledWebhookPayload as MfaEnabledWebhookPayload,
1563
+ type MfaDisabledWebhookPayload as MfaDisabledWebhookPayload,
1564
+ type KrakenEmbedVerificationCompletedWebhookPayload as KrakenEmbedVerificationCompletedWebhookPayload,
1565
+ type KrakenEmbedVerificationFailedWebhookPayload as KrakenEmbedVerificationFailedWebhookPayload,
1566
+ type KrakenEmbedQuoteExecutedWebhookPayload as KrakenEmbedQuoteExecutedWebhookPayload,
1567
+ type KrakenEmbedQuoteExecutionFailedWebhookPayload as KrakenEmbedQuoteExecutionFailedWebhookPayload,
1568
+ type KrakenEmbedQuoteCancelledWebhookPayload as KrakenEmbedQuoteCancelledWebhookPayload,
1569
+ type KrakenEmbedUserVerifiedWebhookPayload as KrakenEmbedUserVerifiedWebhookPayload,
1570
+ type KrakenEmbedUserDisabledWebhookPayload as KrakenEmbedUserDisabledWebhookPayload,
1571
+ type KrakenEmbedUserClosedWebhookPayload as KrakenEmbedUserClosedWebhookPayload,
1572
+ type YieldDepositConfirmedWebhookPayload as YieldDepositConfirmedWebhookPayload,
1573
+ type YieldWithdrawConfirmedWebhookPayload as YieldWithdrawConfirmedWebhookPayload,
1574
+ };
1575
+
1576
+ export {
1577
+ Accounts as Accounts,
1578
+ type AccountWallet as AccountWallet,
1579
+ type AccountResponse as AccountResponse,
1580
+ type AccountWalletConfigurationItem as AccountWalletConfigurationItem,
1581
+ type CreateAccountInput as CreateAccountInput,
1582
+ type AccountsListResponse as AccountsListResponse,
1583
+ };
1584
+
1585
+ export {
1586
+ Yield as Yield,
1587
+ type EvmCaip2ChainID as EvmCaip2ChainID,
1588
+ type EthereumYieldProvider as EthereumYieldProvider,
1589
+ type EthereumYieldSweepType as EthereumYieldSweepType,
1590
+ type EthereumYieldSweepStatus as EthereumYieldSweepStatus,
1591
+ type EthereumYieldDepositInput as EthereumYieldDepositInput,
1592
+ type EthereumYieldWithdrawInput as EthereumYieldWithdrawInput,
1593
+ type EthereumYieldSweepResponse as EthereumYieldSweepResponse,
1594
+ type EthereumVaultDetailsInput as EthereumVaultDetailsInput,
1595
+ type EthereumYieldSweepIDInput as EthereumYieldSweepIDInput,
1596
+ type EthereumVaultResponse as EthereumVaultResponse,
1597
+ type EthereumVaultDetailsResponse as EthereumVaultDetailsResponse,
1598
+ type EthereumYieldPositionsInput as EthereumYieldPositionsInput,
1599
+ type EthereumVaultPosition as EthereumVaultPosition,
1600
+ type EthereumYieldPositionResponse as EthereumYieldPositionResponse,
1601
+ type EthereumYieldClaimInput as EthereumYieldClaimInput,
1602
+ type EthereumYieldClaimReward as EthereumYieldClaimReward,
1603
+ type EthereumYieldClaimResponse as EthereumYieldClaimResponse,
1604
+ };
1605
+
1606
+ export {
1607
+ Intents as Intents,
1608
+ type IntentAuthorizationKeyQuorumMember as IntentAuthorizationKeyQuorumMember,
1609
+ type IntentAuthorizationMember as IntentAuthorizationMember,
1388
1610
  };
1389
1611
  }
@@ -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
  }
@@ -0,0 +1,7 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import * as qs from '../qs/stringify';
4
+
5
+ export function stringifyQuery(query: object | Record<string, unknown>) {
6
+ return qs.stringify(query, { arrayFormat: 'comma' });
7
+ }
@@ -6,3 +6,4 @@ export * from './utils/env';
6
6
  export * from './utils/log';
7
7
  export * from './utils/uuid';
8
8
  export * from './utils/sleep';
9
+ export * from './utils/query';
@@ -0,0 +1,106 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import * as WalletsAPI from './wallets/wallets';
5
+
6
+ export class Accounts extends APIResource {}
7
+
8
+ /**
9
+ * A wallet belonging to a digital asset account.
10
+ */
11
+ export interface AccountWallet {
12
+ /**
13
+ * The wallet ID.
14
+ */
15
+ id: string;
16
+
17
+ /**
18
+ * The on-chain address of the wallet.
19
+ */
20
+ address: string;
21
+
22
+ /**
23
+ * The wallet chain types that offer first class support.
24
+ */
25
+ chain_type: WalletsAPI.FirstClassChainType;
26
+
27
+ /**
28
+ * Information about the custodian managing this wallet.
29
+ */
30
+ custody?: WalletsAPI.WalletCustodian;
31
+ }
32
+
33
+ /**
34
+ * A digital asset account that groups wallets under a single entity.
35
+ */
36
+ export interface AccountResponse {
37
+ /**
38
+ * The account ID.
39
+ */
40
+ id: string;
41
+
42
+ /**
43
+ * An optional display name for the account.
44
+ */
45
+ display_name: string | null;
46
+
47
+ /**
48
+ * The wallets belonging to this account.
49
+ */
50
+ wallets: Array<AccountWallet>;
51
+ }
52
+
53
+ /**
54
+ * Configuration for a wallet to create within an account.
55
+ */
56
+ export interface AccountWalletConfigurationItem {
57
+ /**
58
+ * The wallet chain types that offer first class support.
59
+ */
60
+ chain_type: WalletsAPI.FirstClassChainType;
61
+
62
+ /**
63
+ * Information about the custodian managing this wallet.
64
+ */
65
+ custody?: WalletsAPI.WalletCustodian;
66
+ }
67
+
68
+ /**
69
+ * Input for creating a digital asset account.
70
+ */
71
+ export interface CreateAccountInput {
72
+ /**
73
+ * Configuration for wallets to create.
74
+ */
75
+ wallets_configuration: Array<AccountWalletConfigurationItem>;
76
+
77
+ /**
78
+ * An optional display name for the account.
79
+ */
80
+ display_name?: string;
81
+ }
82
+
83
+ /**
84
+ * Paginated list of digital asset accounts.
85
+ */
86
+ export interface AccountsListResponse {
87
+ /**
88
+ * The list of accounts.
89
+ */
90
+ data: Array<AccountResponse>;
91
+
92
+ /**
93
+ * Cursor for fetching the next page of results, or null if no more results.
94
+ */
95
+ next_cursor: string | null;
96
+ }
97
+
98
+ export declare namespace Accounts {
99
+ export {
100
+ type AccountWallet as AccountWallet,
101
+ type AccountResponse as AccountResponse,
102
+ type AccountWalletConfigurationItem as AccountWalletConfigurationItem,
103
+ type CreateAccountInput as CreateAccountInput,
104
+ type AccountsListResponse as AccountsListResponse,
105
+ };
106
+ }