@aptos-labs/wallet-adapter-react 1.2.2 → 1.2.3
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 +8 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +6 -6
- package/dist/index.mjs +6 -6
- package/package.json +2 -2
- package/src/WalletProvider.tsx +12 -6
- package/src/useWallet.tsx +7 -6
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccountInfo, NetworkInfo, WalletName, WalletInfo, Wallet, SignMessagePayload, SignMessageResponse } from '@aptos-labs/wallet-adapter-core';
|
|
1
|
+
import { AccountInfo, NetworkInfo, WalletName, WalletInfo, Wallet, TransactionOptions, SignMessagePayload, SignMessageResponse } from '@aptos-labs/wallet-adapter-core';
|
|
2
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';
|
|
@@ -12,9 +12,9 @@ interface WalletContextState {
|
|
|
12
12
|
disconnect(): void;
|
|
13
13
|
wallet: WalletInfo | null;
|
|
14
14
|
wallets: ReadonlyArray<Wallet>;
|
|
15
|
-
signAndSubmitTransaction<T extends Types.TransactionPayload
|
|
16
|
-
signAndSubmitBCSTransaction<T extends TxnBuilderTypes.TransactionPayload
|
|
17
|
-
signTransaction<T extends Types.TransactionPayload
|
|
15
|
+
signAndSubmitTransaction<T extends Types.TransactionPayload>(transaction: T, options?: TransactionOptions): Promise<any>;
|
|
16
|
+
signAndSubmitBCSTransaction<T extends TxnBuilderTypes.TransactionPayload>(transaction: T, options?: TransactionOptions): Promise<any>;
|
|
17
|
+
signTransaction<T extends Types.TransactionPayload>(transaction: T, options?: TransactionOptions): Promise<any>;
|
|
18
18
|
signMessage(message: SignMessagePayload): Promise<SignMessageResponse | null>;
|
|
19
19
|
signMessageAndVerify(message: SignMessagePayload): Promise<boolean>;
|
|
20
20
|
}
|
package/dist/index.js
CHANGED
|
@@ -86,23 +86,23 @@ var AptosWalletAdapterProvider = ({
|
|
|
86
86
|
console.log("disconnect error", e);
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
|
-
const signAndSubmitTransaction = async (transaction) => {
|
|
89
|
+
const signAndSubmitTransaction = async (transaction, options) => {
|
|
90
90
|
try {
|
|
91
|
-
return await walletCore.signAndSubmitTransaction(transaction);
|
|
91
|
+
return await walletCore.signAndSubmitTransaction(transaction, options);
|
|
92
92
|
} catch (error) {
|
|
93
93
|
throw error;
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
|
-
const signAndSubmitBCSTransaction = async (transaction) => {
|
|
96
|
+
const signAndSubmitBCSTransaction = async (transaction, options) => {
|
|
97
97
|
try {
|
|
98
|
-
return await walletCore.signAndSubmitBCSTransaction(transaction);
|
|
98
|
+
return await walletCore.signAndSubmitBCSTransaction(transaction, options);
|
|
99
99
|
} catch (error) {
|
|
100
100
|
throw error;
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
|
-
const signTransaction = async (transaction) => {
|
|
103
|
+
const signTransaction = async (transaction, options) => {
|
|
104
104
|
try {
|
|
105
|
-
return await walletCore.signTransaction(transaction);
|
|
105
|
+
return await walletCore.signTransaction(transaction, options);
|
|
106
106
|
} catch (error) {
|
|
107
107
|
throw error;
|
|
108
108
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -65,23 +65,23 @@ var AptosWalletAdapterProvider = ({
|
|
|
65
65
|
console.log("disconnect error", e);
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
|
-
const signAndSubmitTransaction = async (transaction) => {
|
|
68
|
+
const signAndSubmitTransaction = async (transaction, options) => {
|
|
69
69
|
try {
|
|
70
|
-
return await walletCore.signAndSubmitTransaction(transaction);
|
|
70
|
+
return await walletCore.signAndSubmitTransaction(transaction, options);
|
|
71
71
|
} catch (error) {
|
|
72
72
|
throw error;
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
|
-
const signAndSubmitBCSTransaction = async (transaction) => {
|
|
75
|
+
const signAndSubmitBCSTransaction = async (transaction, options) => {
|
|
76
76
|
try {
|
|
77
|
-
return await walletCore.signAndSubmitBCSTransaction(transaction);
|
|
77
|
+
return await walletCore.signAndSubmitBCSTransaction(transaction, options);
|
|
78
78
|
} catch (error) {
|
|
79
79
|
throw error;
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
-
const signTransaction = async (transaction) => {
|
|
82
|
+
const signTransaction = async (transaction, options) => {
|
|
83
83
|
try {
|
|
84
|
-
return await walletCore.signTransaction(transaction);
|
|
84
|
+
return await walletCore.signTransaction(transaction, options);
|
|
85
85
|
} catch (error) {
|
|
86
86
|
throw error;
|
|
87
87
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aptos-labs/wallet-adapter-react",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
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.3.
|
|
40
|
+
"@aptos-labs/wallet-adapter-core": "2.3.3",
|
|
41
41
|
"aptos": "^1.3.17",
|
|
42
42
|
"react": "^18"
|
|
43
43
|
},
|
package/src/WalletProvider.tsx
CHANGED
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
Wallet,
|
|
15
15
|
WalletInfo,
|
|
16
16
|
WalletName,
|
|
17
|
+
TransactionOptions,
|
|
17
18
|
} from "@aptos-labs/wallet-adapter-core";
|
|
18
19
|
import { WalletCore } from "@aptos-labs/wallet-adapter-core";
|
|
19
20
|
|
|
@@ -75,28 +76,33 @@ export const AptosWalletAdapterProvider: FC<AptosWalletProviderProps> = ({
|
|
|
75
76
|
};
|
|
76
77
|
|
|
77
78
|
const signAndSubmitTransaction = async (
|
|
78
|
-
transaction: Types.TransactionPayload
|
|
79
|
+
transaction: Types.TransactionPayload,
|
|
80
|
+
options?: TransactionOptions
|
|
79
81
|
) => {
|
|
80
82
|
try {
|
|
81
|
-
return await walletCore.signAndSubmitTransaction(transaction);
|
|
83
|
+
return await walletCore.signAndSubmitTransaction(transaction, options);
|
|
82
84
|
} catch (error: any) {
|
|
83
85
|
throw error;
|
|
84
86
|
}
|
|
85
87
|
};
|
|
86
88
|
|
|
87
89
|
const signAndSubmitBCSTransaction = async (
|
|
88
|
-
transaction: TxnBuilderTypes.TransactionPayload
|
|
90
|
+
transaction: TxnBuilderTypes.TransactionPayload,
|
|
91
|
+
options?: TransactionOptions
|
|
89
92
|
) => {
|
|
90
93
|
try {
|
|
91
|
-
return await walletCore.signAndSubmitBCSTransaction(transaction);
|
|
94
|
+
return await walletCore.signAndSubmitBCSTransaction(transaction, options);
|
|
92
95
|
} catch (error: any) {
|
|
93
96
|
throw error;
|
|
94
97
|
}
|
|
95
98
|
};
|
|
96
99
|
|
|
97
|
-
const signTransaction = async (
|
|
100
|
+
const signTransaction = async (
|
|
101
|
+
transaction: Types.TransactionPayload,
|
|
102
|
+
options?: TransactionOptions
|
|
103
|
+
) => {
|
|
98
104
|
try {
|
|
99
|
-
return await walletCore.signTransaction(transaction);
|
|
105
|
+
return await walletCore.signTransaction(transaction, options);
|
|
100
106
|
} catch (error: any) {
|
|
101
107
|
throw error;
|
|
102
108
|
}
|
package/src/useWallet.tsx
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
isInAppBrowser,
|
|
12
12
|
isRedirectable,
|
|
13
13
|
isMobile,
|
|
14
|
+
TransactionOptions,
|
|
14
15
|
} from "@aptos-labs/wallet-adapter-core";
|
|
15
16
|
import { createContext, useContext } from "react";
|
|
16
17
|
import { TxnBuilderTypes, Types } from "aptos";
|
|
@@ -33,17 +34,17 @@ export interface WalletContextState {
|
|
|
33
34
|
disconnect(): void;
|
|
34
35
|
wallet: WalletInfo | null;
|
|
35
36
|
wallets: ReadonlyArray<Wallet>;
|
|
36
|
-
signAndSubmitTransaction<T extends Types.TransactionPayload
|
|
37
|
+
signAndSubmitTransaction<T extends Types.TransactionPayload>(
|
|
37
38
|
transaction: T,
|
|
38
|
-
options?:
|
|
39
|
+
options?: TransactionOptions
|
|
39
40
|
): Promise<any>;
|
|
40
|
-
signAndSubmitBCSTransaction<T extends TxnBuilderTypes.TransactionPayload
|
|
41
|
+
signAndSubmitBCSTransaction<T extends TxnBuilderTypes.TransactionPayload>(
|
|
41
42
|
transaction: T,
|
|
42
|
-
options?:
|
|
43
|
+
options?: TransactionOptions
|
|
43
44
|
): Promise<any>;
|
|
44
|
-
signTransaction<T extends Types.TransactionPayload
|
|
45
|
+
signTransaction<T extends Types.TransactionPayload>(
|
|
45
46
|
transaction: T,
|
|
46
|
-
options?:
|
|
47
|
+
options?: TransactionOptions
|
|
47
48
|
): Promise<any>;
|
|
48
49
|
signMessage(message: SignMessagePayload): Promise<SignMessageResponse | null>;
|
|
49
50
|
signMessageAndVerify(message: SignMessagePayload): Promise<boolean>;
|