Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@privy-io/js-sdk-core

Package Overview
Dependencies
Maintainers
7
Versions
746
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@privy-io/js-sdk-core - npm Package Compare versions

Comparing version 0.28.9-beta-20241010170842 to 0.29.0-beta-20241011134409

dist/dts/utils/getAllUserEmbeddedSolanaWallets.d.mts

4

dist/dts/EmailApi.d.ts

@@ -135,5 +135,7 @@ export default class EmailApi {

chain_type: "solana";
wallet_client: "privy";
wallet_client_type: "privy";
connector_type: "embedded";
imported: boolean;
wallet_index: number;
recovery_method: "privy";

@@ -350,5 +352,7 @@ } | {

chain_type: "solana";
wallet_client: "privy";
wallet_client_type: "privy";
connector_type: "embedded";
imported: boolean;
wallet_index: number;
recovery_method: "privy";

@@ -355,0 +359,0 @@ } | {

@@ -5,8 +5,22 @@ type RequestArguments = {

};
/**
* Privy embedded wallet provider for Solana accounts.
*
* Currently only supports signing messages.
*/
export declare class EmbeddedSolanaWalletProvider {
_publicKey: string;
/**
* Legacy API for reading the public key for this provider.
*
* @deprecated
*/
readonly _publicKey: string;
request(request: RequestArguments): Promise<{
signature: string;
}>;
/**
* Pretty log output for when an instance of this class is `console.log`'d
*/
toJSON(): string;
}
export {};

3

dist/dts/embedded/EventCallbackQueue.d.ts

@@ -1,2 +0,2 @@

import type { PrivyResponseCallbacksType, IframeReadyResponseCallbacksType, WalletCreateResponseCallbacksType, WalletConnectResponseCallbacksType, WalletRecoverResponseCallbacksType, WalletRpcResponseCallbacksType, WalletSetRecoveryResponseCallbacksType, SolanaWalletCreateResponseCallbacksType, SolanaWalletConnectResponseCallbacksType, SolanaWalletRecoverResponseCallbacksType, SolanaWalletRpcResponseCallbacksType } from './types';
import type { PrivyResponseCallbacksType, IframeReadyResponseCallbacksType, WalletCreateResponseCallbacksType, WalletConnectResponseCallbacksType, WalletRecoverResponseCallbacksType, WalletRpcResponseCallbacksType, WalletSetRecoveryResponseCallbacksType, SolanaWalletCreateResponseCallbacksType, SolanaWalletConnectResponseCallbacksType, SolanaWalletRecoverResponseCallbacksType, SolanaWalletRpcResponseCallbacksType, SolanaWalletCreateAdditionalResponseCallbacksType } from './types';
/**

@@ -23,2 +23,3 @@ * This class helps keep track of callbacks that are created when sending

dequeue(event: 'privy:solana-wallet:create', eventId: string): SolanaWalletCreateResponseCallbacksType;
dequeue(event: 'privy:solana-wallet:create-additional', eventId: string): SolanaWalletCreateAdditionalResponseCallbacksType;
dequeue(event: 'privy:solana-wallet:connect', eventId: string): SolanaWalletConnectResponseCallbacksType;

@@ -25,0 +26,0 @@ dequeue(event: 'privy:solana-wallet:recover', eventId: string): SolanaWalletRecoverResponseCallbacksType;

@@ -145,3 +145,3 @@ /**

}
export type PrivyEventType = 'privy:iframe:ready' | 'privy:wallet:create' | 'privy:wallet:connect' | 'privy:wallet:recover' | 'privy:wallet:rpc' | 'privy:wallet:set-recovery' | 'privy:solana-wallet:create' | 'privy:solana-wallet:connect' | 'privy:solana-wallet:recover' | 'privy:solana-wallet:rpc';
export type PrivyEventType = 'privy:iframe:ready' | 'privy:wallet:create' | 'privy:wallet:connect' | 'privy:wallet:recover' | 'privy:wallet:rpc' | 'privy:wallet:set-recovery' | 'privy:solana-wallet:create' | 'privy:solana-wallet:create-additional' | 'privy:solana-wallet:connect' | 'privy:solana-wallet:recover' | 'privy:solana-wallet:rpc';
export type IEmbeddedWalletRecoveryOptions = 'privy' | 'user-passcode' | 'google-drive' | 'icloud' | 'icloud-native';

@@ -215,2 +215,15 @@ export type IUserRecoveryMethod = 'user-passcode' | 'google-drive' | 'icloud' | 'icloud-native';

};
export type SolanaWalletCreateAdditionalRequestDataType = {
accessToken: string;
/**
* The address/public key of the solana HD wallet at index 0
*/
primaryPublicKey: string;
/**
* The HD node index at which to create a wallet.
*
* Must be >= 1 AND equal to the next index in the sequence.j
*/
hdWalletIndex: number;
};
export type SolanaWalletConnectRequestDataType = {

@@ -227,5 +240,6 @@ accessToken: string;

publicKey: string;
hdWalletIndex: number;
request: SolanaRpcRequestType;
};
export type PrivyRequestDataType = IframeReadyRequestDataType | EthereumWalletCreateRequestDataType | WalletConnectRequestDataType | WalletRecoverRequestDataType | WalletRpcRequestDataType | SolanaWalletCreateRequestDataType | SolanaWalletRecoverRequestDataType | SolanaWalletConnectRequestDataType | SolanaWalletRpcRequestDataType;
export type PrivyRequestDataType = IframeReadyRequestDataType | EthereumWalletCreateRequestDataType | WalletConnectRequestDataType | WalletRecoverRequestDataType | WalletRpcRequestDataType | SolanaWalletCreateRequestDataType | SolanaWalletCreateAdditionalRequestDataType | SolanaWalletRecoverRequestDataType | SolanaWalletConnectRequestDataType | SolanaWalletRpcRequestDataType;
export type PrivyErrorResponseDataType = {

@@ -254,2 +268,5 @@ error: Error;

};
export type SolanaWalletCreateAdditionalResponseDataType = {
publicKey: string;
};
export type SolanaWalletConnectResponseDataType = {

@@ -309,2 +326,6 @@ publicKey: string;

}
interface SolanaWalletCreateAdditionalResponseEventType extends PrivyResponseBaseEventType {
event: 'privy:solana-wallet:create-additional';
data: SolanaWalletCreateAdditionalResponseDataType;
}
interface SolanaWalletConnectResponseEventType extends PrivyResponseBaseEventType {

@@ -322,3 +343,3 @@ event: 'privy:solana-wallet:connect';

}
export type PrivyResponseEvent = IframeReadyResponseEventType | PrivyErrorResponseEventType | WalletCreateResponseEventType | WalletConnectResponseEventType | WalletRecoverResponseEventType | WalletSetRecoveryResponseEventType | WalletRpcResponseEventType | SolanaWalletCreateResponseEventType | SolanaWalletConnectResponseEventType | SolanaWalletRecoverResponseEventType | SolanaWalletRpcResponseEventType;
export type PrivyResponseEvent = IframeReadyResponseEventType | PrivyErrorResponseEventType | WalletCreateResponseEventType | WalletConnectResponseEventType | WalletRecoverResponseEventType | WalletSetRecoveryResponseEventType | WalletRpcResponseEventType | SolanaWalletCreateResponseEventType | SolanaWalletCreateAdditionalResponseEventType | SolanaWalletConnectResponseEventType | SolanaWalletRecoverResponseEventType | SolanaWalletRpcResponseEventType;
export type IframeReadyResponseCallbacksType = {

@@ -352,2 +373,6 @@ reject: (error: Error) => void;

};
export type SolanaWalletCreateAdditionalResponseCallbacksType = {
reject: (error: Error) => void;
resolve: (res: SolanaWalletCreateAdditionalResponseDataType) => void;
};
export type SolanaWalletConnectResponseCallbacksType = {

@@ -365,13 +390,3 @@ reject: (error: Error) => void;

};
export type PrivyResponseCallbacksType = IframeReadyResponseCallbacksType | WalletCreateResponseCallbacksType | WalletConnectResponseCallbacksType | WalletRecoverResponseCallbacksType | WalletSetRecoveryResponseCallbacksType | WalletRpcResponseCallbacksType | SolanaWalletCreateResponseCallbacksType | SolanaWalletConnectResponseCallbacksType | SolanaWalletRecoverResponseCallbacksType | SolanaWalletRpcResponseCallbacksType;
export interface EmbeddedWalletProxy {
create: (data: EthereumWalletCreateRequestDataType) => Promise<WalletCreateResponseDataType>;
connect: (data: WalletConnectRequestDataType) => Promise<WalletConnectResponseDataType>;
recover: (data: WalletRecoverRequestDataType) => Promise<WalletRecoverResponseDataType>;
rpc: (data: WalletRpcRequestDataType) => Promise<WalletRpcResponseDataType>;
createSolana: (data: EthereumWalletCreateRequestDataType) => Promise<SolanaWalletCreateResponseDataType>;
connectSolana: (data: WalletConnectRequestDataType) => Promise<SolanaWalletConnectResponseDataType>;
recoverSolana: (data: WalletRecoverRequestDataType) => Promise<SolanaWalletRecoverResponseDataType>;
rpcSolana: (data: WalletRpcRequestDataType) => Promise<SolanaWalletRpcResponseDataType>;
}
export type PrivyResponseCallbacksType = IframeReadyResponseCallbacksType | WalletCreateResponseCallbacksType | WalletConnectResponseCallbacksType | WalletRecoverResponseCallbacksType | WalletSetRecoveryResponseCallbacksType | WalletRpcResponseCallbacksType | SolanaWalletCreateResponseCallbacksType | SolanaWalletCreateAdditionalResponseCallbacksType | SolanaWalletConnectResponseCallbacksType | SolanaWalletRecoverResponseCallbacksType | SolanaWalletRpcResponseCallbacksType;
export type EmbeddedWalletMessagePoster = {

@@ -378,0 +393,0 @@ postMessage: (message: any, targetOrigin: string, transfer?: Transferable) => void;

@@ -38,3 +38,22 @@ import type { PrivyEthereumEmbeddedWalletAccount, PrivySolanaEmbeddedWalletAccount, PrivyUser } from '@privy-io/public-api/schemas';

*/
createSolana(opts?: CreateSolanaOpts): Promise<EmbeddedSolanaWalletProvider>;
createSolana(opts?: CreateSolanaOpts): Promise<{
user: PrivyUser;
provider: EmbeddedSolanaWalletProvider;
}>;
/**
* Creates an additional embedded Solana wallet at the specified HD index.
*
* @param o
* @param o.primaryWalletAddress The address of this wallet at index 0
* @param o.hdWalletIndex The index at which to derive a new account
*
* @returns A provider that can be used to sign messages with the embedded wallet.
*/
createAdditionalSolana({ primaryPublicKey, hdWalletIndex, }: {
primaryPublicKey: string;
hdWalletIndex: number;
}): Promise<{
user: PrivyUser;
provider: EmbeddedSolanaWalletProvider;
}>;
hasEmbeddedWallet(): Promise<boolean>;

@@ -56,3 +75,3 @@ isPasswordRequired(): Promise<boolean>;

*/
getSolanaProvider(wallet: PrivySolanaEmbeddedWalletAccount): Promise<EmbeddedSolanaWalletProvider>;
getSolanaProvider(account: PrivySolanaEmbeddedWalletAccount, primaryPublicKey?: string): Promise<EmbeddedSolanaWalletProvider>;
/**

@@ -110,4 +129,4 @@ * @deprecated Use `setRecovery` instead.

*/
_loadSolana(wallet: PrivySolanaEmbeddedWalletAccount): Promise<string>;
_loadSolana(wallet: PrivySolanaEmbeddedWalletAccount, primaryPublicKey: string): Promise<string>;
}
export {};

