Web3Wallet
The Web3Wallet object describes a User's web3 wallet address.
Overview
The Web3Wallet
object describes a Web3 wallet address. The address can be used as a proof of identification for users.
Web3 addresses must be verified so that we can make sure they can be assigned to their rightful owners. The verification is completed via Web3 wallet browser extensions such as Metamask. The Web3Wallet3
object holds all the necessary state around the verification process.
The verification process always starts with the Web3Wallet.prepareVerification() or signIn.prepareFirstFactor() method, which will send the wallet address to Clerk Frontend API and will receive a nonce that needs to be signed by the Web3 wallet browser extension.
The second and final step involves an attempt to complete the verification by calling Web3Wallet.attemptVerification() method, passing the generated signature as a parameter.
Attributes
Name | Type | Description |
---|---|---|
id | string | A unique identifier for this web3 wallet. |
web3Wallet | string | In Ethereum, the address is made up of |
verification | VerificationResource | An object holding information on the verification of this web3 wallet. |
Methods
create()
create() => Promise<Web3WalletResource>
Creates a new web3 wallet.
Parameters
This method accepts no parameters.
Returns
Type | Description |
---|---|
Promise<Web3WalletResource> | This method returns a |
prepareVerification()
prepareVerification(params: PrepareWeb3WalletVerificationParams) => Promise<Web3WalletResource>
Kick off the verification process for this web3 wallet. The user will be prompted to sign a generated nonce by the browser extension e.g MetaMask.
Parameters
Name | Description |
---|---|
params | An object of type |
Returns
Type | Description |
---|---|
Promise<Web3WalletResource> | This method returns a |
attemptVerification()
attemptVerification(params: AttemptWeb3WalletVerificationParams) => Promise<Web3WalletResource>
Attempts to verify this web3 wallet, by passing the generated signature.
Parameters
Name | Description |
---|---|
params | An object of type |
Returns
Type | Description |
---|---|
Promise<Web3WalletResource> | This method returns a |
destroy()
destroy() => Promise<void>
Delete this web3 walllet.
Parameters
This method accepts no parameters.
Returns
Type | Description |
---|---|
Promise<void> | This method returns a |
toString()
toString() => string
Returns the web3Wallet
hexadecimal string.
Interfaces
VerificationResource
Name | Type | Description |
---|---|---|
status | string | null | The verification status. Possible values are:
|
strategy | string | null | The verification strategy. Possible strategy values are:
|
nonce | string | null | A unique nonce that will be signed in the browser. |
attempts | number | null | The number of attempts to complete the verification so far. Usually, a verification allows for maximum 3 attempts to be completed. |
expireAt | Date | null | The timestamp when the verification will expire and cease to be valid. |
error | ClerkAPIError | null | Any error that occurred during the verification process from the Clerk API. |
Types
PrepareWeb3WalletVerificationParams
Name | Type | Description |
---|---|---|
strategy | string | The verification strategy. Possible strategy values are:
|
AttemptWeb3WalletVerificationParams
Name | Type | Description |
---|---|---|
signature | string | The signature that was generated after prepareVerification was called |