Skip to content

Commit

Permalink
fix: use transport from config if provided (#196)
Browse files Browse the repository at this point in the history
* fix: use transport from config if provided

* changeset
  • Loading branch information
coffeexcoin authored Jan 22, 2025
1 parent 1be48e7 commit cc4dc1a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/ten-nails-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@abstract-foundation/agw-react': patch
---

Fix transport used in useAbstractClient
4 changes: 3 additions & 1 deletion packages/agw-react/src/hooks/useAbstractClient.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { createAbstractClient } from '@abstract-foundation/agw-client';
import { useQuery } from '@tanstack/react-query';
import { custom, useChains } from 'wagmi';
import { custom, useChains, useConfig } from 'wagmi';

import { useGlobalWalletSignerClient } from './useGlobalWalletSignerClient.js';

export const useAbstractClient = () => {
const { data: signer, status, error } = useGlobalWalletSignerClient();
const [chain] = useChains();
const config = useConfig();

return useQuery({
gcTime: 0,
Expand All @@ -24,6 +25,7 @@ export const useAbstractClient = () => {
chain,
transport: custom(signer.transport),
isPrivyCrossApp: true,
publicTransport: config?._internal.transports[chain.id],
});

return client;
Expand Down

0 comments on commit cc4dc1a

Please sign in to comment.