oli-python 1.0.1__tar.gz → 1.0.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oli-python
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Python SDK for interacting with the Open Labels Initiative; A framework for address labels in the blockchain space. Read & write labels into the OLI Label Pool, check your labels for OLI compliance.
5
5
  Home-page: https://github.com/openlabelsinitiative/oli-python
6
6
  Author: Lorenz Lehmann
@@ -90,8 +90,8 @@ print(f"Labels batch revoked with hash: {trx_hash}")
90
90
  from oli import OLI
91
91
  import os
92
92
 
93
- # Initialize the client (read only mode doesn't require a private key)
94
- oli = OLI(is_production=True)
93
+ # Initialize the client (read mode only doesn't require a private key)
94
+ oli = OLI()
95
95
 
96
96
  # Query attestations for a specific address
97
97
  result = oli.graphql_query_attestations(address=address)
@@ -63,8 +63,8 @@ print(f"Labels batch revoked with hash: {trx_hash}")
63
63
  from oli import OLI
64
64
  import os
65
65
 
66
- # Initialize the client (read only mode doesn't require a private key)
67
- oli = OLI(is_production=True)
66
+ # Initialize the client (read mode only doesn't require a private key)
67
+ oli = OLI()
68
68
 
69
69
  # Query attestations for a specific address
70
70
  result = oli.graphql_query_attestations(address=address)
@@ -12,7 +12,7 @@ from oli.data.fetcher import DataFetcher
12
12
  from oli.data.graphql import GraphQLClient
13
13
 
14
14
  class OLI:
15
- def __init__(self, private_key: str, is_production: bool=True, custom_rpc_url: str=None) -> None:
15
+ def __init__(self, private_key: str=None, is_production: bool=True, custom_rpc_url: str=None) -> None:
16
16
  """
17
17
  Initialize the OLI API client.
18
18
 
@@ -51,18 +51,19 @@ class OLI:
51
51
  private_key = os.environ.get('OLI_PRIVATE_KEY')
52
52
  if not private_key:
53
53
  print("WARNING: Private key not provided. Please set the OLI_PRIVATE_KEY environment variable in case you plan to submit labels.")
54
-
55
- # Convert the hex private key to the proper key object
56
- self.private_key = private_key
57
- if private_key.startswith('0x'):
58
- private_key_bytes = private_key[2:]
59
- else:
60
- private_key_bytes = private_key
61
- private_key_obj = keys.PrivateKey(bytes.fromhex(private_key_bytes))
54
+ print("WARNING: OLI client in read mode only.")
62
55
 
63
- # Create account from private key
64
- self.account = eth_account.Account.from_key(private_key_obj)
65
- self.address = self.account.address
56
+ self.private_key = private_key
57
+ if self.private_key:
58
+ # Convert the hex private key to the proper key object
59
+ if private_key.startswith('0x'):
60
+ private_key_bytes = private_key[2:]
61
+ else:
62
+ private_key_bytes = private_key
63
+ # Create account from private key
64
+ private_key_obj = keys.PrivateKey(bytes.fromhex(private_key_bytes))
65
+ self.account = eth_account.Account.from_key(private_key_obj)
66
+ self.address = self.account.address
66
67
 
67
68
  # Label Pool Schema for OLI
68
69
  self.oli_label_pool_schema = '0xb763e62d940bed6f527dd82418e146a904e62a297b8fa765c9b3e1f0bc6fdd68'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oli-python
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Python SDK for interacting with the Open Labels Initiative; A framework for address labels in the blockchain space. Read & write labels into the OLI Label Pool, check your labels for OLI compliance.
5
5
  Home-page: https://github.com/openlabelsinitiative/oli-python
6
6
  Author: Lorenz Lehmann
@@ -90,8 +90,8 @@ print(f"Labels batch revoked with hash: {trx_hash}")
90
90
  from oli import OLI
91
91
  import os
92
92
 
93
- # Initialize the client (read only mode doesn't require a private key)
94
- oli = OLI(is_production=True)
93
+ # Initialize the client (read mode only doesn't require a private key)
94
+ oli = OLI()
95
95
 
96
96
  # Query attestations for a specific address
97
97
  result = oli.graphql_query_attestations(address=address)
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setup(
7
7
  name="oli-python",
8
- version="1.0.1",
8
+ version="1.0.2",
9
9
  author="Lorenz Lehmann",
10
10
  author_email="lorenz@growthepie.xyz",
11
11
  description="Python SDK for interacting with the Open Labels Initiative; A framework for address labels in the blockchain space. Read & write labels into the OLI Label Pool, check your labels for OLI compliance.",
File without changes
File without changes