Skip to main content
Docs

Web3Wallet

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 to ensure that they can be assigned to their rightful owners. The verification is completed via Web3 wallet browser extensions, such as Metamask, Coinbase Wallet, and OKX Wallet. 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 the 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.

Properties

  • Name
    id
    Type
    string
    Description

    The unique ID for the Web3 wallet.

  • Name
    web3Wallet
    Type
    string
    Description

    The Web3 wallet address, made up of 0x + 40 hexadecimal characters.

  • Name
    verification
    Type
    Verification
    Description

    An object holding information on the verification of this Web3 wallet.

Methods

create()

Creates a new Web3 wallet.

function create(): Promise<Web3Wallet>

destroy()

Deletes this Web3 wallet.

function destroy(): Promise<void>

toString()

Returns the web3Wallet hexadecimal string.

function toString(): string

prepareVerification()

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. Returns a Web3Wallet object.

function prepareVerification(params: PrepareWeb3WalletVerificationParams): Promise<Web3Wallet>
  • Name
    strategy
    Type
    'web3_metamask_signature' | 'web3_coinbase_wallet_signature' | 'web3_okx_wallet_signature'
    Description

    The verification strategy to validate the user's sign-up request. The following strategies are supported:

    • 'web3_metamask_signature': User will need to sign a message and generate a signature using MetaMask browser extension.
    • 'web3_coinbase_wallet_signature': User will need to sign a message and generate a signature using Coinbase Wallet.
    • 'web3_okx_wallet_signature': User will need to sign a message and generate a signature using OKX Wallet.

attemptVerification()

Attempts to verify this Web3 wallet, by passing the generated signature. Returns a Web3Wallet object.

function attemptVerification(params: AttemptWeb3WalletVerificationParams): Promise<Web3Wallet>
  • Name
    signature
    Type
    string
    Description

    The signature that was generated after prepareVerification was called.

Feedback

What did you think of this content?

Last updated on