typed-evedex 0.1.0__py3-none-any.whl
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.
- typed_evedex/__init__.py +15 -0
- typed_evedex/__init__.pyi +27 -0
- typed_evedex/auth/__init__.py +53 -0
- typed_evedex/auth/api_keys/__init__.py +14 -0
- typed_evedex/auth/api_keys/create.py +51 -0
- typed_evedex/auth/api_keys/delete.py +37 -0
- typed_evedex/auth/api_keys/list.py +139 -0
- typed_evedex/auth/api_keys/regenerate.py +38 -0
- typed_evedex/auth/api_keys/restore.py +37 -0
- typed_evedex/auth/location.py +63 -0
- typed_evedex/auth/nonce.py +32 -0
- typed_evedex/auth/ping.py +29 -0
- typed_evedex/auth/session/__init__.py +11 -0
- typed_evedex/auth/session/logout.py +25 -0
- typed_evedex/auth/session/revoke.py +25 -0
- typed_evedex/auth/sub_accounts/__init__.py +13 -0
- typed_evedex/auth/sub_accounts/create.py +84 -0
- typed_evedex/auth/sub_accounts/list.py +130 -0
- typed_evedex/auth/sub_accounts/switch.py +41 -0
- typed_evedex/auth/sub_accounts/update.py +50 -0
- typed_evedex/auth/user/__init__.py +12 -0
- typed_evedex/auth/user/balance.py +35 -0
- typed_evedex/auth/user/me.py +22 -0
- typed_evedex/auth/user/wallet_transfers.py +321 -0
- typed_evedex/core/__init__.py +5 -0
- typed_evedex/core/__init__.pyi +53 -0
- typed_evedex/core/auth.py +268 -0
- typed_evedex/core/client.py +121 -0
- typed_evedex/core/endpoint/__init__.py +1 -0
- typed_evedex/core/endpoint/rpc.py +200 -0
- typed_evedex/core/endpoint/stream.py +135 -0
- typed_evedex/core/environments.py +53 -0
- typed_evedex/core/exc.py +23 -0
- typed_evedex/core/signing.py +292 -0
- typed_evedex/core/transport/__init__.py +1 -0
- typed_evedex/core/transport/http.py +151 -0
- typed_evedex/core/transport/ws.py +494 -0
- typed_evedex/core/types.py +61 -0
- typed_evedex/core/wire.py +95 -0
- typed_evedex/exchange/__init__.py +82 -0
- typed_evedex/exchange/account/__init__.py +41 -0
- typed_evedex/exchange/account/available_balance.py +92 -0
- typed_evedex/exchange/account/balance.py +40 -0
- typed_evedex/exchange/account/balance_chart.py +76 -0
- typed_evedex/exchange/account/create.py +44 -0
- typed_evedex/exchange/account/deposit_details.py +46 -0
- typed_evedex/exchange/account/faucet/__init__.py +11 -0
- typed_evedex/exchange/account/faucet/check.py +29 -0
- typed_evedex/exchange/account/faucet/claim.py +25 -0
- typed_evedex/exchange/account/funding.py +42 -0
- typed_evedex/exchange/account/funding_transfers.py +222 -0
- typed_evedex/exchange/account/me.py +25 -0
- typed_evedex/exchange/account/power.py +73 -0
- typed_evedex/exchange/account/statistics.py +50 -0
- typed_evedex/exchange/fills.py +127 -0
- typed_evedex/exchange/market/__init__.py +18 -0
- typed_evedex/exchange/market/coins.py +51 -0
- typed_evedex/exchange/market/info.py +58 -0
- typed_evedex/exchange/market/instrument.py +32 -0
- typed_evedex/exchange/market/instruments.py +221 -0
- typed_evedex/exchange/market/order_book.py +80 -0
- typed_evedex/exchange/market/recent_trades.py +55 -0
- typed_evedex/exchange/market/trades.py +64 -0
- typed_evedex/exchange/orders/__init__.py +38 -0
- typed_evedex/exchange/orders/cancel.py +37 -0
- typed_evedex/exchange/orders/cancel_by_ids.py +51 -0
- typed_evedex/exchange/orders/cancel_by_instrument.py +47 -0
- typed_evedex/exchange/orders/fills.py +72 -0
- typed_evedex/exchange/orders/get.py +33 -0
- typed_evedex/exchange/orders/list.py +369 -0
- typed_evedex/exchange/orders/opened.py +83 -0
- typed_evedex/exchange/orders/place_limit.py +92 -0
- typed_evedex/exchange/orders/place_limit_batch.py +80 -0
- typed_evedex/exchange/orders/place_market.py +80 -0
- typed_evedex/exchange/orders/place_stop_limit.py +85 -0
- typed_evedex/exchange/orders/replace_limit.py +65 -0
- typed_evedex/exchange/orders/replace_limit_batch.py +72 -0
- typed_evedex/exchange/orders/replace_stop_limit.py +63 -0
- typed_evedex/exchange/ping.py +29 -0
- typed_evedex/exchange/positions/__init__.py +13 -0
- typed_evedex/exchange/positions/close.py +62 -0
- typed_evedex/exchange/positions/history.py +191 -0
- typed_evedex/exchange/positions/list.py +52 -0
- typed_evedex/exchange/positions/set_leverage.py +57 -0
- typed_evedex/exchange/sub_accounts/__init__.py +15 -0
- typed_evedex/exchange/sub_accounts/order.py +39 -0
- typed_evedex/exchange/sub_accounts/orders.py +370 -0
- typed_evedex/exchange/sub_accounts/position_history.py +198 -0
- typed_evedex/exchange/sub_accounts/positions.py +53 -0
- typed_evedex/exchange/sub_accounts/state.py +41 -0
- typed_evedex/exchange/sub_accounts/statistics.py +62 -0
- typed_evedex/exchange/tpsl/__init__.py +13 -0
- typed_evedex/exchange/tpsl/cancel.py +38 -0
- typed_evedex/exchange/tpsl/create.py +66 -0
- typed_evedex/exchange/tpsl/list.py +136 -0
- typed_evedex/exchange/tpsl/update.py +66 -0
- typed_evedex/exchange/transfers/__init__.py +12 -0
- typed_evedex/exchange/transfers/detail.py +38 -0
- typed_evedex/exchange/transfers/list.py +207 -0
- typed_evedex/exchange/transfers/withdraw.py +59 -0
- typed_evedex/main.py +51 -0
- typed_evedex/market_data/__init__.py +11 -0
- typed_evedex/market_data/candles.py +207 -0
- typed_evedex/market_data/ping.py +29 -0
- typed_evedex/py.typed +0 -0
- typed_evedex/schemas.py +1012 -0
- typed_evedex/streams/__init__.py +41 -0
- typed_evedex/streams/account/__init__.py +17 -0
- typed_evedex/streams/account/fees.py +50 -0
- typed_evedex/streams/account/fills.py +50 -0
- typed_evedex/streams/account/funding.py +42 -0
- typed_evedex/streams/account/orders.py +101 -0
- typed_evedex/streams/account/positions.py +62 -0
- typed_evedex/streams/account/tpsl.py +56 -0
- typed_evedex/streams/account/transfers.py +68 -0
- typed_evedex/streams/account/user.py +37 -0
- typed_evedex/streams/candles.py +40 -0
- typed_evedex/streams/coin_prices.py +44 -0
- typed_evedex/streams/funding_rates.py +40 -0
- typed_evedex/streams/heartbeat.py +35 -0
- typed_evedex/streams/info.py +37 -0
- typed_evedex/streams/instruments.py +87 -0
- typed_evedex/streams/order_book.py +70 -0
- typed_evedex/streams/order_book_best.py +68 -0
- typed_evedex/streams/recent_trades.py +50 -0
- typed_evedex/streams/trades.py +43 -0
- typed_evedex-0.1.0.dist-info/METADATA +106 -0
- typed_evedex-0.1.0.dist-info/RECORD +131 -0
- typed_evedex-0.1.0.dist-info/WHEEL +5 -0
- typed_evedex-0.1.0.dist-info/licenses/LICENSE +21 -0
- typed_evedex-0.1.0.dist-info/top_level.txt +1 -0
typed_evedex/__init__.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""A fully typed, validated async client for the Evedex API.
|
|
2
|
+
|
|
3
|
+
Examples:
|
|
4
|
+
```python
|
|
5
|
+
from typed_evedex import Evedex
|
|
6
|
+
|
|
7
|
+
async with Evedex.new(public=True) as client:
|
|
8
|
+
info = await client.exchange.market.info()
|
|
9
|
+
print(info['state'])
|
|
10
|
+
```
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
import lazy_loader as lazy
|
|
14
|
+
|
|
15
|
+
__getattr__, __dir__, __all__ = lazy.attach_stub(__name__, __file__)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from .main import Evedex
|
|
2
|
+
from .core import (
|
|
3
|
+
Error,
|
|
4
|
+
NetworkError,
|
|
5
|
+
ValidationError,
|
|
6
|
+
ApiError,
|
|
7
|
+
BadRequest,
|
|
8
|
+
AuthError,
|
|
9
|
+
RateLimited,
|
|
10
|
+
LogicError,
|
|
11
|
+
Environment,
|
|
12
|
+
EnvironmentProfile,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
'Evedex',
|
|
17
|
+
'Error',
|
|
18
|
+
'NetworkError',
|
|
19
|
+
'ValidationError',
|
|
20
|
+
'ApiError',
|
|
21
|
+
'BadRequest',
|
|
22
|
+
'AuthError',
|
|
23
|
+
'RateLimited',
|
|
24
|
+
'LogicError',
|
|
25
|
+
'Environment',
|
|
26
|
+
'EnvironmentProfile',
|
|
27
|
+
]
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Generated by typed-dev — see CONTRIBUTING.md.
|
|
2
|
+
from functools import cached_property
|
|
3
|
+
from .api_keys import ApiKeys
|
|
4
|
+
from .location import LocationEndpoint
|
|
5
|
+
from .nonce import NonceEndpoint
|
|
6
|
+
from .ping import Ping
|
|
7
|
+
from .session import Session
|
|
8
|
+
from .sub_accounts import SubAccounts
|
|
9
|
+
from .user import User
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Auth(LocationEndpoint, NonceEndpoint, Ping):
|
|
13
|
+
"""Auth REST service (`auth-api`): Sign-In with Ethereum sessions, the wallet user, API keys and sub-accounts.
|
|
14
|
+
|
|
15
|
+
References:
|
|
16
|
+
- [Upstream docs](https://docs.evedex.com/developers/developers/authorization)
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
@cached_property
|
|
20
|
+
def api_keys(self) -> ApiKeys:
|
|
21
|
+
"""API keys for read access to the Exchange service: list, create (EIP-712 signed), regenerate, restore and delete.
|
|
22
|
+
|
|
23
|
+
References:
|
|
24
|
+
- [Upstream docs](https://docs.evedex.com/developers/developers/authorization)
|
|
25
|
+
"""
|
|
26
|
+
return ApiKeys(client=self.client)
|
|
27
|
+
|
|
28
|
+
@cached_property
|
|
29
|
+
def session(self) -> Session:
|
|
30
|
+
"""Sign-In with Ethereum (EIP-4361) sessions: sign in, refresh, revoke and log out.
|
|
31
|
+
|
|
32
|
+
References:
|
|
33
|
+
- [Upstream docs](https://docs.evedex.com/developers/developers/authorization)
|
|
34
|
+
"""
|
|
35
|
+
return Session(client=self.client)
|
|
36
|
+
|
|
37
|
+
@cached_property
|
|
38
|
+
def sub_accounts(self) -> SubAccounts:
|
|
39
|
+
"""Sub-accounts of the wallet: list, create, switch the session to one, rename or archive.
|
|
40
|
+
|
|
41
|
+
References:
|
|
42
|
+
- [Upstream docs](https://docs.evedex.com/developers/developers/authorization)
|
|
43
|
+
"""
|
|
44
|
+
return SubAccounts(client=self.client)
|
|
45
|
+
|
|
46
|
+
@cached_property
|
|
47
|
+
def user(self) -> User:
|
|
48
|
+
"""The wallet's Auth-service user: profile, wallet balance and wallet transfers.
|
|
49
|
+
|
|
50
|
+
References:
|
|
51
|
+
- [Upstream docs](https://docs.evedex.com/developers/developers/authorization)
|
|
52
|
+
"""
|
|
53
|
+
return User(client=self.client)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Generated by typed-dev — see CONTRIBUTING.md.
|
|
2
|
+
from .create import Create
|
|
3
|
+
from .delete import Delete
|
|
4
|
+
from .list import List
|
|
5
|
+
from .regenerate import Regenerate
|
|
6
|
+
from .restore import Restore
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ApiKeys(Create, Delete, List, Regenerate, Restore):
|
|
10
|
+
"""API keys for read access to the Exchange service: list, create (EIP-712 signed), regenerate, restore and delete.
|
|
11
|
+
|
|
12
|
+
References:
|
|
13
|
+
- [Upstream docs](https://docs.evedex.com/developers/developers/authorization)
|
|
14
|
+
"""
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Generated by typed-dev — see CONTRIBUTING.md.
|
|
2
|
+
from typing_extensions import Literal, NotRequired, TypedDict
|
|
3
|
+
from typed_evedex.core import RpcEndpoint, TimestampIso
|
|
4
|
+
from typed_evedex.schemas import IssuedApiKey
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Request(TypedDict):
|
|
8
|
+
name: str
|
|
9
|
+
"""Name of the key."""
|
|
10
|
+
expireAt: NotRequired[TimestampIso | None]
|
|
11
|
+
"""When the key expires; omitted or `null` for a key that never expires. Sent RFC 3339, signed as epoch seconds."""
|
|
12
|
+
scopes: NotRequired[list[Literal['partner', 'exchange']]]
|
|
13
|
+
"""Services the key grants access to; signed comma-joined."""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class Create(RpcEndpoint):
|
|
17
|
+
"""Create an API key and return its secret (shown only here and on regenerate). Requires the session and an EIP-712 `create_new_api_key` signature by the wallet, which the core adds. An `exchange`-scoped key authorizes read-only Exchange calls via `X-API-Key`."""
|
|
18
|
+
|
|
19
|
+
async def create(
|
|
20
|
+
self,
|
|
21
|
+
name: str,
|
|
22
|
+
*,
|
|
23
|
+
expire_at: TimestampIso | None = None,
|
|
24
|
+
scopes: list[Literal['partner', 'exchange']] | None = None,
|
|
25
|
+
validate: bool | None = None,
|
|
26
|
+
) -> IssuedApiKey:
|
|
27
|
+
"""Create an API key and return its secret (shown only here and on regenerate). Requires the session and an EIP-712 `create_new_api_key` signature by the wallet, which the core adds. An `exchange`-scoped key authorizes read-only Exchange calls via `X-API-Key`.
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
name: Name of the key.
|
|
31
|
+
expire_at: When the key expires; omitted or `null` for a key that never expires. Sent RFC 3339, signed as epoch seconds.
|
|
32
|
+
scopes: Services the key grants access to; signed comma-joined.
|
|
33
|
+
validate: Override this call's response validation; falls back to the client-level default when omitted.
|
|
34
|
+
|
|
35
|
+
References:
|
|
36
|
+
- [Official docs](https://docs.evedex.com/developers/developers/authorization)
|
|
37
|
+
"""
|
|
38
|
+
request: Request = Request(name=name)
|
|
39
|
+
if expire_at is not None:
|
|
40
|
+
request['expireAt'] = expire_at
|
|
41
|
+
if scopes is not None:
|
|
42
|
+
request['scopes'] = scopes
|
|
43
|
+
return await self.request(
|
|
44
|
+
request,
|
|
45
|
+
method='POST',
|
|
46
|
+
path='/auth/api-key',
|
|
47
|
+
meta={'auth': 'private', 'sign': 'create_new_api_key'},
|
|
48
|
+
validate=validate,
|
|
49
|
+
request_type=Request,
|
|
50
|
+
response_type=IssuedApiKey,
|
|
51
|
+
)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Generated by typed-dev — see CONTRIBUTING.md.
|
|
2
|
+
from typing_extensions import Any, TypedDict
|
|
3
|
+
from typed_evedex.core import RpcEndpoint
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
DeletedApiKey = dict[str, Any]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Request(TypedDict):
|
|
10
|
+
apiKeyId: str
|
|
11
|
+
"""Id of the key to delete."""
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Delete(RpcEndpoint):
|
|
15
|
+
"""Delete (archive) an API key so it no longer authorizes. Requires the session. A deleted key can be brought back with `restore`."""
|
|
16
|
+
|
|
17
|
+
async def delete(
|
|
18
|
+
self, api_key_id: str, *, validate: bool | None = None
|
|
19
|
+
) -> DeletedApiKey:
|
|
20
|
+
"""Delete (archive) an API key so it no longer authorizes. Requires the session. A deleted key can be brought back with `restore`.
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
api_key_id: Id of the key to delete.
|
|
24
|
+
validate: Override this call's response validation; falls back to the client-level default when omitted.
|
|
25
|
+
|
|
26
|
+
References:
|
|
27
|
+
- [Official docs](https://docs.evedex.com/developers/developers/authorization)
|
|
28
|
+
"""
|
|
29
|
+
return await self.request(
|
|
30
|
+
Request(apiKeyId=api_key_id),
|
|
31
|
+
method='DELETE',
|
|
32
|
+
path='/auth/api-key/{apiKeyId}',
|
|
33
|
+
meta={'auth': 'private'},
|
|
34
|
+
validate=validate,
|
|
35
|
+
request_type=Request,
|
|
36
|
+
response_type=DeletedApiKey,
|
|
37
|
+
)
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Generated by typed-dev — see CONTRIBUTING.md.
|
|
2
|
+
from typed_core import PaginatedResponse
|
|
3
|
+
from typing_extensions import Literal, NotRequired, Sequence, TypedDict
|
|
4
|
+
from typed_evedex.core import RpcEndpoint, TimestampIso
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ApiKeySettings(TypedDict):
|
|
8
|
+
"""Key settings."""
|
|
9
|
+
|
|
10
|
+
scopes: list[Literal['partner', 'exchange']]
|
|
11
|
+
"""Services the key grants access to."""
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Request(TypedDict):
|
|
15
|
+
withDeleted: NotRequired[Literal['yes', 'no', 'true', 'false', '']]
|
|
16
|
+
"""Include deleted keys."""
|
|
17
|
+
withExpired: NotRequired[Literal['yes', 'no', 'true', 'false', '']]
|
|
18
|
+
"""Include expired keys."""
|
|
19
|
+
limit: NotRequired[int]
|
|
20
|
+
"""Page size."""
|
|
21
|
+
offset: NotRequired[int]
|
|
22
|
+
"""Number of keys to skip."""
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ApiKeyInfo(TypedDict):
|
|
26
|
+
"""One API key, without its secret."""
|
|
27
|
+
|
|
28
|
+
id: str
|
|
29
|
+
"""API key id."""
|
|
30
|
+
name: str
|
|
31
|
+
"""Name given at creation."""
|
|
32
|
+
mask: str
|
|
33
|
+
"""Masked form of the key, for display."""
|
|
34
|
+
isArchived: bool
|
|
35
|
+
"""Whether the key is archived (true once deleted)."""
|
|
36
|
+
expireAt: TimestampIso | None
|
|
37
|
+
"""When the key expires; `null` if it never does."""
|
|
38
|
+
createdAt: TimestampIso
|
|
39
|
+
"""When the key was created."""
|
|
40
|
+
updatedAt: TimestampIso | None
|
|
41
|
+
"""When the key was last updated (regenerated); `null` if never."""
|
|
42
|
+
deletedAt: TimestampIso | None
|
|
43
|
+
"""When the key was deleted; `null` if it is not."""
|
|
44
|
+
settings: ApiKeySettings
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class ApiKeyPage(TypedDict):
|
|
48
|
+
"""One page of API keys."""
|
|
49
|
+
|
|
50
|
+
list: list[ApiKeyInfo]
|
|
51
|
+
"""API keys on this page."""
|
|
52
|
+
count: int
|
|
53
|
+
"""Total number of keys matching the filters."""
|
|
54
|
+
next: NotRequired[str]
|
|
55
|
+
"""Opaque continuation marker; unused by the offset walk."""
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class List(RpcEndpoint):
|
|
59
|
+
"""List the account's API keys (masked; the secret is shown only when a key is created or regenerated). Requires the session. Deleted and expired keys are left out unless asked for."""
|
|
60
|
+
|
|
61
|
+
def list_paged(
|
|
62
|
+
self,
|
|
63
|
+
*,
|
|
64
|
+
with_deleted: Literal['yes', 'no', 'true', 'false', ''] | None = None,
|
|
65
|
+
with_expired: Literal['yes', 'no', 'true', 'false', ''] | None = None,
|
|
66
|
+
limit: int | None = None,
|
|
67
|
+
validate: bool | None = None,
|
|
68
|
+
) -> PaginatedResponse[ApiKeyInfo, int]:
|
|
69
|
+
"""List the account's API keys (masked; the secret is shown only when a key is created or regenerated). Requires the session. Deleted and expired keys are left out unless asked for.
|
|
70
|
+
|
|
71
|
+
Paged variant of `list`: Advances `offset` by `len(rows)` and stops once it has covered the `count` items the response reports, or on an empty page. Awaitable (flattens every page) or async-iterable (one page at a time).
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
with_deleted: Include deleted keys.
|
|
75
|
+
with_expired: Include expired keys.
|
|
76
|
+
limit: Page size.
|
|
77
|
+
validate: Override this call's response validation; falls back to the client-level default when omitted.
|
|
78
|
+
|
|
79
|
+
References:
|
|
80
|
+
- [Official docs](https://docs.evedex.com/developers/developers/authorization)
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
async def next(offset: int) -> tuple[Sequence[ApiKeyInfo], int | None]:
|
|
84
|
+
response = await self.list(
|
|
85
|
+
with_deleted=with_deleted,
|
|
86
|
+
with_expired=with_expired,
|
|
87
|
+
limit=limit,
|
|
88
|
+
offset=offset,
|
|
89
|
+
validate=validate,
|
|
90
|
+
)
|
|
91
|
+
rows = response.get('list')
|
|
92
|
+
rows = rows if rows is not None else []
|
|
93
|
+
total = response.get('count')
|
|
94
|
+
total = int(total) if total is not None else None
|
|
95
|
+
if not rows or (total is not None and (offset + len(rows)) >= total):
|
|
96
|
+
return rows, None
|
|
97
|
+
return rows, offset + len(rows)
|
|
98
|
+
|
|
99
|
+
return PaginatedResponse(0, next)
|
|
100
|
+
|
|
101
|
+
async def list(
|
|
102
|
+
self,
|
|
103
|
+
*,
|
|
104
|
+
with_deleted: Literal['yes', 'no', 'true', 'false', ''] | None = None,
|
|
105
|
+
with_expired: Literal['yes', 'no', 'true', 'false', ''] | None = None,
|
|
106
|
+
limit: int | None = None,
|
|
107
|
+
offset: int | None = None,
|
|
108
|
+
validate: bool | None = None,
|
|
109
|
+
) -> ApiKeyPage:
|
|
110
|
+
"""List the account's API keys (masked; the secret is shown only when a key is created or regenerated). Requires the session. Deleted and expired keys are left out unless asked for.
|
|
111
|
+
|
|
112
|
+
Args:
|
|
113
|
+
with_deleted: Include deleted keys.
|
|
114
|
+
with_expired: Include expired keys.
|
|
115
|
+
limit: Page size.
|
|
116
|
+
offset: Number of keys to skip.
|
|
117
|
+
validate: Override this call's response validation; falls back to the client-level default when omitted.
|
|
118
|
+
|
|
119
|
+
References:
|
|
120
|
+
- [Official docs](https://docs.evedex.com/developers/developers/authorization)
|
|
121
|
+
"""
|
|
122
|
+
request: Request = Request()
|
|
123
|
+
if with_deleted is not None:
|
|
124
|
+
request['withDeleted'] = with_deleted
|
|
125
|
+
if with_expired is not None:
|
|
126
|
+
request['withExpired'] = with_expired
|
|
127
|
+
if limit is not None:
|
|
128
|
+
request['limit'] = limit
|
|
129
|
+
if offset is not None:
|
|
130
|
+
request['offset'] = offset
|
|
131
|
+
return await self.request(
|
|
132
|
+
request,
|
|
133
|
+
method='GET',
|
|
134
|
+
path='/auth/api-key',
|
|
135
|
+
meta={'auth': 'private'},
|
|
136
|
+
validate=validate,
|
|
137
|
+
request_type=Request,
|
|
138
|
+
response_type=ApiKeyPage,
|
|
139
|
+
)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Generated by typed-dev — see CONTRIBUTING.md.
|
|
2
|
+
from typing_extensions import TypedDict
|
|
3
|
+
from typed_evedex.core import RpcEndpoint
|
|
4
|
+
from typed_evedex.schemas import IssuedApiKey
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Request(TypedDict):
|
|
8
|
+
apiKeyId: str
|
|
9
|
+
"""Id of the key to regenerate."""
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Regenerate(RpcEndpoint):
|
|
13
|
+
"""Issue a new secret for an API key, invalidating the old one, and return it. Requires the session. The key keeps its id, name, scopes and expiry."""
|
|
14
|
+
|
|
15
|
+
async def regenerate(
|
|
16
|
+
self,
|
|
17
|
+
api_key_id: str,
|
|
18
|
+
*,
|
|
19
|
+
validate: bool | None = None,
|
|
20
|
+
) -> IssuedApiKey:
|
|
21
|
+
"""Issue a new secret for an API key, invalidating the old one, and return it. Requires the session. The key keeps its id, name, scopes and expiry.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
api_key_id: Id of the key to regenerate.
|
|
25
|
+
validate: Override this call's response validation; falls back to the client-level default when omitted.
|
|
26
|
+
|
|
27
|
+
References:
|
|
28
|
+
- [Official docs](https://docs.evedex.com/developers/developers/authorization)
|
|
29
|
+
"""
|
|
30
|
+
return await self.request(
|
|
31
|
+
Request(apiKeyId=api_key_id),
|
|
32
|
+
method='PUT',
|
|
33
|
+
path='/auth/api-key/{apiKeyId}/regenerate',
|
|
34
|
+
meta={'auth': 'private'},
|
|
35
|
+
validate=validate,
|
|
36
|
+
request_type=Request,
|
|
37
|
+
response_type=IssuedApiKey,
|
|
38
|
+
)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Generated by typed-dev — see CONTRIBUTING.md.
|
|
2
|
+
from typing_extensions import Any, TypedDict
|
|
3
|
+
from typed_evedex.core import RpcEndpoint
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Request(TypedDict):
|
|
7
|
+
apiKeyId: str
|
|
8
|
+
"""Id of the deleted key to restore."""
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
RestoredApiKey = dict[str, Any]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Restore(RpcEndpoint):
|
|
15
|
+
"""Restore a deleted API key. Requires the session."""
|
|
16
|
+
|
|
17
|
+
async def restore(
|
|
18
|
+
self, api_key_id: str, *, validate: bool | None = None
|
|
19
|
+
) -> RestoredApiKey:
|
|
20
|
+
"""Restore a deleted API key. Requires the session.
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
api_key_id: Id of the deleted key to restore.
|
|
24
|
+
validate: Override this call's response validation; falls back to the client-level default when omitted.
|
|
25
|
+
|
|
26
|
+
References:
|
|
27
|
+
- [Official docs](https://docs.evedex.com/developers/developers/authorization)
|
|
28
|
+
"""
|
|
29
|
+
return await self.request(
|
|
30
|
+
Request(apiKeyId=api_key_id),
|
|
31
|
+
method='POST',
|
|
32
|
+
path='/auth/api-key/{apiKeyId}/restore',
|
|
33
|
+
meta={'auth': 'private'},
|
|
34
|
+
validate=validate,
|
|
35
|
+
request_type=Request,
|
|
36
|
+
response_type=RestoredApiKey,
|
|
37
|
+
)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Generated by typed-dev — see CONTRIBUTING.md.
|
|
2
|
+
from typing_extensions import NotRequired, TypedDict
|
|
3
|
+
from typed_evedex.core import RpcEndpoint
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class LocationCity(TypedDict):
|
|
7
|
+
"""City of the IP address; empty when unknown."""
|
|
8
|
+
|
|
9
|
+
id: NotRequired[int]
|
|
10
|
+
"""Geo-database city id."""
|
|
11
|
+
name: NotRequired[str]
|
|
12
|
+
"""City name."""
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class LocationCountry(TypedDict):
|
|
16
|
+
"""Country of the IP address."""
|
|
17
|
+
|
|
18
|
+
id: NotRequired[int]
|
|
19
|
+
"""Geo-database country id."""
|
|
20
|
+
name: NotRequired[str]
|
|
21
|
+
"""Country name."""
|
|
22
|
+
code: NotRequired[str]
|
|
23
|
+
"""ISO 3166-1 alpha-2 country code."""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class LocationRegion(TypedDict):
|
|
27
|
+
"""Region of the IP address; empty when unknown."""
|
|
28
|
+
|
|
29
|
+
id: NotRequired[int]
|
|
30
|
+
"""Geo-database region id."""
|
|
31
|
+
name: NotRequired[str]
|
|
32
|
+
"""Region name."""
|
|
33
|
+
code: NotRequired[str]
|
|
34
|
+
"""Region code."""
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class Location(TypedDict):
|
|
38
|
+
"""The caller's geo-IP location."""
|
|
39
|
+
|
|
40
|
+
country: LocationCountry
|
|
41
|
+
region: LocationRegion
|
|
42
|
+
city: LocationCity
|
|
43
|
+
ipAddress: str
|
|
44
|
+
"""The IP address the lookup was made for (the caller's)."""
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class LocationEndpoint(RpcEndpoint):
|
|
48
|
+
"""Look up the caller's location from its IP address (geo-IP). Public. The web app uses it for regional gating; region and city can be empty objects when the lookup has no data for them."""
|
|
49
|
+
|
|
50
|
+
async def location(self, *, validate: bool | None = None) -> Location:
|
|
51
|
+
"""Look up the caller's location from its IP address (geo-IP). Public. The web app uses it for regional gating; region and city can be empty objects when the lookup has no data for them.
|
|
52
|
+
|
|
53
|
+
Args:
|
|
54
|
+
validate: Override this call's response validation; falls back to the client-level default when omitted.
|
|
55
|
+
"""
|
|
56
|
+
return await self.request(
|
|
57
|
+
None,
|
|
58
|
+
method='GET',
|
|
59
|
+
path='/auth/location',
|
|
60
|
+
meta={},
|
|
61
|
+
validate=validate,
|
|
62
|
+
response_type=Location,
|
|
63
|
+
)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Generated by typed-dev — see CONTRIBUTING.md.
|
|
2
|
+
from typing_extensions import TypedDict
|
|
3
|
+
from typed_evedex.core import RpcEndpoint
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Nonce(TypedDict):
|
|
7
|
+
"""A single-use SIWE nonce."""
|
|
8
|
+
|
|
9
|
+
nonce: str
|
|
10
|
+
"""Nonce to embed in the SIWE message and send back with `POST /auth/user/sign-up`."""
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class NonceEndpoint(RpcEndpoint):
|
|
14
|
+
"""Get a fresh nonce for a Sign-In with Ethereum (EIP-4361) message. Public. The client core calls this itself when it signs in; call it directly only to build a SIWE message by hand."""
|
|
15
|
+
|
|
16
|
+
async def nonce(self, *, validate: bool | None = None) -> Nonce:
|
|
17
|
+
"""Get a fresh nonce for a Sign-In with Ethereum (EIP-4361) message. Public. The client core calls this itself when it signs in; call it directly only to build a SIWE message by hand.
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
validate: Override this call's response validation; falls back to the client-level default when omitted.
|
|
21
|
+
|
|
22
|
+
References:
|
|
23
|
+
- [Official docs](https://docs.evedex.com/developers/developers/authorization)
|
|
24
|
+
"""
|
|
25
|
+
return await self.request(
|
|
26
|
+
None,
|
|
27
|
+
method='GET',
|
|
28
|
+
path='/auth/nonce',
|
|
29
|
+
meta={},
|
|
30
|
+
validate=validate,
|
|
31
|
+
response_type=Nonce,
|
|
32
|
+
)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Generated by typed-dev — see CONTRIBUTING.md.
|
|
2
|
+
from typing_extensions import TypedDict
|
|
3
|
+
from typed_evedex.core import RpcEndpoint, TimestampMillis
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class AuthPing(TypedDict):
|
|
7
|
+
"""The Auth service clock."""
|
|
8
|
+
|
|
9
|
+
time: TimestampMillis
|
|
10
|
+
"""Server time."""
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Ping(RpcEndpoint):
|
|
14
|
+
"""Get the Auth service time. Public; useful as a liveness check."""
|
|
15
|
+
|
|
16
|
+
async def ping(self, *, validate: bool | None = None) -> AuthPing:
|
|
17
|
+
"""Get the Auth service time. Public; useful as a liveness check.
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
validate: Override this call's response validation; falls back to the client-level default when omitted.
|
|
21
|
+
"""
|
|
22
|
+
return await self.request(
|
|
23
|
+
None,
|
|
24
|
+
method='GET',
|
|
25
|
+
path='/auth/ping',
|
|
26
|
+
meta={},
|
|
27
|
+
validate=validate,
|
|
28
|
+
response_type=AuthPing,
|
|
29
|
+
)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Generated by typed-dev — see CONTRIBUTING.md.
|
|
2
|
+
from .logout import Logout
|
|
3
|
+
from .revoke import Revoke
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Session(Logout, Revoke):
|
|
7
|
+
"""Sign-In with Ethereum (EIP-4361) sessions: sign in, refresh, revoke and log out.
|
|
8
|
+
|
|
9
|
+
References:
|
|
10
|
+
- [Upstream docs](https://docs.evedex.com/developers/developers/authorization)
|
|
11
|
+
"""
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Generated by typed-dev — see CONTRIBUTING.md.
|
|
2
|
+
from typing_extensions import Any
|
|
3
|
+
from typed_evedex.core import RpcEndpoint
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
LoggedOut = dict[str, Any]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Logout(RpcEndpoint):
|
|
10
|
+
"""Log the current session out. Requires the session. After this the client signs in again on its next private call."""
|
|
11
|
+
|
|
12
|
+
async def logout(self, *, validate: bool | None = None) -> LoggedOut:
|
|
13
|
+
"""Log the current session out. Requires the session. After this the client signs in again on its next private call.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
validate: Override this call's response validation; falls back to the client-level default when omitted.
|
|
17
|
+
"""
|
|
18
|
+
return await self.request(
|
|
19
|
+
None,
|
|
20
|
+
method='POST',
|
|
21
|
+
path='/auth/user/logout',
|
|
22
|
+
meta={'auth': 'private'},
|
|
23
|
+
validate=validate,
|
|
24
|
+
response_type=LoggedOut,
|
|
25
|
+
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Generated by typed-dev — see CONTRIBUTING.md.
|
|
2
|
+
from typing_extensions import Any
|
|
3
|
+
from typed_evedex.core import RpcEndpoint
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
SessionRevoked = dict[str, Any]
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Revoke(RpcEndpoint):
|
|
10
|
+
"""Revoke the current session, invalidating its tokens. Requires the session. After this the client signs in again on its next private call."""
|
|
11
|
+
|
|
12
|
+
async def revoke(self, *, validate: bool | None = None) -> SessionRevoked:
|
|
13
|
+
"""Revoke the current session, invalidating its tokens. Requires the session. After this the client signs in again on its next private call.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
validate: Override this call's response validation; falls back to the client-level default when omitted.
|
|
17
|
+
"""
|
|
18
|
+
return await self.request(
|
|
19
|
+
None,
|
|
20
|
+
method='POST',
|
|
21
|
+
path='/auth/revoke',
|
|
22
|
+
meta={'auth': 'private'},
|
|
23
|
+
validate=validate,
|
|
24
|
+
response_type=SessionRevoked,
|
|
25
|
+
)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Generated by typed-dev — see CONTRIBUTING.md.
|
|
2
|
+
from .create import Create
|
|
3
|
+
from .list import List
|
|
4
|
+
from .switch import Switch
|
|
5
|
+
from .update import Update
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class SubAccounts(Create, List, Switch, Update):
|
|
9
|
+
"""Sub-accounts of the wallet: list, create, switch the session to one, rename or archive.
|
|
10
|
+
|
|
11
|
+
References:
|
|
12
|
+
- [Upstream docs](https://docs.evedex.com/developers/developers/authorization)
|
|
13
|
+
"""
|