ghost-portal/packages/react-hooks/src/useStakingAsyncApis.ts
Arjun Porwal 5630635d4c
Refactor: Move Relay and Asset Hub API Connections to Context (#11891)
* feat: add StakingAsync context and hooks for improved staking API integration

* refactor: rename isStakingAsyncPage to isStakingAsync for consistency across components

* feat: introduce useBestNumberRelay hook for enhanced best number retrieval based on staking async state

* feat: add 'Kusama Asset Hub' link to Polkassembly and Subsquare configurations
2025-10-09 09:47:24 +05:30

16 lines
521 B
TypeScript

// Copyright 2017-2025 @polkadot/react-hooks authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { StakingAsyncApis } from './ctx/types.js';
import { useContext } from 'react';
import { StakingAsyncApisCtx } from './ctx/StakingAsync.js';
import { createNamedHook } from './createNamedHook.js';
function useStakingAsyncApisImpl (): StakingAsyncApis {
return useContext(StakingAsyncApisCtx);
}
export const useStakingAsyncApis = createNamedHook('useStakingAsyncApis', useStakingAsyncApisImpl);