@enclave-hq/wallet-sdk 1.2.3 → 1.2.5
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 +51 -1
- package/dist/index.d.mts +380 -195
- package/dist/index.js +3117 -141
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3774 -111
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.d.mts +91 -9
- package/dist/react/index.d.ts +91 -9
- package/dist/react/index.js +3651 -104
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +3625 -82
- package/dist/react/index.mjs.map +1 -1
- package/dist/tron.d.mts +36 -0
- package/dist/tron.js +852 -0
- package/dist/tron.js.map +1 -0
- package/dist/tron.mjs +846 -0
- package/dist/tron.mjs.map +1 -0
- package/dist/wallet-adapter-DRd0xm3N.d.mts +197 -0
- package/package.json +14 -4
- package/dist/index.d.ts +0 -477
package/README.md
CHANGED
|
@@ -98,6 +98,52 @@ function YourApp() {
|
|
|
98
98
|
}
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
+
### QR Code Signing (扫码签名)
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
import React, { useState } from 'react'
|
|
105
|
+
import { useQRCodeSigner, QRCodeModal } from '@enclave-hq/wallet-sdk/react'
|
|
106
|
+
|
|
107
|
+
function SignButton() {
|
|
108
|
+
const [showModal, setShowModal] = useState(false)
|
|
109
|
+
|
|
110
|
+
const { qrCodeDataUrl, status, startSign, cancel, error } = useQRCodeSigner({
|
|
111
|
+
requestId: `sign-${Date.now()}`,
|
|
112
|
+
requestUrl: `https://example.com/sign?requestId=sign-${Date.now()}`,
|
|
113
|
+
pollUrl: 'https://api.example.com/sign/status',
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
const handleSign = async () => {
|
|
117
|
+
setShowModal(true)
|
|
118
|
+
try {
|
|
119
|
+
const signature = await startSign()
|
|
120
|
+
console.log('Signature:', signature)
|
|
121
|
+
setShowModal(false)
|
|
122
|
+
} catch (error) {
|
|
123
|
+
console.error('Sign failed:', error)
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<>
|
|
129
|
+
<button onClick={handleSign}>扫码签名</button>
|
|
130
|
+
|
|
131
|
+
<QRCodeModal
|
|
132
|
+
isOpen={showModal}
|
|
133
|
+
onClose={() => {
|
|
134
|
+
cancel()
|
|
135
|
+
setShowModal(false)
|
|
136
|
+
}}
|
|
137
|
+
qrCodeDataUrl={qrCodeDataUrl}
|
|
138
|
+
status={status}
|
|
139
|
+
error={error}
|
|
140
|
+
title="使用钱包扫码签名"
|
|
141
|
+
/>
|
|
142
|
+
</>
|
|
143
|
+
)
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
101
147
|
## 🎯 Core Concepts
|
|
102
148
|
|
|
103
149
|
### Universal Address
|
|
@@ -138,9 +184,11 @@ const wallets = walletManager.getConnectedWallets()
|
|
|
138
184
|
|--------|------------|--------|
|
|
139
185
|
| MetaMask | EVM | ✅ Supported |
|
|
140
186
|
| TronLink | Tron | ✅ Supported |
|
|
141
|
-
| WalletConnect | EVM |
|
|
187
|
+
| WalletConnect | EVM | ✅ Supported |
|
|
188
|
+
| WalletConnect Tron | Tron | ✅ Supported |
|
|
142
189
|
| Coinbase Wallet | EVM | 🚧 Coming Soon |
|
|
143
190
|
| Private Key | EVM/Tron | ✅ Dev Only |
|
|
191
|
+
| QR Code Signing | EVM/Tron | ✅ Supported |
|
|
144
192
|
|
|
145
193
|
## 📖 Documentation
|
|
146
194
|
|
|
@@ -152,6 +200,8 @@ Full documentation is available in the `/docs` folder:
|
|
|
152
200
|
- [Integration Guide](../docs/wallet-sdk/INTEGRATION.md)
|
|
153
201
|
- [State Management](../docs/wallet-sdk/STATE_AND_ACCOUNT.md)
|
|
154
202
|
- [Standards & Signing](../docs/wallet-sdk/STANDARDS.md)
|
|
203
|
+
- [QR Code Signing](./docs/QR_CODE_SIGNING.md) - 二维码签名功能
|
|
204
|
+
- [TRON Wallet Signing](./docs/TRON_WALLET_SIGNING.md) - TRON 钱包签名支持
|
|
155
205
|
|
|
156
206
|
## 🧪 Running the Example
|
|
157
207
|
|