Enclave
  • Introducing Enclave Money
    • Enclave Smart Accounts
      • Security & Recovery
      • MEV Protection
    • Enclave Money Protocol
      • Asset Support
      • Network Support
      • Wallet Support
    • Embedded Swaps
  • Integrate with Enclave Money
    • SDK
      • Integrate with Privy
      • Integrate with Turnkey
    • API Reference
      • Health
      • User
      • Smart Balance
      • Smart Account
      • Passkey Account
      • Delegated Action
  • Applications
  • Business Model
  • Audits
  • Disclaimer
  • Risk Disclosure
Powered by GitBook
On this page
  1. Integrate with Enclave Money
  2. API Reference

Passkey Account

PreviousSmart AccountNextDelegated Action

Last updated 4 months ago

Generate registration options for WebAuthn

get
Query parameters
usernamestringRequired

The username of the user to register

Example: user@example.com
Responses
200
Registration options generated successfully
application/json
Responseobject
400
User already registered
application/json
get
GET /v3/webauthn/register/generate-options?username=text HTTP/1.1
Host: 
Accept: */*
{
  "challenge": "randomChallengeString",
  "rp": {
    "name": "Example RP",
    "id": "example.com"
  },
  "user": {
    "id": "userID123",
    "name": "user@example.com",
    "displayName": "User"
  },
  "pubKeyCredParams": [
    {
      "alg": -7,
      "type": "public-key"
    }
  ]
}

Verify WebAuthn registration

post
Query parameters
usernamestringRequired

The username of the user to verify

Body
anyOptional
Responses
200
Registration verified successfully
application/json
400
Verification failed or user not found
500
Internal server error
post
POST /v3/webauthn/register/verify?username=text HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 162

{
  "id": "credentialId123",
  "rawId": "base64EncodedRawId",
  "response": {
    "attestationObject": "base64EncodedAttestationObject",
    "clientDataJSON": "base64EncodedClientData"
  }
}
{
  "username": "user@example.com",
  "wallet": {
    "scw_address": "0x123...",
    "multi_scw": [
      {
        "network": 42161,
        "address": "0x123...",
        "deployed": true
      }
    ]
  },
  "token": "jwt-token-123"
}

Generate transaction options for WebAuthn

post
Body
anyOptional
Responses
200
Transaction options generated successfully
400
Missing required fields or invalid network
500
Internal server error
post
POST /v3/webauthn/transaction/generate-options HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 158

{
  "username": "user@example.com",
  "transactionDetails": [
    {
      "encodedData": "0x...",
      "targetContractAddress": "0x...",
      "value": "1000000000000000000"
    }
  ],
  "network": "42161"
}

No content

Verify WebAuthn transaction

post
Query parameters
usernamestringRequired

The username of the user verifying the transaction

Body
objectOptional
Responses
200
Transaction verified successfully
400
User not found or incomplete user data
500
Internal server error
post
POST /v3/webauthn/transaction/verify?username=text HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 2

{}

No content

  • GETGenerate registration options for WebAuthn
  • POSTVerify WebAuthn registration
  • GETGenerate authentication options
  • POSTVerify authentication
  • POSTGenerate transaction options for WebAuthn
  • POSTVerify WebAuthn transaction

Generate authentication options

get

Generate authentication options for a user

Query parameters
usernamestringRequired

The username of the user

Responses
200
Authentication options generated successfully
application/json
400
User not registered
500
Internal server error
get
GET /webauthn/authenticate/generate-options?username=text HTTP/1.1
Host: 
Accept: */*
{
  "passkeyAuthenticationOptions": {}
}

Verify authentication

post

Verify the authentication for a user

Query parameters
usernamestringRequired

The username of the user

Body
idstringOptional
rawIdstringOptional
authenticatorAttachmentstringOptional
clientExtensionResultsobjectOptional
typestringOptional
Responses
200
Authentication verified successfully
application/json
400
User not found or Device Info not found
500
Internal server error
post
POST /webauthn/authenticate/verify?username=text HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 186

{
  "id": "text",
  "rawId": "text",
  "response": {
    "attestationObject": "text",
    "clientDataJSON": "text",
    "signature": "text"
  },
  "authenticatorAttachment": "text",
  "clientExtensionResults": {},
  "type": "text"
}
{
  "message": "text"
}