@meshsdk/react 1.7.23 → 1.7.24
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/index.cjs +455 -317
- package/dist/index.js +459 -321
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -47,7 +47,7 @@ __export(src_exports, {
|
|
|
47
47
|
module.exports = __toCommonJS(src_exports);
|
|
48
48
|
|
|
49
49
|
// src/cardano-wallet/index.tsx
|
|
50
|
-
var
|
|
50
|
+
var import_react12 = require("react");
|
|
51
51
|
|
|
52
52
|
// src/common/button.tsx
|
|
53
53
|
var React3 = __toESM(require("react"), 1);
|
|
@@ -2784,142 +2784,10 @@ var DialogDescription = React4.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
2784
2784
|
));
|
|
2785
2785
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
2786
2786
|
|
|
2787
|
-
// src/common/dropdown-menu.tsx
|
|
2788
|
-
var React5 = __toESM(require("react"), 1);
|
|
2789
|
-
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
|
|
2790
|
-
var import_react_icons2 = require("@radix-ui/react-icons");
|
|
2791
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
2792
|
-
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
2793
|
-
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
2794
|
-
var DropdownMenuSubTrigger = React5.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
2795
|
-
DropdownMenuPrimitive.SubTrigger,
|
|
2796
|
-
{
|
|
2797
|
-
ref,
|
|
2798
|
-
className: cn(
|
|
2799
|
-
"mesh-flex mesh-cursor-default mesh-select-none mesh-items-center mesh-rounded-sm mesh-px-2 mesh-py-1.5 mesh-text-sm mesh-outline-none focus:mesh-bg-zinc-100 data-[state=open]:mesh-bg-zinc-100 dark:focus:mesh-bg-zinc-800 dark:data-[state=open]:mesh-bg-zinc-800",
|
|
2800
|
-
inset && "mesh-pl-8",
|
|
2801
|
-
className
|
|
2802
|
-
),
|
|
2803
|
-
...props,
|
|
2804
|
-
children: [
|
|
2805
|
-
children,
|
|
2806
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_icons2.ChevronRightIcon, { className: "mesh-ml-auto mesh-h-4 mesh-w-4" })
|
|
2807
|
-
]
|
|
2808
|
-
}
|
|
2809
|
-
));
|
|
2810
|
-
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
2811
|
-
var DropdownMenuSubContent = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2812
|
-
DropdownMenuPrimitive.SubContent,
|
|
2813
|
-
{
|
|
2814
|
-
ref,
|
|
2815
|
-
className: cn(
|
|
2816
|
-
"mesh-z-50 mesh-min-w-[8rem] mesh-overflow-hidden mesh-rounded-md mesh-border mesh-border-zinc-200 mesh-bg-white mesh-p-1 mesh-text-zinc-950 mesh-shadow-lg data-[state=open]:mesh-animate-in data-[state=closed]:mesh-animate-out data-[state=closed]:mesh-fade-out-0 data-[state=open]:mesh-fade-in-0 data-[state=closed]:mesh-zoom-out-95 data-[state=open]:mesh-zoom-in-95 data-[side=bottom]:mesh-slide-in-from-top-2 data-[side=left]:mesh-slide-in-from-right-2 data-[side=right]:mesh-slide-in-from-left-2 data-[side=top]:mesh-slide-in-from-bottom-2 dark:mesh-border-zinc-800 dark:mesh-bg-zinc-950 dark:mesh-text-zinc-50",
|
|
2817
|
-
className
|
|
2818
|
-
),
|
|
2819
|
-
...props
|
|
2820
|
-
}
|
|
2821
|
-
));
|
|
2822
|
-
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
2823
|
-
var DropdownMenuContent = React5.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2824
|
-
DropdownMenuPrimitive.Content,
|
|
2825
|
-
{
|
|
2826
|
-
ref,
|
|
2827
|
-
sideOffset,
|
|
2828
|
-
className: cn(
|
|
2829
|
-
"mesh-z-50 mesh-min-w-[8rem] mesh-overflow-hidden mesh-rounded-md mesh-border mesh-border-zinc-200 mesh-bg-white mesh-p-1 mesh-text-zinc-950 mesh-shadow-md dark:mesh-border-zinc-800 dark:mesh-bg-zinc-950 dark:mesh-text-zinc-50",
|
|
2830
|
-
"data-[state=open]:mesh-animate-in data-[state=closed]:mesh-animate-out data-[state=closed]:mesh-fade-out-0 data-[state=open]:mesh-fade-in-0 data-[state=closed]:mesh-zoom-out-95 data-[state=open]:mesh-zoom-in-95 data-[side=bottom]:mesh-slide-in-from-top-2 data-[side=left]:mesh-slide-in-from-right-2 data-[side=right]:mesh-slide-in-from-left-2 data-[side=top]:mesh-slide-in-from-bottom-2",
|
|
2831
|
-
className
|
|
2832
|
-
),
|
|
2833
|
-
...props
|
|
2834
|
-
}
|
|
2835
|
-
) }));
|
|
2836
|
-
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
2837
|
-
var DropdownMenuItem = React5.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2838
|
-
DropdownMenuPrimitive.Item,
|
|
2839
|
-
{
|
|
2840
|
-
ref,
|
|
2841
|
-
className: cn(
|
|
2842
|
-
"mesh-relative mesh-flex mesh-cursor-default mesh-select-none mesh-items-center mesh-rounded-sm mesh-px-2 mesh-py-1.5 mesh-text-sm mesh-outline-none mesh-transition-colors focus:mesh-bg-zinc-100 focus:mesh-text-zinc-900 data-[disabled]:mesh-pointer-events-none data-[disabled]:mesh-opacity-50 dark:focus:mesh-bg-zinc-800 dark:focus:mesh-text-zinc-50",
|
|
2843
|
-
inset && "mesh-pl-8",
|
|
2844
|
-
className
|
|
2845
|
-
),
|
|
2846
|
-
...props
|
|
2847
|
-
}
|
|
2848
|
-
));
|
|
2849
|
-
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
2850
|
-
var DropdownMenuCheckboxItem = React5.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
2851
|
-
DropdownMenuPrimitive.CheckboxItem,
|
|
2852
|
-
{
|
|
2853
|
-
ref,
|
|
2854
|
-
className: cn(
|
|
2855
|
-
"mesh-relative mesh-flex mesh-cursor-default mesh-select-none mesh-items-center mesh-rounded-sm mesh-py-1.5 mesh-pl-8 mesh-pr-2 mesh-text-sm mesh-outline-none mesh-transition-colors focus:mesh-bg-zinc-100 focus:mesh-text-zinc-900 data-[disabled]:mesh-pointer-events-none data-[disabled]:mesh-opacity-50 dark:focus:mesh-bg-zinc-800 dark:focus:mesh-text-zinc-50",
|
|
2856
|
-
className
|
|
2857
|
-
),
|
|
2858
|
-
checked,
|
|
2859
|
-
...props,
|
|
2860
|
-
children: [
|
|
2861
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "mesh-absolute mesh-left-2 mesh-flex mesh-h-3.5 mesh-w-3.5 mesh-items-center mesh-justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_icons2.CheckIcon, { className: "mesh-h-4 mesh-w-4" }) }) }),
|
|
2862
|
-
children
|
|
2863
|
-
]
|
|
2864
|
-
}
|
|
2865
|
-
));
|
|
2866
|
-
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
2867
|
-
var DropdownMenuRadioItem = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
2868
|
-
DropdownMenuPrimitive.RadioItem,
|
|
2869
|
-
{
|
|
2870
|
-
ref,
|
|
2871
|
-
className: cn(
|
|
2872
|
-
"mesh-relative mesh-flex mesh-cursor-default mesh-select-none mesh-items-center mesh-rounded-sm mesh-py-1.5 mesh-pl-8 mesh-pr-2 mesh-text-sm mesh-outline-none mesh-transition-colors focus:mesh-bg-zinc-100 focus:mesh-text-zinc-900 data-[disabled]:mesh-pointer-events-none data-[disabled]:mesh-opacity-50 dark:focus:mesh-bg-zinc-800 dark:focus:mesh-text-zinc-50",
|
|
2873
|
-
className
|
|
2874
|
-
),
|
|
2875
|
-
...props,
|
|
2876
|
-
children: [
|
|
2877
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "mesh-absolute mesh-left-2 mesh-flex mesh-h-3.5 mesh-w-3.5 mesh-items-center mesh-justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_icons2.DotFilledIcon, { className: "mesh-h-4 mesh-w-4 mesh-fill-current" }) }) }),
|
|
2878
|
-
children
|
|
2879
|
-
]
|
|
2880
|
-
}
|
|
2881
|
-
));
|
|
2882
|
-
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
2883
|
-
var DropdownMenuLabel = React5.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2884
|
-
DropdownMenuPrimitive.Label,
|
|
2885
|
-
{
|
|
2886
|
-
ref,
|
|
2887
|
-
className: cn(
|
|
2888
|
-
"mesh-px-2 mesh-py-1.5 mesh-text-sm mesh-font-semibold",
|
|
2889
|
-
inset && "mesh-pl-8",
|
|
2890
|
-
className
|
|
2891
|
-
),
|
|
2892
|
-
...props
|
|
2893
|
-
}
|
|
2894
|
-
));
|
|
2895
|
-
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
2896
|
-
var DropdownMenuSeparator = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2897
|
-
DropdownMenuPrimitive.Separator,
|
|
2898
|
-
{
|
|
2899
|
-
ref,
|
|
2900
|
-
className: cn("-mesh-mx-1 mesh-my-1 mesh-h-px mesh-bg-zinc-100 dark:mesh-bg-zinc-800", className),
|
|
2901
|
-
...props
|
|
2902
|
-
}
|
|
2903
|
-
));
|
|
2904
|
-
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
2905
|
-
var DropdownMenuShortcut = ({
|
|
2906
|
-
className,
|
|
2907
|
-
...props
|
|
2908
|
-
}) => {
|
|
2909
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2910
|
-
"span",
|
|
2911
|
-
{
|
|
2912
|
-
className: cn("mesh-ml-auto mesh-text-xs mesh-tracking-widest mesh-opacity-60", className),
|
|
2913
|
-
...props
|
|
2914
|
-
}
|
|
2915
|
-
);
|
|
2916
|
-
};
|
|
2917
|
-
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
2918
|
-
|
|
2919
2787
|
// src/common/icons/icon-chevron-right.tsx
|
|
2920
|
-
var
|
|
2788
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
2921
2789
|
function IconChevronRight() {
|
|
2922
|
-
return /* @__PURE__ */ (0,
|
|
2790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2923
2791
|
"svg",
|
|
2924
2792
|
{
|
|
2925
2793
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2938,59 +2806,7 @@ function IconChevronRight() {
|
|
|
2938
2806
|
strokeWidth: "1px"
|
|
2939
2807
|
},
|
|
2940
2808
|
className: "hover:mesh-fill-white",
|
|
2941
|
-
children: /* @__PURE__ */ (0,
|
|
2942
|
-
}
|
|
2943
|
-
);
|
|
2944
|
-
}
|
|
2945
|
-
|
|
2946
|
-
// src/common/icons/icon-monitor-smartphone.tsx
|
|
2947
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
2948
|
-
function IconMonitorSmartphone() {
|
|
2949
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
2950
|
-
"svg",
|
|
2951
|
-
{
|
|
2952
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2953
|
-
width: "24",
|
|
2954
|
-
height: "24",
|
|
2955
|
-
viewBox: "0 0 24 24",
|
|
2956
|
-
fill: "none",
|
|
2957
|
-
stroke: "black",
|
|
2958
|
-
strokeWidth: "2",
|
|
2959
|
-
strokeLinecap: "round",
|
|
2960
|
-
strokeLinejoin: "round",
|
|
2961
|
-
style: {
|
|
2962
|
-
color: "#ffadff",
|
|
2963
|
-
width: "56px",
|
|
2964
|
-
height: "56px",
|
|
2965
|
-
strokeWidth: "1px"
|
|
2966
|
-
},
|
|
2967
|
-
children: [
|
|
2968
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8" }),
|
|
2969
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M10 19v-3.96 3.15" }),
|
|
2970
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { d: "M7 19h5" }),
|
|
2971
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("rect", { width: "6", height: "10", x: "16", y: "12", rx: "2" })
|
|
2972
|
-
]
|
|
2973
|
-
}
|
|
2974
|
-
);
|
|
2975
|
-
}
|
|
2976
|
-
|
|
2977
|
-
// src/common/icons/wallet-icon.tsx
|
|
2978
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
2979
|
-
function WalletIcon({
|
|
2980
|
-
icon,
|
|
2981
|
-
name,
|
|
2982
|
-
action,
|
|
2983
|
-
iconReactNode
|
|
2984
|
-
}) {
|
|
2985
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
2986
|
-
"button",
|
|
2987
|
-
{
|
|
2988
|
-
className: "mesh-flex mesh-items-center mesh-justify-center mesh-rounded-lg mesh-w-10 mesh-h-10 mesh-bg-neutral-50 mesh-border mesh-border-zinc-700 hover:mesh-border-zinc-200 mesh-cursor-pointer",
|
|
2989
|
-
onClick: action,
|
|
2990
|
-
children: [
|
|
2991
|
-
icon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("img", { src: icon, alt: name, className: "mesh-w-8 mesh-h-8" }),
|
|
2992
|
-
iconReactNode && iconReactNode
|
|
2993
|
-
]
|
|
2809
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "m15 18-6-6 6-6" })
|
|
2994
2810
|
}
|
|
2995
2811
|
);
|
|
2996
2812
|
}
|
|
@@ -3052,10 +2868,10 @@ var WalletContext = (0, import_react.createContext)({
|
|
|
3052
2868
|
});
|
|
3053
2869
|
|
|
3054
2870
|
// src/contexts/index.tsx
|
|
3055
|
-
var
|
|
2871
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
3056
2872
|
var MeshProvider = (props) => {
|
|
3057
2873
|
const store = useWalletStore();
|
|
3058
|
-
return /* @__PURE__ */ (0,
|
|
2874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(WalletContext.Provider, { value: store, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: props.children }) });
|
|
3059
2875
|
};
|
|
3060
2876
|
|
|
3061
2877
|
// src/hooks/useAddress.ts
|
|
@@ -3215,74 +3031,144 @@ var useWalletSubmit = () => {
|
|
|
3215
3031
|
};
|
|
3216
3032
|
};
|
|
3217
3033
|
|
|
3218
|
-
// src/cardano-wallet/
|
|
3219
|
-
var
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3034
|
+
// src/cardano-wallet/connected-button.tsx
|
|
3035
|
+
var import_react10 = require("react");
|
|
3036
|
+
|
|
3037
|
+
// src/common/dropdown-menu.tsx
|
|
3038
|
+
var React5 = __toESM(require("react"), 1);
|
|
3039
|
+
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
|
|
3040
|
+
var import_react_icons2 = require("@radix-ui/react-icons");
|
|
3041
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
3042
|
+
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
3043
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
3044
|
+
var DropdownMenuSubTrigger = React5.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
3045
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
3046
|
+
{
|
|
3047
|
+
ref,
|
|
3048
|
+
className: cn(
|
|
3049
|
+
"mesh-flex mesh-cursor-default mesh-select-none mesh-items-center mesh-rounded-sm mesh-px-2 mesh-py-1.5 mesh-text-sm mesh-outline-none focus:mesh-bg-zinc-100 data-[state=open]:mesh-bg-zinc-100 dark:focus:mesh-bg-zinc-800 dark:data-[state=open]:mesh-bg-zinc-800",
|
|
3050
|
+
inset && "mesh-pl-8",
|
|
3051
|
+
className
|
|
3052
|
+
),
|
|
3053
|
+
...props,
|
|
3054
|
+
children: [
|
|
3055
|
+
children,
|
|
3056
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_icons2.ChevronRightIcon, { className: "mesh-ml-auto mesh-h-4 mesh-w-4" })
|
|
3057
|
+
]
|
|
3058
|
+
}
|
|
3059
|
+
));
|
|
3060
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
3061
|
+
var DropdownMenuSubContent = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3062
|
+
DropdownMenuPrimitive.SubContent,
|
|
3063
|
+
{
|
|
3064
|
+
ref,
|
|
3065
|
+
className: cn(
|
|
3066
|
+
"mesh-z-50 mesh-min-w-[8rem] mesh-overflow-hidden mesh-rounded-md mesh-border mesh-border-zinc-200 mesh-bg-white mesh-p-1 mesh-text-zinc-950 mesh-shadow-lg data-[state=open]:mesh-animate-in data-[state=closed]:mesh-animate-out data-[state=closed]:mesh-fade-out-0 data-[state=open]:mesh-fade-in-0 data-[state=closed]:mesh-zoom-out-95 data-[state=open]:mesh-zoom-in-95 data-[side=bottom]:mesh-slide-in-from-top-2 data-[side=left]:mesh-slide-in-from-right-2 data-[side=right]:mesh-slide-in-from-left-2 data-[side=top]:mesh-slide-in-from-bottom-2 dark:mesh-border-zinc-800 dark:mesh-bg-zinc-950 dark:mesh-text-zinc-50",
|
|
3067
|
+
className
|
|
3068
|
+
),
|
|
3069
|
+
...props
|
|
3070
|
+
}
|
|
3071
|
+
));
|
|
3072
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
3073
|
+
var DropdownMenuContent = React5.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3074
|
+
DropdownMenuPrimitive.Content,
|
|
3075
|
+
{
|
|
3076
|
+
ref,
|
|
3077
|
+
sideOffset,
|
|
3078
|
+
className: cn(
|
|
3079
|
+
"mesh-z-50 mesh-min-w-[8rem] mesh-overflow-hidden mesh-rounded-md mesh-border mesh-border-zinc-200 mesh-bg-white mesh-p-1 mesh-text-zinc-950 mesh-shadow-md dark:mesh-border-zinc-800 dark:mesh-bg-zinc-950 dark:mesh-text-zinc-50",
|
|
3080
|
+
"data-[state=open]:mesh-animate-in data-[state=closed]:mesh-animate-out data-[state=closed]:mesh-fade-out-0 data-[state=open]:mesh-fade-in-0 data-[state=closed]:mesh-zoom-out-95 data-[state=open]:mesh-zoom-in-95 data-[side=bottom]:mesh-slide-in-from-top-2 data-[side=left]:mesh-slide-in-from-right-2 data-[side=right]:mesh-slide-in-from-left-2 data-[side=top]:mesh-slide-in-from-bottom-2",
|
|
3081
|
+
className
|
|
3082
|
+
),
|
|
3083
|
+
...props
|
|
3084
|
+
}
|
|
3085
|
+
) }));
|
|
3086
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
3087
|
+
var DropdownMenuItem = React5.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3088
|
+
DropdownMenuPrimitive.Item,
|
|
3089
|
+
{
|
|
3090
|
+
ref,
|
|
3091
|
+
className: cn(
|
|
3092
|
+
"mesh-relative mesh-flex mesh-cursor-default mesh-select-none mesh-items-center mesh-rounded-sm mesh-px-2 mesh-py-1.5 mesh-text-sm mesh-outline-none mesh-transition-colors focus:mesh-bg-zinc-100 focus:mesh-text-zinc-900 data-[disabled]:mesh-pointer-events-none data-[disabled]:mesh-opacity-50 dark:focus:mesh-bg-zinc-800 dark:focus:mesh-text-zinc-50",
|
|
3093
|
+
inset && "mesh-pl-8",
|
|
3094
|
+
className
|
|
3095
|
+
),
|
|
3096
|
+
...props
|
|
3097
|
+
}
|
|
3098
|
+
));
|
|
3099
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
3100
|
+
var DropdownMenuCheckboxItem = React5.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
3101
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
3102
|
+
{
|
|
3103
|
+
ref,
|
|
3104
|
+
className: cn(
|
|
3105
|
+
"mesh-relative mesh-flex mesh-cursor-default mesh-select-none mesh-items-center mesh-rounded-sm mesh-py-1.5 mesh-pl-8 mesh-pr-2 mesh-text-sm mesh-outline-none mesh-transition-colors focus:mesh-bg-zinc-100 focus:mesh-text-zinc-900 data-[disabled]:mesh-pointer-events-none data-[disabled]:mesh-opacity-50 dark:focus:mesh-bg-zinc-800 dark:focus:mesh-text-zinc-50",
|
|
3106
|
+
className
|
|
3107
|
+
),
|
|
3108
|
+
checked,
|
|
3109
|
+
...props,
|
|
3110
|
+
children: [
|
|
3111
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "mesh-absolute mesh-left-2 mesh-flex mesh-h-3.5 mesh-w-3.5 mesh-items-center mesh-justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_icons2.CheckIcon, { className: "mesh-h-4 mesh-w-4" }) }) }),
|
|
3112
|
+
children
|
|
3113
|
+
]
|
|
3114
|
+
}
|
|
3115
|
+
));
|
|
3116
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
3117
|
+
var DropdownMenuRadioItem = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
3118
|
+
DropdownMenuPrimitive.RadioItem,
|
|
3119
|
+
{
|
|
3120
|
+
ref,
|
|
3121
|
+
className: cn(
|
|
3122
|
+
"mesh-relative mesh-flex mesh-cursor-default mesh-select-none mesh-items-center mesh-rounded-sm mesh-py-1.5 mesh-pl-8 mesh-pr-2 mesh-text-sm mesh-outline-none mesh-transition-colors focus:mesh-bg-zinc-100 focus:mesh-text-zinc-900 data-[disabled]:mesh-pointer-events-none data-[disabled]:mesh-opacity-50 dark:focus:mesh-bg-zinc-800 dark:focus:mesh-text-zinc-50",
|
|
3123
|
+
className
|
|
3124
|
+
),
|
|
3125
|
+
...props,
|
|
3126
|
+
children: [
|
|
3127
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "mesh-absolute mesh-left-2 mesh-flex mesh-h-3.5 mesh-w-3.5 mesh-items-center mesh-justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_icons2.DotFilledIcon, { className: "mesh-h-4 mesh-w-4 mesh-fill-current" }) }) }),
|
|
3128
|
+
children
|
|
3129
|
+
]
|
|
3130
|
+
}
|
|
3131
|
+
));
|
|
3132
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
3133
|
+
var DropdownMenuLabel = React5.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3134
|
+
DropdownMenuPrimitive.Label,
|
|
3135
|
+
{
|
|
3136
|
+
ref,
|
|
3137
|
+
className: cn(
|
|
3138
|
+
"mesh-px-2 mesh-py-1.5 mesh-text-sm mesh-font-semibold",
|
|
3139
|
+
inset && "mesh-pl-8",
|
|
3140
|
+
className
|
|
3141
|
+
),
|
|
3142
|
+
...props
|
|
3143
|
+
}
|
|
3144
|
+
));
|
|
3145
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
3146
|
+
var DropdownMenuSeparator = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3147
|
+
DropdownMenuPrimitive.Separator,
|
|
3148
|
+
{
|
|
3149
|
+
ref,
|
|
3150
|
+
className: cn("-mesh-mx-1 mesh-my-1 mesh-h-px mesh-bg-zinc-100 dark:mesh-bg-zinc-800", className),
|
|
3151
|
+
...props
|
|
3152
|
+
}
|
|
3153
|
+
));
|
|
3154
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
3155
|
+
var DropdownMenuShortcut = ({
|
|
3156
|
+
className,
|
|
3157
|
+
...props
|
|
3227
3158
|
}) => {
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
if (onConnected) onConnected();
|
|
3159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
3160
|
+
"span",
|
|
3161
|
+
{
|
|
3162
|
+
className: cn("mesh-ml-auto mesh-text-xs mesh-tracking-widest mesh-opacity-60", className),
|
|
3163
|
+
...props
|
|
3234
3164
|
}
|
|
3235
|
-
|
|
3236
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Dialog, { open, onOpenChange: setOpen, children: [
|
|
3237
|
-
!connected ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Button, { variant: "outline", className: "mesh-text-white", children: label }) }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ConnectedDropdown, {}),
|
|
3238
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(DialogContent, { className: "sm:mesh-max-w-[425px]", children: [
|
|
3239
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(DialogHeader, { children: [
|
|
3240
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(DialogTitle, { className: "mesh-flex mesh-justify-between", children: [
|
|
3241
|
-
screen != "main" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { onClick: () => setScreen("main"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(IconChevronRight, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { width: "24px" } }),
|
|
3242
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { children: [
|
|
3243
|
-
screen == "main" && "Connect Wallet",
|
|
3244
|
-
screen == "p2p" && "P2P Connect"
|
|
3245
|
-
] }),
|
|
3246
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { width: "24px" } })
|
|
3247
|
-
] }),
|
|
3248
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogDescription, { children: screen == "p2p" && "Use wallet that supports CIP-45, scan this QR code to connect." })
|
|
3249
|
-
] }),
|
|
3250
|
-
screen == "main" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3251
|
-
MainScreen,
|
|
3252
|
-
{
|
|
3253
|
-
metamask,
|
|
3254
|
-
extensions,
|
|
3255
|
-
setOpen,
|
|
3256
|
-
setScreen
|
|
3257
|
-
}
|
|
3258
|
-
),
|
|
3259
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogFooter, { className: "mesh-justify-center mesh-text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
3260
|
-
"a",
|
|
3261
|
-
{
|
|
3262
|
-
href: "https://meshjs.dev/",
|
|
3263
|
-
target: "_blank",
|
|
3264
|
-
className: "mesh-grow mesh-flex mesh-gap-1 mesh-items-center mesh-justify-center mesh-text-zinc-500 hover:mesh-text-white mesh-fill-zinc-500 hover:mesh-fill-white",
|
|
3265
|
-
children: [
|
|
3266
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "", children: "Powered by" }),
|
|
3267
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
3268
|
-
"svg",
|
|
3269
|
-
{
|
|
3270
|
-
width: 24,
|
|
3271
|
-
height: 24,
|
|
3272
|
-
enableBackground: "new 0 0 300 200",
|
|
3273
|
-
viewBox: "0 0 300 200",
|
|
3274
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3275
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "m289 127-45-60-45-60c-.9-1.3-2.4-2-4-2s-3.1.7-4 2l-37 49.3c-2 2.7-6 2.7-8 0l-37-49.3c-.9-1.3-2.4-2-4-2s-3.1.7-4 2l-45 60-45 60c-1.3 1.8-1.3 4.2 0 6l45 60c.9 1.3 2.4 2 4 2s3.1-.7 4-2l37-49.3c2-2.7 6-2.7 8 0l37 49.3c.9 1.3 2.4 2 4 2s3.1-.7 4-2l37-49.3c2-2.7 6-2.7 8 0l37 49.3c.9 1.3 2.4 2 4 2s3.1-.7 4-2l45-60c1.3-1.8 1.3-4.2 0-6zm-90-103.3 32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0l-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0zm-90 0 32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0l-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0zm-53 152.6-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0l32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0zm90 0-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0l32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0zm90 0-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0l32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0z" })
|
|
3276
|
-
}
|
|
3277
|
-
),
|
|
3278
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "", children: "Mesh SDK" })
|
|
3279
|
-
]
|
|
3280
|
-
}
|
|
3281
|
-
) })
|
|
3282
|
-
] })
|
|
3283
|
-
] });
|
|
3165
|
+
);
|
|
3284
3166
|
};
|
|
3285
|
-
|
|
3167
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
3168
|
+
|
|
3169
|
+
// src/cardano-wallet/connected-button.tsx
|
|
3170
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
3171
|
+
function ConnectedButton() {
|
|
3286
3172
|
const { wallet, connected, disconnect } = useWallet();
|
|
3287
3173
|
const [address, setAddress] = (0, import_react10.useState)("");
|
|
3288
3174
|
(0, import_react10.useEffect)(() => {
|
|
@@ -3295,16 +3181,16 @@ function ConnectedDropdown() {
|
|
|
3295
3181
|
afterConnectedWallet();
|
|
3296
3182
|
}
|
|
3297
3183
|
}, [connected, wallet]);
|
|
3298
|
-
return /* @__PURE__ */ (0,
|
|
3299
|
-
/* @__PURE__ */ (0,
|
|
3184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(DropdownMenu, { children: [
|
|
3185
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DropdownMenuTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Button, { variant: "outline", className: "mesh-text-white", children: [
|
|
3300
3186
|
address.slice(0, 6),
|
|
3301
3187
|
"...",
|
|
3302
3188
|
address.slice(-6)
|
|
3303
3189
|
] }) }),
|
|
3304
|
-
/* @__PURE__ */ (0,
|
|
3305
|
-
/* @__PURE__ */ (0,
|
|
3306
|
-
/* @__PURE__ */ (0,
|
|
3307
|
-
/* @__PURE__ */ (0,
|
|
3190
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(DropdownMenuContent, { children: [
|
|
3191
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DropdownMenuLabel, { children: "Wallet" }),
|
|
3192
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DropdownMenuSeparator, {}),
|
|
3193
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
3308
3194
|
DropdownMenuItem,
|
|
3309
3195
|
{
|
|
3310
3196
|
onClick: () => {
|
|
@@ -3313,7 +3199,7 @@ function ConnectedDropdown() {
|
|
|
3313
3199
|
children: "Copy Address"
|
|
3314
3200
|
}
|
|
3315
3201
|
),
|
|
3316
|
-
/* @__PURE__ */ (0,
|
|
3202
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
3317
3203
|
DropdownMenuItem,
|
|
3318
3204
|
{
|
|
3319
3205
|
onClick: () => {
|
|
@@ -3325,16 +3211,103 @@ function ConnectedDropdown() {
|
|
|
3325
3211
|
] })
|
|
3326
3212
|
] });
|
|
3327
3213
|
}
|
|
3328
|
-
|
|
3214
|
+
|
|
3215
|
+
// src/common/icons/icon-download.tsx
|
|
3216
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
3217
|
+
function IconDownload() {
|
|
3218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
3219
|
+
"svg",
|
|
3220
|
+
{
|
|
3221
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3222
|
+
width: "24",
|
|
3223
|
+
height: "24",
|
|
3224
|
+
viewBox: "0 0 24 24",
|
|
3225
|
+
fill: "none",
|
|
3226
|
+
stroke: "gray",
|
|
3227
|
+
strokeWidth: "2",
|
|
3228
|
+
strokeLinecap: "round",
|
|
3229
|
+
strokeLinejoin: "round",
|
|
3230
|
+
style: {
|
|
3231
|
+
color: "#ffadff",
|
|
3232
|
+
width: "24px",
|
|
3233
|
+
height: "24px",
|
|
3234
|
+
strokeWidth: "1px"
|
|
3235
|
+
},
|
|
3236
|
+
className: "hover:mesh-fill-white",
|
|
3237
|
+
children: [
|
|
3238
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
3239
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("polyline", { points: "7 10 12 15 17 10" }),
|
|
3240
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("line", { x1: "12", x2: "12", y1: "15", y2: "3" })
|
|
3241
|
+
]
|
|
3242
|
+
}
|
|
3243
|
+
);
|
|
3244
|
+
}
|
|
3245
|
+
|
|
3246
|
+
// src/common/icons/icon-monitor-smartphone.tsx
|
|
3247
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
3248
|
+
function IconMonitorSmartphone() {
|
|
3249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
3250
|
+
"svg",
|
|
3251
|
+
{
|
|
3252
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3253
|
+
width: "24",
|
|
3254
|
+
height: "24",
|
|
3255
|
+
viewBox: "0 0 24 24",
|
|
3256
|
+
fill: "none",
|
|
3257
|
+
stroke: "black",
|
|
3258
|
+
strokeWidth: "2",
|
|
3259
|
+
strokeLinecap: "round",
|
|
3260
|
+
strokeLinejoin: "round",
|
|
3261
|
+
style: {
|
|
3262
|
+
color: "#ffadff",
|
|
3263
|
+
width: "56px",
|
|
3264
|
+
height: "56px",
|
|
3265
|
+
strokeWidth: "1px"
|
|
3266
|
+
},
|
|
3267
|
+
children: [
|
|
3268
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8" }),
|
|
3269
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M10 19v-3.96 3.15" }),
|
|
3270
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M7 19h5" }),
|
|
3271
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("rect", { width: "6", height: "10", x: "16", y: "12", rx: "2" })
|
|
3272
|
+
]
|
|
3273
|
+
}
|
|
3274
|
+
);
|
|
3275
|
+
}
|
|
3276
|
+
|
|
3277
|
+
// src/common/icons/wallet-icon.tsx
|
|
3278
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
3279
|
+
function WalletIcon({
|
|
3280
|
+
icon,
|
|
3281
|
+
name,
|
|
3282
|
+
action,
|
|
3283
|
+
iconReactNode
|
|
3284
|
+
}) {
|
|
3285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
3286
|
+
"button",
|
|
3287
|
+
{
|
|
3288
|
+
className: "mesh-flex mesh-items-center mesh-justify-center mesh-rounded-lg mesh-w-10 mesh-h-10 mesh-bg-neutral-50 mesh-border mesh-border-zinc-700 hover:mesh-border-zinc-200 mesh-cursor-pointer",
|
|
3289
|
+
onClick: action,
|
|
3290
|
+
children: [
|
|
3291
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("img", { src: icon, alt: name, className: "mesh-w-8 mesh-h-8" }),
|
|
3292
|
+
iconReactNode && iconReactNode
|
|
3293
|
+
]
|
|
3294
|
+
}
|
|
3295
|
+
);
|
|
3296
|
+
}
|
|
3297
|
+
|
|
3298
|
+
// src/cardano-wallet/screen-main.tsx
|
|
3299
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
3300
|
+
function ScreenMain({
|
|
3329
3301
|
metamask,
|
|
3330
3302
|
extensions,
|
|
3331
3303
|
setOpen,
|
|
3332
|
-
setScreen
|
|
3304
|
+
setScreen,
|
|
3305
|
+
cardanoPeerConnect
|
|
3333
3306
|
}) {
|
|
3334
3307
|
const wallets = useWalletList({ metamask });
|
|
3335
3308
|
const { connect } = useWallet();
|
|
3336
|
-
return /* @__PURE__ */ (0,
|
|
3337
|
-
wallets.map((wallet, index) => /* @__PURE__ */ (0,
|
|
3309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "mesh-grid mesh-gap-4 mesh-py-4 mesh-grid-cols-4 mesh-place-items-center", children: [
|
|
3310
|
+
wallets.map((wallet, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3338
3311
|
WalletIcon,
|
|
3339
3312
|
{
|
|
3340
3313
|
icon: wallet.icon,
|
|
@@ -3346,7 +3319,7 @@ function MainScreen({
|
|
|
3346
3319
|
},
|
|
3347
3320
|
index
|
|
3348
3321
|
)),
|
|
3349
|
-
/* @__PURE__ */ (0,
|
|
3322
|
+
cardanoPeerConnect && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3350
3323
|
WalletIcon,
|
|
3351
3324
|
{
|
|
3352
3325
|
iconReactNode: IconMonitorSmartphone(),
|
|
@@ -3355,26 +3328,191 @@ function MainScreen({
|
|
|
3355
3328
|
setScreen("p2p");
|
|
3356
3329
|
}
|
|
3357
3330
|
}
|
|
3331
|
+
),
|
|
3332
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3333
|
+
WalletIcon,
|
|
3334
|
+
{
|
|
3335
|
+
iconReactNode: IconDownload(),
|
|
3336
|
+
name: `Download`,
|
|
3337
|
+
action: () => {
|
|
3338
|
+
window.open(
|
|
3339
|
+
"https://developers.cardano.org/showcase/?tags=wallet",
|
|
3340
|
+
"_blank"
|
|
3341
|
+
);
|
|
3342
|
+
}
|
|
3343
|
+
}
|
|
3358
3344
|
)
|
|
3359
3345
|
] });
|
|
3360
3346
|
}
|
|
3361
3347
|
|
|
3348
|
+
// src/cardano-wallet/screen-p2p.tsx
|
|
3349
|
+
var import_react11 = require("react");
|
|
3350
|
+
|
|
3351
|
+
// src/common/cardano-peer-connect/index.ts
|
|
3352
|
+
var cjsCardanopeerconnect = __toESM(require("@fabianbormann/cardano-peer-connect"), 1);
|
|
3353
|
+
var cardanopeerconnect = cjsCardanopeerconnect;
|
|
3354
|
+
var exportedCardanopeerconnect = cardanopeerconnect?.default || cardanopeerconnect;
|
|
3355
|
+
var DAppPeerConnect = exportedCardanopeerconnect.DAppPeerConnect;
|
|
3356
|
+
|
|
3357
|
+
// src/cardano-wallet/screen-p2p.tsx
|
|
3358
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
3359
|
+
function ScreenP2P({
|
|
3360
|
+
cardanoPeerConnect
|
|
3361
|
+
}) {
|
|
3362
|
+
const dAppConnect = (0, import_react11.useRef)(null);
|
|
3363
|
+
const qrCodeField = (0, import_react11.useRef)(null);
|
|
3364
|
+
const [address, setAddress] = (0, import_react11.useState)("");
|
|
3365
|
+
const [copied, setCopied] = (0, import_react11.useState)(false);
|
|
3366
|
+
(0, import_react11.useEffect)(() => {
|
|
3367
|
+
if (cardanoPeerConnect) {
|
|
3368
|
+
if (dAppConnect.current === null) {
|
|
3369
|
+
dAppConnect.current = new DAppPeerConnect({
|
|
3370
|
+
dAppInfo: {
|
|
3371
|
+
name: cardanoPeerConnect.dAppInfo.name,
|
|
3372
|
+
url: cardanoPeerConnect.dAppInfo.url
|
|
3373
|
+
},
|
|
3374
|
+
announce: cardanoPeerConnect.announce,
|
|
3375
|
+
onApiInject: (name, address2) => {
|
|
3376
|
+
console.log("onApiInject", name, address2);
|
|
3377
|
+
},
|
|
3378
|
+
onApiEject: (name, address2) => {
|
|
3379
|
+
console.log("onApiEject", name, address2);
|
|
3380
|
+
},
|
|
3381
|
+
onConnect: (address2, walletInfo) => {
|
|
3382
|
+
console.log("Connected to wallet", address2, walletInfo);
|
|
3383
|
+
},
|
|
3384
|
+
onDisconnect: () => {
|
|
3385
|
+
console.log("Disconnected from wallet");
|
|
3386
|
+
},
|
|
3387
|
+
verifyConnection: (walletInfo, callback) => {
|
|
3388
|
+
console.log("verifyConnection", walletInfo);
|
|
3389
|
+
callback(true, true);
|
|
3390
|
+
},
|
|
3391
|
+
useWalletDiscovery: true
|
|
3392
|
+
});
|
|
3393
|
+
if (dAppConnect.current) {
|
|
3394
|
+
const address2 = dAppConnect.current.getAddress();
|
|
3395
|
+
setAddress(address2);
|
|
3396
|
+
console.log("address", address2);
|
|
3397
|
+
if (qrCodeField.current !== null) {
|
|
3398
|
+
dAppConnect.current.generateQRCode(qrCodeField.current);
|
|
3399
|
+
}
|
|
3400
|
+
}
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
}, []);
|
|
3404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mesh-flex mesh-flex-col mesh-items-center mesh-justify-center", children: [
|
|
3405
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { style: { marginTop: 16, marginBottom: 16 }, ref: qrCodeField }),
|
|
3406
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3407
|
+
Button,
|
|
3408
|
+
{
|
|
3409
|
+
variant: "outline",
|
|
3410
|
+
className: "mesh-text-white",
|
|
3411
|
+
onClick: () => {
|
|
3412
|
+
navigator.clipboard.writeText(address);
|
|
3413
|
+
setCopied(true);
|
|
3414
|
+
},
|
|
3415
|
+
children: copied ? "Copied" : "Copy Address"
|
|
3416
|
+
}
|
|
3417
|
+
)
|
|
3418
|
+
] });
|
|
3419
|
+
}
|
|
3420
|
+
|
|
3421
|
+
// src/cardano-wallet/index.tsx
|
|
3422
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
3423
|
+
var CardanoWallet = ({
|
|
3424
|
+
label = "Connect Wallet",
|
|
3425
|
+
onConnected = void 0,
|
|
3426
|
+
isDark = false,
|
|
3427
|
+
metamask = void 0,
|
|
3428
|
+
extensions = [],
|
|
3429
|
+
cardanoPeerConnect = void 0
|
|
3430
|
+
}) => {
|
|
3431
|
+
const [open, setOpen] = (0, import_react12.useState)(false);
|
|
3432
|
+
const [screen, setScreen] = (0, import_react12.useState)("main");
|
|
3433
|
+
const { wallet, connected } = useWallet();
|
|
3434
|
+
(0, import_react12.useEffect)(() => {
|
|
3435
|
+
if (connected && wallet) {
|
|
3436
|
+
if (onConnected) onConnected();
|
|
3437
|
+
}
|
|
3438
|
+
}, [connected, wallet]);
|
|
3439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Dialog, { open, onOpenChange: setOpen, children: [
|
|
3440
|
+
!connected ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Button, { variant: "outline", className: "mesh-text-white", children: label }) }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ConnectedButton, {}),
|
|
3441
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(DialogContent, { className: "sm:mesh-max-w-[425px]", children: [
|
|
3442
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Header, { screen, setScreen }),
|
|
3443
|
+
screen == "main" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3444
|
+
ScreenMain,
|
|
3445
|
+
{
|
|
3446
|
+
metamask,
|
|
3447
|
+
extensions,
|
|
3448
|
+
setOpen,
|
|
3449
|
+
setScreen,
|
|
3450
|
+
cardanoPeerConnect
|
|
3451
|
+
}
|
|
3452
|
+
),
|
|
3453
|
+
screen == "p2p" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ScreenP2P, { cardanoPeerConnect }),
|
|
3454
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Footer, {})
|
|
3455
|
+
] })
|
|
3456
|
+
] });
|
|
3457
|
+
};
|
|
3458
|
+
function Header({
|
|
3459
|
+
screen,
|
|
3460
|
+
setScreen
|
|
3461
|
+
}) {
|
|
3462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(DialogHeader, { children: [
|
|
3463
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(DialogTitle, { className: "mesh-flex mesh-justify-between", children: [
|
|
3464
|
+
screen != "main" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { onClick: () => setScreen("main"), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconChevronRight, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { width: "24px" } }),
|
|
3465
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { children: [
|
|
3466
|
+
screen == "main" && "Connect Wallet",
|
|
3467
|
+
screen == "p2p" && "P2P Connect"
|
|
3468
|
+
] }),
|
|
3469
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { style: { width: "24px" } })
|
|
3470
|
+
] }),
|
|
3471
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogDescription, { children: screen == "p2p" && "Use wallet that supports CIP-45, scan this QR code to connect." })
|
|
3472
|
+
] });
|
|
3473
|
+
}
|
|
3474
|
+
function Footer() {
|
|
3475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DialogFooter, { className: "mesh-justify-center mesh-text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
3476
|
+
"a",
|
|
3477
|
+
{
|
|
3478
|
+
href: "https://meshjs.dev/",
|
|
3479
|
+
target: "_blank",
|
|
3480
|
+
className: "mesh-grow mesh-flex mesh-gap-1 mesh-items-center mesh-justify-center mesh-text-zinc-500 hover:mesh-text-white mesh-fill-zinc-500 hover:mesh-fill-white",
|
|
3481
|
+
children: [
|
|
3482
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "", children: "Powered by" }),
|
|
3483
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3484
|
+
"svg",
|
|
3485
|
+
{
|
|
3486
|
+
width: 24,
|
|
3487
|
+
height: 24,
|
|
3488
|
+
enableBackground: "new 0 0 300 200",
|
|
3489
|
+
viewBox: "0 0 300 200",
|
|
3490
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3491
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "m289 127-45-60-45-60c-.9-1.3-2.4-2-4-2s-3.1.7-4 2l-37 49.3c-2 2.7-6 2.7-8 0l-37-49.3c-.9-1.3-2.4-2-4-2s-3.1.7-4 2l-45 60-45 60c-1.3 1.8-1.3 4.2 0 6l45 60c.9 1.3 2.4 2 4 2s3.1-.7 4-2l37-49.3c2-2.7 6-2.7 8 0l37 49.3c.9 1.3 2.4 2 4 2s3.1-.7 4-2l37-49.3c2-2.7 6-2.7 8 0l37 49.3c.9 1.3 2.4 2 4 2s3.1-.7 4-2l45-60c1.3-1.8 1.3-4.2 0-6zm-90-103.3 32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0l-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0zm-90 0 32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0l-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0zm-53 152.6-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0l32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0zm90 0-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0l32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0zm90 0-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0l32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0z" })
|
|
3492
|
+
}
|
|
3493
|
+
),
|
|
3494
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "", children: "Mesh SDK" })
|
|
3495
|
+
]
|
|
3496
|
+
}
|
|
3497
|
+
) });
|
|
3498
|
+
}
|
|
3499
|
+
|
|
3362
3500
|
// src/mesh-badge/mesh-logo.tsx
|
|
3363
|
-
var
|
|
3364
|
-
var MeshLogo = () => /* @__PURE__ */ (0,
|
|
3501
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
3502
|
+
var MeshLogo = () => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3365
3503
|
"svg",
|
|
3366
3504
|
{
|
|
3367
3505
|
className: "mesh-h-16 mesh-p-2",
|
|
3368
3506
|
fill: "currentColor",
|
|
3369
3507
|
viewBox: "0 0 300 200",
|
|
3370
3508
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3371
|
-
children: /* @__PURE__ */ (0,
|
|
3509
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "m289 127-45-60-45-60c-.9-1.3-2.4-2-4-2s-3.1.7-4 2l-37 49.3c-2 2.7-6 2.7-8 0l-37-49.3c-.9-1.3-2.4-2-4-2s-3.1.7-4 2l-45 60-45 60c-1.3 1.8-1.3 4.2 0 6l45 60c.9 1.3 2.4 2 4 2s3.1-.7 4-2l37-49.3c2-2.7 6-2.7 8 0l37 49.3c.9 1.3 2.4 2 4 2s3.1-.7 4-2l37-49.3c2-2.7 6-2.7 8 0l37 49.3c.9 1.3 2.4 2 4 2s3.1-.7 4-2l45-60c1.3-1.8 1.3-4.2 0-6zm-90-103.3 32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0l-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0zm-90 0 32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0l-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0zm-53 152.6-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0l32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0zm90 0-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0l32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0zm90 0-32.5-43.3c-1.3-1.8-1.3-4.2 0-6l32.5-43.3c2-2.7 6-2.7 8 0l32.5 43.3c1.3 1.8 1.3 4.2 0 6l-32.5 43.3c-2 2.7-6 2.7-8 0z" })
|
|
3372
3510
|
}
|
|
3373
3511
|
);
|
|
3374
3512
|
|
|
3375
3513
|
// src/mesh-badge/index.tsx
|
|
3376
|
-
var
|
|
3377
|
-
var MeshBadge = ({ isDark = false }) => /* @__PURE__ */ (0,
|
|
3514
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
3515
|
+
var MeshBadge = ({ isDark = false }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
3378
3516
|
"a",
|
|
3379
3517
|
{
|
|
3380
3518
|
className: `mesh-flex mesh-max-w-fit mesh-flex-col mesh-items-center mesh-rounded-md mesh-border mesh-border-solid mesh-border-current mesh-p-1 mesh-text-xl mesh-font-semibold mesh-no-underline ${isDark ? `mesh-bg-neutral-950 mesh-text-neutral-50` : `mesh-bg-neutral-50 mesh-text-neutral-950`}`,
|
|
@@ -3386,21 +3524,21 @@ var MeshBadge = ({ isDark = false }) => /* @__PURE__ */ (0, import_jsx_runtime11
|
|
|
3386
3524
|
rel: "noopener noreferrer",
|
|
3387
3525
|
target: "_blank",
|
|
3388
3526
|
children: [
|
|
3389
|
-
/* @__PURE__ */ (0,
|
|
3527
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MeshLogo, {}),
|
|
3390
3528
|
"Mesh"
|
|
3391
3529
|
]
|
|
3392
3530
|
}
|
|
3393
3531
|
);
|
|
3394
3532
|
|
|
3395
3533
|
// src/stake-button/index.tsx
|
|
3396
|
-
var
|
|
3534
|
+
var import_react14 = require("react");
|
|
3397
3535
|
var import_transaction = require("@meshsdk/transaction");
|
|
3398
3536
|
|
|
3399
3537
|
// src/cardano-wallet-dropdown/index.tsx
|
|
3400
|
-
var
|
|
3538
|
+
var import_react13 = require("react");
|
|
3401
3539
|
|
|
3402
3540
|
// src/common/button-dropdown.tsx
|
|
3403
|
-
var
|
|
3541
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
3404
3542
|
function ButtonDropdown({
|
|
3405
3543
|
children,
|
|
3406
3544
|
isDarkMode = false,
|
|
@@ -3409,7 +3547,7 @@ function ButtonDropdown({
|
|
|
3409
3547
|
onMouseEnter,
|
|
3410
3548
|
onMouseLeave
|
|
3411
3549
|
}) {
|
|
3412
|
-
return /* @__PURE__ */ (0,
|
|
3550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
3413
3551
|
"button",
|
|
3414
3552
|
{
|
|
3415
3553
|
className: `mesh-mr-menu-list mesh-flex mesh-w-60 mesh-items-center mesh-justify-center mesh-rounded-t-md mesh-border mesh-px-4 mesh-py-2 mesh-text-lg mesh-font-normal mesh-shadow-sm ${isDarkMode ? `mesh-bg-neutral-950 mesh-text-neutral-50` : `mesh-bg-neutral-50 mesh-text-neutral-950`}`,
|
|
@@ -3422,21 +3560,21 @@ function ButtonDropdown({
|
|
|
3422
3560
|
}
|
|
3423
3561
|
|
|
3424
3562
|
// src/cardano-wallet-dropdown/menu-item.tsx
|
|
3425
|
-
var
|
|
3563
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
3426
3564
|
function MenuItem({
|
|
3427
3565
|
icon,
|
|
3428
3566
|
label,
|
|
3429
3567
|
action,
|
|
3430
3568
|
active
|
|
3431
3569
|
}) {
|
|
3432
|
-
return /* @__PURE__ */ (0,
|
|
3570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
3433
3571
|
"div",
|
|
3434
3572
|
{
|
|
3435
3573
|
className: "mesh-flex mesh-cursor-pointer mesh-items-center mesh-px-4 mesh-py-2 mesh-opacity-80 hover:mesh-opacity-100 mesh-h-16",
|
|
3436
3574
|
onClick: action,
|
|
3437
3575
|
children: [
|
|
3438
|
-
icon && /* @__PURE__ */ (0,
|
|
3439
|
-
/* @__PURE__ */ (0,
|
|
3576
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("img", { className: "mesh-pr-2 mesh-m-1 mesh-h-8", src: icon }),
|
|
3577
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "mesh-mr-menu-item mesh-text-xl mesh-font-normal mesh-text-gray-700 hover:mesh-text-black", children: label.split(" ").map((word) => {
|
|
3440
3578
|
return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
|
|
3441
3579
|
}).join(" ") })
|
|
3442
3580
|
]
|
|
@@ -3445,8 +3583,8 @@ function MenuItem({
|
|
|
3445
3583
|
}
|
|
3446
3584
|
|
|
3447
3585
|
// src/cardano-wallet-dropdown/chevron-down.tsx
|
|
3448
|
-
var
|
|
3449
|
-
var ChevronDown = () => /* @__PURE__ */ (0,
|
|
3586
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3587
|
+
var ChevronDown = () => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3450
3588
|
"svg",
|
|
3451
3589
|
{
|
|
3452
3590
|
className: "mesh-m-2 mesh-h-6",
|
|
@@ -3455,7 +3593,7 @@ var ChevronDown = () => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
|
3455
3593
|
viewBox: "0 0 24 24",
|
|
3456
3594
|
stroke: "currentColor",
|
|
3457
3595
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3458
|
-
children: /* @__PURE__ */ (0,
|
|
3596
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3459
3597
|
"path",
|
|
3460
3598
|
{
|
|
3461
3599
|
strokeLinecap: "round",
|
|
@@ -3468,7 +3606,7 @@ var ChevronDown = () => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
|
3468
3606
|
);
|
|
3469
3607
|
|
|
3470
3608
|
// src/cardano-wallet-dropdown/wallet-balance.tsx
|
|
3471
|
-
var
|
|
3609
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3472
3610
|
var WalletBalance = ({
|
|
3473
3611
|
connected,
|
|
3474
3612
|
connecting,
|
|
@@ -3476,22 +3614,22 @@ var WalletBalance = ({
|
|
|
3476
3614
|
wallet
|
|
3477
3615
|
}) => {
|
|
3478
3616
|
const lovelace = useLovelace();
|
|
3479
|
-
return connected && lovelace && wallet?.icon ? /* @__PURE__ */ (0,
|
|
3480
|
-
/* @__PURE__ */ (0,
|
|
3617
|
+
return connected && lovelace && wallet?.icon ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
3618
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("img", { className: "mesh-m-2 mesh-h-6", src: wallet.icon }),
|
|
3481
3619
|
"\u20B3",
|
|
3482
3620
|
" ",
|
|
3483
3621
|
parseInt((parseInt(lovelace, 10) / 1e6).toString(), 10),
|
|
3484
3622
|
".",
|
|
3485
|
-
/* @__PURE__ */ (0,
|
|
3486
|
-
] }) : connected && wallet?.icon ? /* @__PURE__ */ (0,
|
|
3623
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "mesh-text-xs", children: lovelace.substring(lovelace.length - 6) })
|
|
3624
|
+
] }) : connected && wallet?.icon ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_jsx_runtime19.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("img", { className: "mesh-m-2 mesh-h-6", src: wallet.icon }) }) : connecting ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_jsx_runtime19.Fragment, { children: "Connecting..." }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
3487
3625
|
label,
|
|
3488
3626
|
" ",
|
|
3489
|
-
/* @__PURE__ */ (0,
|
|
3627
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChevronDown, {})
|
|
3490
3628
|
] });
|
|
3491
3629
|
};
|
|
3492
3630
|
|
|
3493
3631
|
// src/cardano-wallet-dropdown/index.tsx
|
|
3494
|
-
var
|
|
3632
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3495
3633
|
var CardanoWallet2 = ({
|
|
3496
3634
|
label = "Connect Wallet",
|
|
3497
3635
|
onConnected = void 0,
|
|
@@ -3500,32 +3638,32 @@ var CardanoWallet2 = ({
|
|
|
3500
3638
|
extensions = [],
|
|
3501
3639
|
cardanoPeerConnect = void 0
|
|
3502
3640
|
}) => {
|
|
3503
|
-
const [isDarkMode, setIsDarkMode] = (0,
|
|
3504
|
-
const [hideMenuList, setHideMenuList] = (0,
|
|
3641
|
+
const [isDarkMode, setIsDarkMode] = (0, import_react13.useState)(false);
|
|
3642
|
+
const [hideMenuList, setHideMenuList] = (0, import_react13.useState)(true);
|
|
3505
3643
|
const { connect, connecting, connected, disconnect, name } = useWallet();
|
|
3506
3644
|
const wallets = useWalletList({ metamask });
|
|
3507
|
-
(0,
|
|
3645
|
+
(0, import_react13.useEffect)(() => {
|
|
3508
3646
|
if (connected && onConnected) {
|
|
3509
3647
|
onConnected();
|
|
3510
3648
|
}
|
|
3511
3649
|
}, [connected]);
|
|
3512
|
-
(0,
|
|
3650
|
+
(0, import_react13.useEffect)(() => {
|
|
3513
3651
|
setIsDarkMode(isDark);
|
|
3514
3652
|
}, [isDark]);
|
|
3515
|
-
return /* @__PURE__ */ (0,
|
|
3653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3516
3654
|
"div",
|
|
3517
3655
|
{
|
|
3518
3656
|
onMouseEnter: () => setHideMenuList(false),
|
|
3519
3657
|
onMouseLeave: () => setHideMenuList(true),
|
|
3520
3658
|
style: { width: "min-content", zIndex: 50 },
|
|
3521
3659
|
children: [
|
|
3522
|
-
/* @__PURE__ */ (0,
|
|
3660
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3523
3661
|
ButtonDropdown,
|
|
3524
3662
|
{
|
|
3525
3663
|
isDarkMode,
|
|
3526
3664
|
hideMenuList,
|
|
3527
3665
|
setHideMenuList,
|
|
3528
|
-
children: /* @__PURE__ */ (0,
|
|
3666
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3529
3667
|
WalletBalance,
|
|
3530
3668
|
{
|
|
3531
3669
|
connected,
|
|
@@ -3536,12 +3674,12 @@ var CardanoWallet2 = ({
|
|
|
3536
3674
|
)
|
|
3537
3675
|
}
|
|
3538
3676
|
),
|
|
3539
|
-
/* @__PURE__ */ (0,
|
|
3677
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3540
3678
|
"div",
|
|
3541
3679
|
{
|
|
3542
3680
|
className: `mesh-mr-menu-list mesh-absolute mesh-w-60 mesh-rounded-b-md mesh-border mesh-text-center mesh-shadow-sm mesh-backdrop-blur ${hideMenuList && "mesh-hidden"} ${isDarkMode ? `mesh-bg-neutral-950 mesh-text-neutral-50` : `mesh-bg-neutral-50 mesh-text-neutral-950`}`,
|
|
3543
3681
|
style: { zIndex: 50 },
|
|
3544
|
-
children: !connected && wallets.length > 0 ? /* @__PURE__ */ (0,
|
|
3682
|
+
children: !connected && wallets.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: wallets.map((wallet, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3545
3683
|
MenuItem,
|
|
3546
3684
|
{
|
|
3547
3685
|
icon: wallet.icon,
|
|
@@ -3553,7 +3691,7 @@ var CardanoWallet2 = ({
|
|
|
3553
3691
|
active: name === wallet.id
|
|
3554
3692
|
},
|
|
3555
3693
|
index
|
|
3556
|
-
)) }) : wallets.length === 0 ? /* @__PURE__ */ (0,
|
|
3694
|
+
)) }) : wallets.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: "No Wallet Found" }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3557
3695
|
MenuItem,
|
|
3558
3696
|
{
|
|
3559
3697
|
active: false,
|
|
@@ -3570,7 +3708,7 @@ var CardanoWallet2 = ({
|
|
|
3570
3708
|
};
|
|
3571
3709
|
|
|
3572
3710
|
// src/stake-button/index.tsx
|
|
3573
|
-
var
|
|
3711
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3574
3712
|
var StakeButton = ({
|
|
3575
3713
|
label = "Stake your ADA",
|
|
3576
3714
|
isDark = false,
|
|
@@ -3578,19 +3716,19 @@ var StakeButton = ({
|
|
|
3578
3716
|
onCheck,
|
|
3579
3717
|
onDelegated = void 0
|
|
3580
3718
|
}) => {
|
|
3581
|
-
const [isDarkMode, setIsDarkMode] = (0,
|
|
3719
|
+
const [isDarkMode, setIsDarkMode] = (0, import_react14.useState)(false);
|
|
3582
3720
|
const { connected } = useWallet();
|
|
3583
|
-
(0,
|
|
3721
|
+
(0, import_react14.useEffect)(() => {
|
|
3584
3722
|
setIsDarkMode(isDark);
|
|
3585
3723
|
}, [isDark]);
|
|
3586
|
-
return /* @__PURE__ */ (0,
|
|
3724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children: connected ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ButtonDropdown, { isDarkMode, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3587
3725
|
Delegate,
|
|
3588
3726
|
{
|
|
3589
3727
|
poolId,
|
|
3590
3728
|
onCheck,
|
|
3591
3729
|
onDelegated
|
|
3592
3730
|
}
|
|
3593
|
-
) }) : /* @__PURE__ */ (0,
|
|
3731
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CardanoWallet2, { label, isDark }) });
|
|
3594
3732
|
};
|
|
3595
3733
|
var Delegate = ({
|
|
3596
3734
|
poolId,
|
|
@@ -3599,11 +3737,11 @@ var Delegate = ({
|
|
|
3599
3737
|
}) => {
|
|
3600
3738
|
const { wallet } = useWallet();
|
|
3601
3739
|
const rewardAddress = useRewardAddress();
|
|
3602
|
-
const [_, setError] = (0,
|
|
3603
|
-
const [checking, setChecking] = (0,
|
|
3604
|
-
const [accountInfo, setAccountInfo] = (0,
|
|
3605
|
-
const [processing, setProcessing] = (0,
|
|
3606
|
-
const [done, setDone] = (0,
|
|
3740
|
+
const [_, setError] = (0, import_react14.useState)();
|
|
3741
|
+
const [checking, setChecking] = (0, import_react14.useState)(false);
|
|
3742
|
+
const [accountInfo, setAccountInfo] = (0, import_react14.useState)();
|
|
3743
|
+
const [processing, setProcessing] = (0, import_react14.useState)(false);
|
|
3744
|
+
const [done, setDone] = (0, import_react14.useState)(false);
|
|
3607
3745
|
const checkAccountStatus = async () => {
|
|
3608
3746
|
try {
|
|
3609
3747
|
setChecking(true);
|
|
@@ -3654,22 +3792,22 @@ var Delegate = ({
|
|
|
3654
3792
|
}
|
|
3655
3793
|
setProcessing(false);
|
|
3656
3794
|
};
|
|
3657
|
-
(0,
|
|
3795
|
+
(0, import_react14.useEffect)(() => {
|
|
3658
3796
|
checkAccountStatus();
|
|
3659
3797
|
}, [rewardAddress]);
|
|
3660
3798
|
if (checking) {
|
|
3661
|
-
return /* @__PURE__ */ (0,
|
|
3799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "Checking..." });
|
|
3662
3800
|
}
|
|
3663
3801
|
if (processing) {
|
|
3664
|
-
return /* @__PURE__ */ (0,
|
|
3802
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "Loading..." });
|
|
3665
3803
|
}
|
|
3666
3804
|
if (done) {
|
|
3667
|
-
return /* @__PURE__ */ (0,
|
|
3805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "Stake Delegated" });
|
|
3668
3806
|
}
|
|
3669
3807
|
if (accountInfo?.active) {
|
|
3670
|
-
return accountInfo.poolId === poolId ? /* @__PURE__ */ (0,
|
|
3808
|
+
return accountInfo.poolId === poolId ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "Stake Delegated" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { onClick: delegateStake, children: "Begin Staking" });
|
|
3671
3809
|
}
|
|
3672
|
-
return /* @__PURE__ */ (0,
|
|
3810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { onClick: registerAddress, children: "Begin Staking" });
|
|
3673
3811
|
};
|
|
3674
3812
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3675
3813
|
0 && (module.exports = {
|