from glide_client import GlideClient, StepUpRequired
import os
client = GlideClient(grant_token=os.environ["GLIDE_GRANT_TOKEN"])
params = {
"new_signer_public_key": "0x04a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",
"reason": "scheduled_rotation",
}
first = client.call("treasury", "vault.rotateSigner", params)
if isinstance(first, StepUpRequired):
sigil = redirect_and_collect_sigil(first.step_up_url)
result = client.call("treasury", "vault.rotateSigner", {**params, "step_up_sigil": sigil})
print("Rotated. New policy version:", result["new_policy_version"])