ostium-python-sdk 0.1.9__tar.gz → 0.1.11__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.
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/PKG-INFO +31 -4
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/README.md +30 -3
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk/sdk.py +10 -0
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk.egg-info/PKG-INFO +31 -4
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/setup.py +1 -1
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk/__init__.py +0 -0
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk/abi.py +0 -0
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk/balance.py +0 -0
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk/config.py +0 -0
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk/constants.py +0 -0
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk/formulae.py +0 -0
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk/formulae_wrapper.py +0 -0
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk/ostium.py +0 -0
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk/price.py +0 -0
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk/subgraph.py +0 -0
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk/utils.py +0 -0
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk.egg-info/SOURCES.txt +0 -0
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk.egg-info/dependency_links.txt +0 -0
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk.egg-info/requires.txt +0 -0
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk.egg-info/top_level.txt +0 -0
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/pyproject.toml +0 -0
- {ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ostium-python-sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.11
|
|
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
|
|
@@ -47,16 +47,43 @@ from dotenv import load_dotenv
|
|
|
47
47
|
# Load environment variables if using .env file
|
|
48
48
|
load_dotenv()
|
|
49
49
|
|
|
50
|
-
#
|
|
51
|
-
|
|
50
|
+
# Get private key from environment variable
|
|
51
|
+
private_key = os.getenv('PRIVATE_KEY')
|
|
52
|
+
if not private_key:
|
|
53
|
+
raise ValueError("PRIVATE_KEY not found in .env file")
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
rpc_url = os.getenv('RPC_URL')
|
|
56
|
+
if not rpc_url:
|
|
57
|
+
raise ValueError("RPC_URL not found in .env file")
|
|
58
|
+
|
|
59
|
+
# Initialize SDK
|
|
60
|
+
config = NetworkConfig.testnet()
|
|
61
|
+
sdk = OstiumSDK(config, private_key)
|
|
62
|
+
|
|
63
|
+
# Or initialize with explicit private key & rpc url
|
|
54
64
|
# sdk = OstiumSDK(
|
|
55
65
|
# network="arbitrum",
|
|
56
66
|
# private_key="your_private_key_here",
|
|
57
67
|
# rpc_url="https://arb1.arbitrum.io/rpc"
|
|
58
68
|
# )
|
|
59
69
|
|
|
70
|
+
# Get all available pairs
|
|
71
|
+
pairs = await sdk.subgraph.get_pairs()
|
|
72
|
+
|
|
73
|
+
print("\nPair Information:")
|
|
74
|
+
print("----------------------------------------")
|
|
75
|
+
|
|
76
|
+
for pair in pairs:
|
|
77
|
+
# Get detailed information for each pair from the Graph API
|
|
78
|
+
pair_details = await sdk.subgraph.get_pair_details(pair['id'])
|
|
79
|
+
print("\nPair Details:")
|
|
80
|
+
print("----------------------------------------")
|
|
81
|
+
# Print all available fields in pair_details
|
|
82
|
+
for key, value in pair_details.items():
|
|
83
|
+
print(f"{key}: {value}")
|
|
84
|
+
print("----------------------------------------")
|
|
85
|
+
|
|
86
|
+
|
|
60
87
|
# Define trade parameters
|
|
61
88
|
trade_params = {
|
|
62
89
|
'collateral': 100, # USDC amount
|
|
@@ -32,16 +32,43 @@ from dotenv import load_dotenv
|
|
|
32
32
|
# Load environment variables if using .env file
|
|
33
33
|
load_dotenv()
|
|
34
34
|
|
|
35
|
-
#
|
|
36
|
-
|
|
35
|
+
# Get private key from environment variable
|
|
36
|
+
private_key = os.getenv('PRIVATE_KEY')
|
|
37
|
+
if not private_key:
|
|
38
|
+
raise ValueError("PRIVATE_KEY not found in .env file")
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
rpc_url = os.getenv('RPC_URL')
|
|
41
|
+
if not rpc_url:
|
|
42
|
+
raise ValueError("RPC_URL not found in .env file")
|
|
43
|
+
|
|
44
|
+
# Initialize SDK
|
|
45
|
+
config = NetworkConfig.testnet()
|
|
46
|
+
sdk = OstiumSDK(config, private_key)
|
|
47
|
+
|
|
48
|
+
# Or initialize with explicit private key & rpc url
|
|
39
49
|
# sdk = OstiumSDK(
|
|
40
50
|
# network="arbitrum",
|
|
41
51
|
# private_key="your_private_key_here",
|
|
42
52
|
# rpc_url="https://arb1.arbitrum.io/rpc"
|
|
43
53
|
# )
|
|
44
54
|
|
|
55
|
+
# Get all available pairs
|
|
56
|
+
pairs = await sdk.subgraph.get_pairs()
|
|
57
|
+
|
|
58
|
+
print("\nPair Information:")
|
|
59
|
+
print("----------------------------------------")
|
|
60
|
+
|
|
61
|
+
for pair in pairs:
|
|
62
|
+
# Get detailed information for each pair from the Graph API
|
|
63
|
+
pair_details = await sdk.subgraph.get_pair_details(pair['id'])
|
|
64
|
+
print("\nPair Details:")
|
|
65
|
+
print("----------------------------------------")
|
|
66
|
+
# Print all available fields in pair_details
|
|
67
|
+
for key, value in pair_details.items():
|
|
68
|
+
print(f"{key}: {value}")
|
|
69
|
+
print("----------------------------------------")
|
|
70
|
+
|
|
71
|
+
|
|
45
72
|
# Define trade parameters
|
|
46
73
|
trade_params = {
|
|
47
74
|
'collateral': 100, # USDC amount
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
from dotenv import load_dotenv
|
|
2
2
|
import os
|
|
3
|
+
from .balance import Balance
|
|
4
|
+
from .price import Price
|
|
3
5
|
from web3 import Web3
|
|
4
6
|
from .ostium import Ostium
|
|
5
7
|
from .config import NetworkConfig
|
|
6
8
|
from typing import Union
|
|
9
|
+
from .subgraph import SubgraphClient
|
|
7
10
|
|
|
8
11
|
|
|
9
12
|
class OstiumSDK:
|
|
@@ -47,3 +50,10 @@ class OstiumSDK:
|
|
|
47
50
|
self.network_config.contracts["trading"],
|
|
48
51
|
private_key=self.private_key
|
|
49
52
|
)
|
|
53
|
+
|
|
54
|
+
# Initialize subgraph client
|
|
55
|
+
self.subgraph = SubgraphClient(url=self.network_config.graph_url)
|
|
56
|
+
|
|
57
|
+
self.balance = Balance(self.web3, self.network_config.contracts["usdc"])
|
|
58
|
+
self.price = Price()
|
|
59
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ostium-python-sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.11
|
|
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
|
|
@@ -47,16 +47,43 @@ from dotenv import load_dotenv
|
|
|
47
47
|
# Load environment variables if using .env file
|
|
48
48
|
load_dotenv()
|
|
49
49
|
|
|
50
|
-
#
|
|
51
|
-
|
|
50
|
+
# Get private key from environment variable
|
|
51
|
+
private_key = os.getenv('PRIVATE_KEY')
|
|
52
|
+
if not private_key:
|
|
53
|
+
raise ValueError("PRIVATE_KEY not found in .env file")
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
rpc_url = os.getenv('RPC_URL')
|
|
56
|
+
if not rpc_url:
|
|
57
|
+
raise ValueError("RPC_URL not found in .env file")
|
|
58
|
+
|
|
59
|
+
# Initialize SDK
|
|
60
|
+
config = NetworkConfig.testnet()
|
|
61
|
+
sdk = OstiumSDK(config, private_key)
|
|
62
|
+
|
|
63
|
+
# Or initialize with explicit private key & rpc url
|
|
54
64
|
# sdk = OstiumSDK(
|
|
55
65
|
# network="arbitrum",
|
|
56
66
|
# private_key="your_private_key_here",
|
|
57
67
|
# rpc_url="https://arb1.arbitrum.io/rpc"
|
|
58
68
|
# )
|
|
59
69
|
|
|
70
|
+
# Get all available pairs
|
|
71
|
+
pairs = await sdk.subgraph.get_pairs()
|
|
72
|
+
|
|
73
|
+
print("\nPair Information:")
|
|
74
|
+
print("----------------------------------------")
|
|
75
|
+
|
|
76
|
+
for pair in pairs:
|
|
77
|
+
# Get detailed information for each pair from the Graph API
|
|
78
|
+
pair_details = await sdk.subgraph.get_pair_details(pair['id'])
|
|
79
|
+
print("\nPair Details:")
|
|
80
|
+
print("----------------------------------------")
|
|
81
|
+
# Print all available fields in pair_details
|
|
82
|
+
for key, value in pair_details.items():
|
|
83
|
+
print(f"{key}: {value}")
|
|
84
|
+
print("----------------------------------------")
|
|
85
|
+
|
|
86
|
+
|
|
60
87
|
# Define trade parameters
|
|
61
88
|
trade_params = {
|
|
62
89
|
'collateral': 100, # USDC amount
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk.egg-info/requires.txt
RENAMED
|
File without changes
|
{ostium_python_sdk-0.1.9 → ostium_python_sdk-0.1.11}/ostium_python_sdk.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|