You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
## Bug Report: SDK v1.0.2 Incompatible with Lighter API #103
Bug Report: SDK v1.0.2 Incompatible with Lighter API
Problem: All order operations fail with error code 21136
Error Message:
HTTP response body: code=21136 message='invalid PublicKey, update the sdk to the latest version'
Affected Operations:
create_market_order
create_sl_order
create_tp_order
create_order (all types)
SDK Version: 1.0.2 (latest from main branch)
Expected: Orders should be placed successfully
Actual: All orders fail with PublicKey validation error
Root Cause:
The Lighter API now requires a PublicKey field in transaction payloads, but SDK v1.0.2's compiled signer (lighter-signer-linux-amd64.so) doesn't include this field.
Request:
Please update the SDK and signer binary to include PublicKey field in all transaction types.
Workaround Needed:
Is there a temporary solution while waiting for SDK update?
git clone https://github.com/elliottech/lighter-python.git
cd lighter-python
pip install -e .
Important: Check for package conflicts!
There's another PyPI package called lighter (a deep learning framework) that may conflict. Verify you're importing the correct one:
importlighterprint(lighter.__file__) # Should point to the trading SDK, not /site-packages/lighter from the ML package
If there's a conflict:
pip uninstall lighter # Remove the ML package if installed
pip install -e /path/to/lighter-python # Reinstall the trading SDK
Updated SignerClient API:
Note that v1.0.2 changed the constructor:
# OLD (doesn't work):client=lighter.SignerClient.create_client(url, private_key, api_key_index, account_index)
# NEW (v1.0.2):client=lighter.SignerClient(
url=url,
account_index=account_index,
api_private_keys={api_key_index: api_key}, # Dict[int, str]
)
I get the same error "HTTP response body: code=21136 message='invalid PublicKey, update the sdk to the latest version' additional_properties={}" on sdk version 1.0.2. This error appeared in version 1.0.1. I updated to version 1.0.2, but that didn't help. If I understand correctly, the API changed on the server side, but the fix was not added to the SDK.
UPD: I recreated the API key and everything worked.
Activity
teamreputapro-sudo commentedon Dec 22, 2025
✅ Confirmed Fixed in SDK v1.0.2 (latest main branch)
I was experiencing the same error 21136 "invalid PublicKey" and can confirm that the issue is resolved in the current SDK v1.0.2 on the main branch.
What was the problem?
The root cause was in the
CreateAuthTokenfunction. The old code passed only the deadline:But it needed deadline + timestamp:
This is now fixed in
signer_client.py:How to fix
There's another PyPI package called
lighter(a deep learning framework) that may conflict. Verify you're importing the correct one:If there's a conflict:
Note that v1.0.2 changed the constructor:
Verification
After updating, verify with:
Both should return OK.
Test Results
I tested on mainnet with real orders:
All returned code 200.
Hope this helps! The SDK is working correctly now.
daedra86 commentedon Dec 26, 2025
I get the same error "HTTP response body: code=21136 message='invalid PublicKey, update the sdk to the latest version' additional_properties={}" on sdk version 1.0.2. This error appeared in version 1.0.1. I updated to version 1.0.2, but that didn't help. If I understand correctly, the API changed on the server side, but the fix was not added to the SDK.
UPD: I recreated the API key and everything worked.