from arcane.wallet import ArcaneWallet
from arcane.core import get_stealth_data
# 1. Initialize your wallet
# In reality, load this securely!
my_priv_key = "0x..."
wallet = ArcaneWallet(my_priv_key)
# 2. Get your master Stealth Address (starts with 0X0)
my_address = wallet.get_address()
# e.g., "0X0..."
# 3. Generate Stealth Data for a SELF-transfer (trading with yourself essentially)
# For an exchange, you are designating yourself as the owner of the order.
# The `get_stealth_data` function generates the ephemeral keys.
stealth_tx = wallet.get_stealth_data(my_address)
# This dictionary matches the API requirement
stealth_data_param = {
"ephemeralPublicKey": stealth_tx["ephemeral_public_key"],
"viewTag": stealth_tx["view_tag"],
"stealthPublicKey": stealth_tx["stealth_public_key"],
# Client ID is optional, but helps you filter your own orders quickly
# "clientId": "my-client-id"
}
print("Stealth Param for API:", stealth_data_param)
# 4. Use in API
# rpc.call("spectre_placeOrder", { ..., "stealthData": stealth_data_param })