@b3dotfun/sdk 0.0.7-alpha.21 → 0.0.7-alpha.23

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.
@@ -4,5 +4,5 @@ export declare function AnyspendSignatureMint({ loadOrder, mode, signatureData,
4
4
  mode?: "modal" | "page";
5
5
  signatureData: GenerateSigMintResponse;
6
6
  imageUrl?: string;
7
- onSuccess?: () => void;
7
+ onSuccess?: (txHash?: string) => void;
8
8
  }): import("react/jsx-runtime").JSX.Element;
@@ -63,7 +63,7 @@ function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData, image
63
63
  }, [tokenData, signatureData.collection.chainId]);
64
64
  const mediaUrl = imageUrl || signatureData.payload.metadata.image || "https://cdn.b3.fun/nft-placeholder.png";
65
65
  const isVideo = isVideoURL(mediaUrl);
66
- const header = () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "relative mx-auto size-32", children: isVideo ? ((0, jsx_runtime_1.jsxs)("video", { autoPlay: true, loop: true, muted: true, playsInline: true, className: "size-full rounded-lg object-cover", children: [(0, jsx_runtime_1.jsx)("source", { src: mediaUrl, type: `video/${mediaUrl.split(".").pop()}` }), "Your browser does not support the video tag."] })) : ((0, jsx_runtime_1.jsx)("img", { alt: "nft preview", className: "size-full rounded-lg object-cover", src: mediaUrl })) }), (0, jsx_runtime_1.jsxs)("div", { className: "from-b3-react-background to-as-on-surface-1 mt-[-60px] w-full rounded-t-lg bg-gradient-to-t", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-[60px] w-full" }), (0, jsx_runtime_1.jsx)("div", { className: "mb-1 flex w-full flex-col items-center gap-2 p-5", children: (0, jsx_runtime_1.jsxs)("span", { className: "font-sf-rounded text-2xl font-semibold", children: [signatureData.payload.metadata.name || "Mint NFT", " ", Number(signatureData.payload.quantity) > 1 ? `(${signatureData.payload.quantity}x)` : ""] }) })] })] }));
66
+ const header = () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "relative mx-auto size-32", children: isVideo ? ((0, jsx_runtime_1.jsxs)("video", { autoPlay: true, loop: true, muted: true, playsInline: true, className: "size-full rounded-lg object-cover", children: [(0, jsx_runtime_1.jsx)("source", { src: mediaUrl, type: `video/${mediaUrl.split(".").pop()}` }), "Your browser does not support the video tag."] })) : ((0, jsx_runtime_1.jsx)("img", { alt: "nft preview", className: "size-full rounded-lg object-cover", src: mediaUrl })) }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-[-60px] w-full rounded-t-lg bg-white", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-[60px] w-full" }), (0, jsx_runtime_1.jsx)("div", { className: "mb-1 flex w-full flex-col items-center gap-2 p-5", children: (0, jsx_runtime_1.jsxs)("span", { className: "font-sf-rounded text-2xl font-semibold", children: [signatureData.payload.metadata.name || "Mint NFT", " ", Number(signatureData.payload.quantity) > 1 ? `(${signatureData.payload.quantity}x)` : ""] }) })] })] }));
67
67
  // If we don't have token data, show error state
