Skip to content

remote_key_manager

Provides classes to interact with the set of endpoints for key management of local keys.

API reference: https://ethereum.github.io/keymanager-APIs/#/Remote%20Key%20Manager

Each class provides access to a specific endpoint. The classes are organized in the same way as the API documentation.

Class API Endpoint
DeleteRemoteKeys https://ethereum.github.io/keymanager-APIs/#/Remote%20Key%20Manager/deleteRemoteKeys
ListRemoteKeys https://ethereum.github.io/keymanager-APIs/#/Remote%20Key%20Manager/listRemoteKeys
ImportRemoteKeys https://ethereum.github.io/keymanager-APIs/#/Remote%20Key%20Manager/importRemoteKeys

DeleteRemoteKeys

Contains methods for accessing the DELETE method of the /eth/v1/remotekeys endpoint.

The endpoint returns the following HTTP status code if successful
  • 200: OK
Typical usage example - synchronous
import eth_2_key_manager_api_client

eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
pubkey = "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a"
response = eth_2_key_manager.delete_remote_keys.sync_detailed(pubkeys=[pubkey])

if response.status_code == 200:
    print("Remote keys deleted successfully")
else:
    print(f"Remote keys delete failed with status code: {response.status_code}")
Typical usage example - asynchronous
import eth_2_key_manager_api_client

eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
pubkey = "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a"
response = await eth_2_key_manager.delete_remote_keys.asyncio_detailed(pubkeys=[pubkey])

if response.status_code == 200:
    print("Remote keys deleted successfully")
else:
    print(f"Remote keys delete failed with status code: {response.status_code}")
Source code in eth_2_key_manager_api_client/api/remote_key_manager.py
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
@attr.s(auto_attribs=True)
class DeleteRemoteKeys:
    """Contains methods for accessing the DELETE method of the /eth/v1/remotekeys endpoint.

    The endpoint returns the following HTTP status code if successful:
        - 200: OK

    Typical usage example - synchronous:
        ```python
        import eth_2_key_manager_api_client

        eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
        pubkey = "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a"
        response = eth_2_key_manager.delete_remote_keys.sync_detailed(pubkeys=[pubkey])

        if response.status_code == 200:
            print("Remote keys deleted successfully")
        else:
            print(f"Remote keys delete failed with status code: {response.status_code}")
        ```

    Typical usage example - asynchronous:
        ```python
        import eth_2_key_manager_api_client

        eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
        pubkey = "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a"
        response = await eth_2_key_manager.delete_remote_keys.asyncio_detailed(pubkeys=[pubkey])

        if response.status_code == 200:
            print("Remote keys deleted successfully")
        else:
            print(f"Remote keys delete failed with status code: {response.status_code}")
        ```
    """

    client: AuthenticatedClient
    ENDPOINT: str = "remotekeys"
    METHOD: str = "DELETE"

    def sync_detailed(self, pubkeys: List[str]) -> Response[Union[DeleteRemoteKeysResponse, ErrorResponse]]:
        """Delete Remote Keys (synchronous).

        DELETE must delete all keys from `request.pubkeys` that are known to the validator client and exist
        in its
        persistent storage.

        DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no existing
        keystores.

        Args:
            pubkeys: List of public keys to delete.

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Response object containing the response from the server, response headers, status code and DeleteRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
        """

        json_body = DeleteRemoteKeysJsonBody(pubkeys=pubkeys)

        kwargs = _get_kwargs(
            client=self.client,
            endpoint=self.ENDPOINT,
            method=self.METHOD,
            json_body=json_body,
        )

        response = httpx.request(
            verify=self.client.verify_ssl,
            **kwargs,
        )

        return _build_response(client=self.client, response=response, cls=DeleteRemoteKeysResponse)

    def sync(self, pubkeys: List[str]) -> Optional[Union[DeleteRemoteKeysResponse, ErrorResponse]]:
        """Delete Remote Keys (synchronous).

        DELETE must delete all keys from `request.pubkeys` that are known to the validator client and exist
        in its
        persistent storage.

        DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no existing
        keystores.

        Args:
            pubkeys: List of public keys to delete.

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Parsed response from the server, DeleteRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
        """

        return self.sync_detailed(pubkeys=pubkeys).parsed

    async def asyncio_detailed(self, pubkeys: List[str]) -> Response[Union[DeleteRemoteKeysResponse, ErrorResponse]]:
        """Delete Remote Keys (asynchronous).

        DELETE must delete all keys from `request.pubkeys` that are known to the validator client and exist
        in its
        persistent storage.

        DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no existing
        keystores.

        Args:
            pubkeys: List of public keys to delete.

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Response object containing the response from the server, response headers, status code and DeleteRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
        """

        json_body = DeleteRemoteKeysJsonBody(pubkeys=pubkeys)

        kwargs = _get_kwargs(
            client=self.client,
            endpoint=self.ENDPOINT,
            method=self.METHOD,
            json_body=json_body,
        )

        async with httpx.AsyncClient(verify=self.client.verify_ssl) as _client:
            response = await _client.request(**kwargs)

        return _build_response(client=self.client, response=response, cls=DeleteRemoteKeysResponse)

    async def asyncio(self, pubkeys: List[str]) -> Optional[Union[DeleteRemoteKeysResponse, ErrorResponse]]:
        """Delete Remote Keys (asynchronous).

        DELETE must delete all keys from `request.pubkeys` that are known to the validator client and exist
        in its
        persistent storage.

        DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no existing
        keystores.

        Args:
            pubkeys: List of public keys to delete.

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Parsed response from the server, DeleteRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
        """

        return (await self.asyncio_detailed(pubkeys=pubkeys)).parsed

