Register Wallet Credentials
curl --request POST \
--url https://www.aionmarket.com/bvapi/wallet/credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"walletAddress": "<string>",
"apiKey": "<string>",
"apiSecret": "<string>",
"apiPassphrase": "<string>"
}
'import requests
url = "https://www.aionmarket.com/bvapi/wallet/credentials"
payload = {
"walletAddress": "<string>",
"apiKey": "<string>",
"apiSecret": "<string>",
"apiPassphrase": "<string>"
}
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({
walletAddress: '<string>',
apiKey: '<string>',
apiSecret: '<string>',
apiPassphrase: '<string>'
})
};
fetch('https://www.aionmarket.com/bvapi/wallet/credentials', 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://www.aionmarket.com/bvapi/wallet/credentials",
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' => '<string>',
'apiKey' => '<string>',
'apiSecret' => '<string>',
'apiPassphrase' => '<string>'
]),
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://www.aionmarket.com/bvapi/wallet/credentials"
payload := strings.NewReader("{\n \"walletAddress\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"apiSecret\": \"<string>\",\n \"apiPassphrase\": \"<string>\"\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://www.aionmarket.com/bvapi/wallet/credentials")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"walletAddress\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"apiSecret\": \"<string>\",\n \"apiPassphrase\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.aionmarket.com/bvapi/wallet/credentials")
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 \"walletAddress\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"apiSecret\": \"<string>\",\n \"apiPassphrase\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"hasCredentials": true,
"walletAddress": "<string>",
"signatureType": 123
}Wallet
Register Wallet Credentials
Store Polymarket CLOB credentials for the given wallet.
POST
/
wallet
/
credentials
Register Wallet Credentials
curl --request POST \
--url https://www.aionmarket.com/bvapi/wallet/credentials \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"walletAddress": "<string>",
"apiKey": "<string>",
"apiSecret": "<string>",
"apiPassphrase": "<string>"
}
'import requests
url = "https://www.aionmarket.com/bvapi/wallet/credentials"
payload = {
"walletAddress": "<string>",
"apiKey": "<string>",
"apiSecret": "<string>",
"apiPassphrase": "<string>"
}
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({
walletAddress: '<string>',
apiKey: '<string>',
apiSecret: '<string>',
apiPassphrase: '<string>'
})
};
fetch('https://www.aionmarket.com/bvapi/wallet/credentials', 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://www.aionmarket.com/bvapi/wallet/credentials",
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' => '<string>',
'apiKey' => '<string>',
'apiSecret' => '<string>',
'apiPassphrase' => '<string>'
]),
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://www.aionmarket.com/bvapi/wallet/credentials"
payload := strings.NewReader("{\n \"walletAddress\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"apiSecret\": \"<string>\",\n \"apiPassphrase\": \"<string>\"\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://www.aionmarket.com/bvapi/wallet/credentials")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"walletAddress\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"apiSecret\": \"<string>\",\n \"apiPassphrase\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.aionmarket.com/bvapi/wallet/credentials")
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 \"walletAddress\": \"<string>\",\n \"apiKey\": \"<string>\",\n \"apiSecret\": \"<string>\",\n \"apiPassphrase\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"hasCredentials": true,
"walletAddress": "<string>",
"signatureType": 123
}Register Polymarket CLOB API credentials for a wallet to enable trading.
Fix: Verify API key, secret, and passphrase are correct and not expired.
Fix: Ensure the wallet address matches the Polymarket account owner.
Fix: Existing credentials are active. Rotate by registering new credentials.
Overview
This endpoint binds wallet credentials to the authenticated agent for Polymarket order execution.Prerequisites
- Polymarket account with CLOB access
- API Key, API Secret, and API Passphrase from Polymarket
- Agent registered via
POST /agents/register - Valid wallet address derived from your private key
Getting Polymarket CLOB credentials
- Go to Polymarket Settings
- Navigate to API Keys section
- Create a new API key with trading permissions
- Copy the:
- API Key
- API Secret
- API Passphrase
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
walletAddress | string | Yes | Wallet address (0x-prefixed) |
apiKey | string | Yes | Polymarket CLOB API key |
apiSecret | string | Yes | Polymarket CLOB API secret |
apiPassphrase | string | Yes | Polymarket CLOB API passphrase |
Examples
- curl
- Python SDK
curl -X POST https://www.aionmarket.com/bvapi/wallet/credentials \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"walletAddress": "0x1111111111111111111111111111111111111111",
"apiKey": "your-polymarket-api-key",
"apiSecret": "your-polymarket-api-secret",
"apiPassphrase": "your-polymarket-passphrase"
}'
from aion_sdk import AionMarketClient
client = AionMarketClient(api_key="YOUR_API_KEY", base_url="https://www.aionmarket.com/bvapi")
result = client.register_wallet_credentials(
wallet_address="0x1111111111111111111111111111111111111111",
api_key="your-polymarket-api-key",
api_secret="your-polymarket-api-secret",
api_passphrase="your-polymarket-passphrase",
)
print(result)
Response
{
"success": true,
"walletAddress": "0x1111111111111111111111111111111111111111",
"signatureType": 0,
"encryptedCredentials": true,
"registeredAt": "2024-04-15T10:30:00Z"
}
Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Registration success flag |
walletAddress | string | Registered wallet address |
signatureType | integer | 0=EOA, 1=PolymarketProxy, 2=GnosisSafe |
encryptedCredentials | boolean | Encrypted-at-rest indicator |
registeredAt | string | Registration timestamp |
Credential Storage & Security
Our Commitment
- 🔐 Encrypted Storage: Credentials are encrypted at rest using AES-256
- 🚫 No Logging: API keys are never logged or stored in plaintext
- ✅ Verified Access: Only the registered API key can modify these credentials
- 🔄 Rotation Support: You can register new credentials to rotate keys
Best Practices
- Regular Rotation: Change API keys every 90 days
- Separate Keys: Use dedicated keys for each agent/service
- Limited Scope: Create keys with minimum required permissions
- Monitor Activity: Regularly check Polymarket API activity logs
- Emergency Revocation: Revoke compromised keys immediately
Verifying Credentials
Before placing trades, verify that credentials are properly registered:- curl
- Python SDK
curl -X GET "https://www.aionmarket.com/bvapi/wallet/credentials/check?walletAddress=0x1111111111111111111111111111111111111111" \
-H "Authorization: Bearer YOUR_API_KEY"
from aion_sdk import AionMarketClient
client = AionMarketClient(api_key="YOUR_API_KEY", base_url="https://www.aionmarket.com/bvapi")
status = client.check_wallet_credentials("0x1111111111111111111111111111111111111111")
print(status)
Signature Types
When credentials are registered, the system detects the wallet type:| Type | Name | Description |
|---|---|---|
| 0 | EOA (Externally Owned Account) | Standard Ethereum wallet |
| 1 | PolymarketProxy | Proxy contract for additional features |
| 2 | GnosisSafe | Multi-signature wallet |
Troubleshooting
Invalid Credentials Error
{ "detail": "Invalid Polymarket credentials" }
Wallet Address Mismatch
{ "detail": "Wallet address does not match credential owner" }
Already Registered
{ "detail": "Credentials already exist for this wallet" }
Next Steps
- Register Credentials: Follow the steps above
- Verify Setup: Use the check endpoint to confirm
- Fund Wallet: Transfer USDC.e to your Polymarket account
- Try Limit Order: Start with a small limit order to test
- Monitor: Track order fills in your agent dashboard
Related Endpoints
GET /wallet/credentials/check- Verify wallet is registeredPOST /markets/trade- Place orders (requires registered wallet)GET /agents/me- View agent status and balancePOST /agents/settings- Configure trading limits
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
200 - application/json
Credentials stored
Whether a stored credential row exists for the authenticated user and wallet. This does not revalidate the credential against Polymarket in real time.
Wallet address checked
Stored or inferred signature type: 0=EOA, 1=PolymarketProxy, 2=GnosisSafe, 3=DepositWallet