@aptos-labs/wallet-adapter-react 1.0.4 → 1.0.6

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,18 @@
1
1
  # @aptos-labs/wallet-adapter-react
2
2
 
3
+ ## 1.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [814939c]
8
+ - @aptos-labs/wallet-adapter-core@2.2.0
9
+
10
+ ## 1.0.5
11
+
12
+ ### Patch Changes
13
+
14
+ - 56a3f9f: BCS transaction support in react provider package
15
+
3
16
  ## 1.0.4
4
17
 
5
18
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
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
+ import { Types, TxnBuilderTypes } from 'aptos';
4
4
  import { ReactNode, FC } from 'react';
5
5
 
6
6
  interface WalletContextState {
@@ -13,6 +13,7 @@ interface WalletContextState {
13
13
  wallet: WalletInfo | null;
14
14
  wallets: Wallet[];
15
15
  signAndSubmitTransaction<T extends Types.TransactionPayload, V>(transaction: T, options?: V): Promise<any>;
16
+ signAndSubmitBCSTransaction<T extends TxnBuilderTypes.TransactionPayload, V>(transaction: T, options?: V): Promise<any>;
16
17
  signTransaction<T extends Types.TransactionPayload, V>(transaction: T, options?: V): Promise<any>;
17
18
  signMessage(message: SignMessagePayload): Promise<SignMessageResponse | null>;
18
19
  signMessageAndVerify(message: SignMessagePayload): Promise<boolean>;
package/dist/index.js CHANGED
@@ -87,6 +87,13 @@ var AptosWalletAdapterProvider = ({
87
87
  throw error;
88
88
  }
89
89
  };
90
+ const signAndSubmitBCSTransaction = async (transaction) => {
91
+ try {
92
+ return await walletCore.signAndSubmitBCSTransaction(transaction);
93
+ } catch (error) {
94
+ throw error;
95
+ }
96
+ };
90
97
  const signTransaction = async (transaction) => {
91
98
  try {
92
99
  return await walletCore.signTransaction(transaction);
@@ -196,6 +203,7 @@ var AptosWalletAdapterProvider = ({
196
203
  wallet,
197
204
  wallets,
198
205
  signAndSubmitTransaction,
206
+ signAndSubmitBCSTransaction,
199
207
  signTransaction,
200
208
  signMessage,
201
209
  signMessageAndVerify,
package/dist/index.mjs CHANGED
@@ -66,6 +66,13 @@ var AptosWalletAdapterProvider = ({
66
66
  throw error;
67
67
  }
68
68
  };
69
+ const signAndSubmitBCSTransaction = async (transaction) => {
70
+ try {
71
+ return await walletCore.signAndSubmitBCSTransaction(transaction);
72
+ } catch (error) {
73
+ throw error;
74
+ }
75
+ };
69
76
  const signTransaction = async (transaction) => {
70
77
  try {
71
78
  return await walletCore.signTransaction(transaction);
@@ -175,6 +182,7 @@ var AptosWalletAdapterProvider = ({
175
182
  wallet,
176
183
  wallets,
177
184
  signAndSubmitTransaction,
185
+ signAndSubmitBCSTransaction,
178
186
  signTransaction,
179
187
  signMessage,
180
188
  signMessageAndVerify,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptos-labs/wallet-adapter-react",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
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.1.0",
40
+ "@aptos-labs/wallet-adapter-core": "2.2.0",
41
41
  "aptos": "^1.3.17",
42
42
  "react": "^18"
43
43
  },
@@ -17,7 +17,7 @@ import type {
17
17
  } from "@aptos-labs/wallet-adapter-core";
18
18
  import { WalletCore } from "@aptos-labs/wallet-adapter-core";
19
19
 
20
- import { Types } from "aptos";
20
+ import { TxnBuilderTypes, Types } from "aptos";
21
21
 
22
22
  export interface AptosWalletProviderProps {
23
23
  children: ReactNode;
@@ -79,6 +79,16 @@ export const AptosWalletAdapterProvider: FC<AptosWalletProviderProps> = ({
79
79
  }
80
80
  };
81
81
 
82
+ const signAndSubmitBCSTransaction = async (
83
+ transaction: TxnBuilderTypes.TransactionPayload
84
+ ) => {
85
+ try {
86
+ return await walletCore.signAndSubmitBCSTransaction(transaction);
87
+ } catch (error: any) {
88
+ throw error;
89
+ }
90
+ };
91
+
82
92
  const signTransaction = async (transaction: Types.TransactionPayload) => {
83
93
  try {
84
94
  return await walletCore.signTransaction(transaction);
@@ -202,6 +212,7 @@ export const AptosWalletAdapterProvider: FC<AptosWalletProviderProps> = ({
202
212
  wallet,
203
213
  wallets,
204
214
  signAndSubmitTransaction,
215
+ signAndSubmitBCSTransaction,
205
216
  signTransaction,
206
217
  signMessage,
207
218
  signMessageAndVerify,
package/src/useWallet.tsx CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  NetworkName,
11
11
  } from "@aptos-labs/wallet-adapter-core";
12
12
  import { createContext, useContext } from "react";
13
- import { Types } from "aptos";
13
+ import { TxnBuilderTypes, Types } from "aptos";
14
14
 
15
15
  export type { WalletName };
16
16
  export { WalletReadyState, NetworkName };
@@ -28,6 +28,10 @@ export interface WalletContextState {
28
28
  transaction: T,
29
29
  options?: V
30
30
  ): Promise<any>;
31
+ signAndSubmitBCSTransaction<T extends TxnBuilderTypes.TransactionPayload, V>(
32
+ transaction: T,
33
+ options?: V
34
+ ): Promise<any>;
31
35
  signTransaction<T extends Types.TransactionPayload, V>(
32
36
  transaction: T,
33
37
  options?: V