Skip to main content

Vega API client for gRPC and REST

Project description

Vega API client

Python tests

This is the Vega API client, which can talk to a Vega node using gRPC or REST.

Example

from google.protobuf.empty_pb2 import Empty

import vegaapiclient as vac

# Either gRPC
api = vac.API.GRPC
url = "veganode.example.com:1234"

# Or REST
# api = vac.API.REST
# url = "https://veganode.example.com"

# Create client for accessing public data
datacli = vac.VegaTradingDataClient(api, url)

# Create client for trading (e.g. submitting orders)
tradingcli = vac.VegaTradingClient(api, url)

# Get a list of markets
markets = datacli.Markets(Empty()).markets

# Get a specific market by ID
req = vac.grpc.api.trading.MarketByIDRequest(marketID="MARKETID")
market = datacli.MarketByID(req)

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

Vega API client-0.0.10.tar.gz (37.2 kB view hashes)

Uploaded Source

Built Distribution

Vega_API_client-0.0.10-py3-none-any.whl (45.6 kB view hashes)

Uploaded Python 3

Supported by

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