Skip to main content

A Python SDK for the Vyper API

Project description

Vyper API Python SDK

Vyper

A Python SDK for interacting with the Vyper API. This library allows developers to integrate Vyper's http and websocket api into their Python applications with ease.

Table of Contents

Installation

To install the Vyper API Python SDK, use pip:

pip install vyper-client-py

Quick Start

Here's a simple example to get you started:

from vyper_client import VyperClient

# Initialize the client with your API key
client = VyperClient(api_key="your_api_key_here")

# Get the list of chain IDs supported by Vyper
chain_ids = client.get_chain_ids()
print("Supported chain IDs:", chain_ids)

Usage

Client Initialization

The VyperClient class provides access to the RESTful API endpoints:

from vyper_client import VyperClient

# Create a client instance
client = VyperClient(api_key="your_api_key_here")

REST API Example

Retrieve the market data for a specific token:

# Fetch the All-Time High (ATH) data for a token
token_ath = client.get_token_ath(chain_id=1, market_id="AVs9TA4nWDzfPJE9gGVNJMVhcQy3V9PGazuz33BfG2RA")

print(f"Market Cap USD: {token_ath.market_cap_usd}")
print(f"Timestamp: {token_ath.timestamp}")

WebSocket API Example

import asyncio
from vyper_client import VyperWebsocketClient, FeedType, SubscriptionType

async def main():
    # Create a websocket client instance
    ws_client = VyperWebsocketClient(api_key="your_api_key_here")

    # Define a message handler
    async def message_handler(message):
        print("Received message:", message)

    ws_client.set_message_handler(message_handler)

    # Connect to the WebSocket and subscribe to token events
    await ws_client.connect(FeedType.TOKEN_EVENTS)
    await ws_client.subscribe(
        FeedType.TOKEN_EVENTS,
        subscription_message={
            "action": "subscribe",
            "types": [SubscriptionType.PUMPFUN_TOKENS.value]
        }
    )

    # Listen for incoming messages
    await ws_client.listen()

# Run the asyncio event loop
asyncio.run(main())

API Documentation

For detailed information on the Vyper API, refer to the official documentation:

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

vyper_client_py-0.1.5.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

vyper_client_py-0.1.5-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file vyper_client_py-0.1.5.tar.gz.

File metadata

  • Download URL: vyper_client_py-0.1.5.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.1

File hashes

Hashes for vyper_client_py-0.1.5.tar.gz
Algorithm Hash digest
SHA256 c1186b78401d8d3d16a9137a3834024164be305b6e8707b92e1526c2858058a8
MD5 a4dde4d3b8800756d4bc769740815cc1
BLAKE2b-256 e8cfb0e6c267bfb3594a7bdd90a35b34f87f633293c02f355b73515dd42d2461

See more details on using hashes here.

File details

Details for the file vyper_client_py-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for vyper_client_py-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3ed1cc0343b4c710dd8d22ca21c23fb690826a144e592d09fa2178217fa9ae7a
MD5 ed05fb541b27a98464517d677760ff5a
BLAKE2b-256 b2a800a6c1c2b0e4108a88e4ba929223c0a79cc916deaa4ae2da02b522012f38

See more details on using hashes here.

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