asyncio(pubkeys) async

Delete Remote Keys (asynchronous).

DELETE must delete all keys from request.pubkeys that are known to the validator client and exist in its persistent storage.

DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no existing keystores.

Parameters:

Name Type Description Default
pubkeys List[str]

List of public keys to delete.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[Union[DeleteRemoteKeysResponse, ErrorResponse]]

Parsed response from the server, DeleteRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.

Source code in eth_2_key_manager_api_client/api/remote_key_manager.py
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
async def asyncio(self, pubkeys: List[str]) -> Optional[Union[DeleteRemoteKeysResponse, ErrorResponse]]:
    """Delete Remote Keys (asynchronous).

    DELETE must delete all keys from `request.pubkeys` that are known to the validator client and exist
    in its
    persistent storage.

    DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no existing
    keystores.

    Args:
        pubkeys: List of public keys to delete.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Parsed response from the server, DeleteRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
    """

    return (await self.asyncio_detailed(pubkeys=pubkeys)).parsed

asyncio_detailed(pubkeys) async

Delete Remote Keys (asynchronous).

DELETE must delete all keys from request.pubkeys that are known to the validator client and exist in its persistent storage.

DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no existing keystores.

Parameters:

Name Type Description Default
pubkeys List[str]

List of public keys to delete.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[Union[DeleteRemoteKeysResponse, ErrorResponse]]

Response object containing the response from the server, response headers, status code and DeleteRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.

Source code in eth_2_key_manager_api_client/api/remote_key_manager.py
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
async def asyncio_detailed(self, pubkeys: List[str]) -> Response[Union[DeleteRemoteKeysResponse, ErrorResponse]]:
    """Delete Remote Keys (asynchronous).

    DELETE must delete all keys from `request.pubkeys` that are known to the validator client and exist
    in its
    persistent storage.

    DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no existing
    keystores.

    Args:
        pubkeys: List of public keys to delete.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response object containing the response from the server, response headers, status code and DeleteRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
    """

    json_body = DeleteRemoteKeysJsonBody(pubkeys=pubkeys)

    kwargs = _get_kwargs(
        client=self.client,
        endpoint=self.ENDPOINT,
        method=self.METHOD,
        json_body=json_body,
    )

    async with httpx.AsyncClient(verify=self.client.verify_ssl) as _client:
        response = await _client.request(**kwargs)

    return _build_response(client=self.client, response=response, cls=DeleteRemoteKeysResponse)

