mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* add contract method id tag * add form submit type * refactor types for SmartConstract and make new component for Contract ABI methods * move contract method form inside ABI folder * handle form submit and display result * clean-up * change copied text * handle case when blockchain interaction is not configured * tests and screenshots update * fix bug wit WEI checkbox
24 lines
566 B
TypeScript
24 lines
566 B
TypeScript
import type { UseAccountReturnType } from 'wagmi';
|
|
import { useAccount } from 'wagmi';
|
|
|
|
import config from 'configs/app';
|
|
|
|
function useAccountFallback(): UseAccountReturnType {
|
|
return {
|
|
address: undefined,
|
|
addresses: undefined,
|
|
chain: undefined,
|
|
chainId: undefined,
|
|
connector: undefined,
|
|
isConnected: false,
|
|
isConnecting: false,
|
|
isDisconnected: true,
|
|
isReconnecting: false,
|
|
status: 'disconnected',
|
|
};
|
|
}
|
|
|
|
const hook = config.features.blockchainInteraction.isEnabled ? useAccount : useAccountFallback;
|
|
|
|
export default hook;
|