Skip to main content

Python wrapper for Vortex SDK using Node.js subprocess

Project description

Vortex SDK - Python Wrapper

PyPI version Python License: MIT Tests Code style: black

A Python wrapper for the Vortex SDK enabling cross-chain ramp operations from Python applications.

Overview

This package wraps the TypeScript/JavaScript Vortex SDK using Node.js subprocess execution, allowing Python developers to interact with Vortex's API for on-ramp and off-ramp operations.

Installation

Prerequisites

  • Python 3.9+
  • Node.js 18+

Install

git clone https://github.com/pendulum-chain/vortex-python-sdk.git
cd vortex-python-sdk

# Install the Vortex SDK
npm install

# Install Python package
pip install -e .

Install from PyPI (when published)

pip install vortex-sdk-python
npm install @vortexfi/sdk

Quick Start

from vortex_sdk import VortexSDK, FiatToken, EvmToken, Networks

config = {
    "apiBaseUrl": "https://api.vortex.pendulumchain.tech"
}

sdk = VortexSDK(config)

quote = sdk.create_quote({
    "from": "pix",
    "inputAmount": "150000",
    "inputCurrency": FiatToken.BRL,
    "outputCurrency": EvmToken.USDC,
    "rampType": "on",
    "to": Networks.Polygon
})

print(f"Quote ID: {quote['id']}")

result = sdk.register_ramp(quote, {
    "destinationAddress": "0x1234567890123456789012345678901234567890",
    "taxId": "123.456.789-00"
})

print(f"Deposit QR Code: {result['rampProcess']['depositQrCode']}")

# After PIX payment
sdk.start_ramp(result['rampProcess']['id'])

Core Features

  • Simple Installation: Just npm install + pip install
  • No Build Required: Works with npm-published SDK
  • Full Compatibility: Uses Node.js subprocess for complete SDK support
  • Async Support: Both sync and async methods available
  • Type Hints: Full type annotations for IDE support

API Reference

See Full Documentation for complete API reference.

Key Methods

  • create_quote(request) - Create a new quote
  • get_quote(quote_id) - Get existing quote
  • register_ramp(quote, data) - Register ramp process
  • start_ramp(ramp_id) - Start the ramp
  • get_ramp_status(ramp_id) - Check ramp status

All methods have async versions: create_quote_async(), etc.

Examples

See examples/ directory for complete code samples:

  • brl_onramp_example.py - PIX to USDC
  • brl_offramp_example.py - USDC to PIX
  • async_example.py - Async/await usage

Development

pip install -e ".[dev]"
pytest tests/

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vortex_sdk_python-0.1.1.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vortex_sdk_python-0.1.1-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file vortex_sdk_python-0.1.1.tar.gz.

File metadata

  • Download URL: vortex_sdk_python-0.1.1.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for vortex_sdk_python-0.1.1.tar.gz
Algorithm Hash digest
SHA256 749e7685513bf96577e262c30fbbb444295353e2485fd110c235f63d69f385ec
MD5 f4971fe17a73e0faf6e66e4052c5b919
BLAKE2b-256 55e3f21d4643109fb127a333a98696c012650282b26efefd061b36fe37592a28

See more details on using hashes here.

File details

Details for the file vortex_sdk_python-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for vortex_sdk_python-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d5cbcefb3ff159b603ef56f0d2e1d566f27ebe4c2e3f0d84e13046ccf470635
MD5 04ce2f52913f439e36719240ff61eed7
BLAKE2b-256 cccbb96ab8126ebe81e0874d1b66bcc0c4f678919a28a1797c954f22c2f779b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page