sync(pubkeys)

Delete Remote Keys (synchronous).

DELETE must delete all keys from request.pubkeys that are known to the validator client and exist in its persistent storage.

DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no existing keystores.

Parameters:

Name Type Description Default
pubkeys List[str]

List of public keys to delete.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[Union[DeleteRemoteKeysResponse, ErrorResponse]]

Parsed response from the server, DeleteRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.

Source code in eth_2_key_manager_api_client/api/remote_key_manager.py
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
def sync(self, pubkeys: List[str]) -> Optional[Union[DeleteRemoteKeysResponse, ErrorResponse]]:
    """Delete Remote Keys (synchronous).

    DELETE must delete all keys from `request.pubkeys` that are known to the validator client and exist
    in its
    persistent storage.

    DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no existing
    keystores.

    Args:
        pubkeys: List of public keys to delete.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Parsed response from the server, DeleteRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
    """

    return self.sync_detailed(pubkeys=pubkeys).parsed

sync_detailed(pubkeys)

Delete Remote Keys (synchronous).

DELETE must delete all keys from request.pubkeys that are known to the validator client and exist in its persistent storage.

DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no existing keystores.

Parameters:

Name Type Description Default
pubkeys List[str]

List of public keys to delete.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[Union[DeleteRemoteKeysResponse, ErrorResponse]]

Response object containing the response from the server, response headers, status code and DeleteRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.

Source code in eth_2_key_manager_api_client/api/remote_key_manager.py
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
def sync_detailed(self, pubkeys: List[str]) -> Response[Union[DeleteRemoteKeysResponse, ErrorResponse]]:
    """Delete Remote Keys (synchronous).

    DELETE must delete all keys from `request.pubkeys` that are known to the validator client and exist
    in its
    persistent storage.

    DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no existing
    keystores.

    Args:
        pubkeys: List of public keys to delete.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response object containing the response from the server, response headers, status code and DeleteRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
    """

    json_body = DeleteRemoteKeysJsonBody(pubkeys=pubkeys)

    kwargs = _get_kwargs(
        client=self.client,
        endpoint=self.ENDPOINT,
        method=self.METHOD,
        json_body=json_body,
    )

    response = httpx.request(
        verify=self.client.verify_ssl,
        **kwargs,
    )

    return _build_response(client=self.client, response=response, cls=DeleteRemoteKeysResponse)

ImportRemoteKeys

Contains methods for accessing the POST method of the /eth/v1/remotekeys endpoint.

The endpoint returns the following HTTP status code if successful
  • 200: OK
Typical usage example - synchronous
import eth_2_key_manager_api_client

remote_keys = [
    {
        "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
        "url": "https://remote.signer",
    }
]

eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
response = eth_2_key_manager.import_remote_keys.sync_detailed(remote_keys=remote_keys)

if response.status_code == 200:
    print("Remote keys imported successfully")
else:
    print(f"Remote keys import failed with status code: {response.status_code}")

assert response.status_code == 200
Typical usage example - asynchronous
   import eth_2_key_manager_api_client

remote_keys = [
    {
        "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
        "url": "https://remote.signer",
    }
]

eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
response = await eth_2_key_manager.import_remote_keys.asyncio_detailed(remote_keys=remote_keys)

if response.status_code == 200:
    print("Remote keys imported successfully")
else:
    print(f"Remote keys import failed with status code: {response.status_code}")

