@reown/appkit-wagmi-react-native 0.0.0-fix-cover-screen-20250328152136 → 0.0.0-fix-cover-screen-20250502142441

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 (31) hide show
  1. package/lib/commonjs/client.js +516 -0
  2. package/lib/commonjs/client.js.map +1 -0
  3. package/lib/commonjs/connectors/WalletConnectConnector.js +353 -0
  4. package/lib/commonjs/connectors/WalletConnectConnector.js.map +1 -0
  5. package/lib/commonjs/index.js +139 -0
  6. package/lib/commonjs/index.js.map +1 -0
  7. package/lib/commonjs/utils/defaultWagmiConfig.js +46 -0
  8. package/lib/commonjs/utils/defaultWagmiConfig.js.map +1 -0
  9. package/lib/commonjs/utils/helpers.js +63 -0
  10. package/lib/commonjs/utils/helpers.js.map +1 -0
  11. package/lib/module/client.js +510 -0
  12. package/lib/module/client.js.map +1 -0
  13. package/lib/module/connectors/WalletConnectConnector.js +348 -0
  14. package/lib/module/connectors/WalletConnectConnector.js.map +1 -0
  15. package/lib/module/index.js +93 -0
  16. package/lib/module/index.js.map +1 -0
  17. package/lib/module/utils/defaultWagmiConfig.js +40 -0
  18. package/lib/module/utils/defaultWagmiConfig.js.map +1 -0
  19. package/lib/module/utils/helpers.js +53 -0
  20. package/lib/module/utils/helpers.js.map +1 -0
  21. package/lib/typescript/client.d.ts +40 -0
  22. package/lib/typescript/client.d.ts.map +1 -0
  23. package/lib/typescript/connectors/WalletConnectConnector.d.ts +74 -0
  24. package/lib/typescript/connectors/WalletConnectConnector.d.ts.map +1 -0
  25. package/lib/typescript/index.d.ts +26 -0
  26. package/lib/typescript/index.d.ts.map +1 -0
  27. package/lib/typescript/utils/defaultWagmiConfig.d.ts +11 -0
  28. package/lib/typescript/utils/defaultWagmiConfig.d.ts.map +1 -0
  29. package/lib/typescript/utils/helpers.d.ts +18 -0
  30. package/lib/typescript/utils/helpers.d.ts.map +1 -0
  31. package/package.json +5 -5