68
68
  if (!dstToken || isTokenError) {
69
69
  return ((0, jsx_runtime_1.jsx)(react_1.StyleRoot, { children: (0, jsx_runtime_1.jsx)("div", { className: "b3-root b3-modal bg-b3-react-background flex w-full flex-col items-center p-8", children: (0, jsx_runtime_1.jsxs)("p", { className: "text-as-red text-center text-sm", children: ["Failed to fetch payment token information for ", signatureData.collection.signatureRequestBody?.currency, " on chain ", signatureData.collection.chainId, ". Please try again."] }) }) }));
@@ -249,7 +249,7 @@ export interface AnySpendSignatureMintProps extends BaseModalProps {
249
249
  /** Optional image URL for NFT preview */
250
250
  imageUrl?: string;
251
251
  /** Callback function called when minting is successful */
252
- onSuccess?: () => void;
252
+ onSuccess?: (txHash?: string) => void;
253
253
  }
254
254
  /**
255
255
  * Union type of all possible modal content types
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { eqci, getDefaultToken, isCustomTxMetadata, isNftMetadata, isTournamentMetadata, NftType, OrderStatus, OrderType, RELAY_ETH_ADDRESS, USDC_BASE, useAnyspendCreateOnrampOrder, useAnyspendCreateOrder, useAnyspendOrderAndTransactions, useAnyspendQuote, useAnyspendTokenList, useGeoOnrampOptions, } from "../../../anyspend/index.js";
3
- import { Badge, Button, ShinyButton, Skeleton, StyleRoot, Tabs, TabsContent, TabsList, TabTrigger, TextShimmer, TransitionPanel, useAccountWallet, useB3, useBsmntProfile, useHasMounted, useModalStore, useRouter, useSearchParamsSSR, useTokenBalancesByChain, Dialog, DialogContent, Input, } from "../../../global-account/react/index.js";
3
+ import { Badge, Button, Dialog, DialogContent, Input, ShinyButton, Skeleton, StyleRoot, Tabs, TabsContent, TabsList, TabTrigger, TextShimmer, TransitionPanel, useAccountWallet, useB3, useBsmntProfile, useHasMounted, useModalStore, useRouter, useSearchParamsSSR, useTokenBalancesByChain, } from "../../../global-account/react/index.js";
4
4
  import { cn } from "../../../shared/utils/index.js";
5
5
  import centerTruncate from "../../../shared/utils/centerTruncate.js";
6
6
  import { formatTokenAmount } from "../../../shared/utils/number.js";
@@ -4,5 +4,5 @@ export declare function AnyspendSignatureMint({ loadOrder, mode, signatureData,
4
4
  mode?: "modal" | "page";
5
5
  signatureData: GenerateSigMintResponse;
6
6
  imageUrl?: string;
7
- onSuccess?: () => void;
7
+ onSuccess?: (txHash?: string) => void;
8
8
  }): import("react/jsx-runtime").JSX.Element;
@@ -57,7 +57,7 @@ export function AnyspendSignatureMint({ loadOrder, mode = "modal", signatureData
57
57
  }, [tokenData, signatureData.collection.chainId]);
58
58
  const mediaUrl = imageUrl || signatureData.payload.metadata.image || "https://cdn.b3.fun/nft-placeholder.png";
59
59
  const isVideo = isVideoURL(mediaUrl);
60
- const header = () => (_jsxs(_Fragment, { children: [_jsx("div", { className: "relative mx-auto size-32", children: isVideo ? (_jsxs("video", { autoPlay: true, loop: true, muted: true, playsInline: true, className: "size-full rounded-lg object-cover", children: [_jsx("source", { src: mediaUrl, type: `video/${mediaUrl.split(".").pop()}` }), "Your browser does not support the video tag."] })) : (_jsx("img", { alt: "nft preview", className: "size-full rounded-lg object-cover", src: mediaUrl })) }), _jsxs("div", { className: "from-b3-react-background to-as-on-surface-1 mt-[-60px] w-full rounded-t-lg bg-gradient-to-t", children: [_jsx("div", { className: "h-[60px] w-full" }), _jsx("div", { className: "mb-1 flex w-full flex-col items-center gap-2 p-5", children: _jsxs("span", { className: "font-sf-rounded text-2xl font-semibold", children: [signatureData.payload.metadata.name || "Mint NFT", " ", Number(signatureData.payload.quantity) > 1 ? `(${signatureData.payload.quantity}x)` : ""] }) })] })] }));
60
+ const header = () => (_jsxs(_Fragment, { children: [_jsx("div", { className: "relative mx-auto size-32", children: isVideo ? (_jsxs("video", { autoPlay: true, loop: true, muted: true, playsInline: true, className: "size-full rounded-lg object-cover", children: [_jsx("source", { src: mediaUrl, type: `video/${mediaUrl.split(".").pop()}` }), "Your browser does not support the video tag."] })) : (_jsx("img", { alt: "nft preview", className: "size-full rounded-lg object-cover", src: mediaUrl })) }), _jsxs("div", { className: "mt-[-60px] w-full rounded-t-lg bg-white", children: [_jsx("div", { className: "h-[60px] w-full" }), _jsx("div", { className: "mb-1 flex w-full flex-col items-center gap-2 p-5", children: _jsxs("span", { className: "font-sf-rounded text-2xl font-semibold", children: [signatureData.payload.metadata.name || "Mint NFT", " ", Number(signatureData.payload.quantity) > 1 ? `(${signatureData.payload.quantity}x)` : ""] }) })] })] }));
61
61
  // If we don't have token data, show error state
62
62
  if (!dstToken || isTokenError) {
63
63
  return (_jsx(StyleRoot, { children: _jsx("div", { className: "b3-root b3-modal bg-b3-react-background flex w-full flex-col items-center p-8", children: _jsxs("p", { className: "text-as-red text-center text-sm", children: ["Failed to fetch payment token information for ", signatureData.collection.signatureRequestBody?.currency, " on chain ", signatureData.collection.chainId, ". Please try again."] }) }) }));
@@ -249,7 +249,7 @@ export interface AnySpendSignatureMintProps extends BaseModalProps {
249
249
  /** Optional image URL for NFT preview */
250
250
  imageUrl?: string;
251
251
  /** Callback function called when minting is successful */
252
- onSuccess?: () => void;
252
+ onSuccess?: (txHash?: string) => void;
253
253
  }
254
254
  /**
255
255
  * Union type of all possible modal content types
@@ -4,5 +4,5 @@ export declare function AnyspendSignatureMint({ loadOrder, mode, signatureData,
4
4
  mode?: "modal" | "page";
5
5
  signatureData: GenerateSigMintResponse;
6
6
  imageUrl?: string;
7
- onSuccess?: () => void;
7
+ onSuccess?: (txHash?: string) => void;
8
8
  }): import("react/jsx-runtime").JSX.Element;
@@ -249,7 +249,7 @@ export interface AnySpendSignatureMintProps extends BaseModalProps {
249
249
  /** Optional image URL for NFT preview */
250
250
  imageUrl?: string;
251
251
  /** Callback function called when minting is successful */
252
- onSuccess?: () => void;
252
+ onSuccess?: (txHash?: string) => void;
253
253
  }
254
254
  /**
255
255
  * Union type of all possible modal content types
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.0.7-alpha.21",
3
+ "version": "0.0.7-alpha.23",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",
@@ -26,6 +26,9 @@ import {
26
26
  import {
27
27
  Badge,
28
28
  Button,
29
+ Dialog,
30
+ DialogContent,
31
+ Input,
29
32
  ShinyButton,
30
33
  Skeleton,
31
34
  StyleRoot,
@@ -43,9 +46,6 @@ import {
43
46
  useRouter,
44
47
  useSearchParamsSSR,
45
48
  useTokenBalancesByChain,
46
- Dialog,
47
- DialogContent,
48
- Input,
49
49
  } from "@b3dotfun/sdk/global-account/react";
50
50
  import { cn } from "@b3dotfun/sdk/shared/utils";
51
51
  import centerTruncate from "@b3dotfun/sdk/shared/utils/centerTruncate";
@@ -53,7 +53,7 @@ export function AnyspendSignatureMint({
53
53
  mode?: "modal" | "page";
54
54
  signatureData: GenerateSigMintResponse;
55
55
  imageUrl?: string;
56
- onSuccess?: () => void;
56
+ onSuccess?: (txHash?: string) => void;
57
57
  }) {
58
58
  const hasMounted = useHasMounted();
59
59
 
@@ -94,7 +94,7 @@ export function AnyspendSignatureMint({
94
94
  <img alt="nft preview" className="size-full rounded-lg object-cover" src={mediaUrl} />
95
95
  )}
96
96
  </div>
97
- <div className="from-b3-react-background to-as-on-surface-1 mt-[-60px] w-full rounded-t-lg bg-gradient-to-t">
97
+ <div className="mt-[-60px] w-full rounded-t-lg bg-white">
98
98
  <div className="h-[60px] w-full" />
99
99
  <div className="mb-1 flex w-full flex-col items-center gap-2 p-5">
100
100
  <span className="font-sf-rounded text-2xl font-semibold">
@@ -264,7 +264,7 @@ export interface AnySpendSignatureMintProps extends BaseModalProps {
264
264
  /** Optional image URL for NFT preview */
265
265
  imageUrl?: string;
266
266
  /** Callback function called when minting is successful */
267
- onSuccess?: () => void;
267
+ onSuccess?: (txHash?: string) => void;
268
268
  }
269
269
 
270
270
  /**