assert response.status_code == 200
Source code in eth_2_key_manager_api_client/api/remote_key_manager.py
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
@attr.s(auto_attribs=True)
class ImportRemoteKeys:
    """Contains methods for accessing the POST method of the /eth/v1/remotekeys endpoint.

    The endpoint returns the following HTTP status code if successful:
        - 200: OK

    Typical usage example - synchronous:
        ```python
        import eth_2_key_manager_api_client

        remote_keys = [
            {
                "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
                "url": "https://remote.signer",
            }
        ]

        eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
        response = eth_2_key_manager.import_remote_keys.sync_detailed(remote_keys=remote_keys)

        if response.status_code == 200:
            print("Remote keys imported successfully")
        else:
            print(f"Remote keys import failed with status code: {response.status_code}")

        assert response.status_code == 200
        ```

    Typical usage example - asynchronous:
        ```python
           import eth_2_key_manager_api_client

        remote_keys = [
            {
                "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
                "url": "https://remote.signer",
            }
        ]

        eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
        response = await eth_2_key_manager.import_remote_keys.asyncio_detailed(remote_keys=remote_keys)

        if response.status_code == 200:
            print("Remote keys imported successfully")
        else:
            print(f"Remote keys import failed with status code: {response.status_code}")

        assert response.status_code == 200
        ```
    """

    client: AuthenticatedClient
    ENDPOINT: str = "remotekeys"
    METHOD: str = "POST"

    def sync_detailed(self, remote_keys: List[Dict]) -> Response[Union[ImportRemoteKeysResponse, ErrorResponse]]:
        """Import Remote Keys (synchronous).

        Import remote keys for the validator client to request duties for.

        Args:
            remote_keys: List of remote keys to import. Each item must contain a pubkey and optional remote signer url.
                For example:
                [
                    {
                        "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
                        "url": "https://remote.signer"
                    },
                    {
                        "pubkey": "0x874bed7931ba14832198a4070b881f89e7ddf81898dd800446ef382344e9726a5e6265acb21f5c8ee2759c313ec6ca0d",
                        "url": "https://remote1.signer"
                    }
                ]
        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
             Response object containing the response from the server, response headers, status code and ImportKeystoresResponse object if the request succeeds, otherwise an ErrorResponse object.
        """

        json_body = ImportRemoteKeysJsonBody(
            remote_keys=[remote_keys_item for remote_keys_item in map(ImportRemoteKeysJsonBodyRemoteKeysItem.from_dict, remote_keys)]  # type: ignore
        )

        kwargs = _get_kwargs(
            client=self.client,
            endpoint=self.ENDPOINT,
            method=self.METHOD,
            json_body=json_body,
        )

        response = httpx.request(
            verify=self.client.verify_ssl,
            **kwargs,
        )

        return _build_response(client=self.client, response=response, cls=ImportRemoteKeysResponse)

    def sync(self, remote_keys: List[Dict]) -> Optional[Union[ImportRemoteKeysResponse, ErrorResponse]]:
        """Import Remote Keys (synchronous).

        Import remote keys for the validator client to request duties for.

        Args:
            remote_keys: List of remote keys to import. Each item must contain a pubkey and optional remote signer url.
                For example:
                [
                    {
                        "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
                        "url": "https://remote.signer"
                    },
                    {
                        "pubkey": "0x874bed7931ba14832198a4070b881f89e7ddf81898dd800446ef382344e9726a5e6265acb21f5c8ee2759c313ec6ca0d",
                        "url": "https://remote1.signer"
                    }
                ]
        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Parsed response from the server, ImportRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
        """

        return self.sync_detailed(remote_keys=remote_keys).parsed

    async def asyncio_detailed(self, remote_keys: List[Dict]) -> Response[Union[ImportRemoteKeysResponse, ErrorResponse]]:
        """Import Remote Keys (asynchronous).

        Import remote keys for the validator client to request duties for.

        Args:
            remote_keys: List of remote keys to import. Each item must contain a pubkey and optional remote signer url.
                For example:
                [
                    {
                        "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
                        "url": "https://remote.signer"
                    },
                    {
                        "pubkey": "0x874bed7931ba14832198a4070b881f89e7ddf81898dd800446ef382344e9726a5e6265acb21f5c8ee2759c313ec6ca0d",
                        "url": "https://remote1.signer"
                    }
                ]
        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
             Response object containing the response from the server, response headers, status code and ImportKeystoresResponse object if the request succeeds, otherwise an ErrorResponse object.
        """
        json_body = ImportRemoteKeysJsonBody(
            remote_keys=[remote_keys_item for remote_keys_item in map(ImportRemoteKeysJsonBodyRemoteKeysItem.from_dict, remote_keys)]  # type: ignore
        )

        kwargs = _get_kwargs(
            client=self.client,
            endpoint=self.ENDPOINT,
            method=self.METHOD,
            json_body=json_body,
        )

        async with httpx.AsyncClient(verify=self.client.verify_ssl) as _client:
            response = await _client.request(**kwargs)

        return _build_response(client=self.client, response=response, cls=ImportRemoteKeysResponse)

    async def asyncio(self, remote_keys: List[Dict]) -> Optional[Union[ImportRemoteKeysResponse, ErrorResponse]]:
        """Import Remote Keys (asynchronous).

        Import remote keys for the validator client to request duties for.

        Args:
            remote_keys: List of remote keys to import. Each item must contain a pubkey and optional remote signer url.
                For example:
                [
                    {
                        "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
                        "url": "https://remote.signer"
                    },
                    {
                        "pubkey": "0x874bed7931ba14832198a4070b881f89e7ddf81898dd800446ef382344e9726a5e6265acb21f5c8ee2759c313ec6ca0d",
                        "url": "https://remote1.signer"
                    }
                ]
        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Parsed response from the server, ImportRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
        """

        return (await self.asyncio_detailed(remote_keys=remote_keys)).parsed

