@privy-io/js-sdk-core 0.76.2 → 0.78.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/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/dts/index.d.mts +46 -9
- package/dist/dts/index.d.ts +46 -9
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/index.mjs.map +1 -1
- package/package.json +11 -9
package/dist/dts/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AuthenticatedUser, CoinbaseOnRampInitInput, CoinbaseOnRampInitResponse, 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, 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";
|
|
2
2
|
import { Chain, RpcConfig } from "@privy-io/chains";
|
|
3
|
-
import {
|
|
3
|
+
import { Route } from "@privy-io/routes";
|
|
4
4
|
import "@metamask/eth-sig-util";
|
|
5
5
|
import "viem/account-abstraction";
|
|
6
6
|
import { StrictUnsignedTempoTransactionRequest, StrictUnsignedTransactionRequest } from "@privy-io/ethereum";
|
|
@@ -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 {
|
|
@@ -3086,7 +3122,8 @@ declare namespace index_d_exports$3 {
|
|
|
3086
3122
|
declare function getConfig(privy: Privy): Promise<DepositConfig>;
|
|
3087
3123
|
//#endregion
|
|
3088
3124
|
//#region src/action/cryptoDepositAccount/types.d.ts
|
|
3089
|
-
type
|
|
3125
|
+
type CryptoDepositAccountConfig = CryptoDepositAccountConfigResponse;
|
|
3126
|
+
type CryptoDepositAccountQuote = DepositAccountCryptoQuoteResponse;
|
|
3090
3127
|
type CreateCryptoDepositAccountWithConfigInput = {
|
|
3091
3128
|
walletId: string;
|
|
3092
3129
|
type: 'deposit_config';
|
|
@@ -3520,4 +3557,4 @@ declare const THIRDWEB: "thirdweb";
|
|
|
3520
3557
|
/** @deprecated {@link SmartWalletType} is a well-typed union, use the `'nexus'` literal instead */
|
|
3521
3558
|
declare const NEXUS: "nexus";
|
|
3522
3559
|
//#endregion
|
|
3523
|
-
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 };
|
|
3560
|
+
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, getFiatOnrampProviderBrand, getFiatOnrampProviderId, 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 };
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AuthenticatedUser, CoinbaseOnRampInitInput, CoinbaseOnRampInitResponse, 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, 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";
|
|
2
2
|
import { Chain, RpcConfig } from "@privy-io/chains";
|
|
3
|
-
import {
|
|
3
|
+
import { Route } from "@privy-io/routes";
|
|
4
4
|
import "@metamask/eth-sig-util";
|
|
5
5
|
import "viem/account-abstraction";
|
|
6
6
|
import { StrictUnsignedTempoTransactionRequest, StrictUnsignedTransactionRequest } from "@privy-io/ethereum";
|
|
@@ -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 {
|
|
@@ -3086,7 +3122,8 @@ declare namespace index_d_exports$3 {
|
|
|
3086
3122
|
declare function getConfig(privy: Privy): Promise<DepositConfig>;
|
|
3087
3123
|
//#endregion
|
|
3088
3124
|
//#region src/action/cryptoDepositAccount/types.d.ts
|
|
3089
|
-
type
|
|
3125
|
+
type CryptoDepositAccountConfig = CryptoDepositAccountConfigResponse;
|
|
3126
|
+
type CryptoDepositAccountQuote = DepositAccountCryptoQuoteResponse;
|
|
3090
3127
|
type CreateCryptoDepositAccountWithConfigInput = {
|
|
3091
3128
|
walletId: string;
|
|
3092
3129
|
type: 'deposit_config';
|
|
@@ -3520,4 +3557,4 @@ declare const THIRDWEB: "thirdweb";
|
|
|
3520
3557
|
/** @deprecated {@link SmartWalletType} is a well-typed union, use the `'nexus'` literal instead */
|
|
3521
3558
|
declare const NEXUS: "nexus";
|
|
3522
3559
|
//#endregion
|
|
3523
|
-
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 };
|
|
3560
|
+
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, getFiatOnrampProviderBrand, getFiatOnrampProviderId, 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 };
|