Skip to content

Commit f83ab59

Browse files
Merge pull request #312 from reown-com/fix/ethers-walletinfo
fix: show wallet info in useWalletInfo hook for ethers and ethers5
2 parents 4202275 + 1f80e20 commit f83ab59

File tree

33 files changed

+198
-72
lines changed

33 files changed

+198
-72
lines changed

.changeset/light-geese-stare.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@reown/appkit-ethers5-react-native': patch
3+
'@reown/appkit-ethers-react-native': patch
4+
'@reown/appkit-auth-ethers-react-native': patch
5+
'@reown/appkit-auth-wagmi-react-native': patch
6+
'@reown/appkit-coinbase-ethers-react-native': patch
7+
'@reown/appkit-coinbase-wagmi-react-native': patch
8+
'@reown/appkit-common-react-native': patch
9+
'@reown/appkit-core-react-native': patch
10+
'@reown/appkit-scaffold-react-native': patch
11+
'@reown/appkit-scaffold-utils-react-native': patch
12+
'@reown/appkit-siwe-react-native': patch
13+
'@reown/appkit-ui-react-native': patch
14+
'@reown/appkit-wagmi-react-native': patch
15+
'@reown/appkit-wallet-react-native': patch
16+
---
17+
18+
fix: show wallet info in useWalletInfo hook for ethers and ethers5