asyncio(remote_keys) async

Import Remote Keys (asynchronous).

Import remote keys for the validator client to request duties for.

Parameters:

Name Type Description Default
remote_keys List[Dict]

List of remote keys to import. Each item must contain a pubkey and optional remote signer url. For example: [ { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "url": "https://remote.signer" }, { "pubkey": "0x874bed7931ba14832198a4070b881f89e7ddf81898dd800446ef382344e9726a5e6265acb21f5c8ee2759c313ec6ca0d", "url": "https://remote1.signer" } ]

required

Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[Union[ImportRemoteKeysResponse, ErrorResponse]]

Parsed response from the server, ImportRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.

Source code in eth_2_key_manager_api_client/api/remote_key_manager.py
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
async def asyncio(self, remote_keys: List[Dict]) -> Optional[Union[ImportRemoteKeysResponse, ErrorResponse]]:
    """Import Remote Keys (asynchronous).

    Import remote keys for the validator client to request duties for.

    Args:
        remote_keys: List of remote keys to import. Each item must contain a pubkey and optional remote signer url.
            For example:
            [
                {
                    "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
                    "url": "https://remote.signer"
                },
                {
                    "pubkey": "0x874bed7931ba14832198a4070b881f89e7ddf81898dd800446ef382344e9726a5e6265acb21f5c8ee2759c313ec6ca0d",
                    "url": "https://remote1.signer"
                }
            ]
    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Parsed response from the server, ImportRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
    """

    return (await self.asyncio_detailed(remote_keys=remote_keys)).parsed

asyncio_detailed(remote_keys) async

Import Remote Keys (asynchronous).

Import remote keys for the validator client to request duties for.

Parameters:

Name Type Description Default
remote_keys List[Dict]

List of remote keys to import. Each item must contain a pubkey and optional remote signer url. For example: [ { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "url": "https://remote.signer" }, { "pubkey": "0x874bed7931ba14832198a4070b881f89e7ddf81898dd800446ef382344e9726a5e6265acb21f5c8ee2759c313ec6ca0d", "url": "https://remote1.signer" } ]

required

Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:

Type Description
Response[Union[ImportRemoteKeysResponse, ErrorResponse]]

Response object containing the response from the server, response headers, status code and ImportKeystoresResponse object if the request succeeds, otherwise an ErrorResponse object.

