TGViewer
Lighter API/MM Updates Lighter API/MM Updates @lighter_api_updates · 1.02K subscribers
Post #60 479
Update:

We've just merged some breaking changes for the Python SDK.
As you might have noticed, the GO SDK was updated a while ago, changing the interface.
Major changes on that side include:
each sign operation returns the TxType, TxInfo & TxHash
each sign operation receives two new arguments: account_index & api_key_index
These changes allow the Python SDK to support multiple accounts & API keys easier.

Changes have been made to the Python SDK to accommodate the changes, as well as updated examples.
Now, both the examples and the SignerClient use multiple API keys by default.
Note that the SignerClient is tied to one account index. You can create multiple instances of SignerClient.
The shared library is designed as a singleton so that there will be just one instance of it, so it's loaded just once.

You can instance a SignerClient as follows:

client = lighter.SignerClient(
url="https://mainnet.zklighter.elliot.ai",
account_index=...,
api_private_keys={
3: "c180...",
4: "ef13...",
...
}
)


HTTP calls should not be affected by these changes.

For WS operations, which use sign_create_order for example, directly, you'll need to update the list of returned values.
Each sign_ operation returns a tuple of (TxType, TxInfo, TxHash, error).
On how to use these values to send the transaction, please refer to the ./examples/create_modify_cancel_order_ws.py.
It includes example on nonce management and sending the transactions.
Specifically for WS operations, the fact that you have access to the TxHash might allow you to track your transaction easier, in an async way.
  • ❤ 4
More from @lighter_api_updates
  1. Sep 18, 2026gm We will be performing a network upgrade on Sunday, September 20 at 11:00 AM UTC. Expect…
  2. Sep 16, 2026- The fun.xyz deposit flow now allows to generate a quote to estimate fees, received amoun…
  3. Sep 13, 2026- Starting tomorrow, the following changes to partner attribution will be deployed: https:…
  4. Sep 11, 2026gm We will be performing a network upgrade on Sunday, September 13 at 11:00 AM UTC. Expect…
  5. Sep 11, 2026Legacy market IDs were bounded to [0, 255) for perp markets, and [2048, 4096) for spot mar…
  6. Sep 9, 2026- Rate limits for L1Withdrawal have been increased to 10 per hour, per user - Fees for fas…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →