Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
curl --request POST \
--url https://swap-api.flux.fun/v1/auth/submit-signature \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"signature": "0x...",
"extraData": "{\"walletAddress\":\"0x...\",\"expiresOn\":\"2024-12-31T23:59:59Z\",\"hmac\":\"...\",\"chainId\":8453,\"isSmartContractWallet\":false}"
}
'import requests
url = "https://swap-api.flux.fun/v1/auth/submit-signature"
payload = {
"signature": "0x...",
"extraData": "{\"walletAddress\":\"0x...\",\"expiresOn\":\"2024-12-31T23:59:59Z\",\"hmac\":\"...\",\"chainId\":8453,\"isSmartContractWallet\":false}"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
signature: '0x...',
extraData: '{"walletAddress":"0x...","expiresOn":"2024-12-31T23:59:59Z","hmac":"...","chainId":8453,"isSmartContractWallet":false}'
})
};
fetch('https://swap-api.flux.fun/v1/auth/submit-signature', 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://swap-api.flux.fun/v1/auth/submit-signature",
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([
'signature' => '0x...',
'extraData' => '{"walletAddress":"0x...","expiresOn":"2024-12-31T23:59:59Z","hmac":"...","chainId":8453,"isSmartContractWallet":false}'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://swap-api.flux.fun/v1/auth/submit-signature"
payload := strings.NewReader("{\n \"signature\": \"0x...\",\n \"extraData\": \"{\\\"walletAddress\\\":\\\"0x...\\\",\\\"expiresOn\\\":\\\"2024-12-31T23:59:59Z\\\",\\\"hmac\\\":\\\"...\\\",\\\"chainId\\\":8453,\\\"isSmartContractWallet\\\":false}\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://swap-api.flux.fun/v1/auth/submit-signature")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"signature\": \"0x...\",\n \"extraData\": \"{\\\"walletAddress\\\":\\\"0x...\\\",\\\"expiresOn\\\":\\\"2024-12-31T23:59:59Z\\\",\\\"hmac\\\":\\\"...\\\",\\\"chainId\\\":8453,\\\"isSmartContractWallet\\\":false}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://swap-api.flux.fun/v1/auth/submit-signature")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signature\": \"0x...\",\n \"extraData\": \"{\\\"walletAddress\\\":\\\"0x...\\\",\\\"expiresOn\\\":\\\"2024-12-31T23:59:59Z\\\",\\\"hmac\\\":\\\"...\\\",\\\"chainId\\\":8453,\\\"isSmartContractWallet\\\":false}\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}Submit the signed challenge message to receive your JWT access token. The server will verify that: the signature is valid and recovers to your wallet address, the challenge hasn’t expired (1 minute window), and the HMAC matches the original challenge.
curl --request POST \
--url https://swap-api.flux.fun/v1/auth/submit-signature \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"signature": "0x...",
"extraData": "{\"walletAddress\":\"0x...\",\"expiresOn\":\"2024-12-31T23:59:59Z\",\"hmac\":\"...\",\"chainId\":8453,\"isSmartContractWallet\":false}"
}
'import requests
url = "https://swap-api.flux.fun/v1/auth/submit-signature"
payload = {
"signature": "0x...",
"extraData": "{\"walletAddress\":\"0x...\",\"expiresOn\":\"2024-12-31T23:59:59Z\",\"hmac\":\"...\",\"chainId\":8453,\"isSmartContractWallet\":false}"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
signature: '0x...',
extraData: '{"walletAddress":"0x...","expiresOn":"2024-12-31T23:59:59Z","hmac":"...","chainId":8453,"isSmartContractWallet":false}'
})
};
fetch('https://swap-api.flux.fun/v1/auth/submit-signature', 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://swap-api.flux.fun/v1/auth/submit-signature",
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([
'signature' => '0x...',
'extraData' => '{"walletAddress":"0x...","expiresOn":"2024-12-31T23:59:59Z","hmac":"...","chainId":8453,"isSmartContractWallet":false}'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://swap-api.flux.fun/v1/auth/submit-signature"
payload := strings.NewReader("{\n \"signature\": \"0x...\",\n \"extraData\": \"{\\\"walletAddress\\\":\\\"0x...\\\",\\\"expiresOn\\\":\\\"2024-12-31T23:59:59Z\\\",\\\"hmac\\\":\\\"...\\\",\\\"chainId\\\":8453,\\\"isSmartContractWallet\\\":false}\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://swap-api.flux.fun/v1/auth/submit-signature")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"signature\": \"0x...\",\n \"extraData\": \"{\\\"walletAddress\\\":\\\"0x...\\\",\\\"expiresOn\\\":\\\"2024-12-31T23:59:59Z\\\",\\\"hmac\\\":\\\"...\\\",\\\"chainId\\\":8453,\\\"isSmartContractWallet\\\":false}\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://swap-api.flux.fun/v1/auth/submit-signature")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signature\": \"0x...\",\n \"extraData\": \"{\\\"walletAddress\\\":\\\"0x...\\\",\\\"expiresOn\\\":\\\"2024-12-31T23:59:59Z\\\",\\\"hmac\\\":\\\"...\\\",\\\"chainId\\\":8453,\\\"isSmartContractWallet\\\":false}\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}The signature of the challenge message, signed with your wallet's private key
"0x..."
The extraData string received from the Get Message endpoint
"{\"walletAddress\":\"0x...\",\"expiresOn\":\"2024-12-31T23:59:59Z\",\"hmac\":\"...\",\"chainId\":8453,\"isSmartContractWallet\":false}"
