mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* display methods accordion * add method_id to methods * query read method via public client * query read methods without inputs at accordion section open * add custom abi tabs * add proxy tabs * custom wagmi config if wc is not configured * remove ContractAbiItemConstant component * display tuple properties in method outputs * display read result * clean up * support nested arrays in the read result * re-write test for contract methods * change result view for address output * refactoring * fix tests * remove web3 provider fallback * fix tab loading * refactoring * add implementation contract selector * add "copy to clipboard" for address, remove top-level square brackets * add preview mode to contract method result * tests for read result * fix tests * change styles for result preview * review fix
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
import { defaultWagmiConfig } from '@web3modal/wagmi/react/config';
|
|
import { http } from 'viem';
|
|
import { createConfig, type CreateConfigParameters } from 'wagmi';
|
|
|
|
import config from 'configs/app';
|
|
import currentChain from 'lib/web3/currentChain';
|
|
const feature = config.features.blockchainInteraction;
|
|
|
|
const wagmiConfig = (() => {
|
|
const chains: CreateConfigParameters['chains'] = [ currentChain ];
|
|
|
|
if (!feature.isEnabled) {
|
|
const wagmiConfig = createConfig({
|
|
chains: [ currentChain ],
|
|
transports: {
|
|
[currentChain.id]: http(config.chain.rpcUrl || `${ config.api.endpoint }/api/eth-rpc`),
|
|
},
|
|
ssr: true,
|
|
batch: { multicall: { wait: 100 } },
|
|
});
|
|
|
|
return wagmiConfig;
|
|
}
|
|
|
|
const wagmiConfig = defaultWagmiConfig({
|
|
chains,
|
|
multiInjectedProviderDiscovery: true,
|
|
transports: {
|
|
[currentChain.id]: http(),
|
|
},
|
|
projectId: feature.walletConnect.projectId,
|
|
metadata: {
|
|
name: `${ config.chain.name } explorer`,
|
|
description: `${ config.chain.name } explorer`,
|
|
url: config.app.baseUrl,
|
|
icons: [ config.UI.navigation.icon.default ].filter(Boolean),
|
|
},
|
|
enableEmail: true,
|
|
ssr: true,
|
|
batch: { multicall: { wait: 100 } },
|
|
});
|
|
|
|
return wagmiConfig;
|
|
})();
|
|
|
|
export default wagmiConfig;
|