Skip to content

local_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/#/Local%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
ImportKeystores https://ethereum.github.io/keymanager-APIs/#/Local%20Key%20Manager/importKeystores
ListKeys https://ethereum.github.io/keymanager-APIs/#/Local%20Key%20Manager/listKeys
DeleteKeys https://ethereum.github.io/keymanager-APIs/#/Local%20Key%20Manager/deleteKeys

DeleteKeys

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

The endpoint returns the following HTTP status code if successful
  • 204: No Content
Typical usage example - synchronous
import eth_2_key_manager_api_client

eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
pubkey = "0x99c4c42fac7d1393956bd9e2785ed67cf5aaca4bf56d2fcda94c42d6042aebb1723ce6bac6f0216ff8c5d4f9f013008b"

response = eth_2_key_manager.delete_keys.sync_detailed(pubkeys=[pubkey])
if response.status_code == 200:
    print("Keystores deleted successfully")
else:
    print(f"Keystores delete failed with status code: {response.status_code}")
assert response.status_code == 200
Typical usage example - synchronous
import eth_2_key_manager_api_client

eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
pubkey = "0x99c4c42fac7d1393956bd9e2785ed67cf5aaca4bf56d2fcda94c42d6042aebb1723ce6bac6f0216ff8c5d4f9f013008b"

response = await eth_2_key_manager.delete_keys.asyncio_detailed(pubkeys=[pubkey])
if response.status_code == 200:
    print("Keystores deleted successfully")
else:
    print(f"Keystores delete failed with status code: {response.status_code}")
