Pools
Pools page and pool-authoring dialog for configuring mining pools
Authoring UI for mining pools. PoolManagerPools is the plug-and-play feature composite used by the demo; AddPoolModal is the pool-authoring dialog it opens on demand.
For miner-to-pool assignment via the explorer, see Miner explorer. For the landing surface, see Dashboard.
Prerequisites
- Complete the @mdk/foundation installation and add the dependency
- A connected Redux store with
actionsSlicewired up.PoolManagerPoolsandAddPoolModaldispatch pool-config actions - Pool configuration data (
PoolConfigData[]) sourced from your API layer - Feature flags that gate optional controls:
ADD_POOL_ENABLED,SHOW_CREDENTIAL_TEMPLATE,SHOW_POOL_VALIDATION(re-exported from@mdk/foundation)
Components
| Component | Description |
|---|---|
PoolManagerPools | Pool Manager pools page with accordion list and Add Pool action |
AddPoolModal | Dialog for authoring a new pool configuration |
PoolManagerPools
Feature composite that renders the pools page: header with **Add Pool** button (gated by ADD_POOL_ENABLED), a loader/error state, and a collapsible accordion listing every pool with its endpoints, credentials template, and validation status. Opens AddPoolModal on demand.
Import
import { PoolManagerPools } from '@mdk/foundation'Props
| Prop | Type | Default | Description |
|---|---|---|---|
poolConfig | PoolConfigData[] | required | Pool configuration source; hydrated by usePoolConfigs |
backButtonClick | () => void | required | Fires when the operator clicks the "Pool Manager" back link |
Behaviour
- Renders a page header (title + back link) with an Add Pool button gated by the
ADD_POOL_ENABLEDflag - Shows a loader while
usePoolConfigsis loading, or aCoreAlerton error - Lists every pool in a collapsible accordion: each row shows the pool name, description, unit/miner counts, and a validation badge; expanding a row reveals the endpoints list, credentials template, and a Test Configuration action
- Opens
AddPoolModalwhen the Add Pool button is clicked
Basic usage
<PoolManagerPools
poolConfig={poolConfigs}
backButtonClick={() => router.push('/pool-manager')}
/>Styling
.mdk-pm-pools: Root element.mdk-pm-pools__header: Title and action row.mdk-pm-pools__header-title: Page title.mdk-pm-pools__back-link: Back link button.mdk-pm-pools__accordion: Accordion root.mdk-pm-pools__accordion-item,.mdk-pm-pools__accordion-trigger,.mdk-pm-pools__accordion-content: Accordion parts
AddPoolModal
Dialog that collects pool info, endpoints, and credential template fields. Validates with Zod and dispatches ACTION_TYPES.REGISTER_POOL_CONFIG through actionsSlice on submit.
Dialog for authoring a new pool configuration. Collects pool info, endpoints, and credential template fields; validates with Zod; dispatches ACTION_TYPES.REGISTER_POOL_CONFIG to actionsSlice on submit.
Import
import { AddPoolModal } from '@mdk/foundation'Props
| Prop | Type | Default | Description |
|---|---|---|---|
isOpen | boolean | false | Controls visibility |
onClose | () => void | required | Closes the dialog |
Form schema
groupName: required, non-empty (Pool Name)description: optionalworkerName: required, non-empty (Pool Username)suffixType: nullable, shown whenSHOW_CREDENTIAL_TEMPLATEis onendpoints: required, minimum 1, maximumMAX_POOL_ENDPOINTS
Role labels for endpoints are derived from position using POOL_ENDPOINT_INDEX_ROLES and POOL_ENDPOINT_ROLES_LABELS.
Basic usage
const {
modalOpen,
handleOpen,
handleClose,
} = useContextualModal()
<AddPoolModal isOpen={modalOpen} onClose={handleClose} />Styling
.mdk-pm-add-pool-modal: Root dialog.mdk-pm-add-pool-modal__section-header: Section headings (e.g. POOL INFO, ENDPOINTS CONFIGURATION, CREDENTIALS TEMPLATE).mdk-pm-add-pool-modal__endpoints-section,.mdk-pm-add-pool-modal__endpoints-header,.mdk-pm-add-pool-modal__endpoints-list: Endpoints region.mdk-pm-add-pool-modal__endpoint,.mdk-pm-add-pool-modal__endpoint-header,.mdk-pm-add-pool-modal__endpoint-role,.mdk-pm-add-pool-modal__endpoint-fields: Per-endpoint blocks.mdk-pm-add-pool-modal__validation-section,.mdk-pm-add-pool-modal__validation-status: Shown whenSHOW_POOL_VALIDATIONis on.mdk-pm-add-pool-modal__footer: Actions

