@privy-io/js-sdk-core 0.77.0 → 0.78.1
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/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/dts/index.d.mts +211 -7
- package/dist/dts/index.d.ts +211 -7
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +9 -7
package/dist/dts/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthenticatedUser, CoinbaseOnRampInitInput, CoinbaseOnRampInitResponse, CreateCryptoDepositAccountResponse, CryptoDepositAccountConfigResponse, CryptoDepositAddressRoute, CryptoDepositAddressStrategy, CryptoDepositAsset, CryptoDepositAssetFilter, DepositAccountCryptoQuoteResponse, GetCryptoDepositAccountNextOrderResponse, GetCryptoDepositAccountOrderResponse, LinkedAccount, LinkedAccountBitcoinSegwitEmbeddedWallet, LinkedAccountBitcoinTaprootEmbeddedWallet, LinkedAccountEmbeddedWallet, LinkedAccountEmbeddedWalletWithID, LinkedAccountEthereumEmbeddedWallet, LinkedAccountSmartWallet, LinkedAccountSolanaEmbeddedWallet, MfaPasskeyInitRequestBody, MfaSMSInitRequestBody, MoonpayOnRampSignInput, OAuthProviderID, OAuthProviderID as OAuthProviderID$1, OAuthTokens, PasskeyAuthenticatorVerifyResponse, RawSignResponse, SmartWalletConfiguration, SmartWalletType as SmartWalletType$1, TransferRequestBody, UnsignedEthereumTransaction, User, Wallet, WalletCreateParams, WalletRawSignParams, WalletRpcParams, WalletRpcResponse, WalletUpdateParams, Wallets } from "@privy-io/api-types";
|
|
1
|
+
import { AuthenticatedUser, CardIssuingCardResponse, CardIssuingCardStatus, CardIssuingCardsResponse, CardIssuingCustomerResponse, CardIssuingReplacementReason, CardIssuingTransactionsResponse, CoinbaseOnRampInitInput, CoinbaseOnRampInitResponse, CreateCryptoDepositAccountResponse, CryptoDepositAccountConfigResponse, CryptoDepositAddressRoute, CryptoDepositAddressStrategy, CryptoDepositAsset, CryptoDepositAssetFilter, DepositAccountCryptoQuoteResponse, GetCryptoDepositAccountNextOrderResponse, GetCryptoDepositAccountOrderResponse, IntegrationEnvironment, LinkedAccount, LinkedAccountBitcoinSegwitEmbeddedWallet, LinkedAccountBitcoinTaprootEmbeddedWallet, LinkedAccountEmbeddedWallet, LinkedAccountEmbeddedWalletWithID, LinkedAccountEthereumEmbeddedWallet, LinkedAccountSmartWallet, LinkedAccountSolanaEmbeddedWallet, MfaPasskeyInitRequestBody, MfaSMSInitRequestBody, MoonpayOnRampSignInput, OAuthProviderID, OAuthProviderID as OAuthProviderID$1, OAuthTokens, PasskeyAuthenticatorVerifyResponse, RawSignResponse, SmartWalletConfiguration, SmartWalletType as SmartWalletType$1, TransferRequestBody, UnsignedEthereumTransaction, User, Wallet, WalletCreateParams, WalletRawSignParams, WalletRpcParams, WalletRpcResponse, WalletUpdateParams, Wallets } from "@privy-io/api-types";
|
|
2
2
|
import { Chain, RpcConfig } from "@privy-io/chains";
|
|
3
3
|
import { Route } from "@privy-io/routes";
|
|
4
4
|
import "@metamask/eth-sig-util";
|
|
@@ -809,6 +809,13 @@ interface Storage {
|
|
|
809
809
|
}
|
|
810
810
|
//#endregion
|
|
811
811
|
//#region src/embedded/EmbeddedSolanaWalletProvider.d.ts
|
|
812
|
+
/**
|
|
813
|
+
* A web3.js transaction object, or a serialized transaction in wire format.
|
|
814
|
+
*
|
|
815
|
+
* Serialized transactions support legacy, v0, and V1 formats. V1 transactions must be passed
|
|
816
|
+
* serialized because web3.js cannot serialize them.
|
|
817
|
+
*/
|
|
818
|
+
type SolanaTransactionInput = Transaction | VersionedTransaction | Uint8Array;
|
|
812
819
|
type SignMessageRequestArguments = {
|
|
813
820
|
method: 'signMessage';
|
|
814
821
|
params: {
|
|
@@ -818,12 +825,12 @@ type SignMessageRequestArguments = {
|
|
|
818
825
|
type SignAndSendTransactionRequestArguments = {
|
|
819
826
|
method: 'signAndSendTransaction';
|
|
820
827
|
params: {
|
|
821
|
-
transaction:
|
|
828
|
+
transaction: SolanaTransactionInput;
|
|
822
829
|
connection: Connection;
|
|
823
830
|
options?: SendOptions;
|
|
824
831
|
};
|
|
825
832
|
};
|
|
826
|
-
type SignTransactionRequestArguments<T extends
|
|
833
|
+
type SignTransactionRequestArguments<T extends SolanaTransactionInput = Transaction> = {
|
|
827
834
|
method: 'signTransaction';
|
|
828
835
|
params: {
|
|
829
836
|
transaction: T;
|
|
@@ -844,6 +851,13 @@ declare class EmbeddedSolanaWalletProvider {
|
|
|
844
851
|
request<T extends Transaction | VersionedTransaction>(request: SignTransactionRequestArguments<T>): Promise<{
|
|
845
852
|
signedTransaction: T;
|
|
846
853
|
}>;
|
|
854
|
+
/**
|
|
855
|
+
* Serialized transactions are signed into a new `Uint8Array`, so the result is always a plain
|
|
856
|
+
* `Uint8Array`, even when a subtype such as `Buffer` is passed in.
|
|
857
|
+
*/
|
|
858
|
+
request(request: SignTransactionRequestArguments<Uint8Array>): Promise<{
|
|
859
|
+
signedTransaction: Uint8Array;
|
|
860
|
+
}>;
|
|
847
861
|
/**
|
|
848
862
|
* Legacy API for reading the public key for this provider.
|
|
849
863
|
*
|
|
@@ -851,7 +865,10 @@ declare class EmbeddedSolanaWalletProvider {
|
|
|
851
865
|
*/
|
|
852
866
|
get _publicKey(): string;
|
|
853
867
|
private connectAndRecover;
|
|
868
|
+
private walletRpcContext;
|
|
854
869
|
private signMessageRpc;
|
|
870
|
+
private signSerializedTransaction;
|
|
871
|
+
private signTransactionObject;
|
|
855
872
|
private handleIFrameRpc;
|
|
856
873
|
private handleSignAndSendTransaction;
|
|
857
874
|
private handleSignTransaction;
|
|
@@ -2277,6 +2294,8 @@ declare class Privy {
|
|
|
2277
2294
|
query?: Record<string, string | number>;
|
|
2278
2295
|
params?: Record<string, string | number>;
|
|
2279
2296
|
headers?: HeadersInit;
|
|
2297
|
+
/** Aborts the request. The built-in timeout still applies. */
|
|
2298
|
+
signal?: AbortSignal;
|
|
2280
2299
|
}): Promise<NonNullable<T['response']>>;
|
|
2281
2300
|
/**
|
|
2282
2301
|
* Like {@link fetchPrivyRoute}, but resolves the raw {@link Response} rather than a parsed JSON
|
|
@@ -2670,6 +2689,21 @@ declare const isSupportedChainIdForCoinbaseOnramp: (chainId: number, asset: 'nat
|
|
|
2670
2689
|
declare function toCoinbaseBlockchainFromChainId(chainId: number): SupportedBlockchains | undefined;
|
|
2671
2690
|
declare function toCoinbaseAssetId(chainId: number, asset: 'USDC' | 'native-currency'): CoinbaseAssetId;
|
|
2672
2691
|
//#endregion
|
|
2692
|
+
//#region src/funding/onramp-providers.d.ts
|
|
2693
|
+
type FiatOnrampQuoteProvider = {
|
|
2694
|
+
provider: string;
|
|
2695
|
+
sub_provider?: string | null;
|
|
2696
|
+
};
|
|
2697
|
+
/** The onramp provider without its sandbox suffix, e.g. `stripe` for `stripe-sandbox`. */
|
|
2698
|
+
declare const getFiatOnrampProviderId: (quote: FiatOnrampQuoteProvider) => string;
|
|
2699
|
+
/**
|
|
2700
|
+
* The provider brand a quote belongs to, e.g. STRIPE or a Meld route such as TRANSAK. A direct
|
|
2701
|
+
* integration and Meld's route for the same brand share one. The backend keeps one quote per
|
|
2702
|
+
* payment method per brand and the SDK's provider picker groups quotes by brand, so both must use
|
|
2703
|
+
* this definition.
|
|
2704
|
+
*/
|
|
2705
|
+
declare const getFiatOnrampProviderBrand: (quote: FiatOnrampQuoteProvider) => string;
|
|
2706
|
+
//#endregion
|
|
2673
2707
|
//#region src/crypto/types.d.ts
|
|
2674
2708
|
/**
|
|
2675
2709
|
* Optional overrides accepted at the public API boundary so callers can
|
|
@@ -2847,16 +2881,18 @@ interface LoginWithCrossAppAuthDependencies {
|
|
|
2847
2881
|
interface LoginWithCrossAppAuthInput {
|
|
2848
2882
|
providerAppId: string;
|
|
2849
2883
|
redirectUrl: string;
|
|
2884
|
+
loginOptions?: LoginOptions;
|
|
2850
2885
|
}
|
|
2851
2886
|
type LoginWithCrossAppAuthOutput = Omit<AuthenticatedUser, 'session_update_action'>;
|
|
2852
2887
|
/**
|
|
2853
2888
|
* Logs a user into your app through an account on **another Privy app**.
|
|
2854
2889
|
*
|
|
2855
|
-
* @param
|
|
2856
|
-
* @param
|
|
2890
|
+
* @param providerAppId the Privy app ID to which the external account should belong.
|
|
2891
|
+
* @param redirectUrl a URL path used to redirect back to your app after successful authentication
|
|
2892
|
+
* @param loginOptions optional login settings, including automatic embedded wallet creation
|
|
2857
2893
|
* @returns a promise that resolves with the new session
|
|
2858
2894
|
*/
|
|
2859
|
-
declare const loginWithCrossAppAuth: ({ client, openAuthSession }: LoginWithCrossAppAuthDependencies) => ({ providerAppId, redirectUrl }: LoginWithCrossAppAuthInput) => Promise<LoginWithCrossAppAuthOutput>;
|
|
2895
|
+
declare const loginWithCrossAppAuth: ({ client, openAuthSession }: LoginWithCrossAppAuthDependencies) => ({ providerAppId, redirectUrl, loginOptions }: LoginWithCrossAppAuthInput) => Promise<LoginWithCrossAppAuthOutput>;
|
|
2860
2896
|
//#endregion
|
|
2861
2897
|
//#region src/action/crossApp/linkWithCrossAppAuth.d.ts
|
|
2862
2898
|
interface LinkWithCrossAppAuthDependencies {
|
|
@@ -3502,6 +3538,174 @@ type PollResult<T> = {
|
|
|
3502
3538
|
};
|
|
3503
3539
|
declare const poll: <T>({ operation, until, delay, interval, attempts: maxAttempts, signal }: PollOptions<T>) => Promise<PollResult<T>>;
|
|
3504
3540
|
//#endregion
|
|
3541
|
+
//#region src/cards/accept-card-consents.d.ts
|
|
3542
|
+
/**
|
|
3543
|
+
* Records that the user accepted the agreements Privy tracks (the electronic disclosure and the
|
|
3544
|
+
* bank agreements), returning the customer at its advanced status. Acceptances are write-once, so
|
|
3545
|
+
* re-sending a field that is already recorded leaves the original timestamp unchanged.
|
|
3546
|
+
*
|
|
3547
|
+
* The cardholder must already exist. Accepting the bank terms before the electronic disclosure
|
|
3548
|
+
* is rejected by the backend.
|
|
3549
|
+
*/
|
|
3550
|
+
declare const acceptCardConsents: (client: Privy, { environment, acceptElectronicDisclosure, acceptBankTerms }: {
|
|
3551
|
+
environment: IntegrationEnvironment;
|
|
3552
|
+
acceptElectronicDisclosure?: boolean;
|
|
3553
|
+
acceptBankTerms?: boolean;
|
|
3554
|
+
}) => Promise<CardIssuingCustomerResponse['data']>;
|
|
3555
|
+
//#endregion
|
|
3556
|
+
//#region src/cards/cards-config.d.ts
|
|
3557
|
+
/** Browser-safe card-issuing configuration. */
|
|
3558
|
+
type CardsConfig = {
|
|
3559
|
+
publishableKey: string;
|
|
3560
|
+
/** Dedicated card-face logo. Distinct from login `appearance.logo`; null when none is set. */
|
|
3561
|
+
cardLogoUrl: string | null;
|
|
3562
|
+
/** Scope for platform keys; omitted when the key belongs to the issuing account. */
|
|
3563
|
+
stripeAccount?: string;
|
|
3564
|
+
};
|
|
3565
|
+
//#endregion
|
|
3566
|
+
//#region src/cards/create-card.d.ts
|
|
3567
|
+
/**
|
|
3568
|
+
* Creates the virtual card for a wallet, returning the new card. Only valid once the cards
|
|
3569
|
+
* customer has reached `ready`; there is one card per account.
|
|
3570
|
+
*
|
|
3571
|
+
* @param chainId CAIP-2 chain id, e.g. `'eip155:84532'`.
|
|
3572
|
+
*/
|
|
3573
|
+
declare const createCard: (client: Privy, { environment, walletId, chainId, asset }: {
|
|
3574
|
+
environment: IntegrationEnvironment;
|
|
3575
|
+
walletId: string;
|
|
3576
|
+
chainId: string;
|
|
3577
|
+
asset: string;
|
|
3578
|
+
}) => Promise<CardIssuingCardResponse>;
|
|
3579
|
+
//#endregion
|
|
3580
|
+
//#region src/cards/download-card-statement.d.ts
|
|
3581
|
+
/**
|
|
3582
|
+
* Fetches one month's card statement as a PDF blob.
|
|
3583
|
+
*
|
|
3584
|
+
* Fetched through {@link Privy.fetchPrivyRouteRaw} because the body is a PDF, not JSON.
|
|
3585
|
+
* `statementPeriod` is `YYYY-MM`.
|
|
3586
|
+
*/
|
|
3587
|
+
declare const downloadCardStatement: (client: Privy, { cardId, environment, statementPeriod }: {
|
|
3588
|
+
cardId: string;
|
|
3589
|
+
environment: IntegrationEnvironment;
|
|
3590
|
+
statementPeriod: string;
|
|
3591
|
+
}) => Promise<Blob>;
|
|
3592
|
+
//#endregion
|
|
3593
|
+
//#region src/cards/get-card-by-id.d.ts
|
|
3594
|
+
/**
|
|
3595
|
+
* One card by id, or null when it is not among the user's first {@link LIST_CARDS_MAX_LIMIT}.
|
|
3596
|
+
*
|
|
3597
|
+
* A single page of the list endpoint, filtered client-side, with `next_cursor` not followed.
|
|
3598
|
+
* The list endpoint does a live retrieve plus a balance lookup per card, so paging through it
|
|
3599
|
+
* to find one card grows with the user's card count. A card past the first page resolves to null.
|
|
3600
|
+
*
|
|
3601
|
+
* ##CardByIdListShim: replace this with one `GET /api/v1/cards/[card_id]` call when that endpoint
|
|
3602
|
+
* exists. Today the endpoint registers `PUT` only.
|
|
3603
|
+
*/
|
|
3604
|
+
declare const getCardById: (client: Privy, { cardId, environment }: {
|
|
3605
|
+
cardId: string;
|
|
3606
|
+
environment: IntegrationEnvironment;
|
|
3607
|
+
}) => Promise<CardIssuingCardResponse | null>;
|
|
3608
|
+
//#endregion
|
|
3609
|
+
//#region src/cards/get-card-customer.d.ts
|
|
3610
|
+
/**
|
|
3611
|
+
* Cards customer onboarding state for the authenticated user.
|
|
3612
|
+
*
|
|
3613
|
+
* Returns `{status: 'not_created'}` rather than a 404 when no customer exists.
|
|
3614
|
+
*/
|
|
3615
|
+
declare const getCardCustomer: (client: Privy, { environment }: {
|
|
3616
|
+
environment: IntegrationEnvironment;
|
|
3617
|
+
}) => Promise<CardIssuingCustomerResponse['data']>;
|
|
3618
|
+
//#endregion
|
|
3619
|
+
//#region src/cards/get-card-ephemeral-key.d.ts
|
|
3620
|
+
/**
|
|
3621
|
+
* Mints a single-use Stripe ephemeral key for revealing one card's sensitive fields.
|
|
3622
|
+
*
|
|
3623
|
+
* The caller first creates an ephemeral-key nonce for the card's provider id. That `nonce` is
|
|
3624
|
+
* passed here, and the backend exchanges it with Stripe for the short-lived secret. The secret
|
|
3625
|
+
* is handed to the Stripe display elements, which fetch and render the number, expiry, and CVC
|
|
3626
|
+
* without those values touching this SDK.
|
|
3627
|
+
*
|
|
3628
|
+
* `cardId` is Privy's id. Its path scopes the key to the caller's card, which prevents IDOR
|
|
3629
|
+
* access. The `nonce` was minted against Stripe's provider id.
|
|
3630
|
+
*/
|
|
3631
|
+
declare const getCardEphemeralKey: (client: Privy, { cardId, environment, nonce }: {
|
|
3632
|
+
cardId: string;
|
|
3633
|
+
environment: IntegrationEnvironment;
|
|
3634
|
+
nonce: string;
|
|
3635
|
+
}) => Promise<string>;
|
|
3636
|
+
//#endregion
|
|
3637
|
+
//#region src/cards/get-cards-config.d.ts
|
|
3638
|
+
/** Browser-safe card-issuing config for the app in `environment`. */
|
|
3639
|
+
declare const getCardsConfig: (client: Privy, { appId, environment }: {
|
|
3640
|
+
appId: string;
|
|
3641
|
+
environment: IntegrationEnvironment;
|
|
3642
|
+
}) => Promise<CardsConfig>;
|
|
3643
|
+
//#endregion
|
|
3644
|
+
//#region src/cards/get-or-create-card-customer.d.ts
|
|
3645
|
+
/**
|
|
3646
|
+
* Get-or-create the cardholder for the authenticated user, returning its onboarding state.
|
|
3647
|
+
* Requires a linked email on the account.
|
|
3648
|
+
*/
|
|
3649
|
+
declare const getOrCreateCardCustomer: (client: Privy, { environment }: {
|
|
3650
|
+
environment: IntegrationEnvironment;
|
|
3651
|
+
}) => Promise<CardIssuingCustomerResponse['data']>;
|
|
3652
|
+
//#endregion
|
|
3653
|
+
//#region src/cards/list-card-transactions.d.ts
|
|
3654
|
+
/**
|
|
3655
|
+
* A page of activity for one card, newest first.
|
|
3656
|
+
*
|
|
3657
|
+
* @param cursor opaque, from a previous page's `next_cursor`. Never construct one.
|
|
3658
|
+
* @param limit applies per activity source, so a page can carry up to twice this many rows.
|
|
3659
|
+
*/
|
|
3660
|
+
declare const listCardTransactions: (client: Privy, { cardId, environment, limit, cursor }: {
|
|
3661
|
+
cardId: string;
|
|
3662
|
+
environment: IntegrationEnvironment;
|
|
3663
|
+
limit?: number;
|
|
3664
|
+
cursor?: string;
|
|
3665
|
+
}) => Promise<CardIssuingTransactionsResponse>;
|
|
3666
|
+
//#endregion
|
|
3667
|
+
//#region src/cards/list-cards-max-limit.d.ts
|
|
3668
|
+
/** Largest page accepted by the list-cards endpoint. */
|
|
3669
|
+
declare const LIST_CARDS_MAX_LIMIT = 20;
|
|
3670
|
+
//#endregion
|
|
3671
|
+
//#region src/cards/list-cards.d.ts
|
|
3672
|
+
/** The authenticated user's cards, newest page first. */
|
|
3673
|
+
declare const listCards: (client: Privy, { environment, limit, cursor }: {
|
|
3674
|
+
environment: IntegrationEnvironment;
|
|
3675
|
+
limit?: number;
|
|
3676
|
+
cursor?: string;
|
|
3677
|
+
}) => Promise<CardIssuingCardsResponse>;
|
|
3678
|
+
//#endregion
|
|
3679
|
+
//#region src/cards/replace-card.d.ts
|
|
3680
|
+
/**
|
|
3681
|
+
* Replaces one card in a single request: the current card is closed and a fresh card is issued
|
|
3682
|
+
* and returned.
|
|
3683
|
+
*/
|
|
3684
|
+
declare const replaceCard: (client: Privy, { cardId, environment, reason }: {
|
|
3685
|
+
cardId: string;
|
|
3686
|
+
environment: IntegrationEnvironment;
|
|
3687
|
+
reason: CardIssuingReplacementReason;
|
|
3688
|
+
}) => Promise<CardIssuingCardResponse>;
|
|
3689
|
+
//#endregion
|
|
3690
|
+
//#region src/cards/update-card-pin.d.ts
|
|
3691
|
+
/** Sets one card's PIN from a Stripe-encrypted JWE. The plaintext PIN never enters this request. */
|
|
3692
|
+
declare const updateCardPin: (client: Privy, { cardId, environment, encryptedNumber }: {
|
|
3693
|
+
cardId: string;
|
|
3694
|
+
environment: IntegrationEnvironment;
|
|
3695
|
+
encryptedNumber: string;
|
|
3696
|
+
}) => Promise<CardIssuingCardResponse>;
|
|
3697
|
+
//#endregion
|
|
3698
|
+
//#region src/cards/update-card-status.d.ts
|
|
3699
|
+
/**
|
|
3700
|
+
* Moves one card to `status`, returning the updated card. `inactive` is a reversible freeze;
|
|
3701
|
+
* `canceled` is terminal.
|
|
3702
|
+
*/
|
|
3703
|
+
declare const updateCardStatus: (client: Privy, { cardId, environment, status }: {
|
|
3704
|
+
cardId: string;
|
|
3705
|
+
environment: IntegrationEnvironment;
|
|
3706
|
+
status: CardIssuingCardStatus;
|
|
3707
|
+
}) => Promise<CardIssuingCardResponse>;
|
|
3708
|
+
//#endregion
|
|
3505
3709
|
//#region src/index.d.ts
|
|
3506
3710
|
/** @deprecated Use OAuthProviderID instead */
|
|
3507
3711
|
type OAuthProviderType = OAuthProviderID$1;
|
|
@@ -3521,4 +3725,4 @@ declare const THIRDWEB: "thirdweb";
|
|
|
3521
3725
|
/** @deprecated {@link SmartWalletType} is a well-typed union, use the `'nexus'` literal instead */
|
|
3522
3726
|
declare const NEXUS: "nexus";
|
|
3523
3727
|
//#endregion
|
|
3524
|
-
export { ALL_WALLET_CLIENT_TYPES, BICONOMY, COINBASE_SMART_WALLET, Cluster, type CoinbaseAssetId, CoinbaseWalletClientType, type CompletedDepositAddressOrder, ConnectedStandardSolanaWallet, ConnectorType, CookieWriteBehavior, type CountryCallingCode, type CountryCode, type CreateCryptoDepositAccountInput, type CreateCryptoDepositAccountResponse, type CreateSiwsMessageOpts, type CryptoDepositAccountConfig, type CryptoDepositAccountQuote, type CryptoDepositAccountQuoteInput, type CryptoDepositAddressRoute, type CryptoDepositAddressStrategy, type CryptoDepositAsset, type CryptoDepositAssetFilter, DATA_SUFFIX_PLUGIN_ID, type DataSuffixPlugin, type DepositAddressOrder, type DepositAddressPollingResult, type DepositAddressQuote, type DepositConfig, type EIP1193Provider, type EmbeddedBitcoinWalletProvider, EmbeddedProviderError, EmbeddedWalletClientType, type EmbeddedWalletConfig, type EmbeddedWalletRecoveryOptions, type EntropyIdVerifier, type ErrorMessageMap, ExternalWallet, ExternalWalletMetadata, FundingMethod, FundingProvider, type GenerateAuthorizationSignatureInput, type GenerateAuthorizationSignatureOutput, type GenerateDepositAddressInput, type GetCryptoDepositAccountNextOrderInput, type GetCryptoDepositAccountNextOrderResponse, type GetCryptoDepositAccountOrderInput, type GetCryptoDepositAccountOrderResponse, type GetDepositInput, IdentifierString, InMemoryCache, type IncompleteDepositAddressOrder, InjectedWalletClientType, KERNEL, LIGHT_ACCOUNT, LocalStorage, type LogLevel, type Logger, type MfaMethod, type MfaPromise, type MfaSubmitArgs, type MfaSubmitPromise, MoonpayApiError, type MoonpayTransactionStatus, type MoonpayTransactionStatusResponse, NEXUS, type OAuthProviderID, OAuthProviderType, type OnNeedsRecovery, type ParsedSolanaOffchainMessage, PaymentOption, type PollOptions, type PollResult, type PreparedTransactionRequest, PrivyApiError, PrivyClientError, PrivyConnectorError, PrivyEmbeddedSolanaWalletProvider, PrivyEmbeddedWalletErrorCode, PrivyEmbeddedWalletProvider, type PrivyPlugin, PrivyProviderRpcError, ProviderErrors, type Quantity, type ResolveRefundAddressError, type ResolveRefundAddressResult, SAFE, SUPPORTED_CONNECTOR_TYPES, type SessionSignerInput, type SetRecoveryInput, SmartWalletType, SolanaClient, SolanaCluster, SolanaSignAndSendTransactionInput, SolanaSignAndSendTransactionMode, SolanaSignAndSendTransactionOptions, SolanaSignAndSendTransactionOutput, SolanaSignMessageInput, SolanaSignMessageOutput, SolanaSignTransactionInput, SolanaSignTransactionOptions, SolanaSignTransactionOutput, SolanaStandardWallet, SolanaTransactionCommitment, SolanaUsdcAddressMap, type Storage, THIRDWEB, type TelegramAuthInput, type TelegramAuthResult, type TelegramWebAppData, UnknownWalletClientType, type UnsignedTransactionRequest, type UnsignedTransactionRequestWithChainId, UsdcAddressMap, type WaitForCompletionInput, type WaitForDepositInput, WalletBranding, WalletClientType, WalletConnectWalletClientType, addSessionSigners, buildSolanaOffchainMessage, chainToMoonpayCurrency, cookies, countryCodesAndNumbers, create, createDataSuffixPlugin, createErrorFormatter, createSiwsMessage, index_d_exports as crossApp, index_d_exports$1 as cryptoDepositAccount, Privy as default, index_d_exports$2 as delegatedActions, index_d_exports$3 as depositAddress, deriveSolanaApplicationDomain, errorIndicatesMaxMfaRetries, errorIndicatesMfaCanceled, errorIndicatesMfaRateLimit, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, errorIndicatesRecoveryIsNeeded, formatLamportsAmount, formatPhoneNumber, formatTokenAmount, formatWalletAddress, formatWeiAmount, fundingMethodToMoonpayPaymentMethod, generateAuthorizationSignature, generateWalletIdempotencyKey, getAllUserEmbeddedBitcoinWallets, getAllUserEmbeddedEthereumWallets, getAllUserEmbeddedSolanaWallets, getCoinbaseOnRampUrl, getCountryCallingCode, getDataSuffixPlugin, getEntropyDetailsFromAccount, getEntropyDetailsFromUser, getIsTokenUsdc, getJsonRpcEndpointFromChain, getPhoneCountryCodeAndNumber, getPlaceholderPhoneNumber, getSolanaClusterDisplayName, getSolanaRpcEndpointForCluster, getSolanaUsdcMintAddressForCluster, getUserEmbeddedEthereumWallet, getUserEmbeddedSolanaWallet, getUserEmbeddedWallet, getUserSmartWallet, getWallet, getWalletAction, isEmbeddedWalletAccount, isExtensionContext, isSupportedChainIdForCoinbaseOnramp, isSupportedChainIdForMoonpay, isUnifiedWallet, lastFourDigits, listWalletActions, parseSolanaOffchainMessage, phoneNumberTypingFormatter, poll, rawSign, removeSessionSigners, rpc, shouldWriteSessionCookies, throwIfInvalidRecoveryUpgradePath, toCoinbaseAssetId, toCoinbaseBlockchainFromChainId, toE164, toObjectKeys, toWalletApiUnsignedEthTransaction, transfer, updateWallet, validatePhoneNumber };
|
|
3728
|
+
export { ALL_WALLET_CLIENT_TYPES, BICONOMY, COINBASE_SMART_WALLET, type CardsConfig, Cluster, type CoinbaseAssetId, CoinbaseWalletClientType, type CompletedDepositAddressOrder, ConnectedStandardSolanaWallet, ConnectorType, CookieWriteBehavior, type CountryCallingCode, type CountryCode, type CreateCryptoDepositAccountInput, type CreateCryptoDepositAccountResponse, type CreateSiwsMessageOpts, type CryptoDepositAccountConfig, type CryptoDepositAccountQuote, type CryptoDepositAccountQuoteInput, type CryptoDepositAddressRoute, type CryptoDepositAddressStrategy, type CryptoDepositAsset, type CryptoDepositAssetFilter, DATA_SUFFIX_PLUGIN_ID, type DataSuffixPlugin, type DepositAddressOrder, type DepositAddressPollingResult, type DepositAddressQuote, type DepositConfig, type EIP1193Provider, type EmbeddedBitcoinWalletProvider, EmbeddedProviderError, EmbeddedWalletClientType, type EmbeddedWalletConfig, type EmbeddedWalletRecoveryOptions, type EntropyIdVerifier, type ErrorMessageMap, ExternalWallet, ExternalWalletMetadata, FundingMethod, FundingProvider, type GenerateAuthorizationSignatureInput, type GenerateAuthorizationSignatureOutput, type GenerateDepositAddressInput, type GetCryptoDepositAccountNextOrderInput, type GetCryptoDepositAccountNextOrderResponse, type GetCryptoDepositAccountOrderInput, type GetCryptoDepositAccountOrderResponse, type GetDepositInput, IdentifierString, InMemoryCache, type IncompleteDepositAddressOrder, InjectedWalletClientType, KERNEL, LIGHT_ACCOUNT, LIST_CARDS_MAX_LIMIT, LocalStorage, type LogLevel, type Logger, type MfaMethod, type MfaPromise, type MfaSubmitArgs, type MfaSubmitPromise, MoonpayApiError, type MoonpayTransactionStatus, type MoonpayTransactionStatusResponse, NEXUS, type OAuthProviderID, OAuthProviderType, type OnNeedsRecovery, type ParsedSolanaOffchainMessage, PaymentOption, type PollOptions, type PollResult, type PreparedTransactionRequest, PrivyApiError, PrivyClientError, PrivyConnectorError, PrivyEmbeddedSolanaWalletProvider, PrivyEmbeddedWalletErrorCode, PrivyEmbeddedWalletProvider, type PrivyPlugin, PrivyProviderRpcError, ProviderErrors, type Quantity, type ResolveRefundAddressError, type ResolveRefundAddressResult, SAFE, SUPPORTED_CONNECTOR_TYPES, type SessionSignerInput, type SetRecoveryInput, SmartWalletType, SolanaClient, SolanaCluster, SolanaSignAndSendTransactionInput, SolanaSignAndSendTransactionMode, SolanaSignAndSendTransactionOptions, SolanaSignAndSendTransactionOutput, SolanaSignMessageInput, SolanaSignMessageOutput, SolanaSignTransactionInput, SolanaSignTransactionOptions, SolanaSignTransactionOutput, SolanaStandardWallet, SolanaTransactionCommitment, SolanaUsdcAddressMap, type Storage, THIRDWEB, type TelegramAuthInput, type TelegramAuthResult, type TelegramWebAppData, UnknownWalletClientType, type UnsignedTransactionRequest, type UnsignedTransactionRequestWithChainId, UsdcAddressMap, type WaitForCompletionInput, type WaitForDepositInput, WalletBranding, WalletClientType, WalletConnectWalletClientType, acceptCardConsents, addSessionSigners, buildSolanaOffchainMessage, chainToMoonpayCurrency, cookies, countryCodesAndNumbers, create, createCard, createDataSuffixPlugin, createErrorFormatter, createSiwsMessage, index_d_exports as crossApp, index_d_exports$1 as cryptoDepositAccount, Privy as default, index_d_exports$2 as delegatedActions, index_d_exports$3 as depositAddress, deriveSolanaApplicationDomain, downloadCardStatement, errorIndicatesMaxMfaRetries, errorIndicatesMfaCanceled, errorIndicatesMfaRateLimit, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, errorIndicatesRecoveryIsNeeded, formatLamportsAmount, formatPhoneNumber, formatTokenAmount, formatWalletAddress, formatWeiAmount, fundingMethodToMoonpayPaymentMethod, generateAuthorizationSignature, generateWalletIdempotencyKey, getAllUserEmbeddedBitcoinWallets, getAllUserEmbeddedEthereumWallets, getAllUserEmbeddedSolanaWallets, getCardById, getCardCustomer, getCardEphemeralKey, getCardsConfig, getCoinbaseOnRampUrl, getCountryCallingCode, getDataSuffixPlugin, getEntropyDetailsFromAccount, getEntropyDetailsFromUser, getFiatOnrampProviderBrand, getFiatOnrampProviderId, getIsTokenUsdc, getJsonRpcEndpointFromChain, getOrCreateCardCustomer, getPhoneCountryCodeAndNumber, getPlaceholderPhoneNumber, getSolanaClusterDisplayName, getSolanaRpcEndpointForCluster, getSolanaUsdcMintAddressForCluster, getUserEmbeddedEthereumWallet, getUserEmbeddedSolanaWallet, getUserEmbeddedWallet, getUserSmartWallet, getWallet, getWalletAction, isEmbeddedWalletAccount, isExtensionContext, isSupportedChainIdForCoinbaseOnramp, isSupportedChainIdForMoonpay, isUnifiedWallet, lastFourDigits, listCardTransactions, listCards, listWalletActions, parseSolanaOffchainMessage, phoneNumberTypingFormatter, poll, rawSign, removeSessionSigners, replaceCard, rpc, shouldWriteSessionCookies, throwIfInvalidRecoveryUpgradePath, toCoinbaseAssetId, toCoinbaseBlockchainFromChainId, toE164, toObjectKeys, toWalletApiUnsignedEthTransaction, transfer, updateCardPin, updateCardStatus, updateWallet, validatePhoneNumber };
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthenticatedUser, CoinbaseOnRampInitInput, CoinbaseOnRampInitResponse, CreateCryptoDepositAccountResponse, CryptoDepositAccountConfigResponse, CryptoDepositAddressRoute, CryptoDepositAddressStrategy, CryptoDepositAsset, CryptoDepositAssetFilter, DepositAccountCryptoQuoteResponse, GetCryptoDepositAccountNextOrderResponse, GetCryptoDepositAccountOrderResponse, LinkedAccount, LinkedAccountBitcoinSegwitEmbeddedWallet, LinkedAccountBitcoinTaprootEmbeddedWallet, LinkedAccountEmbeddedWallet, LinkedAccountEmbeddedWalletWithID, LinkedAccountEthereumEmbeddedWallet, LinkedAccountSmartWallet, LinkedAccountSolanaEmbeddedWallet, MfaPasskeyInitRequestBody, MfaSMSInitRequestBody, MoonpayOnRampSignInput, OAuthProviderID, OAuthProviderID as OAuthProviderID$1, OAuthTokens, PasskeyAuthenticatorVerifyResponse, RawSignResponse, SmartWalletConfiguration, SmartWalletType as SmartWalletType$1, TransferRequestBody, UnsignedEthereumTransaction, User, Wallet, WalletCreateParams, WalletRawSignParams, WalletRpcParams, WalletRpcResponse, WalletUpdateParams, Wallets } from "@privy-io/api-types";
|
|
1
|
+
import { AuthenticatedUser, CardIssuingCardResponse, CardIssuingCardStatus, CardIssuingCardsResponse, CardIssuingCustomerResponse, CardIssuingReplacementReason, CardIssuingTransactionsResponse, CoinbaseOnRampInitInput, CoinbaseOnRampInitResponse, CreateCryptoDepositAccountResponse, CryptoDepositAccountConfigResponse, CryptoDepositAddressRoute, CryptoDepositAddressStrategy, CryptoDepositAsset, CryptoDepositAssetFilter, DepositAccountCryptoQuoteResponse, GetCryptoDepositAccountNextOrderResponse, GetCryptoDepositAccountOrderResponse, IntegrationEnvironment, LinkedAccount, LinkedAccountBitcoinSegwitEmbeddedWallet, LinkedAccountBitcoinTaprootEmbeddedWallet, LinkedAccountEmbeddedWallet, LinkedAccountEmbeddedWalletWithID, LinkedAccountEthereumEmbeddedWallet, LinkedAccountSmartWallet, LinkedAccountSolanaEmbeddedWallet, MfaPasskeyInitRequestBody, MfaSMSInitRequestBody, MoonpayOnRampSignInput, OAuthProviderID, OAuthProviderID as OAuthProviderID$1, OAuthTokens, PasskeyAuthenticatorVerifyResponse, RawSignResponse, SmartWalletConfiguration, SmartWalletType as SmartWalletType$1, TransferRequestBody, UnsignedEthereumTransaction, User, Wallet, WalletCreateParams, WalletRawSignParams, WalletRpcParams, WalletRpcResponse, WalletUpdateParams, Wallets } from "@privy-io/api-types";
|
|
2
2
|
import { Chain, RpcConfig } from "@privy-io/chains";
|
|
3
3
|
import { Route } from "@privy-io/routes";
|
|
4
4
|
import "@metamask/eth-sig-util";
|
|
@@ -809,6 +809,13 @@ interface Storage {
|
|
|
809
809
|
}
|
|
810
810
|
//#endregion
|
|
811
811
|
//#region src/embedded/EmbeddedSolanaWalletProvider.d.ts
|
|
812
|
+
/**
|
|
813
|
+
* A web3.js transaction object, or a serialized transaction in wire format.
|
|
814
|
+
*
|
|
815
|
+
* Serialized transactions support legacy, v0, and V1 formats. V1 transactions must be passed
|
|
816
|
+
* serialized because web3.js cannot serialize them.
|
|
817
|
+
*/
|
|
818
|
+
type SolanaTransactionInput = Transaction | VersionedTransaction | Uint8Array;
|
|
812
819
|
type SignMessageRequestArguments = {
|
|
813
820
|
method: 'signMessage';
|
|
814
821
|
params: {
|
|
@@ -818,12 +825,12 @@ type SignMessageRequestArguments = {
|
|
|
818
825
|
type SignAndSendTransactionRequestArguments = {
|
|
819
826
|
method: 'signAndSendTransaction';
|
|
820
827
|
params: {
|
|
821
|
-
transaction:
|
|
828
|
+
transaction: SolanaTransactionInput;
|
|
822
829
|
connection: Connection;
|
|
823
830
|
options?: SendOptions;
|
|
824
831
|
};
|
|
825
832
|
};
|
|
826
|
-
type SignTransactionRequestArguments<T extends
|
|
833
|
+
type SignTransactionRequestArguments<T extends SolanaTransactionInput = Transaction> = {
|
|
827
834
|
method: 'signTransaction';
|
|
828
835
|
params: {
|
|
829
836
|
transaction: T;
|
|
@@ -844,6 +851,13 @@ declare class EmbeddedSolanaWalletProvider {
|
|
|
844
851
|
request<T extends Transaction | VersionedTransaction>(request: SignTransactionRequestArguments<T>): Promise<{
|
|
845
852
|
signedTransaction: T;
|
|
846
853
|
}>;
|
|
854
|
+
/**
|
|
855
|
+
* Serialized transactions are signed into a new `Uint8Array`, so the result is always a plain
|
|
856
|
+
* `Uint8Array`, even when a subtype such as `Buffer` is passed in.
|
|
857
|
+
*/
|
|
858
|
+
request(request: SignTransactionRequestArguments<Uint8Array>): Promise<{
|
|
859
|
+
signedTransaction: Uint8Array;
|
|
860
|
+
}>;
|
|
847
861
|
/**
|
|
848
862
|
* Legacy API for reading the public key for this provider.
|
|
849
863
|
*
|
|
@@ -851,7 +865,10 @@ declare class EmbeddedSolanaWalletProvider {
|
|
|
851
865
|
*/
|
|
852
866
|
get _publicKey(): string;
|
|
853
867
|
private connectAndRecover;
|
|
868
|
+
private walletRpcContext;
|
|
854
869
|
private signMessageRpc;
|
|
870
|
+
private signSerializedTransaction;
|
|
871
|
+
private signTransactionObject;
|
|
855
872
|
private handleIFrameRpc;
|
|
856
873
|
private handleSignAndSendTransaction;
|
|
857
874
|
private handleSignTransaction;
|
|
@@ -2277,6 +2294,8 @@ declare class Privy {
|
|
|
2277
2294
|
query?: Record<string, string | number>;
|
|
2278
2295
|
params?: Record<string, string | number>;
|
|
2279
2296
|
headers?: HeadersInit;
|
|
2297
|
+
/** Aborts the request. The built-in timeout still applies. */
|
|
2298
|
+
signal?: AbortSignal;
|
|
2280
2299
|
}): Promise<NonNullable<T['response']>>;
|
|
2281
2300
|
/**
|
|
2282
2301
|
* Like {@link fetchPrivyRoute}, but resolves the raw {@link Response} rather than a parsed JSON
|
|
@@ -2670,6 +2689,21 @@ declare const isSupportedChainIdForCoinbaseOnramp: (chainId: number, asset: 'nat
|
|
|
2670
2689
|
declare function toCoinbaseBlockchainFromChainId(chainId: number): SupportedBlockchains | undefined;
|
|
2671
2690
|
declare function toCoinbaseAssetId(chainId: number, asset: 'USDC' | 'native-currency'): CoinbaseAssetId;
|
|
2672
2691
|
//#endregion
|
|
2692
|
+
//#region src/funding/onramp-providers.d.ts
|
|
2693
|
+
type FiatOnrampQuoteProvider = {
|
|
2694
|
+
provider: string;
|
|
2695
|
+
sub_provider?: string | null;
|
|
2696
|
+
};
|
|
2697
|
+
/** The onramp provider without its sandbox suffix, e.g. `stripe` for `stripe-sandbox`. */
|
|
2698
|
+
declare const getFiatOnrampProviderId: (quote: FiatOnrampQuoteProvider) => string;
|
|
2699
|
+
/**
|
|
2700
|
+
* The provider brand a quote belongs to, e.g. STRIPE or a Meld route such as TRANSAK. A direct
|
|
2701
|
+
* integration and Meld's route for the same brand share one. The backend keeps one quote per
|
|
2702
|
+
* payment method per brand and the SDK's provider picker groups quotes by brand, so both must use
|
|
2703
|
+
* this definition.
|
|
2704
|
+
*/
|
|
2705
|
+
declare const getFiatOnrampProviderBrand: (quote: FiatOnrampQuoteProvider) => string;
|
|
2706
|
+
//#endregion
|
|
2673
2707
|
//#region src/crypto/types.d.ts
|
|
2674
2708
|
/**
|
|
2675
2709
|
* Optional overrides accepted at the public API boundary so callers can
|
|
@@ -2847,16 +2881,18 @@ interface LoginWithCrossAppAuthDependencies {
|
|
|
2847
2881
|
interface LoginWithCrossAppAuthInput {
|
|
2848
2882
|
providerAppId: string;
|
|
2849
2883
|
redirectUrl: string;
|
|
2884
|
+
loginOptions?: LoginOptions;
|
|
2850
2885
|
}
|
|
2851
2886
|
type LoginWithCrossAppAuthOutput = Omit<AuthenticatedUser, 'session_update_action'>;
|
|
2852
2887
|
/**
|
|
2853
2888
|
* Logs a user into your app through an account on **another Privy app**.
|
|
2854
2889
|
*
|
|
2855
|
-
* @param
|
|
2856
|
-
* @param
|
|
2890
|
+
* @param providerAppId the Privy app ID to which the external account should belong.
|
|
2891
|
+
* @param redirectUrl a URL path used to redirect back to your app after successful authentication
|
|
2892
|
+
* @param loginOptions optional login settings, including automatic embedded wallet creation
|
|
2857
2893
|
* @returns a promise that resolves with the new session
|
|
2858
2894
|
*/
|
|
2859
|
-
declare const loginWithCrossAppAuth: ({ client, openAuthSession }: LoginWithCrossAppAuthDependencies) => ({ providerAppId, redirectUrl }: LoginWithCrossAppAuthInput) => Promise<LoginWithCrossAppAuthOutput>;
|
|
2895
|
+
declare const loginWithCrossAppAuth: ({ client, openAuthSession }: LoginWithCrossAppAuthDependencies) => ({ providerAppId, redirectUrl, loginOptions }: LoginWithCrossAppAuthInput) => Promise<LoginWithCrossAppAuthOutput>;
|
|
2860
2896
|
//#endregion
|
|
2861
2897
|
//#region src/action/crossApp/linkWithCrossAppAuth.d.ts
|
|
2862
2898
|
interface LinkWithCrossAppAuthDependencies {
|
|
@@ -3502,6 +3538,174 @@ type PollResult<T> = {
|
|
|
3502
3538
|
};
|
|
3503
3539
|
declare const poll: <T>({ operation, until, delay, interval, attempts: maxAttempts, signal }: PollOptions<T>) => Promise<PollResult<T>>;
|
|
3504
3540
|
//#endregion
|
|
3541
|
+
//#region src/cards/accept-card-consents.d.ts
|
|
3542
|
+
/**
|
|
3543
|
+
* Records that the user accepted the agreements Privy tracks (the electronic disclosure and the
|
|
3544
|
+
* bank agreements), returning the customer at its advanced status. Acceptances are write-once, so
|
|
3545
|
+
* re-sending a field that is already recorded leaves the original timestamp unchanged.
|
|
3546
|
+
*
|
|
3547
|
+
* The cardholder must already exist. Accepting the bank terms before the electronic disclosure
|
|
3548
|
+
* is rejected by the backend.
|
|
3549
|
+
*/
|
|
3550
|
+
declare const acceptCardConsents: (client: Privy, { environment, acceptElectronicDisclosure, acceptBankTerms }: {
|
|
3551
|
+
environment: IntegrationEnvironment;
|
|
3552
|
+
acceptElectronicDisclosure?: boolean;
|
|
3553
|
+
acceptBankTerms?: boolean;
|
|
3554
|
+
}) => Promise<CardIssuingCustomerResponse['data']>;
|
|
3555
|
+
//#endregion
|
|
3556
|
+
//#region src/cards/cards-config.d.ts
|
|
3557
|
+
/** Browser-safe card-issuing configuration. */
|
|
3558
|
+
type CardsConfig = {
|
|
3559
|
+
publishableKey: string;
|
|
3560
|
+
/** Dedicated card-face logo. Distinct from login `appearance.logo`; null when none is set. */
|
|
3561
|
+
cardLogoUrl: string | null;
|
|
3562
|
+
/** Scope for platform keys; omitted when the key belongs to the issuing account. */
|
|
3563
|
+
stripeAccount?: string;
|
|
3564
|
+
};
|
|
3565
|
+
//#endregion
|
|
3566
|
+
//#region src/cards/create-card.d.ts
|
|
3567
|
+
/**
|
|
3568
|
+
* Creates the virtual card for a wallet, returning the new card. Only valid once the cards
|
|
3569
|
+
* customer has reached `ready`; there is one card per account.
|
|
3570
|
+
*
|
|
3571
|
+
* @param chainId CAIP-2 chain id, e.g. `'eip155:84532'`.
|
|
3572
|
+
*/
|
|
3573
|
+
declare const createCard: (client: Privy, { environment, walletId, chainId, asset }: {
|
|
3574
|
+
environment: IntegrationEnvironment;
|
|
3575
|
+
walletId: string;
|
|
3576
|
+
chainId: string;
|
|
3577
|
+
asset: string;
|
|
3578
|
+
}) => Promise<CardIssuingCardResponse>;
|
|
3579
|
+
//#endregion
|
|
3580
|
+
//#region src/cards/download-card-statement.d.ts
|
|
3581
|
+
/**
|
|
3582
|
+
* Fetches one month's card statement as a PDF blob.
|
|
3583
|
+
*
|
|
3584
|
+
* Fetched through {@link Privy.fetchPrivyRouteRaw} because the body is a PDF, not JSON.
|
|
3585
|
+
* `statementPeriod` is `YYYY-MM`.
|
|
3586
|
+
*/
|
|
3587
|
+
declare const downloadCardStatement: (client: Privy, { cardId, environment, statementPeriod }: {
|
|
3588
|
+
cardId: string;
|
|
3589
|
+
environment: IntegrationEnvironment;
|
|
3590
|
+
statementPeriod: string;
|
|
3591
|
+
}) => Promise<Blob>;
|
|
3592
|
+
//#endregion
|
|
3593
|
+
//#region src/cards/get-card-by-id.d.ts
|
|
3594
|
+
/**
|
|
3595
|
+
* One card by id, or null when it is not among the user's first {@link LIST_CARDS_MAX_LIMIT}.
|
|
3596
|
+
*
|
|
3597
|
+
* A single page of the list endpoint, filtered client-side, with `next_cursor` not followed.
|
|
3598
|
+
* The list endpoint does a live retrieve plus a balance lookup per card, so paging through it
|
|
3599
|
+
* to find one card grows with the user's card count. A card past the first page resolves to null.
|
|
3600
|
+
*
|
|
3601
|
+
* ##CardByIdListShim: replace this with one `GET /api/v1/cards/[card_id]` call when that endpoint
|
|
3602
|
+
* exists. Today the endpoint registers `PUT` only.
|
|
3603
|
+
*/
|
|
3604
|
+
declare const getCardById: (client: Privy, { cardId, environment }: {
|
|
3605
|
+
cardId: string;
|
|
3606
|
+
environment: IntegrationEnvironment;
|
|
3607
|
+
}) => Promise<CardIssuingCardResponse | null>;
|
|
3608
|
+
//#endregion
|
|
3609
|
+
//#region src/cards/get-card-customer.d.ts
|
|
3610
|
+
/**
|
|
3611
|
+
* Cards customer onboarding state for the authenticated user.
|
|
3612
|
+
*
|
|
3613
|
+
* Returns `{status: 'not_created'}` rather than a 404 when no customer exists.
|
|
3614
|
+
*/
|
|
3615
|
+
declare const getCardCustomer: (client: Privy, { environment }: {
|
|
3616
|
+
environment: IntegrationEnvironment;
|
|
3617
|
+
}) => Promise<CardIssuingCustomerResponse['data']>;
|
|
3618
|
+
//#endregion
|
|
3619
|
+
//#region src/cards/get-card-ephemeral-key.d.ts
|
|
3620
|
+
/**
|
|
3621
|
+
* Mints a single-use Stripe ephemeral key for revealing one card's sensitive fields.
|
|
3622
|
+
*
|
|
3623
|
+
* The caller first creates an ephemeral-key nonce for the card's provider id. That `nonce` is
|
|
3624
|
+
* passed here, and the backend exchanges it with Stripe for the short-lived secret. The secret
|
|
3625
|
+
* is handed to the Stripe display elements, which fetch and render the number, expiry, and CVC
|
|
3626
|
+
* without those values touching this SDK.
|
|
3627
|
+
*
|
|
3628
|
+
* `cardId` is Privy's id. Its path scopes the key to the caller's card, which prevents IDOR
|
|
3629
|
+
* access. The `nonce` was minted against Stripe's provider id.
|
|
3630
|
+
*/
|
|
3631
|
+
declare const getCardEphemeralKey: (client: Privy, { cardId, environment, nonce }: {
|
|
3632
|
+
cardId: string;
|
|
3633
|
+
environment: IntegrationEnvironment;
|
|
3634
|
+
nonce: string;
|
|
3635
|
+
}) => Promise<string>;
|
|
3636
|
+
//#endregion
|
|
3637
|
+
//#region src/cards/get-cards-config.d.ts
|
|
3638
|
+
/** Browser-safe card-issuing config for the app in `environment`. */
|
|
3639
|
+
declare const getCardsConfig: (client: Privy, { appId, environment }: {
|
|
3640
|
+
appId: string;
|
|
3641
|
+
environment: IntegrationEnvironment;
|
|
3642
|
+
}) => Promise<CardsConfig>;
|
|
3643
|
+
//#endregion
|
|
3644
|
+
//#region src/cards/get-or-create-card-customer.d.ts
|
|
3645
|
+
/**
|
|
3646
|
+
* Get-or-create the cardholder for the authenticated user, returning its onboarding state.
|
|
3647
|
+
* Requires a linked email on the account.
|
|
3648
|
+
*/
|
|
3649
|
+
declare const getOrCreateCardCustomer: (client: Privy, { environment }: {
|
|
3650
|
+
environment: IntegrationEnvironment;
|
|
3651
|
+
}) => Promise<CardIssuingCustomerResponse['data']>;
|
|
3652
|
+
//#endregion
|
|
3653
|
+
//#region src/cards/list-card-transactions.d.ts
|
|
3654
|
+
/**
|
|
3655
|
+
* A page of activity for one card, newest first.
|
|
3656
|
+
*
|
|
3657
|
+
* @param cursor opaque, from a previous page's `next_cursor`. Never construct one.
|
|
3658
|
+
* @param limit applies per activity source, so a page can carry up to twice this many rows.
|
|
3659
|
+
*/
|
|
3660
|
+
declare const listCardTransactions: (client: Privy, { cardId, environment, limit, cursor }: {
|
|
3661
|
+
cardId: string;
|
|
3662
|
+
environment: IntegrationEnvironment;
|
|
3663
|
+
limit?: number;
|
|
3664
|
+
cursor?: string;
|
|
3665
|
+
}) => Promise<CardIssuingTransactionsResponse>;
|
|
3666
|
+
//#endregion
|
|
3667
|
+
//#region src/cards/list-cards-max-limit.d.ts
|
|
3668
|
+
/** Largest page accepted by the list-cards endpoint. */
|
|
3669
|
+
declare const LIST_CARDS_MAX_LIMIT = 20;
|
|
3670
|
+
//#endregion
|
|
3671
|
+
//#region src/cards/list-cards.d.ts
|
|
3672
|
+
/** The authenticated user's cards, newest page first. */
|
|
3673
|
+
declare const listCards: (client: Privy, { environment, limit, cursor }: {
|
|
3674
|
+
environment: IntegrationEnvironment;
|
|
3675
|
+
limit?: number;
|
|
3676
|
+
cursor?: string;
|
|
3677
|
+
}) => Promise<CardIssuingCardsResponse>;
|
|
3678
|
+
//#endregion
|
|
3679
|
+
//#region src/cards/replace-card.d.ts
|
|
3680
|
+
/**
|
|
3681
|
+
* Replaces one card in a single request: the current card is closed and a fresh card is issued
|
|
3682
|
+
* and returned.
|
|
3683
|
+
*/
|
|
3684
|
+
declare const replaceCard: (client: Privy, { cardId, environment, reason }: {
|
|
3685
|
+
cardId: string;
|
|
3686
|
+
environment: IntegrationEnvironment;
|
|
3687
|
+
reason: CardIssuingReplacementReason;
|
|
3688
|
+
}) => Promise<CardIssuingCardResponse>;
|
|
3689
|
+
//#endregion
|
|
3690
|
+
//#region src/cards/update-card-pin.d.ts
|
|
3691
|
+
/** Sets one card's PIN from a Stripe-encrypted JWE. The plaintext PIN never enters this request. */
|
|
3692
|
+
declare const updateCardPin: (client: Privy, { cardId, environment, encryptedNumber }: {
|
|
3693
|
+
cardId: string;
|
|
3694
|
+
environment: IntegrationEnvironment;
|
|
3695
|
+
encryptedNumber: string;
|
|
3696
|
+
}) => Promise<CardIssuingCardResponse>;
|
|
3697
|
+
//#endregion
|
|
3698
|
+
//#region src/cards/update-card-status.d.ts
|
|
3699
|
+
/**
|
|
3700
|
+
* Moves one card to `status`, returning the updated card. `inactive` is a reversible freeze;
|
|
3701
|
+
* `canceled` is terminal.
|
|
3702
|
+
*/
|
|
3703
|
+
declare const updateCardStatus: (client: Privy, { cardId, environment, status }: {
|
|
3704
|
+
cardId: string;
|
|
3705
|
+
environment: IntegrationEnvironment;
|
|
3706
|
+
status: CardIssuingCardStatus;
|
|
3707
|
+
}) => Promise<CardIssuingCardResponse>;
|
|
3708
|
+
//#endregion
|
|
3505
3709
|
//#region src/index.d.ts
|
|
3506
3710
|
/** @deprecated Use OAuthProviderID instead */
|
|
3507
3711
|
type OAuthProviderType = OAuthProviderID$1;
|
|
@@ -3521,4 +3725,4 @@ declare const THIRDWEB: "thirdweb";
|
|
|
3521
3725
|
/** @deprecated {@link SmartWalletType} is a well-typed union, use the `'nexus'` literal instead */
|
|
3522
3726
|
declare const NEXUS: "nexus";
|
|
3523
3727
|
//#endregion
|
|
3524
|
-
export { ALL_WALLET_CLIENT_TYPES, BICONOMY, COINBASE_SMART_WALLET, Cluster, type CoinbaseAssetId, CoinbaseWalletClientType, type CompletedDepositAddressOrder, ConnectedStandardSolanaWallet, ConnectorType, CookieWriteBehavior, type CountryCallingCode, type CountryCode, type CreateCryptoDepositAccountInput, type CreateCryptoDepositAccountResponse, type CreateSiwsMessageOpts, type CryptoDepositAccountConfig, type CryptoDepositAccountQuote, type CryptoDepositAccountQuoteInput, type CryptoDepositAddressRoute, type CryptoDepositAddressStrategy, type CryptoDepositAsset, type CryptoDepositAssetFilter, DATA_SUFFIX_PLUGIN_ID, type DataSuffixPlugin, type DepositAddressOrder, type DepositAddressPollingResult, type DepositAddressQuote, type DepositConfig, type EIP1193Provider, type EmbeddedBitcoinWalletProvider, EmbeddedProviderError, EmbeddedWalletClientType, type EmbeddedWalletConfig, type EmbeddedWalletRecoveryOptions, type EntropyIdVerifier, type ErrorMessageMap, ExternalWallet, ExternalWalletMetadata, FundingMethod, FundingProvider, type GenerateAuthorizationSignatureInput, type GenerateAuthorizationSignatureOutput, type GenerateDepositAddressInput, type GetCryptoDepositAccountNextOrderInput, type GetCryptoDepositAccountNextOrderResponse, type GetCryptoDepositAccountOrderInput, type GetCryptoDepositAccountOrderResponse, type GetDepositInput, IdentifierString, InMemoryCache, type IncompleteDepositAddressOrder, InjectedWalletClientType, KERNEL, LIGHT_ACCOUNT, LocalStorage, type LogLevel, type Logger, type MfaMethod, type MfaPromise, type MfaSubmitArgs, type MfaSubmitPromise, MoonpayApiError, type MoonpayTransactionStatus, type MoonpayTransactionStatusResponse, NEXUS, type OAuthProviderID, OAuthProviderType, type OnNeedsRecovery, type ParsedSolanaOffchainMessage, PaymentOption, type PollOptions, type PollResult, type PreparedTransactionRequest, PrivyApiError, PrivyClientError, PrivyConnectorError, PrivyEmbeddedSolanaWalletProvider, PrivyEmbeddedWalletErrorCode, PrivyEmbeddedWalletProvider, type PrivyPlugin, PrivyProviderRpcError, ProviderErrors, type Quantity, type ResolveRefundAddressError, type ResolveRefundAddressResult, SAFE, SUPPORTED_CONNECTOR_TYPES, type SessionSignerInput, type SetRecoveryInput, SmartWalletType, SolanaClient, SolanaCluster, SolanaSignAndSendTransactionInput, SolanaSignAndSendTransactionMode, SolanaSignAndSendTransactionOptions, SolanaSignAndSendTransactionOutput, SolanaSignMessageInput, SolanaSignMessageOutput, SolanaSignTransactionInput, SolanaSignTransactionOptions, SolanaSignTransactionOutput, SolanaStandardWallet, SolanaTransactionCommitment, SolanaUsdcAddressMap, type Storage, THIRDWEB, type TelegramAuthInput, type TelegramAuthResult, type TelegramWebAppData, UnknownWalletClientType, type UnsignedTransactionRequest, type UnsignedTransactionRequestWithChainId, UsdcAddressMap, type WaitForCompletionInput, type WaitForDepositInput, WalletBranding, WalletClientType, WalletConnectWalletClientType, addSessionSigners, buildSolanaOffchainMessage, chainToMoonpayCurrency, cookies, countryCodesAndNumbers, create, createDataSuffixPlugin, createErrorFormatter, createSiwsMessage, index_d_exports as crossApp, index_d_exports$1 as cryptoDepositAccount, Privy as default, index_d_exports$2 as delegatedActions, index_d_exports$3 as depositAddress, deriveSolanaApplicationDomain, errorIndicatesMaxMfaRetries, errorIndicatesMfaCanceled, errorIndicatesMfaRateLimit, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, errorIndicatesRecoveryIsNeeded, formatLamportsAmount, formatPhoneNumber, formatTokenAmount, formatWalletAddress, formatWeiAmount, fundingMethodToMoonpayPaymentMethod, generateAuthorizationSignature, generateWalletIdempotencyKey, getAllUserEmbeddedBitcoinWallets, getAllUserEmbeddedEthereumWallets, getAllUserEmbeddedSolanaWallets, getCoinbaseOnRampUrl, getCountryCallingCode, getDataSuffixPlugin, getEntropyDetailsFromAccount, getEntropyDetailsFromUser, getIsTokenUsdc, getJsonRpcEndpointFromChain, getPhoneCountryCodeAndNumber, getPlaceholderPhoneNumber, getSolanaClusterDisplayName, getSolanaRpcEndpointForCluster, getSolanaUsdcMintAddressForCluster, getUserEmbeddedEthereumWallet, getUserEmbeddedSolanaWallet, getUserEmbeddedWallet, getUserSmartWallet, getWallet, getWalletAction, isEmbeddedWalletAccount, isExtensionContext, isSupportedChainIdForCoinbaseOnramp, isSupportedChainIdForMoonpay, isUnifiedWallet, lastFourDigits, listWalletActions, parseSolanaOffchainMessage, phoneNumberTypingFormatter, poll, rawSign, removeSessionSigners, rpc, shouldWriteSessionCookies, throwIfInvalidRecoveryUpgradePath, toCoinbaseAssetId, toCoinbaseBlockchainFromChainId, toE164, toObjectKeys, toWalletApiUnsignedEthTransaction, transfer, updateWallet, validatePhoneNumber };
|
|
3728
|
+
export { ALL_WALLET_CLIENT_TYPES, BICONOMY, COINBASE_SMART_WALLET, type CardsConfig, Cluster, type CoinbaseAssetId, CoinbaseWalletClientType, type CompletedDepositAddressOrder, ConnectedStandardSolanaWallet, ConnectorType, CookieWriteBehavior, type CountryCallingCode, type CountryCode, type CreateCryptoDepositAccountInput, type CreateCryptoDepositAccountResponse, type CreateSiwsMessageOpts, type CryptoDepositAccountConfig, type CryptoDepositAccountQuote, type CryptoDepositAccountQuoteInput, type CryptoDepositAddressRoute, type CryptoDepositAddressStrategy, type CryptoDepositAsset, type CryptoDepositAssetFilter, DATA_SUFFIX_PLUGIN_ID, type DataSuffixPlugin, type DepositAddressOrder, type DepositAddressPollingResult, type DepositAddressQuote, type DepositConfig, type EIP1193Provider, type EmbeddedBitcoinWalletProvider, EmbeddedProviderError, EmbeddedWalletClientType, type EmbeddedWalletConfig, type EmbeddedWalletRecoveryOptions, type EntropyIdVerifier, type ErrorMessageMap, ExternalWallet, ExternalWalletMetadata, FundingMethod, FundingProvider, type GenerateAuthorizationSignatureInput, type GenerateAuthorizationSignatureOutput, type GenerateDepositAddressInput, type GetCryptoDepositAccountNextOrderInput, type GetCryptoDepositAccountNextOrderResponse, type GetCryptoDepositAccountOrderInput, type GetCryptoDepositAccountOrderResponse, type GetDepositInput, IdentifierString, InMemoryCache, type IncompleteDepositAddressOrder, InjectedWalletClientType, KERNEL, LIGHT_ACCOUNT, LIST_CARDS_MAX_LIMIT, LocalStorage, type LogLevel, type Logger, type MfaMethod, type MfaPromise, type MfaSubmitArgs, type MfaSubmitPromise, MoonpayApiError, type MoonpayTransactionStatus, type MoonpayTransactionStatusResponse, NEXUS, type OAuthProviderID, OAuthProviderType, type OnNeedsRecovery, type ParsedSolanaOffchainMessage, PaymentOption, type PollOptions, type PollResult, type PreparedTransactionRequest, PrivyApiError, PrivyClientError, PrivyConnectorError, PrivyEmbeddedSolanaWalletProvider, PrivyEmbeddedWalletErrorCode, PrivyEmbeddedWalletProvider, type PrivyPlugin, PrivyProviderRpcError, ProviderErrors, type Quantity, type ResolveRefundAddressError, type ResolveRefundAddressResult, SAFE, SUPPORTED_CONNECTOR_TYPES, type SessionSignerInput, type SetRecoveryInput, SmartWalletType, SolanaClient, SolanaCluster, SolanaSignAndSendTransactionInput, SolanaSignAndSendTransactionMode, SolanaSignAndSendTransactionOptions, SolanaSignAndSendTransactionOutput, SolanaSignMessageInput, SolanaSignMessageOutput, SolanaSignTransactionInput, SolanaSignTransactionOptions, SolanaSignTransactionOutput, SolanaStandardWallet, SolanaTransactionCommitment, SolanaUsdcAddressMap, type Storage, THIRDWEB, type TelegramAuthInput, type TelegramAuthResult, type TelegramWebAppData, UnknownWalletClientType, type UnsignedTransactionRequest, type UnsignedTransactionRequestWithChainId, UsdcAddressMap, type WaitForCompletionInput, type WaitForDepositInput, WalletBranding, WalletClientType, WalletConnectWalletClientType, acceptCardConsents, addSessionSigners, buildSolanaOffchainMessage, chainToMoonpayCurrency, cookies, countryCodesAndNumbers, create, createCard, createDataSuffixPlugin, createErrorFormatter, createSiwsMessage, index_d_exports as crossApp, index_d_exports$1 as cryptoDepositAccount, Privy as default, index_d_exports$2 as delegatedActions, index_d_exports$3 as depositAddress, deriveSolanaApplicationDomain, downloadCardStatement, errorIndicatesMaxMfaRetries, errorIndicatesMfaCanceled, errorIndicatesMfaRateLimit, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, errorIndicatesRecoveryIsNeeded, formatLamportsAmount, formatPhoneNumber, formatTokenAmount, formatWalletAddress, formatWeiAmount, fundingMethodToMoonpayPaymentMethod, generateAuthorizationSignature, generateWalletIdempotencyKey, getAllUserEmbeddedBitcoinWallets, getAllUserEmbeddedEthereumWallets, getAllUserEmbeddedSolanaWallets, getCardById, getCardCustomer, getCardEphemeralKey, getCardsConfig, getCoinbaseOnRampUrl, getCountryCallingCode, getDataSuffixPlugin, getEntropyDetailsFromAccount, getEntropyDetailsFromUser, getFiatOnrampProviderBrand, getFiatOnrampProviderId, getIsTokenUsdc, getJsonRpcEndpointFromChain, getOrCreateCardCustomer, getPhoneCountryCodeAndNumber, getPlaceholderPhoneNumber, getSolanaClusterDisplayName, getSolanaRpcEndpointForCluster, getSolanaUsdcMintAddressForCluster, getUserEmbeddedEthereumWallet, getUserEmbeddedSolanaWallet, getUserEmbeddedWallet, getUserSmartWallet, getWallet, getWalletAction, isEmbeddedWalletAccount, isExtensionContext, isSupportedChainIdForCoinbaseOnramp, isSupportedChainIdForMoonpay, isUnifiedWallet, lastFourDigits, listCardTransactions, listCards, listWalletActions, parseSolanaOffchainMessage, phoneNumberTypingFormatter, poll, rawSign, removeSessionSigners, replaceCard, rpc, shouldWriteSessionCookies, throwIfInvalidRecoveryUpgradePath, toCoinbaseAssetId, toCoinbaseBlockchainFromChainId, toE164, toObjectKeys, toWalletApiUnsignedEthTransaction, transfer, updateCardPin, updateCardStatus, updateWallet, validatePhoneNumber };
|