@aptos-labs/wallet-adapter-react 2.1.0 → 2.1.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 +14 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +12 -10
- package/dist/index.mjs +11 -9
- package/package.json +2 -2
- package/src/WalletProvider.tsx +2 -3
- package/src/index.tsx +9 -4
- package/src/useWallet.tsx +1 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @aptos-labs/wallet-adapter-react
|
|
2
2
|
|
|
3
|
+
## 2.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a1c08cc: Export missing InputTransactionData type
|
|
8
|
+
|
|
9
|
+
## 2.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 6266a29: Consolidate options argument on signAndSubmitTransaction
|
|
14
|
+
- Updated dependencies [6266a29]
|
|
15
|
+
- @aptos-labs/wallet-adapter-core@3.1.1
|
|
16
|
+
|
|
3
17
|
## 2.1.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AccountInfo, NetworkInfo, WalletName, WalletInfo, Wallet, InputTransactionData,
|
|
2
|
-
export { NetworkName, Wallet, WalletName, WalletReadyState, isInAppBrowser, isMobile, isRedirectable } from '@aptos-labs/wallet-adapter-core';
|
|
1
|
+
import { AccountInfo, NetworkInfo, WalletName, WalletInfo, Wallet, InputTransactionData, AnyRawTransaction, Types, InputGenerateTransactionOptions, AccountAuthenticator, InputSubmitTransactionData, PendingTransactionResponse, SignMessagePayload, SignMessageResponse } from '@aptos-labs/wallet-adapter-core';
|
|
2
|
+
export { InputTransactionData, NetworkName, Wallet, WalletName, WalletReadyState, isInAppBrowser, isMobile, isRedirectable } from '@aptos-labs/wallet-adapter-core';
|
|
3
3
|
import { ReactNode, FC } from 'react';
|
|
4
4
|
|
|
5
5
|
interface WalletContextState {
|
|
@@ -11,7 +11,7 @@ interface WalletContextState {
|
|
|
11
11
|
disconnect(): void;
|
|
12
12
|
wallet: WalletInfo | null;
|
|
13
13
|
wallets: ReadonlyArray<Wallet>;
|
|
14
|
-
signAndSubmitTransaction(transaction: InputTransactionData
|
|
14
|
+
signAndSubmitTransaction(transaction: InputTransactionData): Promise<any>;
|
|
15
15
|
signTransaction(transactionOrPayload: AnyRawTransaction | Types.TransactionPayload, asFeePayer?: boolean, options?: InputGenerateTransactionOptions): Promise<AccountAuthenticator>;
|
|
16
16
|
submitTransaction(transaction: InputSubmitTransactionData): Promise<PendingTransactionResponse>;
|
|
17
17
|
signMessage(message: SignMessagePayload): Promise<SignMessageResponse>;
|
package/dist/index.js
CHANGED
|
@@ -21,17 +21,16 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var src_exports = {};
|
|
22
22
|
__export(src_exports, {
|
|
23
23
|
AptosWalletAdapterProvider: () => AptosWalletAdapterProvider,
|
|
24
|
-
NetworkName: () =>
|
|
25
|
-
WalletReadyState: () =>
|
|
26
|
-
isInAppBrowser: () =>
|
|
27
|
-
isMobile: () =>
|
|
28
|
-
isRedirectable: () =>
|
|
24
|
+
NetworkName: () => import_wallet_adapter_core2.NetworkName,
|
|
25
|
+
WalletReadyState: () => import_wallet_adapter_core2.WalletReadyState,
|
|
26
|
+
isInAppBrowser: () => import_wallet_adapter_core2.isInAppBrowser,
|
|
27
|
+
isMobile: () => import_wallet_adapter_core2.isMobile,
|
|
28
|
+
isRedirectable: () => import_wallet_adapter_core2.isRedirectable,
|
|
29
29
|
useWallet: () => useWallet
|
|
30
30
|
});
|
|
31
31
|
module.exports = __toCommonJS(src_exports);
|
|
32
32
|
|
|
33
33
|
// src/useWallet.tsx
|
|
34
|
-
var import_wallet_adapter_core = require("@aptos-labs/wallet-adapter-core");
|
|
35
34
|
var import_react = require("react");
|
|
36
35
|
var DEFAULT_CONTEXT = {
|
|
37
36
|
connected: false
|
|
@@ -49,7 +48,7 @@ function useWallet() {
|
|
|
49
48
|
|
|
50
49
|
// src/WalletProvider.tsx
|
|
51
50
|
var import_react2 = require("react");
|
|
52
|
-
var
|
|
51
|
+
var import_wallet_adapter_core = require("@aptos-labs/wallet-adapter-core");
|
|
53
52
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
54
53
|
var initialState = {
|
|
55
54
|
connected: false,
|
|
@@ -65,7 +64,7 @@ var AptosWalletAdapterProvider = ({
|
|
|
65
64
|
}) => {
|
|
66
65
|
const [{ connected, account, network, wallet }, setState] = (0, import_react2.useState)(initialState);
|
|
67
66
|
const [isLoading, setIsLoading] = (0, import_react2.useState)(true);
|
|
68
|
-
const walletCore = (0, import_react2.useMemo)(() => new
|
|
67
|
+
const walletCore = (0, import_react2.useMemo)(() => new import_wallet_adapter_core.WalletCore(plugins), []);
|
|
69
68
|
const [wallets, setWallets] = (0, import_react2.useState)(
|
|
70
69
|
walletCore.wallets
|
|
71
70
|
);
|
|
@@ -127,9 +126,9 @@ var AptosWalletAdapterProvider = ({
|
|
|
127
126
|
return Promise.reject(error);
|
|
128
127
|
}
|
|
129
128
|
};
|
|
130
|
-
const signAndSubmitTransaction = async (transaction
|
|
129
|
+
const signAndSubmitTransaction = async (transaction) => {
|
|
131
130
|
try {
|
|
132
|
-
return await walletCore.signAndSubmitTransaction(transaction
|
|
131
|
+
return await walletCore.signAndSubmitTransaction(transaction);
|
|
133
132
|
} catch (error) {
|
|
134
133
|
if (onError)
|
|
135
134
|
onError(error);
|
|
@@ -235,6 +234,9 @@ var AptosWalletAdapterProvider = ({
|
|
|
235
234
|
children
|
|
236
235
|
});
|
|
237
236
|
};
|
|
237
|
+
|
|
238
|
+
// src/index.tsx
|
|
239
|
+
var import_wallet_adapter_core2 = require("@aptos-labs/wallet-adapter-core");
|
|
238
240
|
// Annotate the CommonJS export names for ESM import in node:
|
|
239
241
|
0 && (module.exports = {
|
|
240
242
|
AptosWalletAdapterProvider,
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
// src/useWallet.tsx
|
|
2
|
-
import {
|
|
3
|
-
WalletReadyState,
|
|
4
|
-
NetworkName,
|
|
5
|
-
isInAppBrowser,
|
|
6
|
-
isRedirectable,
|
|
7
|
-
isMobile
|
|
8
|
-
} from "@aptos-labs/wallet-adapter-core";
|
|
9
2
|
import { createContext, useContext } from "react";
|
|
10
3
|
var DEFAULT_CONTEXT = {
|
|
11
4
|
connected: false
|
|
@@ -106,9 +99,9 @@ var AptosWalletAdapterProvider = ({
|
|
|
106
99
|
return Promise.reject(error);
|
|
107
100
|
}
|
|
108
101
|
};
|
|
109
|
-
const signAndSubmitTransaction = async (transaction
|
|
102
|
+
const signAndSubmitTransaction = async (transaction) => {
|
|
110
103
|
try {
|
|
111
|
-
return await walletCore.signAndSubmitTransaction(transaction
|
|
104
|
+
return await walletCore.signAndSubmitTransaction(transaction);
|
|
112
105
|
} catch (error) {
|
|
113
106
|
if (onError)
|
|
114
107
|
onError(error);
|
|
@@ -214,6 +207,15 @@ var AptosWalletAdapterProvider = ({
|
|
|
214
207
|
children
|
|
215
208
|
});
|
|
216
209
|
};
|
|
210
|
+
|
|
211
|
+
// src/index.tsx
|
|
212
|
+
import {
|
|
213
|
+
WalletReadyState,
|
|
214
|
+
NetworkName,
|
|
215
|
+
isInAppBrowser,
|
|
216
|
+
isMobile,
|
|
217
|
+
isRedirectable
|
|
218
|
+
} from "@aptos-labs/wallet-adapter-core";
|
|
217
219
|
export {
|
|
218
220
|
AptosWalletAdapterProvider,
|
|
219
221
|
NetworkName,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aptos-labs/wallet-adapter-react",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
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": "3.1.
|
|
40
|
+
"@aptos-labs/wallet-adapter-core": "3.1.1"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"react": "^18"
|
package/src/WalletProvider.tsx
CHANGED
|
@@ -131,11 +131,10 @@ export const AptosWalletAdapterProvider: FC<AptosWalletProviderProps> = ({
|
|
|
131
131
|
};
|
|
132
132
|
|
|
133
133
|
const signAndSubmitTransaction = async (
|
|
134
|
-
transaction: InputTransactionData
|
|
135
|
-
options?: InputGenerateTransactionOptions
|
|
134
|
+
transaction: InputTransactionData
|
|
136
135
|
) => {
|
|
137
136
|
try {
|
|
138
|
-
return await walletCore.signAndSubmitTransaction(transaction
|
|
137
|
+
return await walletCore.signAndSubmitTransaction(transaction);
|
|
139
138
|
} catch (error: any) {
|
|
140
139
|
if (onError) onError(error);
|
|
141
140
|
return Promise.reject(error);
|
package/src/index.tsx
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
export { useWallet } from "./useWallet";
|
|
3
|
+
export * from "./WalletProvider";
|
|
4
|
+
export type {
|
|
5
|
+
Wallet,
|
|
6
|
+
WalletName,
|
|
7
|
+
InputTransactionData,
|
|
8
|
+
} from "@aptos-labs/wallet-adapter-core";
|
|
9
|
+
|
|
2
10
|
export {
|
|
3
|
-
useWallet,
|
|
4
11
|
WalletReadyState,
|
|
5
12
|
NetworkName,
|
|
6
13
|
isInAppBrowser,
|
|
7
14
|
isMobile,
|
|
8
15
|
isRedirectable,
|
|
9
|
-
} from "
|
|
10
|
-
export type { Wallet, WalletName } from "./useWallet";
|
|
11
|
-
export * from "./WalletProvider";
|
|
16
|
+
} from "@aptos-labs/wallet-adapter-core";
|
package/src/useWallet.tsx
CHANGED
|
@@ -5,11 +5,6 @@ import {
|
|
|
5
5
|
SignMessagePayload,
|
|
6
6
|
SignMessageResponse,
|
|
7
7
|
Wallet,
|
|
8
|
-
WalletReadyState,
|
|
9
|
-
NetworkName,
|
|
10
|
-
isInAppBrowser,
|
|
11
|
-
isRedirectable,
|
|
12
|
-
isMobile,
|
|
13
8
|
InputGenerateTransactionOptions,
|
|
14
9
|
AnyRawTransaction,
|
|
15
10
|
InputTransactionData,
|
|
@@ -21,15 +16,6 @@ import {
|
|
|
21
16
|
} from "@aptos-labs/wallet-adapter-core";
|
|
22
17
|
import { createContext, useContext } from "react";
|
|
23
18
|
|
|
24
|
-
export type { Wallet, WalletName };
|
|
25
|
-
export {
|
|
26
|
-
WalletReadyState,
|
|
27
|
-
isInAppBrowser,
|
|
28
|
-
isRedirectable,
|
|
29
|
-
isMobile,
|
|
30
|
-
NetworkName,
|
|
31
|
-
};
|
|
32
|
-
|
|
33
19
|
export interface WalletContextState {
|
|
34
20
|
connected: boolean;
|
|
35
21
|
isLoading: boolean;
|
|
@@ -39,10 +25,7 @@ export interface WalletContextState {
|
|
|
39
25
|
disconnect(): void;
|
|
40
26
|
wallet: WalletInfo | null;
|
|
41
27
|
wallets: ReadonlyArray<Wallet>;
|
|
42
|
-
signAndSubmitTransaction(
|
|
43
|
-
transaction: InputTransactionData,
|
|
44
|
-
options?: InputGenerateTransactionOptions
|
|
45
|
-
): Promise<any>;
|
|
28
|
+
signAndSubmitTransaction(transaction: InputTransactionData): Promise<any>;
|
|
46
29
|
signTransaction(
|
|
47
30
|
transactionOrPayload: AnyRawTransaction | Types.TransactionPayload,
|
|
48
31
|
asFeePayer?: boolean,
|