ostium-python-sdk 0.1.5__tar.gz → 0.1.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/PKG-INFO +1 -1
  2. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/ostium_python_sdk/config.py +0 -3
  3. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/ostium_python_sdk/ostium.py +2 -1
  4. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/ostium_python_sdk/sdk.py +2 -2
  5. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/ostium_python_sdk.egg-info/PKG-INFO +1 -1
  6. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/setup.py +1 -1
  7. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/README.md +0 -0
  8. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/ostium_python_sdk/__init__.py +0 -0
  9. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/ostium_python_sdk/abi.py +0 -0
  10. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/ostium_python_sdk/balance.py +0 -0
  11. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/ostium_python_sdk/constants.py +0 -0
  12. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/ostium_python_sdk/formulae.py +0 -0
  13. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/ostium_python_sdk/formulae_wrapper.py +0 -0
  14. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/ostium_python_sdk/price.py +0 -0
  15. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/ostium_python_sdk/subgraph.py +0 -0
  16. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/ostium_python_sdk/utils.py +0 -0
  17. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/ostium_python_sdk.egg-info/SOURCES.txt +0 -0
  18. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/ostium_python_sdk.egg-info/dependency_links.txt +0 -0
  19. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/ostium_python_sdk.egg-info/requires.txt +0 -0
  20. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/ostium_python_sdk.egg-info/top_level.txt +0 -0
  21. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/pyproject.toml +0 -0
  22. {ostium_python_sdk-0.1.5 → ostium_python_sdk-0.1.7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ostium-python-sdk
3
- Version: 0.1.5
3
+ Version: 0.1.7
4
4
  Summary: A python based SDK developed for interacting with Ostium, a leveraged trading application for trading currencies, commodities, indices, crypto and more.
5
5
  Home-page: https://github.com/0xOstium/ostium-python-sdk
6
6
  Author: ami@ostium.io
@@ -4,14 +4,12 @@ from typing import Dict, Optional
4
4
 
5
5
  @dataclass
6
6
  class NetworkConfig:
7
- rpc_url: str
8
7
  graph_url: str
9
8
  contracts: Dict[str, str]
10
9
 
11
10
  @classmethod
12
11
  def mainnet(cls) -> 'NetworkConfig':
13
12
  return cls(
14
- rpc_url="https://arb-mainnet.g.alchemy.com/v2/-dfuyiAmKg9seY_LJcy61q60GZELrNhX",
15
13
  graph_url="https://subgraph.satsuma-prod.com/391a61815d32/ostium/ost-prod/api",
16
14
  contracts={
17
15
  "usdc": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
@@ -23,7 +21,6 @@ class NetworkConfig:
23
21
  @classmethod
24
22
  def testnet(cls) -> 'NetworkConfig':
25
23
  return cls(
26
- rpc_url="https://arb-sepolia.g.alchemy.com/v2/xussaWLkWxKtZjCIlUjAYiMGV6_dRO-8",
27
24
  graph_url="https://subgraph.satsuma-prod.com/391a61815d32/ostium/ost-sep-final/api",
28
25
  contracts={
29
26
  "usdc": "0xe73B11Fb1e3eeEe8AF2a23079A4410Fe1B370548",
@@ -4,6 +4,7 @@ from enum import Enum
4
4
  from web3 import Web3
5
5
  from .abi import usdc_abi, ostium_trading_abi, ostium_trading_storage_abi
6
6
  from .utils import convert_to_scaled_integer, fromErrorCodeToMessage, get_tp_sl_prices, to_base_units
7
+ from eth_account.account import Account
7
8
 
8
9
 
9
10
  class OpenOrderType(Enum):
@@ -32,7 +33,7 @@ class Ostium:
32
33
  self.ostium_trading_contract = self.web3.eth.contract(
33
34
  address=self.ostium_trading_address, abi=ostium_trading_abi)
34
35
 
35
- def _get_account(self) -> Web3.eth.account:
36
+ def _get_account(self) -> Account:
36
37
  """Get account from stored private key"""
37
38
  return self.web3.eth.account.from_key(self.private_key)
38
39
 
@@ -13,10 +13,10 @@ class OstiumSDK:
13
13
  "No private key provided. Please provide via constructor or OSTIUM_PRIVATE_KEY environment variable")
14
14
 
15
15
  # Use provided RPC URL or get from env
16
- self.rpc_url = rpc_url or os.getenv('OSTIUM_RPC_URL')
16
+ self.rpc_url = rpc_url or os.getenv('RPC_URL')
17
17
  if not self.rpc_url:
18
18
  raise ValueError(
19
- "No RPC URL provided. Please provide via constructor or OSTIUM_RPC_URL environment variable")
19
+ f"No RPC URL provided for {network}. Please provide via constructor or RPC_URL environment variable")
20
20
 
21
21
  # Initialize Web3
22
22
  self.w3 = Web3(Web3.HTTPProvider(self.rpc_url))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ostium-python-sdk
3
- Version: 0.1.5
3
+ Version: 0.1.7
4
4
  Summary: A python based SDK developed for interacting with Ostium, a leveraged trading application for trading currencies, commodities, indices, crypto and more.
5
5
  Home-page: https://github.com/0xOstium/ostium-python-sdk
6
6
  Author: ami@ostium.io
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="ostium-python-sdk",
5
- version="0.1.5",
5
+ version="0.1.7",
6
6
  packages=find_packages(),
7
7
  install_requires=[
8
8
  "web3>=6.0.0",