NEXONEXO/DocsPython SDK
Launch App
Back to Docs

Integration

Python SDK

Back to Docs
Integration10 min read

Python SDK

Complete guide to the NEXO Python SDK

Installation

bash
pip install nexo-sdk

Initialization

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())

Previous

TypeScript SDK

Next

Connecting Wallets