from ravnexchange import RavnClient, RavnApiError
client = RavnClient(api_key="rvn_live_…") # optional: omit for the anonymous tier
try:
quote = client.get_quote({
"inputChainId": 1,
"outputChainId": -2,
"inputToken": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
"outputToken": "So11111111111111111111111111111111111111112",
"inputAmount": "1000000000000000000",
"userAddress": "0x1111111111111111111111111111111111111111",
"destinationAddress": "YourSo1anaWa11etAddressGoesHere311111111111",
})
execution = client.execute({"quoteToken": quote["quoteToken"]})
# Branch on execution["executionType"]: see Execution types.
except RavnApiError as e:
print(e.code, e.details, str(e))