This scenario is mainly used to sign information. that can be used for login verification.
Sign Message
This method is used for sign message.
interfaceSignedData { publicKey:string; data:string; signature: { field:string; scalar:string; };}interfaceProviderErrorextendsError { message:string; code:number; data?:unknown;}typeSignMessageArgs= { message:string}constcontent=`Click "Sign" to sign in. No password needed!This request will not trigger a blockchain transaction or cost any gas fees.I accept the Auro Test zkApp Terms of Service: ${window.location.href}address: ${currentAccount}iat: ${newDate().getTime()}`;constsignContent:SignMessageArgs= { message:content}constsignResult:SignedData|ProviderError=awaitwindow.mina?.signMessage(signContent).catch((err:any) => err);console.log(signResult)
Sign Json Message
This method is used for sign JSON data , Auro Wallet will format message.
let verifyResult:boolean|ProviderError=awaitwindow.mina?.verifyMessage(verifyMessageBody).catch((err:any) => err);console.log(verifyResult); // If the result is successful, it will return true.