Web3 Authentication

The wallet-api lets users create and secure their account by leveraging web3 authentication. Based on the latest standards, like Login With Ethereum.

Supported Blockchains

  • Ethereum
  • Polygon
  • Tezos
  • Near
  • Polkadot
  • Flow
  • Algorand

Create User Account

To create a new user account, you need to send a POST request to the following endpoint:

CURL

API Reference

curl -X 'POST' \
  'http://0.0.0.0:7001/wallet-api/auth/create' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json' \
  -d '{
  "address": "0xABC",
  "ecosystem": "ecosystem",
  "type": "address"
}'

Body Parameters

{
  "address": "string",
  "ecosystem": "string",
  "type": "{type}"
}
  • address: string - The address of the user's web3 wallet.
  • ecosystem: string - The ecosystem of the user's web3 wallet. Supported ecosystems: ethereum, polygon, tezos, near, polkadot, flow, algorand.
  • type: string - The type of the user account. email or address (for web3 login).

Login

CURL

API Reference

curl -X 'POST' \
 'http://0.0.0.0:7001/wallet-api/auth/login' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json' \
  -d '{
  "address": "0xABC",
  "ecosystem": "ecosystem",
  "type": "address"
}'

Body Parameters

{
  "address": "string",
  "ecosystem": "string",
  "type": "{type}"
}
  • address: string - The address of the user's web3 wallet.
  • ecosystem: string - The ecosystem of the user's web3 wallet. Supported ecosystems: ethereum, polygon, tezos, near, polkadot, flow, algorand.
  • type: string - The type of the user account. email or address (for web3 login).

Example Response
Now a session is automatically created for cookie-based authentication. For Bearer Token Authentication, the token returned must be provided in the header for each request that needs authentication. Refer to the overview section for more details.

{
  "token": "KL-a_dk1qO8moCX4gxaGfb7_TS8RK-JWVKZk9BBP0-s",
  "id": "018045e5-942c-4362-b535-658c4dd581ef",
  "username": "0xABC"
}

Logout

CURL

API Reference

Deletes the session/invalidates the token.

curl -X 'POST' \
  'http://0.0.0.0:7001/wallet-api/auth/logout' \
  -H 'accept: */*' \
  -d ''