Skip to content

[BlockchainWallet] Add evm#3279

Merged
Herklos merged 1 commit intodevfrom
feature/add-blockchain-analysis
Mar 1, 2026
Merged

[BlockchainWallet] Add evm#3279
Herklos merged 1 commit intodevfrom
feature/add-blockchain-analysis

Conversation

@Herklos
Copy link
Member

@Herklos Herklos commented Feb 28, 2026

No description provided.

@Herklos Herklos self-assigned this Feb 28, 2026
@contextlib.asynccontextmanager
async def open(self) -> typing.AsyncGenerator["EVMBlockchainWallet", None]:
rpc_url = self._get_rpc_url()
self._w3 = web3_lib.AsyncWeb3(web3_lib.AsyncWeb3.AsyncHTTPProvider(rpc_url))
Copy link
Member

Choose a reason for hiding this comment

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

I believe we can do async with AsyncWeb3 to close everything automatically

@Herklos Herklos force-pushed the feature/add-blockchain-analysis branch 6 times, most recently from e7d78ad to 219e381 Compare March 1, 2026 14:14
@Herklos Herklos marked this pull request as ready for review March 1, 2026 15:54
@Herklos Herklos force-pushed the feature/add-blockchain-analysis branch from 219e381 to 362fbd2 Compare March 1, 2026 16:18
Copy link
Member

@GuillaumeDSM GuillaumeDSM left a comment

Choose a reason for hiding this comment

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

great work!

Copy link
Member

Choose a reason for hiding this comment

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

this file should not be comitted


class TestLiveEthereumBalance:
@pytest.mark.asyncio
@pytest.mark.skipif(not _ETH_TEST_ADDRESS, reason="TEST_EVM_ETH_ADDRESS not set")
Copy link
Member

Choose a reason for hiding this comment

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

👍

async with wallet.open():
return _convert_portfolio_assets(await wallet.get_balance())
except ImportError:
return None
Copy link
Member

Choose a reason for hiding this comment

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

should we raise something here ? I think it's better than silencing this error

profile_data: "exchange_service_feed.ExchangeProfile",
new_position_only: bool,
started_at: datetime.datetime,
reference_market: str = "USDT",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
reference_market: str = "USDT",
reference_market: str = octobot_commons.constants.DEFAULT_REFERENCE_MARKET,

Comment on lines +157 to +158
# Total portfolio value = positions + free reference-market balance
total_portfolio_value = total_position_value + reference_market_balance
Copy link
Member

Choose a reason for hiding this comment

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

🎉

# Scripting requirements
tinydb
# Blockchain wallet
web3==7.14.1
Copy link
Member

Choose a reason for hiding this comment

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

👍

@Herklos Herklos force-pushed the feature/add-blockchain-analysis branch from 362fbd2 to f78109a Compare March 1, 2026 16:28
@Herklos
Copy link
Member Author

Herklos commented Mar 1, 2026

It's up, thanks!

@Herklos Herklos enabled auto-merge (rebase) March 1, 2026 16:29
@Herklos Herklos merged commit 2f69a40 into dev Mar 1, 2026
18 checks passed
@Herklos Herklos deleted the feature/add-blockchain-analysis branch March 1, 2026 16:51
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