@reown/appkit-react-native 0.0.0-chore-examples-20251009175707 → 0.0.0-chore-qr-borders-20251104183806

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/lib/commonjs/AppKit.js +20 -6
  2. package/lib/commonjs/AppKit.js.map +1 -1
  3. package/lib/commonjs/hooks/useAccount.js +65 -2
  4. package/lib/commonjs/hooks/useAccount.js.map +1 -1
  5. package/lib/commonjs/modal/w3m-modal/styles.js +2 -1
  6. package/lib/commonjs/modal/w3m-modal/styles.js.map +1 -1
  7. package/lib/commonjs/partials/w3m-connecting-qrcode/index.js +5 -1
  8. package/lib/commonjs/partials/w3m-connecting-qrcode/index.js.map +1 -1
  9. package/lib/commonjs/partials/w3m-send-input-token/index.js +6 -3
  10. package/lib/commonjs/partials/w3m-send-input-token/index.js.map +1 -1
  11. package/lib/commonjs/partials/w3m-swap-input/index.js +6 -3
  12. package/lib/commonjs/partials/w3m-swap-input/index.js.map +1 -1
  13. package/lib/commonjs/views/w3m-account-default-view/index.js +2 -1
  14. package/lib/commonjs/views/w3m-account-default-view/index.js.map +1 -1
  15. package/lib/commonjs/views/w3m-onramp-settings-view/index.js +2 -0
  16. package/lib/commonjs/views/w3m-onramp-settings-view/index.js.map +1 -1
  17. package/lib/commonjs/views/w3m-onramp-view/index.js +3 -2
  18. package/lib/commonjs/views/w3m-onramp-view/index.js.map +1 -1
  19. package/lib/commonjs/views/w3m-swap-view/components/select-token-modal/index.js +2 -1
  20. package/lib/commonjs/views/w3m-swap-view/components/select-token-modal/index.js.map +1 -1
  21. package/lib/commonjs/views/w3m-swap-view/index.js +4 -2
  22. package/lib/commonjs/views/w3m-swap-view/index.js.map +1 -1
  23. package/lib/commonjs/views/w3m-wallet-send-view/index.js +2 -1
  24. package/lib/commonjs/views/w3m-wallet-send-view/index.js.map +1 -1
  25. package/lib/module/AppKit.js +20 -6
  26. package/lib/module/AppKit.js.map +1 -1
  27. package/lib/module/hooks/useAccount.js +66 -2
  28. package/lib/module/hooks/useAccount.js.map +1 -1
  29. package/lib/module/index.js.map +1 -1
  30. package/lib/module/modal/w3m-modal/styles.js +2 -1
  31. package/lib/module/modal/w3m-modal/styles.js.map +1 -1
  32. package/lib/module/partials/w3m-connecting-qrcode/index.js +5 -1
  33. package/lib/module/partials/w3m-connecting-qrcode/index.js.map +1 -1
  34. package/lib/module/partials/w3m-send-input-token/index.js +6 -3
  35. package/lib/module/partials/w3m-send-input-token/index.js.map +1 -1
  36. package/lib/module/partials/w3m-swap-input/index.js +6 -3
  37. package/lib/module/partials/w3m-swap-input/index.js.map +1 -1
  38. package/lib/module/views/w3m-account-default-view/index.js +2 -1
  39. package/lib/module/views/w3m-account-default-view/index.js.map +1 -1
  40. package/lib/module/views/w3m-onramp-settings-view/index.js +2 -0
  41. package/lib/module/views/w3m-onramp-settings-view/index.js.map +1 -1
  42. package/lib/module/views/w3m-onramp-view/index.js +3 -2
  43. package/lib/module/views/w3m-onramp-view/index.js.map +1 -1
  44. package/lib/module/views/w3m-swap-view/components/select-token-modal/index.js +2 -1
  45. package/lib/module/views/w3m-swap-view/components/select-token-modal/index.js.map +1 -1
  46. package/lib/module/views/w3m-swap-view/index.js +4 -2
  47. package/lib/module/views/w3m-swap-view/index.js.map +1 -1
  48. package/lib/module/views/w3m-wallet-send-view/index.js +2 -1
  49. package/lib/module/views/w3m-wallet-send-view/index.js.map +1 -1
  50. package/lib/typescript/AppKit.d.ts +9 -2
  51. package/lib/typescript/AppKit.d.ts.map +1 -1
  52. package/lib/typescript/AppKitContext.d.ts +1 -1
  53. package/lib/typescript/hooks/useAccount.d.ts +57 -33
  54. package/lib/typescript/hooks/useAccount.d.ts.map +1 -1
  55. package/lib/typescript/index.d.ts +1 -1
  56. package/lib/typescript/index.d.ts.map +1 -1
  57. package/lib/typescript/modal/w3m-modal/styles.d.ts +1 -0
  58. package/lib/typescript/modal/w3m-modal/styles.d.ts.map +1 -1
  59. package/lib/typescript/partials/w3m-connecting-qrcode/index.d.ts.map +1 -1
  60. package/lib/typescript/partials/w3m-send-input-token/index.d.ts +2 -1
  61. package/lib/typescript/partials/w3m-send-input-token/index.d.ts.map +1 -1
  62. package/lib/typescript/partials/w3m-swap-input/index.d.ts +2 -1
  63. package/lib/typescript/partials/w3m-swap-input/index.d.ts.map +1 -1
  64. package/lib/typescript/views/w3m-account-default-view/index.d.ts.map +1 -1
  65. package/lib/typescript/views/w3m-onramp-settings-view/index.d.ts.map +1 -1
  66. package/lib/typescript/views/w3m-onramp-view/index.d.ts.map +1 -1
  67. package/lib/typescript/views/w3m-swap-view/index.d.ts.map +1 -1
  68. package/lib/typescript/views/w3m-wallet-send-view/index.d.ts.map +1 -1
  69. package/package.json +4 -4
  70. package/src/AppKit.ts +27 -7
  71. package/src/hooks/useAccount.ts +89 -3
  72. package/src/index.ts +1 -1
  73. package/src/modal/w3m-modal/styles.ts +2 -1
  74. package/src/partials/w3m-connecting-qrcode/index.tsx +10 -1
  75. package/src/partials/w3m-send-input-token/index.tsx +5 -1
  76. package/src/partials/w3m-swap-input/index.tsx +5 -1
  77. package/src/views/w3m-account-default-view/index.tsx +6 -1
  78. package/src/views/w3m-onramp-settings-view/index.tsx +7 -1
  79. package/src/views/w3m-onramp-view/index.tsx +3 -2
  80. package/src/views/w3m-swap-view/components/select-token-modal/index.tsx +1 -1
  81. package/src/views/w3m-swap-view/index.tsx +2 -0
  82. package/src/views/w3m-wallet-send-view/index.tsx +1 -0
