Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ndodson committed Nov 5, 2024
1 parent 3738100 commit f81ae67
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
31 changes: 20 additions & 11 deletions uplink-client/src/providers/TransmissionsProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,30 @@ const TxProvider = ({ children }: { children: React.ReactNode }) => {
}

const TransmissionsClientProvider = ({ children }: { children: React.ReactNode }) => {
const chainId = useChainId();

const { data: walletClient, status } = useWalletClient();
const publicClient = usePublicClient();

const transmissionsClientConfig = useMemo(() => ({
chainId: SUPPORTED_CHAIN_IDS.includes(chainId) ? chainId : 8453,
walletClient: walletClient,
publicClient: publicClient,
apiConfig: {
serverUrl: getSubgraphUrl(chainId),
},
paymasterConfig: {
paymasterUrl: process.env.NODE_ENV === "production" ? `${process.env.NEXT_PUBLIC_HUB_URL}/v2/paymaster_proxy` : 'https://paymaster.base.org',
const transmissionsClientConfig = useMemo(() => {

const chainId = walletClient?.chain?.id;

if (!chainId || !SUPPORTED_CHAIN_IDS.includes(chainId)) {
return undefined;
}
}), [chainId, walletClient, publicClient]);

return {
chainId,
walletClient,
publicClient,
apiConfig: {
serverUrl: getSubgraphUrl(chainId),
},
paymasterConfig: {
paymasterUrl: process.env.NODE_ENV === "production" ? `${process.env.NEXT_PUBLIC_HUB_URL}/v2/paymaster_proxy` : 'https://paymaster.base.org',
},
};
}, [walletClient, publicClient]);

useTransmissionsClient(transmissionsClientConfig);

Expand Down
1 change: 1 addition & 0 deletions uplink-client/src/providers/WalletProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export default function WalletProvider({
<RainbowKitProvider
theme={darkTheme()}
modalSize="compact"
initialChain={base}
// avatar={(user) => <UserAvatar user={user} size={160} styleOverride="flex items-center rounded-full overflow-hidden p-2.5" />}
>
<TxProvider>
Expand Down

0 comments on commit f81ae67

Please sign in to comment.