@aptos-labs/wallet-adapter-react 1.0.1 → 1.0.2
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 +0 -11
- package/dist/index.d.ts +4 -3
- package/package.json +1 -1
- package/src/WalletProvider.tsx +6 -3
- package/src/useWallet.tsx +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
# @aptos-labs/wallet-adapter-react
|
|
2
2
|
|
|
3
|
-
## 1.0.0
|
|
4
|
-
|
|
5
|
-
### Major Changes
|
|
6
|
-
|
|
7
|
-
- 06a2e0d: Add support to submit BCS transaction
|
|
8
|
-
|
|
9
|
-
### Patch Changes
|
|
10
|
-
|
|
11
|
-
- Updated dependencies [06a2e0d]
|
|
12
|
-
- @aptos-labs/wallet-adapter-core@2.0.0
|
|
13
|
-
|
|
14
3
|
## 0.2.4
|
|
15
4
|
|
|
16
5
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { AccountInfo, NetworkInfo, WalletName, WalletInfo, Wallet,
|
|
1
|
+
import { AccountInfo, NetworkInfo, WalletName, WalletInfo, Wallet, SignMessagePayload, SignMessageResponse } from '@aptos-labs/wallet-adapter-core';
|
|
2
2
|
export { NetworkName, WalletName, WalletReadyState } from '@aptos-labs/wallet-adapter-core';
|
|
3
|
+
import { Types } from 'aptos';
|
|
3
4
|
import { ReactNode, FC } from 'react';
|
|
4
5
|
|
|
5
6
|
interface WalletContextState {
|
|
@@ -11,8 +12,8 @@ interface WalletContextState {
|
|
|
11
12
|
disconnect(): void;
|
|
12
13
|
wallet: WalletInfo | null;
|
|
13
14
|
wallets: Wallet[];
|
|
14
|
-
signAndSubmitTransaction<T extends TransactionPayload, V>(transaction: T, options?: V): Promise<any>;
|
|
15
|
-
signTransaction<T extends TransactionPayload, V>(transaction: T, options?: V): Promise<any>;
|
|
15
|
+
signAndSubmitTransaction<T extends Types.TransactionPayload, V>(transaction: T, options?: V): Promise<any>;
|
|
16
|
+
signTransaction<T extends Types.TransactionPayload, V>(transaction: T, options?: V): Promise<any>;
|
|
16
17
|
signMessage(message: SignMessagePayload): Promise<SignMessageResponse | null>;
|
|
17
18
|
signMessageAndVerify(message: SignMessagePayload): Promise<boolean>;
|
|
18
19
|
}
|
package/package.json
CHANGED
package/src/WalletProvider.tsx
CHANGED
|
@@ -11,13 +11,14 @@ import type {
|
|
|
11
11
|
AccountInfo,
|
|
12
12
|
NetworkInfo,
|
|
13
13
|
SignMessagePayload,
|
|
14
|
-
TransactionPayload,
|
|
15
14
|
Wallet,
|
|
16
15
|
WalletInfo,
|
|
17
16
|
WalletName,
|
|
18
17
|
} from "@aptos-labs/wallet-adapter-core";
|
|
19
18
|
import { WalletCore } from "@aptos-labs/wallet-adapter-core";
|
|
20
19
|
|
|
20
|
+
import { Types } from "aptos";
|
|
21
|
+
|
|
21
22
|
export interface AptosWalletProviderProps {
|
|
22
23
|
children: ReactNode;
|
|
23
24
|
plugins: Wallet[];
|
|
@@ -68,7 +69,9 @@ export const AptosWalletAdapterProvider: FC<AptosWalletProviderProps> = ({
|
|
|
68
69
|
}
|
|
69
70
|
};
|
|
70
71
|
|
|
71
|
-
const signAndSubmitTransaction = async (
|
|
72
|
+
const signAndSubmitTransaction = async (
|
|
73
|
+
transaction: Types.TransactionPayload
|
|
74
|
+
) => {
|
|
72
75
|
try {
|
|
73
76
|
return await walletCore.signAndSubmitTransaction(transaction);
|
|
74
77
|
} catch (error: any) {
|
|
@@ -76,7 +79,7 @@ export const AptosWalletAdapterProvider: FC<AptosWalletProviderProps> = ({
|
|
|
76
79
|
}
|
|
77
80
|
};
|
|
78
81
|
|
|
79
|
-
const signTransaction = async (transaction: TransactionPayload) => {
|
|
82
|
+
const signTransaction = async (transaction: Types.TransactionPayload) => {
|
|
80
83
|
try {
|
|
81
84
|
return await walletCore.signTransaction(transaction);
|
|
82
85
|
} catch (error: any) {
|
package/src/useWallet.tsx
CHANGED
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
Wallet,
|
|
9
9
|
WalletReadyState,
|
|
10
10
|
NetworkName,
|
|
11
|
-
TransactionPayload,
|
|
12
11
|
} from "@aptos-labs/wallet-adapter-core";
|
|
13
12
|
import { createContext, useContext } from "react";
|
|
13
|
+
import { Types } from "aptos";
|
|
14
14
|
|
|
15
15
|
export type { WalletName };
|
|
16
16
|
export { WalletReadyState, NetworkName };
|
|
@@ -24,11 +24,11 @@ export interface WalletContextState {
|
|
|
24
24
|
disconnect(): void;
|
|
25
25
|
wallet: WalletInfo | null;
|
|
26
26
|
wallets: Wallet[];
|
|
27
|
-
signAndSubmitTransaction<T extends TransactionPayload, V>(
|
|
27
|
+
signAndSubmitTransaction<T extends Types.TransactionPayload, V>(
|
|
28
28
|
transaction: T,
|
|
29
29
|
options?: V
|
|
30
30
|
): Promise<any>;
|
|
31
|
-
signTransaction<T extends TransactionPayload, V>(
|
|
31
|
+
signTransaction<T extends Types.TransactionPayload, V>(
|
|
32
32
|
transaction: T,
|
|
33
33
|
options?: V
|
|
34
34
|
): Promise<any>;
|