Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions examples/system_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# It serves as a good example
BASE_URL = "https://testnet.zklighter.elliot.ai"
ETH_PRIVATE_KEY = "1234567812345678123456781234567812345678123456781234567812345678"
API_KEY_INDEX = 1
API_KEY_INDEX = 3


async def main():
Expand All @@ -20,7 +20,9 @@ async def main():
eth_address = eth_acc.address

try:
response = await lighter.AccountApi(api_client).accounts_by_l1_address(l1_address=eth_address)
response = await lighter.AccountApi(api_client).accounts_by_l1_address(
l1_address=eth_address
)
except lighter.ApiException as e:
if e.data.message == "account not found":
print(f"error: account not found for {eth_address}")
Expand All @@ -31,7 +33,9 @@ async def main():
if len(response.sub_accounts) > 1:
for sub_account in response.sub_accounts:
print(f"found accountIndex: {sub_account.index}")
raise Exception(f"found found multiple account indexes: {len(response.sub_accounts)}")
raise Exception(
f"found found multiple account indexes: {len(response.sub_accounts)}"
)
else:
account_index = response.sub_accounts[0].index

Expand Down