Source code in eth_2_key_manager_api_client/api/remote_key_manager.py
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
async def asyncio_detailed(self, remote_keys: List[Dict]) -> Response[Union[ImportRemoteKeysResponse, ErrorResponse]]:
    """Import Remote Keys (asynchronous).

    Import remote keys for the validator client to request duties for.

    Args:
        remote_keys: List of remote keys to import. Each item must contain a pubkey and optional remote signer url.
            For example:
            [
                {
                    "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
                    "url": "https://remote.signer"
                },
                {
                    "pubkey": "0x874bed7931ba14832198a4070b881f89e7ddf81898dd800446ef382344e9726a5e6265acb21f5c8ee2759c313ec6ca0d",
                    "url": "https://remote1.signer"
                }
            ]
    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
         Response object containing the response from the server, response headers, status code and ImportKeystoresResponse object if the request succeeds, otherwise an ErrorResponse object.
    """
    json_body = ImportRemoteKeysJsonBody(
        remote_keys=[remote_keys_item for remote_keys_item in map(ImportRemoteKeysJsonBodyRemoteKeysItem.from_dict, remote_keys)]  # type: ignore
    )

    kwargs = _get_kwargs(
        client=self.client,
        endpoint=self.ENDPOINT,
        method=self.METHOD,
        json_body=json_body,
    )

    async with httpx.AsyncClient(verify=self.client.verify_ssl) as _client:
        response = await _client.request(**kwargs)

    return _build_response(client=self.client, response=response, cls=ImportRemoteKeysResponse)

sync(remote_keys)

Import Remote Keys (synchronous).

Import remote keys for the validator client to request duties for.

Parameters:

Name Type Description Default
remote_keys List[Dict]

List of remote keys to import. Each item must contain a pubkey and optional remote signer url. For example: [ { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "url": "https://remote.signer" }, { "pubkey": "0x874bed7931ba14832198a4070b881f89e7ddf81898dd800446ef382344e9726a5e6265acb21f5c8ee2759c313ec6ca0d", "url": "https://remote1.signer" } ]

required

Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[Union[ImportRemoteKeysResponse, ErrorResponse]]

Parsed response from the server, ImportRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.

Source code in eth_2_key_manager_api_client/api/remote_key_manager.py
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
def sync(self, remote_keys: List[Dict]) -> Optional[Union[ImportRemoteKeysResponse, ErrorResponse]]:
    """Import Remote Keys (synchronous).

    Import remote keys for the validator client to request duties for.

    Args:
        remote_keys: List of remote keys to import. Each item must contain a pubkey and optional remote signer url.
            For example:
            [
                {
                    "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
                    "url": "https://remote.signer"
                },
                {
                    "pubkey": "0x874bed7931ba14832198a4070b881f89e7ddf81898dd800446ef382344e9726a5e6265acb21f5c8ee2759c313ec6ca0d",
                    "url": "https://remote1.signer"
                }
            ]
    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Parsed response from the server, ImportRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
    """

    return self.sync_detailed(remote_keys=remote_keys).parsed

sync_detailed(remote_keys)

Import Remote Keys (synchronous).

Import remote keys for the validator client to request duties for.

Parameters:

Name Type Description Default
remote_keys List[Dict]

List of remote keys to import. Each item must contain a pubkey and optional remote signer url. For example: [ { "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", "url": "https://remote.signer" }, { "pubkey": "0x874bed7931ba14832198a4070b881f89e7ddf81898dd800446ef382344e9726a5e6265acb21f5c8ee2759c313ec6ca0d", "url": "https://remote1.signer" } ]

required

Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout.

Returns:

Type Description
Response[Union[ImportRemoteKeysResponse, ErrorResponse]]

Response object containing the response from the server, response headers, status code and ImportKeystoresResponse object if the request succeeds, otherwise an ErrorResponse object.