@@ -1,39 +1,63 @@
1
+ import type { AccountType, AppKitNetwork } from '@reown/appkit-common-react-native';
2
+ /**
3
+ * Represents a blockchain account with its associated metadata
4
+ */
5
+ export interface Account {
6
+ /** The blockchain address of the account */
7
+ address: string;
8
+ /** The blockchain namespace (e.g., 'eip155' for Ethereum, 'solana' for Solana) */
9
+ namespace: string;
10
+ /** The chain ID where this account is active */
11
+ chainId: string;
12
+ /** Optional account type (e.g. 'eoa' or 'smartAccount') */
13
+ type?: AccountType;
14
+ }
15
+ /**
16
+ * Hook to access the current account state and connection information
17
+ *
18
+ * @remarks
19
+ * This hook provides access to all connected accounts, the currently active account,
20
+ * connection status, and active chain information. It automatically subscribes to
21
+ * connection state changes via valtio.
22
+ *
23
+ * The hook parses account data from CAIP-10 format (namespace:chainId:address)
24
+ * and provides a normalized structure.
25
+ *
26
+ * @returns An object containing:
27
+ * - `allAccounts` - Array of all connected accounts across all connections
28
+ * - `address` - The plain address of the currently active account (without namespace or chain prefix)
29
+ * - `isConnected` - Boolean indicating if a wallet is currently connected
30
+ * - `chainId` - The ID of the currently active chain
31
+ * - `chain` - The full chain/network object of the currently active chain
32
+ * - `namespace` - The namespace of the currently active account (e.g. 'eip155', 'solana' or 'bip122')
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * function MyComponent() {
37
+ * const { address, isConnected, chainId, allAccounts } = useAccount();
38
+ *
39
+ * if (!isConnected) {
40
+ * return <Text>Not connected</Text>;
41
+ * }
42
+ *
43
+ * return (
44
+ * <View>
45
+ * <Text>Connected: {address}</Text>
46
+ * <Text>Chain: {chainId}</Text>
47
+ * <Text>Total accounts: {allAccounts.length}</Text>
48
+ * </View>
49
+ * );
50
+ * }
51
+ * ```
52
+ *
53
+ * @throws Will log errors via LogController if account parsing fails
54
+ */
1
55
  export declare function useAccount(): {
56
+ allAccounts: Account[];
2
57
  address: string | undefined;
3
58
  isConnected: boolean;
4
- chainId: string | number | undefined;
5
- chain: {
6
- readonly id: string | number;
7
- readonly name: string;
8
- readonly nativeCurrency: {
9
- readonly name: string;
10
- readonly symbol: string;
11
- readonly decimals: number;
12
- };
13
- readonly rpcUrls: {
14
- readonly [x: string]: {
15
- readonly http: readonly string[];
16
- } | undefined;
17
- readonly default: {
18
- readonly http: readonly string[];
19
- };
20
- };
21
- readonly blockExplorers?: {
22
- readonly [x: string]: {
23
- readonly name: string;
24
- readonly url: string;
25
- } | undefined;
26
- readonly default: {
27
- readonly name: string;
28
- readonly url: string;
29
- };
30
- } | undefined;
31
- readonly chainNamespace: "eip155" | "solana" | "bip122";
32
- readonly caipNetworkId: `${string}:${string}`;
33
- readonly testnet?: boolean | undefined;
34
- readonly deprecatedCaipNetworkId?: `${string}:${string}` | undefined;
35
- readonly imageUrl?: string | undefined;
36
- } | undefined;
59
+ chainId: string | undefined;
60
+ chain: AppKitNetwork | undefined;
37
61
  namespace: import("@reown/appkit-common-react-native").ChainNamespace | undefined;
38
62
  };
