@aptos-labs/wallet-adapter-react 1.0.6 → 1.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 +18 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +6 -0
- package/dist/index.mjs +7 -1
- package/package.json +2 -2
- package/src/WalletProvider.tsx +2 -2
- package/src/index.tsx +9 -2
- package/src/useWallet.tsx +12 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @aptos-labs/wallet-adapter-react
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1605d28: Support ReadonlyArray of Wallets in AptosWalletAdapterProvider and WalletCore
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [bb1595e]
|
|
12
|
+
- Updated dependencies [1605d28]
|
|
13
|
+
- @aptos-labs/wallet-adapter-core@2.3.0
|
|
14
|
+
|
|
15
|
+
## 1.1.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- d8d5a8a: Support deeplink on React Provider and Nextjs demo app
|
|
20
|
+
|
|
3
21
|
## 1.0.6
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AccountInfo, NetworkInfo, WalletName, WalletInfo, Wallet, SignMessagePayload, SignMessageResponse } from '@aptos-labs/wallet-adapter-core';
|
|
2
|
-
export { NetworkName, WalletName, WalletReadyState } from '@aptos-labs/wallet-adapter-core';
|
|
2
|
+
export { NetworkName, Wallet, WalletName, WalletReadyState, isInAppBrowser, isMobile, isRedirectable } from '@aptos-labs/wallet-adapter-core';
|
|
3
3
|
import { Types, TxnBuilderTypes } from 'aptos';
|
|
4
4
|
import { ReactNode, FC } from 'react';
|
|
5
5
|
|
|
@@ -11,7 +11,7 @@ interface WalletContextState {
|
|
|
11
11
|
connect(walletName: WalletName): void;
|
|
12
12
|
disconnect(): void;
|
|
13
13
|
wallet: WalletInfo | null;
|
|
14
|
-
wallets: Wallet
|
|
14
|
+
wallets: ReadonlyArray<Wallet>;
|
|
15
15
|
signAndSubmitTransaction<T extends Types.TransactionPayload, V>(transaction: T, options?: V): Promise<any>;
|
|
16
16
|
signAndSubmitBCSTransaction<T extends TxnBuilderTypes.TransactionPayload, V>(transaction: T, options?: V): Promise<any>;
|
|
17
17
|
signTransaction<T extends Types.TransactionPayload, V>(transaction: T, options?: V): Promise<any>;
|
|
@@ -22,7 +22,7 @@ declare function useWallet(): WalletContextState;
|
|
|
22
22
|
|
|
23
23
|
interface AptosWalletProviderProps {
|
|
24
24
|
children: ReactNode;
|
|
25
|
-
plugins: Wallet
|
|
25
|
+
plugins: ReadonlyArray<Wallet>;
|
|
26
26
|
autoConnect?: boolean;
|
|
27
27
|
}
|
|
28
28
|
declare const AptosWalletAdapterProvider: FC<AptosWalletProviderProps>;
|
package/dist/index.js
CHANGED
|
@@ -23,6 +23,9 @@ __export(src_exports, {
|
|
|
23
23
|
AptosWalletAdapterProvider: () => AptosWalletAdapterProvider,
|
|
24
24
|
NetworkName: () => import_wallet_adapter_core.NetworkName,
|
|
25
25
|
WalletReadyState: () => import_wallet_adapter_core.WalletReadyState,
|
|
26
|
+
isInAppBrowser: () => import_wallet_adapter_core.isInAppBrowser,
|
|
27
|
+
isMobile: () => import_wallet_adapter_core.isMobile,
|
|
28
|
+
isRedirectable: () => import_wallet_adapter_core.isRedirectable,
|
|
26
29
|
useWallet: () => useWallet
|
|
27
30
|
});
|
|
28
31
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -217,5 +220,8 @@ var AptosWalletAdapterProvider = ({
|
|
|
217
220
|
AptosWalletAdapterProvider,
|
|
218
221
|
NetworkName,
|
|
219
222
|
WalletReadyState,
|
|
223
|
+
isInAppBrowser,
|
|
224
|
+
isMobile,
|
|
225
|
+
isRedirectable,
|
|
220
226
|
useWallet
|
|
221
227
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// src/useWallet.tsx
|
|
2
2
|
import {
|
|
3
3
|
WalletReadyState,
|
|
4
|
-
NetworkName
|
|
4
|
+
NetworkName,
|
|
5
|
+
isInAppBrowser,
|
|
6
|
+
isRedirectable,
|
|
7
|
+
isMobile
|
|
5
8
|
} from "@aptos-labs/wallet-adapter-core";
|
|
6
9
|
import { createContext, useContext } from "react";
|
|
7
10
|
var DEFAULT_COUNTEXT = {
|
|
@@ -195,5 +198,8 @@ export {
|
|
|
195
198
|
AptosWalletAdapterProvider,
|
|
196
199
|
NetworkName,
|
|
197
200
|
WalletReadyState,
|
|
201
|
+
isInAppBrowser,
|
|
202
|
+
isMobile,
|
|
203
|
+
isRedirectable,
|
|
198
204
|
useWallet
|
|
199
205
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aptos-labs/wallet-adapter-react",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Aptos Wallet Adapter React Provider",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@aptos-labs/wallet-adapter-tsconfig": "0.0.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@aptos-labs/wallet-adapter-core": "2.
|
|
40
|
+
"@aptos-labs/wallet-adapter-core": "2.3.0",
|
|
41
41
|
"aptos": "^1.3.17",
|
|
42
42
|
"react": "^18"
|
|
43
43
|
},
|
package/src/WalletProvider.tsx
CHANGED
|
@@ -21,7 +21,7 @@ import { TxnBuilderTypes, Types } from "aptos";
|
|
|
21
21
|
|
|
22
22
|
export interface AptosWalletProviderProps {
|
|
23
23
|
children: ReactNode;
|
|
24
|
-
plugins: Wallet
|
|
24
|
+
plugins: ReadonlyArray<Wallet>;
|
|
25
25
|
autoConnect?: boolean;
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -48,7 +48,7 @@ export const AptosWalletAdapterProvider: FC<AptosWalletProviderProps> = ({
|
|
|
48
48
|
const [isLoading, setIsLoading] = useState<boolean>(true);
|
|
49
49
|
|
|
50
50
|
const walletCore = useMemo(() => new WalletCore(plugins), []);
|
|
51
|
-
const [wallets, setWallets] = useState<Wallet
|
|
51
|
+
const [wallets, setWallets] = useState<ReadonlyArray<Wallet>>(walletCore.wallets);
|
|
52
52
|
|
|
53
53
|
const connect = (walletName: WalletName) => {
|
|
54
54
|
try {
|
package/src/index.tsx
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
export {
|
|
3
|
-
|
|
2
|
+
export {
|
|
3
|
+
useWallet,
|
|
4
|
+
WalletReadyState,
|
|
5
|
+
NetworkName,
|
|
6
|
+
isInAppBrowser,
|
|
7
|
+
isMobile,
|
|
8
|
+
isRedirectable,
|
|
9
|
+
} from "./useWallet";
|
|
10
|
+
export type { WalletName, Wallet } from "./useWallet";
|
|
4
11
|
export * from "./WalletProvider";
|
package/src/useWallet.tsx
CHANGED
|
@@ -8,12 +8,21 @@ import {
|
|
|
8
8
|
Wallet,
|
|
9
9
|
WalletReadyState,
|
|
10
10
|
NetworkName,
|
|
11
|
+
isInAppBrowser,
|
|
12
|
+
isRedirectable,
|
|
13
|
+
isMobile,
|
|
11
14
|
} from "@aptos-labs/wallet-adapter-core";
|
|
12
15
|
import { createContext, useContext } from "react";
|
|
13
16
|
import { TxnBuilderTypes, Types } from "aptos";
|
|
14
17
|
|
|
15
|
-
export type { WalletName };
|
|
16
|
-
export {
|
|
18
|
+
export type { WalletName, Wallet };
|
|
19
|
+
export {
|
|
20
|
+
WalletReadyState,
|
|
21
|
+
NetworkName,
|
|
22
|
+
isInAppBrowser,
|
|
23
|
+
isRedirectable,
|
|
24
|
+
isMobile,
|
|
25
|
+
};
|
|
17
26
|
|
|
18
27
|
export interface WalletContextState {
|
|
19
28
|
connected: boolean;
|
|
@@ -23,7 +32,7 @@ export interface WalletContextState {
|
|
|
23
32
|
connect(walletName: WalletName): void;
|
|
24
33
|
disconnect(): void;
|
|
25
34
|
wallet: WalletInfo | null;
|
|
26
|
-
wallets: Wallet
|
|
35
|
+
wallets: ReadonlyArray<Wallet>;
|
|
27
36
|
signAndSubmitTransaction<T extends Types.TransactionPayload, V>(
|
|
28
37
|
transaction: T,
|
|
29
38
|
options?: V
|