Skip to content

Commit

Permalink
Merge pull request solomeowl#2 from solomeowl/feat/add-public-example
Browse files Browse the repository at this point in the history
feat: add public examples, setup.py
  • Loading branch information
solomeowl authored Mar 9, 2024
2 parents 2f4c013 + 4aee8d2 commit a459a03
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
35 changes: 35 additions & 0 deletions examples/example_public.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from backpack_exchange_sdk.public import PublicClient
public_client = PublicClient()

# get assets
print(public_client.get_assets())

# get markets
print(public_client.get_markets())

# get ticker
print(public_client.get_ticker('SOL_USDC'))

# get tickers
print(public_client.get_tickers())

# get order book depth
print(public_client.get_order_book_depth('SOL_USDC'))

# get klines
print(public_client.get_klines('SOL_USDC', '1m'))

# get status
print(public_client.get_status())

# send ping
print(public_client.send_ping())

# get system time
print(public_client.get_system_time())

# get recent trades
print(public_client.get_recent_trades('SOL_USDC'))

# get historical trades
print(public_client.get_historical_trades('SOL_USDC',10,0))
17 changes: 17 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from setuptools import setup, find_packages

setup(
name="backpack_exchange_sdk",
version="0.0.1",
author="solomeowl",
author_email="[email protected]",
description="A simple SDK for backpack exchange",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
url="https://github.com/solomeowl/backpack_exchange_sdk",
project_urls={
"Source": "https://github.com/solomeowl/backpack_exchange_sdk",
},

packages=find_packages(exclude=["tests"]),
)

0 comments on commit a459a03

Please sign in to comment.