Request challenge

Request a challenge

post

Request a challenge.

Body
domainstringRequired

Domain name

Example: justaname
addressstringRequired

Address

Example: 0x1234567890123456789012345678901234567890
originstringRequired

Origin

Example: https://justaname.id
chainIdnumberRequired

Chain id, we only support Ethereum Mainnet and Sepolia Testnet (1 for mainnet, 11155111 for sepolia)

Example: 11155111
ttlnumberOptional

Time to Live (TTL) in milliseconds (ms), default is 2 minutes (2 * 60 * 1000 = 120000 ms)

Default: 120000Example: 120000
Responses
201
The challenge was requested successfully.
application/json
post
POST /ens/v1/siwe/request-challenge HTTP/1.1
Host: api.justaname.id
Content-Type: application/json
Accept: */*
Content-Length: 143

{
  "domain": "justaname",
  "address": "0x1234567890123456789012345678901234567890",
  "origin": "https://justaname.id",
  "chainId": "11155111",
  "ttl": 120000
}
201

The challenge was requested successfully.

{
  "statusCode": 200,
  "result": {
    "data": {
      "challenge": "domain wants you to sign in with your Ethereum account:\nAddress\n\nPlease sign this message to verify that you want to add/update your subdomain provided by justawallet to your account Address using JustAName\n\nURI: uri\nVersion: 1\nChain ID: ChainId\nNonce: nonce\nIssued At: Date\nExpiration Time: Date"
    },
    "error": "text"
  }
}

Was this helpful?