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
8
Versions
725
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.0.1 to 0.1.1-beta-20230925224215

dist/esm/index.js.map

223

dist/index.d.ts

@@ -1,5 +0,10 @@

import { InferRouteTypes } from '@privy-io/api-base';
import { refreshSession } from '@privy-io/core-api';
import EventEmitter from 'eventemitter3';
import EventEmitter from "eventemitter3";
import { InferRouteTypes } from "@privy-io/api-base";
import { refreshSession } from "@privy-io/public-api";
interface Storage {
get(key: string): unknown;
put(key: string, value: unknown): void;
del(key: string): void;
getKeys(): string[];
}
declare class CustomProvider {

@@ -29,4 +34,4 @@ #private;

address: string;
verified_at: number;
chain_type: "ethereum";
verified_at: number;
wallet_client: "unknown";

@@ -39,5 +44,5 @@ chain_id?: string | undefined;

address: string;
chain_type: "ethereum";
verified_at: number;
chain_id: "eip155:1";
chain_type: "ethereum";
wallet_client: "privy";

@@ -57,4 +62,4 @@ wallet_client_type: "privy";

subject: string;
verified_at: number;
username: string | null;
verified_at: number;
} | {

@@ -64,4 +69,4 @@ type: "discord_oauth";

subject: string;
verified_at: number;
username: string | null;
verified_at: number;
} | {

@@ -72,4 +77,4 @@ type: "github_oauth";

subject: string;
verified_at: number;
username: string | null;
verified_at: number;
} | {

@@ -82,4 +87,4 @@ type: "apple_oauth";

type: "custom_auth";
verified_at: number;
custom_user_id: string;
verified_at: number;
})[];

