@notifi-network/notifi-frontend-client
Advanced tools
Comparing version 0.35.1-alpha.1 to 0.35.1-alpha.2
@@ -189,3 +189,3 @@ import { Types, Operations, NotifiService } from '@notifi-network/notifi-graphql'; | ||
private _clientRandomUuid; | ||
logIn(signMessageParams: SignMessageParams): Promise<Types.UserFragmentFragment | undefined>; | ||
logIn(signMessageParams: SignMessageParams): Promise<Types.UserFragmentFragment>; | ||
private _signMessage; | ||
@@ -192,0 +192,0 @@ private _handleLogInResult; |
@@ -314,8 +314,6 @@ "use strict"; | ||
const { tenantId, walletBlockchain } = this._configuration; | ||
let loginPromise = Promise.reject( | ||
"Unsupported blockchain" | ||
); | ||
let loginResult = void 0; | ||
switch (walletBlockchain) { | ||
case "SOLANA": { | ||
loginPromise = this._service.logInFromDapp({ | ||
const result = await this._service.logInFromDapp({ | ||
walletBlockchain, | ||
@@ -327,6 +325,7 @@ walletPublicKey: this._configuration.walletPublicKey, | ||
}); | ||
loginResult = result.logInFromDapp; | ||
break; | ||
} | ||
case "APTOS": { | ||
loginPromise = this._service.logInFromDapp({ | ||
const result = await this._service.logInFromDapp({ | ||
walletBlockchain, | ||
@@ -339,8 +338,11 @@ walletPublicKey: this._configuration.authenticationKey, | ||
}); | ||
loginResult = result.logInFromDapp; | ||
break; | ||
} | ||
} | ||
const result = await loginPromise; | ||
await this._handleLogInResult(result.logInFromDapp); | ||
return result.logInFromDapp; | ||
if (loginResult === void 0) { | ||
return Promise.reject("Failed to login"); | ||
} | ||
await this._handleLogInResult(loginResult); | ||
return loginResult; | ||
} | ||
@@ -347,0 +349,0 @@ async _signMessage({ |
@@ -62,3 +62,3 @@ import type { FilterOptions } from '@notifi-network/notifi-core'; | ||
signMessageParams: SignMessageParams, | ||
): Promise<Types.UserFragmentFragment | undefined> { | ||
): Promise<Types.UserFragmentFragment> { | ||
const timestamp = Math.round(Date.now() / 1000); | ||
@@ -71,8 +71,7 @@ const signature = await this._signMessage({ | ||
const { tenantId, walletBlockchain } = this._configuration; | ||
let loginPromise = Promise.reject<Types.LogInFromDappMutation>( | ||
'Unsupported blockchain', | ||
); | ||
let loginResult: Types.UserFragmentFragment | undefined = undefined; | ||
switch (walletBlockchain) { | ||
case 'SOLANA': { | ||
loginPromise = this._service.logInFromDapp({ | ||
const result = await this._service.logInFromDapp({ | ||
walletBlockchain, | ||
@@ -84,6 +83,7 @@ walletPublicKey: this._configuration.walletPublicKey, | ||
}); | ||
loginResult = result.logInFromDapp; | ||
break; | ||
} | ||
case 'APTOS': { | ||
loginPromise = this._service.logInFromDapp({ | ||
const result = await this._service.logInFromDapp({ | ||
walletBlockchain, | ||
@@ -96,9 +96,13 @@ walletPublicKey: this._configuration.authenticationKey, | ||
}); | ||
loginResult = result.logInFromDapp; | ||
break; | ||
} | ||
} | ||
const result = await loginPromise; | ||
await this._handleLogInResult(result.logInFromDapp); | ||
return result.logInFromDapp; | ||
if (loginResult === undefined) { | ||
return Promise.reject('Failed to login'); | ||
} | ||
await this._handleLogInResult(loginResult); | ||
return loginResult; | ||
} | ||
@@ -105,0 +109,0 @@ |
{ | ||
"name": "@notifi-network/notifi-frontend-client", | ||
"version": "0.35.1-alpha.1+a2ee910", | ||
"version": "0.35.1-alpha.2+b634b4b", | ||
"description": "The frontend client for Notifi", | ||
@@ -36,7 +36,7 @@ "main": "./dist/index.js", | ||
"dependencies": { | ||
"@notifi-network/notifi-graphql": "^0.35.1-alpha.1+a2ee910", | ||
"@notifi-network/notifi-graphql": "^0.35.1-alpha.2+b634b4b", | ||
"graphql-request": "^5.0.0", | ||
"localforage": "^1.10.0" | ||
}, | ||
"gitHead": "a2ee910e1a11d4ef93fa053d8a2b947c3c1a75da" | ||
"gitHead": "b634b4b432869555c6686da974e080f5d5db09ae" | ||
} |
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
97698
2596