@b3dotfun/sdk 0.1.69-alpha.7 → 0.1.69-alpha.8
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/dist/cjs/anyspend/react/components/AnySpendStakeB3.js +1 -1
- package/dist/cjs/anyspend/react/components/AnySpendStakeB3ExactIn.js +1 -1
- package/dist/cjs/anyspend/react/components/checkout/CheckoutSuccess.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/checkout/CheckoutSuccess.js +5 -3
- package/dist/esm/anyspend/react/components/AnySpendStakeB3.js +2 -2
- package/dist/esm/anyspend/react/components/AnySpendStakeB3ExactIn.js +2 -2
- package/dist/esm/anyspend/react/components/checkout/CheckoutSuccess.d.ts +2 -1
- package/dist/esm/anyspend/react/components/checkout/CheckoutSuccess.js +5 -3
- package/dist/types/anyspend/react/components/checkout/CheckoutSuccess.d.ts +2 -1
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpendStakeB3.tsx +2 -2
- package/src/anyspend/react/components/AnySpendStakeB3ExactIn.tsx +2 -2
- package/src/anyspend/react/components/checkout/CheckoutSuccess.tsx +13 -3
|
@@ -268,7 +268,7 @@ function AnySpendStakeB3({ loadOrder, mode = "modal", recipientAddress, stakeAmo
|
|
|
268
268
|
opacity: hasMounted ? 1 : 0,
|
|
269
269
|
y: hasMounted ? 0 : 20,
|
|
270
270
|
filter: hasMounted ? "blur(0px)" : "blur(10px)",
|
|
271
|
-
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "bg-b3-react-background w-full p-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "mb-6", children: (0, jsx_runtime_1.jsx)("a", { href:
|
|
271
|
+
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "bg-b3-react-background w-full p-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "mb-6", children: (0, jsx_runtime_1.jsx)("a", { href: (0, anyspend_1.getExplorerTxUrl)(chains_1.base.id, stakingTxHash), target: "_blank", rel: "noopener noreferrer", className: "text-as-primary/70 hover:text-as-primary block break-all text-center font-mono text-sm underline transition-colors", children: "View transaction" }) }), (0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => {
|
|
272
272
|
setB3ModalOpen(false);
|
|
273
273
|
onSuccess?.();
|
|
274
274
|
}, className: "bg-as-brand hover:bg-as-brand/90 text-as-primary h-14 w-full rounded-xl text-lg font-medium", children: "Done" })] })] }) }));
|
|
@@ -278,7 +278,7 @@ function AnySpendStakeB3ExactIn({ loadOrder, mode = "modal", sourceTokenAddress,
|
|
|
278
278
|
opacity: hasMounted ? 1 : 0,
|
|
279
279
|
y: hasMounted ? 0 : 20,
|
|
280
280
|
filter: hasMounted ? "blur(0px)" : "blur(10px)",
|
|
281
|
-
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "bg-b3-react-background w-full p-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "mb-6", children: (0, jsx_runtime_1.jsx)("a", { href:
|
|
281
|
+
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "bg-b3-react-background w-full p-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "mb-6", children: (0, jsx_runtime_1.jsx)("a", { href: (0, anyspend_1.getExplorerTxUrl)(chains_1.base.id, stakingTxHash), target: "_blank", rel: "noopener noreferrer", className: "text-as-primary/70 hover:text-as-primary block break-all text-center font-mono text-sm underline transition-colors", children: "View transaction" }) }), (0, jsx_runtime_1.jsx)(react_1.Button, { onClick: () => {
|
|
282
282
|
setB3ModalOpen(false);
|
|
283
283
|
onSuccess?.((0, number_1.formatTokenAmount)(BigInt(userStakeAmount), 18) ?? "");
|
|
284
284
|
}, className: "bg-as-brand hover:bg-as-brand/90 text-as-primary h-14 w-full rounded-xl text-lg font-medium", children: "Done" })] })] }) }));
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { AnySpendCheckoutClasses } from "./AnySpendCheckout";
|
|
2
2
|
interface CheckoutSuccessProps {
|
|
3
3
|
txHash?: string;
|
|
4
|
+
dstChainId?: number;
|
|
4
5
|
orderId?: string;
|
|
5
6
|
returnUrl?: string;
|
|
6
7
|
returnLabel?: string;
|
|
7
8
|
classes?: AnySpendCheckoutClasses;
|
|
8
9
|
}
|
|
9
|
-
export declare function CheckoutSuccess({ txHash, orderId, returnUrl, returnLabel, classes }: CheckoutSuccessProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function CheckoutSuccess({ txHash, dstChainId, orderId, returnUrl, returnLabel, classes, }: CheckoutSuccessProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.CheckoutSuccess = CheckoutSuccess;
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const anyspend_1 = require("../../../../anyspend");
|
|
7
|
+
const chains_1 = require("viem/chains");
|
|
6
8
|
const cn_1 = require("../../../../shared/utils/cn");
|
|
7
9
|
const lucide_react_1 = require("lucide-react");
|
|
8
10
|
const react_1 = require("motion/react");
|
|
9
11
|
const AnySpendCustomizationContext_1 = require("../context/AnySpendCustomizationContext");
|
|
10
12
|
const AnimatedCheckmark_1 = require("../icons/AnimatedCheckmark");
|
|
11
|
-
function CheckoutSuccess({ txHash, orderId, returnUrl, returnLabel, classes }) {
|
|
13
|
+
function CheckoutSuccess({ txHash, dstChainId, orderId, returnUrl, returnLabel, classes, }) {
|
|
12
14
|
const { content, slots } = (0, AnySpendCustomizationContext_1.useAnySpendCustomization)();
|
|
13
15
|
if (slots.successScreen) {
|
|
14
16
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: slots.successScreen({
|
|
@@ -18,7 +20,7 @@ function CheckoutSuccess({ txHash, orderId, returnUrl, returnLabel, classes }) {
|
|
|
18
20
|
: "Your payment has been processed successfully.",
|
|
19
21
|
txHash,
|
|
20
22
|
orderId,
|
|
21
|
-
explorerUrl: txHash ?
|
|
23
|
+
explorerUrl: txHash ? (0, anyspend_1.getExplorerTxUrl)(dstChainId ?? chains_1.b3.id, txHash) : undefined,
|
|
22
24
|
onDone: () => {
|
|
23
25
|
if (returnUrl)
|
|
24
26
|
window.location.href = returnUrl;
|
|
@@ -27,5 +29,5 @@ function CheckoutSuccess({ txHash, orderId, returnUrl, returnLabel, classes }) {
|
|
|
27
29
|
returnLabel: content.returnButtonLabel || returnLabel,
|
|
28
30
|
}) }));
|
|
29
31
|
}
|
|
30
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("anyspend-checkout-success flex flex-col items-center py-8 text-center", classes?.successPanel), children: [(0, jsx_runtime_1.jsx)("div", { className: "anyspend-success-icon mb-4", children: (0, jsx_runtime_1.jsx)(AnimatedCheckmark_1.AnimatedCheckmark, { className: "h-16 w-16" }) }), (0, jsx_runtime_1.jsx)(react_1.motion.h2, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.0, ease: "easeOut" }, className: "anyspend-success-title text-xl font-semibold text-gray-900 dark:text-gray-100", children: content.successTitle || "Payment Successful" }), (0, jsx_runtime_1.jsx)(react_1.motion.p, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.15, ease: "easeOut" }, className: "anyspend-success-description mt-2 text-sm text-gray-500 dark:text-gray-400", children: content.successDescription || "Your payment has been processed successfully." }), txHash && ((0, jsx_runtime_1.jsxs)(react_1.motion.a, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, delay: 0.5, ease: "easeOut" }, href:
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("anyspend-checkout-success flex flex-col items-center py-8 text-center", classes?.successPanel), children: [(0, jsx_runtime_1.jsx)("div", { className: "anyspend-success-icon mb-4", children: (0, jsx_runtime_1.jsx)(AnimatedCheckmark_1.AnimatedCheckmark, { className: "h-16 w-16" }) }), (0, jsx_runtime_1.jsx)(react_1.motion.h2, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.0, ease: "easeOut" }, className: "anyspend-success-title text-xl font-semibold text-gray-900 dark:text-gray-100", children: content.successTitle || "Payment Successful" }), (0, jsx_runtime_1.jsx)(react_1.motion.p, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.15, ease: "easeOut" }, className: "anyspend-success-description mt-2 text-sm text-gray-500 dark:text-gray-400", children: content.successDescription || "Your payment has been processed successfully." }), txHash && ((0, jsx_runtime_1.jsxs)(react_1.motion.a, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, delay: 0.5, ease: "easeOut" }, href: (0, anyspend_1.getExplorerTxUrl)(dstChainId ?? chains_1.b3.id, txHash), target: "_blank", rel: "noopener noreferrer", className: "anyspend-success-tx-link mt-4 flex items-center gap-1.5 text-sm text-blue-600 hover:underline dark:text-blue-400", children: ["View Transaction", (0, jsx_runtime_1.jsx)(lucide_react_1.ExternalLink, { className: "h-3.5 w-3.5" })] })), !txHash && orderId && ((0, jsx_runtime_1.jsxs)(react_1.motion.p, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, delay: 0.5, ease: "easeOut" }, className: "anyspend-success-order-id mt-4 text-xs text-gray-400 dark:text-gray-500", children: ["Order ID: ", orderId] })), returnUrl && ((0, jsx_runtime_1.jsx)(react_1.motion.a, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 0.6, ease: "easeOut" }, href: returnUrl, className: (0, cn_1.cn)("anyspend-success-return-btn mt-6 inline-flex rounded-xl px-6 py-3 text-sm font-medium transition-colors", classes?.returnButton), style: { backgroundColor: "#111827", color: "#fff" }, children: content.returnButtonLabel || returnLabel || "Return to Store" }))] }));
|
|
31
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { ABI_ERC20_STAKING, B3_TOKEN, eqci } from "../../../anyspend/index.js";
|
|
2
|
+
import { ABI_ERC20_STAKING, B3_TOKEN, eqci, getExplorerTxUrl } from "../../../anyspend/index.js";
|
|
3
3
|
import { Button, GlareCardRounded, Input, StyleRoot, TextLoop, toast, useHasMounted, useModalStore, useSimBalance, useUnifiedChainSwitchAndExecute, } from "../../../global-account/react/index.js";
|
|
4
4
|
import { PUBLIC_BASE_RPC_URL } from "../../../shared/constants/index.js";
|
|
5
5
|
import { formatTokenAmount } from "../../../shared/utils/number.js";
|
|
@@ -262,7 +262,7 @@ export function AnySpendStakeB3({ loadOrder, mode = "modal", recipientAddress, s
|
|
|
262
262
|
opacity: hasMounted ? 1 : 0,
|
|
263
263
|
y: hasMounted ? 0 : 20,
|
|
264
264
|
filter: hasMounted ? "blur(0px)" : "blur(10px)",
|
|
265
|
-
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "bg-b3-react-background w-full p-6", children: [_jsx("div", { className: "mb-6", children: _jsx("a", { href:
|
|
265
|
+
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "bg-b3-react-background w-full p-6", children: [_jsx("div", { className: "mb-6", children: _jsx("a", { href: getExplorerTxUrl(base.id, stakingTxHash), target: "_blank", rel: "noopener noreferrer", className: "text-as-primary/70 hover:text-as-primary block break-all text-center font-mono text-sm underline transition-colors", children: "View transaction" }) }), _jsx(Button, { onClick: () => {
|
|
266
266
|
setB3ModalOpen(false);
|
|
267
267
|
onSuccess?.();
|
|
268
268
|
}, className: "bg-as-brand hover:bg-as-brand/90 text-as-primary h-14 w-full rounded-xl text-lg font-medium", children: "Done" })] })] }) }));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { ABI_ERC20_STAKING, B3_TOKEN, eqci } from "../../../anyspend/index.js";
|
|
2
|
+
import { ABI_ERC20_STAKING, B3_TOKEN, eqci, getExplorerTxUrl } from "../../../anyspend/index.js";
|
|
3
3
|
import { normalizeAddress } from "../../../anyspend/utils/index.js";
|
|
4
4
|
import { Button, GlareCardRounded, Input, StyleRoot, TextLoop, toast, useHasMounted, useModalStore, useSimBalance, useUnifiedChainSwitchAndExecute, } from "../../../global-account/react/index.js";
|
|
5
5
|
import { PUBLIC_BASE_RPC_URL } from "../../../shared/constants/index.js";
|
|
@@ -275,7 +275,7 @@ export function AnySpendStakeB3ExactIn({ loadOrder, mode = "modal", sourceTokenA
|
|
|
275
275
|
opacity: hasMounted ? 1 : 0,
|
|
276
276
|
y: hasMounted ? 0 : 20,
|
|
277
277
|
filter: hasMounted ? "blur(0px)" : "blur(10px)",
|
|
278
|
-
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "bg-b3-react-background w-full p-6", children: [_jsx("div", { className: "mb-6", children: _jsx("a", { href:
|
|
278
|
+
}, transition: { duration: 0.3, delay: 0.2, ease: "easeInOut" }, className: "bg-b3-react-background w-full p-6", children: [_jsx("div", { className: "mb-6", children: _jsx("a", { href: getExplorerTxUrl(base.id, stakingTxHash), target: "_blank", rel: "noopener noreferrer", className: "text-as-primary/70 hover:text-as-primary block break-all text-center font-mono text-sm underline transition-colors", children: "View transaction" }) }), _jsx(Button, { onClick: () => {
|
|
279
279
|
setB3ModalOpen(false);
|
|
280
280
|
onSuccess?.(formatTokenAmount(BigInt(userStakeAmount), 18) ?? "");
|
|
281
281
|
}, className: "bg-as-brand hover:bg-as-brand/90 text-as-primary h-14 w-full rounded-xl text-lg font-medium", children: "Done" })] })] }) }));
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { AnySpendCheckoutClasses } from "./AnySpendCheckout";
|
|
2
2
|
interface CheckoutSuccessProps {
|
|
3
3
|
txHash?: string;
|
|
4
|
+
dstChainId?: number;
|
|
4
5
|
orderId?: string;
|
|
5
6
|
returnUrl?: string;
|
|
6
7
|
returnLabel?: string;
|
|
7
8
|
classes?: AnySpendCheckoutClasses;
|
|
8
9
|
}
|
|
9
|
-
export declare function CheckoutSuccess({ txHash, orderId, returnUrl, returnLabel, classes }: CheckoutSuccessProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function CheckoutSuccess({ txHash, dstChainId, orderId, returnUrl, returnLabel, classes, }: CheckoutSuccessProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { getExplorerTxUrl } from "../../../../anyspend/index.js";
|
|
4
|
+
import { b3 } from "viem/chains";
|
|
3
5
|
import { cn } from "../../../../shared/utils/cn.js";
|
|
4
6
|
import { ExternalLink } from "lucide-react";
|
|
5
7
|
import { motion } from "motion/react";
|
|
6
8
|
import { useAnySpendCustomization } from "../context/AnySpendCustomizationContext.js";
|
|
7
9
|
import { AnimatedCheckmark } from "../icons/AnimatedCheckmark.js";
|
|
8
|
-
export function CheckoutSuccess({ txHash, orderId, returnUrl, returnLabel, classes }) {
|
|
10
|
+
export function CheckoutSuccess({ txHash, dstChainId, orderId, returnUrl, returnLabel, classes, }) {
|
|
9
11
|
const { content, slots } = useAnySpendCustomization();
|
|
10
12
|
if (slots.successScreen) {
|
|
11
13
|
return (_jsx(_Fragment, { children: slots.successScreen({
|
|
@@ -15,7 +17,7 @@ export function CheckoutSuccess({ txHash, orderId, returnUrl, returnLabel, class
|
|
|
15
17
|
: "Your payment has been processed successfully.",
|
|
16
18
|
txHash,
|
|
17
19
|
orderId,
|
|
18
|
-
explorerUrl: txHash ?
|
|
20
|
+
explorerUrl: txHash ? getExplorerTxUrl(dstChainId ?? b3.id, txHash) : undefined,
|
|
19
21
|
onDone: () => {
|
|
20
22
|
if (returnUrl)
|
|
21
23
|
window.location.href = returnUrl;
|
|
@@ -24,5 +26,5 @@ export function CheckoutSuccess({ txHash, orderId, returnUrl, returnLabel, class
|
|
|
24
26
|
returnLabel: content.returnButtonLabel || returnLabel,
|
|
25
27
|
}) }));
|
|
26
28
|
}
|
|
27
|
-
return (_jsxs("div", { className: cn("anyspend-checkout-success flex flex-col items-center py-8 text-center", classes?.successPanel), children: [_jsx("div", { className: "anyspend-success-icon mb-4", children: _jsx(AnimatedCheckmark, { className: "h-16 w-16" }) }), _jsx(motion.h2, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.0, ease: "easeOut" }, className: "anyspend-success-title text-xl font-semibold text-gray-900 dark:text-gray-100", children: content.successTitle || "Payment Successful" }), _jsx(motion.p, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.15, ease: "easeOut" }, className: "anyspend-success-description mt-2 text-sm text-gray-500 dark:text-gray-400", children: content.successDescription || "Your payment has been processed successfully." }), txHash && (_jsxs(motion.a, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, delay: 0.5, ease: "easeOut" }, href:
|
|
29
|
+
return (_jsxs("div", { className: cn("anyspend-checkout-success flex flex-col items-center py-8 text-center", classes?.successPanel), children: [_jsx("div", { className: "anyspend-success-icon mb-4", children: _jsx(AnimatedCheckmark, { className: "h-16 w-16" }) }), _jsx(motion.h2, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.0, ease: "easeOut" }, className: "anyspend-success-title text-xl font-semibold text-gray-900 dark:text-gray-100", children: content.successTitle || "Payment Successful" }), _jsx(motion.p, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 1.15, ease: "easeOut" }, className: "anyspend-success-description mt-2 text-sm text-gray-500 dark:text-gray-400", children: content.successDescription || "Your payment has been processed successfully." }), txHash && (_jsxs(motion.a, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, delay: 0.5, ease: "easeOut" }, href: getExplorerTxUrl(dstChainId ?? b3.id, txHash), target: "_blank", rel: "noopener noreferrer", className: "anyspend-success-tx-link mt-4 flex items-center gap-1.5 text-sm text-blue-600 hover:underline dark:text-blue-400", children: ["View Transaction", _jsx(ExternalLink, { className: "h-3.5 w-3.5" })] })), !txHash && orderId && (_jsxs(motion.p, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { duration: 0.3, delay: 0.5, ease: "easeOut" }, className: "anyspend-success-order-id mt-4 text-xs text-gray-400 dark:text-gray-500", children: ["Order ID: ", orderId] })), returnUrl && (_jsx(motion.a, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.3, delay: 0.6, ease: "easeOut" }, href: returnUrl, className: cn("anyspend-success-return-btn mt-6 inline-flex rounded-xl px-6 py-3 text-sm font-medium transition-colors", classes?.returnButton), style: { backgroundColor: "#111827", color: "#fff" }, children: content.returnButtonLabel || returnLabel || "Return to Store" }))] }));
|
|
28
30
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { AnySpendCheckoutClasses } from "./AnySpendCheckout";
|
|
2
2
|
interface CheckoutSuccessProps {
|
|
3
3
|
txHash?: string;
|
|
4
|
+
dstChainId?: number;
|
|
4
5
|
orderId?: string;
|
|
5
6
|
returnUrl?: string;
|
|
6
7
|
returnLabel?: string;
|
|
7
8
|
classes?: AnySpendCheckoutClasses;
|
|
8
9
|
}
|
|
9
|
-
export declare function CheckoutSuccess({ txHash, orderId, returnUrl, returnLabel, classes }: CheckoutSuccessProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function CheckoutSuccess({ txHash, dstChainId, orderId, returnUrl, returnLabel, classes, }: CheckoutSuccessProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ABI_ERC20_STAKING, B3_TOKEN, eqci } from "@b3dotfun/sdk/anyspend";
|
|
1
|
+
import { ABI_ERC20_STAKING, B3_TOKEN, eqci, getExplorerTxUrl } from "@b3dotfun/sdk/anyspend";
|
|
2
2
|
import {
|
|
3
3
|
Button,
|
|
4
4
|
GlareCardRounded,
|
|
@@ -474,7 +474,7 @@ export function AnySpendStakeB3({
|
|
|
474
474
|
>
|
|
475
475
|
<div className="mb-6">
|
|
476
476
|
<a
|
|
477
|
-
href={
|
|
477
|
+
href={getExplorerTxUrl(base.id, stakingTxHash)}
|
|
478
478
|
target="_blank"
|
|
479
479
|
rel="noopener noreferrer"
|
|
480
480
|
className="text-as-primary/70 hover:text-as-primary block break-all text-center font-mono text-sm underline transition-colors"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ABI_ERC20_STAKING, B3_TOKEN, eqci } from "@b3dotfun/sdk/anyspend";
|
|
1
|
+
import { ABI_ERC20_STAKING, B3_TOKEN, eqci, getExplorerTxUrl } from "@b3dotfun/sdk/anyspend";
|
|
2
2
|
import { normalizeAddress } from "@b3dotfun/sdk/anyspend/utils";
|
|
3
3
|
import {
|
|
4
4
|
Button,
|
|
@@ -492,7 +492,7 @@ export function AnySpendStakeB3ExactIn({
|
|
|
492
492
|
>
|
|
493
493
|
<div className="mb-6">
|
|
494
494
|
<a
|
|
495
|
-
href={
|
|
495
|
+
href={getExplorerTxUrl(base.id, stakingTxHash)}
|
|
496
496
|
target="_blank"
|
|
497
497
|
rel="noopener noreferrer"
|
|
498
498
|
className="text-as-primary/70 hover:text-as-primary block break-all text-center font-mono text-sm underline transition-colors"
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
import { getExplorerTxUrl } from "@b3dotfun/sdk/anyspend";
|
|
4
|
+
import { b3 } from "viem/chains";
|
|
3
5
|
import { cn } from "@b3dotfun/sdk/shared/utils/cn";
|
|
4
6
|
import { ExternalLink } from "lucide-react";
|
|
5
7
|
import { motion } from "motion/react";
|
|
@@ -9,13 +11,21 @@ import type { AnySpendCheckoutClasses } from "./AnySpendCheckout";
|
|
|
9
11
|
|
|
10
12
|
interface CheckoutSuccessProps {
|
|
11
13
|
txHash?: string;
|
|
14
|
+
dstChainId?: number;
|
|
12
15
|
orderId?: string;
|
|
13
16
|
returnUrl?: string;
|
|
14
17
|
returnLabel?: string;
|
|
15
18
|
classes?: AnySpendCheckoutClasses;
|
|
16
19
|
}
|
|
17
20
|
|
|
18
|
-
export function CheckoutSuccess({
|
|
21
|
+
export function CheckoutSuccess({
|
|
22
|
+
txHash,
|
|
23
|
+
dstChainId,
|
|
24
|
+
orderId,
|
|
25
|
+
returnUrl,
|
|
26
|
+
returnLabel,
|
|
27
|
+
classes,
|
|
28
|
+
}: CheckoutSuccessProps) {
|
|
19
29
|
const { content, slots } = useAnySpendCustomization();
|
|
20
30
|
|
|
21
31
|
if (slots.successScreen) {
|
|
@@ -29,7 +39,7 @@ export function CheckoutSuccess({ txHash, orderId, returnUrl, returnLabel, class
|
|
|
29
39
|
: "Your payment has been processed successfully.",
|
|
30
40
|
txHash,
|
|
31
41
|
orderId,
|
|
32
|
-
explorerUrl: txHash ?
|
|
42
|
+
explorerUrl: txHash ? getExplorerTxUrl(dstChainId ?? b3.id, txHash) : undefined,
|
|
33
43
|
onDone: () => {
|
|
34
44
|
if (returnUrl) window.location.href = returnUrl;
|
|
35
45
|
},
|
|
@@ -69,7 +79,7 @@ export function CheckoutSuccess({ txHash, orderId, returnUrl, returnLabel, class
|
|
|
69
79
|
initial={{ opacity: 0 }}
|
|
70
80
|
animate={{ opacity: 1 }}
|
|
71
81
|
transition={{ duration: 0.3, delay: 0.5, ease: "easeOut" }}
|
|
72
|
-
href={
|
|
82
|
+
href={getExplorerTxUrl(dstChainId ?? b3.id, txHash)}
|
|
73
83
|
target="_blank"
|
|
74
84
|
rel="noopener noreferrer"
|
|
75
85
|
className="anyspend-success-tx-link mt-4 flex items-center gap-1.5 text-sm text-blue-600 hover:underline dark:text-blue-400"
|