Common issues and solutions for the Vortex SDK Python wrapper.
Cause: The compiled TypeScript SDK is not found.
Solution:
# Install the SDK locally
npm install @vortexfi/sdk@latest
# or install the SDK globally
npm install -g @vortexfi/sdk@latestCause: ES6 module syntax issue (should be fixed in latest version).
Solution: This has been fixed. If you still see this:
- Pull the latest code
- Reinstall:
pip install -e . --force-reinstall
Cause: The underlying JavaScript promise was rejected, often due to API errors.
Solution:
- Check your API endpoint is correct
- Verify network connectivity
- Check API response in browser:
https://your-api-url/health - Enable verbose error messages:
import logging logging.basicConfig(level=logging.DEBUG)
Cause: Various initialization issues.
Solutions:
-
Check SDK path:
import os os.environ['VORTEX_SDK_PATH'] = '/full/path/to/packages/sdk/dist/index.js' from vortex_sdk import VortexSDK
-
Verify Node.js:
node --version # Should be v18+ -
Check file permissions:
ls -la packages/sdk/dist/index.js chmod +r packages/sdk/dist/index.js
Solution:
-
Use forward slashes or raw strings for paths:
os.environ['VORTEX_SDK_PATH'] = r'C:\path\to\sdk\dist\index.js' # or os.environ['VORTEX_SDK_PATH'] = 'C:/path/to/sdk/dist/index.js'
-
Ensure Node.js is in PATH:
where node
Solution:
# Ubuntu/Debian
sudo apt-get install python3-dev
# Fedora
sudo dnf install python3-devel
# Then reinstall
pip install pythonmonkey --force-reinstallCauses:
- Invalid amount format
- Unsupported currency pair
- Network not available
Solutions:
-
Check amount format:
# Wrong amount = "100.00" # Correct (in smallest unit) amount = "10000" # For BRL (cents) amount = "1000000" # For USDC (6 decimals)
-
Verify currency pair:
from vortex_sdk import FiatToken, EvmToken # Supported pairs print(f"BRL: {FiatToken.BRL}") print(f"USDC: {EvmToken.USDC}")
-
Test API directly:
curl https://api.vortex.pendulumchain.tech/health
Causes:
- Missing required fields
- Invalid address format
- Invalid tax ID format
Solutions:
-
Verify all required fields:
# For BRL onramp data = { "destinationAddress": "0x...", # Valid EVM address "taxId": "123.456.789-00" # Valid CPF format } # For BRL offramp data = { "pixDestination": "email@example.com", "receiverTaxId": "123.456.789-00", "taxId": "123.456.789-00", "walletAddress": "0x..." }
-
Validate address:
address = "0x1234567890123456789012345678901234567890" assert len(address) == 42 assert address.startswith("0x")
Solution:
pip install pytest pytest-asyncio
pytest tests/ -vSolution:
# Install in development mode
pip install -e ".[dev]"
# Run from project root
pytest tests/Cause: Network manager initialization.
Solution: Initialization happens once. Reuse the SDK instance:
# Good
sdk = VortexSDK(config)
quote1 = sdk.create_quote(req1)
quote2 = sdk.create_quote(req2)
# Bad - creates new instance each time
sdk1 = VortexSDK(config)
quote1 = sdk1.create_quote(req1)
sdk2 = VortexSDK(config) # Unnecessary
quote2 = sdk2.create_quote(req2)Solution: Use context managers for long-running processes:
def process_ramp():
sdk = VortexSDK(config)
# ... do work
# SDK will be garbage collected when function returnsimport logging
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)# Check if SDK loaded
print(f"SDK instance: {sdk}")
print(f"SDK module: {dir(sdk._sdk)}")import os
import sys
print(f"Python: {sys.version}")
print(f"CWD: {os.getcwd()}")
print(f"SDK PATH: {os.environ.get('VORTEX_SDK_PATH', 'Not set')}")If your issue isn't listed here:
-
Run the test script:
python test_import.py
-
Check GitHub Issues: https://github.com/pendulum-chain/vortex/issues
-
Create a new issue with:
- Python version:
python --version - Node.js version:
node --version - OS and version
- Full error message
- Minimal reproduction code
- Python version: