@b3dotfun/sdk 0.1.69-alpha.2 → 0.1.69-alpha.3
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/checkout/FiatCheckoutPanel.js +1 -2
- package/dist/cjs/anyspend/react/components/checkout/KycGate.js +1 -2
- package/dist/esm/anyspend/react/components/checkout/FiatCheckoutPanel.js +2 -3
- package/dist/esm/anyspend/react/components/checkout/KycGate.js +2 -3
- package/package.json +1 -1
- package/src/anyspend/react/components/checkout/FiatCheckoutPanel.tsx +9 -3
- package/src/anyspend/react/components/checkout/KycGate.tsx +8 -3
|
@@ -14,13 +14,12 @@ const react_stripe_js_1 = require("@stripe/react-stripe-js");
|
|
|
14
14
|
const lucide_react_1 = require("lucide-react");
|
|
15
15
|
const react_3 = require("motion/react");
|
|
16
16
|
const react_4 = require("react");
|
|
17
|
-
const wagmi_1 = require("wagmi");
|
|
18
17
|
const KycGate_1 = require("./KycGate");
|
|
19
18
|
function FiatCheckoutPanel({ recipientAddress, destinationTokenAddress, destinationTokenChainId, totalAmount, themeColor, onSuccess, onOrderCreated, onError, callbackMetadata, classes, feeOnTop, kycEnabled = false, }) {
|
|
20
19
|
// Stable refs for callback props to avoid re-triggering effects
|
|
21
20
|
const onErrorRef = (0, react_4.useRef)(onError);
|
|
22
21
|
onErrorRef.current = onError;
|
|
23
|
-
const { address } = (0,
|
|
22
|
+
const { address } = (0, react_2.useAccountWallet)();
|
|
24
23
|
const setB3ModalOpen = (0, react_2.useModalStore)(state => state.setB3ModalOpen);
|
|
25
24
|
const setB3ModalContentType = (0, react_2.useModalStore)(state => state.setB3ModalContentType);
|
|
26
25
|
const { data: tokenData } = (0, react_2.useTokenData)(destinationTokenChainId, destinationTokenAddress);
|
|
@@ -42,10 +42,9 @@ const b3Chain_1 = require("../../../../shared/constants/chains/b3Chain");
|
|
|
42
42
|
const lucide_react_1 = require("lucide-react");
|
|
43
43
|
const react_2 = require("motion/react");
|
|
44
44
|
const react_3 = require("react");
|
|
45
|
-
const wagmi_1 = require("wagmi");
|
|
46
45
|
const useKycStatus_1 = require("../../hooks/useKycStatus");
|
|
47
46
|
function KycGate({ themeColor, classes, enabled = false, onStatusResolved }) {
|
|
48
|
-
const { address } = (0,
|
|
47
|
+
const { address } = (0, react_1.useAccountWallet)();
|
|
49
48
|
const { partnerId } = (0, react_1.useB3Config)();
|
|
50
49
|
// Gate the status fetch behind explicit user consent so the wallet
|
|
51
50
|
// signature prompt doesn't fire automatically on tab open.
|
|
@@ -5,19 +5,18 @@ import { USDC_BASE } from "../../../../anyspend/constants/index.js";
|
|
|
5
5
|
import { cn } from "../../../../shared/utils/cn.js";
|
|
6
6
|
import { formatUnits } from "../../../../shared/utils/number.js";
|
|
7
7
|
import { getStripePromise } from "../../../../shared/utils/payment.utils.js";
|
|
8
|
-
import { ShinyButton, TextShimmer, useB3Config, useModalStore, useTokenData } from "../../../../global-account/react/index.js";
|
|
8
|
+
import { ShinyButton, TextShimmer, useAccountWallet, useB3Config, useModalStore, useTokenData, } from "../../../../global-account/react/index.js";
|
|
9
9
|
import { thirdwebB3Chain } from "../../../../shared/constants/chains/b3Chain.js";
|
|
10
10
|
import { AddressElement, Elements, PaymentElement, useElements, useStripe } from "@stripe/react-stripe-js";
|
|
11
11
|
import { Loader2, Lock, Wallet } from "lucide-react";
|
|
12
12
|
import { AnimatePresence, motion } from "motion/react";
|
|
13
13
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
14
|
-
import { useAccount } from "wagmi";
|
|
15
14
|
import { KycGate } from "./KycGate.js";
|
|
16
15
|
export function FiatCheckoutPanel({ recipientAddress, destinationTokenAddress, destinationTokenChainId, totalAmount, themeColor, onSuccess, onOrderCreated, onError, callbackMetadata, classes, feeOnTop, kycEnabled = false, }) {
|
|
17
16
|
// Stable refs for callback props to avoid re-triggering effects
|
|
18
17
|
const onErrorRef = useRef(onError);
|
|
19
18
|
onErrorRef.current = onError;
|
|
20
|
-
const { address } =
|
|
19
|
+
const { address } = useAccountWallet();
|
|
21
20
|
const setB3ModalOpen = useModalStore(state => state.setB3ModalOpen);
|
|
22
21
|
const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
|
|
23
22
|
const { data: tokenData } = useTokenData(destinationTokenChainId, destinationTokenAddress);
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from "../../../../shared/utils/cn.js";
|
|
4
|
-
import { ShinyButton, TextShimmer, useB3Config, useModalStore } from "../../../../global-account/react/index.js";
|
|
4
|
+
import { ShinyButton, TextShimmer, useAccountWallet, useB3Config, useModalStore, } from "../../../../global-account/react/index.js";
|
|
5
5
|
import { thirdwebB3Chain } from "../../../../shared/constants/chains/b3Chain.js";
|
|
6
6
|
import { Loader2, ShieldCheck, AlertTriangle, Clock, Wallet } from "lucide-react";
|
|
7
7
|
import { AnimatePresence, motion } from "motion/react";
|
|
8
8
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
9
|
-
import { useAccount } from "wagmi";
|
|
10
9
|
import { useCreateKycInquiry, useKycStatus, useVerifyKyc, useWalletAuthHeaders } from "../../hooks/useKycStatus.js";
|
|
11
10
|
export function KycGate({ themeColor, classes, enabled = false, onStatusResolved }) {
|
|
12
|
-
const { address } =
|
|
11
|
+
const { address } = useAccountWallet();
|
|
13
12
|
const { partnerId } = useB3Config();
|
|
14
13
|
// Gate the status fetch behind explicit user consent so the wallet
|
|
15
14
|
// signature prompt doesn't fire automatically on tab open.
|
package/package.json
CHANGED
|
@@ -10,14 +10,20 @@ import { USDC_BASE } from "@b3dotfun/sdk/anyspend/constants";
|
|
|
10
10
|
import { cn } from "@b3dotfun/sdk/shared/utils/cn";
|
|
11
11
|
import { formatUnits } from "@b3dotfun/sdk/shared/utils/number";
|
|
12
12
|
import { getStripePromise } from "@b3dotfun/sdk/shared/utils/payment.utils";
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
ShinyButton,
|
|
15
|
+
TextShimmer,
|
|
16
|
+
useAccountWallet,
|
|
17
|
+
useB3Config,
|
|
18
|
+
useModalStore,
|
|
19
|
+
useTokenData,
|
|
20
|
+
} from "@b3dotfun/sdk/global-account/react";
|
|
14
21
|
import { thirdwebB3Chain } from "@b3dotfun/sdk/shared/constants/chains/b3Chain";
|
|
15
22
|
import { AddressElement, Elements, PaymentElement, useElements, useStripe } from "@stripe/react-stripe-js";
|
|
16
23
|
import type { PaymentIntentResult, StripePaymentElementOptions } from "@stripe/stripe-js";
|
|
17
24
|
import { Loader2, Lock, Wallet } from "lucide-react";
|
|
18
25
|
import { AnimatePresence, motion } from "motion/react";
|
|
19
26
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
20
|
-
import { useAccount } from "wagmi";
|
|
21
27
|
import type { AnySpendCheckoutClasses } from "./AnySpendCheckout";
|
|
22
28
|
import { KycGate } from "./KycGate";
|
|
23
29
|
|
|
@@ -58,7 +64,7 @@ export function FiatCheckoutPanel({
|
|
|
58
64
|
const onErrorRef = useRef(onError);
|
|
59
65
|
onErrorRef.current = onError;
|
|
60
66
|
|
|
61
|
-
const { address } =
|
|
67
|
+
const { address } = useAccountWallet();
|
|
62
68
|
const setB3ModalOpen = useModalStore(state => state.setB3ModalOpen);
|
|
63
69
|
const setB3ModalContentType = useModalStore(state => state.setB3ModalContentType);
|
|
64
70
|
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { cn } from "@b3dotfun/sdk/shared/utils/cn";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
ShinyButton,
|
|
6
|
+
TextShimmer,
|
|
7
|
+
useAccountWallet,
|
|
8
|
+
useB3Config,
|
|
9
|
+
useModalStore,
|
|
10
|
+
} from "@b3dotfun/sdk/global-account/react";
|
|
5
11
|
import { thirdwebB3Chain } from "@b3dotfun/sdk/shared/constants/chains/b3Chain";
|
|
6
12
|
import { Loader2, ShieldCheck, AlertTriangle, Clock, Wallet } from "lucide-react";
|
|
7
13
|
import { AnimatePresence, motion } from "motion/react";
|
|
8
14
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
9
|
-
import { useAccount } from "wagmi";
|
|
10
15
|
import type { AnySpendCheckoutClasses } from "./AnySpendCheckout";
|
|
11
16
|
import { useCreateKycInquiry, useKycStatus, useVerifyKyc, useWalletAuthHeaders } from "../../hooks/useKycStatus";
|
|
12
17
|
|
|
@@ -20,7 +25,7 @@ interface KycGateProps {
|
|
|
20
25
|
}
|
|
21
26
|
|
|
22
27
|
export function KycGate({ themeColor, classes, enabled = false, onStatusResolved }: KycGateProps) {
|
|
23
|
-
const { address } =
|
|
28
|
+
const { address } = useAccountWallet();
|
|
24
29
|
const { partnerId } = useB3Config();
|
|
25
30
|
// Gate the status fetch behind explicit user consent so the wallet
|
|
26
31
|
// signature prompt doesn't fire automatically on tab open.
|