Compare commits

...
Author SHA1 Message Date
Joaquim VergesGitHubgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
dffa457a39 Version Packages (#8498)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-03 19:50:37 -08:00
Joaquim VergesandGitHub 859032dc17 [SDK] Skip swap review step when coming from swap widget (#8496) 2025-12-03 19:23:42 -08:00
9 changed files with 30 additions and 70 deletions
+8
View File
@@ -1,5 +1,13 @@
# wagmi-inapp
## 0.0.41
### Patch Changes
- Updated dependencies [[`859032d`](https://github.com/thirdweb-dev/js/commit/859032dc1761afdb7a4e12b40534e3a98b771498)]:
- thirdweb@5.115.2
- @thirdweb-dev/wagmi-adapter@0.2.196
## 0.0.40
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "wagmi-inapp",
"private": true,
"version": "0.0.40",
"version": "0.0.41",
"type": "module",
"scripts": {
"dev": "vite",
+7
View File
@@ -1,5 +1,12 @@
# @thirdweb-dev/nebula
## 0.2.99
### Patch Changes
- Updated dependencies [[`859032d`](https://github.com/thirdweb-dev/js/commit/859032dc1761afdb7a4e12b40534e3a98b771498)]:
- thirdweb@5.115.2
## 0.2.98
### Patch Changes
+1 -1
View File
@@ -57,5 +57,5 @@
"type": "module",
"types": "./dist/types/exports/thirdweb.d.ts",
"typings": "./dist/types/exports/thirdweb.d.ts",
"version": "0.2.98"
"version": "0.2.99"
}
+6
View File
@@ -1,5 +1,11 @@
# thirdweb
## 5.115.2
### Patch Changes
- [#8496](https://github.com/thirdweb-dev/js/pull/8496) [`859032d`](https://github.com/thirdweb-dev/js/commit/859032dc1761afdb7a4e12b40534e3a98b771498) Thanks [@joaquim-verges](https://github.com/joaquim-verges)! - Skip swap review step when coming from swap widget
## 5.115.1
### Patch Changes
+1 -1
View File
@@ -430,5 +430,5 @@
}
},
"typings": "./dist/types/exports/thirdweb.d.ts",
"version": "5.115.1"
"version": "5.115.2"
}
@@ -1,6 +1,6 @@
"use client";
import { useCallback, useEffect, useRef, useState } from "react";
import { useEffect, useRef, useState } from "react";
import { trackPayEvent } from "../../../../../analytics/track/pay.js";
import type { Buy, Sell } from "../../../../../bridge/index.js";
import type { TokenWithPrices } from "../../../../../bridge/types/Token.js";
@@ -16,7 +16,6 @@ import { webWindowAdapter } from "../../../adapters/WindowAdapter.js";
import { EmbedContainer } from "../../ConnectWallet/Modal/ConnectEmbed.js";
import { DynamicHeight } from "../../components/DynamicHeight.js";
import { ErrorBanner } from "../ErrorBanner.js";
import { PaymentDetails } from "../payment-details/PaymentDetails.js";
import { SuccessScreen } from "../payment-success/SuccessScreen.js";
import { StepRunner } from "../StepRunner.js";
import { useActiveWalletInfo } from "./hooks.js";
@@ -364,19 +363,6 @@ function SwapWidgetContent(
// preload requests
useBridgeChains(props.client);
const handleError = useCallback(
(error: Error, quote: SwapPreparedQuote) => {
console.error(error);
props.onError?.(error, quote);
setScreen({
id: "error",
preparedQuote: quote,
error,
});
},
[props.onError],
);
// if wallet suddenly disconnects, show screen 1
if (screen.id === "1:swap-ui" || !activeWalletInfo) {
return (
@@ -399,19 +385,8 @@ function SwapWidgetContent(
amountSelection={amountSelection}
setAmountSelection={setAmountSelection}
onSwap={(data) => {
trackPayEvent({
chainId: data.result.intent.originChainId,
client: props.client,
event: "payment_details",
fromToken: data.result.intent.originTokenAddress,
toChainId: data.result.intent.destinationChainId,
toToken: data.result.intent.destinationTokenAddress,
walletAddress:
activeWalletInfo?.activeWallet?.getAccount()?.address,
walletType: activeWalletInfo?.activeWallet?.id,
});
setScreen({
id: "2:preview",
id: "3:execute",
buyToken: data.buyToken,
sellToken: data.sellToken,
sellTokenBalance: data.sellTokenBalance,
@@ -425,43 +400,6 @@ function SwapWidgetContent(
);
}
if (screen.id === "2:preview") {
return (
<PaymentDetails
metadata={{
title: "Review Swap",
description: undefined,
}}
confirmButtonLabel="Swap"
client={props.client}
onBack={() => {
setScreen({ id: "1:swap-ui" });
}}
onConfirm={() => {
setScreen({
...screen,
id: "3:execute",
});
}}
onError={(error) => handleError(error, screen.preparedQuote)}
paymentMethod={{
quote: screen.quote,
type: "wallet",
payerWallet: activeWalletInfo.activeWallet,
balance: screen.sellTokenBalance,
originToken: screen.sellToken,
action: screen.mode,
hasEnoughBalance: true,
}}
preparedQuote={screen.preparedQuote}
currency={props.currency}
modeInfo={{
mode: "fund_wallet",
}}
/>
);
}
if (screen.id === "3:execute") {
return (
<StepRunner
@@ -472,8 +410,7 @@ function SwapWidgetContent(
onBack={() => {
setScreen({
...screen,
id: "2:preview",
sellTokenBalance: screen.sellTokenBalance,
id: "1:swap-ui",
});
}}
onCancel={() => props.onCancel?.(screen.preparedQuote)}
+2
View File
@@ -1,5 +1,7 @@
# @thirdweb-dev/wagmi-adapter
## 0.2.196
## 0.2.195
## 0.2.194
+1 -1
View File
@@ -56,5 +56,5 @@
"type": "module",
"types": "./dist/types/exports/thirdweb.d.ts",
"typings": "./dist/types/exports/thirdweb.d.ts",
"version": "0.2.195"
"version": "0.2.196"
}