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.4.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: vyper_client_py-0.1.4.tar.gz
  • Upload date:
  • Size: 14.8 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.4.tar.gz
Algorithm Hash digest
SHA256 bfd992650d8e2016ced9116276ba30bd3d13423b892dd45f17ce816a72148e9f
MD5 bc20728855a973d85d3890a6a690fcd8
BLAKE2b-256 42c1824cf66182cb26ce22e117ca6a8bcfadd6cd15a44908eeb48602211e6aa2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vyper_client_py-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 64b201cad6437e27e17d82e4efea1ef82fd58dc7a5ce45cf4b3c33034e741e52
MD5 7d42e57f52a0fcedaf19d9caea22105e
BLAKE2b-256 7ce1de1e3148b0e753ed38c73d6a65f8751d9b59bb11c1e8b1234ddd1a73b3b9

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