Skip to content

Slow withdrawals (reclaim)#25

Merged
ex10ded merged 1 commit intomainfrom
slow-withdrawals-reclaim
Aug 4, 2024
Merged

Slow withdrawals (reclaim)#25
ex10ded merged 1 commit intomainfrom
slow-withdrawals-reclaim

Conversation

@alexex10
Copy link
Copy Markdown
Contributor

@alexex10 alexex10 commented Aug 1, 2024

Changes

  • Add account.withdrawal_slow_reclaim method

Usage example:

eth_address = "0x..."
eth_private_key = "0x..."

markets = await trading_client.markets_info.get_markets()
settings = await trading_client.info.get_settings()

tx_hash = trading_client.account.withdrawal_slow_reclaim(
    settings.data.stark_ex_contract_address,
    eth_address,
    markets.data[0],
    lambda: eth_private_key,
)

@alexex10 alexex10 marked this pull request as ready for review August 1, 2024 08:08
Comment thread x10/perpetual/contract.py
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I faced some problems with testing this logic as it requires network requests to build tx (chain RPC call), will think if there is a way to do it locally.

Comment thread x10/perpetual/contract.py
),
eth_private_key,
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might make sense to eth_private_key = None, but need to do a memory dump and check when it will be collected by gc.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets see if we can harmonise between eth_account and web3 methods of signing / private key management - will do an investigation.

Copy link
Copy Markdown
Contributor Author

@alexex10 alexex10 Aug 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, I like 100% sure it is possible 'cause web3 uses eth_account for this. but I think we should NOT "cache" or store L1 private key in any long-lived variable inside SDK.

@ex10ded ex10ded merged commit 92d7dae into main Aug 4, 2024
0xsumatt pushed a commit to 0xsumatt/x10_python_sdk that referenced this pull request Mar 31, 2025
@alexex10 alexex10 deleted the slow-withdrawals-reclaim branch June 23, 2025 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants