WalletAuthService
class provides methods to retrieve a challenge for wallet authentication and to decrypt credentials using that challenge.
new WalletAuthService(): WalletAuthService
WalletAuthService
decrypt(Decrypts an encrypted verifiable credential using a signed challenge. This method sends the signed challenge, the user’s address, and the encrypted credential to Crossmint for decryption.credential
,challenge
,signature
,userAddress
):Promise
<any
>
Parameter | Type | Description |
---|---|---|
credential | EncryptedVerifiableCredential | The encrypted verifiable credential to decrypt. |
challenge | string | The challenge that was signed by the user’s wallet. |
signature | string | The signature of the challenge signed by the user’s wallet. |
userAddress | string | The blockchain address of the user requesting decryption. |
Promise
<any
>
A promise that resolves to the decrypted data.
getChallenge(Retrieves a challenge nonce for wallet authentication. This method requests a challenge from Crossmint that can be signed by the user’s wallet to authenticate the user.userAddress
):Promise
<string
>
Parameter | Type | Description |
---|---|---|
userAddress | string | The blockchain address of the user requesting the challenge. |
Promise
<string
>
A promise that resolves to a string representing the challenge to sign.