assert response.status_code == 200
Source code in eth_2_key_manager_api_client/api/local_key_manager.py
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
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
@attr.s(auto_attribs=True)
class DeleteKeys:

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

    The endpoint returns the following HTTP status code if successful:
        - 204: No Content

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

        eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
        pubkey = "0x99c4c42fac7d1393956bd9e2785ed67cf5aaca4bf56d2fcda94c42d6042aebb1723ce6bac6f0216ff8c5d4f9f013008b"

        response = eth_2_key_manager.delete_keys.sync_detailed(pubkeys=[pubkey])
        if response.status_code == 200:
            print("Keystores deleted successfully")
        else:
            print(f"Keystores delete failed with status code: {response.status_code}")
        assert response.status_code == 200
        ```

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

        eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
        pubkey = "0x99c4c42fac7d1393956bd9e2785ed67cf5aaca4bf56d2fcda94c42d6042aebb1723ce6bac6f0216ff8c5d4f9f013008b"

        response = await eth_2_key_manager.delete_keys.asyncio_detailed(pubkeys=[pubkey])
        if response.status_code == 200:
            print("Keystores deleted successfully")
        else:
            print(f"Keystores delete failed with status code: {response.status_code}")
        assert response.status_code == 200
        ```
    """

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

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

        DELETE must delete all keys from `request.pubkeys` that are known to the keymanager and exist in its
        persistent storage. Additionally, DELETE must fetch the slashing protection data for the requested
        keys from persistent storage, which must be retained (and not deleted) after the response has been sent.
        Therefore in the case of two identical delete requests being made, both will have access to slashing protection data.

        In a single atomic sequential operation the keymanager must:
        1. Guarantee that key(s) can not produce any more signature; only then
        2. Delete key(s) and serialize its associated slashing protection data

        DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no extant
        keystores nor slashing protection data.

        Slashing protection data must only be returned for keys from `request.pubkeys` for which a
        `deleted` or `not_active` status is returned.

        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 DeleteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
        """

        delete_keys_body = DeleteKeysJsonBody(pubkeys=pubkeys)

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

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

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

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

        DELETE must delete all keys from `request.pubkeys` that are known to the keymanager and exist in its
        persistent storage. Additionally, DELETE must fetch the slashing protection data for the requested
        keys from persistent storage, which must be retained (and not deleted) after the response has been sent.
        Therefore in the case of two identical delete requests being made, both will have access to slashing protection data.

        In a single atomic sequential operation the keymanager must:
        1. Guarantee that key(s) can not produce any more signature; only then
        2. Delete key(s) and serialize its associated slashing protection data

        DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no extant
        keystores nor slashing protection data.

        Slashing protection data must only be returned for keys from `request.pubkeys` for which a
        `deleted` or `not_active` status is returned.

        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. DeleteKeysResponse 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[DeleteKeysResponse, ErrorResponse]]:
        """Delete Keys (asynchronous).

        DELETE must delete all keys from `request.pubkeys` that are known to the keymanager and exist in its
        persistent storage. Additionally, DELETE must fetch the slashing protection data for the requested
        keys from persistent storage, which must be retained (and not deleted) after the response has been sent.
        Therefore in the case of two identical delete requests being made, both will have access to slashing protection data.

        In a single atomic sequential operation the keymanager must:
        1. Guarantee that key(s) can not produce any more signature; only then
        2. Delete key(s) and serialize its associated slashing protection data

        DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no extant
        keystores nor slashing protection data.

        Slashing protection data must only be returned for keys from `request.pubkeys` for which a
        `deleted` or `not_active` status is returned.

        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 DeleteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
        """

        delete_keys_body = DeleteKeysJsonBody(pubkeys=pubkeys)

        kwargs = _get_kwargs(
            client=self.client,
            endpoint=self.ENDPOINT,
            method=self.METHOD,
            json_body=delete_keys_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=DeleteKeysResponse)

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

        DELETE must delete all keys from `request.pubkeys` that are known to the keymanager and exist in its
        persistent storage. Additionally, DELETE must fetch the slashing protection data for the requested
        keys from persistent storage, which must be retained (and not deleted) after the response has been sent.
        Therefore in the case of two identical delete requests being made, both will have access to slashing protection data.

        In a single atomic sequential operation the keymanager must:
        1. Guarantee that key(s) can not produce any more signature; only then
        2. Delete key(s) and serialize its associated slashing protection data

        DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no extant
        keystores nor slashing protection data.

        Slashing protection data must only be returned for keys from `request.pubkeys` for which a
        `deleted` or `not_active` status is returned.

        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. DeleteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
        """

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

asyncio(pubkeys) async

Delete Keys (asynchronous).

DELETE must delete all keys from request.pubkeys that are known to the keymanager and exist in its persistent storage. Additionally, DELETE must fetch the slashing protection data for the requested keys from persistent storage, which must be retained (and not deleted) after the response has been sent. Therefore in the case of two identical delete requests being made, both will have access to slashing protection data.

In a single atomic sequential operation the keymanager must: 1. Guarantee that key(s) can not produce any more signature; only then 2. Delete key(s) and serialize its associated slashing protection data

DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no extant keystores nor slashing protection data.

Slashing protection data must only be returned for keys from request.pubkeys for which a deleted or not_active status is returned.

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[DeleteKeysResponse, ErrorResponse]]

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

Source code in eth_2_key_manager_api_client/api/local_key_manager.py
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
async def asyncio(
    self,
    pubkeys: List[str],
) -> Optional[Union[DeleteKeysResponse, ErrorResponse]]:
    """Delete Keys (asynchronous).

    DELETE must delete all keys from `request.pubkeys` that are known to the keymanager and exist in its
    persistent storage. Additionally, DELETE must fetch the slashing protection data for the requested
    keys from persistent storage, which must be retained (and not deleted) after the response has been sent.
    Therefore in the case of two identical delete requests being made, both will have access to slashing protection data.

    In a single atomic sequential operation the keymanager must:
    1. Guarantee that key(s) can not produce any more signature; only then
    2. Delete key(s) and serialize its associated slashing protection data

    DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no extant
    keystores nor slashing protection data.

    Slashing protection data must only be returned for keys from `request.pubkeys` for which a
    `deleted` or `not_active` status is returned.

    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. DeleteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
    """

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

asyncio_detailed(pubkeys) async

Delete Keys (asynchronous).

DELETE must delete all keys from request.pubkeys that are known to the keymanager and exist in its persistent storage. Additionally, DELETE must fetch the slashing protection data for the requested keys from persistent storage, which must be retained (and not deleted) after the response has been sent. Therefore in the case of two identical delete requests being made, both will have access to slashing protection data.

In a single atomic sequential operation the keymanager must: 1. Guarantee that key(s) can not produce any more signature; only then 2. Delete key(s) and serialize its associated slashing protection data

DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no extant keystores nor slashing protection data.

Slashing protection data must only be returned for keys from request.pubkeys for which a deleted or not_active status is returned.

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[DeleteKeysResponse, ErrorResponse]]

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

Source code in eth_2_key_manager_api_client/api/local_key_manager.py
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
async def asyncio_detailed(
    self,
    pubkeys: List[str],
) -> Response[Union[DeleteKeysResponse, ErrorResponse]]:
    """Delete Keys (asynchronous).

    DELETE must delete all keys from `request.pubkeys` that are known to the keymanager and exist in its
    persistent storage. Additionally, DELETE must fetch the slashing protection data for the requested
    keys from persistent storage, which must be retained (and not deleted) after the response has been sent.
    Therefore in the case of two identical delete requests being made, both will have access to slashing protection data.

    In a single atomic sequential operation the keymanager must:
    1. Guarantee that key(s) can not produce any more signature; only then
    2. Delete key(s) and serialize its associated slashing protection data

    DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no extant
    keystores nor slashing protection data.

    Slashing protection data must only be returned for keys from `request.pubkeys` for which a
    `deleted` or `not_active` status is returned.

    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 DeleteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
    """

    delete_keys_body = DeleteKeysJsonBody(pubkeys=pubkeys)

    kwargs = _get_kwargs(
        client=self.client,
        endpoint=self.ENDPOINT,
        method=self.METHOD,
        json_body=delete_keys_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=DeleteKeysResponse)

sync(pubkeys)

Delete Keys (synchronous).

DELETE must delete all keys from request.pubkeys that are known to the keymanager and exist in its persistent storage. Additionally, DELETE must fetch the slashing protection data for the requested keys from persistent storage, which must be retained (and not deleted) after the response has been sent. Therefore in the case of two identical delete requests being made, both will have access to slashing protection data.

In a single atomic sequential operation the keymanager must: 1. Guarantee that key(s) can not produce any more signature; only then 2. Delete key(s) and serialize its associated slashing protection data

DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no extant keystores nor slashing protection data.

Slashing protection data must only be returned for keys from request.pubkeys for which a deleted or not_active status is returned.

Parameters:

Name Type Description Default
pubkeys List[str]

List of public keys to delete.

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[DeleteKeysResponse, ErrorResponse]]

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

Source code in eth_2_key_manager_api_client/api/local_key_manager.py
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
def sync(
    self,
    pubkeys: List[str],
) -> Optional[Union[DeleteKeysResponse, ErrorResponse]]:
    """Delete Keys (synchronous).

    DELETE must delete all keys from `request.pubkeys` that are known to the keymanager and exist in its
    persistent storage. Additionally, DELETE must fetch the slashing protection data for the requested
    keys from persistent storage, which must be retained (and not deleted) after the response has been sent.
    Therefore in the case of two identical delete requests being made, both will have access to slashing protection data.

    In a single atomic sequential operation the keymanager must:
    1. Guarantee that key(s) can not produce any more signature; only then
    2. Delete key(s) and serialize its associated slashing protection data

    DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no extant
    keystores nor slashing protection data.

    Slashing protection data must only be returned for keys from `request.pubkeys` for which a
    `deleted` or `not_active` status is returned.

    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. DeleteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
    """

    return self.sync_detailed(
        pubkeys=pubkeys,
    ).parsed

sync_detailed(pubkeys)

Delete Keys (synchronous).

DELETE must delete all keys from request.pubkeys that are known to the keymanager and exist in its persistent storage. Additionally, DELETE must fetch the slashing protection data for the requested keys from persistent storage, which must be retained (and not deleted) after the response has been sent. Therefore in the case of two identical delete requests being made, both will have access to slashing protection data.

In a single atomic sequential operation the keymanager must: 1. Guarantee that key(s) can not produce any more signature; only then 2. Delete key(s) and serialize its associated slashing protection data

DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no extant keystores nor slashing protection data.

Slashing protection data must only be returned for keys from request.pubkeys for which a deleted or not_active status is returned.

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[DeleteKeysResponse, ErrorResponse]]

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

Source code in eth_2_key_manager_api_client/api/local_key_manager.py
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
def sync_detailed(
    self,
    pubkeys: List[str],
) -> Response[Union[DeleteKeysResponse, ErrorResponse]]:
    """Delete Keys (synchronous).

    DELETE must delete all keys from `request.pubkeys` that are known to the keymanager and exist in its
    persistent storage. Additionally, DELETE must fetch the slashing protection data for the requested
    keys from persistent storage, which must be retained (and not deleted) after the response has been sent.
    Therefore in the case of two identical delete requests being made, both will have access to slashing protection data.

    In a single atomic sequential operation the keymanager must:
    1. Guarantee that key(s) can not produce any more signature; only then
    2. Delete key(s) and serialize its associated slashing protection data

    DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no extant
    keystores nor slashing protection data.

    Slashing protection data must only be returned for keys from `request.pubkeys` for which a
    `deleted` or `not_active` status is returned.

    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 DeleteKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
    """

    delete_keys_body = DeleteKeysJsonBody(pubkeys=pubkeys)

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

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

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

ImportKeystores

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

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

keystore_str = '''{
"crypto": {
    "kdf": {
        "function": "scrypt",
        "params": {
            "dklen": 32,
            "n": 262144,
            "r": 8,
            "p": 1,
            "salt": "1c4a91c48175d4742b88c0c3cca7321ba8e3127906678a0f0195321234b2f61d"
        },
        "message": ""
    },
    "checksum": {
        "function": "sha256",
        "params": {},
        "message": "8f260d986ba4cf13dd75998d8b0f10bef6a5e60fdcec3fc0d606b082077c1b24"
    },
    "cipher": {
        "function": "aes-128-ctr",
        "params": {
            "iv": "77495a6ef36049d4edb83dd02bbe419b"
        },
        "message": "d28fd393f4ee8b2516e4f8287245a2ccf1e42816b684becfca6c56c3b56d6ae5"
    }
},
"description": "",
"pubkey": "99c4c42fac7d1393956bd9e2785ed67cf5aaca4bf56d2fcda94c42d6042aebb1723ce6bac6f0216ff8c5d4f9f013008b",
"path": "m/12381/3600/2/0/0",
"uuid": "6d4913af-4cc2-457f-a962-39eca6d0dd37",
"version": 4
}'''

keystore_password_str = "validatorkey123"

slashing_protection_str = '''{
"metadata": {
    "interchange_format_version": "5",
    "genesis_validators_root": "0x043db0d9a83813551ee2f33450d23797757d430911a9320530ad8a0eabc43efb"
},
"data": [
    {
        "pubkey": "0x876a9a7fadb5b9d2114a5180f9fe50b451cbab5f241b42e476b724a3575e5a8277767bc5a7c831c63f066a9a725c53d6",
        "signed_blocks": [
            {
                "slot": "4866645",
                "signing_root": "0xc24c384a4b9ecef533b6d838691d83ac3e4b06c2903fb09200957583ea291c3d"
            }
        ],
        "signed_attestations": [
            {
                "source_epoch": "154315",
                "target_epoch": "154316",
                "signing_root": "0x04ec24fb31df03f65b7af9a74a62bf3c8e44817ae1f976b1d9c81af277f3ddfa"
            },
            {
                "source_epoch": "154316",
                "target_epoch": "154317",
                "signing_root": "0x9d731a700e06f0999b6964d65b6858022690387a47d25919f6e01daa6173dfc9"
            }
        ]
    }
]
}'''

eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
response = eth_2_key_manager.import_keystores.sync_detailed([keystore_str], [keystore_password_str], slashing_protection_str)

if response.status_code == 200:
    print("Keystores imported successfully")
else:
    print(f"Keystores import failed with status code: {response.status_code}")
assert response.status_code == 200
Source code in eth_2_key_manager_api_client/api/local_key_manager.py
 30
 31
 32
 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
190
191
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
@attr.s(auto_attribs=True)
class ImportKeystores:

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

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

    Typical usage example:
        ```python
        import eth_2_key_manager_api_client

        keystore_str = '''{
        "crypto": {
            "kdf": {
                "function": "scrypt",
                "params": {
                    "dklen": 32,
                    "n": 262144,
                    "r": 8,
                    "p": 1,
                    "salt": "1c4a91c48175d4742b88c0c3cca7321ba8e3127906678a0f0195321234b2f61d"
                },
                "message": ""
            },
            "checksum": {
                "function": "sha256",
                "params": {},
                "message": "8f260d986ba4cf13dd75998d8b0f10bef6a5e60fdcec3fc0d606b082077c1b24"
            },
            "cipher": {
                "function": "aes-128-ctr",
                "params": {
                    "iv": "77495a6ef36049d4edb83dd02bbe419b"
                },
                "message": "d28fd393f4ee8b2516e4f8287245a2ccf1e42816b684becfca6c56c3b56d6ae5"
            }
        },
        "description": "",
        "pubkey": "99c4c42fac7d1393956bd9e2785ed67cf5aaca4bf56d2fcda94c42d6042aebb1723ce6bac6f0216ff8c5d4f9f013008b",
        "path": "m/12381/3600/2/0/0",
        "uuid": "6d4913af-4cc2-457f-a962-39eca6d0dd37",
        "version": 4
        }'''

        keystore_password_str = "validatorkey123"

        slashing_protection_str = '''{
        "metadata": {
            "interchange_format_version": "5",
            "genesis_validators_root": "0x043db0d9a83813551ee2f33450d23797757d430911a9320530ad8a0eabc43efb"
        },
        "data": [
            {
                "pubkey": "0x876a9a7fadb5b9d2114a5180f9fe50b451cbab5f241b42e476b724a3575e5a8277767bc5a7c831c63f066a9a725c53d6",
                "signed_blocks": [
                    {
                        "slot": "4866645",
                        "signing_root": "0xc24c384a4b9ecef533b6d838691d83ac3e4b06c2903fb09200957583ea291c3d"
                    }
                ],
                "signed_attestations": [
                    {
                        "source_epoch": "154315",
                        "target_epoch": "154316",
                        "signing_root": "0x04ec24fb31df03f65b7af9a74a62bf3c8e44817ae1f976b1d9c81af277f3ddfa"
                    },
                    {
                        "source_epoch": "154316",
                        "target_epoch": "154317",
                        "signing_root": "0x9d731a700e06f0999b6964d65b6858022690387a47d25919f6e01daa6173dfc9"
                    }
                ]
            }
        ]
        }'''

        eth_2_key_manager = eth_2_key_manager_api_client.Eth2KeyManager()
        response = eth_2_key_manager.import_keystores.sync_detailed([keystore_str], [keystore_password_str], slashing_protection_str)

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

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

    def sync_detailed(
        self,
        keystores: List[str],
        passwords: List[str],
        slashing_protection_data: Union[Unset, str] = UNSET,
    ) -> Response[Union[ImportKeystoresResponse, ErrorResponse]]:
        """Import Keystores (synchronous).

        Import keystores generated by the Eth2.0 deposit CLI tooling.

        Users SHOULD send slashing_protection data associated with the imported pubkeys. MUST follow the
        format defined in EIP-3076: Slashing Protection Interchange Format.

        Args:
            keystores: List of keystores (strings) to import.
            passwords: List of passwords to unlock the keystores. `passwords[i]` must unlock `keystores[i]`.
            slashing_protection_data: Slashing protection data as string.

        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.
        """
        import_keystores_body = ImportKeystoresJsonBody(
            keystores=keystores,
            passwords=passwords,
            slashing_protection=slashing_protection_data,
        )

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

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

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

    def sync(
        self,
        keystores: List[str],
        passwords: List[str],
        slashing_protection_data: Union[Unset, str] = UNSET,
    ) -> Optional[Union[ImportKeystoresResponse, ErrorResponse]]:
        """Import Keystores (synchronous).

        Import keystores generated by the Eth2.0 deposit CLI tooling.

        Users SHOULD send slashing_protection data associated with the imported pubkeys. MUST follow the
        format defined in EIP-3076: Slashing Protection Interchange Format.

        Args:
            keystores: List of keystores (strings) to import.
            passwords: List of passwords to unlock the keystores. `passwords[i]` must unlock `keystores[i]`.
            slashing_protection_data: Slashing protection data as string.

        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. ImportKeystoresResponse if the request succeeds, otherwise ErrorResponse.
        """
        return self.sync_detailed(
            keystores=keystores,
            passwords=passwords,
            slashing_protection_data=slashing_protection_data,
        ).parsed

    async def asyncio_detailed(
        self,
        keystores: List[str],
        passwords: List[str],
        slashing_protection_data: Union[Unset, str] = UNSET,
    ) -> Response[Union[ImportKeystoresResponse, ErrorResponse]]:
        """Import Keystores (asynchronous).

        Import keystores generated by the Eth2.0 deposit CLI tooling.

        Users SHOULD send slashing_protection data associated with the imported pubkeys. MUST follow the
        format defined in EIP-3076: Slashing Protection Interchange Format.

        Args:
            keystores: List of keystores (strings) to import.
            passwords: List of passwords to unlock the keystores. `passwords[i]` must unlock `keystores[i]`.
            slashing_protection_data: Slashing protection data as string.

        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.
        """

        import_keystores_body = ImportKeystoresJsonBody(
            keystores=keystores,
            passwords=passwords,
            slashing_protection=slashing_protection_data,
        )

        kwargs = _get_kwargs(
            client=self.client,
            endpoint=self.ENDPOINT,
            method=self.METHOD,
            json_body=import_keystores_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=ImportKeystoresResponse)

    async def asyncio(
        self,
        keystores: List[str],
        passwords: List[str],
        slashing_protection_data: Union[Unset, str] = UNSET,
    ) -> Optional[Union[ImportKeystoresResponse, ErrorResponse]]:
        """Import Keystores (asynchronous).

        Import keystores generated by the Eth2.0 deposit CLI tooling.

        Users SHOULD send slashing_protection data associated with the imported pubkeys. MUST follow the
        format defined in EIP-3076: Slashing Protection Interchange Format.

        Args:
            keystores: List of keystores (strings) to import.
            passwords: List of passwords to unlock the keystores. `passwords[i]` must unlock `keystores[i]`.
            slashing_protection_data: Slashing protection data as string.

        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. ImportKeystoresResponse if the request succeeds, otherwise ErrorResponse.
        """

        return (
            await self.asyncio_detailed(
                keystores=keystores,
                passwords=passwords,
                slashing_protection_data=slashing_protection_data,
            )
        ).parsed

asyncio(keystores, passwords, slashing_protection_data=UNSET) async

Import Keystores (asynchronous).

Import keystores generated by the Eth2.0 deposit CLI tooling.

Users SHOULD send slashing_protection data associated with the imported pubkeys. MUST follow the format defined in EIP-3076: Slashing Protection Interchange Format.

Parameters:

Name Type Description Default
keystores List[str]

List of keystores (strings) to import.

required
passwords List[str]

List of passwords to unlock the keystores. passwords[i] must unlock keystores[i].

required
slashing_protection_data Union[Unset, str]

Slashing protection data as string.

UNSET

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[ImportKeystoresResponse, ErrorResponse]]

Parsed response from the server. ImportKeystoresResponse if the request succeeds, otherwise ErrorResponse.

Source code in eth_2_key_manager_api_client/api/local_key_manager.py
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
async def asyncio(
    self,
    keystores: List[str],
    passwords: List[str],
    slashing_protection_data: Union[Unset, str] = UNSET,
) -> Optional[Union[ImportKeystoresResponse, ErrorResponse]]:
    """Import Keystores (asynchronous).

    Import keystores generated by the Eth2.0 deposit CLI tooling.

    Users SHOULD send slashing_protection data associated with the imported pubkeys. MUST follow the
    format defined in EIP-3076: Slashing Protection Interchange Format.

    Args:
        keystores: List of keystores (strings) to import.
        passwords: List of passwords to unlock the keystores. `passwords[i]` must unlock `keystores[i]`.
        slashing_protection_data: Slashing protection data as string.

    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. ImportKeystoresResponse if the request succeeds, otherwise ErrorResponse.
    """

    return (
        await self.asyncio_detailed(
            keystores=keystores,
            passwords=passwords,
            slashing_protection_data=slashing_protection_data,
        )
    ).parsed

asyncio_detailed(keystores, passwords, slashing_protection_data=UNSET) async

Import Keystores (asynchronous).

Import keystores generated by the Eth2.0 deposit CLI tooling.

Users SHOULD send slashing_protection data associated with the imported pubkeys. MUST follow the format defined in EIP-3076: Slashing Protection Interchange Format.

Parameters:

Name Type Description Default
keystores List[str]

List of keystores (strings) to import.

required
passwords List[str]

List of passwords to unlock the keystores. passwords[i] must unlock keystores[i].

required
slashing_protection_data Union[Unset, str]

Slashing protection data as string.

UNSET

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[ImportKeystoresResponse, 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/local_key_manager.py
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
async def asyncio_detailed(
    self,
    keystores: List[str],
    passwords: List[str],
    slashing_protection_data: Union[Unset, str] = UNSET,
) -> Response[Union[ImportKeystoresResponse, ErrorResponse]]:
    """Import Keystores (asynchronous).

    Import keystores generated by the Eth2.0 deposit CLI tooling.

    Users SHOULD send slashing_protection data associated with the imported pubkeys. MUST follow the
    format defined in EIP-3076: Slashing Protection Interchange Format.

    Args:
        keystores: List of keystores (strings) to import.
        passwords: List of passwords to unlock the keystores. `passwords[i]` must unlock `keystores[i]`.
        slashing_protection_data: Slashing protection data as string.

    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.
    """

    import_keystores_body = ImportKeystoresJsonBody(
        keystores=keystores,
        passwords=passwords,
        slashing_protection=slashing_protection_data,
    )

    kwargs = _get_kwargs(
        client=self.client,
        endpoint=self.ENDPOINT,
        method=self.METHOD,
        json_body=import_keystores_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=ImportKeystoresResponse)

sync(keystores, passwords, slashing_protection_data=UNSET)

Import Keystores (synchronous).

Import keystores generated by the Eth2.0 deposit CLI tooling.

Users SHOULD send slashing_protection data associated with the imported pubkeys. MUST follow the format defined in EIP-3076: Slashing Protection Interchange Format.

Parameters:

Name Type Description Default
keystores List[str]

List of keystores (strings) to import.

required
passwords List[str]

List of passwords to unlock the keystores. passwords[i] must unlock keystores[i].

required
slashing_protection_data Union[Unset, str]

Slashing protection data as string.

UNSET

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[ImportKeystoresResponse, ErrorResponse]]

Parsed response from the server. ImportKeystoresResponse if the request succeeds, otherwise ErrorResponse.

Source code in eth_2_key_manager_api_client/api/local_key_manager.py
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
def sync(
    self,
    keystores: List[str],
    passwords: List[str],
    slashing_protection_data: Union[Unset, str] = UNSET,
) -> Optional[Union[ImportKeystoresResponse, ErrorResponse]]:
    """Import Keystores (synchronous).

    Import keystores generated by the Eth2.0 deposit CLI tooling.

    Users SHOULD send slashing_protection data associated with the imported pubkeys. MUST follow the
    format defined in EIP-3076: Slashing Protection Interchange Format.

    Args:
        keystores: List of keystores (strings) to import.
        passwords: List of passwords to unlock the keystores. `passwords[i]` must unlock `keystores[i]`.
        slashing_protection_data: Slashing protection data as string.

    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. ImportKeystoresResponse if the request succeeds, otherwise ErrorResponse.
    """
    return self.sync_detailed(
        keystores=keystores,
        passwords=passwords,
        slashing_protection_data=slashing_protection_data,
    ).parsed

sync_detailed(keystores, passwords, slashing_protection_data=UNSET)

Import Keystores (synchronous).

Import keystores generated by the Eth2.0 deposit CLI tooling.

Users SHOULD send slashing_protection data associated with the imported pubkeys. MUST follow the format defined in EIP-3076: Slashing Protection Interchange Format.

Parameters:

Name Type Description Default
keystores List[str]

List of keystores (strings) to import.

required
passwords List[str]

List of passwords to unlock the keystores. passwords[i] must unlock keystores[i].

required
slashing_protection_data Union[Unset, str]

Slashing protection data as string.

UNSET

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[ImportKeystoresResponse, 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/local_key_manager.py
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
def sync_detailed(
    self,
    keystores: List[str],
    passwords: List[str],
    slashing_protection_data: Union[Unset, str] = UNSET,
) -> Response[Union[ImportKeystoresResponse, ErrorResponse]]:
    """Import Keystores (synchronous).

    Import keystores generated by the Eth2.0 deposit CLI tooling.

    Users SHOULD send slashing_protection data associated with the imported pubkeys. MUST follow the
    format defined in EIP-3076: Slashing Protection Interchange Format.

    Args:
        keystores: List of keystores (strings) to import.
        passwords: List of passwords to unlock the keystores. `passwords[i]` must unlock `keystores[i]`.
        slashing_protection_data: Slashing protection data as string.

    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.
    """
    import_keystores_body = ImportKeystoresJsonBody(
        keystores=keystores,
        passwords=passwords,
        slashing_protection=slashing_protection_data,
    )

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

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

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

ListKeys

Contains methods for accessing the GET method of the /eth/v1/keystores 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_keys.sync_detailed()

if response.status_code == 200:
    print(f"List of keys: {response.parsed.data}")
else:
    print(f"List 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_keys.asyncio_detailed()

if response.status_code == 200:
    print(f"List of keys: {response.parsed.data}")
else:
    print(f"List keys failed with status code: {response.status_code}")
assert response.status_code == 200
Source code in eth_2_key_manager_api_client/api/local_key_manager.py
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
388
389
390
391
392
393
@attr.s(auto_attribs=True)
class ListKeys:
    """Contains methods for accessing the GET method of the /eth/v1/keystores 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_keys.sync_detailed()

        if response.status_code == 200:
            print(f"List of keys: {response.parsed.data}")
        else:
            print(f"List 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_keys.asyncio_detailed()

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

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

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

        List all validating pubkeys known to and decrypted by this keymanager 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 ListKeysResponse 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=ListKeysResponse)

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

        List all validating pubkeys known to and decrypted by this keymanager 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. ListKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
        """
        return self.sync_detailed().parsed

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

        List all validating pubkeys known to and decrypted by this keymanager 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 ListKeysResponse 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=ListKeysResponse)

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

        List all validating pubkeys known to and decrypted by this keymanager 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. ListKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
        """
        return (await self.asyncio_detailed()).parsed

