@medialane/ui 0.349.0 → 0.351.0
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/components/account/add-guardian-dialog.cjs +1 -1
- package/dist/components/account/add-guardian-dialog.cjs.map +1 -1
- package/dist/components/account/add-guardian-dialog.js +1 -1
- package/dist/components/account/add-guardian-dialog.js.map +1 -1
- package/dist/components/account/guardian-recovery-section.cjs +2 -2
- package/dist/components/account/guardian-recovery-section.cjs.map +1 -1
- package/dist/components/account/guardian-recovery-section.js +2 -2
- package/dist/components/account/guardian-recovery-section.js.map +1 -1
- package/dist/components/account/input-otp.d.cts +2 -2
- package/dist/components/account/input-otp.d.ts +2 -2
- package/dist/components/button.d.cts +2 -2
- package/dist/components/button.d.ts +2 -2
- package/dist/components/fast-mint/fast-mint.d.cts +2 -2
- package/dist/components/fast-mint/fast-mint.d.ts +2 -2
- package/dist/components/gradient-button.cjs +24 -10
- package/dist/components/gradient-button.cjs.map +1 -1
- package/dist/components/gradient-button.d.cts +2 -1
- package/dist/components/gradient-button.d.ts +2 -1
- package/dist/components/gradient-button.js +24 -10
- package/dist/components/gradient-button.js.map +1 -1
- package/dist/components/launchpad/edition-mint-schema.d.cts +2 -2
- package/dist/components/launchpad/edition-mint-schema.d.ts +2 -2
- package/dist/components/marketplace-dialog-primitives.cjs +2 -2
- package/dist/components/marketplace-dialog-primitives.cjs.map +1 -1
- package/dist/components/marketplace-dialog-primitives.d.cts +1 -2
- package/dist/components/marketplace-dialog-primitives.d.ts +1 -2
- package/dist/components/marketplace-dialog-primitives.js +2 -2
- package/dist/components/marketplace-dialog-primitives.js.map +1 -1
- package/dist/components/order-fields.cjs +100 -0
- package/dist/components/order-fields.cjs.map +1 -0
- package/dist/components/order-fields.d.cts +20 -0
- package/dist/components/order-fields.d.ts +20 -0
- package/dist/components/order-fields.js +76 -0
- package/dist/components/order-fields.js.map +1 -0
- package/dist/components/pop-burn-button.cjs +1 -1
- package/dist/components/pop-burn-button.cjs.map +1 -1
- package/dist/components/pop-burn-button.js +1 -1
- package/dist/components/pop-burn-button.js.map +1 -1
- package/dist/components/sheet.d.cts +1 -1
- package/dist/components/sheet.d.ts +1 -1
- package/dist/components/transaction-dialog.cjs +1 -1
- package/dist/components/transaction-dialog.cjs.map +1 -1
- package/dist/components/transaction-dialog.js +1 -1
- package/dist/components/transaction-dialog.js.map +1 -1
- package/dist/components/transfer-dialog.cjs +3 -3
- package/dist/components/transfer-dialog.cjs.map +1 -1
- package/dist/components/transfer-dialog.js +3 -3
- package/dist/components/transfer-dialog.js.map +1 -1
- package/dist/components/wallet/export-key-section.cjs +3 -7
- package/dist/components/wallet/export-key-section.cjs.map +1 -1
- package/dist/components/wallet/export-key-section.js +3 -7
- package/dist/components/wallet/export-key-section.js.map +1 -1
- package/dist/index.cjs +19 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/order-form.cjs +57 -0
- package/dist/utils/order-form.cjs.map +1 -0
- package/dist/utils/order-form.d.cts +35 -0
- package/dist/utils/order-form.d.ts +35 -0
- package/dist/utils/order-form.js +21 -0
- package/dist/utils/order-form.js.map +1 -0
- package/dist/utils/use-session.cjs +65 -0
- package/dist/utils/use-session.cjs.map +1 -0
- package/dist/utils/use-session.d.cts +11 -0
- package/dist/utils/use-session.d.ts +11 -0
- package/dist/utils/use-session.js +28 -0
- package/dist/utils/use-session.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/transaction-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { Button } from \"./button.js\";\nimport { useConfetti } from \"../utils/use-confetti.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\n\nexport interface TransactionDialogProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"phase\" | \"error\" | \"reset\"> & { retryable?: boolean };\n title: string;\n workingLabel: string;\n firstStepLabel?: string;\n children?: ReactNode;\n}\n\nconst ACTIVE_STEP = { preparing: 0, submitting: 1, confirming: 2 } as const;\n\nexport function TransactionDialog({ tx, title, workingLabel, firstStepLabel = \"Prepare\", children }: TransactionDialogProps) {\n const { phase, error, reset, retryable = true } = tx;\n const working = phase === \"preparing\" || phase === \"submitting\" || phase === \"confirming\";\n const success = phase === \"success\";\n const failed = phase === \"error\";\n const steps = [firstStepLabel, \"Submit transaction\", \"Confirm transaction\"];\n\n useConfetti(success);\n\n return (\n <Dialog open={phase !== \"idle\"} modal onOpenChange={(open) => { if (!open && !working) reset(); }}>\n <DialogContent\n className=\"sm:max-w-md\"\n onInteractOutside={working ? (e) => e.preventDefault() : undefined}\n onEscapeKeyDown={working ? (e) => e.preventDefault() : undefined}\n {...(working ? { hideClose: true } : {})}\n >\n <DialogTitle className=\"sr-only\">{working ? workingLabel : title}</DialogTitle>\n\n {working && (\n <div className=\"flex flex-col items-center gap-6 py-4\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-primary/10\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-lg font-semibold\">{workingLabel}</p>\n <p className=\"text-sm text-muted-foreground\">\n {phase === \"confirming\" ? \"Waiting for block confirmation\" : \"Submitting transaction\"}\n </p>\n </div>\n <ol className=\"w-full space-y-2 rounded-xl border border-border/60 bg-muted/30 p-4\">\n {steps.map((label, i) => {\n const active = i === ACTIVE_STEP[phase];\n const done = i < ACTIVE_STEP[phase];\n return (\n <li key={label} data-step aria-current={active ? \"step\" : undefined} className=\"flex items-center gap-3\">\n {done ? (\n <CheckCircle2 className=\"h-4 w-4 shrink-0 text-emerald-500\" />\n ) : active ? (\n <Loader2 className=\"h-4 w-4 shrink-0 animate-spin text-primary\" />\n ) : (\n <div className=\"h-4 w-4 shrink-0 rounded-full border-2 border-muted-foreground/30\" />\n )}\n <span className={done ? \"text-sm text-foreground\" : active ? \"text-sm font-medium text-primary\" : \"text-sm text-muted-foreground\"}>\n {label}\n </span>\n </li>\n );\n })}\n </ol>\n <p className=\"text-center text-xs text-muted-foreground\">This usually takes 10–30 seconds
|
|
1
|
+
{"version":3,"sources":["../../src/components/transaction-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { Button } from \"./button.js\";\nimport { useConfetti } from \"../utils/use-confetti.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\n\nexport interface TransactionDialogProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"phase\" | \"error\" | \"reset\"> & { retryable?: boolean };\n title: string;\n workingLabel: string;\n firstStepLabel?: string;\n children?: ReactNode;\n}\n\nconst ACTIVE_STEP = { preparing: 0, submitting: 1, confirming: 2 } as const;\n\nexport function TransactionDialog({ tx, title, workingLabel, firstStepLabel = \"Prepare\", children }: TransactionDialogProps) {\n const { phase, error, reset, retryable = true } = tx;\n const working = phase === \"preparing\" || phase === \"submitting\" || phase === \"confirming\";\n const success = phase === \"success\";\n const failed = phase === \"error\";\n const steps = [firstStepLabel, \"Submit transaction\", \"Confirm transaction\"];\n\n useConfetti(success);\n\n return (\n <Dialog open={phase !== \"idle\"} modal onOpenChange={(open) => { if (!open && !working) reset(); }}>\n <DialogContent\n className=\"sm:max-w-md\"\n onInteractOutside={working ? (e) => e.preventDefault() : undefined}\n onEscapeKeyDown={working ? (e) => e.preventDefault() : undefined}\n {...(working ? { hideClose: true } : {})}\n >\n <DialogTitle className=\"sr-only\">{working ? workingLabel : title}</DialogTitle>\n\n {working && (\n <div className=\"flex flex-col items-center gap-6 py-4\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-primary/10\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-lg font-semibold\">{workingLabel}</p>\n <p className=\"text-sm text-muted-foreground\">\n {phase === \"confirming\" ? \"Waiting for block confirmation\" : \"Submitting transaction\"}\n </p>\n </div>\n <ol className=\"w-full space-y-2 rounded-xl border border-border/60 bg-muted/30 p-4\">\n {steps.map((label, i) => {\n const active = i === ACTIVE_STEP[phase];\n const done = i < ACTIVE_STEP[phase];\n return (\n <li key={label} data-step aria-current={active ? \"step\" : undefined} className=\"flex items-center gap-3\">\n {done ? (\n <CheckCircle2 className=\"h-4 w-4 shrink-0 text-emerald-500\" />\n ) : active ? (\n <Loader2 className=\"h-4 w-4 shrink-0 animate-spin text-primary\" />\n ) : (\n <div className=\"h-4 w-4 shrink-0 rounded-full border-2 border-muted-foreground/30\" />\n )}\n <span className={done ? \"text-sm text-foreground\" : active ? \"text-sm font-medium text-primary\" : \"text-sm text-muted-foreground\"}>\n {label}\n </span>\n </li>\n );\n })}\n </ol>\n <p className=\"text-center text-xs text-muted-foreground\">This usually takes 10–30 seconds.</p>\n </div>\n )}\n\n {success && children}\n\n {failed && (\n <div className=\"flex flex-col items-center gap-5 py-2\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10\">\n <XCircle className=\"h-9 w-9 text-destructive\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-xl font-bold\">{title}</p>\n <p className=\"mx-auto max-w-xs text-sm text-muted-foreground\">{error}</p>\n </div>\n <Button variant=\"outline\" className=\"w-full\" onClick={reset}>\n {retryable ? \"Try again\" : \"Close\"}\n </Button>\n </div>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCQ;AAjCR,0BAA+C;AAC/C,oBAAmD;AACnD,oBAAuB;AACvB,0BAA4B;AAW5B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AAU,2BAC5E;AAAA,qBACC,4CAAC,oCAAa,WAAU,qCAAoC,IAC1D,SACF,4CAAC,+BAAQ,WAAU,8CAA6C,IAEhE,4CAAC,SAAI,WAAU,qEAAoE;AAAA,cAErF,4CAAC,UAAK,WAAW,OAAO,4BAA4B,SAAS,qCAAqC,iCAC/F,iBACH;AAAA,iBAVO,KAWT;AAAA,UAEJ,CAAC,GACH;AAAA,UACA,4CAAC,OAAE,WAAU,6CAA4C,oDAAiC;AAAA,WAC5F;AAAA,QAGD,WAAW;AAAA,QAEX,UACC,6CAAC,SAAI,WAAU,yCACb;AAAA,sDAAC,SAAI,WAAU,6EACb,sDAAC,+BAAQ,WAAU,4BAA2B,GAChD;AAAA,UACA,6CAAC,SAAI,WAAU,yBACb;AAAA,wDAAC,OAAE,WAAU,qBAAqB,iBAAM;AAAA,YACxC,4CAAC,OAAE,WAAU,kDAAkD,iBAAM;AAAA,aACvE;AAAA,UACA,4CAAC,wBAAO,SAAQ,WAAU,WAAU,UAAS,SAAS,OACnD,sBAAY,cAAc,SAC7B;AAAA,WACF;AAAA;AAAA;AAAA,EAEJ,GACF;AAEJ;","names":[]}
|
|
@@ -37,7 +37,7 @@ function TransactionDialog({ tx, title, workingLabel, firstStepLabel = "Prepare"
|
|
|
37
37
|
/* @__PURE__ */ jsx("span", { className: done ? "text-sm text-foreground" : active ? "text-sm font-medium text-primary" : "text-sm text-muted-foreground", children: label })
|
|
38
38
|
] }, label);
|
|
39
39
|
}) }),
|
|
40
|
-
/* @__PURE__ */ jsx("p", { className: "text-center text-xs text-muted-foreground", children: "This usually takes 10\u201330 seconds.
|
|
40
|
+
/* @__PURE__ */ jsx("p", { className: "text-center text-xs text-muted-foreground", children: "This usually takes 10\u201330 seconds." })
|
|
41
41
|
] }),
|
|
42
42
|
success && children,
|
|
43
43
|
failed && /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-5 py-2", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/transaction-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { Button } from \"./button.js\";\nimport { useConfetti } from \"../utils/use-confetti.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\n\nexport interface TransactionDialogProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"phase\" | \"error\" | \"reset\"> & { retryable?: boolean };\n title: string;\n workingLabel: string;\n firstStepLabel?: string;\n children?: ReactNode;\n}\n\nconst ACTIVE_STEP = { preparing: 0, submitting: 1, confirming: 2 } as const;\n\nexport function TransactionDialog({ tx, title, workingLabel, firstStepLabel = \"Prepare\", children }: TransactionDialogProps) {\n const { phase, error, reset, retryable = true } = tx;\n const working = phase === \"preparing\" || phase === \"submitting\" || phase === \"confirming\";\n const success = phase === \"success\";\n const failed = phase === \"error\";\n const steps = [firstStepLabel, \"Submit transaction\", \"Confirm transaction\"];\n\n useConfetti(success);\n\n return (\n <Dialog open={phase !== \"idle\"} modal onOpenChange={(open) => { if (!open && !working) reset(); }}>\n <DialogContent\n className=\"sm:max-w-md\"\n onInteractOutside={working ? (e) => e.preventDefault() : undefined}\n onEscapeKeyDown={working ? (e) => e.preventDefault() : undefined}\n {...(working ? { hideClose: true } : {})}\n >\n <DialogTitle className=\"sr-only\">{working ? workingLabel : title}</DialogTitle>\n\n {working && (\n <div className=\"flex flex-col items-center gap-6 py-4\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-primary/10\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-lg font-semibold\">{workingLabel}</p>\n <p className=\"text-sm text-muted-foreground\">\n {phase === \"confirming\" ? \"Waiting for block confirmation\" : \"Submitting transaction\"}\n </p>\n </div>\n <ol className=\"w-full space-y-2 rounded-xl border border-border/60 bg-muted/30 p-4\">\n {steps.map((label, i) => {\n const active = i === ACTIVE_STEP[phase];\n const done = i < ACTIVE_STEP[phase];\n return (\n <li key={label} data-step aria-current={active ? \"step\" : undefined} className=\"flex items-center gap-3\">\n {done ? (\n <CheckCircle2 className=\"h-4 w-4 shrink-0 text-emerald-500\" />\n ) : active ? (\n <Loader2 className=\"h-4 w-4 shrink-0 animate-spin text-primary\" />\n ) : (\n <div className=\"h-4 w-4 shrink-0 rounded-full border-2 border-muted-foreground/30\" />\n )}\n <span className={done ? \"text-sm text-foreground\" : active ? \"text-sm font-medium text-primary\" : \"text-sm text-muted-foreground\"}>\n {label}\n </span>\n </li>\n );\n })}\n </ol>\n <p className=\"text-center text-xs text-muted-foreground\">This usually takes 10–30 seconds
|
|
1
|
+
{"version":3,"sources":["../../src/components/transaction-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { CheckCircle2, Loader2, XCircle } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogTitle } from \"./dialog.js\";\nimport { Button } from \"./button.js\";\nimport { useConfetti } from \"../utils/use-confetti.js\";\nimport type { useTransaction } from \"../utils/use-transaction.js\";\n\nexport interface TransactionDialogProps {\n tx: Pick<ReturnType<typeof useTransaction>, \"phase\" | \"error\" | \"reset\"> & { retryable?: boolean };\n title: string;\n workingLabel: string;\n firstStepLabel?: string;\n children?: ReactNode;\n}\n\nconst ACTIVE_STEP = { preparing: 0, submitting: 1, confirming: 2 } as const;\n\nexport function TransactionDialog({ tx, title, workingLabel, firstStepLabel = \"Prepare\", children }: TransactionDialogProps) {\n const { phase, error, reset, retryable = true } = tx;\n const working = phase === \"preparing\" || phase === \"submitting\" || phase === \"confirming\";\n const success = phase === \"success\";\n const failed = phase === \"error\";\n const steps = [firstStepLabel, \"Submit transaction\", \"Confirm transaction\"];\n\n useConfetti(success);\n\n return (\n <Dialog open={phase !== \"idle\"} modal onOpenChange={(open) => { if (!open && !working) reset(); }}>\n <DialogContent\n className=\"sm:max-w-md\"\n onInteractOutside={working ? (e) => e.preventDefault() : undefined}\n onEscapeKeyDown={working ? (e) => e.preventDefault() : undefined}\n {...(working ? { hideClose: true } : {})}\n >\n <DialogTitle className=\"sr-only\">{working ? workingLabel : title}</DialogTitle>\n\n {working && (\n <div className=\"flex flex-col items-center gap-6 py-4\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-primary/10\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-lg font-semibold\">{workingLabel}</p>\n <p className=\"text-sm text-muted-foreground\">\n {phase === \"confirming\" ? \"Waiting for block confirmation\" : \"Submitting transaction\"}\n </p>\n </div>\n <ol className=\"w-full space-y-2 rounded-xl border border-border/60 bg-muted/30 p-4\">\n {steps.map((label, i) => {\n const active = i === ACTIVE_STEP[phase];\n const done = i < ACTIVE_STEP[phase];\n return (\n <li key={label} data-step aria-current={active ? \"step\" : undefined} className=\"flex items-center gap-3\">\n {done ? (\n <CheckCircle2 className=\"h-4 w-4 shrink-0 text-emerald-500\" />\n ) : active ? (\n <Loader2 className=\"h-4 w-4 shrink-0 animate-spin text-primary\" />\n ) : (\n <div className=\"h-4 w-4 shrink-0 rounded-full border-2 border-muted-foreground/30\" />\n )}\n <span className={done ? \"text-sm text-foreground\" : active ? \"text-sm font-medium text-primary\" : \"text-sm text-muted-foreground\"}>\n {label}\n </span>\n </li>\n );\n })}\n </ol>\n <p className=\"text-center text-xs text-muted-foreground\">This usually takes 10–30 seconds.</p>\n </div>\n )}\n\n {success && children}\n\n {failed && (\n <div className=\"flex flex-col items-center gap-5 py-2\">\n <div className=\"flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10\">\n <XCircle className=\"h-9 w-9 text-destructive\" />\n </div>\n <div className=\"space-y-1 text-center\">\n <p className=\"text-xl font-bold\">{title}</p>\n <p className=\"mx-auto max-w-xs text-sm text-muted-foreground\">{error}</p>\n </div>\n <Button variant=\"outline\" className=\"w-full\" onClick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D;AAAA,aACF;AAAA,UACA,oBAAC,QAAG,WAAU,uEACX,gBAAM,IAAI,CAAC,OAAO,MAAM;AACvB,kBAAM,SAAS,MAAM,YAAY,KAAK;AACtC,kBAAM,OAAO,IAAI,YAAY,KAAK;AAClC,mBACE,qBAAC,QAAe,aAAS,MAAC,gBAAc,SAAS,SAAS,QAAW,WAAU,2BAC5E;AAAA,qBACC,oBAAC,gBAAa,WAAU,qCAAoC,IAC1D,SACF,oBAAC,WAAQ,WAAU,8CAA6C,IAEhE,oBAAC,SAAI,WAAU,qEAAoE;AAAA,cAErF,oBAAC,UAAK,WAAW,OAAO,4BAA4B,SAAS,qCAAqC,iCAC/F,iBACH;AAAA,iBAVO,KAWT;AAAA,UAEJ,CAAC,GACH;AAAA,UACA,oBAAC,OAAE,WAAU,6CAA4C,oDAAiC;AAAA,WAC5F;AAAA,QAGD,WAAW;AAAA,QAEX,UACC,qBAAC,SAAI,WAAU,yCACb;AAAA,8BAAC,SAAI,WAAU,6EACb,8BAAC,WAAQ,WAAU,4BAA2B,GAChD;AAAA,UACA,qBAAC,SAAI,WAAU,yBACb;AAAA,gCAAC,OAAE,WAAU,qBAAqB,iBAAM;AAAA,YACxC,oBAAC,OAAE,WAAU,kDAAkD,iBAAM;AAAA,aACvE;AAAA,UACA,oBAAC,UAAO,SAAQ,WAAU,WAAU,UAAS,SAAS,OACnD,sBAAY,cAAc,SAC7B;AAAA,WACF;AAAA;AAAA;AAAA,EAEJ,GACF;AAEJ;","names":[]}
|
|
@@ -155,7 +155,7 @@ function TransferDialog({
|
|
|
155
155
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
156
156
|
import_marketplace_dialog_primitives.MarketplaceConfirmStep,
|
|
157
157
|
{
|
|
158
|
-
description: "Transfer this asset?
|
|
158
|
+
description: "Transfer this asset?",
|
|
159
159
|
error,
|
|
160
160
|
secondaryLabel: "Back",
|
|
161
161
|
onSecondary: () => {
|
|
@@ -174,11 +174,11 @@ function TransferDialog({
|
|
|
174
174
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "font-bold text-base leading-tight truncate", children: displayName }),
|
|
175
175
|
hasActiveListing && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_alert.Alert, { variant: "destructive", children: [
|
|
176
176
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertCircle, { className: "h-4 w-4" }),
|
|
177
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.AlertDescription, { className: "text-xs", children: "This token has an active listing.
|
|
177
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.AlertDescription, { className: "text-xs", children: "This token has an active listing. Cancelling the listing first keeps the sale from completing after the transfer." })
|
|
178
178
|
] }),
|
|
179
179
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_alert.Alert, { children: [
|
|
180
180
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.AlertCircle, { className: "h-4 w-4" }),
|
|
181
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.AlertDescription, { className: "text-xs", children: "Transfers are
|
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.AlertDescription, { className: "text-xs", children: "Transfers are final and recorded onchain." })
|
|
182
182
|
] }),
|
|
183
183
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_form.Form, { ...form, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-3", children: [
|
|
184
184
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/transfer-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport * as z from \"zod\";\nimport { AlertCircle, ArrowRightLeft, ShieldCheck } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"./dialog.js\";\nimport { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from \"./form.js\";\nimport { Input } from \"./input.js\";\nimport { Alert, AlertDescription } from \"./alert.js\";\nimport { MarketplaceConfirmStep, MarketplaceDialogHero } from \"./marketplace-dialog-primitives.js\";\nimport { TransactionDialogStates } from \"./transaction-dialog-states.js\";\nimport { isBusyPhase, type TransactionPhase } from \"../utils/use-transaction.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\n\nconst schema = z.object({\n toAddress: z\n .string()\n .min(1, \"Recipient address is required\")\n .regex(/^0x[0-9a-fA-F]{1,64}$/, \"Must be a valid Starknet address (0x followed by hex characters)\"),\n});\n\ntype FormValues = z.infer<typeof schema>;\n\ntype Step = \"form\" | \"confirm\";\n\nexport interface TransferDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n tokenId: string;\n tokenName?: string;\n tokenImage?: string | null;\n hasActiveListing?: boolean;\n walletAddress?: string | null;\n canTransfer: boolean;\n connectLabel: string;\n footerNote: string;\n tx: {\n phase: TransactionPhase;\n txHash: string | null;\n error: string | null;\n retryable?: boolean;\n reset: () => void;\n };\n onTransfer: (toAddress: string) => void;\n onSuccess?: () => void;\n}\n\nexport function TransferDialog({\n open,\n onOpenChange,\n tokenId,\n tokenName,\n tokenImage,\n hasActiveListing = false,\n walletAddress,\n canTransfer,\n connectLabel,\n footerNote,\n tx,\n onTransfer,\n onSuccess,\n}: TransferDialogProps) {\n const { phase, txHash, error, retryable = true, reset } = tx;\n const busy = isBusyPhase(phase);\n const [step, setStep] = useState<Step>(\"form\");\n const [pendingAddress, setPendingAddress] = useState<string | null>(null);\n\n const form = useForm<FormValues>({\n resolver: zodResolver(schema),\n defaultValues: { toAddress: \"\" },\n });\n\n const resetDialog = () => {\n reset();\n form.reset();\n setPendingAddress(null);\n setStep(\"form\");\n };\n\n useEffect(() => {\n if (open) resetDialog();\n }, [open]);\n\n const close = () => {\n resetDialog();\n onOpenChange(false);\n };\n\n const handleClose = (value: boolean) => {\n if (!value && !busy && phase !== \"success\") close();\n };\n\n const onSubmit = (values: FormValues) => {\n if (walletAddress) {\n try {\n if (BigInt(values.toAddress) === BigInt(walletAddress)) {\n form.setError(\"toAddress\", { message: \"Cannot transfer to yourself\" });\n return;\n }\n } catch {\n void 0;\n }\n }\n if (!canTransfer) return;\n setPendingAddress(values.toAddress);\n setStep(\"confirm\");\n };\n\n const displayName = tokenName || `Token #${tokenId}`;\n const recipientShort = pendingAddress ? `${pendingAddress.slice(0, 8)}…${pendingAddress.slice(-6)}` : \"\";\n\n const footer = (\n <div className=\"flex items-start justify-center gap-1.5\">\n <ShieldCheck className=\"h-3 w-3 text-muted-foreground shrink-0 mt-0.5\" />\n <p className=\"text-2xs text-center text-muted-foreground\">{footerNote}</p>\n </div>\n );\n\n return (\n <Dialog open={open} onOpenChange={handleClose}>\n <DialogContent className=\"max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl flex flex-col max-h-[92svh]\">\n <DialogTitle className=\"sr-only\">Transfer {displayName}</DialogTitle>\n <DialogDescription className=\"sr-only\">\n Enter a recipient Starknet address to transfer this asset onchain.\n </DialogDescription>\n\n <TransactionDialogStates\n phase={phase}\n asset={{ name: displayName, image: tokenImage }}\n statusMessage=\"Confirming on Starknet…\"\n txHash={txHash}\n error={error}\n success={successMessages.transferred({ name: displayName, to: recipientShort })}\n successActions={[{ label: \"Done\", onClick: () => { close(); onSuccess?.(); } }]}\n errorTitle=\"Transfer failed\"\n errorDescription=\"The transaction was submitted, but the transfer could not be completed.\"\n onRetry={retryable ? () => { reset(); setStep(\"form\"); } : undefined}\n onDone={close}\n >\n <MarketplaceDialogHero\n tokenImage={tokenImage}\n tokenName={tokenName}\n tokenId={tokenId}\n fallbackIcon={<ArrowRightLeft className=\"h-12 w-12 text-brand-blue/30\" />}\n />\n {step === \"confirm\" ? (\n <>\n <div className=\"flex items-end justify-between px-6 pt-3 pb-1\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-lg leading-tight truncate\">{displayName}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5 tabular-nums truncate\">→ {recipientShort}</p>\n </div>\n </div>\n <MarketplaceConfirmStep\n description=\"Transfer this asset? This action cannot be undone.\"\n error={error}\n secondaryLabel=\"Back\"\n onSecondary={() => { reset(); setStep(\"form\"); }}\n primaryLabel=\"Transfer\"\n onPrimary={() => { if (pendingAddress) onTransfer(pendingAddress); }}\n primaryIcon={<ArrowRightLeft className=\"h-4 w-4\" />}\n footer={footer}\n />\n </>\n ) : (\n <div className=\"px-5 pb-4 pt-3 space-y-3\">\n <p className=\"font-bold text-base leading-tight truncate\">{displayName}</p>\n\n {hasActiveListing && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n This token has an active listing. A buyer could still complete the purchase after you transfer it — cancel the listing first, or proceed with caution.\n </AlertDescription>\n </Alert>\n )}\n\n <Alert>\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n Transfers are permanent and irreversible. Double-check the recipient address before confirming.\n </AlertDescription>\n </Alert>\n\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-3\">\n <FormField\n control={form.control}\n name=\"toAddress\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>Recipient address</FormLabel>\n <FormControl>\n <Input placeholder=\"0x…\" autoComplete=\"off\" spellCheck={false} {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n\n {error && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n )}\n\n <div className=\"pt-1 space-y-2\">\n <div className=\"btn-border-animated p-[1px] rounded-xl\">\n <button\n type=\"submit\"\n disabled={!canTransfer}\n className=\"w-full h-11 rounded-[11px] flex items-center justify-center gap-2 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] bg-transparent\"\n >\n <ArrowRightLeft className=\"h-4 w-4\" />\n {canTransfer ? \"Transfer\" : connectLabel}\n </button>\n </div>\n {footer}\n </div>\n </form>\n </Form>\n </div>\n )}\n </TransactionDialogStates>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkHI;AAhHJ,mBAAoC;AACpC,6BAAwB;AACxB,iBAA4B;AAC5B,QAAmB;AACnB,0BAAyD;AACzD,oBAAsE;AACtE,kBAA+E;AAC/E,mBAAsB;AACtB,mBAAwC;AACxC,2CAA8D;AAC9D,uCAAwC;AACxC,6BAAmD;AACnD,8BAAgC;AAEhC,MAAM,SAAS,EAAE,OAAO;AAAA,EACtB,WAAW,EACR,OAAO,EACP,IAAI,GAAG,+BAA+B,EACtC,MAAM,yBAAyB,kEAAkE;AACtG,CAAC;AA4BM,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,mBAAmB;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAwB;AACtB,QAAM,EAAE,OAAO,QAAQ,OAAO,YAAY,MAAM,MAAM,IAAI;AAC1D,QAAM,WAAO,oCAAY,KAAK;AAC9B,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAe,MAAM;AAC7C,QAAM,CAAC,gBAAgB,iBAAiB,QAAI,uBAAwB,IAAI;AAExE,QAAM,WAAO,gCAAoB;AAAA,IAC/B,cAAU,wBAAY,MAAM;AAAA,IAC5B,eAAe,EAAE,WAAW,GAAG;AAAA,EACjC,CAAC;AAED,QAAM,cAAc,MAAM;AACxB,UAAM;AACN,SAAK,MAAM;AACX,sBAAkB,IAAI;AACtB,YAAQ,MAAM;AAAA,EAChB;AAEA,8BAAU,MAAM;AACd,QAAI,KAAM,aA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AU,KAAK,aAAa,QAAQ,GAAG,WAAU,aACrD;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,SAAS,KAAK;AAAA,kBACd,MAAK;AAAA,kBACL,QAAQ,CAAC,EAAE,MAAM,MACf,6CAAC,wBACC;AAAA,gEAAC,yBAAU,+BAAiB;AAAA,oBAC5B,4CAAC,2BACC,sDAAC,sBAAM,aAAY,YAAM,cAAa,OAAM,YAAY,OAAQ,GAAG,OAAO,GAC5E;AAAA,oBACA,4CAAC,2BAAY;AAAA,qBACf;AAAA;AAAA,cAEJ;AAAA,cAEC,SACC,6CAAC,sBAAM,SAAQ,eACb;AAAA,4DAAC,mCAAY,WAAU,WAAU;AAAA,gBACjC,4CAAC,iCAAkB,iBAAM;AAAA,iBAC3B;AAAA,cAGF,6CAAC,SAAI,WAAU,kBACb;AAAA,4DAAC,SAAI,WAAU,0CACb;AAAA,kBAAC;AAAA;AAAA,oBACC,MAAK;AAAA,oBACL,UAAU,CAAC;AAAA,oBACX,WAAU;AAAA,oBAEV;AAAA,kEAAC,sCAAe,WAAU,WAAU;AAAA,sBACnC,cAAc,aAAa;AAAA;AAAA;AAAA,gBAC9B,GACF;AAAA,gBACC;AAAA,iBACH;AAAA,eACF,GACF;AAAA,aACF;AAAA;AAAA;AAAA,IAEJ;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/transfer-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport * as z from \"zod\";\nimport { AlertCircle, ArrowRightLeft, ShieldCheck } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"./dialog.js\";\nimport { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from \"./form.js\";\nimport { Input } from \"./input.js\";\nimport { Alert, AlertDescription } from \"./alert.js\";\nimport { MarketplaceConfirmStep, MarketplaceDialogHero } from \"./marketplace-dialog-primitives.js\";\nimport { TransactionDialogStates } from \"./transaction-dialog-states.js\";\nimport { isBusyPhase, type TransactionPhase } from \"../utils/use-transaction.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\n\nconst schema = z.object({\n toAddress: z\n .string()\n .min(1, \"Recipient address is required\")\n .regex(/^0x[0-9a-fA-F]{1,64}$/, \"Must be a valid Starknet address (0x followed by hex characters)\"),\n});\n\ntype FormValues = z.infer<typeof schema>;\n\ntype Step = \"form\" | \"confirm\";\n\nexport interface TransferDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n tokenId: string;\n tokenName?: string;\n tokenImage?: string | null;\n hasActiveListing?: boolean;\n walletAddress?: string | null;\n canTransfer: boolean;\n connectLabel: string;\n footerNote: string;\n tx: {\n phase: TransactionPhase;\n txHash: string | null;\n error: string | null;\n retryable?: boolean;\n reset: () => void;\n };\n onTransfer: (toAddress: string) => void;\n onSuccess?: () => void;\n}\n\nexport function TransferDialog({\n open,\n onOpenChange,\n tokenId,\n tokenName,\n tokenImage,\n hasActiveListing = false,\n walletAddress,\n canTransfer,\n connectLabel,\n footerNote,\n tx,\n onTransfer,\n onSuccess,\n}: TransferDialogProps) {\n const { phase, txHash, error, retryable = true, reset } = tx;\n const busy = isBusyPhase(phase);\n const [step, setStep] = useState<Step>(\"form\");\n const [pendingAddress, setPendingAddress] = useState<string | null>(null);\n\n const form = useForm<FormValues>({\n resolver: zodResolver(schema),\n defaultValues: { toAddress: \"\" },\n });\n\n const resetDialog = () => {\n reset();\n form.reset();\n setPendingAddress(null);\n setStep(\"form\");\n };\n\n useEffect(() => {\n if (open) resetDialog();\n }, [open]);\n\n const close = () => {\n resetDialog();\n onOpenChange(false);\n };\n\n const handleClose = (value: boolean) => {\n if (!value && !busy && phase !== \"success\") close();\n };\n\n const onSubmit = (values: FormValues) => {\n if (walletAddress) {\n try {\n if (BigInt(values.toAddress) === BigInt(walletAddress)) {\n form.setError(\"toAddress\", { message: \"Cannot transfer to yourself\" });\n return;\n }\n } catch {\n void 0;\n }\n }\n if (!canTransfer) return;\n setPendingAddress(values.toAddress);\n setStep(\"confirm\");\n };\n\n const displayName = tokenName || `Token #${tokenId}`;\n const recipientShort = pendingAddress ? `${pendingAddress.slice(0, 8)}…${pendingAddress.slice(-6)}` : \"\";\n\n const footer = (\n <div className=\"flex items-start justify-center gap-1.5\">\n <ShieldCheck className=\"h-3 w-3 text-muted-foreground shrink-0 mt-0.5\" />\n <p className=\"text-2xs text-center text-muted-foreground\">{footerNote}</p>\n </div>\n );\n\n return (\n <Dialog open={open} onOpenChange={handleClose}>\n <DialogContent className=\"max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl flex flex-col max-h-[92svh]\">\n <DialogTitle className=\"sr-only\">Transfer {displayName}</DialogTitle>\n <DialogDescription className=\"sr-only\">\n Enter a recipient Starknet address to transfer this asset onchain.\n </DialogDescription>\n\n <TransactionDialogStates\n phase={phase}\n asset={{ name: displayName, image: tokenImage }}\n statusMessage=\"Confirming on Starknet…\"\n txHash={txHash}\n error={error}\n success={successMessages.transferred({ name: displayName, to: recipientShort })}\n successActions={[{ label: \"Done\", onClick: () => { close(); onSuccess?.(); } }]}\n errorTitle=\"Transfer failed\"\n errorDescription=\"The transaction was submitted, but the transfer could not be completed.\"\n onRetry={retryable ? () => { reset(); setStep(\"form\"); } : undefined}\n onDone={close}\n >\n <MarketplaceDialogHero\n tokenImage={tokenImage}\n tokenName={tokenName}\n tokenId={tokenId}\n fallbackIcon={<ArrowRightLeft className=\"h-12 w-12 text-brand-blue/30\" />}\n />\n {step === \"confirm\" ? (\n <>\n <div className=\"flex items-end justify-between px-6 pt-3 pb-1\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-lg leading-tight truncate\">{displayName}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5 tabular-nums truncate\">→ {recipientShort}</p>\n </div>\n </div>\n <MarketplaceConfirmStep\n description=\"Transfer this asset?\"\n error={error}\n secondaryLabel=\"Back\"\n onSecondary={() => { reset(); setStep(\"form\"); }}\n primaryLabel=\"Transfer\"\n onPrimary={() => { if (pendingAddress) onTransfer(pendingAddress); }}\n primaryIcon={<ArrowRightLeft className=\"h-4 w-4\" />}\n footer={footer}\n />\n </>\n ) : (\n <div className=\"px-5 pb-4 pt-3 space-y-3\">\n <p className=\"font-bold text-base leading-tight truncate\">{displayName}</p>\n\n {hasActiveListing && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n This token has an active listing. Cancelling the listing first keeps the sale from completing after the transfer.\n </AlertDescription>\n </Alert>\n )}\n\n <Alert>\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n Transfers are final and recorded onchain.\n </AlertDescription>\n </Alert>\n\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-3\">\n <FormField\n control={form.control}\n name=\"toAddress\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>Recipient address</FormLabel>\n <FormControl>\n <Input placeholder=\"0x…\" autoComplete=\"off\" spellCheck={false} {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n\n {error && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n )}\n\n <div className=\"pt-1 space-y-2\">\n <div className=\"btn-border-animated p-[1px] rounded-xl\">\n <button\n type=\"submit\"\n disabled={!canTransfer}\n className=\"w-full h-11 rounded-[11px] flex items-center justify-center gap-2 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] bg-transparent\"\n >\n <ArrowRightLeft className=\"h-4 w-4\" />\n {canTransfer ? \"Transfer\" : connectLabel}\n </button>\n </div>\n {footer}\n </div>\n </form>\n </Form>\n </div>\n )}\n </TransactionDialogStates>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;A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AY,YAAM,cAAa,OAAM,YAAY,OAAQ,GAAG,OAAO,GAC5E;AAAA,oBACA,4CAAC,2BAAY;AAAA,qBACf;AAAA;AAAA,cAEJ;AAAA,cAEC,SACC,6CAAC,sBAAM,SAAQ,eACb;AAAA,4DAAC,mCAAY,WAAU,WAAU;AAAA,gBACjC,4CAAC,iCAAkB,iBAAM;AAAA,iBAC3B;AAAA,cAGF,6CAAC,SAAI,WAAU,kBACb;AAAA,4DAAC,SAAI,WAAU,0CACb;AAAA,kBAAC;AAAA;AAAA,oBACC,MAAK;AAAA,oBACL,UAAU,CAAC;AAAA,oBACX,WAAU;AAAA,oBAEV;AAAA,kEAAC,sCAAe,WAAU,WAAU;AAAA,sBACnC,cAAc,aAAa;AAAA;AAAA;AAAA,gBAC9B,GACF;AAAA,gBACC;AAAA,iBACH;AAAA,eACF,GACF;AAAA,aACF;AAAA;AAAA;AAAA,IAEJ;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
@@ -122,7 +122,7 @@ function TransferDialog({
|
|
|
122
122
|
/* @__PURE__ */ jsx(
|
|
123
123
|
MarketplaceConfirmStep,
|
|
124
124
|
{
|
|
125
|
-
description: "Transfer this asset?
|
|
125
|
+
description: "Transfer this asset?",
|
|
126
126
|
error,
|
|
127
127
|
secondaryLabel: "Back",
|
|
128
128
|
onSecondary: () => {
|
|
@@ -141,11 +141,11 @@ function TransferDialog({
|
|
|
141
141
|
/* @__PURE__ */ jsx("p", { className: "font-bold text-base leading-tight truncate", children: displayName }),
|
|
142
142
|
hasActiveListing && /* @__PURE__ */ jsxs(Alert, { variant: "destructive", children: [
|
|
143
143
|
/* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4" }),
|
|
144
|
-
/* @__PURE__ */ jsx(AlertDescription, { className: "text-xs", children: "This token has an active listing.
|
|
144
|
+
/* @__PURE__ */ jsx(AlertDescription, { className: "text-xs", children: "This token has an active listing. Cancelling the listing first keeps the sale from completing after the transfer." })
|
|
145
145
|
] }),
|
|
146
146
|
/* @__PURE__ */ jsxs(Alert, { children: [
|
|
147
147
|
/* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4" }),
|
|
148
|
-
/* @__PURE__ */ jsx(AlertDescription, { className: "text-xs", children: "Transfers are
|
|
148
|
+
/* @__PURE__ */ jsx(AlertDescription, { className: "text-xs", children: "Transfers are final and recorded onchain." })
|
|
149
149
|
] }),
|
|
150
150
|
/* @__PURE__ */ jsx(Form, { ...form, children: /* @__PURE__ */ jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-3", children: [
|
|
151
151
|
/* @__PURE__ */ jsx(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/transfer-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport * as z from \"zod\";\nimport { AlertCircle, ArrowRightLeft, ShieldCheck } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"./dialog.js\";\nimport { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from \"./form.js\";\nimport { Input } from \"./input.js\";\nimport { Alert, AlertDescription } from \"./alert.js\";\nimport { MarketplaceConfirmStep, MarketplaceDialogHero } from \"./marketplace-dialog-primitives.js\";\nimport { TransactionDialogStates } from \"./transaction-dialog-states.js\";\nimport { isBusyPhase, type TransactionPhase } from \"../utils/use-transaction.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\n\nconst schema = z.object({\n toAddress: z\n .string()\n .min(1, \"Recipient address is required\")\n .regex(/^0x[0-9a-fA-F]{1,64}$/, \"Must be a valid Starknet address (0x followed by hex characters)\"),\n});\n\ntype FormValues = z.infer<typeof schema>;\n\ntype Step = \"form\" | \"confirm\";\n\nexport interface TransferDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n tokenId: string;\n tokenName?: string;\n tokenImage?: string | null;\n hasActiveListing?: boolean;\n walletAddress?: string | null;\n canTransfer: boolean;\n connectLabel: string;\n footerNote: string;\n tx: {\n phase: TransactionPhase;\n txHash: string | null;\n error: string | null;\n retryable?: boolean;\n reset: () => void;\n };\n onTransfer: (toAddress: string) => void;\n onSuccess?: () => void;\n}\n\nexport function TransferDialog({\n open,\n onOpenChange,\n tokenId,\n tokenName,\n tokenImage,\n hasActiveListing = false,\n walletAddress,\n canTransfer,\n connectLabel,\n footerNote,\n tx,\n onTransfer,\n onSuccess,\n}: TransferDialogProps) {\n const { phase, txHash, error, retryable = true, reset } = tx;\n const busy = isBusyPhase(phase);\n const [step, setStep] = useState<Step>(\"form\");\n const [pendingAddress, setPendingAddress] = useState<string | null>(null);\n\n const form = useForm<FormValues>({\n resolver: zodResolver(schema),\n defaultValues: { toAddress: \"\" },\n });\n\n const resetDialog = () => {\n reset();\n form.reset();\n setPendingAddress(null);\n setStep(\"form\");\n };\n\n useEffect(() => {\n if (open) resetDialog();\n }, [open]);\n\n const close = () => {\n resetDialog();\n onOpenChange(false);\n };\n\n const handleClose = (value: boolean) => {\n if (!value && !busy && phase !== \"success\") close();\n };\n\n const onSubmit = (values: FormValues) => {\n if (walletAddress) {\n try {\n if (BigInt(values.toAddress) === BigInt(walletAddress)) {\n form.setError(\"toAddress\", { message: \"Cannot transfer to yourself\" });\n return;\n }\n } catch {\n void 0;\n }\n }\n if (!canTransfer) return;\n setPendingAddress(values.toAddress);\n setStep(\"confirm\");\n };\n\n const displayName = tokenName || `Token #${tokenId}`;\n const recipientShort = pendingAddress ? `${pendingAddress.slice(0, 8)}…${pendingAddress.slice(-6)}` : \"\";\n\n const footer = (\n <div className=\"flex items-start justify-center gap-1.5\">\n <ShieldCheck className=\"h-3 w-3 text-muted-foreground shrink-0 mt-0.5\" />\n <p className=\"text-2xs text-center text-muted-foreground\">{footerNote}</p>\n </div>\n );\n\n return (\n <Dialog open={open} onOpenChange={handleClose}>\n <DialogContent className=\"max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl flex flex-col max-h-[92svh]\">\n <DialogTitle className=\"sr-only\">Transfer {displayName}</DialogTitle>\n <DialogDescription className=\"sr-only\">\n Enter a recipient Starknet address to transfer this asset onchain.\n </DialogDescription>\n\n <TransactionDialogStates\n phase={phase}\n asset={{ name: displayName, image: tokenImage }}\n statusMessage=\"Confirming on Starknet…\"\n txHash={txHash}\n error={error}\n success={successMessages.transferred({ name: displayName, to: recipientShort })}\n successActions={[{ label: \"Done\", onClick: () => { close(); onSuccess?.(); } }]}\n errorTitle=\"Transfer failed\"\n errorDescription=\"The transaction was submitted, but the transfer could not be completed.\"\n onRetry={retryable ? () => { reset(); setStep(\"form\"); } : undefined}\n onDone={close}\n >\n <MarketplaceDialogHero\n tokenImage={tokenImage}\n tokenName={tokenName}\n tokenId={tokenId}\n fallbackIcon={<ArrowRightLeft className=\"h-12 w-12 text-brand-blue/30\" />}\n />\n {step === \"confirm\" ? (\n <>\n <div className=\"flex items-end justify-between px-6 pt-3 pb-1\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-lg leading-tight truncate\">{displayName}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5 tabular-nums truncate\">→ {recipientShort}</p>\n </div>\n </div>\n <MarketplaceConfirmStep\n description=\"Transfer this asset? This action cannot be undone.\"\n error={error}\n secondaryLabel=\"Back\"\n onSecondary={() => { reset(); setStep(\"form\"); }}\n primaryLabel=\"Transfer\"\n onPrimary={() => { if (pendingAddress) onTransfer(pendingAddress); }}\n primaryIcon={<ArrowRightLeft className=\"h-4 w-4\" />}\n footer={footer}\n />\n </>\n ) : (\n <div className=\"px-5 pb-4 pt-3 space-y-3\">\n <p className=\"font-bold text-base leading-tight truncate\">{displayName}</p>\n\n {hasActiveListing && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n This token has an active listing. A buyer could still complete the purchase after you transfer it — cancel the listing first, or proceed with caution.\n </AlertDescription>\n </Alert>\n )}\n\n <Alert>\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n Transfers are permanent and irreversible. Double-check the recipient address before confirming.\n </AlertDescription>\n </Alert>\n\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-3\">\n <FormField\n control={form.control}\n name=\"toAddress\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>Recipient address</FormLabel>\n <FormControl>\n <Input placeholder=\"0x…\" autoComplete=\"off\" spellCheck={false} {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n\n {error && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n )}\n\n <div className=\"pt-1 space-y-2\">\n <div className=\"btn-border-animated p-[1px] rounded-xl\">\n <button\n type=\"submit\"\n disabled={!canTransfer}\n className=\"w-full h-11 rounded-[11px] flex items-center justify-center gap-2 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] bg-transparent\"\n >\n <ArrowRightLeft className=\"h-4 w-4\" />\n {canTransfer ? \"Transfer\" : connectLabel}\n </button>\n </div>\n {footer}\n </div>\n </form>\n </Form>\n </div>\n )}\n </TransactionDialogStates>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAkHI,SAkCQ,UAjCN,KADF;AAhHJ,SAAS,WAAW,gBAAgB;AACpC,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,YAAY,OAAO;AACnB,SAAS,aAAa,gBAAgB,mBAAmB;AACzD,SAAS,QAAQ,eAAe,mBAAmB,mBAAmB;AACtE,SAAS,MAAM,aAAa,WAAW,UAAU,WAAW,mBAAmB;AAC/E,SAAS,aAAa;AACtB,SAAS,OAAO,wBAAwB;AACxC,SAAS,wBAAwB,6BAA6B;AAC9D,SAAS,+BAA+B;AACxC,SAAS,mBAA0C;AACnD,SAAS,uBAAuB;AAEhC,MAAM,SAAS,EAAE,OAAO;AAAA,EACtB,WAAW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CACb;AAAA,kBAAC;AAAA;AAAA,oBACC,MAAK;AAAA,oBACL,UAAU,CAAC;AAAA,oBACX,WAAU;AAAA,oBAEV;AAAA,0CAAC,kBAAe,WAAU,WAAU;AAAA,sBACnC,cAAc,aAAa;AAAA;AAAA;AAAA,gBAC9B,GACF;AAAA,gBACC;AAAA,iBACH;AAAA,eACF,GACF;AAAA,aACF;AAAA;AAAA;AAAA,IAEJ;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/transfer-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { zodResolver } from \"@hookform/resolvers/zod\";\nimport * as z from \"zod\";\nimport { AlertCircle, ArrowRightLeft, ShieldCheck } from \"lucide-react\";\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"./dialog.js\";\nimport { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from \"./form.js\";\nimport { Input } from \"./input.js\";\nimport { Alert, AlertDescription } from \"./alert.js\";\nimport { MarketplaceConfirmStep, MarketplaceDialogHero } from \"./marketplace-dialog-primitives.js\";\nimport { TransactionDialogStates } from \"./transaction-dialog-states.js\";\nimport { isBusyPhase, type TransactionPhase } from \"../utils/use-transaction.js\";\nimport { successMessages } from \"../utils/success-messages.js\";\n\nconst schema = z.object({\n toAddress: z\n .string()\n .min(1, \"Recipient address is required\")\n .regex(/^0x[0-9a-fA-F]{1,64}$/, \"Must be a valid Starknet address (0x followed by hex characters)\"),\n});\n\ntype FormValues = z.infer<typeof schema>;\n\ntype Step = \"form\" | \"confirm\";\n\nexport interface TransferDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n tokenId: string;\n tokenName?: string;\n tokenImage?: string | null;\n hasActiveListing?: boolean;\n walletAddress?: string | null;\n canTransfer: boolean;\n connectLabel: string;\n footerNote: string;\n tx: {\n phase: TransactionPhase;\n txHash: string | null;\n error: string | null;\n retryable?: boolean;\n reset: () => void;\n };\n onTransfer: (toAddress: string) => void;\n onSuccess?: () => void;\n}\n\nexport function TransferDialog({\n open,\n onOpenChange,\n tokenId,\n tokenName,\n tokenImage,\n hasActiveListing = false,\n walletAddress,\n canTransfer,\n connectLabel,\n footerNote,\n tx,\n onTransfer,\n onSuccess,\n}: TransferDialogProps) {\n const { phase, txHash, error, retryable = true, reset } = tx;\n const busy = isBusyPhase(phase);\n const [step, setStep] = useState<Step>(\"form\");\n const [pendingAddress, setPendingAddress] = useState<string | null>(null);\n\n const form = useForm<FormValues>({\n resolver: zodResolver(schema),\n defaultValues: { toAddress: \"\" },\n });\n\n const resetDialog = () => {\n reset();\n form.reset();\n setPendingAddress(null);\n setStep(\"form\");\n };\n\n useEffect(() => {\n if (open) resetDialog();\n }, [open]);\n\n const close = () => {\n resetDialog();\n onOpenChange(false);\n };\n\n const handleClose = (value: boolean) => {\n if (!value && !busy && phase !== \"success\") close();\n };\n\n const onSubmit = (values: FormValues) => {\n if (walletAddress) {\n try {\n if (BigInt(values.toAddress) === BigInt(walletAddress)) {\n form.setError(\"toAddress\", { message: \"Cannot transfer to yourself\" });\n return;\n }\n } catch {\n void 0;\n }\n }\n if (!canTransfer) return;\n setPendingAddress(values.toAddress);\n setStep(\"confirm\");\n };\n\n const displayName = tokenName || `Token #${tokenId}`;\n const recipientShort = pendingAddress ? `${pendingAddress.slice(0, 8)}…${pendingAddress.slice(-6)}` : \"\";\n\n const footer = (\n <div className=\"flex items-start justify-center gap-1.5\">\n <ShieldCheck className=\"h-3 w-3 text-muted-foreground shrink-0 mt-0.5\" />\n <p className=\"text-2xs text-center text-muted-foreground\">{footerNote}</p>\n </div>\n );\n\n return (\n <Dialog open={open} onOpenChange={handleClose}>\n <DialogContent className=\"max-w-[calc(100%-6px)] sm:max-w-md p-0 overflow-hidden gap-0 rounded-2xl flex flex-col max-h-[92svh]\">\n <DialogTitle className=\"sr-only\">Transfer {displayName}</DialogTitle>\n <DialogDescription className=\"sr-only\">\n Enter a recipient Starknet address to transfer this asset onchain.\n </DialogDescription>\n\n <TransactionDialogStates\n phase={phase}\n asset={{ name: displayName, image: tokenImage }}\n statusMessage=\"Confirming on Starknet…\"\n txHash={txHash}\n error={error}\n success={successMessages.transferred({ name: displayName, to: recipientShort })}\n successActions={[{ label: \"Done\", onClick: () => { close(); onSuccess?.(); } }]}\n errorTitle=\"Transfer failed\"\n errorDescription=\"The transaction was submitted, but the transfer could not be completed.\"\n onRetry={retryable ? () => { reset(); setStep(\"form\"); } : undefined}\n onDone={close}\n >\n <MarketplaceDialogHero\n tokenImage={tokenImage}\n tokenName={tokenName}\n tokenId={tokenId}\n fallbackIcon={<ArrowRightLeft className=\"h-12 w-12 text-brand-blue/30\" />}\n />\n {step === \"confirm\" ? (\n <>\n <div className=\"flex items-end justify-between px-6 pt-3 pb-1\">\n <div className=\"min-w-0\">\n <p className=\"font-bold text-lg leading-tight truncate\">{displayName}</p>\n <p className=\"text-xs text-muted-foreground mt-0.5 tabular-nums truncate\">→ {recipientShort}</p>\n </div>\n </div>\n <MarketplaceConfirmStep\n description=\"Transfer this asset?\"\n error={error}\n secondaryLabel=\"Back\"\n onSecondary={() => { reset(); setStep(\"form\"); }}\n primaryLabel=\"Transfer\"\n onPrimary={() => { if (pendingAddress) onTransfer(pendingAddress); }}\n primaryIcon={<ArrowRightLeft className=\"h-4 w-4\" />}\n footer={footer}\n />\n </>\n ) : (\n <div className=\"px-5 pb-4 pt-3 space-y-3\">\n <p className=\"font-bold text-base leading-tight truncate\">{displayName}</p>\n\n {hasActiveListing && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n This token has an active listing. Cancelling the listing first keeps the sale from completing after the transfer.\n </AlertDescription>\n </Alert>\n )}\n\n <Alert>\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs\">\n Transfers are final and recorded onchain.\n </AlertDescription>\n </Alert>\n\n <Form {...form}>\n <form onSubmit={form.handleSubmit(onSubmit)} className=\"space-y-3\">\n <FormField\n control={form.control}\n name=\"toAddress\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>Recipient address</FormLabel>\n <FormControl>\n <Input placeholder=\"0x…\" autoComplete=\"off\" spellCheck={false} {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n\n {error && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"h-4 w-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n )}\n\n <div className=\"pt-1 space-y-2\">\n <div className=\"btn-border-animated p-[1px] rounded-xl\">\n <button\n type=\"submit\"\n disabled={!canTransfer}\n className=\"w-full h-11 rounded-[11px] flex items-center justify-center gap-2 text-sm font-semibold text-white transition-all hover:brightness-110 active:scale-[0.98] bg-transparent\"\n >\n <ArrowRightLeft className=\"h-4 w-4\" />\n {canTransfer ? \"Transfer\" : connectLabel}\n </button>\n </div>\n {footer}\n </div>\n </form>\n </Form>\n </div>\n )}\n </TransactionDialogStates>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";AAkHI,SAkCQ,UAjCN,KADF;AAhHJ,SAAS,WAAW,gBAAgB;AACpC,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAC5B,YAAY,OAAO;AACnB,SAAS,aAAa,gBAAgB,mBAAmB;AACzD,SAAS,QAAQ,eAAe,mBAAmB,mBAAmB;AACtE,SAAS,MAAM,aAAa,WAAW,UAAU,WAAW,mBAAmB;AAC/E,SAAS,aAAa;AACtB,SAAS,OAAO,wBAAwB;AACxC,SAAS,wBAAwB,6BAA6B;AAC9D,SAAS,+BAA+B;AACxC,SAAS,mBAA0C;AACnD,SAAS,uBAAuB;AAEhC,MAAM,SAAS,EAAE,OAAO;AAAA,EACtB,WAAW,EACR,OAAO,EACP,IAAI,GAAG,+BAA+B,EACtC,MAAM,yBAAyB,kEAAkE;AACtG,CAAC;AA4BM,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAA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c,aAAa;AAAA;AAAA;AAAA,gBAC9B,GACF;AAAA,gBACC;AAAA,iBACH;AAAA,eACF,GACF;AAAA,aACF;AAAA;AAAA;AAAA,IAEJ;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
@@ -63,16 +63,12 @@ function ExportKeySection({ loadSealed, unlock, actions }) {
|
|
|
63
63
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col gap-3", children: [
|
|
64
64
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
65
65
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-sm font-semibold", children: "Recovery key" }),
|
|
66
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mt-1 text-xs text-muted-foreground leading-relaxed", children: "
|
|
66
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mt-1 text-xs text-muted-foreground leading-relaxed", children: "Used to sign in on a new phone or browser." })
|
|
67
67
|
] }),
|
|
68
68
|
recoveryKey ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
69
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_alert.Alert, {
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_alert.Alert, { children: [
|
|
70
70
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ShieldAlert, { className: "h-4 w-4" }),
|
|
71
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
72
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-semibold", children: "Anyone with this key controls your wallet." }),
|
|
73
|
-
" ",
|
|
74
|
-
"Medialane will never ask you for it. Treat any message requesting it as an attempt to take your assets."
|
|
75
|
-
] })
|
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_alert.AlertDescription, { className: "text-xs leading-relaxed", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-semibold", children: "The recovery key gives full control of the wallet." }) })
|
|
76
72
|
] }),
|
|
77
73
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { className: "block break-all rounded-xl bg-muted px-3 py-2.5 font-mono text-xs select-all", children: recoveryKey }),
|
|
78
74
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/wallet/export-key-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, type ReactNode } from \"react\";\nimport { KeyRound, Copy, Check, EyeOff, Loader2, ShieldAlert } from \"lucide-react\";\nimport { encodeRecoveryKey, type SealedOwner } from \"@medialane/sdk/starknet\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport { Button } from \"../button.js\";\nimport { Alert, AlertDescription } from \"../alert.js\";\n\nexport interface ExportKeySectionProps {\n loadSealed: () => SealedOwner | null;\n unlock: (sealed: SealedOwner) => Promise<string>;\n actions?: ReactNode;\n}\n\nexport function ExportKeySection({ loadSealed, unlock, actions }: ExportKeySectionProps) {\n const [recoveryKey, setRecoveryKey] = useState<string | null>(null);\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [copied, setCopied] = useState(false);\n\n const reveal = async () => {\n setBusy(true);\n setError(null);\n try {\n const sealed = loadSealed();\n if (!sealed) {\n setError(\"This browser has no wallet key stored.\");\n return;\n }\n setRecoveryKey(encodeRecoveryKey({ walletAddress: sealed.address, privateKey: await unlock(sealed) }));\n } catch (err) {\n setError(describeError(err).message);\n } finally {\n setBusy(false);\n }\n };\n\n const copy = async () => {\n if (!recoveryKey) return;\n await navigator.clipboard.writeText(recoveryKey);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n };\n\n const hide = () => {\n setRecoveryKey(null);\n setCopied(false);\n };\n\n return (\n <div className=\"flex flex-col gap-3\">\n <div>\n <p className=\"text-sm font-semibold\">Recovery key</p>\n <p className=\"mt-1 text-xs text-muted-foreground leading-relaxed\">\n
|
|
1
|
+
{"version":3,"sources":["../../../src/components/wallet/export-key-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, type ReactNode } from \"react\";\nimport { KeyRound, Copy, Check, EyeOff, Loader2, ShieldAlert } from \"lucide-react\";\nimport { encodeRecoveryKey, type SealedOwner } from \"@medialane/sdk/starknet\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport { Button } from \"../button.js\";\nimport { Alert, AlertDescription } from \"../alert.js\";\n\nexport interface ExportKeySectionProps {\n loadSealed: () => SealedOwner | null;\n unlock: (sealed: SealedOwner) => Promise<string>;\n actions?: ReactNode;\n}\n\nexport function ExportKeySection({ loadSealed, unlock, actions }: ExportKeySectionProps) {\n const [recoveryKey, setRecoveryKey] = useState<string | null>(null);\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [copied, setCopied] = useState(false);\n\n const reveal = async () => {\n setBusy(true);\n setError(null);\n try {\n const sealed = loadSealed();\n if (!sealed) {\n setError(\"This browser has no wallet key stored.\");\n return;\n }\n setRecoveryKey(encodeRecoveryKey({ walletAddress: sealed.address, privateKey: await unlock(sealed) }));\n } catch (err) {\n setError(describeError(err).message);\n } finally {\n setBusy(false);\n }\n };\n\n const copy = async () => {\n if (!recoveryKey) return;\n await navigator.clipboard.writeText(recoveryKey);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n };\n\n const hide = () => {\n setRecoveryKey(null);\n setCopied(false);\n };\n\n return (\n <div className=\"flex flex-col gap-3\">\n <div>\n <p className=\"text-sm font-semibold\">Recovery key</p>\n <p className=\"mt-1 text-xs text-muted-foreground leading-relaxed\">\n Used to sign in on a new phone or browser.\n </p>\n </div>\n\n {recoveryKey ? (\n <>\n <Alert>\n <ShieldAlert className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs leading-relaxed\">\n <span className=\"font-semibold\">The recovery key gives full control of the wallet.</span>\n </AlertDescription>\n </Alert>\n <code className=\"block break-all rounded-xl bg-muted px-3 py-2.5 font-mono text-xs select-all\">\n {recoveryKey}\n </code>\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button onClick={copy} variant=\"outline\" size=\"sm\">\n {copied ? <Check className=\"mr-1.5 h-3.5 w-3.5\" /> : <Copy className=\"mr-1.5 h-3.5 w-3.5\" />}\n {copied ? \"Copied\" : \"Copy key\"}\n </Button>\n <Button onClick={hide} variant=\"ghost\" size=\"sm\">\n <EyeOff className=\"mr-1.5 h-3.5 w-3.5\" />\n Hide\n </Button>\n {actions}\n </div>\n </>\n ) : (\n <>\n {error && <p className=\"text-sm text-destructive\">{error}</p>}\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button onClick={reveal} disabled={busy} variant=\"outline\" size=\"sm\">\n {busy ? <Loader2 className=\"mr-1.5 h-3.5 w-3.5 animate-spin\" /> : <KeyRound className=\"mr-1.5 h-3.5 w-3.5\" />}\n Show recovery key\n </Button>\n {actions}\n </div>\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoDM;AAlDN,mBAAyC;AACzC,0BAAoE;AACpE,sBAAoD;AACpD,4BAA8B;AAC9B,oBAAuB;AACvB,mBAAwC;AAQjC,SAAS,iBAAiB,EAAE,YAAY,QAAQ,QAAQ,GAA0B;AACvF,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAwB,IAAI;AAClE,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAS,KAAK;AACtC,QAAM,CAAC,OAAO,QAAQ,QAAI,uBAAwB,IAAI;AACtD,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAS,KAAK;AAE1C,QAAM,SAAS,YAAY;AACzB,YAAQ,IAAI;AACZ,aAAS,IAAI;AACb,QAAI;AACF,YAAM,SAAS,WAAW;AAC1B,UAAI,CAAC,QAAQ;AACX,iBAAS,wCAAwC;AACjD;AAAA,MACF;AACA,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,6CAAC,SAAI,WAAU,qCACb;AAAA,qDAAC,wBAAO,SAAS,QAAQ,UAAU,MAAM,SAAQ,WAAU,MAAK,MAC7D;AAAA,iBAAO,4CAAC,+BAAQ,WAAU,mCAAkC,IAAK,4CAAC,gCAAS,WAAU,sBAAqB;AAAA,UAAG;AAAA,WAEhH;AAAA,QACC;AAAA,SACH;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":[]}
|
|
@@ -40,16 +40,12 @@ function ExportKeySection({ loadSealed, unlock, actions }) {
|
|
|
40
40
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
41
41
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
42
42
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold", children: "Recovery key" }),
|
|
43
|
-
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground leading-relaxed", children: "
|
|
43
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground leading-relaxed", children: "Used to sign in on a new phone or browser." })
|
|
44
44
|
] }),
|
|
45
45
|
recoveryKey ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
46
|
-
/* @__PURE__ */ jsxs(Alert, {
|
|
46
|
+
/* @__PURE__ */ jsxs(Alert, { children: [
|
|
47
47
|
/* @__PURE__ */ jsx(ShieldAlert, { className: "h-4 w-4" }),
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */ jsx("span", { className: "font-semibold", children: "Anyone with this key controls your wallet." }),
|
|
50
|
-
" ",
|
|
51
|
-
"Medialane will never ask you for it. Treat any message requesting it as an attempt to take your assets."
|
|
52
|
-
] })
|
|
48
|
+
/* @__PURE__ */ jsx(AlertDescription, { className: "text-xs leading-relaxed", children: /* @__PURE__ */ jsx("span", { className: "font-semibold", children: "The recovery key gives full control of the wallet." }) })
|
|
53
49
|
] }),
|
|
54
50
|
/* @__PURE__ */ jsx("code", { className: "block break-all rounded-xl bg-muted px-3 py-2.5 font-mono text-xs select-all", children: recoveryKey }),
|
|
55
51
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/wallet/export-key-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, type ReactNode } from \"react\";\nimport { KeyRound, Copy, Check, EyeOff, Loader2, ShieldAlert } from \"lucide-react\";\nimport { encodeRecoveryKey, type SealedOwner } from \"@medialane/sdk/starknet\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport { Button } from \"../button.js\";\nimport { Alert, AlertDescription } from \"../alert.js\";\n\nexport interface ExportKeySectionProps {\n loadSealed: () => SealedOwner | null;\n unlock: (sealed: SealedOwner) => Promise<string>;\n actions?: ReactNode;\n}\n\nexport function ExportKeySection({ loadSealed, unlock, actions }: ExportKeySectionProps) {\n const [recoveryKey, setRecoveryKey] = useState<string | null>(null);\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [copied, setCopied] = useState(false);\n\n const reveal = async () => {\n setBusy(true);\n setError(null);\n try {\n const sealed = loadSealed();\n if (!sealed) {\n setError(\"This browser has no wallet key stored.\");\n return;\n }\n setRecoveryKey(encodeRecoveryKey({ walletAddress: sealed.address, privateKey: await unlock(sealed) }));\n } catch (err) {\n setError(describeError(err).message);\n } finally {\n setBusy(false);\n }\n };\n\n const copy = async () => {\n if (!recoveryKey) return;\n await navigator.clipboard.writeText(recoveryKey);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n };\n\n const hide = () => {\n setRecoveryKey(null);\n setCopied(false);\n };\n\n return (\n <div className=\"flex flex-col gap-3\">\n <div>\n <p className=\"text-sm font-semibold\">Recovery key</p>\n <p className=\"mt-1 text-xs text-muted-foreground leading-relaxed\">\n
|
|
1
|
+
{"version":3,"sources":["../../../src/components/wallet/export-key-section.tsx"],"sourcesContent":["\"use client\";\n\nimport { useState, type ReactNode } from \"react\";\nimport { KeyRound, Copy, Check, EyeOff, Loader2, ShieldAlert } from \"lucide-react\";\nimport { encodeRecoveryKey, type SealedOwner } from \"@medialane/sdk/starknet\";\nimport { describeError } from \"../../utils/describe-error.js\";\nimport { Button } from \"../button.js\";\nimport { Alert, AlertDescription } from \"../alert.js\";\n\nexport interface ExportKeySectionProps {\n loadSealed: () => SealedOwner | null;\n unlock: (sealed: SealedOwner) => Promise<string>;\n actions?: ReactNode;\n}\n\nexport function ExportKeySection({ loadSealed, unlock, actions }: ExportKeySectionProps) {\n const [recoveryKey, setRecoveryKey] = useState<string | null>(null);\n const [busy, setBusy] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const [copied, setCopied] = useState(false);\n\n const reveal = async () => {\n setBusy(true);\n setError(null);\n try {\n const sealed = loadSealed();\n if (!sealed) {\n setError(\"This browser has no wallet key stored.\");\n return;\n }\n setRecoveryKey(encodeRecoveryKey({ walletAddress: sealed.address, privateKey: await unlock(sealed) }));\n } catch (err) {\n setError(describeError(err).message);\n } finally {\n setBusy(false);\n }\n };\n\n const copy = async () => {\n if (!recoveryKey) return;\n await navigator.clipboard.writeText(recoveryKey);\n setCopied(true);\n setTimeout(() => setCopied(false), 2000);\n };\n\n const hide = () => {\n setRecoveryKey(null);\n setCopied(false);\n };\n\n return (\n <div className=\"flex flex-col gap-3\">\n <div>\n <p className=\"text-sm font-semibold\">Recovery key</p>\n <p className=\"mt-1 text-xs text-muted-foreground leading-relaxed\">\n Used to sign in on a new phone or browser.\n </p>\n </div>\n\n {recoveryKey ? (\n <>\n <Alert>\n <ShieldAlert className=\"h-4 w-4\" />\n <AlertDescription className=\"text-xs leading-relaxed\">\n <span className=\"font-semibold\">The recovery key gives full control of the wallet.</span>\n </AlertDescription>\n </Alert>\n <code className=\"block break-all rounded-xl bg-muted px-3 py-2.5 font-mono text-xs select-all\">\n {recoveryKey}\n </code>\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button onClick={copy} variant=\"outline\" size=\"sm\">\n {copied ? <Check className=\"mr-1.5 h-3.5 w-3.5\" /> : <Copy className=\"mr-1.5 h-3.5 w-3.5\" />}\n {copied ? \"Copied\" : \"Copy key\"}\n </Button>\n <Button onClick={hide} variant=\"ghost\" size=\"sm\">\n <EyeOff className=\"mr-1.5 h-3.5 w-3.5\" />\n Hide\n </Button>\n {actions}\n </div>\n </>\n ) : (\n <>\n {error && <p className=\"text-sm text-destructive\">{error}</p>}\n <div className=\"flex flex-wrap items-center gap-2\">\n <Button onClick={reveal} disabled={busy} variant=\"outline\" size=\"sm\">\n {busy ? <Loader2 className=\"mr-1.5 h-3.5 w-3.5 animate-spin\" /> : <KeyRound className=\"mr-1.5 h-3.5 w-3.5\" />}\n Show recovery key\n </Button>\n {actions}\n </div>\n </>\n )}\n </div>\n );\n}\n"],"mappings":";AAoDM,SAQE,UAPA,KADF;AAlDN,SAAS,gBAAgC;AACzC,SAAS,UAAU,MAAM,OAAO,QAAQ,SAAS,mBAAmB;AACpE,SAAS,yBAA2C;AACpD,SAAS,qBAAqB;AAC9B,SAAS,cAAc;AACvB,SAAS,OAAO,wBAAwB;AAQjC,SAAS,iBAAiB,EAAE,YAAY,QAAQ,QAAQ,GAA0B;AACvF,QAAM,CAAC,aAAa,cAAc,IAAI,SAAwB,IAAI;AAClE,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AACtC,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAwB,IAAI;AACtD,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAE1C,QAAM,SAAS,YAAY;AACzB,YAAQ,IAAI;AACZ,aAAS,IAAI;AACb,QAAI;AACF,YAAM,SAAS,WAAW;AAC1B,UAAI,CAAC,QAAQ;AACX,iBAAS,wCAAwC;AACjD;AAAA,MACF;AACA,qBAAe,kBAAkB,EAAE,eAAe,OAAO,SAAS,YAAY,MAAM,OAAO,MAAM,EAAE,CAAC,CAAC;AAAA,IACvG,SAAS,KAAK;AACZ,eAAS,cAAc,GAAG,EAAE,OAAO;AA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AS,WAAU,sBAAqB;AAAA,UAAG;AAAA,WAEhH;AAAA,QACC;AAAA,SACH;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":[]}
|
package/dist/index.cjs
CHANGED
|
@@ -249,6 +249,7 @@ __export(index_exports, {
|
|
|
249
249
|
LAUNCHPAD_SERVICE_GROUPS: () => import_launchpad_services3.LAUNCHPAD_SERVICE_GROUPS,
|
|
250
250
|
LICENSE_TRAIT_TYPES: () => import_ip.LICENSE_TRAIT_TYPES,
|
|
251
251
|
LICENSE_TYPES: () => import_ip.LICENSE_TYPES,
|
|
252
|
+
LISTABLE_CURRENCIES: () => import_order_form.LISTABLE_CURRENCIES,
|
|
252
253
|
LIVING_RENDER_COLLECTIONS: () => import_living_render_collections.LIVING_RENDER_COLLECTIONS,
|
|
253
254
|
Label: () => import_label.Label,
|
|
254
255
|
LaunchpadCtaBanner: () => import_launchpad_cta_banner.LaunchpadCtaBanner,
|
|
@@ -299,6 +300,7 @@ __export(index_exports, {
|
|
|
299
300
|
NavThemeToggle: () => import_nav_theme_toggle.NavThemeToggle,
|
|
300
301
|
NavWalletTrigger: () => import_nav_shell.NavWalletTrigger,
|
|
301
302
|
NewCollectionMenu: () => import_new_collection_menu.NewCollectionMenu,
|
|
303
|
+
OrderFields: () => import_order_fields.OrderFields,
|
|
302
304
|
OrderSortControl: () => import_order_sort_control.OrderSortControl,
|
|
303
305
|
OrderSummaryHero: () => import_marketplace_dialog_primitives.OrderSummaryHero,
|
|
304
306
|
OwnerSetupPanel: () => import_owner_setup_panel.OwnerSetupPanel,
|
|
@@ -437,6 +439,7 @@ __export(index_exports, {
|
|
|
437
439
|
coinKindLabelPlural: () => import_coins.coinKindLabelPlural,
|
|
438
440
|
coinServiceIds: () => import_coins.coinServiceIds,
|
|
439
441
|
coinSupply: () => import_coins.coinSupply,
|
|
442
|
+
counterOfferFormSchema: () => import_order_form.counterOfferFormSchema,
|
|
440
443
|
createAppWallet: () => import_app_wallet.createAppWallet,
|
|
441
444
|
createImageResolver: () => import_ipfs2.createImageResolver,
|
|
442
445
|
derivePortfolioCounts: () => import_portfolio_counts.derivePortfolioCounts,
|
|
@@ -448,6 +451,7 @@ __export(index_exports, {
|
|
|
448
451
|
emptyMessages: () => import_empty_messages.emptyMessages,
|
|
449
452
|
fdvUsd: () => import_coins.fdvUsd,
|
|
450
453
|
feeLabelFor: () => import_self_fund_consent_dialog.feeLabelFor,
|
|
454
|
+
fetchSession: () => import_use_session.fetchSession,
|
|
451
455
|
fireConfetti: () => import_confetti.fireConfetti,
|
|
452
456
|
formatActivity: () => import_format_activity.formatActivity,
|
|
453
457
|
formatCoinPrice: () => import_coins.formatCoinPrice,
|
|
@@ -480,6 +484,7 @@ __export(index_exports, {
|
|
|
480
484
|
matchCommands: () => import_nav_command_menu.matchCommands,
|
|
481
485
|
navGroups: () => import_nav_commands.navGroups,
|
|
482
486
|
orderCoins: () => import_coin_order.orderCoins,
|
|
487
|
+
orderFormSchema: () => import_order_form.orderFormSchema,
|
|
483
488
|
orderUsd: () => import_order_usd.orderUsd,
|
|
484
489
|
parsePriceDisplay: () => import_format.parsePriceDisplay,
|
|
485
490
|
passkeyUnsupportedReason: () => import_wallet_failure.passkeyUnsupportedReason,
|
|
@@ -490,8 +495,10 @@ __export(index_exports, {
|
|
|
490
495
|
queryKeyPrefix: () => import_query_keys.queryKeyPrefix,
|
|
491
496
|
queryKeys: () => import_query_keys.queryKeys,
|
|
492
497
|
readBodyWithCap: () => import_proxy_body.readBodyWithCap,
|
|
498
|
+
refreshSession: () => import_use_session.refreshSession,
|
|
493
499
|
relevanceFilter: () => import_nav_command_menu.relevanceFilter,
|
|
494
500
|
runIntentCalls: () => import_run_intent_calls.runIntentCalls,
|
|
501
|
+
sessionEmail: () => import_use_session.sessionEmail,
|
|
495
502
|
setUploadDiagnosticsReporter: () => import_ipfs_upload.setUploadDiagnosticsReporter,
|
|
496
503
|
shortenAddress: () => import_address.shortenAddress,
|
|
497
504
|
sortOrders: () => import_order_sort_control.sortOrders,
|
|
@@ -577,6 +584,7 @@ __export(index_exports, {
|
|
|
577
584
|
useRewardsConfig: () => import_use_rewards.useRewardsConfig,
|
|
578
585
|
useRewardsEvents: () => import_use_rewards.useRewardsEvents,
|
|
579
586
|
useSearch: () => import_use_search.useSearch,
|
|
587
|
+
useSession: () => import_use_session.useSession,
|
|
580
588
|
useSponsorshipBids: () => import_use_sponsorship.useSponsorshipBids,
|
|
581
589
|
useSponsorshipLicenses: () => import_use_sponsorship.useSponsorshipLicenses,
|
|
582
590
|
useSponsorshipOffer: () => import_use_sponsorship.useSponsorshipOffer,
|
|
@@ -690,6 +698,9 @@ var import_activity_ticker = require("./components/activity-ticker.js");
|
|
|
690
698
|
var import_listing_card = require("./components/listing-card.js");
|
|
691
699
|
var import_listings_grid = require("./components/listings-grid.js");
|
|
692
700
|
var import_marketplace_dialog_primitives = require("./components/marketplace-dialog-primitives.js");
|
|
701
|
+
var import_use_session = require("./utils/use-session.js");
|
|
702
|
+
var import_order_fields = require("./components/order-fields.js");
|
|
703
|
+
var import_order_form = require("./utils/order-form.js");
|
|
693
704
|
var import_activity_row = require("./components/activity-row.js");
|
|
694
705
|
var import_activity_timeline_row = require("./components/activity-timeline-row.js");
|
|
695
706
|
var import_drop_item_list = require("./components/drop-item-list.js");
|
|
@@ -1137,6 +1148,7 @@ var import_asset_accents = require("./utils/asset-accents.js");
|
|
|
1137
1148
|
LAUNCHPAD_SERVICE_GROUPS,
|
|
1138
1149
|
LICENSE_TRAIT_TYPES,
|
|
1139
1150
|
LICENSE_TYPES,
|
|
1151
|
+
LISTABLE_CURRENCIES,
|
|
1140
1152
|
LIVING_RENDER_COLLECTIONS,
|
|
1141
1153
|
Label,
|
|
1142
1154
|
LaunchpadCtaBanner,
|
|
@@ -1187,6 +1199,7 @@ var import_asset_accents = require("./utils/asset-accents.js");
|
|
|
1187
1199
|
NavThemeToggle,
|
|
1188
1200
|
NavWalletTrigger,
|
|
1189
1201
|
NewCollectionMenu,
|
|
1202
|
+
OrderFields,
|
|
1190
1203
|
OrderSortControl,
|
|
1191
1204
|
OrderSummaryHero,
|
|
1192
1205
|
OwnerSetupPanel,
|
|
@@ -1325,6 +1338,7 @@ var import_asset_accents = require("./utils/asset-accents.js");
|
|
|
1325
1338
|
coinKindLabelPlural,
|
|
1326
1339
|
coinServiceIds,
|
|
1327
1340
|
coinSupply,
|
|
1341
|
+
counterOfferFormSchema,
|
|
1328
1342
|
createAppWallet,
|
|
1329
1343
|
createImageResolver,
|
|
1330
1344
|
derivePortfolioCounts,
|
|
@@ -1336,6 +1350,7 @@ var import_asset_accents = require("./utils/asset-accents.js");
|
|
|
1336
1350
|
emptyMessages,
|
|
1337
1351
|
fdvUsd,
|
|
1338
1352
|
feeLabelFor,
|
|
1353
|
+
fetchSession,
|
|
1339
1354
|
fireConfetti,
|
|
1340
1355
|
formatActivity,
|
|
1341
1356
|
formatCoinPrice,
|
|
@@ -1368,6 +1383,7 @@ var import_asset_accents = require("./utils/asset-accents.js");
|
|
|
1368
1383
|
matchCommands,
|
|
1369
1384
|
navGroups,
|
|
1370
1385
|
orderCoins,
|
|
1386
|
+
orderFormSchema,
|
|
1371
1387
|
orderUsd,
|
|
1372
1388
|
parsePriceDisplay,
|
|
1373
1389
|
passkeyUnsupportedReason,
|
|
@@ -1378,8 +1394,10 @@ var import_asset_accents = require("./utils/asset-accents.js");
|
|
|
1378
1394
|
queryKeyPrefix,
|
|
1379
1395
|
queryKeys,
|
|
1380
1396
|
readBodyWithCap,
|
|
1397
|
+
refreshSession,
|
|
1381
1398
|
relevanceFilter,
|
|
1382
1399
|
runIntentCalls,
|
|
1400
|
+
sessionEmail,
|
|
1383
1401
|
setUploadDiagnosticsReporter,
|
|
1384
1402
|
shortenAddress,
|
|
1385
1403
|
sortOrders,
|
|
@@ -1465,6 +1483,7 @@ var import_asset_accents = require("./utils/asset-accents.js");
|
|
|
1465
1483
|
useRewardsConfig,
|
|
1466
1484
|
useRewardsEvents,
|
|
1467
1485
|
useSearch,
|
|
1486
|
+
useSession,
|
|
1468
1487
|
useSponsorshipBids,
|
|
1469
1488
|
useSponsorshipLicenses,
|
|
1470
1489
|
useSponsorshipOffer,
|