pwc-sdk-wallet 0.7.2 → 0.7.4

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/README.md CHANGED
@@ -55,6 +55,17 @@ A comprehensive, secure, and user-friendly wallet SDK for React Native applicati
55
55
  - [Validate QR Code](#validate-qr-code)
56
56
  - [Generate EIP-681 Compatible Address QR (for Metamask, Binance, Trust Wallet)](#generate-eip-681-compatible-address-qr-for-metamask-binance-trust-wallet)
57
57
 
58
+ ### 🌐 DApp Browser Integration with Wagmi
59
+ - [Key Benefits](#-key-benefits)
60
+ - [Quick Start (Wagmi Integration)](#-quick-start-wagmi-integration)
61
+ - [What This Achieves](#-what-this-achieves)
62
+ - [Components](#dapp-browser-components)
63
+ - [Services](#dapp-browser-services)
64
+ - [Wagmi Integration (Core Feature)](#-wagmi-integration-core-feature)
65
+ - [Hooks](#dapp-browser-hooks)
66
+ - [Examples](#dapp-browser-examples)
67
+ - [Summary: Universal dApp Compatibility](#-summary-universal-dapp-compatibility)
68
+
58
69
  ### 🖼️ NFT Functionality
59
70
  - [Get NFT Details](#get-nft-details)
60
71
  - [Get NFT Balance](#get-nft-balance)
@@ -693,6 +704,349 @@ console.log('Transaction History:', history);
693
704
  // Returns array of: { hash, from, to, blockNumber, timestamp, type }
694
705
  ```
695
706
 
707
+ ## 🌐 DApp Browser Integration with Wagmi
708
+
709
+ The PWC Wallet SDK provides a complete DApp Browser integration with **Wagmi support**, ensuring that PWC Wallet appears as a connection option in **all dApps** that use Wagmi, ConnectKit, or RainbowKit. This integration follows the same patterns as popular wallets like MetaMask Mobile, Trust Wallet, and Rainbow Wallet.
710
+
711
+ ### 🎯 Key Benefits
712
+
713
+ - **Universal dApp Compatibility** - PWC Wallet appears in ALL dApps using Wagmi
714
+ - **One-Click Integration** - Simple setup with `createWagmiConfig`
715
+ - **Built-in WebView Browser** - Complete browser with navigation controls
716
+ - **Automatic Provider Injection** - PWC Wallet provider automatically injected
717
+ - **Transaction Approval UI** - Beautiful transaction approval modals
718
+ - **Connection Approval UI** - dApp connection approval modals
719
+ - **Multi-chain Support** - Support for Ethereum and other EVM chains
720
+ - **Security Features** - Transaction validation and user confirmation
721
+
722
+ ### 🚀 Quick Start (Wagmi Integration)
723
+
724
+ ```typescript
725
+ import React from 'react';
726
+ import { WagmiConfig } from 'wagmi';
727
+ import { DAppBrowser, createWagmiConfig } from 'pwc-wallet-sdk';
728
+
729
+ const WalletApp = () => {
730
+ const vault = new Vault(); // Your vault instance
731
+
732
+ // Create Wagmi config with PWC Wallet connector
733
+ const wagmiConfig = createWagmiConfig({
734
+ vault: vault,
735
+ pwcWalletName: 'PWC Wallet',
736
+ pwcWalletIcon: 'https://pwc-wallet.com/icon.png'
737
+ });
738
+
739
+ return (
740
+ <WagmiConfig config={wagmiConfig}>
741
+ <DAppBrowser
742
+ vault={vault}
743
+ initialUrl="https://paywithcrypto.io/"
744
+ onTransaction={(transaction) => {
745
+ console.log('Transaction requested:', transaction);
746
+ }}
747
+ onConnection={(dAppInfo) => {
748
+ console.log('Connection requested:', dAppInfo);
749
+ }}
750
+ onError={(error) => {
751
+ console.error('Browser error:', error);
752
+ }}
753
+ />
754
+ </WagmiConfig>
755
+ );
756
+ };
757
+ ```
758
+
759
+ ### 🎯 What This Achieves
760
+
761
+ With this setup, PWC Wallet will appear as a connection option in:
762
+
763
+ - ✅ **PancakeSwap** - "Connect Wallet" → PWC Wallet option
764
+ - ✅ **Uniswap** - "Connect Wallet" → PWC Wallet option
765
+ - ✅ **OpenSea** - "Connect Wallet" → PWC Wallet option
766
+ - ✅ **All dApps using Wagmi** - "Connect Wallet" → PWC Wallet option
767
+ - ✅ **All dApps using ConnectKit** - "Connect Wallet" → PWC Wallet option
768
+ - ✅ **All dApps using RainbowKit** - "Connect Wallet" → PWC Wallet option
769
+
770
+ ### DApp Browser Components
771
+
772
+ #### DAppBrowser
773
+
774
+ The main component that provides a complete WebView browser with PWC Wallet integration. **Must be wrapped with WagmiConfig for universal dApp compatibility.**
775
+
776
+ ```typescript
777
+ import { WagmiConfig } from 'wagmi';
778
+ import { DAppBrowser, createWagmiConfig } from 'pwc-wallet-sdk';
779
+
780
+ // Create Wagmi config for universal dApp compatibility
781
+ const wagmiConfig = createWagmiConfig({
782
+ vault: vault,
783
+ pwcWalletName: 'PWC Wallet'
784
+ });
785
+
786
+ <WagmiConfig config={wagmiConfig}>
787
+ <DAppBrowser
788
+ vault={vault}
789
+ initialUrl="https://paywithcrypto.io/"
790
+ onTransaction={handleTransaction}
791
+ onConnection={handleConnection}
792
+ onError={handleError}
793
+ />
794
+ </WagmiConfig>
795
+ ```
796
+
797
+ #### TransactionModal
798
+
799
+ A modal component for approving/rejecting transactions.
800
+
801
+ ```typescript
802
+ import { TransactionModal } from 'pwc-wallet-sdk';
803
+
804
+ <TransactionModal
805
+ visible={showTransactionModal}
806
+ transaction={pendingTransaction}
807
+ onApprove={handleApprove}
808
+ onReject={handleReject}
809
+ />
810
+ ```
811
+
812
+ #### ConnectionModal
813
+
814
+ A modal component for approving/rejecting dApp connections.
815
+
816
+ ```typescript
817
+ import { ConnectionModal } from 'pwc-wallet-sdk';
818
+
819
+ <ConnectionModal
820
+ visible={showConnectionModal}
821
+ dAppInfo={pendingConnection}
822
+ onApprove={handleApprove}
823
+ onReject={handleReject}
824
+ />
825
+ ```
826
+
827
+ ### DApp Browser Services
828
+
829
+ #### BrowserProviderService
830
+
831
+ Handles the injection of PWC Wallet provider into WebView and processes dApp requests.
832
+
833
+ ```typescript
834
+ import { BrowserProviderService } from 'pwc-wallet-sdk';
835
+
836
+ const browserProviderService = new BrowserProviderService(vault);
837
+ const providerScript = browserProviderService.injectPWCWalletProvider();
838
+ ```
839
+
840
+ #### MessageBridgeService
841
+
842
+ Manages communication between WebView and React Native.
843
+
844
+ ```typescript
845
+ import { MessageBridgeService } from 'pwc-wallet-sdk';
846
+
847
+ const messageBridgeService = new MessageBridgeService();
848
+ messageBridgeService.setWebViewRef(webViewRef.current);
849
+ ```
850
+
851
+ #### TransactionHandler
852
+
853
+ Processes and validates transactions.
854
+
855
+ ```typescript
856
+ import { TransactionHandler } from 'pwc-wallet-sdk';
857
+
858
+ const transactionHandler = new TransactionHandler(vault);
859
+ const details = await transactionHandler.processTransaction(transaction);
860
+ ```
861
+
862
+ ### 🔌 Wagmi Integration (Core Feature)
863
+
864
+ #### PWCWalletConnector
865
+
866
+ The **core component** that makes PWC Wallet appear in all dApps. This connector integrates PWC Wallet with the Wagmi ecosystem, ensuring universal compatibility.
867
+
868
+ ```typescript
869
+ import { PWCWalletConnector, createWagmiConfig } from 'pwc-wallet-sdk';
870
+
871
+ // Create PWC Wallet connector
872
+ const connector = new PWCWalletConnector({
873
+ vault: vault,
874
+ name: 'PWC Wallet',
875
+ icon: 'https://pwc-wallet.com/icon.png'
876
+ });
877
+
878
+ // Create complete Wagmi config
879
+ const config = createWagmiConfig({
880
+ vault: vault,
881
+ appName: 'PWC Wallet',
882
+ pwcWalletName: 'PWC Wallet',
883
+ pwcWalletIcon: 'https://pwc-wallet.com/icon.png'
884
+ });
885
+ ```
886
+
887
+ #### Why This Matters
888
+
889
+ - **Universal Compatibility** - PWC Wallet appears in ALL dApps using Wagmi
890
+ - **No dApp Changes Required** - dApps don't need to add PWC Wallet manually
891
+ - **Industry Standard** - Follows the same pattern as MetaMask, WalletConnect
892
+ - **Future-Proof** - Works with any new dApp that uses Wagmi
893
+
894
+ ### DApp Browser Hooks
895
+
896
+ #### usePWCWallet
897
+
898
+ A React hook that provides easy access to PWC Wallet functionality.
899
+
900
+ ```typescript
901
+ import { usePWCWallet } from 'pwc-wallet-sdk';
902
+
903
+ const {
904
+ accounts,
905
+ currentAccount,
906
+ isConnected,
907
+ connect,
908
+ disconnect,
909
+ sendTransaction,
910
+ signMessage,
911
+ isLoading,
912
+ error
913
+ } = usePWCWallet({ vault });
914
+ ```
915
+
916
+ ### DApp Browser Examples
917
+
918
+ #### Complete Wallet App with Wagmi Integration
919
+
920
+ ```typescript
921
+ import React, { useState } from 'react';
922
+ import { View, Text, TouchableOpacity } from 'react-native';
923
+ import { WagmiConfig } from 'wagmi';
924
+ import { DAppBrowser, usePWCWallet, Vault, createWagmiConfig } from 'pwc-wallet-sdk';
925
+
926
+ const WalletApp = () => {
927
+ const [activeTab, setActiveTab] = useState<'wallet' | 'browser'>('wallet');
928
+ const vault = new Vault(); // Your vault instance
929
+
930
+ // Create Wagmi config for universal dApp compatibility
931
+ const wagmiConfig = createWagmiConfig({
932
+ vault: vault,
933
+ pwcWalletName: 'PWC Wallet',
934
+ pwcWalletIcon: 'https://pwc-wallet.com/icon.png'
935
+ });
936
+
937
+ const { accounts, currentAccount, isConnected, connect, disconnect } = usePWCWallet({ vault });
938
+
939
+ if (activeTab === 'browser') {
940
+ return (
941
+ <WagmiConfig config={wagmiConfig}>
942
+ <DAppBrowser
943
+ vault={vault}
944
+ initialUrl="https://paywithcrypto.io/"
945
+ onTransaction={(transaction) => {
946
+ console.log('Transaction:', transaction);
947
+ }}
948
+ onConnection={(dAppInfo) => {
949
+ console.log('Connection:', dAppInfo);
950
+ }}
951
+ />
952
+ </WagmiConfig>
953
+ );
954
+ }
955
+
956
+ return (
957
+ <View>
958
+ <Text>PWC Wallet</Text>
959
+ {isConnected ? (
960
+ <View>
961
+ <Text>Connected: {currentAccount}</Text>
962
+ <TouchableOpacity onPress={() => setActiveTab('browser')}>
963
+ <Text>Open Browser</Text>
964
+ </TouchableOpacity>
965
+ <TouchableOpacity onPress={disconnect}>
966
+ <Text>Disconnect</Text>
967
+ </TouchableOpacity>
968
+ </View>
969
+ ) : (
970
+ <TouchableOpacity onPress={connect}>
971
+ <Text>Connect Wallet</Text>
972
+ </TouchableOpacity>
973
+ )}
974
+ </View>
975
+ );
976
+ };
977
+ ```
978
+
979
+ #### Real-World Example: PancakeSwap Integration
980
+
981
+ ```typescript
982
+ import React from 'react';
983
+ import { WagmiConfig } from 'wagmi';
984
+ import { DAppBrowser, createWagmiConfig } from 'pwc-wallet-sdk';
985
+
986
+ const PancakeSwapExample = () => {
987
+ const vault = new Vault();
988
+
989
+ const wagmiConfig = createWagmiConfig({
990
+ vault: vault,
991
+ pwcWalletName: 'PWC Wallet'
992
+ });
993
+
994
+ return (
995
+ <WagmiConfig config={wagmiConfig}>
996
+ <DAppBrowser
997
+ vault={vault}
998
+ initialUrl="https://pancakeswap.finance/"
999
+ onTransaction={(transaction) => {
1000
+ console.log('PancakeSwap transaction:', transaction);
1001
+ }}
1002
+ onConnection={(dAppInfo) => {
1003
+ console.log('PancakeSwap connection:', dAppInfo);
1004
+ }}
1005
+ />
1006
+ </WagmiConfig>
1007
+ );
1008
+ };
1009
+ ```
1010
+
1011
+ **Result:** When user clicks "Connect Wallet" on PancakeSwap, they will see "PWC Wallet" as an option! 🎯
1012
+
1013
+ ### 🎯 Summary: Universal dApp Compatibility
1014
+
1015
+ The PWC Wallet SDK with Wagmi integration provides **universal dApp compatibility**:
1016
+
1017
+ #### ✅ **Works with ALL dApps:**
1018
+ - **PancakeSwap** - "Connect Wallet" → PWC Wallet option
1019
+ - **Uniswap** - "Connect Wallet" → PWC Wallet option
1020
+ - **OpenSea** - "Connect Wallet" → PWC Wallet option
1021
+ - **Aave** - "Connect Wallet" → PWC Wallet option
1022
+ - **Compound** - "Connect Wallet" → PWC Wallet option
1023
+ - **Any dApp using Wagmi** - "Connect Wallet" → PWC Wallet option
1024
+
1025
+ #### ✅ **One Setup, Universal Access:**
1026
+ ```typescript
1027
+ // Mobile dev chỉ cần setup 1 lần
1028
+ const wagmiConfig = createWagmiConfig({
1029
+ vault: vault,
1030
+ pwcWalletName: 'PWC Wallet'
1031
+ });
1032
+
1033
+ <WagmiConfig config={wagmiConfig}>
1034
+ <DAppBrowser vault={vault} />
1035
+ </WagmiConfig>
1036
+ ```
1037
+
1038
+ #### ✅ **No dApp Changes Required:**
1039
+ - dApps don't need to add PWC Wallet manually
1040
+ - Works with existing dApp code
1041
+ - Follows industry standards (MetaMask, WalletConnect)
1042
+
1043
+ #### ✅ **No WalletConnect Required:**
1044
+ - PWC Wallet uses built-in browser (WebView)
1045
+ - No need for `projectId` or WalletConnect bridge
1046
+ - Direct connection without external services
1047
+
1048
+ For detailed documentation, see [DApp Browser Integration Guide](./docs/DAPP_BROWSER_INTEGRATION.md).
1049
+
696
1050
  ### NFT Types and Interfaces
697
1051
  Complete TypeScript interfaces for NFT functionality.
698
1052
 
@@ -1070,10 +1424,27 @@ console.log('ERC-1155 transfer gas:', erc1155TransferGas.toString());
1070
1424
 
1071
1425
  ## Installation
1072
1426
 
1427
+ ### Basic Installation
1428
+
1073
1429
  ```bash
1074
1430
  npm install pwc-wallet-sdk
1075
1431
  ```
1076
1432
 
1433
+ ### DApp Browser Dependencies
1434
+
1435
+ For DApp Browser functionality with universal dApp compatibility:
1436
+
1437
+ ```bash
1438
+ npm install pwc-wallet-sdk react-native-webview wagmi connectkit
1439
+ ```
1440
+
1441
+ **Required Dependencies:**
1442
+ - `react-native-webview` - For WebView browser functionality
1443
+ - `wagmi` - For universal dApp compatibility
1444
+ - `connectkit` - For modern wallet connection UI
1445
+
1446
+ **Note:** These are peer dependencies. Mobile developers need to install them to use the DApp Browser features.
1447
+
1077
1448
  ## Quick Start
1078
1449
 
1079
1450
  ### 1. Basic Wallet Creation
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ export interface DAppInfo {
3
+ name: string;
4
+ description: string;
5
+ url: string;
6
+ icons: string[];
7
+ }
8
+ export interface ConnectionModalProps {
9
+ visible: boolean;
10
+ dAppInfo: DAppInfo | null;
11
+ onApprove: () => void;
12
+ onReject: () => void;
13
+ }
14
+ export declare const ConnectionModal: React.FC<ConnectionModalProps>;
@@ -0,0 +1,206 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ConnectionModal = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const react_native_1 = require("react-native");
9
+ const ConnectionModal = ({ visible, dAppInfo, onApprove, onReject, }) => {
10
+ if (!dAppInfo)
11
+ return null;
12
+ const handleApprove = () => {
13
+ react_native_1.Alert.alert('Confirm Connection', `Are you sure you want to connect to ${dAppInfo.name}?`, [
14
+ { text: 'Cancel', style: 'cancel' },
15
+ { text: 'Connect', onPress: onApprove, style: 'default' },
16
+ ]);
17
+ };
18
+ const handleReject = () => {
19
+ react_native_1.Alert.alert('Reject Connection', `Are you sure you want to reject the connection to ${dAppInfo.name}?`, [
20
+ { text: 'Cancel', style: 'cancel' },
21
+ { text: 'Reject', onPress: onReject, style: 'destructive' },
22
+ ]);
23
+ };
24
+ return (react_1.default.createElement(react_native_1.Modal, { visible: visible, animationType: "slide", transparent: true, onRequestClose: onReject },
25
+ react_1.default.createElement(react_native_1.View, { style: styles.overlay },
26
+ react_1.default.createElement(react_native_1.View, { style: styles.modalContainer },
27
+ react_1.default.createElement(react_native_1.View, { style: styles.header },
28
+ react_1.default.createElement(react_native_1.Text, { style: styles.title }, "Connect to dApp"),
29
+ react_1.default.createElement(react_native_1.Text, { style: styles.subtitle }, "Review connection request")),
30
+ react_1.default.createElement(react_native_1.ScrollView, { style: styles.content },
31
+ react_1.default.createElement(react_native_1.View, { style: styles.dAppInfo },
32
+ dAppInfo.icons && dAppInfo.icons.length > 0 && (react_1.default.createElement(react_native_1.Image, { source: { uri: dAppInfo.icons[0] }, style: styles.dAppIcon })),
33
+ react_1.default.createElement(react_native_1.View, { style: styles.dAppDetails },
34
+ react_1.default.createElement(react_native_1.Text, { style: styles.dAppName }, dAppInfo.name),
35
+ react_1.default.createElement(react_native_1.Text, { style: styles.dAppUrl }, dAppInfo.url))),
36
+ react_1.default.createElement(react_native_1.View, { style: styles.section },
37
+ react_1.default.createElement(react_native_1.Text, { style: styles.sectionTitle }, "Description"),
38
+ react_1.default.createElement(react_native_1.Text, { style: styles.description }, dAppInfo.description)),
39
+ react_1.default.createElement(react_native_1.View, { style: styles.section },
40
+ react_1.default.createElement(react_native_1.Text, { style: styles.sectionTitle }, "Permissions"),
41
+ react_1.default.createElement(react_native_1.View, { style: styles.permissionItem },
42
+ react_1.default.createElement(react_native_1.Text, { style: styles.permissionText }, "\u2022 View account address")),
43
+ react_1.default.createElement(react_native_1.View, { style: styles.permissionItem },
44
+ react_1.default.createElement(react_native_1.Text, { style: styles.permissionText }, "\u2022 Request transaction approval")),
45
+ react_1.default.createElement(react_native_1.View, { style: styles.permissionItem },
46
+ react_1.default.createElement(react_native_1.Text, { style: styles.permissionText }, "\u2022 Request message signing"))),
47
+ react_1.default.createElement(react_native_1.View, { style: styles.section },
48
+ react_1.default.createElement(react_native_1.Text, { style: styles.sectionTitle }, "Network"),
49
+ react_1.default.createElement(react_native_1.Text, { style: styles.network }, "Ethereum Mainnet")),
50
+ react_1.default.createElement(react_native_1.View, { style: styles.warningSection },
51
+ react_1.default.createElement(react_native_1.Text, { style: styles.warningTitle }, "\u26A0\uFE0F Security Notice"),
52
+ react_1.default.createElement(react_native_1.Text, { style: styles.warningText }, "Only connect to dApps you trust. This connection will allow the dApp to:"),
53
+ react_1.default.createElement(react_native_1.Text, { style: styles.warningText }, "\u2022 View your wallet address"),
54
+ react_1.default.createElement(react_native_1.Text, { style: styles.warningText }, "\u2022 Request transaction approvals"),
55
+ react_1.default.createElement(react_native_1.Text, { style: styles.warningText }, "\u2022 Request message signatures"))),
56
+ react_1.default.createElement(react_native_1.View, { style: styles.footer },
57
+ react_1.default.createElement(react_native_1.TouchableOpacity, { style: styles.rejectButton, onPress: handleReject },
58
+ react_1.default.createElement(react_native_1.Text, { style: styles.rejectButtonText }, "Reject")),
59
+ react_1.default.createElement(react_native_1.TouchableOpacity, { style: styles.approveButton, onPress: handleApprove },
60
+ react_1.default.createElement(react_native_1.Text, { style: styles.approveButtonText }, "Connect")))))));
61
+ };
62
+ exports.ConnectionModal = ConnectionModal;
63
+ const styles = react_native_1.StyleSheet.create({
64
+ overlay: {
65
+ flex: 1,
66
+ backgroundColor: 'rgba(0, 0, 0, 0.5)',
67
+ justifyContent: 'center',
68
+ alignItems: 'center',
69
+ },
70
+ modalContainer: {
71
+ width: '90%',
72
+ maxHeight: '80%',
73
+ backgroundColor: '#fff',
74
+ borderRadius: 12,
75
+ overflow: 'hidden',
76
+ },
77
+ header: {
78
+ padding: 20,
79
+ borderBottomWidth: 1,
80
+ borderBottomColor: '#e9ecef',
81
+ backgroundColor: '#f8f9fa',
82
+ },
83
+ title: {
84
+ fontSize: 20,
85
+ fontWeight: 'bold',
86
+ color: '#212529',
87
+ textAlign: 'center',
88
+ },
89
+ subtitle: {
90
+ fontSize: 14,
91
+ color: '#6c757d',
92
+ textAlign: 'center',
93
+ marginTop: 4,
94
+ },
95
+ content: {
96
+ flex: 1,
97
+ padding: 20,
98
+ },
99
+ dAppInfo: {
100
+ flexDirection: 'row',
101
+ alignItems: 'center',
102
+ marginBottom: 20,
103
+ padding: 16,
104
+ backgroundColor: '#f8f9fa',
105
+ borderRadius: 8,
106
+ },
107
+ dAppIcon: {
108
+ width: 48,
109
+ height: 48,
110
+ borderRadius: 8,
111
+ marginRight: 12,
112
+ },
113
+ dAppDetails: {
114
+ flex: 1,
115
+ },
116
+ dAppName: {
117
+ fontSize: 18,
118
+ fontWeight: 'bold',
119
+ color: '#212529',
120
+ marginBottom: 4,
121
+ },
122
+ dAppUrl: {
123
+ fontSize: 14,
124
+ color: '#6c757d',
125
+ },
126
+ section: {
127
+ marginBottom: 16,
128
+ },
129
+ sectionTitle: {
130
+ fontSize: 16,
131
+ fontWeight: '600',
132
+ color: '#495057',
133
+ marginBottom: 8,
134
+ },
135
+ description: {
136
+ fontSize: 14,
137
+ color: '#212529',
138
+ lineHeight: 20,
139
+ },
140
+ permissionItem: {
141
+ marginBottom: 4,
142
+ },
143
+ permissionText: {
144
+ fontSize: 14,
145
+ color: '#212529',
146
+ },
147
+ network: {
148
+ fontSize: 14,
149
+ color: '#212529',
150
+ fontWeight: '500',
151
+ },
152
+ warningSection: {
153
+ marginTop: 20,
154
+ padding: 16,
155
+ backgroundColor: '#fff3cd',
156
+ borderRadius: 8,
157
+ borderWidth: 1,
158
+ borderColor: '#ffeaa7',
159
+ },
160
+ warningTitle: {
161
+ fontSize: 16,
162
+ fontWeight: 'bold',
163
+ color: '#856404',
164
+ marginBottom: 8,
165
+ },
166
+ warningText: {
167
+ fontSize: 14,
168
+ color: '#856404',
169
+ lineHeight: 18,
170
+ marginBottom: 4,
171
+ },
172
+ footer: {
173
+ flexDirection: 'row',
174
+ padding: 20,
175
+ borderTopWidth: 1,
176
+ borderTopColor: '#e9ecef',
177
+ },
178
+ rejectButton: {
179
+ flex: 1,
180
+ paddingVertical: 12,
181
+ paddingHorizontal: 20,
182
+ backgroundColor: '#6c757d',
183
+ borderRadius: 8,
184
+ marginRight: 10,
185
+ },
186
+ rejectButtonText: {
187
+ color: '#fff',
188
+ fontSize: 16,
189
+ fontWeight: '600',
190
+ textAlign: 'center',
191
+ },
192
+ approveButton: {
193
+ flex: 1,
194
+ paddingVertical: 12,
195
+ paddingHorizontal: 20,
196
+ backgroundColor: '#007AFF',
197
+ borderRadius: 8,
198
+ marginLeft: 10,
199
+ },
200
+ approveButtonText: {
201
+ color: '#fff',
202
+ fontSize: 16,
203
+ fontWeight: '600',
204
+ textAlign: 'center',
205
+ },
206
+ });
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { Vault } from '../Vault';
3
+ export interface DAppBrowserProps {
4
+ vault: Vault;
5
+ initialUrl?: string;
6
+ onTransaction?: (transaction: any) => void;
7
+ onConnection?: (dAppInfo: any) => void;
8
+ onError?: (error: Error) => void;
9
+ style?: any;
10
+ }
11
+ export declare const DAppBrowser: React.FC<DAppBrowserProps>;