asyncio() async

List Keys (asynchronous).

List all validating pubkeys known to and decrypted by this keymanager 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[ListKeysResponse, ErrorResponse]]

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

Source code in eth_2_key_manager_api_client/api/local_key_manager.py
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
async def asyncio(
    self,
) -> Optional[Union[ListKeysResponse, ErrorResponse]]:
    """List Keys (asynchronous).

    List all validating pubkeys known to and decrypted by this keymanager 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. ListKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
    """
    return (await self.asyncio_detailed()).parsed

asyncio_detailed() async

List Keys (asynchronous).

List all validating pubkeys known to and decrypted by this keymanager 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[ListKeysResponse, ErrorResponse]]

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

Source code in eth_2_key_manager_api_client/api/local_key_manager.py
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
async def asyncio_detailed(
    self,
) -> Response[Union[ListKeysResponse, ErrorResponse]]:
    """List Keys (asynchronous).

    List all validating pubkeys known to and decrypted by this keymanager 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 ListKeysResponse 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=ListKeysResponse)

sync()

List Keys (synchronous).

List all validating pubkeys known to and decrypted by this keymanager 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[ListKeysResponse, ErrorResponse]]

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

Source code in eth_2_key_manager_api_client/api/local_key_manager.py
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
def sync(
    self,
) -> Optional[Union[ListKeysResponse, ErrorResponse]]:
    """List Keys (synchronous).

    List all validating pubkeys known to and decrypted by this keymanager 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. ListKeysResponse object if the request succeeds, otherwise an ErrorResponse object.
    """
    return self.sync_detailed().parsed

sync_detailed()

List Keys (synchronous).

List all validating pubkeys known to and decrypted by this keymanager 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[ListKeysResponse, ErrorResponse]]

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

Source code in eth_2_key_manager_api_client/api/local_key_manager.py
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
def sync_detailed(
    self,
) -> Response[Union[ListKeysResponse, ErrorResponse]]:
    """List Keys (synchronous).

    List all validating pubkeys known to and decrypted by this keymanager 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 ListKeysResponse 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=ListKeysResponse)