@@ -0,0 +1,74 @@
1
+ import { type EthereumProviderOptions } from '@walletconnect/ethereum-provider/dist/types/EthereumProvider';
2
+ import { type Address, type ProviderConnectInfo } from 'viem';
3
+ export type WalletConnectParameters = {
4
+ /**
5
+ * Reown Cloud Project ID.
6
+ * @link https://cloud.reown.com/sign-in.
7
+ */
8
+ projectId: EthereumProviderOptions['projectId'];
9
+ /**
10
+ * If a new chain is added to a previously existing configured connector `chains`, this flag
11
+ * will determine if that chain should be considered as stale. A stale chain is a chain that
12
+ * WalletConnect has yet to establish a relationship with (e.g. the user has not approved or
13
+ * rejected the chain).
14
+ *
15
+ * This flag mainly affects the behavior when a wallet does not support dynamic chain authorization
16
+ * with WalletConnect v2.
17
+ *
18
+ * If `true` (default), the new chain will be treated as a stale chain. If the user
19
+ * has yet to establish a relationship (approved/rejected) with this chain in their WalletConnect
20
+ * session, the connector will disconnect upon the dapp auto-connecting, and the user will have to
21
+ * reconnect to the dapp (revalidate the chain) in order to approve the newly added chain.
22
+ * This is the default behavior to avoid an unexpected error upon switching chains which may
23
+ * be a confusing user experience (e.g. the user will not know they have to reconnect
24
+ * unless the dapp handles these types of errors).
25
+ *
26
+ * If `false`, the new chain will be treated as a potentially valid chain. This means that if the user
27
+ * has yet to establish a relationship with the chain in their WalletConnect session, wagmi will successfully
28
+ * auto-connect the user. This comes with the trade-off that the connector will throw an error
29
+ * when attempting to switch to the unapproved chain if the wallet does not support dynamic session updates.
30
+ * This may be useful in cases where a dapp constantly
31
+ * modifies their configured chains, and they do not want to disconnect the user upon
32
+ * auto-connecting. If the user decides to switch to the unapproved chain, it is important that the
33
+ * dapp handles this error and prompts the user to reconnect to the dapp in order to approve
34
+ * the newly added chain.
35
+ *
36
+ * @default true
37
+ */
38
+ isNewChainsStale?: boolean;
39
+ /**
40
+ * Metadata for your app.
41
+ * @link https://docs.reown.com/appkit/react-native/core/installation#implementation
42
+ */
43
+ metadata: EthereumProviderOptions['metadata'];
44
+ } & Omit<EthereumProviderOptions, 'chains' | 'events' | 'optionalChains' | 'optionalEvents' | 'optionalMethods' | 'methods' | 'rpcMap' | 'showQrModal' | 'qrModalOptions' | 'storageOptions'>;
45
+ type NamespaceMethods = 'wallet_addEthereumChain' | 'wallet_switchEthereumChain';
46
+ type Properties = {
47
+ connect(parameters?: {
48
+ chainId?: number;
49
+ pairingTopic?: string;
50
+ }): Promise<{
51
+ accounts: readonly Address[];
52
+ chainId: number;
53
+ }>;
54
+ getNamespaceChainsIds(): number[];
55
+ getNamespaceMethods(): NamespaceMethods[];
56
+ getRequestedChainsIds(): Promise<number[]>;
57
+ isChainsStale(): Promise<boolean>;
58
+ onConnect(connectInfo: ProviderConnectInfo): void;
59
+ onDisplayUri(uri: string): void;
60
+ onSessionDelete(data: {
61
+ topic: string;
62
+ }): void;
63
+ setRequestedChainsIds(chains: number[]): void;
64
+ requestedChainsStorageKey: `${string}.requestedChains`;
65
+ };
66
+ type StorageItem = {
67
+ [_ in Properties['requestedChainsStorageKey']]: number[];
68
+ };
69
+ export declare function walletConnect(parameters: WalletConnectParameters): import("@wagmi/core").CreateConnectorFn<import("@walletconnect/ethereum-provider").default, Properties, StorageItem>;
70
+ export declare namespace walletConnect {
71
+ var type: "walletConnect";
72
+ }
73
+ export {};
74
+ //# sourceMappingURL=WalletConnectConnector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WalletConnectConnector.d.ts","sourceRoot":"","sources":["../../../src/connectors/WalletConnectConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,8DAA8D,CAAC;AAC5G,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,mBAAmB,EAQzB,MAAM,MAAM,CAAC;AAkBd,MAAM,MAAM,uBAAuB,GAAG;IACpC;;;OAGG;IACH,SAAS,EAAE,uBAAuB,CAAC,WAAW,CAAC,CAAC;IAChD;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH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letconnect/react-native-compat';
2
+ export { AccountButton, AppKitButton, ConnectButton, NetworkButton, AppKit } from '@reown/appkit-scaffold-react-native';
3
+ import type { EventName, EventsControllerState } from '@reown/appkit-scaffold-react-native';
4
+ export { defaultWagmiConfig } from './utils/defaultWagmiConfig';
5
+ import type { AppKitOptions } from './client';
6
+ import { AppKit } from './client';
7
+ export type { AppKitOptions } from './client';
8
+ type OpenOptions = Parameters<AppKit['open']>[0];
9
+ export declare function createAppKit(options: AppKitOptions): AppKit;
10
+ export declare function useAppKit(): {
11
+ open: (options?: OpenOptions) => Promise<void>;
12
+ close: () => Promise<void>;
13
+ };
14
+ export declare function useAppKitState(): {
15
+ selectedNetworkId: number | undefined;
16
+ open: boolean;
17
+ };
18
+ export declare function useWalletInfo(): {
19
+ walletInfo: import("@reown/appkit-scaffold-react-native").ConnectedWalletInfo;
20
+ };
21
+ export declare function useAppKitEvents(callback?: (newEvent: EventsControllerState) => void): {
22
+ timestamp: number;
23
+ data: import("@reown/appkit-scaffold-react-native").Event;
24
+ };
25
+ export declare function useAppKitEventSubscription(event: EventName, callback: (newEvent: EventsControllerState) => void): void;
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,oCAAoC,CAAC;AAE5C,OAAO,EACL,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,MAAM,EACP,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAG5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,KAAK,WAAW,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAKjD,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,UASlD;AAGD,wBAAgB,SAAS;qBAKO,WAAW;;EAS1C;AAED,wBAAgB,cAAc;;;EAkB7B;AAED,wBAAgB,aAAa;;EAY5B;AAED,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,qBAAqB,KAAK,IAAI;;;EAmBnF;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,CAAC,QAAQ,EAAE,qBAAqB,KAAK,IAAI,QAapD"}
@@ -0,0 +1,11 @@
1
+ import { type CreateConnectorFn, type CreateConfigParameters } from 'wagmi';
2
+ import type { EthereumProviderOptions } from '@walletconnect/ethereum-provider/dist/types/EthereumProvider';
3
+ export type ConfigOptions = Partial<CreateConfigParameters> & {
4
+ projectId: string;
5
+ metadata: Exclude<EthereumProviderOptions['metadata'], undefined>;
6
+ chains: CreateConfigParameters['chains'];
7
+ enableWalletConnect?: boolean;
8
+ extraConnectors?: CreateConnectorFn[];
9
+ };
10
+ export declare function defaultWagmiConfig({ projectId, chains, metadata, enableWalletConnect, extraConnectors, ...wagmiConfig }: ConfigOptions): import("wagmi").Config<readonly [import("viem").Chain, ...import("viem").Chain[]], any, readonly CreateConnectorFn[]>;
11
+ //# sourceMappingURL=defaultWagmiConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultWagmiConfig.d.ts","sourceRoot":"","sources":["../../../src/utils/defaultWagmiConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC5B,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8DAA8D,CAAC;AAM5G,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,sBAAsB,CAAC,GAAG;IAC5D,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC,uBAAuB,CAAC,UAAU,CAAC,EAAE,SAAS,CAAC,CAAC;IAClE,MAAM,EAAE,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IACzC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,eAAe,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACvC,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,MAAM,EACN,QAAQ,EACR,mBAA0B,EAC1B,eAAe,EACf,GAAG,WAAW,EACf,EAAE,aAAa,yHAyBf"}
@@ -0,0 +1,18 @@
1
+ import { type CaipNetwork } from '@reown/appkit-scaffold-react-native';
2
+ import type { Connector } from '@wagmi/core';
3
+ import type { AppKitClientOptions } from '../client';
4
+ export declare function getCaipDefaultChain(chain?: AppKitClientOptions['defaultChain']): CaipNetwork | undefined;
5
+ export declare function getWalletConnectCaipNetworks(connector?: Connector): Promise<{
6
+ supportsAllNetworks: boolean;
7
+ approvedCaipNetworkIds: `${string}:${string}`[];
8
+ }>;
9
+ export declare function getAuthCaipNetworks(): {
10
+ supportsAllNetworks: boolean;
11
+ approvedCaipNetworkIds: `${string}:${string}`[];
12
+ };
13
+ export declare function getTransport({ chainId, projectId }: {
14
+ chainId: number;
15
+ projectId: string;
16
+ }): import("viem").HttpTransport<undefined, false>;
17
+ export declare function requireCaipAddress(caipAddress: string): `0x${string}`;
18
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EAEjB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGrD,wBAAgB,mBAAmB,CAAC,KAAK,CAAC,EAAE,mBAAmB,CAAC,cAAc,CAAC,2BAU9E;AAED,wBAAsB,4BAA4B,CAAC,SAAS,CAAC,EAAE,SAAS;;;GAevE;AAED,wBAAgB,mBAAmB;;;EAOlC;AAED,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,kDAQ1F;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,iBAUrD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reown/appkit-wagmi-react-native",
3
- "version": "0.0.0-fix-cover-screen-20250328152136",
3
+ "version": "0.0.0-fix-cover-screen-20250502142441",
4
4
  "main": "lib/commonjs/index.js",
5
5
  "types": "lib/typescript/index.d.ts",
6
6
  "module": "lib/module/index.js",
@@ -39,10 +39,10 @@
39
39
  "access": "public"
40
40
  },
41
41
  "dependencies": {
42
- "@reown/appkit-common-react-native": "0.0.0-fix-cover-screen-20250328152136",
43
- "@reown/appkit-scaffold-react-native": "0.0.0-fix-cover-screen-20250328152136",
44
- "@reown/appkit-scaffold-utils-react-native": "0.0.0-fix-cover-screen-20250328152136",
45
- "@reown/appkit-siwe-react-native": "0.0.0-fix-cover-screen-20250328152136"
42
+ "@reown/appkit-common-react-native": "0.0.0-fix-cover-screen-20250502142441",
43
+ "@reown/appkit-scaffold-react-native": "0.0.0-fix-cover-screen-20250502142441",
44
+ "@reown/appkit-scaffold-utils-react-native": "0.0.0-fix-cover-screen-20250502142441",
45
+ "@reown/appkit-siwe-react-native": "0.0.0-fix-cover-screen-20250502142441"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "@react-native-async-storage/async-storage": ">=1.17.0",