@@ -90,113 +95,6 @@ };

}
/**
* We support a subset of the provider methods found here:
*
* https://ethereum.org/en/developers/docs/apis/json-rpc/#json-rpc-methods
*
* For now, we're focused on signing-related methods because the iframe (this code)
* is the only place that has access to the private key and thus is the only one
* who can create signatures. All other methods do not need the private key and
* can therefore be implemented by clients of the iframe.
*/
type Quantity = string | number | bigint;
type UnsignedTransactionRequest = {
from?: string;
to?: string;
nonce?: Quantity;
gasLimit?: Quantity;
gasPrice?: Quantity;
data?: ArrayLike<number> | string;
value?: Quantity;
chainId?: number;
type?: number;
accessList?: Array<{
address: string;
storageKeys: Array<string>;
}> | Array<[string, Array<string>]> | Record<string, Array<string>>;
maxPriorityFeePerGas?: Quantity;
maxFeePerGas?: Quantity;
};
interface eth_populateTransactionRequestResponse {
method: 'eth_populateTransactionRequest';
data: UnsignedTransactionRequest;
}
interface eth_signResponse {
method: 'eth_sign';
data: string;
}
interface personal_signResponse {
method: 'personal_sign';
data: string;
}
interface eth_signTransactionResponse {
method: 'eth_signTransaction';
data: string;
}
interface eth_signTypedData_v4Response {
method: 'eth_signTypedData_v4';
data: string;
}
type RpcResponseType = eth_signTransactionResponse | eth_populateTransactionRequestResponse | eth_signResponse | personal_signResponse | eth_signTypedData_v4Response;
type PrivyEventType = 'privy:iframe:ready' | 'privy:wallet:create' | 'privy:wallet:connect' | 'privy:wallet:recover' | 'privy:wallet:rpc' | 'privy:wallet:set-recovery-password';
type IframeReadyResponseDataType = Record<string, never>;
type WalletCreateResponseDataType = {
address: string;
};
type WalletConnectResponseDataType = {
address: string;
};
type WalletRecoverResponseDataType = {
address: string;
};
type WalletSetRecoveryPasswordResponseDataType = {
address: string;
};
type WalletRpcResponseDataType = {
address: string;
response: RpcResponseType;
};
declare const PrivyIframeErrorTypes: readonly ["error", "invalid_request_arguments", "wallet_not_on_device", "invalid_recovery_pin", "insufficient_funds"];
type PrivyIframeErrorTypesType = (typeof PrivyIframeErrorTypes)[number];
interface PrivyResponseBaseEventType {
id: string;
event: PrivyEventType;
}
interface PrivyErrorResponseEventType extends PrivyResponseBaseEventType {
error: {
type: PrivyIframeErrorTypesType;
message: string;
};
}
interface IframeReadyResponseEventType extends PrivyResponseBaseEventType {
event: 'privy:iframe:ready';
data: IframeReadyResponseDataType;
}
interface WalletCreateResponseEventType extends PrivyResponseBaseEventType {
event: 'privy:wallet:create';
data: WalletCreateResponseDataType;
}
interface WalletConnectResponseEventType extends PrivyResponseBaseEventType {
event: 'privy:wallet:connect';
data: WalletConnectResponseDataType;
}
interface WalletRecoverResponseEventType extends PrivyResponseBaseEventType {
event: 'privy:wallet:recover';
data: WalletRecoverResponseDataType;
}
interface WalletSetRecoveryPasswordResponseEventType extends PrivyResponseBaseEventType {
event: 'privy:wallet:set-recovery-password';
data: WalletSetRecoveryPasswordResponseDataType;
}
interface WalletRpcResponseEventType extends PrivyResponseBaseEventType {
event: 'privy:wallet:rpc';
data: WalletRpcResponseDataType;
}
type PrivyResponseEvent = IframeReadyResponseEventType | PrivyErrorResponseEventType | WalletCreateResponseEventType | WalletConnectResponseEventType | WalletRecoverResponseEventType | WalletSetRecoveryPasswordResponseEventType | WalletRpcResponseEventType;
type EmbeddedWalletMessagePoster = {
postMessage: (message: any, targetOrigin: string, transfer?: Transferable) => void;
};
declare enum PrivyErrorCode {
enum PrivyErrorCode {
MISSING_OR_INVALID_PRIVY_APP_ID = "missing_or_invalid_privy_app_id",

@@ -248,3 +146,2 @@ MISSING_OR_INVALID_PRIVY_ACCOUNT_ID = "missing_or_invalid_privy_account_id",

}
type ProviderConnectInfo = {

@@ -278,14 +175,7 @@ chainId: string;

request(request: RequestArguments): Promise<any>;
private handleStatic;
private handleEstimateGas;
private handleSwitchEthereumChain;
private handleIFrameRpc;
private handleJsonRpc;
}
type AuthenticatedUser = InferRouteTypes<typeof refreshSession>['expectedResponse'];
type User$1 = NonNullable<AuthenticatedUser['user']>;
type LinkedAccount = User$1['linked_accounts'];
type PrivyEmbeddedWalletProvider = EmbeddedWalletProvider;
export type AuthenticatedUser = InferRouteTypes<typeof refreshSession>['expectedResponse'];
export type User = NonNullable<AuthenticatedUser['user']>;
export type LinkedAccount = User['linked_accounts'];
export type PrivyEmbeddedWalletProvider = EmbeddedWalletProvider;
declare class Email {

@@ -329,4 +219,4 @@ #private;

address: string;
verified_at: number;
chain_type: "ethereum";
verified_at: number;
wallet_client: "unknown";

@@ -339,5 +229,5 @@ chain_id?: string | undefined;

address: string;
chain_type: "ethereum";
verified_at: number;
chain_id: "eip155:1";
chain_type: "ethereum";
wallet_client: "privy";

@@ -357,4 +247,4 @@ wallet_client_type: "privy";

subject: string;
verified_at: number;
username: string | null;
verified_at: number;
} | {

@@ -364,4 +254,4 @@ type: "discord_oauth";

subject: string;
verified_at: number;
username: string | null;
verified_at: number;
} | {

@@ -372,4 +262,4 @@ type: "github_oauth";

subject: string;
verified_at: number;
username: string | null;
verified_at: number;
} | {

@@ -382,4 +272,4 @@ type: "apple_oauth";

type: "custom_auth";
verified_at: number;
custom_user_id: string;
verified_at: number;
})[];

@@ -401,4 +291,4 @@ }>;

address: string;
verified_at: number;
chain_type: "ethereum";
verified_at: number;
wallet_client: "unknown";

@@ -411,5 +301,5 @@ chain_id?: string | undefined;

address: string;
chain_type: "ethereum";
verified_at: number;
chain_id: "eip155:1";
chain_type: "ethereum";
wallet_client: "privy";

@@ -429,4 +319,4 @@ wallet_client_type: "privy";

subject: string;
verified_at: number;
username: string | null;
verified_at: number;
} | {

@@ -436,4 +326,4 @@ type: "discord_oauth";

subject: string;
verified_at: number;
username: string | null;
verified_at: number;
} | {

@@ -444,4 +334,4 @@ type: "github_oauth";

subject: string;
verified_at: number;
username: string | null;
verified_at: number;
} | {

@@ -454,8 +344,7 @@ type: "apple_oauth";

type: "custom_auth";
verified_at: number;
custom_user_id: string;
verified_at: number;
})[];
}>;
}
declare class Phone {

@@ -499,4 +388,4 @@ #private;

address: string;
verified_at: number;
chain_type: "ethereum";
verified_at: number;
wallet_client: "unknown";

@@ -509,5 +398,5 @@ chain_id?: string | undefined;

address: string;
chain_type: "ethereum";
verified_at: number;
chain_id: "eip155:1";
chain_type: "ethereum";
wallet_client: "privy";

@@ -527,4 +416,4 @@ wallet_client_type: "privy";

subject: string;
verified_at: number;
username: string | null;
verified_at: number;
} | {

@@ -534,4 +423,4 @@ type: "discord_oauth";

subject: string;
verified_at: number;
username: string | null;
verified_at: number;
} | {

@@ -542,4 +431,4 @@ type: "github_oauth";

subject: string;
verified_at: number;
username: string | null;
verified_at: number;
} | {

@@ -552,4 +441,4 @@ type: "apple_oauth";

type: "custom_auth";
verified_at: number;
custom_user_id: string;
verified_at: number;
})[];

@@ -571,4 +460,4 @@ }>;

address: string;
verified_at: number;
chain_type: "ethereum";
verified_at: number;
wallet_client: "unknown";

@@ -581,5 +470,5 @@ chain_id?: string | undefined;

address: string;
chain_type: "ethereum";
verified_at: number;
chain_id: "eip155:1";
chain_type: "ethereum";
wallet_client: "privy";

@@ -599,4 +488,4 @@ wallet_client_type: "privy";

subject: string;
verified_at: number;
username: string | null;
verified_at: number;
} | {

@@ -606,4 +495,4 @@ type: "discord_oauth";

subject: string;
verified_at: number;
username: string | null;
verified_at: number;
} | {

@@ -614,4 +503,4 @@ type: "github_oauth";

subject: string;
verified_at: number;
username: string | null;
verified_at: number;
} | {

@@ -624,8 +513,7 @@ type: "apple_oauth";

type: "custom_auth";
verified_at: number;
custom_user_id: string;
verified_at: number;
})[];
}>;
}
declare class Auth {

@@ -650,3 +538,2 @@ #private;

}
declare class EmbeddedWallet {

@@ -690,6 +577,5 @@ #private;

*/
getMessageHandler(): (event: PrivyResponseEvent) => void;
getMessageHandler(): (event: import("src/embedded/types").PrivyResponseEvent) => void;
}
declare class User {
declare class _User1 {
#private;

@@ -701,10 +587,2 @@ /**

}
interface Storage {
get(key: string): unknown;
put(key: string, value: unknown): void;
del(key: string): void;
getKeys(): string[];
}
/**

@@ -743,4 +621,3 @@ * `PrivyOptions` to setup the `Privy` SDK

}
declare class LocalStorage implements Storage {
export class LocalStorage implements Storage {
get(key: string): any;

@@ -751,4 +628,3 @@ put(key: string, val: unknown): void;

}
declare class InMemoryCache implements Storage {
export class InMemoryCache implements Storage {
_cache: {

@@ -762,3 +638,4 @@ [key: string]: unknown;

}
export default Privy;
export { AuthenticatedUser, InMemoryCache, LinkedAccount, LocalStorage, PrivyEmbeddedWalletProvider, User$1 as User, Privy as default };
//# sourceMappingURL=index.d.ts.map
{
"name": "@privy-io/js-sdk-core",
"version": "0.0.1",
"version": "0.1.1-beta-20230925224215",
"description": "Vanilla JS client for the Privy Auth API",

@@ -15,2 +15,3 @@ "keywords": [

"license": "Apache-2.0",
"source": "./src/index.ts",
"main": "./dist/index.js",

@@ -27,2 +28,10 @@ "module": "./dist/esm/index.js",

},
"targets": {
"main": {
"isLibrary": true
},
"module": {
"isLibrary": true
}
},
"files": [

@@ -34,7 +43,6 @@ "dist/**/*",

"scripts": {
"build": "npx tsup --clean --minify",
"generate-types": "npx tsup --dts-only",
"build": "npx parcel build",
"clean": "rm -rf dist",
"prepublishOnly": "npm run clean && npm run build",
"dev": "npx tsup --watch",
"dev": "npx parcel watch",
"test": "jest --testMatch \"**/test/unit/**/*.test.ts\"",

@@ -50,7 +58,7 @@ "test:ci": "npm run test",

"@types/text-encoding": "^0.0.37",
"tsup": "^6.2.3"
"parcel": "^2.9.3"
},
"dependencies": {
"@ethersproject/providers": "^5.7.2",
"@privy-io/core-api": "*",
"@privy-io/public-api": "1.0.1-beta-20230925224215",
"eventemitter3": "^5.0.1",

@@ -57,0 +65,0 @@ "fetch-retry": "^5.0.6",

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

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

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