"""Three things Orblivion refuses before anything is signed. Nothing here can send.""" import json from orblivion import OrblivionClient, OrblivionError from common import load wallet = OrblivionClient(account=load("wallet")) with open("agent.json", encoding="utf-8") as f: agent = json.load(f) def an_impersonator(): """A real copy of an Orbio agent's token from Orblivion's registry, one Dossier calls an impersonator.""" for tier in ("A", "B", "C"): found = wallet.search_tokens(kind="orbio_agent", tier=tier, shield=True, limit=100) for t in found["tokens"]: if (t.get("dossier") or {}).get("verdict") == "impersonator": return t raise SystemExit("no impersonator with a route in the registry right now") def attempt(what, call): try: call() print(f"{what}\n not refused?!\n") except OrblivionError as e: print(f"{what}\n refused: {e.code}\n {e.message}\n") copy = an_impersonator() print(f"Dossier calls {copy['address']} an impersonator: {copy['dossier'].get('url', '')}\n") attempt("1. Buy a token by its name, not its address", lambda: wallet.plan(sell="ETH", buy="AGENT", amount_usd=5)) attempt("2. Buy a known impersonator with Dossier Shield on", lambda: wallet.plan(sell="ETH", buy=copy["address"], amount_usd=5, shield=True)) attempt("3. Raise the agent's limit to $25 a trade; its signed session allows $10", lambda: wallet.hosted.update(agent["agent_id"], limits={"max_trade_usd": 25, "max_day_usd": 40, "max_position_usd": 120}))