Integration10 min read
Python SDK
Complete guide to the NEXO Python SDK
Installation
bash
pip install nexo-sdkInitialization
python
from nexo import NexoClient
client = NexoClient(
api_key="YOUR_API_KEY",
network="mainnet-beta"
)Core Methods
swap()
python
result = client.swap(
input_mint="SOL",
output_mint="USDC",
amount=1_000_000_000, # 1 SOL in lamports
slippage=0.5,
wallet=wallet_keypair
)
print(f"Signature: {result.signature}")execute()
python
result = client.execute(
transaction=serialized_tx,
protection="standard"
)scan()
python
report = client.scan(
address="contract_address",
depth="full"
)
print(f"Risk Score: {report.risk_score}")Async Support
python
import asyncio
from nexo import AsyncNexoClient
async def main():
client = AsyncNexoClient(api_key="YOUR_API_KEY")
result = await client.swap(...)
asyncio.run(main())