Python
Complete example: sign a message, verify your wallet, and fetch the oracle signal.
Requirements
pip install web3 requestsFull Example
from web3 import Web3
from eth_account.messages import encode_defunct
import requests
import time
# Configuration
WALLET = "0xYourWalletAddress"
PRIVATE_KEY = "0xYourPrivateKey" # never commit this
BASE_URL = "https://bv7x.ai"
# Step 1: Sign verification message
timestamp = int(time.time())
message = f"Verify BV7X balance: {WALLET}:{timestamp}"
w3 = Web3()
signed = w3.eth.account.sign_message(
encode_defunct(text=message), private_key=PRIVATE_KEY
)
# Step 2: Verify wallet and get bearer token
verify_resp = requests.post(f"{BASE_URL}/api/bv7x/oracle/verify", json={
"wallet": WALLET,
"signature": signed.signature.hex(),
"timestamp": timestamp,
})
verify_data = verify_resp.json()
print(f"Tier: {verify_data['tier']}, Balance: {verify_data['balance']}")
token = verify_data["token"]
# Step 3: Fetch the oracle signal
headers = {"Authorization": f"Bearer {token}"}
signal = requests.get(f"{BASE_URL}/api/bv7x/oracle", headers=headers).json()
print(f"Signal: {signal['signal']}")
print(f"Direction: {signal['direction']}")
print(f"Confidence: {signal['confidence']}")
print(f"Regime: {signal['regime']}")
print(f"BTC: ${signal['btcPrice']:,}")Output
Notes
The
PRIVATE_KEYis used only to sign the verification message. It is never sent to the server.The bearer token expires after 30 minutes. Call the verify flow again to renew.
For Premium tier endpoints, your wallet must hold 1B+ $BV7X.
Next
Node.js Example -- same flow in JavaScript
cURL Examples -- quick command reference
Last updated
