MDK Logo

PoolManagerMinerExplorer

Pool-manager miner explorer page — searchable / filterable table of miners with multi-select and an "Assign Pool" bulk action. Submits the chosen pool change…

Pool-manager miner explorer page — searchable / filterable table of miners with multi-select and an "Assign Pool" bulk action. Submits the chosen pool change as a pending action via the adapter actions store, then opens a confirmation modal.

Must be rendered inside <MdkProvider> — the page uses useActions, useCheckPerm, and useContextualModal from @tetherto/mdk-react-adapter.

import { PoolManagerMinerExplorer } from "@tetherto/mdk-react-devkit";
PropStatusTypeDefaultDescription
minersRequiredListThingsDevice[]Miners to render in the explorer table.
poolConfigRequiredPoolConfigEntry[]Pool configurations powering the "Assign Pool" dropdown.
backButtonClickRequiredVoidFunctionCalled when the operator clicks the "Pool Manager" back link.

Usage

Pool-manager miner explorer page: searchable / filterable table of miners with multi-select and an "Assign Pool" bulk action. Submits the chosen pool assignment as a pending action through the adapter actions store.

Use this as the /pool-manager/miners route. For just the table primitive, drop down to MinerExplorer.

Requirements

  • Render inside <MdkProvider>. The page reads / writes the actions store (useActions), reads the auth store (useCheckPerm against AUTH_PERMISSIONS.ACTIONS:WRITE), and uses useContextualModal for the Assign Pool dialog.

Behaviour

  • The "Assign Pool" button is gated behind ASSIGN_POOL_POPUP_ENABLED and the actions:write permission. Tooltips explain why it's disabled.
  • Submitting a pool assignment calls setAddPendingSubmissionAction with ACTION_TYPES.SETUP_POOLS for every selected miner, then resets the selection via the MinerExplorerRef imperative handle.
  • A success notifyInfo toast fires when the action is queued.

Data contracts

  • Devicefoundation/types/device.
  • PoolConfigData — exported from @tetherto/mdk-react-devkit.

Example

/** * Runnable example for PoolManagerMinerExplorer. * * Wrap the app in `<MdkProvider>`. The page reads / writes the actions store * and checks `actions:write` permission via the adapter hooks. */import { PoolManagerMinerExplorer } from '@tetherto/mdk-react-devkit'import type { Device, PoolConfigData } from '@tetherto/mdk-react-devkit'const mockMiners = [  {    id: 'miner-A1',    code: 'A1',    name: 'Rig A1',    last: { hashrate: 102.4, status: 'online' },  },  {    id: 'miner-A2',    code: 'A2',    name: 'Rig A2',    last: { hashrate: 98.7, status: 'online' },  },] as unknown as Device[]const mockPools = [  { id: 'pool-eu', name: 'EU primary', priority: 1 } as unknown as PoolConfigData,  { id: 'pool-us', name: 'US backup', priority: 2 } as unknown as PoolConfigData,]export const PoolManagerMinerExplorerExample = () => {  return (    <PoolManagerMinerExplorer      miners={mockMiners}      poolConfig={mockPools}      backButtonClick={() => {        // eslint-disable-next-line no-console        console.log('back to pool manager')      }}    />  )}