Source code in eth_2_key_manager_api_client/api/remote_key_manager.py
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
def sync_detailed(self, remote_keys: List[Dict]) -> Response[Union[ImportRemoteKeysResponse, ErrorResponse]]:
    """Import Remote Keys (synchronous).

    Import remote keys for the validator client to request duties for.

    Args:
        remote_keys: List of remote keys to import. Each item must contain a pubkey and optional remote signer url.
            For example:
            [
                {
                    "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
                    "url": "https://remote.signer"
                },
                {
                    "pubkey": "0x874bed7931ba14832198a4070b881f89e7ddf81898dd800446ef382344e9726a5e6265acb21f5c8ee2759c313ec6ca0d",
                    "url": "https://remote1.signer"
                }
            ]
    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
         Response object containing the response from the server, response headers, status code and ImportKeystoresResponse object if the request succeeds, otherwise an ErrorResponse object.
    """

    json_body = ImportRemoteKeysJsonBody(
        remote_keys=[remote_keys_item for remote_keys_item in map(ImportRemoteKeysJsonBodyRemoteKeysItem.from_dict, remote_keys)]  # type: ignore
    )

    kwargs = _get_kwargs(
        client=self.client,
        endpoint=self.ENDPOINT,
        method=self.METHOD,
        json_body=json_body,
    )

    response = httpx.request(
        verify=self.client.verify_ssl,
        **kwargs,
    )

    return _build_response(client=self.client, response=response, cls=ImportRemoteKeysResponse)

ListRemoteKeys

Contains methods for accessing the GET method of the /eth/v1/remotekeys endpoint.

The endpoint returns the following HTTP status code if successful
  • 200: OK
Typical usage example - synchronous
import eth_2_key_manager_api_client

eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
response = eth_2_key_manager.list_remote_keys.sync_detailed()

if response.status_code == 200:
    print(f"List of remote keys: {response.parsed.data}")
else:
    print(f"List remote keys failed with status code: {response.status_code}")

assert response.status_code == 200
Typical usage example - asynchronous
import eth_2_key_manager_api_client

eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
response = await eth_2_key_manager.list_remote_keys.asyncio_detailed()

if response.status_code == 200:
    print(f"List of remote keys: {response.parsed.data}")
else:
    print(f"List remote keys failed with status code: {response.status_code}")

assert response.status_code == 200
Source code in eth_2_key_manager_api_client/api/remote_key_manager.py
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
@attr.s(auto_attribs=True)
class ListRemoteKeys:
    """Contains methods for accessing the GET method of the /eth/v1/remotekeys endpoint.

    The endpoint returns the following HTTP status code if successful:
        - 200: OK

    Typical usage example - synchronous:
        ```python
        import eth_2_key_manager_api_client

        eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
        response = eth_2_key_manager.list_remote_keys.sync_detailed()

        if response.status_code == 200:
            print(f"List of remote keys: {response.parsed.data}")
        else:
            print(f"List remote keys failed with status code: {response.status_code}")

        assert response.status_code == 200
        ```

    Typical usage example - asynchronous:
        ```python
        import eth_2_key_manager_api_client

        eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
        response = await eth_2_key_manager.list_remote_keys.asyncio_detailed()

        if response.status_code == 200:
            print(f"List of remote keys: {response.parsed.data}")
        else:
            print(f"List remote keys failed with status code: {response.status_code}")

        assert response.status_code == 200
        ```
    """

    client: AuthenticatedClient
    ENDPOINT: str = "remotekeys"
    METHOD: str = "GET"

    def sync_detailed(
        self,
    ) -> Response[Union[ListRemoteKeysResponse, ErrorResponse]]:
        """List Remote Keys (synchronous).

        List all remote validating pubkeys known to this validator client binary

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Response object containing the response from the server, response headers, status code and ListRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
        """

        kwargs = _get_kwargs(client=self.client, endpoint=self.ENDPOINT, method=self.METHOD)

        response = httpx.request(
            verify=self.client.verify_ssl,
            **kwargs,
        )

        return _build_response(client=self.client, response=response, cls=ListRemoteKeysResponse)

    def sync(
        self,
    ) -> Optional[Union[ListRemoteKeysResponse, ErrorResponse]]:
        """List Remote Keys (synchronous).

        List all remote validating pubkeys known to this validator client binary

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Parsed response from the server, ListRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
        """

        return self.sync_detailed().parsed

    async def asyncio_detailed(
        self,
    ) -> Response[Union[ListRemoteKeysResponse, ErrorResponse]]:
        """List Remote Keys (asynchronous).

        List all remote validating pubkeys known to this validator client binary

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Response object containing the response from the server, response headers, status code and ListRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
        """

        kwargs = _get_kwargs(client=self.client, endpoint=self.ENDPOINT, method=self.METHOD)

        async with httpx.AsyncClient(verify=self.client.verify_ssl) as _client:
            response = await _client.request(**kwargs)

        return _build_response(client=self.client, response=response, cls=ListRemoteKeysResponse)

    async def asyncio(
        self,
    ) -> Optional[Union[ListRemoteKeysResponse, ErrorResponse]]:
        """List Remote Keys (asynchronous).

        List all remote validating pubkeys known to this validator client binary

        Raises:
            errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
            httpx.TimeoutException: If the request takes longer than Client.timeout.

        Returns:
            Parsed response from the server, ListRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
        """

        return (await self.asyncio_detailed()).parsed

