Skip to content

Commit dbb9bff

Browse files
committed
Fix: useWalletBalance and the useActiveAccount to work with
`0x{string}` addresses instead of strings.
1 parent e28eb73 commit dbb9bff

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

packages/thirdweb/src/adapters/viem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ function fromViemWalletClient(options: {
394394
);
395395
}
396396
return {
397-
address: viemAccount.address,
397+
address: viemAccount.address as `0x${string}`,
398398
signMessage: async (msg) => {
399399
return options.walletClient.signMessage({
400400
account: viemAccount,

packages/thirdweb/src/react/core/hooks/others/useWalletBalance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313

1414
type UseWalletBalanceOptions = Prettify<
1515
Omit<GetWalletBalanceOptions, "address" | "chain"> & {
16-
address: string | undefined;
16+
address: `0x${string}` | undefined;
1717
chain: Chain | undefined;
1818
}
1919
>;

packages/thirdweb/src/react/native/ui/connect/TokenListScreen.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const TokenRow = (props: {
6464
theme: Theme;
6565
client: ThirdwebClient;
6666
chain?: Chain;
67-
address?: string;
67+
address?: `0x${string}`;
6868
onTokenSelected?: (token?: TokenInfo) => void;
6969
}) => {
7070
const { token, theme, address, chain, client, onTokenSelected } = props;

packages/thirdweb/src/wallets/engine/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export type EngineAccountOptions = {
1919
/**
2020
* The backend wallet to use for sending transactions inside engine.
2121
*/
22-
walletAddress: string;
22+
walletAddress: `0x${string}`;
2323
overrides?: {
2424
/**
2525
* The address of the smart account to act on behalf of. Requires your backend wallet to be a valid signer on that smart account.

packages/thirdweb/src/wallets/interfaces/wallet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export type Account = {
164164
/**
165165
* address of the account
166166
*/
167-
address: Address;
167+
address: `0x${string}`;
168168
/**
169169
* Send the given transaction to the blockchain
170170
* @example

0 commit comments

Comments
 (0)