@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.
- package/CHANGELOG.md +71 -0
- package/client.d.mts +18 -8
- package/client.d.mts.map +1 -1
- package/client.d.ts +18 -8
- package/client.d.ts.map +1 -1
- package/client.js +20 -3
- package/client.js.map +1 -1
- package/client.mjs +20 -3
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/package.json +21 -1
- package/resources/aggregations.d.mts +507 -0
- package/resources/aggregations.d.mts.map +1 -0
- package/resources/aggregations.d.ts +507 -0
- package/resources/aggregations.d.ts.map +1 -0
- package/resources/aggregations.js +9 -0
- package/resources/aggregations.js.map +1 -0
- package/resources/aggregations.mjs +5 -0
- package/resources/aggregations.mjs.map +1 -0
- package/resources/client-auth.d.mts +168 -2
- package/resources/client-auth.d.mts.map +1 -1
- package/resources/client-auth.d.ts +168 -2
- package/resources/client-auth.d.ts.map +1 -1
- package/resources/index.d.mts +6 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -1
- package/resources/key-quorums.d.mts +4 -1
- package/resources/key-quorums.d.mts.map +1 -1
- package/resources/key-quorums.d.ts +4 -1
- package/resources/key-quorums.d.ts.map +1 -1
- package/resources/policies.d.mts +21 -20
- package/resources/policies.d.mts.map +1 -1
- package/resources/policies.d.ts +21 -20
- package/resources/policies.d.ts.map +1 -1
- package/resources/users.d.mts +21 -11
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +21 -11
- package/resources/users.d.ts.map +1 -1
- package/resources/wallets/balance.d.mts +11 -6
- package/resources/wallets/balance.d.mts.map +1 -1
- package/resources/wallets/balance.d.ts +11 -6
- package/resources/wallets/balance.d.ts.map +1 -1
- package/resources/wallets/balance.js +1 -2
- package/resources/wallets/balance.js.map +1 -1
- package/resources/wallets/balance.mjs +1 -2
- package/resources/wallets/balance.mjs.map +1 -1
- package/resources/wallets/index.d.mts +1 -1
- package/resources/wallets/index.d.mts.map +1 -1
- package/resources/wallets/index.d.ts +1 -1
- package/resources/wallets/index.d.ts.map +1 -1
- package/resources/wallets/index.js.map +1 -1
- package/resources/wallets/index.mjs.map +1 -1
- package/resources/wallets/transactions.d.mts +3 -3
- package/resources/wallets/transactions.d.mts.map +1 -1
- package/resources/wallets/transactions.d.ts +3 -3
- package/resources/wallets/transactions.d.ts.map +1 -1
- package/resources/wallets/wallets.d.mts +249 -61
- package/resources/wallets/wallets.d.mts.map +1 -1
- package/resources/wallets/wallets.d.ts +249 -61
- package/resources/wallets/wallets.d.ts.map +1 -1
- package/resources/wallets/wallets.js.map +1 -1
- package/resources/wallets/wallets.mjs.map +1 -1
- package/resources/webhooks.d.mts +940 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +940 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +9 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +5 -0
- package/resources/webhooks.mjs.map +1 -0
- package/resources/yield.d.mts +264 -0
- package/resources/yield.d.mts.map +1 -0
- package/resources/yield.d.ts +264 -0
- package/resources/yield.d.ts.map +1 -0
- package/resources/yield.js +9 -0
- package/resources/yield.js.map +1 -0
- package/resources/yield.mjs +5 -0
- package/resources/yield.mjs.map +1 -0
- package/src/client.ts +198 -9
- package/src/internal/parse.ts +6 -0
- package/src/resources/aggregations.ts +853 -0
- package/src/resources/client-auth.ts +288 -1
- package/src/resources/index.ts +87 -3
- package/src/resources/key-quorums.ts +4 -1
- package/src/resources/policies.ts +21 -20
- package/src/resources/users.ts +58 -41
- package/src/resources/wallets/balance.ts +24 -6
- package/src/resources/wallets/index.ts +6 -2
- package/src/resources/wallets/transactions.ts +11 -3
- package/src/resources/wallets/wallets.ts +333 -78
- package/src/resources/webhooks.ts +1287 -0
- package/src/resources/yield.ts +330 -0
- package/src/types/x402.d.ts +18 -0
- package/src/version.ts +1 -1
- package/src/x402.ts +87 -0
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/x402.d.mts +54 -0
- package/x402.d.mts.map +1 -0
- package/x402.d.ts +54 -0
- package/x402.d.ts.map +1 -0
- package/x402.js +75 -0
- package/x402.js.map +1 -0
- package/x402.mjs +72 -0
- package/x402.mjs.map +1 -0
package/src/client.ts
CHANGED
|
@@ -19,13 +19,44 @@ 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
|
CustomOAuthProviderID,
|
|
27
53
|
ExternalOAuthProviderID,
|
|
54
|
+
FiatCustomerResponse,
|
|
55
|
+
FiatVirtualAccountRequest,
|
|
56
|
+
FiatVirtualAccountResponse,
|
|
57
|
+
GetFiatCustomerRequestInput,
|
|
28
58
|
OAuthProviderID,
|
|
59
|
+
OnrampProvider,
|
|
29
60
|
PrivyOAuthProviderID,
|
|
30
61
|
} from './resources/client-auth';
|
|
31
62
|
import {
|
|
@@ -98,6 +129,7 @@ import {
|
|
|
98
129
|
LinkedAccountLinkedInInput,
|
|
99
130
|
LinkedAccountLinkedInOAuth,
|
|
100
131
|
LinkedAccountPasskey,
|
|
132
|
+
LinkedAccountPasskeyInput,
|
|
101
133
|
LinkedAccountPhone,
|
|
102
134
|
LinkedAccountPhoneInput,
|
|
103
135
|
LinkedAccountSmartWallet,
|
|
@@ -145,6 +177,54 @@ import {
|
|
|
145
177
|
Users,
|
|
146
178
|
UsersCursor,
|
|
147
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';
|
|
148
228
|
import {
|
|
149
229
|
CurveSigningChainType,
|
|
150
230
|
CustodialWallet,
|
|
@@ -178,6 +258,10 @@ import {
|
|
|
178
258
|
Wallet,
|
|
179
259
|
WalletAuthenticateWithJwtParams,
|
|
180
260
|
WalletAuthenticateWithJwtResponse,
|
|
261
|
+
WalletBatchCreateInput,
|
|
262
|
+
WalletBatchCreateResponse,
|
|
263
|
+
WalletBatchCreateResult,
|
|
264
|
+
WalletBatchItemInput,
|
|
181
265
|
WalletChainType,
|
|
182
266
|
WalletCreateParams,
|
|
183
267
|
WalletCreateWalletsWithRecoveryParams,
|
|
@@ -670,7 +754,7 @@ export class PrivyAPI {
|
|
|
670
754
|
loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
|
|
671
755
|
|
|
672
756
|
const errText = await response.text().catch((err: any) => castToError(err).message);
|
|
673
|
-
const errJSON = safeJSON(errText);
|
|
757
|
+
const errJSON = safeJSON(errText) as any;
|
|
674
758
|
const errMessage = errJSON ? undefined : errText;
|
|
675
759
|
|
|
676
760
|
loggerFor(this).debug(
|
|
@@ -707,9 +791,14 @@ export class PrivyAPI {
|
|
|
707
791
|
getAPIList<Item, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(
|
|
708
792
|
path: string,
|
|
709
793
|
Page: new (...args: any[]) => PageClass,
|
|
710
|
-
opts?: RequestOptions
|
|
794
|
+
opts?: PromiseOrValue<RequestOptions>,
|
|
711
795
|
): Pagination.PagePromise<PageClass, Item> {
|
|
712
|
-
return this.requestAPIList(
|
|
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
|
+
);
|
|
713
802
|
}
|
|
714
803
|
|
|
715
804
|
requestAPIList<
|
|
@@ -717,7 +806,7 @@ export class PrivyAPI {
|
|
|
717
806
|
PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>,
|
|
718
807
|
>(
|
|
719
808
|
Page: new (...args: ConstructorParameters<typeof Pagination.AbstractPage>) => PageClass,
|
|
720
|
-
options: FinalRequestOptions
|
|
809
|
+
options: PromiseOrValue<FinalRequestOptions>,
|
|
721
810
|
): Pagination.PagePromise<PageClass, Item> {
|
|
722
811
|
const request = this.makeRequest(options, null, undefined);
|
|
723
812
|
return new Pagination.PagePromise<PageClass, Item>(this as any as PrivyAPI, request, Page);
|
|
@@ -730,9 +819,10 @@ export class PrivyAPI {
|
|
|
730
819
|
controller: AbortController,
|
|
731
820
|
): Promise<Response> {
|
|
732
821
|
const { signal, method, ...options } = init || {};
|
|
733
|
-
|
|
822
|
+
const abort = this._makeAbort(controller);
|
|
823
|
+
if (signal) signal.addEventListener('abort', abort, { once: true });
|
|
734
824
|
|
|
735
|
-
const timeout = setTimeout(
|
|
825
|
+
const timeout = setTimeout(abort, ms);
|
|
736
826
|
|
|
737
827
|
const isReadableBody =
|
|
738
828
|
((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
|
|
@@ -900,6 +990,12 @@ export class PrivyAPI {
|
|
|
900
990
|
return headers.values;
|
|
901
991
|
}
|
|
902
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
|
+
|
|
903
999
|
private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
|
|
904
1000
|
bodyHeaders: HeadersLike;
|
|
905
1001
|
body: BodyInit | undefined;
|
|
@@ -964,6 +1060,9 @@ export class PrivyAPI {
|
|
|
964
1060
|
clientAuth: API.ClientAuth = new API.ClientAuth(this);
|
|
965
1061
|
analytics: API.Analytics = new API.Analytics(this);
|
|
966
1062
|
apps: API.Apps = new API.Apps(this);
|
|
1063
|
+
aggregations: API.Aggregations = new API.Aggregations(this);
|
|
1064
|
+
webhooks: API.Webhooks = new API.Webhooks(this);
|
|
1065
|
+
yield: API.Yield = new API.Yield(this);
|
|
967
1066
|
}
|
|
968
1067
|
|
|
969
1068
|
PrivyAPI.Wallets = Wallets;
|
|
@@ -974,6 +1073,9 @@ PrivyAPI.KeyQuorums = KeyQuorums;
|
|
|
974
1073
|
PrivyAPI.ClientAuth = ClientAuth;
|
|
975
1074
|
PrivyAPI.Analytics = Analytics;
|
|
976
1075
|
PrivyAPI.Apps = Apps;
|
|
1076
|
+
PrivyAPI.Aggregations = Aggregations;
|
|
1077
|
+
PrivyAPI.Webhooks = Webhooks;
|
|
1078
|
+
PrivyAPI.Yield = Yield;
|
|
977
1079
|
|
|
978
1080
|
export declare namespace PrivyAPI {
|
|
979
1081
|
export type RequestOptions = Opts.RequestOptions;
|
|
@@ -983,11 +1085,11 @@ export declare namespace PrivyAPI {
|
|
|
983
1085
|
|
|
984
1086
|
export {
|
|
985
1087
|
Wallets as Wallets,
|
|
1088
|
+
type Wallet as Wallet,
|
|
986
1089
|
type CurveSigningChainType as CurveSigningChainType,
|
|
1090
|
+
type ExtendedChainType as ExtendedChainType,
|
|
987
1091
|
type FirstClassChainType as FirstClassChainType,
|
|
988
|
-
type Wallet as Wallet,
|
|
989
1092
|
type WalletChainType as WalletChainType,
|
|
990
|
-
type ExtendedChainType as ExtendedChainType,
|
|
991
1093
|
type WalletCustodian as WalletCustodian,
|
|
992
1094
|
type CustodialWalletProvider as CustodialWalletProvider,
|
|
993
1095
|
type CustodialWalletChainType as CustodialWalletChainType,
|
|
@@ -995,6 +1097,10 @@ export declare namespace PrivyAPI {
|
|
|
995
1097
|
type CustodialWallet as CustodialWallet,
|
|
996
1098
|
type HpkeImportConfig as HpkeImportConfig,
|
|
997
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,
|
|
998
1104
|
type EthereumPersonalSignRpcInput as EthereumPersonalSignRpcInput,
|
|
999
1105
|
type EthereumSignTransactionRpcInput as EthereumSignTransactionRpcInput,
|
|
1000
1106
|
type EthereumSendTransactionRpcInput as EthereumSendTransactionRpcInput,
|
|
@@ -1037,7 +1143,6 @@ export declare namespace PrivyAPI {
|
|
|
1037
1143
|
export {
|
|
1038
1144
|
Users as Users,
|
|
1039
1145
|
type AuthenticatedUser as AuthenticatedUser,
|
|
1040
|
-
type LinkedAccount as LinkedAccount,
|
|
1041
1146
|
type User as User,
|
|
1042
1147
|
type LinkedAccountEmail as LinkedAccountEmail,
|
|
1043
1148
|
type LinkedAccountPhone as LinkedAccountPhone,
|
|
@@ -1074,6 +1179,7 @@ export declare namespace PrivyAPI {
|
|
|
1074
1179
|
type CrossAppSmartWallet as CrossAppSmartWallet,
|
|
1075
1180
|
type LinkedAccountCrossApp as LinkedAccountCrossApp,
|
|
1076
1181
|
type LinkedAccountAuthorizationKey as LinkedAccountAuthorizationKey,
|
|
1182
|
+
type LinkedAccount as LinkedAccount,
|
|
1077
1183
|
type LinkedAccountType as LinkedAccountType,
|
|
1078
1184
|
type CustomMetadata as CustomMetadata,
|
|
1079
1185
|
type LinkedAccountWalletInput as LinkedAccountWalletInput,
|
|
@@ -1093,6 +1199,7 @@ export declare namespace PrivyAPI {
|
|
|
1093
1199
|
type LinkedAccountFarcasterInput as LinkedAccountFarcasterInput,
|
|
1094
1200
|
type LinkedAccountTelegramInput as LinkedAccountTelegramInput,
|
|
1095
1201
|
type LinkedAccountCustomJwtInput as LinkedAccountCustomJwtInput,
|
|
1202
|
+
type LinkedAccountPasskeyInput as LinkedAccountPasskeyInput,
|
|
1096
1203
|
type LinkedAccountInput as LinkedAccountInput,
|
|
1097
1204
|
type UserBatchCreateInput as UserBatchCreateInput,
|
|
1098
1205
|
type SMSMfaMethod as SMSMfaMethod,
|
|
@@ -1161,9 +1268,91 @@ export declare namespace PrivyAPI {
|
|
|
1161
1268
|
type PrivyOAuthProviderID as PrivyOAuthProviderID,
|
|
1162
1269
|
type CustomOAuthProviderID as CustomOAuthProviderID,
|
|
1163
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,
|
|
1164
1293
|
};
|
|
1165
1294
|
|
|
1166
1295
|
export { Analytics as Analytics, type AnalyticsEventInput as AnalyticsEventInput };
|
|
1167
1296
|
|
|
1168
1297
|
export { Apps as Apps, type AppResponse as AppResponse };
|
|
1298
|
+
|
|
1299
|
+
export {
|
|
1300
|
+
Aggregations as Aggregations,
|
|
1301
|
+
type AggregationMethod as AggregationMethod,
|
|
1302
|
+
type AggregationMetric as AggregationMetric,
|
|
1303
|
+
type AggregationWindow as AggregationWindow,
|
|
1304
|
+
type AggregationGroupBy as AggregationGroupBy,
|
|
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,
|
|
1357
|
+
};
|
|
1169
1358
|
}
|
package/src/internal/parse.ts
CHANGED
|
@@ -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
|
}
|