Skip to content

Commit 33b1660

Browse files
Guillermo Alejandro Gallardo DiezGuillermo Alejandro Gallardo Diez
Guillermo Alejandro Gallardo Diez
authored and
Guillermo Alejandro Gallardo Diez
committed
fix: signandsendtxs hook returns results
1 parent d7ef3e3 commit 33b1660

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/react-hook/src/lib/WalletSelectorProvider.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,18 @@ export function WalletSelectorProvider({
237237
* @returns {Promise<Transaction[]>} - the resulting transactions
238238
*/
239239
const signAndSendTransactions = useCallback(
240-
({ transactions }: { transactions: Array<Transaction> }) => {
240+
async ({ transactions }: { transactions: Array<Transaction> }) => {
241241
if (!wallet) {
242242
throw new WalletError("No wallet connected");
243243
}
244244

245-
return wallet.signAndSendTransactions({ transactions });
245+
const sentTxs = (await wallet.signAndSendTransactions({
246+
transactions,
247+
})) as Array<FinalExecutionOutcome>;
248+
249+
return sentTxs.map((tx: FinalExecutionOutcome) =>
250+
providers.getTransactionLastResult(tx)
251+
);
246252
},
247253
[wallet]
248254
);

0 commit comments

Comments
 (0)