Skip to content

Commit

Permalink
fix any in wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
jnsdls committed Jan 18, 2024
1 parent 0f876bb commit 1769a03
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions packages/thirdweb/src/react/wallet-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,13 @@ export function useSetActiveWallet() {
return activateWallet;
}

type UseConnectOptions = IWallet | (() => Promise<IWallet>);
export function useConnect() {
const { connectWallet } = useContext(WalletContext);
const [isConnecting, setIsConnecting] = useState(false);
const [error, setError] = useState<Error | null>(null);

const connect = useCallback(
async (options: UseConnectOptions) => {
async (options: IWallet | (() => Promise<IWallet>)) => {
// reset error state
setError(null);
if (typeof options !== "function") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {

export interface IWallet {
address: Address | null;
connect: (_opts: any) => Promise<InstanceType<IWallet>>;
connect: (_opts: any) => Promise<IWallet>;
disconnect: () => Promise<void>;
//
signMessage?: (_message: SignableMessage) => Promise<Hex>;
Expand All @@ -23,13 +23,13 @@ export interface IWallet {
>(
_typedData: TypedDataDefinition<typedData, primaryType>,
) => Promise<Hex>;

// TX methods
sendTransaction: <abiFn extends AbiFunction>(
_tx: Transaction<abiFn>,
) => Promise<{
transactionHash: Hex,
wait: () => Promise<TransactionReceipt>,
transactionHash: Hex;
wait: () => Promise<TransactionReceipt>;
}>;
estimateGas: <abiFn extends AbiFunction>(
_tx: Transaction<abiFn>,
Expand Down

0 comments on commit 1769a03

Please sign in to comment.