@notifi-network/notifi-frontend-client
Advanced tools
Comparing version 3.0.2-alpha.6 to 3.0.2-alpha.7
@@ -475,3 +475,3 @@ import { Types, Operations, NotifiService } from '@notifi-network/notifi-graphql'; | ||
type Uint8SignMessageFunction = (message: Uint8Array) => Promise<Uint8Array>; | ||
type AptosSignMessageFunction = (message: string, nonce: number) => Promise<{ | ||
type AptosSignMessageFunction = (message: string, nonce: string) => Promise<{ | ||
signatureHex: HexString; | ||
@@ -533,3 +533,3 @@ signedMessage: string; | ||
logOut(): Promise<UserState>; | ||
private getLoginWithWeb3Variables; | ||
private prepareLoginWithWeb3; | ||
private logInWithWeb3; | ||
@@ -544,3 +544,3 @@ logIn(signMessageParams: LoginParams): Promise<Types.UserFragmentFragment>; | ||
completeLoginViaTransaction({ walletBlockchain, walletAddress, transactionSignature, }: CompleteLoginProps): Promise<Types.CompleteLogInByTransactionMutation>; | ||
beginLogInWithWeb3({ authType, authAddress, walletPubkey, }: BeginLoginWithWeb3Props): Promise<Types.BeginLogInWithWeb3Response>; | ||
_beginLogInWithWeb3({ authType, authAddress, walletPubkey, }: BeginLoginWithWeb3Props): Promise<Types.BeginLogInWithWeb3Response>; | ||
completeLogInWithWeb3(input: CompleteLoginWithWeb3Props): Promise<Types.CompleteLogInWithWeb3Mutation>; | ||
@@ -547,0 +547,0 @@ getTargetGroups(): Promise<ReadonlyArray<Types.TargetGroupFragmentFragment>>; |
@@ -45,76 +45,76 @@ import { Types } from '@notifi-network/notifi-graphql'; | ||
| Readonly<{ | ||
walletBlockchain: 'SOLANA'; | ||
signMessage: Uint8SignMessageFunction; | ||
}> | ||
walletBlockchain: 'SOLANA'; | ||
signMessage: Uint8SignMessageFunction; | ||
}> | ||
| Readonly<{ | ||
walletBlockchain: | ||
| 'ETHEREUM' | ||
| 'POLYGON' | ||
| 'ARBITRUM' | ||
| 'AVALANCHE' | ||
| 'BINANCE' | ||
| 'OSMOSIS' | ||
| 'THE_ROOT_NETWORK' | ||
| 'ELYS' | ||
| 'NEUTRON' | ||
| 'ARCHWAY' | ||
| 'AXELAR' | ||
| 'BERACHAIN' | ||
| 'NIBIRU' | ||
| 'OPTIMISM' | ||
| 'ZKSYNC' | ||
| 'INJECTIVE' | ||
| 'BASE' | ||
| 'BLAST' | ||
| 'CELO' | ||
| 'MANTLE' | ||
| 'LINEA' | ||
| 'SCROLL' | ||
| 'MANTA' | ||
| 'EVMOS' | ||
| 'MONAD' | ||
| 'AGORIC' | ||
| 'ORAI' | ||
| 'KAVA' | ||
| 'CELESTIA' | ||
| 'COSMOS' | ||
| 'DYMENSION' | ||
| 'PERSISTENCE' | ||
| 'DYDX' | ||
| 'ARCH' | ||
| 'BITCOIN'; | ||
walletBlockchain: | ||
| 'ETHEREUM' | ||
| 'POLYGON' | ||
| 'ARBITRUM' | ||
| 'AVALANCHE' | ||
| 'BINANCE' | ||
| 'OSMOSIS' | ||
| 'THE_ROOT_NETWORK' | ||
| 'ELYS' | ||
| 'NEUTRON' | ||
| 'ARCHWAY' | ||
| 'AXELAR' | ||
| 'BERACHAIN' | ||
| 'NIBIRU' | ||
| 'OPTIMISM' | ||
| 'ZKSYNC' | ||
| 'INJECTIVE' | ||
| 'BASE' | ||
| 'BLAST' | ||
| 'CELO' | ||
| 'MANTLE' | ||
| 'LINEA' | ||
| 'SCROLL' | ||
| 'MANTA' | ||
| 'EVMOS' | ||
| 'MONAD' | ||
| 'AGORIC' | ||
| 'ORAI' | ||
| 'KAVA' | ||
| 'CELESTIA' | ||
| 'COSMOS' | ||
| 'DYMENSION' | ||
| 'PERSISTENCE' | ||
| 'DYDX' | ||
| 'ARCH' | ||
| 'BITCOIN'; | ||
signMessage: Uint8SignMessageFunction; | ||
}> | ||
signMessage: Uint8SignMessageFunction; | ||
}> | ||
| Readonly<{ | ||
walletBlockchain: 'APTOS'; | ||
nonce: string; | ||
signMessage: AptosSignMessageFunction; | ||
}> | ||
walletBlockchain: 'APTOS'; | ||
nonce: string; | ||
signMessage: AptosSignMessageFunction; | ||
}> | ||
| Readonly<{ | ||
walletBlockchain: 'MOVEMENT'; | ||
nonce: string; | ||
signMessage: AptosSignMessageFunction; | ||
}> | ||
walletBlockchain: 'MOVEMENT'; | ||
nonce: string; | ||
signMessage: AptosSignMessageFunction; | ||
}> | ||
| Readonly<{ | ||
walletBlockchain: 'XION'; | ||
message: string; //TODO: in future we can remove this as the message will be returned by _.authenticate anyways... | ||
signMessage: XionSignMessageFunction; | ||
}> | ||
walletBlockchain: 'XION'; | ||
message: string; //TODO: in future we can remove this as the message will be returned by _.authenticate anyways... | ||
signMessage: XionSignMessageFunction; | ||
}> | ||
| Readonly<{ | ||
walletBlockchain: 'ACALA'; | ||
signMessage: AcalaSignMessageFunction; | ||
}> | ||
walletBlockchain: 'ACALA'; | ||
signMessage: AcalaSignMessageFunction; | ||
}> | ||
| Readonly<{ | ||
walletBlockchain: 'NEAR'; | ||
signMessage: Uint8SignMessageFunction; | ||
}> | ||
walletBlockchain: 'NEAR'; | ||
signMessage: Uint8SignMessageFunction; | ||
}> | ||
| Readonly<{ | ||
walletBlockchain: 'SUI'; | ||
signMessage: Uint8SignMessageFunction; | ||
}> | ||
walletBlockchain: 'SUI'; | ||
signMessage: Uint8SignMessageFunction; | ||
}> | ||
| Readonly<{ | ||
walletBlockchain: 'OFF_CHAIN'; | ||
signIn: OidcSignInFunction; | ||
}>; | ||
walletBlockchain: 'OFF_CHAIN'; | ||
signIn: OidcSignInFunction; | ||
}>; | ||
@@ -127,105 +127,105 @@ /** NOTE: | ||
| (Readonly<{ | ||
signMessage: Uint8SignMessageFunction; | ||
hardwareLoginPlugin?: { | ||
// NOTE: Solana specific: solana hardware wallet sign-in requires a memo contract verification | ||
sendMessage: (message: string) => Promise<string>; | ||
}; | ||
}> & | ||
SolanaUserParams) | ||
signMessage: Uint8SignMessageFunction; | ||
hardwareLoginPlugin?: { | ||
// NOTE: Solana specific: solana hardware wallet sign-in requires a memo contract verification | ||
sendMessage: (message: string) => Promise<string>; | ||
}; | ||
}> & | ||
SolanaUserParams) | ||
| (Readonly<{ | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
EvmUserParams) | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
EvmUserParams) | ||
| (Readonly<{ | ||
signMessage: AptosSignMessageFunction; | ||
}> & | ||
AptosUserParams) | ||
signMessage: AptosSignMessageFunction; | ||
}> & | ||
AptosUserParams) | ||
| (Readonly<{ | ||
signMessage: AptosSignMessageFunction; | ||
}> & | ||
MovementUserParams) | ||
signMessage: AptosSignMessageFunction; | ||
}> & | ||
MovementUserParams) | ||
| (Readonly<{ | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
BitcoinUserParams) | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
BitcoinUserParams) | ||
| (Readonly<{ | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
ArchUserParams) | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
ArchUserParams) | ||
| (Readonly<{ | ||
signMessage: XionSignMessageFunction; | ||
message: string; | ||
}> & | ||
XionUserParams) | ||
signMessage: XionSignMessageFunction; | ||
message: string; | ||
}> & | ||
XionUserParams) | ||
| (Readonly<{ | ||
signMessage: AcalaSignMessageFunction; | ||
}> & | ||
AcalaUserParams) | ||
signMessage: AcalaSignMessageFunction; | ||
}> & | ||
AcalaUserParams) | ||
| (Readonly<{ | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
NearUserParams) | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
NearUserParams) | ||
| (Readonly<{ | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
SuiUserParams) | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
SuiUserParams) | ||
| (Readonly<{ | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
InjectiveUserParams) | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
InjectiveUserParams) | ||
| (Readonly<{ | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
ElysUserParams) | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
ElysUserParams) | ||
| (Readonly<{ | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
NeutronUserParams) | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
NeutronUserParams) | ||
| (Readonly<{ | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
ArchwayUserParams) | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
ArchwayUserParams) | ||
| (Readonly<{ | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
AxelarUserParams) | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
AxelarUserParams) | ||
| (Readonly<{ | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
AgoricUserParams) | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
AgoricUserParams) | ||
| (Readonly<{ | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
OraiUserParams) | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
OraiUserParams) | ||
| (Readonly<{ | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
KavaUserParams) | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
KavaUserParams) | ||
| (Readonly<{ | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
CelestiaUserParams) | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
CelestiaUserParams) | ||
| (Readonly<{ | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
CosmosUserParams) | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
CosmosUserParams) | ||
| (Readonly<{ | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
DymensionUserParams) | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
DymensionUserParams) | ||
| (Readonly<{ | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
PersistenceUserParams) | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
PersistenceUserParams) | ||
| (Readonly<{ | ||
walletBlockchain: 'DYDX'; | ||
accountAddress: string; | ||
walletPublicKey: string; | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
DydxUserParams) | ||
walletBlockchain: 'DYDX'; | ||
accountAddress: string; | ||
walletPublicKey: string; | ||
signMessage: Uint8SignMessageFunction; | ||
}> & | ||
DydxUserParams) | ||
| (Readonly<{ | ||
signIn: OidcSignInFunction; | ||
}> & | ||
OffChainUserParams); | ||
signIn: OidcSignInFunction; | ||
}> & | ||
OffChainUserParams); | ||
@@ -269,20 +269,20 @@ /** NOTE: | ||
walletBlockchain: | ||
| 'ETHEREUM' | ||
| 'POLYGON' | ||
| 'ARBITRUM' | ||
| 'AVALANCHE' | ||
| 'BINANCE' | ||
| 'OPTIMISM' | ||
| 'THE_ROOT_NETWORK' | ||
| 'ZKSYNC' | ||
| 'BASE' | ||
| 'BLAST' | ||
| 'CELO' | ||
| 'MANTLE' | ||
| 'LINEA' | ||
| 'SCROLL' | ||
| 'MANTA' | ||
| 'MONAD' | ||
| 'EVMOS' | ||
| 'BERACHAIN'; | ||
| 'ETHEREUM' | ||
| 'POLYGON' | ||
| 'ARBITRUM' | ||
| 'AVALANCHE' | ||
| 'BINANCE' | ||
| 'OPTIMISM' | ||
| 'THE_ROOT_NETWORK' | ||
| 'ZKSYNC' | ||
| 'BASE' | ||
| 'BLAST' | ||
| 'CELO' | ||
| 'MANTLE' | ||
| 'LINEA' | ||
| 'SCROLL' | ||
| 'MANTA' | ||
| 'MONAD' | ||
| 'EVMOS' | ||
| 'BERACHAIN'; | ||
walletPublicKey: string; | ||
@@ -436,3 +436,3 @@ }>; | ||
message: string, | ||
nonce: number, | ||
nonce: string, | ||
) => Promise<{ | ||
@@ -493,13 +493,13 @@ signatureHex: HexString; | ||
| { | ||
status: 'loggedOut'; | ||
} | ||
status: 'loggedOut'; | ||
} | ||
| { | ||
status: 'authenticated'; | ||
authorization: Authorization; | ||
roles: Roles; | ||
} | ||
status: 'authenticated'; | ||
authorization: Authorization; | ||
roles: Roles; | ||
} | ||
| { | ||
status: 'expired'; | ||
authorization: Authorization; | ||
} | ||
status: 'expired'; | ||
authorization: Authorization; | ||
} | ||
>; | ||
@@ -519,7 +519,7 @@ | ||
| Exclude< | ||
SignMessageParams, | ||
| { walletBlockchain: 'XION' } | ||
| { walletBlockchain: 'APTOS' } | ||
| { walletBlockchain: 'MOVEMENT' } | ||
> | ||
SignMessageParams, | ||
| { walletBlockchain: 'XION' } | ||
| { walletBlockchain: 'APTOS' } | ||
| { walletBlockchain: 'MOVEMENT' } | ||
> | ||
| LoginWeb3Params; | ||
@@ -538,3 +538,3 @@ | ||
private _storage: NotifiStorage, | ||
) { } | ||
) {} | ||
@@ -614,3 +614,3 @@ private _clientRandomUuid: string | null = null; | ||
private async getLoginWithWeb3Variables( | ||
private async prepareLoginWithWeb3( | ||
signMessageParams: LoginWeb3Params, | ||
@@ -622,3 +622,2 @@ ): Promise<{ | ||
nonce: string; | ||
signedMessage: string; | ||
}> { | ||
@@ -633,3 +632,3 @@ if (signMessageParams.walletBlockchain === 'XION') { | ||
this._configuration; | ||
const { nonce } = await this.beginLogInWithWeb3({ | ||
const { nonce } = await this._beginLogInWithWeb3({ | ||
authAddress: delegatorAddress, | ||
@@ -649,7 +648,6 @@ authType: 'COSMOS_AUTHZ_GRANT', | ||
nonce, | ||
signedMessage, | ||
}; | ||
} else if (checkIsConfigWithPublicKeyAndAddress(this._configuration)) { | ||
const { authenticationKey, accountAddress } = this._configuration; | ||
const { nonce } = await this.beginLogInWithWeb3({ | ||
const { nonce } = await this._beginLogInWithWeb3({ | ||
authAddress: accountAddress, | ||
@@ -668,3 +666,2 @@ authType: 'COSMOS_ADR36', | ||
nonce, | ||
signedMessage, | ||
}; | ||
@@ -683,3 +680,3 @@ } | ||
if (checkIsConfigWithPublicKeyAndAddress(this._configuration)) { | ||
const { nonce } = await this.beginLogInWithWeb3({ | ||
const { nonce } = await this._beginLogInWithWeb3({ | ||
authAddress: this._configuration.accountAddress, | ||
@@ -689,2 +686,3 @@ authType: 'APTOS_SIGNED_MESSAGE', | ||
}); | ||
return { | ||
@@ -699,3 +697,2 @@ signMessageParams: { | ||
nonce, | ||
signedMessage: SIGNING_MESSAGE_WITHOUT_NONCE, | ||
}; | ||
@@ -725,3 +722,3 @@ } | ||
const { nonce, signingAddress, signingPubkey, signMessageParams } = | ||
await this.getLoginWithWeb3Variables(loginWeb3Params); | ||
await this.prepareLoginWithWeb3(loginWeb3Params); | ||
@@ -973,3 +970,6 @@ const authentication = await this._authenticate({ | ||
const { signatureHex, signedMessage } = | ||
await signMessageParams.signMessage(SIGNING_MESSAGE, timestamp); | ||
await signMessageParams.signMessage( | ||
SIGNING_MESSAGE_WITHOUT_NONCE, | ||
signMessageParams.nonce, | ||
); | ||
return { signature: signatureHex, signedMessage }; | ||
@@ -990,4 +990,5 @@ } | ||
const message = `${`ed25519:` + authenticationKey | ||
}${tenantId}${accountAddress}${timestamp.toString()}`; | ||
const message = `${ | ||
`ed25519:` + authenticationKey | ||
}${tenantId}${accountAddress}${timestamp.toString()}`; | ||
const textAsBuffer = new TextEncoder().encode(message); | ||
@@ -1120,3 +1121,3 @@ const hashBuffer = await window.crypto.subtle.digest( | ||
async beginLogInWithWeb3({ | ||
async _beginLogInWithWeb3({ | ||
authType, | ||
@@ -1647,6 +1648,6 @@ authAddress, | ||
walletBlockchain === 'APTOS' || | ||
walletBlockchain === 'MOVEMENT' || | ||
walletBlockchain === 'ACALA' || | ||
walletBlockchain === 'NEAR' || | ||
walletBlockchain === 'SUI' | ||
walletBlockchain === 'MOVEMENT' || | ||
walletBlockchain === 'ACALA' || | ||
walletBlockchain === 'NEAR' || | ||
walletBlockchain === 'SUI' | ||
? params.walletParams.accountAddress | ||
@@ -1653,0 +1654,0 @@ : undefined, |
{ | ||
"name": "@notifi-network/notifi-frontend-client", | ||
"version": "3.0.2-alpha.6+620ff38c", | ||
"version": "3.0.2-alpha.7+d48b98e5", | ||
"description": "The frontend client for Notifi", | ||
@@ -35,3 +35,3 @@ "main": "./dist/index.js", | ||
"dependencies": { | ||
"@notifi-network/notifi-graphql": "^3.0.2-alpha.6+620ff38c", | ||
"@notifi-network/notifi-graphql": "^3.0.2-alpha.7+d48b98e5", | ||
"graphql-request": "^6.0.0", | ||
@@ -43,3 +43,3 @@ "localforage": "^1.10.0" | ||
}, | ||
"gitHead": "620ff38c4697f2354a20ea59391cb3ce0f509ceb" | ||
"gitHead": "d48b98e507a4a6eacd438de82ea0ef213cee3552" | ||
} |
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
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
374220