@aptos-labs/wallet-adapter-react 0.1.7 → 0.2.0
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/CHANGELOG.md +15 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -1
- package/dist/index.mjs +9 -1
- package/package.json +1 -1
- package/src/WalletProvider.tsx +9 -0
- package/src/useWallet.tsx +1 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @aptos-labs/wallet-adapter-react
|
|
2
|
+
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 6e53116: Add support to verify a signed message
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [18a0429]
|
|
12
|
+
- Updated dependencies [42e29f6]
|
|
13
|
+
- Updated dependencies [576bb57]
|
|
14
|
+
- Updated dependencies [6e53116]
|
|
15
|
+
- @aptos-labs/wallet-adapter-core@0.2.0
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ interface WalletContextState {
|
|
|
13
13
|
signAndSubmitTransaction<T extends Types.TransactionPayload, V>(transaction: T, options?: V): Promise<any>;
|
|
14
14
|
signTransaction<T extends Types.TransactionPayload, V>(transaction: T, options?: V): Promise<any>;
|
|
15
15
|
signMessage(message: SignMessagePayload): Promise<SignMessageResponse | null>;
|
|
16
|
+
signMessageAndVerify(message: SignMessagePayload): Promise<boolean>;
|
|
16
17
|
}
|
|
17
18
|
declare function useWallet(): WalletContextState;
|
|
18
19
|
|
package/dist/index.js
CHANGED
|
@@ -94,6 +94,13 @@ var AptosWalletAdapterProvider = ({
|
|
|
94
94
|
throw error;
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
|
+
const signMessageAndVerify = async (message) => {
|
|
98
|
+
try {
|
|
99
|
+
return await walletCore.signMessageAndVerify(message);
|
|
100
|
+
} catch (error) {
|
|
101
|
+
throw error;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
97
104
|
(0, import_react2.useEffect)(() => {
|
|
98
105
|
if (autoConnect) {
|
|
99
106
|
if (localStorage.getItem("AptosWalletName")) {
|
|
@@ -194,7 +201,8 @@ var AptosWalletAdapterProvider = ({
|
|
|
194
201
|
wallets,
|
|
195
202
|
signAndSubmitTransaction,
|
|
196
203
|
signTransaction,
|
|
197
|
-
signMessage
|
|
204
|
+
signMessage,
|
|
205
|
+
signMessageAndVerify
|
|
198
206
|
},
|
|
199
207
|
children
|
|
200
208
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -72,6 +72,13 @@ var AptosWalletAdapterProvider = ({
|
|
|
72
72
|
throw error;
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
|
+
const signMessageAndVerify = async (message) => {
|
|
76
|
+
try {
|
|
77
|
+
return await walletCore.signMessageAndVerify(message);
|
|
78
|
+
} catch (error) {
|
|
79
|
+
throw error;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
75
82
|
useEffect(() => {
|
|
76
83
|
if (autoConnect) {
|
|
77
84
|
if (localStorage.getItem("AptosWalletName")) {
|
|
@@ -172,7 +179,8 @@ var AptosWalletAdapterProvider = ({
|
|
|
172
179
|
wallets,
|
|
173
180
|
signAndSubmitTransaction,
|
|
174
181
|
signTransaction,
|
|
175
|
-
signMessage
|
|
182
|
+
signMessage,
|
|
183
|
+
signMessageAndVerify
|
|
176
184
|
},
|
|
177
185
|
children
|
|
178
186
|
});
|
package/package.json
CHANGED
package/src/WalletProvider.tsx
CHANGED
|
@@ -91,6 +91,14 @@ export const AptosWalletAdapterProvider: FC<AptosWalletProviderProps> = ({
|
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
+
const signMessageAndVerify = async (message: SignMessagePayload) => {
|
|
95
|
+
try {
|
|
96
|
+
return await walletCore.signMessageAndVerify(message);
|
|
97
|
+
} catch (error: any) {
|
|
98
|
+
throw error;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
94
102
|
useEffect(() => {
|
|
95
103
|
if (autoConnect) {
|
|
96
104
|
if (localStorage.getItem("AptosWalletName")) {
|
|
@@ -201,6 +209,7 @@ export const AptosWalletAdapterProvider: FC<AptosWalletProviderProps> = ({
|
|
|
201
209
|
signAndSubmitTransaction,
|
|
202
210
|
signTransaction,
|
|
203
211
|
signMessage,
|
|
212
|
+
signMessageAndVerify,
|
|
204
213
|
}}
|
|
205
214
|
>
|
|
206
215
|
{children}
|
package/src/useWallet.tsx
CHANGED
|
@@ -29,6 +29,7 @@ export interface WalletContextState {
|
|
|
29
29
|
options?: V
|
|
30
30
|
): Promise<any>;
|
|
31
31
|
signMessage(message: SignMessagePayload): Promise<SignMessageResponse | null>;
|
|
32
|
+
signMessageAndVerify(message: SignMessagePayload): Promise<boolean>;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
const DEFAULT_COUNTEXT = {
|