39
63
  //# sourceMappingURL=useAccount.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAccount.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAccount.ts"],"names":[],"mappings":"AAMA,wBAAgB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBzB"}
1
+ {"version":3,"file":"useAccount.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAccount.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAEpF;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,kFAAkF;IAClF,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,UAAU;;;;;;;EAoDzB"}
@@ -13,7 +13,7 @@ export type { AppKitConfig } from './types';
13
13
  /****** Hooks *******/
14
14
  export { useAppKit } from './hooks/useAppKit';
15
15
  export { useProvider } from './hooks/useProvider';
16
- export { useAccount } from './hooks/useAccount';
16
+ export { useAccount, type Account as UseAccountReturn } from './hooks/useAccount';
17
17
  export { useWalletInfo } from './hooks/useWalletInfo';
18
18
  export { useAppKitEvents, useAppKitEventSubscription } from './hooks/useAppKitEvents';
19
19
  export { useAppKit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,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEhF,gCAAgC;AAChC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACxF,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAE5E,4BAA4B;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,4BAA4B;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
@@ -2,6 +2,7 @@ declare const _default: {
2
2
  card: {
3
3
  borderBottomLeftRadius: number;
4
4
  borderBottomRightRadius: number;
5
+ borderWidth: number;
5
6
  };
6
7
  };
7
8
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/modal/w3m-modal/styles.ts"],"names":[],"mappings":";;;;;;AAEA,wBAKG"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/modal/w3m-modal/styles.ts"],"names":[],"mappings":";;;;;;;AAEA,wBAMG"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/partials/w3m-connecting-qrcode/index.tsx"],"names":[],"mappings":"AAsBA,wBAAgB,gBAAgB,4CA+D/B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/partials/w3m-connecting-qrcode/index.tsx"],"names":[],"mappings":"AAyBA,wBAAgB,gBAAgB,4CAqE/B"}
@@ -6,6 +6,7 @@ export interface SendInputTokenProps {
6
6
  style?: StyleProp<ViewStyle>;
7
7
  onTokenPress?: () => void;
8
8
  loading?: boolean;
9
+ testID?: string;
9
10
  }
