Web3
With the Pakt Web API, Chainsite builders can establish user authentication with Web3:
Last updated
With the Pakt Web API, Chainsite builders can establish user authentication with Web3:
Last updated
This endpoint allows you to make an HTTP POST request to {{baseUrl}}/v1/auth/web3/request in order to authenticate using a web3 provider. The request should include a payload with the raw request body type, containing the account information.
Request
account: (string) The user's account information.
Response
The response will include the following fields:
status: The status of the response.
message: A message related to the response status.
data: An object containing the following fields:
message: A message related to the authentication process.
tempToken: An object containing the temporary token information, including:
token: The temporary token value.
token_type: The type of the token.
expiresIn: The expiration time of the token in seconds.
{"account":"0x90b780d7546ab754e35e0d2e80d76557a012d4fe"}
OK
This endpoint allows the validation of a Web3 authentication request.
Request
signedMessage
(string): The signed message from the Web3 provider.
tempToken
(string): The temporary token obtained from the Web3 authentication process.
Response
The response will contain the status, message, and data objects. The data object will include the account and tempToken, where tempToken will have the token, token_type, and expiresIn properties.
{"signedMessage":"0x1787a65329e4569197b3d4a364b7dae128e44e47739e77fb6e7ff6c7f67d3bc4476978195e190c6eda689374d994508058afec419c6318899d89efef85e26c441c","tempToken":"{{web3_request_token}}"}
Accepted
This endpoint is used to onboard a user using a temporary token from web3.
Request
tempToken
(string, required): The temporary token obtained from web3.
firstName
(string, required): The first name of the user.
lastName
(string, required): The last name of the user.
email
(string, required): The email address of the user.
Response
The response contains the following information:
status
: The status of the response, which is "success" in this case.
message
: A brief message describing the response, which is "account on-boarded" here.
data
: An object containing additional information about the response.
tempToken
: An object containing a temporary token.
token
: The actual token value, which is a JWT (JSON Web Token) string.
tokenType
: The type of token, which is "jwt" in this case.
expiresIn
: The timestamp when the token expires, represented as a Unix timestamp in milliseconds.
isVerified
: A boolean indicating whether the account is verified or not.
{"tempToken":"{{web3_onboard_token}}","firstName":"Jack","lastName":"Mar","email":"mail@example.com"}
OK