Complete SIWE Address Book Challenge
curl --request POST \
--url https://api.ondoperps.xyz/v1/auth/erc-4361/address_book/complete_challenge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "chg_ab12cd34ef56",
"signature": "d5ee68784479z8n5utzebecfbd6926a89d7e24e9z5nut313611186z0da4206be4e57b809cbb3372d52b865bda7f372ea0808286009e572a66c8ab717cf85cdbc1b",
"addressLabel": "My Ledger Nano X"
}
'import requests
url = "https://api.ondoperps.xyz/v1/auth/erc-4361/address_book/complete_challenge"
payload = {
"id": "chg_ab12cd34ef56",
"signature": "d5ee68784479z8n5utzebecfbd6926a89d7e24e9z5nut313611186z0da4206be4e57b809cbb3372d52b865bda7f372ea0808286009e572a66c8ab717cf85cdbc1b",
"addressLabel": "My Ledger Nano X"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'chg_ab12cd34ef56',
signature: 'd5ee68784479z8n5utzebecfbd6926a89d7e24e9z5nut313611186z0da4206be4e57b809cbb3372d52b865bda7f372ea0808286009e572a66c8ab717cf85cdbc1b',
addressLabel: 'My Ledger Nano X'
})
};
fetch('https://api.ondoperps.xyz/v1/auth/erc-4361/address_book/complete_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/address_book/complete_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([
'id' => 'chg_ab12cd34ef56',
'signature' => 'd5ee68784479z8n5utzebecfbd6926a89d7e24e9z5nut313611186z0da4206be4e57b809cbb3372d52b865bda7f372ea0808286009e572a66c8ab717cf85cdbc1b',
'addressLabel' => 'My Ledger Nano X'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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/address_book/complete_challenge"
payload := strings.NewReader("{\n \"id\": \"chg_ab12cd34ef56\",\n \"signature\": \"d5ee68784479z8n5utzebecfbd6926a89d7e24e9z5nut313611186z0da4206be4e57b809cbb3372d52b865bda7f372ea0808286009e572a66c8ab717cf85cdbc1b\",\n \"addressLabel\": \"My Ledger Nano X\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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/address_book/complete_challenge")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"chg_ab12cd34ef56\",\n \"signature\": \"d5ee68784479z8n5utzebecfbd6926a89d7e24e9z5nut313611186z0da4206be4e57b809cbb3372d52b865bda7f372ea0808286009e572a66c8ab717cf85cdbc1b\",\n \"addressLabel\": \"My Ledger Nano X\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ondoperps.xyz/v1/auth/erc-4361/address_book/complete_challenge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"chg_ab12cd34ef56\",\n \"signature\": \"d5ee68784479z8n5utzebecfbd6926a89d7e24e9z5nut313611186z0da4206be4e57b809cbb3372d52b865bda7f372ea0808286009e572a66c8ab717cf85cdbc1b\",\n \"addressLabel\": \"My Ledger Nano X\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"success": false,
"error": "Description of the error",
"error_code": "account_not_found"
}{
"success": false,
"error": "Description of the error",
"error_code": "auth_missing"
}{
"success": false,
"error": "Description of the error",
"error_code": "account_not_allowed"
}{
"success": false,
"error": "Description of the error",
"error_code": "too_many_requests"
}{
"success": false,
"error": "Description of the error",
"error_code": "unknown"
}Auth
Complete SIWE Address Book Challenge
Complete the signed challenge to add a withdrawal address.
POST
/
v1
/
auth
/
erc-4361
/
address_book
/
complete_challenge
Complete SIWE Address Book Challenge
curl --request POST \
--url https://api.ondoperps.xyz/v1/auth/erc-4361/address_book/complete_challenge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "chg_ab12cd34ef56",
"signature": "d5ee68784479z8n5utzebecfbd6926a89d7e24e9z5nut313611186z0da4206be4e57b809cbb3372d52b865bda7f372ea0808286009e572a66c8ab717cf85cdbc1b",
"addressLabel": "My Ledger Nano X"
}
'import requests
url = "https://api.ondoperps.xyz/v1/auth/erc-4361/address_book/complete_challenge"
payload = {
"id": "chg_ab12cd34ef56",
"signature": "d5ee68784479z8n5utzebecfbd6926a89d7e24e9z5nut313611186z0da4206be4e57b809cbb3372d52b865bda7f372ea0808286009e572a66c8ab717cf85cdbc1b",
"addressLabel": "My Ledger Nano X"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: 'chg_ab12cd34ef56',
signature: 'd5ee68784479z8n5utzebecfbd6926a89d7e24e9z5nut313611186z0da4206be4e57b809cbb3372d52b865bda7f372ea0808286009e572a66c8ab717cf85cdbc1b',
addressLabel: 'My Ledger Nano X'
})
};
fetch('https://api.ondoperps.xyz/v1/auth/erc-4361/address_book/complete_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/address_book/complete_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([
'id' => 'chg_ab12cd34ef56',
'signature' => 'd5ee68784479z8n5utzebecfbd6926a89d7e24e9z5nut313611186z0da4206be4e57b809cbb3372d52b865bda7f372ea0808286009e572a66c8ab717cf85cdbc1b',
'addressLabel' => 'My Ledger Nano X'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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/address_book/complete_challenge"
payload := strings.NewReader("{\n \"id\": \"chg_ab12cd34ef56\",\n \"signature\": \"d5ee68784479z8n5utzebecfbd6926a89d7e24e9z5nut313611186z0da4206be4e57b809cbb3372d52b865bda7f372ea0808286009e572a66c8ab717cf85cdbc1b\",\n \"addressLabel\": \"My Ledger Nano X\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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/address_book/complete_challenge")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"chg_ab12cd34ef56\",\n \"signature\": \"d5ee68784479z8n5utzebecfbd6926a89d7e24e9z5nut313611186z0da4206be4e57b809cbb3372d52b865bda7f372ea0808286009e572a66c8ab717cf85cdbc1b\",\n \"addressLabel\": \"My Ledger Nano X\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ondoperps.xyz/v1/auth/erc-4361/address_book/complete_challenge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"chg_ab12cd34ef56\",\n \"signature\": \"d5ee68784479z8n5utzebecfbd6926a89d7e24e9z5nut313611186z0da4206be4e57b809cbb3372d52b865bda7f372ea0808286009e572a66c8ab717cf85cdbc1b\",\n \"addressLabel\": \"My Ledger Nano X\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"success": false,
"error": "Description of the error",
"error_code": "account_not_found"
}{
"success": false,
"error": "Description of the error",
"error_code": "auth_missing"
}{
"success": false,
"error": "Description of the error",
"error_code": "account_not_allowed"
}{
"success": false,
"error": "Description of the error",
"error_code": "too_many_requests"
}{
"success": false,
"error": "Description of the error",
"error_code": "unknown"
}Authorizations
BearerAuthApiKeyAuth
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The ID of the challenge
Example:
"chg_ab12cd34ef56"
The signed challenge proving wallet ownership
Example:
"d5ee68784479z8n5utzebecfbd6926a89d7e24e9z5nut313611186z0da4206be4e57b809cbb3372d52b865bda7f372ea0808286009e572a66c8ab717cf85cdbc1b"
Optional label for the withdrawal address
Example:
"My Ledger Nano X"
Response
Result
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:
""
⌘I