10
- export declare function SendInputToken({ token, sendTokenAmount, style, onTokenPress, loading }: SendInputTokenProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function SendInputToken({ token, sendTokenAmount, style, onTokenPress, loading, testID }: SendInputTokenProps): import("react/jsx-runtime").JSX.Element;
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/partials/w3m-send-input-token/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AASzE,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAM7E,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,eAAe,EACf,KAAK,EACL,YAAY,EACZ,OAAO,EACR,EAAE,mBAAmB,2CAsFrB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/partials/w3m-send-input-token/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AASzE,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAM7E,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,eAAe,EACf,KAAK,EACL,YAAY,EACZ,OAAO,EACP,MAAM,EACP,EAAE,mBAAmB,2CAwFrB"}
@@ -15,6 +15,7 @@ export interface SwapInputProps {
15
15
  marketValue?: number;
16
16
  editable?: boolean;
17
17
  autoFocus?: boolean;
18
+ testID?: string;
18
19
  }
19
- export declare function SwapInput({ token, value, style, loading, loadingValues, onTokenPress, onMaxPress, onChange, marketValue, editable, autoFocus }: SwapInputProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function SwapInput({ token, value, style, loading, loadingValues, onTokenPress, onMaxPress, onChange, marketValue, editable, autoFocus, testID }: SwapInputProps): import("react/jsx-runtime").JSX.Element;
20
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/partials/w3m-swap-input/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAa,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAYzE,OAAO,EAAc,KAAK,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAE1F,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;I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SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAID,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,KAAK,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,SAAS,EACT,MAAM,EACP,EAAE,cAAc,2CAqHhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-account-default-view/index.tsx"],"names":[],"mappings":"AAqCA,wBAAgB,kBAAkB,4CA6TjC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-account-default-view/index.tsx"],"names":[],"mappings":"AAqCA,wBAAgB,kBAAkB,4CAkUjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-onramp-settings-view/index.tsx"],"names":[],"mappings":"AA0BA,wBAAgB,kBAAkB,4CA+HjC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-onramp-settings-view/index.tsx"],"names":[],"mappings":"AA0BA,wBAAgB,kBAAkB,4CAqIjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-onramp-view/index.tsx"],"names":[],"mappings":"AAuCA,wBAAgB,UAAU,4CAsOzB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-onramp-view/index.tsx"],"names":[],"mappings":"AAuCA,wBAAgB,UAAU,4CAuOzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-swap-view/index.tsx"],"names":[],"mappings":"AA0BA,wBAAgB,QAAQ,4CA8LvB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-swap-view/index.tsx"],"names":[],"mappings":"AA0BA,wBAAgB,QAAQ,4CAgMvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-wallet-send-view/index.tsx"],"names":[],"mappings":"AAeA,wBAAgB,cAAc,4CAyG7B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/w3m-wallet-send-view/index.tsx"],"names":[],"mappings":"AAeA,wBAAgB,cAAc,4CA0G7B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reown/appkit-react-native",
3
- "version": "0.0.0-chore-examples-20251009175707",
3
+ "version": "0.0.0-chore-qr-borders-20251104183806",
4
4
  "main": "lib/commonjs/index.js",
5
5
  "types": "lib/typescript/index.d.ts",
6
6
  "module": "lib/module/index.js",
@@ -39,9 +39,9 @@
39
39
  "provenance": true
40
40
  },
41
41
  "dependencies": {
42
- "@reown/appkit-common-react-native": "0.0.0-chore-examples-20251009175707",
43
- "@reown/appkit-core-react-native": "0.0.0-chore-examples-20251009175707",
44
- "@reown/appkit-ui-react-native": "0.0.0-chore-examples-20251009175707",
42
+ "@reown/appkit-common-react-native": "0.0.0-chore-qr-borders-20251104183806",
43
+ "@reown/appkit-core-react-native": "0.0.0-chore-qr-borders-20251104183806",
44
+ "@reown/appkit-ui-react-native": "0.0.0-chore-qr-borders-20251104183806",
45
45
  "@walletconnect/universal-provider": "2.21.10",
46
46
  "valtio": "2.1.8"
47
47
  },
package/src/AppKit.ts CHANGED
@@ -271,29 +271,49 @@ export class AppKit {
271
271
  return this.networks;
272
272
  }
273
273
 
274
- async switchNetwork(network: AppKitNetwork): Promise<void> {
274
+ /**
275
+ * Switches to a different network.
276
+ * @param network - Either an AppKitNetwork object or a CAIP network ID string (e.g., 'eip155:1')
277
+ * @throws {Error} When the network is not found in configured networks
278
+ * @throws {Error} When no active adapter is available (only when connected)
279
+ * @returns Promise that resolves when the network switch is complete
280
+ */
281
+ async switchNetwork(network: AppKitNetwork | CaipNetworkId): Promise<void> {
275
282
  const { isConnected } = ConnectionsController.state;
276
283
 
284
+ const appKitNetwork =
285
+ typeof network === 'string' ? this.networks.find(n => n.caipNetworkId === network) : network;
286
+
287
+ if (!appKitNetwork) {
288
+ const error = new Error(`Network not found: ${network}`);
289
+ LogController.sendError(`Network not found: ${network}`, 'AppKit.ts', 'switchNetwork');
290
+
291
+ throw error;
292
+ }
293
+
277
294
  if (!isConnected) {
278
- OptionsController.setDefaultNetwork(network);
295
+ OptionsController.setDefaultNetwork(appKitNetwork);
279
296
 
280
- return Promise.resolve();
297
+ return;
281
298
  }
282
299
 
283
- const adapter = this.getAdapterByNamespace(network.chainNamespace);
300
+ const adapter = this.getAdapterByNamespace(appKitNetwork.chainNamespace);
284
301
  if (!adapter) throw new Error('No active adapter');
285
302
 
286
- await adapter.switchNetwork(network);
303
+ await adapter.switchNetwork(appKitNetwork);
287
304
 
288
305
  EventsController.sendEvent({
289
306
  type: 'track',
290
307
  event: 'SWITCH_NETWORK',
291
308
  properties: {
292
- network: network.caipNetworkId
309
+ network: appKitNetwork.caipNetworkId
293
310
  }
294
311
  });
295
312
 
296
- ConnectionsController.setActiveNetwork(network.chainNamespace, network.caipNetworkId);
313
+ ConnectionsController.setActiveNetwork(
314
+ appKitNetwork.chainNamespace,
315
+ appKitNetwork.caipNetworkId
316
+ );
297
317
  }
298
318
 
299
319
  open(options?: AppKitOpenOptions) {
@@ -1,9 +1,68 @@
1
1
  /* eslint-disable valtio/state-snapshot-rule */
2
+ import {
3
+ ConnectionsController,
4
+ CoreHelperUtil,
5
+ LogController
6
+ } from '@reown/appkit-core-react-native';
2
7
  import { useMemo } from 'react';
3
8
  import { useSnapshot } from 'valtio';
4
- import { ConnectionsController, CoreHelperUtil } from '@reown/appkit-core-react-native';
5
9
  import { useAppKit } from './useAppKit';
10
+ import type { AccountType, AppKitNetwork } from '@reown/appkit-common-react-native';
6
11
 
12
+ /**
13
+ * Represents a blockchain account with its associated metadata
14
+ */
15
+ export interface Account {
16
+ /** The blockchain address of the account */
17
+ address: string;
18
+ /** The blockchain namespace (e.g., 'eip155' for Ethereum, 'solana' for Solana) */
19
+ namespace: string;
20
+ /** The chain ID where this account is active */
21
+ chainId: string;
22
+ /** Optional account type (e.g. 'eoa' or 'smartAccount') */
23
+ type?: AccountType;
24
+ }
25
+
26
+ /**
27
+ * Hook to access the current account state and connection information
28
+ *
29
+ * @remarks
30
+ * This hook provides access to all connected accounts, the currently active account,
31
+ * connection status, and active chain information. It automatically subscribes to
32
+ * connection state changes via valtio.
33
+ *
34
+ * The hook parses account data from CAIP-10 format (namespace:chainId:address)
35
+ * and provides a normalized structure.
36
+ *
37
+ * @returns An object containing:
38
+ * - `allAccounts` - Array of all connected accounts across all connections
39
+ * - `address` - The plain address of the currently active account (without namespace or chain prefix)
40
+ * - `isConnected` - Boolean indicating if a wallet is currently connected
41
+ * - `chainId` - The ID of the currently active chain
42
+ * - `chain` - The full chain/network object of the currently active chain
43
+ * - `namespace` - The namespace of the currently active account (e.g. 'eip155', 'solana' or 'bip122')
44
+ *
45
+ * @example
46
+ * ```tsx
47
+ * function MyComponent() {
48
+ * const { address, isConnected, chainId, allAccounts } = useAccount();
49
+ *
50
+ * if (!isConnected) {
51
+ * return <Text>Not connected</Text>;
52
+ * }
53
+ *
54
+ * return (
55
+ * <View>
56
+ * <Text>Connected: {address}</Text>
57
+ * <Text>Chain: {chainId}</Text>
58
+ * <Text>Total accounts: {allAccounts.length}</Text>
59
+ * </View>
60
+ * );
61
+ * }
62
+ * ```
63
+ *
64
+ * @throws Will log errors via LogController if account parsing fails
65
+ */
7
66
  export function useAccount() {
8
67
  useAppKit(); // Use the hook for checks
9
68
 
@@ -11,9 +70,35 @@ export function useAccount() {
11
70
  activeAddress: address,
12
71
  activeNamespace,
13
72
  connection,
73
+ connections,
14
74
  networks
15
75
  } = useSnapshot(ConnectionsController.state);
16
76
 
77
+ const allAccounts: Account[] = useMemo(() => {
78
+ return Array.from(connections.values()).flatMap(
79
+ _connection =>
80
+ _connection.accounts
81
+ .map(account => {
82
+ const [namespace, chainId, plainAddress] = account.split(':');
83
+ if (!plainAddress || !namespace || !chainId) {
84
+ LogController.sendError('Invalid account', 'useAccount.ts', 'useAccount', {
85
+ account
86
+ });
87
+
88
+ return undefined;
89
+ }
90
+
91
+ return {
92
+ address: plainAddress,
93
+ namespace,
94
+ chainId,
95
+ type: _connection.type
96
+ };
97
+ })
98
+ .filter(account => account !== undefined) as Account[]
99
+ );
100
+ }, [connections]);
101
+
17
102
  const activeChain = useMemo(
18
103
  () =>
19
104
  connection?.caipNetwork
@@ -23,10 +108,11 @@ export function useAccount() {
23
108
  );
24
109
 
25
110
  return {
111
+ allAccounts,
26
112
  address: CoreHelperUtil.getPlainAddress(address),
27
113
  isConnected: !!address,
28
- chainId: activeChain?.id,
29
- chain: activeChain,
114
+ chainId: activeChain?.id !== undefined ? String(activeChain.id) : undefined,
115
+ chain: activeChain as AppKitNetwork | undefined,
30
116
  namespace: activeNamespace
31
117
  };
32
118
  }
package/src/index.ts CHANGED
@@ -31,7 +31,7 @@ export type { AppKitConfig } from './types';
31
31
  /****** Hooks *******/
32
32
  export { useAppKit } from './hooks/useAppKit';
33
33
  export { useProvider } from './hooks/useProvider';
34
- export { useAccount } from './hooks/useAccount';
34
+ export { useAccount, type Account as UseAccountReturn } from './hooks/useAccount';
35
35
  export { useWalletInfo } from './hooks/useWalletInfo';
36
36
  export { useAppKitEvents, useAppKitEventSubscription } from './hooks/useAppKitEvents';
37
37
  export { useAppKitState } from './hooks/useAppKitState';
@@ -3,6 +3,7 @@ import { StyleSheet } from 'react-native';
3
3
  export default StyleSheet.create({
4
4
  card: {
5
5
  borderBottomLeftRadius: 0,
6
- borderBottomRightRadius: 0
6
+ borderBottomRightRadius: 0,
7
+ borderWidth: 0
7
8
  }
8
9
  });
@@ -20,6 +20,9 @@ import styles from './styles';
20
20
  import { ReownButton } from './components/ReownButton';
21
21
  import { useWindowDimensions } from 'react-native';
22
22
 
23
+ const LOGO_SIZE = 60;
24
+ const LOGO_BORDER_RADIUS = 20;
25
+
23
26
  export function ConnectingQrCode() {
24
27
  const { height, width } = useWindowDimensions();
25
28
  const windowSize = Math.min(height, width);
@@ -65,7 +68,13 @@ export function ConnectingQrCode() {
65
68
  flexDirection={isPortrait ? 'column' : 'row'}
66
69
  padding={['xl', 'xl', 'xs', 'xl']}
67
70
  >
68
- <QrCode size={qrSize} uri={wcUri} testID="qr-code" />
71
+ <QrCode
72
+ size={qrSize}
73
+ uri={wcUri}
74
+ testID="qr-code"
75
+ logoBorderRadius={LOGO_BORDER_RADIUS}
76
+ logoSize={LOGO_SIZE}
77
+ />
69
78
  <FlexView alignItems="center" margin="m">
70
79
  <Text variant="paragraph-500">Scan this QR code with your phone</Text>
71
80
  {showCopy ? (
@@ -20,6 +20,7 @@ export interface SendInputTokenProps {
20
20
  style?: StyleProp<ViewStyle>;
21
21
  onTokenPress?: () => void;
22
22
  loading?: boolean;
23
+ testID?: string;
23
24
  }
24
25
 
25
26
  export function SendInputToken({
@@ -27,7 +28,8 @@ export function SendInputToken({
27
28
  sendTokenAmount,
28
29
  style,
29
30
  onTokenPress,
30
- loading
31
+ loading,
32
+ testID
31
33
  }: SendInputTokenProps) {
32
34
  const Theme = useTheme();
33
35
  const valueInputRef = useRef<TextInput | null>(null);
@@ -86,12 +88,14 @@ export function SendInputToken({
86
88
  selectTextOnFocus={false}
87
89
  numberOfLines={1}
88
90
  autoFocus={!!token}
91
+ testID={testID}
89
92
  />
90
93
  <TokenButton
91
94
  imageUrl={token?.iconUrl}
92
95
  text={token?.symbol}
93
96
  onPress={onTokenPress}
94
97
  chevron
98
+ testID={testID ? `${testID}-button` : undefined}
95
99
  />
96
100
  </FlexView>
97
101
  {token ? (
@@ -28,6 +28,7 @@ export interface SwapInputProps {
28
28
  marketValue?: number;
29
29
  editable?: boolean;
30
30
  autoFocus?: boolean;
31
+ testID?: string;
31
32
  }
32
33
 
33
34
  const MINIMUM_USD_VALUE_TO_CONVERT = 0.00005;
@@ -43,7 +44,8 @@ export function SwapInput({
43
44
  onChange,
44
45
  marketValue,
45
46
  editable,
46
- autoFocus
47
+ autoFocus,
48
+ testID
47
49
  }: SwapInputProps) {
48
50
  const Theme = useTheme();
49
51
  const valueInputRef = useRef<TextInput | null>(null);
@@ -118,6 +120,7 @@ export function SwapInput({
118
120
  numberOfLines={1}
119
121
  editable={editable}
120
122
  autoFocus={autoFocus}
123
+ testID={testID}
121
124
  />
122
125
  )}
123
126
  <TokenButton
@@ -125,6 +128,7 @@ export function SwapInput({
125
128
  imageUrl={token?.logoUri}
126
129
  onPress={onTokenPress}
127
130
  chevron
131
+ testID={testID ? `${testID}-button` : undefined}
128
132
  />
129
133
  </FlexView>
130
134
  {loadingValues ? (
@@ -186,7 +186,12 @@ export function AccountDefaultView() {
186
186
  return (
187
187
  <>
188
188
  {showBack ? (
189
- <IconLink icon="chevronLeft" style={styles.backIcon} onPress={RouterController.goBack} />
189
+ <IconLink
190
+ icon="chevronLeft"
191
+ style={styles.backIcon}
192
+ onPress={RouterController.goBack}
193
+ testID="header-back"
194
+ />
190
195
  ) : null}
191
196
  <IconLink
192
197
  icon="close"
@@ -90,6 +90,7 @@ export function OnRampSettingsView() {
90
90
  chevron
91
91
  style={styles.firstItem}
92
92
  contentStyle={styles.listItem}
93
+ testID="button-select-country"
93
94
  >
94
95
  <FlexView
95
96
  alignItems="center"
@@ -111,7 +112,12 @@ export function OnRampSettingsView() {
111
112
  ) : null}
112
113
  </FlexView>
113
114
  </ListItem>
114
- <ListItem onPress={onPaymentCurrencyPress} chevron contentStyle={styles.listItem}>
115
+ <ListItem
116
+ onPress={onPaymentCurrencyPress}
117
+ chevron
118
+ contentStyle={styles.listItem}
119
+ testID="button-select-currency"
120
+ >
115
121
  <FlexView
116
122
  alignItems="center"
117
123
  justifyContent="center"
@@ -61,6 +61,7 @@ export function OnRampView() {
61
61
  const purchaseCurrencyCode =
62
62
  purchaseCurrency?.currencyCode?.split('_')[0] ?? purchaseCurrency?.currencyCode;
63
63
  const networkImage = AssetUtil.getNetworkImage(activeNetwork, networkImages);
64
+ const isContinueDisabled = quotesLoading || loading || !selectedQuote;
64
65
 
65
66
  const getQuotes = useCallback(() => {
66
67
  if (OnRampController.canGenerateQuote()) {
@@ -240,8 +241,8 @@ export function OnRampView() {
240
241
  <Button
241
242
  style={styles.continueButton}
242
243
  onPress={handleContinue}
243
- disabled={quotesLoading || loading || !selectedQuote}
244
- testID="button-continue"
244
+ disabled={isContinueDisabled}
245
+ testID={`button-continue${isContinueDisabled ? '-disabled' : '-enabled'}`}
245
246
  >
246
247
  Continue
247
248
  </Button>
@@ -98,7 +98,7 @@ export function SwapSelectTokenModal({ onClose, type, style, visible }: Props) {
98
98
  alignItems="center"
99
99
  padding={['0', 'm', 'm', 'm']}
100
100
  >
101
- <IconLink icon="chevronLeft" size="md" onPress={onClose} />
101
+ <IconLink icon="chevronLeft" size="md" onPress={onClose} testID="button-back" />
102
102
  <Text variant="paragraph-600">Select token</Text>
103
103
  <View style={styles.iconPlaceholder} />
104
104
  </FlexView>
@@ -174,6 +174,7 @@ export function SwapView() {
174
174
  onChange={onSourceTokenChange}
175
175
  onTokenPress={() => setShowModal('sourceToken')}
176
176
  onMaxPress={onSourceMaxPress}
177
+ testID="swap-input-source"
177
178
  />
178
179
  <FlexView alignItems="center" justifyContent="center" style={styles.bottomInputContainer}>
179
180
  <SwapInput
@@ -186,6 +187,7 @@ export function SwapView() {
186
187
  onChange={onToTokenChange}
187
188
  onTokenPress={() => setShowModal('toToken')}
188
189
  editable={false}
190
+ testID="swap-input-to"
189
191
  />
190
192
  {showSwitch ? (
191
193
  <IconLink
@@ -92,6 +92,7 @@ export function WalletSendView() {
92
92
  style={styles.tokenInput}
93
93
  onTokenPress={() => RouterController.push('WalletSendSelectToken')}
94
94
  loading={isBalanceLoading}
95
+ testID="send-input-token"
95
96
  />
96
97
  <FlexView alignItems="center" justifyContent="center" style={styles.addressContainer}>
97
98
  <SendInputAddress value={receiverProfileName || receiverAddress} />