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

Uploaded Source

Built Distribution

vyper_client_py-0.1.2-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vyper_client_py-0.1.2.tar.gz
  • Upload date:
  • Size: 14.7 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.2.tar.gz
Algorithm Hash digest
SHA256 3602b8c6422366b9f7d50fde96c066464ef9f85b776edd67cc14317e144433c9
MD5 28f4045744a1ab9019efa02d55a1e593
BLAKE2b-256 c8874ae25f5e22f1043f37058cf3fbc9f21162c1f0504e30e3c90a5446667a0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vyper_client_py-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c777ad9b35d4671cd3cb96ebe135074b5dfc81bda6baff20d125bfab9b85d625
MD5 7c271d3f54c6e5e1d5ce38a549aa37a7
BLAKE2b-256 936154bdf25467aa4fbbbeefe8103e5b4dd7e6ba61255248437889926e9f1afc

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