create_lighter_signer_client

Documentation for eth_defi.lighter.sdk.create_lighter_signer_client function.

create_lighter_signer_client(account_index, api_key_index, api_private_key, api_url='https://mainnet.zklighter.elliot.ai')

Create an official SDK signer bound to one Lighter account and API key.

The SDK client opens an aiohttp session in its constructor, so call this inside a running asyncio event loop, for example at the start of the coroutine that uses the client. The returned client holds the private key in memory: close it with await client.close() when done and never log the client or its key.

See the SignerClient source.

Parameters
  • account_index (int) – Lighter account the client signs for.

  • api_key_index (int) – Registered API-key slot.

  • api_private_key (str) – Private key registered at api_key_index.

  • api_url (str) – Lighter API base URL. The SDK derives the Lighter chain id from it.

Returns

A lighter.SignerClient instance.

Return type

Any