Skip to content

map types from openapi.json#150

Open
lucasbalieiro wants to merge 2 commits into
stratum-mining:mainfrom
lucasbalieiro:map-types-openapi
Open

map types from openapi.json#150
lucasbalieiro wants to merge 2 commits into
stratum-mining:mainfrom
lucasbalieiro:map-types-openapi

Conversation

@lucasbalieiro
Copy link
Copy Markdown
Collaborator

closes #135.

this PR does not introduce any UI changes, since it is purely a refactor.

The main goal of testing here is to ensure that nothing was broken during the refactoring process. From my local tests, everything appears to be working correctly.

@lucasbalieiro lucasbalieiro marked this pull request as ready for review May 11, 2026 17:17
Copy link
Copy Markdown
Member

@GitGab19 GitGab19 left a comment

Choose a reason for hiding this comment

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

I haven't tested anything yet, but I have some questions in the meantime.

<InfoItem
label="Shares Acknowledged"
value={formatNumber(channel.shares_acknowledged)}
value={formatNumber('shares_acknowledged' in channel ? channel.shares_acknowledged : (channel as ExtendedChannelInfo | StandardChannelInfo).shares_accepted)}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why this change? Why do we have : (channel as ExtendedChannelInfo | StandardChannelInfo).shares_accepted?

</TableCell>
<TableCell className="text-right font-mono font-medium">
{formatHashrate(channel.nominal_hashrate)}
{formatHashrate(channel.nominal_hashrate ?? null)}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why this change?

Comment on lines -409 to +412
channel_id: client.channel_id,
channel_id: client.channel_id ?? null,
channel_type: 'sv1' as ChannelType,
user_identity: client.user_identity,
estimated_hashrate: client.hashrate,
estimated_hashrate: client.hashrate ?? null,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

When can these be null?

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.

refactor Monitoring API Types: Use OpenAPI Spec

2 participants