@ensofinance/checkout-widget 0.0.1 → 0.0.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/package.json
CHANGED
|
@@ -706,13 +706,13 @@ const SignUserOpStep = ({
|
|
|
706
706
|
setUserOp: (userOp: any) => void;
|
|
707
707
|
}) => {
|
|
708
708
|
const { chainIdIn } = useAppDetails();
|
|
709
|
-
const {
|
|
709
|
+
const { routeLoading, usdAmountIn, routeData } = useRouteData();
|
|
710
710
|
const { signMessageAsync } = useSignMessage();
|
|
711
711
|
const { address } = useAccount();
|
|
712
712
|
const [isSigning, setIsSigning] = useState(false);
|
|
713
713
|
|
|
714
714
|
const handleSignUserOp = async () => {
|
|
715
|
-
if (!
|
|
715
|
+
if (!routeData || (routeData as any)?.error) {
|
|
716
716
|
console.error("No valid router data available");
|
|
717
717
|
return;
|
|
718
718
|
}
|
|
@@ -720,10 +720,10 @@ const SignUserOpStep = ({
|
|
|
720
720
|
try {
|
|
721
721
|
setIsSigning(true);
|
|
722
722
|
|
|
723
|
-
// Extract userOp from
|
|
724
|
-
const userOperation =
|
|
723
|
+
// Extract userOp from routeData
|
|
724
|
+
const userOperation = routeData?.userOp;
|
|
725
725
|
if (!userOperation) {
|
|
726
|
-
console.error("No userOperation found in
|
|
726
|
+
console.error("No userOperation found in routeData");
|
|
727
727
|
return;
|
|
728
728
|
}
|
|
729
729
|
|
|
@@ -772,8 +772,8 @@ const SignUserOpStep = ({
|
|
|
772
772
|
width={"100%"}
|
|
773
773
|
>
|
|
774
774
|
<Skeleton
|
|
775
|
-
loading={
|
|
776
|
-
width={
|
|
775
|
+
loading={routeLoading}
|
|
776
|
+
width={routeLoading ? "156px" : "auto"}
|
|
777
777
|
>
|
|
778
778
|
<Input
|
|
779
779
|
readOnly
|
|
@@ -791,12 +791,12 @@ const SignUserOpStep = ({
|
|
|
791
791
|
|
|
792
792
|
<Button
|
|
793
793
|
disabled={
|
|
794
|
-
!!(
|
|
794
|
+
!!(routeData as any)?.message || routeLoading || isSigning
|
|
795
795
|
}
|
|
796
|
-
loading={
|
|
796
|
+
loading={routeLoading || isSigning}
|
|
797
797
|
onClick={handleSignUserOp}
|
|
798
798
|
>
|
|
799
|
-
{
|
|
799
|
+
{routeLoading
|
|
800
800
|
? "Loading quote"
|
|
801
801
|
: isSigning
|
|
802
802
|
? "Signing..."
|