@@ -146,5 +146,7 @@ export default class FarcasterApi {

chain_type: "solana";
wallet_client: "privy";
wallet_client_type: "privy";
connector_type: "embedded";
imported: boolean;
wallet_index: number;
recovery_method: "privy";

@@ -366,5 +368,7 @@ } | {

chain_type: "solana";
wallet_client: "privy";
wallet_client_type: "privy";
connector_type: "embedded";
imported: boolean;
wallet_index: number;
recovery_method: "privy";

@@ -371,0 +375,0 @@ } | {

@@ -10,2 +10,3 @@ import Privy from './Privy';

export { getUserEmbeddedWallet } from './utils/getUserEmbeddedWallet';
export { getAllUserEmbeddedSolanaWallets } from './utils/getAllUserEmbeddedSolanaWallets';
export { type CountryCode, countryCodesAndNumbers, formatPhoneNumber, getCountryCallingCode, getPhoneCountryCodeAndNumber, getPlaceholderPhoneNumber, lastFourDigits, phoneNumberTypingFormatter, validatePhoneNumber, } from './utils/phoneNumberUtils';

@@ -12,0 +13,0 @@ export { getUserEmbeddedSolanaWallet } from './utils/getUserEmbeddedSolanaWallet';

@@ -139,5 +139,7 @@ import type { OAuthProviderType } from '@privy-io/public-api';

chain_type: "solana";
wallet_client: "privy";
wallet_client_type: "privy";
connector_type: "embedded";
imported: boolean;
wallet_index: number;
recovery_method: "privy";

@@ -360,5 +362,7 @@ } | {

chain_type: "solana";
wallet_client: "privy";
wallet_client_type: "privy";
connector_type: "embedded";
imported: boolean;
wallet_index: number;
recovery_method: "privy";

@@ -365,0 +369,0 @@ } | {

@@ -135,5 +135,7 @@ export default class PhoneApi {

chain_type: "solana";
wallet_client: "privy";
wallet_client_type: "privy";
connector_type: "embedded";
imported: boolean;
wallet_index: number;
recovery_method: "privy";

@@ -350,5 +352,7 @@ } | {

chain_type: "solana";
wallet_client: "privy";
wallet_client_type: "privy";
connector_type: "embedded";
imported: boolean;
wallet_index: number;
recovery_method: "privy";

@@ -355,0 +359,0 @@ } | {

@@ -118,5 +118,7 @@ export default class UserApi {

chain_type: "solana";
wallet_client: "privy";
wallet_client_type: "privy";
connector_type: "embedded";
imported: boolean;
wallet_index: number;
recovery_method: "privy";

@@ -123,0 +125,0 @@ } | {

import type { PrivyUser, PrivySolanaEmbeddedWalletAccount } from '@privy-io/public-api';
/**
* @description Finds the embedded Solana wallet account (if it exists) for a given user.
* @description Finds the primary (HD index = 0) embedded Solana wallet account for a given user.
*
* @param user A privy user object
*
* @returns The user's embedded wallet account
* @returns The user's primary embedded Solana wallet account
*

@@ -9,0 +9,0 @@ * @example

{
"name": "@privy-io/js-sdk-core",
"version": "0.28.9-beta-20241010170842",
"version": "0.29.0-beta-20241011134409",
"description": "Vanilla JS client for the Privy Auth API",

@@ -60,4 +60,4 @@ "keywords": [

"@ethersproject/units": "^5.7.0",
"@privy-io/api-base": "^1.3.1",
"@privy-io/public-api": "2.10.5",
"@privy-io/api-base": "1.3.2-beta-20241011134409",
"@privy-io/public-api": "2.11.0-beta-20241011134409",
"eventemitter3": "^5.0.1",

@@ -64,0 +64,0 @@ "fetch-retry": "^5.0.6",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc