Socket
Socket
Sign inDemoInstall

@toruslabs/base-controllers

Package Overview
Dependencies
Maintainers
4
Versions
146
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@toruslabs/base-controllers - npm Package Compare versions

Comparing version 4.10.1 to 4.11.0

1

dist/types/Embed/IEmbedController.d.ts

@@ -25,2 +25,3 @@ import type { JRPCEngineEndCallback, JRPCEngineNextCallback, JRPCRequest, JRPCResponse } from "@toruslabs/openlogin-jrpc";

};
web3AuthClientId?: string;
}

@@ -27,0 +28,0 @@ export interface STATUS_NOTIFICATION_DATA {

3

dist/types/Preferences/BasePreferencesController.d.ts

@@ -58,2 +58,3 @@ import BaseController from "../BaseController";

idToken?: string;
web3AuthClientId?: string;
}): Promise<void>;

@@ -91,3 +92,3 @@ setCrashReport(isEnabled: boolean): Promise<boolean>;

getDappList(): Promise<DiscoverDapp[]>;
protected init(address: string, userInfo: UserInfo, jwtToken?: string, metadata?: Record<string, unknown>, type?: ACCOUNT_TYPE): Promise<void>;
protected init(address: string, userInfo: UserInfo, jwtToken?: string, metadata?: Record<string, unknown>, type?: ACCOUNT_TYPE, generateNewToken?: boolean): Promise<void>;
protected updateState(preferences?: Partial<P>, address?: string): P;

@@ -94,0 +95,0 @@ protected headers(address?: string): {

@@ -68,2 +68,3 @@ import { BaseConfig, BaseState, IController, UserInfo } from "../interfaces";

idToken?: string;
web3auth_client_id?: string;
}

@@ -70,0 +71,0 @@ export interface UserPayload {

{
"name": "@toruslabs/base-controllers",
"version": "4.10.1",
"version": "4.11.0",
"homepage": "https://github.com/torusresearch/controllers#readme",

@@ -25,3 +25,3 @@ "license": "ISC",

"@toruslabs/broadcast-channel": "^9.0.1",
"@toruslabs/http-helpers": "^5.0.0",
"@toruslabs/http-helpers": "^6.0.0",
"@toruslabs/openlogin-jrpc": "^6.1.0",

@@ -66,3 +66,3 @@ "async-mutex": "^0.4.0",

},
"gitHead": "eedc319d29c069f37fce6f52065502b72f37a8c4"
"gitHead": "ece0fb5e61005a05f63eb85dd6a76a0c6e108089"
}

@@ -25,2 +25,3 @@ import type { JRPCEngineEndCallback, JRPCEngineNextCallback, JRPCRequest, JRPCResponse } from "@toruslabs/openlogin-jrpc";

};
web3AuthClientId?: string;
}

@@ -27,0 +28,0 @@

@@ -174,4 +174,5 @@ import { get, patch, post, remove } from "@toruslabs/http-helpers";

idToken?: string;
web3AuthClientId?: string;
}): Promise<void> {
const { verifierId, verifier, options, address, idToken } = params;
const { verifierId, verifier, options, address, idToken, web3AuthClientId } = params;
if (!options.rehydrate) {

@@ -190,2 +191,3 @@ const browser = bowser.getParser(window.navigator.userAgent);

idToken,
web3auth_client_id: web3AuthClientId,
};

@@ -391,10 +393,14 @@ await post<{ success: boolean }>(`${this.config.api}/user/recordLogin`, recordLoginPayload, this.headers(address), { useAPIKey: true });

metadata: Record<string, unknown> = {},
type?: ACCOUNT_TYPE
type?: ACCOUNT_TYPE,
generateNewToken?: boolean // generate new token that includes more information e.g. AA address
): Promise<void> {
let response = { token: jwtToken };
if (this.getAddressState(address)) return;
if (!jwtToken) {
const messageToSign = await this.getMessageForSigning(address);
if (!messageToSign.startsWith(this.config.signInPrefix)) throw new Error("Cannot sign on invalid message");
const signedMessage = await this.signAuthMessage(address, messageToSign);
if (!jwtToken || generateNewToken) {
let signedMessage;
if (!jwtToken) {
const messageToSign = await this.getMessageForSigning(address);
if (!messageToSign.startsWith(this.config.signInPrefix)) throw new Error("Cannot sign on invalid message");
signedMessage = await this.signAuthMessage(address, messageToSign);
}
response = await post(

@@ -405,2 +411,3 @@ `${this.config.api}/auth/verify`,

signed_message: signedMessage,
id_token: generateNewToken ? jwtToken : undefined,
verifier: userInfo.aggregateVerifier || userInfo.verifier,

@@ -407,0 +414,0 @@ verifier_id: userInfo.verifierId,

@@ -78,2 +78,3 @@ import { BaseConfig, BaseState, IController, UserInfo } from "../interfaces";

idToken?: string;
web3auth_client_id?: string;
}

@@ -80,0 +81,0 @@

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 too big to display

Sorry, the diff of this file is not supported yet

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

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