Skip to content

Delegation

This part will be about the security key and how to use it. We will show how to create / setup a security key.

For more information about the security key, you can check the permissions section.

Exemple

Here is an example of how to create a security key:

from aleph.sdk.chains.ethereum import ETHAccount
from aleph.sdk.client import AuthenticatedAlephHttpClient

async def main():
    prv = bytes.fromhex("xxxxxx")
    account = ETHAccount(prv)
    async with AuthenticatedAlephHttpClient(account) as client:
        message, status = await client.create_aggregate(
            "security",
            {
                "authorizations": [
                    {
                        "address": "TARGET_ADDRESS",
                        "types": ["AGGREGATE"],
                        "aggregate_keys": ["testkey"]
                    }
                ]
            }
        )
        print(message.content)