Skip to content

Commit 30cf2c6

Browse files
committed
client: expose api_url on Client
1 parent a6c7d22 commit 30cf2c6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

onekey_client/client.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from pathlib import Path
55
from typing import Optional, List, Dict
66

7+
from httpx import URL
8+
79
try:
810
from importlib import resources
911
except ImportError:
@@ -52,6 +54,7 @@ def __init__(
5254
ca_bundle: Optional[Path] = None,
5355
disable_tls_verify: Optional[bool] = False,
5456
):
57+
self._api_url = URL(api_url)
5558
self._client = self._setup_httpx_client(api_url, ca_bundle, disable_tls_verify)
5659

5760
self._id_token_public_key = self._load_key("id-token-public-key")
@@ -87,6 +90,10 @@ def _load_key(self, key_name: str, path: Optional[Path] = None):
8790
response.raise_for_status()
8891
return response.read()
8992

93+
@property
94+
def api_url(self) -> URL:
95+
return self._api_url
96+
9097
def login(self, email: str, password: str):
9198
nonce = secrets.token_urlsafe()
9299
payload = {

0 commit comments

Comments
 (0)