Get SIWE Login Challenge
curl --request POST \
--url https://api.ondoperps.xyz/v1/auth/erc-4361/login/get_challenge \
--header 'Content-Type: application/json' \
--data '
{
"walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
"chainId": "1"
}
'import requests
url = "https://api.ondoperps.xyz/v1/auth/erc-4361/login/get_challenge"
payload = {
"walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
"chainId": "1"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({walletAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18', chainId: '1'})
};
fetch('https://api.ondoperps.xyz/v1/auth/erc-4361/login/get_challenge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ondoperps.xyz/v1/auth/erc-4361/login/get_challenge",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'walletAddress' => '0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18',
'chainId' => '1'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ondoperps.xyz/v1/auth/erc-4361/login/get_challenge"
payload := strings.NewReader("{\n \"walletAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18\",\n \"chainId\": \"1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ondoperps.xyz/v1/auth/erc-4361/login/get_challenge")
.header("Content-Type", "application/json")
.body("{\n \"walletAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18\",\n \"chainId\": \"1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ondoperps.xyz/v1/auth/erc-4361/login/get_challenge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"walletAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18\",\n \"chainId\": \"1\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"result": {
"id": "chg_9f8e7d6c5b4a3210",
"message": "api.ondoperps.xyz wants you to sign in with your Ethereum account:\n0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18\n\nSign in to Ondo Perps\n\nURI: https://api.ondoperps.xyz\nVersion: 1\nChain ID: 1\nNonce: abc123\nIssued At: 2025-03-05T14:30:00Z"
}
}{
"success": false,
"error": "Description of the error",
"error_code": "challenge_not_found"
}{
"success": false,
"error": "Description of the error",
"error_code": "too_many_requests"
}{
"success": false,
"error": "Description of the error",
"error_code": "unknown"
}Auth
Get SIWE Login Challenge
Get a Sign-In with Ethereum (ERC-4361) challenge for login.
POST
/
v1
/
auth
/
erc-4361
/
login
/
get_challenge
Get SIWE Login Challenge
curl --request POST \
--url https://api.ondoperps.xyz/v1/auth/erc-4361/login/get_challenge \
--header 'Content-Type: application/json' \
--data '
{
"walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
"chainId": "1"
}
'import requests
url = "https://api.ondoperps.xyz/v1/auth/erc-4361/login/get_challenge"
payload = {
"walletAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
"chainId": "1"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({walletAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18', chainId: '1'})
};
fetch('https://api.ondoperps.xyz/v1/auth/erc-4361/login/get_challenge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ondoperps.xyz/v1/auth/erc-4361/login/get_challenge",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'walletAddress' => '0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18',
'chainId' => '1'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ondoperps.xyz/v1/auth/erc-4361/login/get_challenge"
payload := strings.NewReader("{\n \"walletAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18\",\n \"chainId\": \"1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ondoperps.xyz/v1/auth/erc-4361/login/get_challenge")
.header("Content-Type", "application/json")
.body("{\n \"walletAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18\",\n \"chainId\": \"1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ondoperps.xyz/v1/auth/erc-4361/login/get_challenge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"walletAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18\",\n \"chainId\": \"1\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"result": {
"id": "chg_9f8e7d6c5b4a3210",
"message": "api.ondoperps.xyz wants you to sign in with your Ethereum account:\n0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18\n\nSign in to Ondo Perps\n\nURI: https://api.ondoperps.xyz\nVersion: 1\nChain ID: 1\nNonce: abc123\nIssued At: 2025-03-05T14:30:00Z"
}
}{
"success": false,
"error": "Description of the error",
"error_code": "challenge_not_found"
}{
"success": false,
"error": "Description of the error",
"error_code": "too_many_requests"
}{
"success": false,
"error": "Description of the error",
"error_code": "unknown"
}Body
application/json
Response
Challenge message for signing
Whether the request was successful
Example:
true
Error message, present only on failure
Example:
""
Semantic error code. See each endpoint's error responses for the specific codes it can return.
Deprecation notice, if applicable
Example:
""
Show child attributes
Show child attributes
⌘I