@reown/appkit-react-native 0.0.0-feat-multichain-20250801190527 → 0.0.0-feat-multichain-20250804182547
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.
- package/lib/commonjs/AppKit.js.map +1 -1
- package/lib/commonjs/connectors/WalletConnectConnector.js +13 -1
- package/lib/commonjs/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/commonjs/hooks/useProvider.js +29 -10
- package/lib/commonjs/hooks/useProvider.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/partials/w3m-connecting-qrcode/index.js +21 -1
- package/lib/commonjs/partials/w3m-connecting-qrcode/index.js.map +1 -1
- package/lib/commonjs/types.js +6 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/module/AppKit.js.map +1 -1
- package/lib/module/connectors/WalletConnectConnector.js +13 -1
- package/lib/module/connectors/WalletConnectConnector.js.map +1 -1
- package/lib/module/hooks/useProvider.js +30 -10
- package/lib/module/hooks/useProvider.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/partials/w3m-connecting-qrcode/index.js +22 -2
- package/lib/module/partials/w3m-connecting-qrcode/index.js.map +1 -1
- package/lib/module/types.js +4 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/AppKit.d.ts +2 -25
- package/lib/typescript/AppKit.d.ts.map +1 -1
- package/lib/typescript/connectors/WalletConnectConnector.d.ts +1 -1
- package/lib/typescript/connectors/WalletConnectConnector.d.ts.map +1 -1
- package/lib/typescript/hooks/useProvider.d.ts +28 -1
- package/lib/typescript/hooks/useProvider.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/partials/w3m-connecting-qrcode/index.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +156 -0
- package/lib/typescript/types.d.ts.map +1 -0
- package/package.json +5 -5
- package/src/AppKit.ts +3 -35
- package/src/connectors/WalletConnectConnector.ts +17 -2
- package/src/hooks/useProvider.ts +30 -9
- package/src/index.ts +1 -0
- package/src/partials/w3m-connecting-qrcode/index.tsx +12 -2
- package/src/types.ts +190 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Features,
|
|
3
|
+
type OptionsControllerState,
|
|
4
|
+
type UniversalProviderConfigOverride
|
|
5
|
+
} from '@reown/appkit-core-react-native';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
type WalletConnector,
|
|
9
|
+
type BlockchainAdapter,
|
|
10
|
+
type Metadata,
|
|
11
|
+
type Network,
|
|
12
|
+
type Storage,
|
|
13
|
+
type AppKitSIWEClient,
|
|
14
|
+
type ThemeMode,
|
|
15
|
+
type ThemeVariables,
|
|
16
|
+
type Tokens
|
|
17
|
+
} from '@reown/appkit-common-react-native';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Configuration interface for initializing the AppKit instance.
|
|
21
|
+
* This interface defines all the required and optional parameters needed to set up
|
|
22
|
+
* the AppKit with blockchain adapters, networks, storage, and various customization options.
|
|
23
|
+
*
|
|
24
|
+
* @see {@link https://docs.reown.com/appkit/react-native/core/options | AppKit Options Documentation}
|
|
25
|
+
*/
|
|
26
|
+
export interface AppKitConfig {
|
|
27
|
+
/**
|
|
28
|
+
* The WalletConnect project ID required for establishing connections.
|
|
29
|
+
* This is obtained from the https://dashboard.reown.com/
|
|
30
|
+
* @see {@link https://docs.reown.com/appkit/react-native/core/options#projectid | Project ID Documentation}
|
|
31
|
+
*/
|
|
32
|
+
projectId: string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Metadata information about your application.
|
|
36
|
+
* This is displayed to users during the connection process.
|
|
37
|
+
*
|
|
38
|
+
* @see {@link https://docs.reown.com/appkit/react-native/core/options#metadata | Metadata Documentation}
|
|
39
|
+
*/
|
|
40
|
+
metadata: Metadata;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Array of blockchain adapters that handle different blockchain networks.
|
|
44
|
+
* Each adapter must implement the BlockchainAdapter interface and support
|
|
45
|
+
* a specific chain namespace (eip155, solana, etc.).
|
|
46
|
+
* @see {@link https://docs.reown.com/appkit/react-native/core/options#adapters | Adapters Documentation}
|
|
47
|
+
* @example [new EthersAdapter(), new SolanaAdapter()]
|
|
48
|
+
*/
|
|
49
|
+
adapters: BlockchainAdapter[];
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Array of supported networks that your application can connect to.
|
|
53
|
+
* Each network should have a corresponding adapter in the adapters array.
|
|
54
|
+
* @see {@link https://docs.reown.com/appkit/react-native/core/options#networks | Networks Documentation}
|
|
55
|
+
* @example [ethereum, polygon, solana]
|
|
56
|
+
*/
|
|
57
|
+
networks: Network[];
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Storage implementation for persisting connection state, preferences, and session data.
|
|
61
|
+
* Must implement the Storage interface with async methods for data persistence.
|
|
62
|
+
*/
|
|
63
|
+
storage: Storage;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Optional array of custom wallet connectors beyond the default WalletConnect connector.
|
|
67
|
+
* Useful for adding support for specific wallets like Coinbase, Phantom, etc.
|
|
68
|
+
* @example [new CoinbaseConnector(), new PhantomConnector()]
|
|
69
|
+
*/
|
|
70
|
+
extraConnectors?: WalletConnector[];
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Optional clipboard client for handling copy operations in different environments.
|
|
74
|
+
* Useful for customizing how addresses and other data are copied to clipboard.
|
|
75
|
+
*
|
|
76
|
+
* @see {@link https://docs.reown.com/appkit/react-native/core/options#clipboardclient | Clipboard Client Documentation}
|
|
77
|
+
*/
|
|
78
|
+
clipboardClient?: OptionsControllerState['clipboardClient'];
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Optional array of wallet IDs to include in the wallet selection list.
|
|
82
|
+
* If provided, only these wallets will be shown to users.
|
|
83
|
+
*
|
|
84
|
+
* @see {@link https://docs.reown.com/appkit/react-native/core/options#includewalletids | Include Wallet IDs Documentation}
|
|
85
|
+
* @example ["1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369", "4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0"]
|
|
86
|
+
*/
|
|
87
|
+
includeWalletIds?: OptionsControllerState['includeWalletIds'];
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Optional array of wallet IDs to exclude from the wallet selection list.
|
|
91
|
+
* These wallets will not be shown to users even if they're available.
|
|
92
|
+
*
|
|
93
|
+
* @see {@link https://docs.reown.com/appkit/react-native/core/options#excludewalletids | Exclude Wallet IDs Documentation}
|
|
94
|
+
* @example ["1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369", "4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0"]
|
|
95
|
+
*/
|
|
96
|
+
excludeWalletIds?: OptionsControllerState['excludeWalletIds'];
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Optional array of wallet IDs to feature at the top of the wallet selection list.
|
|
100
|
+
* These wallets will appear prominently for better user experience.
|
|
101
|
+
*
|
|
102
|
+
* @see {@link https://docs.reown.com/appkit/react-native/core/options#featuredwalletids | Featured Wallet IDs Documentation}
|
|
103
|
+
* @example ["1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369", "4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0"]
|
|
104
|
+
*/
|
|
105
|
+
featuredWalletIds?: OptionsControllerState['featuredWalletIds'];
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Optional array of custom wallet configurations.
|
|
109
|
+
* Allows you to add custom wallets with specific metadata and behavior.
|
|
110
|
+
*
|
|
111
|
+
* @see {@link https://docs.reown.com/appkit/react-native/core/options#customwallets | Custom Wallets Documentation}
|
|
112
|
+
*/
|
|
113
|
+
customWallets?: OptionsControllerState['customWallets'];
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Optional token configurations for different networks.
|
|
117
|
+
* Used for displaying token balances and information in the UI.
|
|
118
|
+
* @see {@link https://docs.reown.com/appkit/react-native/core/options#tokens | Tokens Documentation}
|
|
119
|
+
* @example { "eip155:1": { address: "0x..." } }
|
|
120
|
+
*/
|
|
121
|
+
tokens?: Tokens;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Optional flag to enable analytics tracking.
|
|
125
|
+
* When enabled, AppKit will send usage analytics events.
|
|
126
|
+
*
|
|
127
|
+
* @see {@link https://docs.reown.com/appkit/react-native/core/options#enableanalytics | Enable Analytics Documentation}
|
|
128
|
+
* @default false
|
|
129
|
+
*/
|
|
130
|
+
enableAnalytics?: OptionsControllerState['enableAnalytics'];
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Optional flag to enable debug mode.
|
|
134
|
+
* When enabled, additional logging and debugging information will be output.
|
|
135
|
+
*
|
|
136
|
+
* @see {@link https://docs.reown.com/appkit/react-native/core/options#debug | Debug Documentation}
|
|
137
|
+
* @default false
|
|
138
|
+
*/
|
|
139
|
+
debug?: OptionsControllerState['debug'];
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Optional theme mode for the AppKit UI.
|
|
143
|
+
* Controls whether the interface uses light or dark theme.
|
|
144
|
+
* @default "dark"
|
|
145
|
+
* @see {@link https://docs.reown.com/appkit/react-native/core/theming#thememode | Theme Mode Documentation}
|
|
146
|
+
* @example "light" | "dark"
|
|
147
|
+
*/
|
|
148
|
+
themeMode?: ThemeMode;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Optional theme variables for customizing the AppKit UI appearance.
|
|
152
|
+
* Allows you to override default colors and styling.
|
|
153
|
+
*
|
|
154
|
+
* @see {@link https://docs.reown.com/appkit/react-native/core/theming#themevariables | Theme Variables Documentation}
|
|
155
|
+
* @example { accent: "#3B82F6" }
|
|
156
|
+
*/
|
|
157
|
+
themeVariables?: ThemeVariables;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Optional SIWE (Sign-In with Ethereum) configuration.
|
|
161
|
+
* Enables authentication flow using Ethereum signatures.
|
|
162
|
+
* Must implement the AppKitSIWEClient interface.
|
|
163
|
+
*
|
|
164
|
+
* @see {@link https://docs.reown.com/appkit/react-native/core/siwe | SIWE Documentation}
|
|
165
|
+
*/
|
|
166
|
+
siweConfig?: AppKitSIWEClient;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Optional default network to use when no specific network is selected.
|
|
170
|
+
* This network will be used as the initial active network.
|
|
171
|
+
*
|
|
172
|
+
* @see {@link https://docs.reown.com/appkit/react-native/core/options#defaultnetwork | Default Network Documentation}
|
|
173
|
+
*/
|
|
174
|
+
defaultNetwork?: Network;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Optional features configuration to enable/disable specific AppKit functionality.
|
|
178
|
+
* Controls which features are available in the UI and API.
|
|
179
|
+
*
|
|
180
|
+
* @see {@link https://docs.reown.com/appkit/react-native/core/options#features | Features Documentation}
|
|
181
|
+
* @example { onramp: true, swap: false }
|
|
182
|
+
*/
|
|
183
|
+
features?: Features;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Optional configuration override for the Universal Provider.
|
|
187
|
+
* Allows customization of WalletConnect's Universal Provider behavior.
|
|
188
|
+
*/
|
|
189
|
+
universalProviderConfigOverride?: UniversalProviderConfigOverride;
|
|
190
|
+
}
|