packages/auth-ethers/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"access": "public"
3737
},
3838
"dependencies": {
39+
"@reown/appkit-common-react-native": "1.2.1",
3940
"@reown/appkit-wallet-react-native": "1.2.1"
4041
},
4142
"peerDependencies": {

packages/auth-ethers/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { AppKitFrameProvider, type AppKitFrameTypes } from '@reown/appkit-wallet-react-native';
2-
2+
import { ConstantsUtil, PresetsUtil } from '@reown/appkit-common-react-native';
33
interface AuthProviderProps {
44
projectId: string;
55
metadata: AppKitFrameTypes.Metadata;
66
}
77

88
export class AuthProvider extends AppKitFrameProvider {
9-
readonly id = 'appKitAuth';
10-
readonly name = 'AppKit Auth';
9+
readonly id = ConstantsUtil.AUTH_CONNECTOR_ID;
10+
readonly name = PresetsUtil.ConnectorNamesMap[ConstantsUtil.AUTH_CONNECTOR_ID]!;
1111

1212
constructor(props: AuthProviderProps) {
1313
super(props.projectId, props.metadata);

packages/auth-wagmi/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"access": "public"
3737
},
3838
"dependencies": {
39+
"@reown/appkit-common-react-native": "1.2.1",
3940
"@reown/appkit-core-react-native": "1.2.1",
4041
"@reown/appkit-wallet-react-native": "1.2.1"
4142
},

packages/auth-wagmi/src/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { SwitchChainError, getAddress, type Address, type Hex } from 'viem';
33

44
import { AppKitFrameProvider } from '@reown/appkit-wallet-react-native';
55
import { StorageUtil } from '@reown/appkit-core-react-native';
6+
import { ConstantsUtil, PresetsUtil } from '@reown/appkit-common-react-native';
67

78
export type Metadata = {
89
name: string;
@@ -26,16 +27,16 @@ type StorageItemMap = {
2627
recentConnectorId?: string;
2728
};
2829

29-
authConnector.type = 'appKitAuth' as const;
30-
authConnector.id = 'appKitAuth' as const;
30+
authConnector.type = PresetsUtil.ConnectorTypesMap[ConstantsUtil.AUTH_CONNECTOR_ID]!;
31+
authConnector.id = ConstantsUtil.AUTH_CONNECTOR_ID;
3132
export function authConnector(parameters: AuthConnectorOptions) {
3233
let _provider: AppKitFrameProvider = {} as AppKitFrameProvider;
3334
let _currentAddress: Address | null = null;
3435
let _chainId: number | null = null;
3536

3637
return createConnector<Provider, {}, StorageItemMap>(config => ({
3738
id: authConnector.id,
38-
name: 'AppKit Auth',
39+
name: PresetsUtil.ConnectorNamesMap[ConstantsUtil.AUTH_CONNECTOR_ID]!,
3940
type: authConnector.type,
4041
async setup() {
4142
_provider = new AppKitFrameProvider(parameters.projectId, parameters.metadata);

packages/coinbase-ethers/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
"registry": "https://registry.npmjs.org/",
3737
"access": "public"
3838
},
39+
"dependencies": {
40+
"@reown/appkit-common-react-native": "1.2.1"
41+
},
3942
"peerDependencies": {
4043
"@coinbase/wallet-mobile-sdk": ">=1.0.10",
4144
"ethers": ">=5"

packages/coinbase-ethers/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { configure, WalletMobileSDKEVMProvider } from '@coinbase/wallet-mobile-sdk';
22
import type { WalletMobileSDKProviderOptions } from '@coinbase/wallet-mobile-sdk/build/WalletMobileSDKEVMProvider';
3+
import { ConstantsUtil, PresetsUtil } from '@reown/appkit-common-react-native';
34

45
interface RequestArguments {
56
readonly method: string;
@@ -12,8 +13,8 @@ type CoinbaseProviderOptions = WalletMobileSDKProviderOptions & {
1213
};
1314

1415
export class CoinbaseProvider {
15-
readonly id = 'coinbaseWallet';
16-
readonly name = 'Coinbase Wallet';
16+
readonly id = ConstantsUtil.COINBASE_CONNECTOR_ID;
17+
readonly name = PresetsUtil.ConnectorNamesMap[ConstantsUtil.COINBASE_CONNECTOR_ID]!;
1718

1819
private _provider?: WalletMobileSDKEVMProvider;
1920
private _initProviderPromise?: Promise<void>;

packages/coinbase-wagmi/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
"registry": "https://registry.npmjs.org/",
3737
"access": "public"
3838
},
39+
"dependencies": {
40+
"@reown/appkit-common-react-native": "1.2.1"
41+
},
3942
"peerDependencies": {
4043
"@coinbase/wallet-mobile-sdk": ">=1.0.10",
4144
"wagmi": ">=2"

packages/coinbase-wagmi/src/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@ import {
88
} from 'viem';
99
import { WalletMobileSDKEVMProvider, configure } from '@coinbase/wallet-mobile-sdk';
1010
import type { WalletMobileSDKProviderOptions } from '@coinbase/wallet-mobile-sdk/build/WalletMobileSDKEVMProvider';
11+
import { ConstantsUtil, PresetsUtil } from '@reown/appkit-common-react-native';
1112

1213
type CoinbaseConnectorParameters = WalletMobileSDKProviderOptions & {
1314
redirect: string;
1415
};
1516

1617
type Provider = WalletMobileSDKEVMProvider;
1718

18-
coinbaseConnector.type = 'coinbaseWallet' as const;
19+
coinbaseConnector.type = PresetsUtil.ConnectorTypesMap[ConstantsUtil.COINBASE_CONNECTOR_ID]!;
1920
export function coinbaseConnector(parameters: CoinbaseConnectorParameters) {
2021
let _provider: Provider;
2122

2223
return createConnector<Provider>(config => ({
23-
id: 'coinbaseWallet',
24-
name: 'Coinbase Wallet',
24+
id: ConstantsUtil.COINBASE_CONNECTOR_ID,
25+
name: PresetsUtil.ConnectorNamesMap[ConstantsUtil.COINBASE_CONNECTOR_ID]!,
2526
type: coinbaseConnector.type,
2627
async connect({ chainId } = {}) {
2728
try {

packages/common/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export { DateUtil } from './utils/DateUtil';
44
export { NamesUtil } from './utils/NamesUtil';
55
export { NetworkUtil } from './utils/NetworkUtil';
66
export { NumberUtil } from './utils/NumberUtil';
7+
export { PresetsUtil } from './utils/PresetsUtil';
78
export { StringUtil } from './utils/StringUtil';
89
export { ErrorUtil } from './utils/ErrorUtil';
910
export { erc20ABI } from './contracts/erc20';

0 commit comments

Comments
 (0)