asyncio() async

List Remote Keys (asynchronous).

List all remote validating pubkeys known to this validator client binary

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[Union[ListRemoteKeysResponse, ErrorResponse]]

Parsed response from the server, ListRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.

Source code in eth_2_key_manager_api_client/api/remote_key_manager.py
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
async def asyncio(
    self,
) -> Optional[Union[ListRemoteKeysResponse, ErrorResponse]]:
    """List Remote Keys (asynchronous).

    List all remote validating pubkeys known to this validator client binary

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Parsed response from the server, ListRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
    """

    return (await self.asyncio_detailed()).parsed

asyncio_detailed() async

List Remote Keys (asynchronous).

List all remote validating pubkeys known to this validator client binary

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[Union[ListRemoteKeysResponse, ErrorResponse]]

Response object containing the response from the server, response headers, status code and ListRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.

Source code in eth_2_key_manager_api_client/api/remote_key_manager.py
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
async def asyncio_detailed(
    self,
) -> Response[Union[ListRemoteKeysResponse, ErrorResponse]]:
    """List Remote Keys (asynchronous).

    List all remote validating pubkeys known to this validator client binary

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response object containing the response from the server, response headers, status code and ListRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
    """

    kwargs = _get_kwargs(client=self.client, endpoint=self.ENDPOINT, method=self.METHOD)

    async with httpx.AsyncClient(verify=self.client.verify_ssl) as _client:
        response = await _client.request(**kwargs)

    return _build_response(client=self.client, response=response, cls=ListRemoteKeysResponse)

sync()

List Remote Keys (synchronous).

List all remote validating pubkeys known to this validator client binary

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Optional[Union[ListRemoteKeysResponse, ErrorResponse]]

Parsed response from the server, ListRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.

Source code in eth_2_key_manager_api_client/api/remote_key_manager.py
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
def sync(
    self,
) -> Optional[Union[ListRemoteKeysResponse, ErrorResponse]]:
    """List Remote Keys (synchronous).

    List all remote validating pubkeys known to this validator client binary

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Parsed response from the server, ListRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
    """

    return self.sync_detailed().parsed

sync_detailed()

List Remote Keys (synchronous).

List all remote validating pubkeys known to this validator client binary

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[Union[ListRemoteKeysResponse, ErrorResponse]]

Response object containing the response from the server, response headers, status code and ListRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.

Source code in eth_2_key_manager_api_client/api/remote_key_manager.py
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
def sync_detailed(
    self,
) -> Response[Union[ListRemoteKeysResponse, ErrorResponse]]:
    """List Remote Keys (synchronous).

    List all remote validating pubkeys known to this validator client binary

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response object containing the response from the server, response headers, status code and ListRemoteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
    """

    kwargs = _get_kwargs(client=self.client, endpoint=self.ENDPOINT, method=self.METHOD)

    response = httpx.request(
        verify=self.client.verify_ssl,
        **kwargs,
    )

    return _build_response(client=self.client, response=response, cls=ListRemoteKeysResponse)