@aptos-labs/wallet-adapter-react 1.1.0 → 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 CHANGED
@@ -1,5 +1,17 @@
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
+
3
15
  ## 1.1.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptos-labs/wallet-adapter-react",
3
- "version": "1.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.2.0",
40
+ "@aptos-labs/wallet-adapter-core": "2.3.0",
41
41
  "aptos": "^1.3.17",
42
42
  "react": "^18"
43
43
  },
@@ -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[]>(walletCore.wallets);
51
+ const [wallets, setWallets] = useState<ReadonlyArray<Wallet>>(walletCore.wallets);
52
52
 
53
53
  const connect = (walletName: WalletName) => {
54
54
  try {
package/src/useWallet.tsx CHANGED
@@ -32,7 +32,7 @@ export interface WalletContextState {
32
32
  connect(walletName: WalletName): void;
33
33
  disconnect(): void;
34
34
  wallet: WalletInfo | null;
35
- wallets: Wallet[];
35
+ wallets: ReadonlyArray<Wallet>;
36
36
  signAndSubmitTransaction<T extends Types.TransactionPayload, V>(
37
37
  transaction: T,
38
38
  options?: V