@0xsequence/marketplace-sdk 0.3.5 → 0.3.7
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/{chunk-URTXTVOU.js → chunk-3LGNSRBR.js} +476 -417
- package/dist/chunk-3LGNSRBR.js.map +1 -0
- package/dist/{chunk-RZSZNVEH.js → chunk-L6GSYPCR.js} +5 -5
- package/dist/{chunk-RZSZNVEH.js.map → chunk-L6GSYPCR.js.map} +1 -1
- package/dist/{chunk-Q57TEA3Z.js → chunk-NMCGA2TB.js} +4 -2
- package/dist/chunk-NMCGA2TB.js.map +1 -0
- package/dist/{chunk-6LQST3KZ.js → chunk-QGELCUYG.js} +27 -15
- package/dist/chunk-QGELCUYG.js.map +1 -0
- package/dist/index.js +6 -6
- package/dist/react/hooks/index.d.ts +3 -1
- package/dist/react/hooks/index.js +3 -3
- package/dist/react/index.js +6 -6
- package/dist/react/ui/components/index.js +6 -6
- package/dist/react/ui/index.d.ts +4 -21
- package/dist/react/ui/index.js +6 -6
- package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +1 -1
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +1 -1
- package/dist/react/ui/styles/index.d.ts +1 -1
- package/dist/styles/index.d.ts +1 -1
- package/dist/styles/index.js +1 -1
- package/dist/utils/abi/index.js +5 -5
- package/dist/utils/index.js +5 -5
- package/package.json +1 -1
- package/src/react/_internal/transaction-machine/execute-transaction.ts +10 -3
- package/src/react/_internal/transaction-machine/useTransactionMachine.ts +18 -5
- package/src/react/ui/components/_internals/action-button/ActionButton.tsx +1 -1
- package/src/react/ui/components/_internals/custom-select/CustomSelect.tsx +4 -4
- package/src/react/ui/modals/BuyModal/index.tsx +42 -10
- package/src/react/ui/modals/CreateListingModal/index.tsx +9 -16
- package/src/react/ui/modals/MakeOfferModal/_store.ts +1 -1
- package/src/react/ui/modals/MakeOfferModal/index.tsx +9 -12
- package/src/react/ui/modals/SellModal/index.tsx +10 -10
- package/src/react/ui/modals/TransferModal/_store.ts +12 -10
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +2 -2
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/useHandleTransfer.tsx +16 -38
- package/src/react/ui/modals/TransferModal/index.tsx +7 -9
- package/src/react/ui/modals/_internal/components/actionModal/ActionModal.tsx +4 -2
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +15 -7
- package/src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx +9 -18
- package/src/react/ui/modals/_internal/components/priceInput/index.tsx +1 -1
- package/src/react/ui/modals/_internal/components/quantityInput/index.tsx +25 -3
- package/src/react/ui/modals/_internal/components/switchChainModal/index.tsx +2 -0
- package/src/react/ui/modals/_internal/components/switchChainModal/store.ts +4 -4
- package/src/react/ui/modals/_internal/components/transaction-footer/index.tsx +7 -4
- package/src/react/ui/modals/_internal/components/transactionPreview/consts.ts +10 -5
- package/src/react/ui/modals/_internal/components/transactionPreview/index.tsx +27 -8
- package/src/react/ui/modals/_internal/components/transactionPreview/useTransactionPreviewTitle.tsx +3 -5
- package/src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx +80 -62
- package/src/react/ui/modals/_internal/components/transactionStatusModal/store.ts +21 -29
- package/src/react/ui/modals/_internal/components/transactionStatusModal/util/getFormattedType.ts +23 -0
- package/src/react/ui/modals/_internal/components/transactionStatusModal/util/getMessage.ts +29 -0
- package/src/react/ui/modals/_internal/components/transactionStatusModal/util/getTitle.ts +43 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/chunk-6LQST3KZ.js.map +0 -1
- package/dist/chunk-Q57TEA3Z.js.map +0 -1
- package/dist/chunk-URTXTVOU.js.map +0 -1
- package/src/react/ui/modals/CreateListingModal/_utils/getCreateListingTransactionTitleMessage.ts +0 -30
- package/src/react/ui/modals/MakeOfferModal/_utils/getMakeOfferTransactionTitleMessage.ts +0 -28
- package/src/react/ui/modals/SellModal/_utils/getSellTransactionTitleMessage.ts +0 -28
- package/src/react/ui/modals/TransferModal/_utils/getTransferTransactionTitleMessage.ts +0 -28
- package/src/types/callbacks.ts +0 -51
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
ActionModal
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NMCGA2TB.js";
|
|
5
5
|
import {
|
|
6
6
|
CalendarIcon_default,
|
|
7
7
|
MinusIcon_default,
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
quantityInputWrapper,
|
|
32
32
|
tokenPreview,
|
|
33
33
|
transferModalContent
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-L6GSYPCR.js";
|
|
35
35
|
import {
|
|
36
36
|
AlertMessage,
|
|
37
37
|
switchChainModal_default,
|
|
@@ -48,12 +48,13 @@ import {
|
|
|
48
48
|
useSwitchChainModal,
|
|
49
49
|
useTransactionMachine,
|
|
50
50
|
useTransferTokens
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-QGELCUYG.js";
|
|
52
52
|
import {
|
|
53
53
|
iconVariants
|
|
54
54
|
} from "./chunk-SBVLWSRZ.js";
|
|
55
55
|
import {
|
|
56
56
|
calculatePriceDifferencePercentage,
|
|
57
|
+
getPublicRpcClient,
|
|
57
58
|
truncateMiddle
|
|
58
59
|
} from "./chunk-OUZ42I6B.js";
|
|
59
60
|
import {
|
|
@@ -88,6 +89,7 @@ var AccountModal = observer(function AccountModal2() {
|
|
|
88
89
|
});
|
|
89
90
|
|
|
90
91
|
// src/react/ui/modals/BuyModal/index.tsx
|
|
92
|
+
import { Box as Box3, Text as Text2, TokenImage } from "@0xsequence/design-system";
|
|
91
93
|
import { Show, observer as observer2, useSelector } from "@legendapp/state/react";
|
|
92
94
|
import { useEffect } from "react";
|
|
93
95
|
|
|
@@ -101,9 +103,15 @@ function QuantityInput({
|
|
|
101
103
|
maxQuantity
|
|
102
104
|
}) {
|
|
103
105
|
function handleChangeQuantity(value) {
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
const sanitizedValue = value.replace(/[^\d.]/g, "");
|
|
107
|
+
const decimalParts = sanitizedValue.split(".");
|
|
108
|
+
let formattedValue = sanitizedValue;
|
|
109
|
+
if (decimalParts.length > 2) {
|
|
110
|
+
formattedValue = decimalParts[0] + "." + decimalParts[1];
|
|
111
|
+
}
|
|
112
|
+
const finalValue = formatQuantity(formattedValue);
|
|
113
|
+
$quantity.set(finalValue);
|
|
114
|
+
validateQuantity(finalValue);
|
|
107
115
|
}
|
|
108
116
|
function validateQuantity(value) {
|
|
109
117
|
if (!value || value.trim() === "" || isNaN(Number(value))) {
|
|
@@ -111,12 +119,21 @@ function QuantityInput({
|
|
|
111
119
|
return;
|
|
112
120
|
}
|
|
113
121
|
const numValue = Number(value);
|
|
122
|
+
const decimalParts = value.split(".");
|
|
123
|
+
if (decimalParts.length > 1 && decimalParts[1].length > decimals) {
|
|
124
|
+
$invalidQuantity.set(true);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
114
127
|
$invalidQuantity.set(numValue <= 0 || numValue > Number(maxQuantity));
|
|
115
128
|
}
|
|
116
129
|
function formatQuantity(value) {
|
|
117
130
|
if (!value || isNaN(Number(value))) {
|
|
118
131
|
return "0";
|
|
119
132
|
}
|
|
133
|
+
const decimalParts = value.split(".");
|
|
134
|
+
if (decimalParts.length > 1 && decimalParts[1].length > decimals) {
|
|
135
|
+
return Number(value).toFixed(decimals);
|
|
136
|
+
}
|
|
120
137
|
if (Number(value) > Number(maxQuantity)) {
|
|
121
138
|
return maxQuantity;
|
|
122
139
|
}
|
|
@@ -220,7 +237,8 @@ var initialState = {
|
|
|
220
237
|
var buyModal$ = observable2(initialState);
|
|
221
238
|
|
|
222
239
|
// src/react/ui/modals/BuyModal/index.tsx
|
|
223
|
-
import {
|
|
240
|
+
import { formatUnits, parseUnits } from "viem";
|
|
241
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
224
242
|
var useBuyModal = (callbacks) => {
|
|
225
243
|
return {
|
|
226
244
|
show: (args) => buyModal$.open({ ...args, defaultCallbacks: callbacks }),
|
|
@@ -288,7 +306,7 @@ function CheckoutModal({
|
|
|
288
306
|
buy({
|
|
289
307
|
orderId: order.orderId,
|
|
290
308
|
collectableDecimals: collectable.decimals || 0,
|
|
291
|
-
quantity: "1",
|
|
309
|
+
quantity: parseUnits("1", collectable.decimals || 0).toString(),
|
|
292
310
|
marketplace: order.marketplace
|
|
293
311
|
});
|
|
294
312
|
};
|
|
@@ -299,8 +317,18 @@ function CheckoutModal({
|
|
|
299
317
|
var ERC1155QuantityModal = observer2(
|
|
300
318
|
({ buy, collectable, order }) => {
|
|
301
319
|
buyModal$.state.quantity.set(
|
|
302
|
-
Math.
|
|
320
|
+
Math.min(Number(order.quantityRemaining), 1).toString()
|
|
303
321
|
);
|
|
322
|
+
const { data: currencies } = useCurrencies({
|
|
323
|
+
chainId: order.chainId,
|
|
324
|
+
collectionAddress: order.collectionContractAddress
|
|
325
|
+
});
|
|
326
|
+
const currency = currencies?.find(
|
|
327
|
+
(currency2) => currency2.contractAddress === order.priceCurrencyAddress
|
|
328
|
+
);
|
|
329
|
+
const quantity = Number(buyModal$.state.quantity.get());
|
|
330
|
+
const pricePerToken = order.priceAmount;
|
|
331
|
+
const totalPrice = (BigInt(quantity) * BigInt(pricePerToken)).toString();
|
|
304
332
|
return /* @__PURE__ */ jsx3(
|
|
305
333
|
ActionModal,
|
|
306
334
|
{
|
|
@@ -309,10 +337,13 @@ var ERC1155QuantityModal = observer2(
|
|
|
309
337
|
title: "Select Quantity",
|
|
310
338
|
ctas: [
|
|
311
339
|
{
|
|
312
|
-
label: "
|
|
340
|
+
label: "Buy now",
|
|
313
341
|
onClick: () => {
|
|
314
342
|
buy({
|
|
315
|
-
quantity:
|
|
343
|
+
quantity: parseUnits(
|
|
344
|
+
buyModal$.state.quantity.get(),
|
|
345
|
+
collectable.decimals || 0
|
|
346
|
+
).toString(),
|
|
316
347
|
orderId: order.orderId,
|
|
317
348
|
collectableDecimals: collectable.decimals || 0,
|
|
318
349
|
marketplace: order.marketplace
|
|
@@ -321,23 +352,33 @@ var ERC1155QuantityModal = observer2(
|
|
|
321
352
|
}
|
|
322
353
|
}
|
|
323
354
|
],
|
|
324
|
-
children: /* @__PURE__ */
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
355
|
+
children: /* @__PURE__ */ jsxs3(Box3, { display: "flex", flexDirection: "column", gap: "4", children: [
|
|
356
|
+
/* @__PURE__ */ jsx3(
|
|
357
|
+
QuantityInput,
|
|
358
|
+
{
|
|
359
|
+
$quantity: buyModal$.state.quantity,
|
|
360
|
+
$invalidQuantity: buyModal$.state.invalidQuantity,
|
|
361
|
+
decimals: order.quantityDecimals,
|
|
362
|
+
maxQuantity: order.quantityRemaining
|
|
363
|
+
}
|
|
364
|
+
),
|
|
365
|
+
/* @__PURE__ */ jsxs3(Box3, { display: "flex", justifyContent: "space-between", children: [
|
|
366
|
+
/* @__PURE__ */ jsx3(Text2, { color: "text50", fontSize: "small", children: "Total Price" }),
|
|
367
|
+
/* @__PURE__ */ jsxs3(Box3, { display: "flex", alignItems: "center", gap: "2", children: [
|
|
368
|
+
/* @__PURE__ */ jsx3(TokenImage, { src: currency?.imageUrl, size: "xs" }),
|
|
369
|
+
/* @__PURE__ */ jsx3(Text2, { color: "text100", fontSize: "small", fontWeight: "bold", children: formatUnits(BigInt(totalPrice), currency?.decimals || 0) })
|
|
370
|
+
] })
|
|
371
|
+
] })
|
|
372
|
+
] })
|
|
333
373
|
}
|
|
334
374
|
);
|
|
335
375
|
}
|
|
336
376
|
);
|
|
337
377
|
|
|
338
378
|
// src/react/ui/modals/CreateListingModal/index.tsx
|
|
339
|
-
import { Box as
|
|
379
|
+
import { Box as Box13 } from "@0xsequence/design-system";
|
|
340
380
|
import { Show as Show2, observer as observer8 } from "@legendapp/state/react";
|
|
381
|
+
import { parseUnits as parseUnits3 } from "viem";
|
|
341
382
|
import { useAccount as useAccount3 } from "wagmi";
|
|
342
383
|
|
|
343
384
|
// src/react/hooks/useCreateListing.tsx
|
|
@@ -385,18 +426,18 @@ var useCreateListing = ({
|
|
|
385
426
|
};
|
|
386
427
|
|
|
387
428
|
// src/react/ui/modals/_internal/components/actionModal/ErrorModal.tsx
|
|
388
|
-
import { Box as
|
|
429
|
+
import { Box as Box4 } from "@0xsequence/design-system";
|
|
389
430
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
390
|
-
var ErrorModal = ({ store, onClose, title }) => /* @__PURE__ */ jsx4(ActionModal, { store, onClose, title, ctas: [], children: /* @__PURE__ */ jsx4(
|
|
431
|
+
var ErrorModal = ({ store, onClose, title }) => /* @__PURE__ */ jsx4(ActionModal, { store, onClose, title, ctas: [], children: /* @__PURE__ */ jsx4(Box4, { display: "flex", justifyContent: "center", alignItems: "center", padding: "4", children: "Error loading item details" }) });
|
|
391
432
|
|
|
392
433
|
// src/react/ui/modals/_internal/components/actionModal/LoadingModal.tsx
|
|
393
|
-
import { Box as
|
|
434
|
+
import { Box as Box5, Spinner } from "@0xsequence/design-system";
|
|
394
435
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
395
|
-
var LoadingModal = ({ store, onClose, title }) => /* @__PURE__ */ jsx5(ActionModal, { store, onClose, title, ctas: [], children: /* @__PURE__ */ jsx5(
|
|
436
|
+
var LoadingModal = ({ store, onClose, title }) => /* @__PURE__ */ jsx5(ActionModal, { store, onClose, title, ctas: [], children: /* @__PURE__ */ jsx5(Box5, { display: "flex", justifyContent: "center", alignItems: "center", padding: "4", children: /* @__PURE__ */ jsx5(Spinner, { size: "lg" }) }) });
|
|
396
437
|
|
|
397
438
|
// src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx
|
|
398
439
|
import { useState as useState2 } from "react";
|
|
399
|
-
import { Box as
|
|
440
|
+
import { Box as Box6, Skeleton, Text as Text3 } from "@0xsequence/design-system";
|
|
400
441
|
import { observer as observer3 } from "@legendapp/state/react";
|
|
401
442
|
import { addDays, isSameDay } from "date-fns";
|
|
402
443
|
|
|
@@ -412,22 +453,22 @@ var itemIndicator = "fyvr11lw fyvr1qk fyvr11lk fyvr11ow fyvr11no";
|
|
|
412
453
|
var trigger = "fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw fyvr1zg fyvr111k fyvr11lk fyvr11ow fyvr11no fyvr11ik fyvr14g fyvr11cg fyvr11wr fyvr12w9 fyvr12zf fyvr12s9 fyvr11a4";
|
|
413
454
|
|
|
414
455
|
// src/react/ui/components/_internals/custom-select/CustomSelect.tsx
|
|
415
|
-
import { jsx as jsx6, jsxs as
|
|
456
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
416
457
|
var CustomSelectItem = React.forwardRef(({ children, ...props }, forwardedRef) => {
|
|
417
|
-
return /* @__PURE__ */
|
|
458
|
+
return /* @__PURE__ */ jsxs4(Select.Item, { className: item, ...props, ref: forwardedRef, children: [
|
|
418
459
|
/* @__PURE__ */ jsx6(Select.ItemText, { children }),
|
|
419
460
|
/* @__PURE__ */ jsx6(Select.ItemIndicator, { className: itemIndicator, children: /* @__PURE__ */ jsx6(CheckmarkIcon, { size: "xs" }) })
|
|
420
461
|
] });
|
|
421
462
|
});
|
|
422
463
|
var CustomSelect = ({
|
|
423
464
|
items,
|
|
424
|
-
|
|
465
|
+
value,
|
|
425
466
|
onValueChange,
|
|
426
467
|
defaultValue
|
|
427
468
|
}) => {
|
|
428
|
-
return /* @__PURE__ */
|
|
429
|
-
/* @__PURE__ */
|
|
430
|
-
/* @__PURE__ */ jsx6(Select.Value, {
|
|
469
|
+
return /* @__PURE__ */ jsxs4(Select.Root, { onValueChange, defaultValue, children: [
|
|
470
|
+
/* @__PURE__ */ jsxs4(Select.Trigger, { className: trigger, value, children: [
|
|
471
|
+
/* @__PURE__ */ jsx6(Select.Value, {}),
|
|
431
472
|
/* @__PURE__ */ jsx6(Select.Icon, { children: /* @__PURE__ */ jsx6(ChevronDownIcon, { size: "xs" }) })
|
|
432
473
|
] }),
|
|
433
474
|
/* @__PURE__ */ jsx6(Select.Portal, { children: /* @__PURE__ */ jsx6(Select.Content, { className: content, children: /* @__PURE__ */ jsx6(Select.Viewport, { children: items.map((item2, index) => /* @__PURE__ */ jsx6(
|
|
@@ -501,12 +542,12 @@ Calendar.displayName = "Calendar";
|
|
|
501
542
|
var calendar_default = Calendar;
|
|
502
543
|
|
|
503
544
|
// src/react/ui/modals/_internal/components/calendarPopover/index.tsx
|
|
504
|
-
import { jsx as jsx8, jsxs as
|
|
545
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
505
546
|
function CalendarPopover({
|
|
506
547
|
selectedDate,
|
|
507
548
|
setSelectedDate
|
|
508
549
|
}) {
|
|
509
|
-
return /* @__PURE__ */
|
|
550
|
+
return /* @__PURE__ */ jsxs5(Root2, { children: [
|
|
510
551
|
/* @__PURE__ */ jsx8(Trigger2, { asChild: true, children: /* @__PURE__ */ jsx8(
|
|
511
552
|
Button2,
|
|
512
553
|
{
|
|
@@ -529,7 +570,7 @@ function CalendarPopover({
|
|
|
529
570
|
}
|
|
530
571
|
|
|
531
572
|
// src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx
|
|
532
|
-
import { jsx as jsx9, jsxs as
|
|
573
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
533
574
|
var PRESET_RANGES = {
|
|
534
575
|
TODAY: {
|
|
535
576
|
label: "Today",
|
|
@@ -561,11 +602,12 @@ var ExpirationDateSelect = observer3(function ExpirationDateSelect2({
|
|
|
561
602
|
className,
|
|
562
603
|
$date
|
|
563
604
|
}) {
|
|
564
|
-
const
|
|
565
|
-
|
|
566
|
-
|
|
605
|
+
const defaultRange = "1_week";
|
|
606
|
+
const [range, setRange] = useState2(defaultRange);
|
|
607
|
+
function handleSelectPresetRange(range2) {
|
|
608
|
+
setRange(range2);
|
|
567
609
|
const presetRange = Object.values(PRESET_RANGES).find(
|
|
568
|
-
(preset) => preset.value ===
|
|
610
|
+
(preset) => preset.value === range2
|
|
569
611
|
);
|
|
570
612
|
if (!presetRange) {
|
|
571
613
|
return;
|
|
@@ -582,9 +624,12 @@ var ExpirationDateSelect = observer3(function ExpirationDateSelect2({
|
|
|
582
624
|
}
|
|
583
625
|
$date.set(date);
|
|
584
626
|
}
|
|
585
|
-
|
|
627
|
+
if (!$date.get()) {
|
|
628
|
+
return /* @__PURE__ */ jsx9(Skeleton, { borderRadius: "lg", width: "20", height: "7", marginRight: "3" });
|
|
629
|
+
}
|
|
630
|
+
return /* @__PURE__ */ jsxs6(Box6, { width: "full", position: "relative", children: [
|
|
586
631
|
/* @__PURE__ */ jsx9(
|
|
587
|
-
|
|
632
|
+
Text3,
|
|
588
633
|
{
|
|
589
634
|
fontSize: "small",
|
|
590
635
|
fontWeight: "medium",
|
|
@@ -595,8 +640,8 @@ var ExpirationDateSelect = observer3(function ExpirationDateSelect2({
|
|
|
595
640
|
children: "Set expiry"
|
|
596
641
|
}
|
|
597
642
|
),
|
|
598
|
-
/* @__PURE__ */
|
|
599
|
-
|
|
643
|
+
/* @__PURE__ */ jsxs6(
|
|
644
|
+
Box6,
|
|
600
645
|
{
|
|
601
646
|
className,
|
|
602
647
|
width: "full",
|
|
@@ -606,7 +651,7 @@ var ExpirationDateSelect = observer3(function ExpirationDateSelect2({
|
|
|
606
651
|
marginTop: "0.5",
|
|
607
652
|
children: [
|
|
608
653
|
/* @__PURE__ */ jsx9(
|
|
609
|
-
|
|
654
|
+
Box6,
|
|
610
655
|
{
|
|
611
656
|
position: "absolute",
|
|
612
657
|
right: "0",
|
|
@@ -619,19 +664,9 @@ var ExpirationDateSelect = observer3(function ExpirationDateSelect2({
|
|
|
619
664
|
label: preset.label,
|
|
620
665
|
value: preset.value
|
|
621
666
|
})),
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
addDays(/* @__PURE__ */ new Date(), preset.offset)
|
|
626
|
-
)
|
|
627
|
-
)?.label,
|
|
628
|
-
onValueChange: (value) => handleSelectPresetRange(value),
|
|
629
|
-
defaultValue: Object.values(PRESET_RANGES).find(
|
|
630
|
-
(preset) => isSameDay(
|
|
631
|
-
new Date($date.get()),
|
|
632
|
-
addDays(/* @__PURE__ */ new Date(), preset.offset)
|
|
633
|
-
)
|
|
634
|
-
)?.value
|
|
667
|
+
value: range,
|
|
668
|
+
defaultValue: defaultRange,
|
|
669
|
+
onValueChange: (value) => handleSelectPresetRange(value)
|
|
635
670
|
}
|
|
636
671
|
)
|
|
637
672
|
}
|
|
@@ -651,7 +686,7 @@ var ExpirationDateSelect = observer3(function ExpirationDateSelect2({
|
|
|
651
686
|
var expirationDateSelect_default = ExpirationDateSelect;
|
|
652
687
|
|
|
653
688
|
// src/react/ui/modals/_internal/components/floorPriceText/index.tsx
|
|
654
|
-
import { Text as
|
|
689
|
+
import { Text as Text4 } from "@0xsequence/design-system";
|
|
655
690
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
656
691
|
function FloorPriceText({
|
|
657
692
|
chainId,
|
|
@@ -678,7 +713,7 @@ function FloorPriceText({
|
|
|
678
713
|
});
|
|
679
714
|
const floorPriceDifferenceText = floorPriceRaw === price.amountRaw ? "Same as floor price" : `${floorPriceDifference}% ${floorPriceRaw > price.amountRaw ? "below" : "above"} floor price`;
|
|
680
715
|
return /* @__PURE__ */ jsx10(
|
|
681
|
-
|
|
716
|
+
Text4,
|
|
682
717
|
{
|
|
683
718
|
fontSize: "small",
|
|
684
719
|
fontWeight: "medium",
|
|
@@ -692,52 +727,61 @@ function FloorPriceText({
|
|
|
692
727
|
}
|
|
693
728
|
|
|
694
729
|
// src/react/ui/modals/_internal/components/priceInput/index.tsx
|
|
695
|
-
import { Box as
|
|
730
|
+
import { Box as Box7, NumericInput as NumericInput2, TokenImage as TokenImage2 } from "@0xsequence/design-system";
|
|
696
731
|
import { observer as observer5 } from "@legendapp/state/react";
|
|
697
732
|
import { useState as useState3 } from "react";
|
|
698
|
-
import { erc20Abi, parseUnits } from "viem";
|
|
733
|
+
import { erc20Abi, parseUnits as parseUnits2 } from "viem";
|
|
699
734
|
import { useAccount as useAccount2, useReadContract } from "wagmi";
|
|
700
735
|
|
|
701
736
|
// src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx
|
|
702
|
-
import { Skeleton } from "@0xsequence/design-system";
|
|
737
|
+
import { Skeleton as Skeleton2 } from "@0xsequence/design-system";
|
|
703
738
|
import { observer as observer4 } from "@legendapp/state/react";
|
|
704
739
|
import { useEffect as useEffect2 } from "react";
|
|
705
740
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
706
741
|
var CurrencyOptionsSelect = observer4(function CurrencyOptionsSelect2({
|
|
707
742
|
chainId,
|
|
708
743
|
collectionAddress,
|
|
709
|
-
$
|
|
744
|
+
selectedCurrency$
|
|
710
745
|
}) {
|
|
746
|
+
const currency = selectedCurrency$.get();
|
|
711
747
|
const { data: currencies, isLoading: currenciesLoading } = useCurrencies({
|
|
712
748
|
collectionAddress,
|
|
713
749
|
chainId
|
|
714
750
|
});
|
|
715
751
|
useEffect2(() => {
|
|
716
|
-
if (currencies && currencies.length > 0 &&
|
|
717
|
-
|
|
752
|
+
if (currencies && currencies.length > 0 && !selectedCurrency$.contractAddress.get()) {
|
|
753
|
+
selectedCurrency$.set(currencies[0]);
|
|
718
754
|
}
|
|
719
755
|
}, [currencies]);
|
|
720
|
-
if (!currencies || currenciesLoading) {
|
|
721
|
-
return /* @__PURE__ */ jsx11(
|
|
756
|
+
if (!currencies || currenciesLoading || !currency.symbol) {
|
|
757
|
+
return /* @__PURE__ */ jsx11(Skeleton2, { borderRadius: "lg", width: "20", height: "7", marginRight: "3" });
|
|
722
758
|
}
|
|
723
759
|
const options = currencies.map(
|
|
724
|
-
(
|
|
725
|
-
label:
|
|
726
|
-
value:
|
|
760
|
+
(currency2) => ({
|
|
761
|
+
label: currency2.symbol,
|
|
762
|
+
value: currency2.contractAddress
|
|
727
763
|
})
|
|
728
764
|
);
|
|
729
765
|
const onChange = (value) => {
|
|
730
766
|
const c = currencies.find(
|
|
731
|
-
(
|
|
767
|
+
(currency2) => currency2.contractAddress === value
|
|
732
768
|
);
|
|
733
|
-
|
|
769
|
+
selectedCurrency$.set(c);
|
|
734
770
|
};
|
|
735
|
-
|
|
771
|
+
console.log("currency", currency);
|
|
772
|
+
return /* @__PURE__ */ jsx11(
|
|
773
|
+
CustomSelect,
|
|
774
|
+
{
|
|
775
|
+
items: options,
|
|
776
|
+
value: currency.symbol,
|
|
777
|
+
onValueChange: onChange
|
|
778
|
+
}
|
|
779
|
+
);
|
|
736
780
|
});
|
|
737
781
|
var currencyOptionsSelect_default = CurrencyOptionsSelect;
|
|
738
782
|
|
|
739
783
|
// src/react/ui/modals/_internal/components/priceInput/index.tsx
|
|
740
|
-
import { jsx as jsx12, jsxs as
|
|
784
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
741
785
|
var PriceInput = observer5(function PriceInput2({
|
|
742
786
|
chainId,
|
|
743
787
|
collectionAddress,
|
|
@@ -770,20 +814,20 @@ var PriceInput = observer5(function PriceInput2({
|
|
|
770
814
|
};
|
|
771
815
|
const changeListingPrice = (value2) => {
|
|
772
816
|
setValue(value2);
|
|
773
|
-
const parsedAmount =
|
|
817
|
+
const parsedAmount = parseUnits2(value2, Number(currencyDecimals));
|
|
774
818
|
$listingPrice.amountRaw.set(parsedAmount.toString());
|
|
775
819
|
checkBalance && checkInsufficientBalance(parsedAmount.toString());
|
|
776
820
|
};
|
|
777
|
-
return /* @__PURE__ */
|
|
821
|
+
return /* @__PURE__ */ jsxs7(Box7, { className: priceInputWrapper, position: "relative", children: [
|
|
778
822
|
/* @__PURE__ */ jsx12(
|
|
779
|
-
|
|
823
|
+
Box7,
|
|
780
824
|
{
|
|
781
825
|
className: priceInputCurrencyImage,
|
|
782
826
|
position: "absolute",
|
|
783
827
|
left: "2",
|
|
784
828
|
display: "flex",
|
|
785
829
|
alignItems: "center",
|
|
786
|
-
children: /* @__PURE__ */ jsx12(
|
|
830
|
+
children: /* @__PURE__ */ jsx12(TokenImage2, { src: $listingPrice.currency.imageUrl.get(), size: "xs" })
|
|
787
831
|
}
|
|
788
832
|
),
|
|
789
833
|
/* @__PURE__ */ jsx12(
|
|
@@ -796,7 +840,7 @@ var PriceInput = observer5(function PriceInput2({
|
|
|
796
840
|
controls: /* @__PURE__ */ jsx12(
|
|
797
841
|
currencyOptionsSelect_default,
|
|
798
842
|
{
|
|
799
|
-
|
|
843
|
+
selectedCurrency$: $listingPrice?.currency,
|
|
800
844
|
collectionAddress,
|
|
801
845
|
chainId
|
|
802
846
|
}
|
|
@@ -806,19 +850,19 @@ var PriceInput = observer5(function PriceInput2({
|
|
|
806
850
|
width: "full"
|
|
807
851
|
}
|
|
808
852
|
),
|
|
809
|
-
balanceError && /* @__PURE__ */ jsx12(
|
|
853
|
+
balanceError && /* @__PURE__ */ jsx12(Box7, { color: "negative", fontSize: "small", children: balanceError })
|
|
810
854
|
] });
|
|
811
855
|
});
|
|
812
856
|
var priceInput_default = PriceInput;
|
|
813
857
|
|
|
814
858
|
// src/react/ui/modals/_internal/components/tokenPreview/index.tsx
|
|
815
|
-
import { Box as
|
|
859
|
+
import { Box as Box8, Image, Skeleton as Skeleton3, Text as Text5 } from "@0xsequence/design-system";
|
|
816
860
|
|
|
817
861
|
// src/react/ui/images/chess-tile.png
|
|
818
862
|
var chess_tile_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK8AAACuCAYAAABAzl3QAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAInSURBVHgB7dyxbUMxEAXBs6FEjagv91/AD+keeNFCMw1csmBEvJ/P53Nm4Xme2Xi/37Ph/nfeP+f8/Q5EiZcs8ZIlXrLES5Z4yRIvWeIlS7xkiZcs8ZIlXrLES5Z4yRIvWS//Ud2v3vfykiVessRLlnjJEi9Z4iVLvGSJlyzxkiVessRLlnjJEi9Z4iVLvGS9/Ed1v3j/nOPlpUu8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPGSJV6yxEuWeMmyz+v+bNjnhQviJUu8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPGSJV6yxEuWfV73Z8M+L1wQL1niJUu8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPGSJV6y7PO6Pxv2eeGCeMkSL1niJUu8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPGSZZ/X/dmwzwsXxEuWeMkSL1niJUu8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPu87s+GfV64IF6yxEuWeMkSL1niJUu8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZNnndX827PPCBfGSJV6yxEuWeMkSL1niJUu8ZImXLPGSJV6yxEuWeMkSL1niJcs+r/uzYZ8XLoiXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPGSJV6yxEuWeMkSL1n2ed2fDfu8cEG8ZImXLPGSJV6yxEuWeMkSL1niJUu8ZImXLPGSJV6y/gF97MkwfJRH7QAAAABJRU5ErkJggg==";
|
|
819
863
|
|
|
820
864
|
// src/react/ui/modals/_internal/components/tokenPreview/index.tsx
|
|
821
|
-
import { jsx as jsx13, jsxs as
|
|
865
|
+
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
822
866
|
function TokenPreview({
|
|
823
867
|
collectionName,
|
|
824
868
|
collectionAddress,
|
|
@@ -831,15 +875,15 @@ function TokenPreview({
|
|
|
831
875
|
collectibleId
|
|
832
876
|
});
|
|
833
877
|
if (collectibleLoading) {
|
|
834
|
-
return /* @__PURE__ */
|
|
835
|
-
/* @__PURE__ */ jsx13(
|
|
836
|
-
/* @__PURE__ */
|
|
837
|
-
/* @__PURE__ */ jsx13(
|
|
838
|
-
/* @__PURE__ */ jsx13(
|
|
878
|
+
return /* @__PURE__ */ jsxs8(Box8, { display: "flex", alignItems: "center", gap: "3", width: "full", children: [
|
|
879
|
+
/* @__PURE__ */ jsx13(Skeleton3, { width: "9", height: "9", borderRadius: "xs" }),
|
|
880
|
+
/* @__PURE__ */ jsxs8(Box8, { display: "flex", flexGrow: "1", gap: "1", flexDirection: "column", children: [
|
|
881
|
+
/* @__PURE__ */ jsx13(Skeleton3, { width: "1/3", height: "3" }),
|
|
882
|
+
/* @__PURE__ */ jsx13(Skeleton3, { width: "1/2", height: "3" })
|
|
839
883
|
] })
|
|
840
884
|
] });
|
|
841
885
|
}
|
|
842
|
-
return /* @__PURE__ */
|
|
886
|
+
return /* @__PURE__ */ jsxs8(Box8, { className: tokenPreview, children: [
|
|
843
887
|
/* @__PURE__ */ jsx13(
|
|
844
888
|
Image,
|
|
845
889
|
{
|
|
@@ -850,9 +894,9 @@ function TokenPreview({
|
|
|
850
894
|
borderRadius: "xs"
|
|
851
895
|
}
|
|
852
896
|
),
|
|
853
|
-
/* @__PURE__ */
|
|
897
|
+
/* @__PURE__ */ jsxs8(Box8, { display: "flex", flexDirection: "column", marginLeft: "3", children: [
|
|
854
898
|
/* @__PURE__ */ jsx13(
|
|
855
|
-
|
|
899
|
+
Text5,
|
|
856
900
|
{
|
|
857
901
|
fontSize: "small",
|
|
858
902
|
color: "text80",
|
|
@@ -862,7 +906,7 @@ function TokenPreview({
|
|
|
862
906
|
}
|
|
863
907
|
),
|
|
864
908
|
/* @__PURE__ */ jsx13(
|
|
865
|
-
|
|
909
|
+
Text5,
|
|
866
910
|
{
|
|
867
911
|
fontSize: "small",
|
|
868
912
|
fontWeight: "bold",
|
|
@@ -876,9 +920,9 @@ function TokenPreview({
|
|
|
876
920
|
}
|
|
877
921
|
|
|
878
922
|
// src/react/ui/modals/_internal/components/transactionDetails/index.tsx
|
|
879
|
-
import { Box as
|
|
880
|
-
import { formatUnits } from "viem";
|
|
881
|
-
import { jsx as jsx14, jsxs as
|
|
923
|
+
import { Box as Box9, Image as Image2, Skeleton as Skeleton4, Text as Text6 } from "@0xsequence/design-system";
|
|
924
|
+
import { formatUnits as formatUnits2 } from "viem";
|
|
925
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
882
926
|
var DEFAULT_MARKETPLACE_FEE_PERCENTAGE = 2.5;
|
|
883
927
|
function TransactionDetails({
|
|
884
928
|
collectibleId,
|
|
@@ -897,25 +941,25 @@ function TransactionDetails({
|
|
|
897
941
|
collectibleId
|
|
898
942
|
});
|
|
899
943
|
const priceLoading = !price || marketplaceConfigLoading || royaltyPercentageLoading;
|
|
900
|
-
let formattedAmount = price &&
|
|
944
|
+
let formattedAmount = price && formatUnits2(BigInt(price.amountRaw), price.currency.decimals);
|
|
901
945
|
if (royaltyPercentage !== void 0 && formattedAmount) {
|
|
902
946
|
formattedAmount = (Number.parseFloat(formattedAmount) - Number.parseFloat(formattedAmount) * Number(royaltyPercentage) / 100).toString();
|
|
903
947
|
}
|
|
904
948
|
if (marketplaceFeePercentage !== void 0 && formattedAmount) {
|
|
905
949
|
formattedAmount = (Number.parseFloat(formattedAmount) - Number.parseFloat(formattedAmount) * marketplaceFeePercentage / 100).toString();
|
|
906
950
|
}
|
|
907
|
-
return /* @__PURE__ */
|
|
908
|
-
|
|
951
|
+
return /* @__PURE__ */ jsxs9(
|
|
952
|
+
Box9,
|
|
909
953
|
{
|
|
910
954
|
width: "full",
|
|
911
955
|
display: "flex",
|
|
912
956
|
justifyContent: "space-between",
|
|
913
957
|
alignItems: "center",
|
|
914
958
|
children: [
|
|
915
|
-
/* @__PURE__ */ jsx14(
|
|
916
|
-
/* @__PURE__ */
|
|
959
|
+
/* @__PURE__ */ jsx14(Text6, { fontSize: "small", color: "text50", fontFamily: "body", children: "Total earnings" }),
|
|
960
|
+
/* @__PURE__ */ jsxs9(Box9, { display: "flex", alignItems: "center", gap: "2", children: [
|
|
917
961
|
/* @__PURE__ */ jsx14(Image2, { src: currencyImageUrl, width: "3", height: "3" }),
|
|
918
|
-
priceLoading ? /* @__PURE__ */ jsx14(
|
|
962
|
+
priceLoading ? /* @__PURE__ */ jsx14(Skeleton4, { width: "16", height: "4" }) : /* @__PURE__ */ jsxs9(Text6, { fontSize: "small", color: "text100", fontFamily: "body", children: [
|
|
919
963
|
formattedAmount,
|
|
920
964
|
" ",
|
|
921
965
|
price.currency.symbol
|
|
@@ -930,32 +974,33 @@ function TransactionDetails({
|
|
|
930
974
|
import {
|
|
931
975
|
CloseIcon,
|
|
932
976
|
IconButton as IconButton2,
|
|
933
|
-
Skeleton as
|
|
934
|
-
Text as
|
|
977
|
+
Skeleton as Skeleton6,
|
|
978
|
+
Text as Text10
|
|
935
979
|
} from "@0xsequence/design-system";
|
|
936
980
|
import { observer as observer7 } from "@legendapp/state/react";
|
|
937
981
|
import { Close, Content as Content3, Overlay, Portal as Portal3, Root as Root3 } from "@radix-ui/react-dialog";
|
|
938
|
-
import { useEffect as useEffect4 } from "react";
|
|
939
|
-
import {
|
|
982
|
+
import { useEffect as useEffect4, useState as useState5 } from "react";
|
|
983
|
+
import { WaitForTransactionReceiptTimeoutError } from "viem";
|
|
940
984
|
|
|
941
985
|
// src/react/ui/modals/_internal/components/transaction-footer/index.tsx
|
|
942
|
-
import { Box as Box9, Spinner as Spinner2, Text as Text6 } from "@0xsequence/design-system";
|
|
943
986
|
import { networks } from "@0xsequence/network";
|
|
944
|
-
import {
|
|
987
|
+
import { Box as Box10, Spinner as Spinner2, Text as Text7 } from "@0xsequence/design-system";
|
|
988
|
+
import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
945
989
|
function TransactionFooter({
|
|
946
990
|
transactionHash,
|
|
947
991
|
isConfirming,
|
|
948
992
|
isConfirmed,
|
|
949
993
|
isFailed,
|
|
994
|
+
isTimeout,
|
|
950
995
|
chainId
|
|
951
996
|
}) {
|
|
952
997
|
const icon = isConfirming && /* @__PURE__ */ jsx15(Spinner2, { size: "md" }) || isConfirmed && /* @__PURE__ */ jsx15(PositiveCircleIcon_default, { size: "md" });
|
|
953
|
-
const title = isConfirming && "Processing transaction" || isConfirmed && "Transaction complete" || isFailed && "Transaction failed";
|
|
998
|
+
const title = isConfirming && "Processing transaction" || isConfirmed && "Transaction complete" || isFailed && "Transaction failed" || isTimeout && "Transaction took longer than expected";
|
|
954
999
|
const transactionUrl = `${networks[chainId]?.blockExplorer?.rootUrl}tx/${transactionHash}`;
|
|
955
|
-
return /* @__PURE__ */
|
|
1000
|
+
return /* @__PURE__ */ jsxs10(Box10, { display: "flex", alignItems: "center", children: [
|
|
956
1001
|
icon,
|
|
957
1002
|
/* @__PURE__ */ jsx15(
|
|
958
|
-
|
|
1003
|
+
Text7,
|
|
959
1004
|
{
|
|
960
1005
|
color: "text50",
|
|
961
1006
|
fontSize: "normal",
|
|
@@ -966,7 +1011,7 @@ function TransactionFooter({
|
|
|
966
1011
|
}
|
|
967
1012
|
),
|
|
968
1013
|
/* @__PURE__ */ jsx15(
|
|
969
|
-
|
|
1014
|
+
Box10,
|
|
970
1015
|
{
|
|
971
1016
|
as: "a",
|
|
972
1017
|
flexGrow: "1",
|
|
@@ -977,7 +1022,7 @@ function TransactionFooter({
|
|
|
977
1022
|
textAlign: "right",
|
|
978
1023
|
textDecoration: "none",
|
|
979
1024
|
children: /* @__PURE__ */ jsx15(
|
|
980
|
-
|
|
1025
|
+
Text7,
|
|
981
1026
|
{
|
|
982
1027
|
color: "polygonLight",
|
|
983
1028
|
textAlign: "right",
|
|
@@ -993,12 +1038,18 @@ function TransactionFooter({
|
|
|
993
1038
|
}
|
|
994
1039
|
|
|
995
1040
|
// src/react/ui/modals/_internal/components/transactionPreview/index.tsx
|
|
996
|
-
import {
|
|
1041
|
+
import {
|
|
1042
|
+
Box as Box12,
|
|
1043
|
+
Image as Image3,
|
|
1044
|
+
NetworkImage,
|
|
1045
|
+
Skeleton as Skeleton5,
|
|
1046
|
+
Text as Text9
|
|
1047
|
+
} from "@0xsequence/design-system";
|
|
997
1048
|
import { observer as observer6 } from "@legendapp/state/react";
|
|
998
|
-
import { formatUnits as
|
|
1049
|
+
import { formatUnits as formatUnits3 } from "viem";
|
|
999
1050
|
|
|
1000
1051
|
// src/react/ui/modals/_internal/components/timeAgo/index.tsx
|
|
1001
|
-
import { Box as
|
|
1052
|
+
import { Box as Box11, Text as Text8 } from "@0xsequence/design-system";
|
|
1002
1053
|
import { formatDistanceToNow } from "date-fns";
|
|
1003
1054
|
import { useEffect as useEffect3, useState as useState4 } from "react";
|
|
1004
1055
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
@@ -1011,13 +1062,13 @@ function TimeAgo({ date }) {
|
|
|
1011
1062
|
return () => clearInterval(interval);
|
|
1012
1063
|
}, [date]);
|
|
1013
1064
|
return /* @__PURE__ */ jsx16(
|
|
1014
|
-
|
|
1065
|
+
Box11,
|
|
1015
1066
|
{
|
|
1016
1067
|
flexGrow: "1",
|
|
1017
1068
|
display: "flex",
|
|
1018
1069
|
alignItems: "center",
|
|
1019
1070
|
justifyContent: "flex-end",
|
|
1020
|
-
children: /* @__PURE__ */ jsx16(
|
|
1071
|
+
children: /* @__PURE__ */ jsx16(Text8, { color: "text50", fontSize: "small", children: timeAgo })
|
|
1021
1072
|
}
|
|
1022
1073
|
);
|
|
1023
1074
|
}
|
|
@@ -1031,12 +1082,12 @@ var initialState2 = {
|
|
|
1031
1082
|
price,
|
|
1032
1083
|
collectionAddress,
|
|
1033
1084
|
chainId,
|
|
1034
|
-
|
|
1035
|
-
getTitle,
|
|
1036
|
-
getMessage: getMessage2,
|
|
1085
|
+
collectibleId,
|
|
1037
1086
|
type,
|
|
1038
1087
|
callbacks,
|
|
1039
|
-
queriesToInvalidate
|
|
1088
|
+
queriesToInvalidate,
|
|
1089
|
+
confirmations,
|
|
1090
|
+
blocked
|
|
1040
1091
|
}) => {
|
|
1041
1092
|
transactionStatusModal$.state.set({
|
|
1042
1093
|
...transactionStatusModal$.state.get(),
|
|
@@ -1044,12 +1095,12 @@ var initialState2 = {
|
|
|
1044
1095
|
price,
|
|
1045
1096
|
collectionAddress,
|
|
1046
1097
|
chainId,
|
|
1047
|
-
|
|
1048
|
-
getTitle,
|
|
1049
|
-
getMessage: getMessage2,
|
|
1098
|
+
collectibleId,
|
|
1050
1099
|
type,
|
|
1051
1100
|
callbacks,
|
|
1052
|
-
queriesToInvalidate
|
|
1101
|
+
queriesToInvalidate,
|
|
1102
|
+
confirmations,
|
|
1103
|
+
blocked
|
|
1053
1104
|
});
|
|
1054
1105
|
transactionStatusModal$.isOpen.set(true);
|
|
1055
1106
|
},
|
|
@@ -1065,10 +1116,12 @@ var initialState2 = {
|
|
|
1065
1116
|
price: void 0,
|
|
1066
1117
|
collectionAddress: "",
|
|
1067
1118
|
chainId: "",
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1119
|
+
collectibleId: "",
|
|
1120
|
+
type: void 0,
|
|
1121
|
+
callbacks: void 0,
|
|
1122
|
+
queriesToInvalidate: [],
|
|
1123
|
+
confirmations: -1,
|
|
1124
|
+
blocked: false
|
|
1072
1125
|
}
|
|
1073
1126
|
};
|
|
1074
1127
|
var transactionStatusModal$ = observable3(initialState2);
|
|
@@ -1078,30 +1131,35 @@ import { useMemo } from "react";
|
|
|
1078
1131
|
|
|
1079
1132
|
// src/react/ui/modals/_internal/components/transactionPreview/consts.ts
|
|
1080
1133
|
var TRANSACTION_TITLES = {
|
|
1081
|
-
|
|
1134
|
+
SELL: {
|
|
1082
1135
|
confirming: "Selling",
|
|
1083
1136
|
confirmed: "Sold",
|
|
1084
1137
|
failed: "Sale failed"
|
|
1085
1138
|
},
|
|
1086
|
-
|
|
1139
|
+
LISTING: {
|
|
1087
1140
|
confirming: "Creating listing",
|
|
1088
1141
|
confirmed: "Listed",
|
|
1089
1142
|
failed: "Listing failed"
|
|
1090
1143
|
},
|
|
1091
|
-
|
|
1144
|
+
OFFER: {
|
|
1092
1145
|
confirming: "Creating offer",
|
|
1093
1146
|
confirmed: "Offer created",
|
|
1094
1147
|
failed: "Offer failed"
|
|
1095
1148
|
},
|
|
1096
|
-
|
|
1149
|
+
BUY: {
|
|
1097
1150
|
confirming: "Buying",
|
|
1098
1151
|
confirmed: "Bought",
|
|
1099
1152
|
failed: "Purchase failed"
|
|
1100
1153
|
},
|
|
1101
|
-
|
|
1154
|
+
TRANSFER: {
|
|
1102
1155
|
confirming: "Transferring",
|
|
1103
1156
|
confirmed: "Transferred",
|
|
1104
1157
|
failed: "Transfer failed"
|
|
1158
|
+
},
|
|
1159
|
+
CANCEL: {
|
|
1160
|
+
confirming: "Cancelling",
|
|
1161
|
+
confirmed: "Cancelled",
|
|
1162
|
+
failed: "Cancellation failed"
|
|
1105
1163
|
}
|
|
1106
1164
|
};
|
|
1107
1165
|
|
|
@@ -1119,35 +1177,40 @@ function useTransactionPreviewTitle(status, type) {
|
|
|
1119
1177
|
}
|
|
1120
1178
|
|
|
1121
1179
|
// src/react/ui/modals/_internal/components/transactionPreview/index.tsx
|
|
1122
|
-
import { jsx as jsx17, jsxs as
|
|
1180
|
+
import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1123
1181
|
var TransactionPreview = observer6(
|
|
1124
1182
|
({
|
|
1125
1183
|
price,
|
|
1126
1184
|
collectionAddress,
|
|
1127
1185
|
chainId,
|
|
1128
1186
|
collectible,
|
|
1187
|
+
collectibleLoading,
|
|
1129
1188
|
currencyImageUrl,
|
|
1130
1189
|
isConfirming,
|
|
1131
1190
|
isConfirmed,
|
|
1132
|
-
isFailed
|
|
1191
|
+
isFailed,
|
|
1192
|
+
isTimeout
|
|
1133
1193
|
}) => {
|
|
1134
1194
|
const { type } = transactionStatusModal$.state.get();
|
|
1135
1195
|
const title = useTransactionPreviewTitle(
|
|
1136
|
-
{ isConfirmed, isConfirming, isFailed },
|
|
1196
|
+
{ isConfirmed, isConfirming, isFailed, isTimeout },
|
|
1137
1197
|
type
|
|
1138
1198
|
);
|
|
1139
|
-
const { data: collection } = useCollection({
|
|
1199
|
+
const { data: collection, isLoading: collectionLoading } = useCollection({
|
|
1140
1200
|
collectionAddress,
|
|
1141
1201
|
chainId
|
|
1142
1202
|
});
|
|
1143
|
-
const collectibleImage2 = collectible
|
|
1144
|
-
const collectibleName = collectible
|
|
1203
|
+
const collectibleImage2 = collectible?.image;
|
|
1204
|
+
const collectibleName = collectible?.name;
|
|
1145
1205
|
const collectionName = collection?.name;
|
|
1146
|
-
const priceFormatted = price ?
|
|
1147
|
-
|
|
1148
|
-
/* @__PURE__ */
|
|
1206
|
+
const priceFormatted = price ? formatUnits3(BigInt(price.amountRaw), price.currency.decimals) : void 0;
|
|
1207
|
+
if (collectibleLoading || collectionLoading) {
|
|
1208
|
+
return /* @__PURE__ */ jsx17(Box12, { style: { height: 83 }, width: "full", borderRadius: "md", children: /* @__PURE__ */ jsx17(Skeleton5, { style: { width: "100%", height: "100%" } }) });
|
|
1209
|
+
}
|
|
1210
|
+
return /* @__PURE__ */ jsxs11(Box12, { padding: "3", background: "backgroundSecondary", borderRadius: "md", children: [
|
|
1211
|
+
/* @__PURE__ */ jsxs11(Box12, { display: "flex", alignItems: "center", children: [
|
|
1149
1212
|
/* @__PURE__ */ jsx17(
|
|
1150
|
-
|
|
1213
|
+
Text9,
|
|
1151
1214
|
{
|
|
1152
1215
|
color: "text50",
|
|
1153
1216
|
fontSize: "small",
|
|
@@ -1160,7 +1223,7 @@ var TransactionPreview = observer6(
|
|
|
1160
1223
|
/* @__PURE__ */ jsx17(NetworkImage, { chainId: Number(chainId), size: "xs" }),
|
|
1161
1224
|
isConfirming && /* @__PURE__ */ jsx17(TimeAgo, { date: /* @__PURE__ */ new Date() })
|
|
1162
1225
|
] }),
|
|
1163
|
-
/* @__PURE__ */
|
|
1226
|
+
/* @__PURE__ */ jsxs11(Box12, { display: "flex", alignItems: "center", marginTop: "2", children: [
|
|
1164
1227
|
/* @__PURE__ */ jsx17(
|
|
1165
1228
|
Image3,
|
|
1166
1229
|
{
|
|
@@ -1169,11 +1232,12 @@ var TransactionPreview = observer6(
|
|
|
1169
1232
|
width: "9",
|
|
1170
1233
|
height: "9",
|
|
1171
1234
|
borderRadius: "xs",
|
|
1172
|
-
marginRight: "3"
|
|
1235
|
+
marginRight: "3",
|
|
1236
|
+
style: { objectFit: "cover" }
|
|
1173
1237
|
}
|
|
1174
1238
|
),
|
|
1175
|
-
/* @__PURE__ */
|
|
1176
|
-
|
|
1239
|
+
/* @__PURE__ */ jsxs11(
|
|
1240
|
+
Box12,
|
|
1177
1241
|
{
|
|
1178
1242
|
display: "flex",
|
|
1179
1243
|
flexDirection: "column",
|
|
@@ -1181,7 +1245,7 @@ var TransactionPreview = observer6(
|
|
|
1181
1245
|
gap: "0.5",
|
|
1182
1246
|
children: [
|
|
1183
1247
|
/* @__PURE__ */ jsx17(
|
|
1184
|
-
|
|
1248
|
+
Text9,
|
|
1185
1249
|
{
|
|
1186
1250
|
color: "text80",
|
|
1187
1251
|
fontSize: "small",
|
|
@@ -1190,12 +1254,12 @@ var TransactionPreview = observer6(
|
|
|
1190
1254
|
children: collectibleName
|
|
1191
1255
|
}
|
|
1192
1256
|
),
|
|
1193
|
-
/* @__PURE__ */ jsx17(
|
|
1257
|
+
/* @__PURE__ */ jsx17(Text9, { color: "text100", fontSize: "small", fontFamily: "body", children: collectionName })
|
|
1194
1258
|
]
|
|
1195
1259
|
}
|
|
1196
1260
|
),
|
|
1197
|
-
price && /* @__PURE__ */
|
|
1198
|
-
|
|
1261
|
+
price && /* @__PURE__ */ jsxs11(
|
|
1262
|
+
Box12,
|
|
1199
1263
|
{
|
|
1200
1264
|
flexGrow: "1",
|
|
1201
1265
|
display: "flex",
|
|
@@ -1204,8 +1268,8 @@ var TransactionPreview = observer6(
|
|
|
1204
1268
|
gap: "1",
|
|
1205
1269
|
children: [
|
|
1206
1270
|
/* @__PURE__ */ jsx17(Image3, { src: currencyImageUrl, width: "3", height: "3" }),
|
|
1207
|
-
/* @__PURE__ */
|
|
1208
|
-
|
|
1271
|
+
/* @__PURE__ */ jsxs11(
|
|
1272
|
+
Text9,
|
|
1209
1273
|
{
|
|
1210
1274
|
color: "text80",
|
|
1211
1275
|
fontSize: "small",
|
|
@@ -1233,62 +1297,140 @@ var dialogOverlay3 = "fyvr1m0 fyvr1o8 fyvr1qg fyvr1so fyvr11xl fyvr11m0 fyvr11rs
|
|
|
1233
1297
|
var transactionStatusModalContent = "modal_dialogContent_wide__1ypl6nt3 modal_dialogContentBase__1ypl6nt1 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs fyvr11l8 fyvr11wl fyvr11m0 fyvr11rs fyvr1vo fyvr1xs fyvr1zw fyvr1120 fyvr11lc fyvr11mc fyvr11cw";
|
|
1234
1298
|
|
|
1235
1299
|
// src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx
|
|
1236
|
-
import {
|
|
1300
|
+
import { TRANSACTION_CONFIRMATIONS_DEFAULT } from "@0xsequence/kit";
|
|
1301
|
+
|
|
1302
|
+
// src/react/ui/modals/_internal/components/transactionStatusModal/util/getFormattedType.ts
|
|
1303
|
+
function getFormattedType(transactionType, verb = false) {
|
|
1304
|
+
switch (transactionType) {
|
|
1305
|
+
case "TRANSFER" /* TRANSFER */:
|
|
1306
|
+
return verb ? "transferred" : "transfer";
|
|
1307
|
+
case "LISTING" /* LISTING */:
|
|
1308
|
+
return verb ? "listed" : "listing";
|
|
1309
|
+
case "BUY" /* BUY */:
|
|
1310
|
+
return verb ? "purchased" : "purchase";
|
|
1311
|
+
case "SELL" /* SELL */:
|
|
1312
|
+
return verb ? "sold" : "sale";
|
|
1313
|
+
case "CANCEL" /* CANCEL */:
|
|
1314
|
+
return verb ? "cancelled" : "cancellation";
|
|
1315
|
+
case "OFFER" /* OFFER */:
|
|
1316
|
+
return verb ? "offered" : "offer";
|
|
1317
|
+
default:
|
|
1318
|
+
return "transaction";
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
// src/react/ui/modals/_internal/components/transactionStatusModal/util/getTitle.ts
|
|
1323
|
+
function getTransactionStatusModalTitle({
|
|
1324
|
+
transactionStatus,
|
|
1325
|
+
transactionType
|
|
1326
|
+
}) {
|
|
1327
|
+
switch (transactionStatus) {
|
|
1328
|
+
case "PENDING":
|
|
1329
|
+
return `Your ${getFormattedType(transactionType)} is processing`;
|
|
1330
|
+
case "SUCCESS":
|
|
1331
|
+
return `Your ${getFormattedType(transactionType)} has processed`;
|
|
1332
|
+
case "FAILED":
|
|
1333
|
+
return `Your ${getFormattedType(transactionType)} has failed`;
|
|
1334
|
+
case "TIMEOUT":
|
|
1335
|
+
return `Your ${getFormattedType(transactionType)} takes too long`;
|
|
1336
|
+
default:
|
|
1337
|
+
return "Your transaction is processing";
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
// src/react/ui/modals/_internal/components/transactionStatusModal/util/getMessage.ts
|
|
1342
|
+
function getTransactionStatusModalMessage({
|
|
1343
|
+
transactionStatus,
|
|
1344
|
+
transactionType,
|
|
1345
|
+
collectibleName
|
|
1346
|
+
}) {
|
|
1347
|
+
const hideCollectibleName = transactionType === "CANCEL";
|
|
1348
|
+
switch (transactionStatus) {
|
|
1349
|
+
case "PENDING":
|
|
1350
|
+
return `You just ${getFormattedType(transactionType, true)}${!hideCollectibleName ? ` ${collectibleName}` : ""}. It should be confirmed on the blockchain shortly.`;
|
|
1351
|
+
case "SUCCESS":
|
|
1352
|
+
return `You just ${getFormattedType(transactionType, true)}${!hideCollectibleName ? ` ${collectibleName}` : ""}. It\u2019s been confirmed on the blockchain!`;
|
|
1353
|
+
case "FAILED":
|
|
1354
|
+
return `Your ${getFormattedType(transactionType)} has failed.`;
|
|
1355
|
+
case "TIMEOUT":
|
|
1356
|
+
return `Your ${getFormattedType(transactionType)} takes too long. Click the link below to track it on the explorer.`;
|
|
1357
|
+
default:
|
|
1358
|
+
return "Your transaction is processing";
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
// src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx
|
|
1363
|
+
import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1237
1364
|
var useTransactionStatusModal = () => {
|
|
1238
1365
|
return {
|
|
1239
|
-
show: (args) =>
|
|
1366
|
+
show: (args) => {
|
|
1367
|
+
if (args.blocked) return;
|
|
1368
|
+
transactionStatusModal$.open(args);
|
|
1369
|
+
},
|
|
1240
1370
|
close: () => transactionStatusModal$.close()
|
|
1241
1371
|
};
|
|
1242
1372
|
};
|
|
1243
1373
|
var TransactionStatusModal = observer7(() => {
|
|
1244
1374
|
const {
|
|
1375
|
+
type,
|
|
1245
1376
|
hash,
|
|
1246
1377
|
price,
|
|
1247
1378
|
collectionAddress,
|
|
1248
1379
|
chainId,
|
|
1249
|
-
|
|
1250
|
-
getTitle,
|
|
1251
|
-
getMessage: getMessage2,
|
|
1380
|
+
collectibleId,
|
|
1252
1381
|
callbacks,
|
|
1253
|
-
queriesToInvalidate
|
|
1382
|
+
queriesToInvalidate,
|
|
1383
|
+
confirmations
|
|
1254
1384
|
} = transactionStatusModal$.state.get();
|
|
1255
|
-
const { data: collectible } = useCollectible({
|
|
1385
|
+
const { data: collectible, isLoading: collectibleLoading } = useCollectible({
|
|
1256
1386
|
collectionAddress,
|
|
1257
1387
|
chainId,
|
|
1258
|
-
collectibleId
|
|
1388
|
+
collectibleId
|
|
1259
1389
|
});
|
|
1260
|
-
const
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1390
|
+
const [transactionStatus, setTransactionStatus] = useState5("PENDING");
|
|
1391
|
+
const title = getTransactionStatusModalTitle({
|
|
1392
|
+
transactionStatus,
|
|
1393
|
+
transactionType: type
|
|
1394
|
+
});
|
|
1395
|
+
const message = getTransactionStatusModalMessage({
|
|
1396
|
+
transactionStatus,
|
|
1397
|
+
transactionType: type,
|
|
1398
|
+
collectibleName: collectible?.name || ""
|
|
1399
|
+
});
|
|
1400
|
+
const { onError, onSuccess } = callbacks || {};
|
|
1270
1401
|
const queryClient = getQueryClient();
|
|
1402
|
+
const publicClient = chainId ? getPublicRpcClient(chainId) : null;
|
|
1403
|
+
const waitForTransactionReceiptPromise = publicClient?.waitForTransactionReceipt({
|
|
1404
|
+
confirmations: confirmations || TRANSACTION_CONFIRMATIONS_DEFAULT,
|
|
1405
|
+
hash
|
|
1406
|
+
});
|
|
1271
1407
|
useEffect4(() => {
|
|
1272
1408
|
if (!transactionStatusModal$.isOpen.get()) return;
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1409
|
+
console.log("Waiting for transaction receipt ...");
|
|
1410
|
+
waitForTransactionReceiptPromise?.then((receipt) => {
|
|
1411
|
+
if (receipt.status === "success") {
|
|
1412
|
+
console.log("receipt", receipt);
|
|
1413
|
+
setTransactionStatus("SUCCESS");
|
|
1414
|
+
}
|
|
1415
|
+
}).catch((error) => {
|
|
1416
|
+
if (error instanceof WaitForTransactionReceiptTimeoutError) {
|
|
1417
|
+
setTransactionStatus("TIMEOUT");
|
|
1418
|
+
return;
|
|
1419
|
+
}
|
|
1420
|
+
setTransactionStatus("FAILED");
|
|
1421
|
+
});
|
|
1422
|
+
if (queriesToInvalidate) {
|
|
1281
1423
|
queryClient.invalidateQueries({ queryKey: [...queriesToInvalidate] });
|
|
1282
1424
|
}
|
|
1283
1425
|
return () => {
|
|
1284
|
-
|
|
1426
|
+
setTransactionStatus("PENDING");
|
|
1285
1427
|
};
|
|
1286
|
-
}, [
|
|
1287
|
-
return /* @__PURE__ */ jsx18(Root3, { open: transactionStatusModal$.isOpen.get(), children: /* @__PURE__ */
|
|
1428
|
+
}, [onSuccess, onError, transactionStatusModal$.isOpen.get()]);
|
|
1429
|
+
return /* @__PURE__ */ jsx18(Root3, { open: transactionStatusModal$.isOpen.get(), children: /* @__PURE__ */ jsxs12(Portal3, { children: [
|
|
1288
1430
|
/* @__PURE__ */ jsx18(Overlay, { className: dialogOverlay3 }),
|
|
1289
|
-
/* @__PURE__ */
|
|
1431
|
+
/* @__PURE__ */ jsxs12(Content3, { className: transactionStatusModalContent, children: [
|
|
1290
1432
|
title ? /* @__PURE__ */ jsx18(
|
|
1291
|
-
|
|
1433
|
+
Text10,
|
|
1292
1434
|
{
|
|
1293
1435
|
fontSize: "large",
|
|
1294
1436
|
fontWeight: "bold",
|
|
@@ -1296,28 +1438,31 @@ var TransactionStatusModal = observer7(() => {
|
|
|
1296
1438
|
fontFamily: "body",
|
|
1297
1439
|
children: title
|
|
1298
1440
|
}
|
|
1299
|
-
) : /* @__PURE__ */ jsx18(
|
|
1300
|
-
message ? /* @__PURE__ */ jsx18(
|
|
1301
|
-
|
|
1441
|
+
) : /* @__PURE__ */ jsx18(Skeleton6, { width: "16", height: "6" }),
|
|
1442
|
+
message ? /* @__PURE__ */ jsx18(Text10, { fontSize: "small", color: "text80", fontFamily: "body", children: message }) : /* @__PURE__ */ jsx18(Skeleton6, { width: "20", height: "4" }),
|
|
1443
|
+
/* @__PURE__ */ jsx18(
|
|
1302
1444
|
transactionPreview_default,
|
|
1303
1445
|
{
|
|
1304
1446
|
price,
|
|
1305
1447
|
collectionAddress,
|
|
1306
1448
|
chainId,
|
|
1307
1449
|
collectible,
|
|
1450
|
+
collectibleLoading,
|
|
1308
1451
|
currencyImageUrl: price?.currency.imageUrl,
|
|
1309
|
-
isConfirming,
|
|
1310
|
-
isConfirmed,
|
|
1311
|
-
isFailed:
|
|
1452
|
+
isConfirming: transactionStatus === "PENDING",
|
|
1453
|
+
isConfirmed: transactionStatus === "SUCCESS",
|
|
1454
|
+
isFailed: transactionStatus === "FAILED",
|
|
1455
|
+
isTimeout: transactionStatus === "TIMEOUT"
|
|
1312
1456
|
}
|
|
1313
1457
|
),
|
|
1314
1458
|
/* @__PURE__ */ jsx18(
|
|
1315
1459
|
TransactionFooter,
|
|
1316
1460
|
{
|
|
1317
1461
|
transactionHash: hash,
|
|
1318
|
-
isConfirming,
|
|
1319
|
-
isConfirmed,
|
|
1320
|
-
isFailed:
|
|
1462
|
+
isConfirming: transactionStatus === "PENDING",
|
|
1463
|
+
isConfirmed: transactionStatus === "SUCCESS",
|
|
1464
|
+
isFailed: transactionStatus === "FAILED",
|
|
1465
|
+
isTimeout: transactionStatus === "TIMEOUT",
|
|
1321
1466
|
chainId
|
|
1322
1467
|
}
|
|
1323
1468
|
),
|
|
@@ -1373,28 +1518,8 @@ var initialState3 = {
|
|
|
1373
1518
|
};
|
|
1374
1519
|
var createListingModal$ = observable4(initialState3);
|
|
1375
1520
|
|
|
1376
|
-
// src/react/ui/modals/CreateListingModal/_utils/getCreateListingTransactionTitleMessage.ts
|
|
1377
|
-
var getCreateListingTransactionTitle = (params) => {
|
|
1378
|
-
if (params.isConfirmed) {
|
|
1379
|
-
return "Listing has processed";
|
|
1380
|
-
}
|
|
1381
|
-
if (params.isFailed) {
|
|
1382
|
-
return "Listing has failed";
|
|
1383
|
-
}
|
|
1384
|
-
return "Listing is processing";
|
|
1385
|
-
};
|
|
1386
|
-
var getCreateListingTransactionMessage = (params, collectibleName) => {
|
|
1387
|
-
if (params.isConfirmed) {
|
|
1388
|
-
return `You just listed ${collectibleName}. It\u2019s been confirmed on the blockchain!`;
|
|
1389
|
-
}
|
|
1390
|
-
if (params.isFailed) {
|
|
1391
|
-
return `Your listing of ${collectibleName} has failed. Please try again.`;
|
|
1392
|
-
}
|
|
1393
|
-
return `You just listed ${collectibleName}. It should be confirmed on the blockchain shortly.`;
|
|
1394
|
-
};
|
|
1395
|
-
|
|
1396
1521
|
// src/react/ui/modals/CreateListingModal/index.tsx
|
|
1397
|
-
import { jsx as jsx19, jsxs as
|
|
1522
|
+
import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1398
1523
|
var useCreateListingModal = (callbacks) => {
|
|
1399
1524
|
return {
|
|
1400
1525
|
show: (args) => createListingModal$.open({ ...args, defaultCallbacks: callbacks }),
|
|
@@ -1445,10 +1570,8 @@ var Modal2 = observer8(
|
|
|
1445
1570
|
collectionAddress,
|
|
1446
1571
|
chainId,
|
|
1447
1572
|
price: createListingModal$.listingPrice.get(),
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
getMessage: (params) => getCreateListingTransactionMessage(params, collectible?.name || ""),
|
|
1451
|
-
type: "createListing" /* createListing */,
|
|
1573
|
+
collectibleId,
|
|
1574
|
+
type: "LISTING" /* LISTING */,
|
|
1452
1575
|
queriesToInvalidate: collectableKeys.all
|
|
1453
1576
|
});
|
|
1454
1577
|
createListingModal$.close();
|
|
@@ -1492,11 +1615,13 @@ var Modal2 = observer8(
|
|
|
1492
1615
|
}
|
|
1493
1616
|
const dateToUnixTime = (date) => Math.floor(date.getTime() / 1e3).toString();
|
|
1494
1617
|
const { isLoading, steps, refreshSteps } = getListingSteps({
|
|
1495
|
-
// biome-ignore lint/style/noNonNullAssertion: <explanation>
|
|
1496
1618
|
contractType: collection.type,
|
|
1497
1619
|
listing: {
|
|
1498
1620
|
tokenId: collectibleId,
|
|
1499
|
-
quantity:
|
|
1621
|
+
quantity: parseUnits3(
|
|
1622
|
+
createListingModal$.quantity.get(),
|
|
1623
|
+
collectible?.decimals || 0
|
|
1624
|
+
).toString(),
|
|
1500
1625
|
expiry: dateToUnixTime(createListingModal$.expiry.get()),
|
|
1501
1626
|
currencyAddress: listingPrice.currency.contractAddress,
|
|
1502
1627
|
pricePerToken: listingPrice.amountRaw
|
|
@@ -1518,7 +1643,7 @@ var Modal2 = observer8(
|
|
|
1518
1643
|
disabled: steps?.approval.isPending || listingPrice.amountRaw === "0" || isLoading || createListingModal$.invalidQuantity.get()
|
|
1519
1644
|
}
|
|
1520
1645
|
];
|
|
1521
|
-
return /* @__PURE__ */
|
|
1646
|
+
return /* @__PURE__ */ jsxs13(
|
|
1522
1647
|
ActionModal,
|
|
1523
1648
|
{
|
|
1524
1649
|
store: createListingModal$,
|
|
@@ -1535,7 +1660,7 @@ var Modal2 = observer8(
|
|
|
1535
1660
|
chainId
|
|
1536
1661
|
}
|
|
1537
1662
|
),
|
|
1538
|
-
/* @__PURE__ */
|
|
1663
|
+
/* @__PURE__ */ jsxs13(Box13, { display: "flex", flexDirection: "column", width: "full", gap: "1", children: [
|
|
1539
1664
|
/* @__PURE__ */ jsx19(
|
|
1540
1665
|
priceInput_default,
|
|
1541
1666
|
{
|
|
@@ -1582,18 +1707,19 @@ var Modal2 = observer8(
|
|
|
1582
1707
|
|
|
1583
1708
|
// src/react/ui/modals/MakeOfferModal/index.tsx
|
|
1584
1709
|
import { Show as Show3, observer as observer9 } from "@legendapp/state/react";
|
|
1585
|
-
import { useEffect as useEffect5, useState as
|
|
1710
|
+
import { useEffect as useEffect5, useState as useState7 } from "react";
|
|
1711
|
+
import { parseUnits as parseUnits4 } from "viem";
|
|
1586
1712
|
|
|
1587
1713
|
// src/react/hooks/useMakeOffer.tsx
|
|
1588
|
-
import { useCallback as useCallback2, useState as
|
|
1714
|
+
import { useCallback as useCallback2, useState as useState6 } from "react";
|
|
1589
1715
|
var useMakeOffer = ({
|
|
1590
1716
|
onSuccess,
|
|
1591
1717
|
onError,
|
|
1592
1718
|
onTransactionSent,
|
|
1593
1719
|
...config
|
|
1594
1720
|
}) => {
|
|
1595
|
-
const [isLoading, setIsLoading] =
|
|
1596
|
-
const [steps, setSteps] =
|
|
1721
|
+
const [isLoading, setIsLoading] = useState6(false);
|
|
1722
|
+
const [steps, setSteps] = useState6(null);
|
|
1597
1723
|
const { machine, isLoading: isMachineLoading } = useTransactionMachine(
|
|
1598
1724
|
{
|
|
1599
1725
|
...config,
|
|
@@ -1638,7 +1764,7 @@ var initialState4 = {
|
|
|
1638
1764
|
collectibleId: "",
|
|
1639
1765
|
callbacks: void 0,
|
|
1640
1766
|
offerPrice: {
|
|
1641
|
-
amountRaw: "
|
|
1767
|
+
amountRaw: "1",
|
|
1642
1768
|
currency: {}
|
|
1643
1769
|
},
|
|
1644
1770
|
quantity: "1",
|
|
@@ -1658,28 +1784,8 @@ var initialState4 = {
|
|
|
1658
1784
|
};
|
|
1659
1785
|
var makeOfferModal$ = observable5(initialState4);
|
|
1660
1786
|
|
|
1661
|
-
// src/react/ui/modals/MakeOfferModal/_utils/getMakeOfferTransactionTitleMessage.ts
|
|
1662
|
-
var getMakeOfferTransactionTitle = (params) => {
|
|
1663
|
-
if (params.isConfirmed) {
|
|
1664
|
-
return "Your offer has processed";
|
|
1665
|
-
}
|
|
1666
|
-
if (params.isFailed) {
|
|
1667
|
-
return "Your offer has failed";
|
|
1668
|
-
}
|
|
1669
|
-
return "Your offer is processing";
|
|
1670
|
-
};
|
|
1671
|
-
var getMakeOfferTransactionMessage = (params, collectibleName) => {
|
|
1672
|
-
if (params.isConfirmed) {
|
|
1673
|
-
return `You just made offer for ${collectibleName}. It\u2019s been confirmed on the blockchain!`;
|
|
1674
|
-
}
|
|
1675
|
-
if (params.isFailed) {
|
|
1676
|
-
return `Your offer for ${collectibleName} has failed. Please try again.`;
|
|
1677
|
-
}
|
|
1678
|
-
return `You just made offer for ${collectibleName}. It should be confirmed on the blockchain shortly.`;
|
|
1679
|
-
};
|
|
1680
|
-
|
|
1681
1787
|
// src/react/ui/modals/MakeOfferModal/index.tsx
|
|
1682
|
-
import { jsx as jsx20, jsxs as
|
|
1788
|
+
import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1683
1789
|
var useMakeOfferModal = (defaultCallbacks) => ({
|
|
1684
1790
|
show: (args) => makeOfferModal$.open({ ...args, callbacks: defaultCallbacks }),
|
|
1685
1791
|
close: makeOfferModal$.close
|
|
@@ -1694,7 +1800,7 @@ var ModalContent = observer9(
|
|
|
1694
1800
|
}) => {
|
|
1695
1801
|
const state = makeOfferModal$.get();
|
|
1696
1802
|
const { collectionAddress, chainId, offerPrice, collectibleId } = state;
|
|
1697
|
-
const [insufficientBalance, setInsufficientBalance] =
|
|
1803
|
+
const [insufficientBalance, setInsufficientBalance] = useState7(false);
|
|
1698
1804
|
const {
|
|
1699
1805
|
data: collectible,
|
|
1700
1806
|
isLoading: collectableIsLoading,
|
|
@@ -1726,10 +1832,8 @@ var ModalContent = observer9(
|
|
|
1726
1832
|
price: makeOfferModal$.offerPrice.get(),
|
|
1727
1833
|
collectionAddress,
|
|
1728
1834
|
chainId,
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
getMessage: (params) => getMakeOfferTransactionMessage(params, collectible?.name || ""),
|
|
1732
|
-
type: "createOffer" /* createOffer */,
|
|
1835
|
+
collectibleId,
|
|
1836
|
+
type: "OFFER" /* OFFER */,
|
|
1733
1837
|
queriesToInvalidate: collectableKeys.all
|
|
1734
1838
|
});
|
|
1735
1839
|
makeOfferModal$.close();
|
|
@@ -1755,7 +1859,10 @@ var ModalContent = observer9(
|
|
|
1755
1859
|
contractType: collection.type,
|
|
1756
1860
|
offer: {
|
|
1757
1861
|
tokenId: collectibleId,
|
|
1758
|
-
quantity:
|
|
1862
|
+
quantity: parseUnits4(
|
|
1863
|
+
makeOfferModal$.quantity.get(),
|
|
1864
|
+
collectible?.decimals || 0
|
|
1865
|
+
).toString(),
|
|
1759
1866
|
expiry: dateToUnixTime(makeOfferModal$.expiry.get()),
|
|
1760
1867
|
currencyAddress,
|
|
1761
1868
|
pricePerToken: offerPrice.amountRaw
|
|
@@ -1810,7 +1917,7 @@ var ModalContent = observer9(
|
|
|
1810
1917
|
disabled: steps?.approval.isPending || offerPrice.amountRaw === "0" || insufficientBalance || isLoading || makeOfferModal$.invalidQuantity.get()
|
|
1811
1918
|
}
|
|
1812
1919
|
];
|
|
1813
|
-
return /* @__PURE__ */
|
|
1920
|
+
return /* @__PURE__ */ jsxs14(
|
|
1814
1921
|
ActionModal,
|
|
1815
1922
|
{
|
|
1816
1923
|
store: makeOfferModal$,
|
|
@@ -1866,17 +1973,18 @@ var ModalContent = observer9(
|
|
|
1866
1973
|
|
|
1867
1974
|
// src/react/ui/modals/SellModal/index.tsx
|
|
1868
1975
|
import { Show as Show4, observer as observer10 } from "@legendapp/state/react";
|
|
1976
|
+
import { parseUnits as parseUnits5 } from "viem";
|
|
1869
1977
|
|
|
1870
1978
|
// src/react/hooks/useSell.tsx
|
|
1871
|
-
import { useCallback as useCallback3, useState as
|
|
1979
|
+
import { useCallback as useCallback3, useState as useState8 } from "react";
|
|
1872
1980
|
var useSell = ({
|
|
1873
1981
|
onSuccess,
|
|
1874
1982
|
onError,
|
|
1875
1983
|
onTransactionSent,
|
|
1876
1984
|
...config
|
|
1877
1985
|
}) => {
|
|
1878
|
-
const [isLoading, setIsLoading] =
|
|
1879
|
-
const [steps, setSteps] =
|
|
1986
|
+
const [isLoading, setIsLoading] = useState8(false);
|
|
1987
|
+
const [steps, setSteps] = useState8(null);
|
|
1880
1988
|
const { machine, isLoading: isMachineLoading } = useTransactionMachine(
|
|
1881
1989
|
{
|
|
1882
1990
|
...config,
|
|
@@ -1912,17 +2020,17 @@ var useSell = ({
|
|
|
1912
2020
|
};
|
|
1913
2021
|
|
|
1914
2022
|
// src/react/ui/modals/_internal/components/transactionHeader/index.tsx
|
|
1915
|
-
import { Box as
|
|
2023
|
+
import { Box as Box14, Image as Image4, Skeleton as Skeleton7, Text as Text11 } from "@0xsequence/design-system";
|
|
1916
2024
|
import { formatDistanceToNow as formatDistanceToNow2 } from "date-fns";
|
|
1917
|
-
import { jsx as jsx21, jsxs as
|
|
2025
|
+
import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1918
2026
|
function TransactionHeader({
|
|
1919
2027
|
title,
|
|
1920
2028
|
currencyImageUrl,
|
|
1921
2029
|
date
|
|
1922
2030
|
}) {
|
|
1923
|
-
return /* @__PURE__ */
|
|
2031
|
+
return /* @__PURE__ */ jsxs15(Box14, { display: "flex", alignItems: "center", width: "full", children: [
|
|
1924
2032
|
/* @__PURE__ */ jsx21(
|
|
1925
|
-
|
|
2033
|
+
Text11,
|
|
1926
2034
|
{
|
|
1927
2035
|
fontSize: "small",
|
|
1928
2036
|
fontWeight: "medium",
|
|
@@ -1933,8 +2041,8 @@ function TransactionHeader({
|
|
|
1933
2041
|
}
|
|
1934
2042
|
),
|
|
1935
2043
|
/* @__PURE__ */ jsx21(Image4, { src: currencyImageUrl, width: "3", height: "3", marginRight: "1" }),
|
|
1936
|
-
date && /* @__PURE__ */
|
|
1937
|
-
|
|
2044
|
+
date && /* @__PURE__ */ jsxs15(
|
|
2045
|
+
Text11,
|
|
1938
2046
|
{
|
|
1939
2047
|
fontSize: "small",
|
|
1940
2048
|
color: "text50",
|
|
@@ -1946,7 +2054,7 @@ function TransactionHeader({
|
|
|
1946
2054
|
" ago"
|
|
1947
2055
|
]
|
|
1948
2056
|
}
|
|
1949
|
-
) || /* @__PURE__ */ jsx21(
|
|
2057
|
+
) || /* @__PURE__ */ jsx21(Skeleton7, { width: "8", height: "4" })
|
|
1950
2058
|
] });
|
|
1951
2059
|
}
|
|
1952
2060
|
|
|
@@ -1974,28 +2082,8 @@ var initialState5 = {
|
|
|
1974
2082
|
};
|
|
1975
2083
|
var sellModal$ = observable6(initialState5);
|
|
1976
2084
|
|
|
1977
|
-
// src/react/ui/modals/SellModal/_utils/getSellTransactionTitleMessage.ts
|
|
1978
|
-
var getSellTransactionTitle = (params) => {
|
|
1979
|
-
if (params.isConfirmed) {
|
|
1980
|
-
return "Your sale has processed";
|
|
1981
|
-
}
|
|
1982
|
-
if (params.isFailed) {
|
|
1983
|
-
return "Your sale has failed";
|
|
1984
|
-
}
|
|
1985
|
-
return "Your sale is processing";
|
|
1986
|
-
};
|
|
1987
|
-
var getSellTransactionMessage = (params, collectibleName) => {
|
|
1988
|
-
if (params.isConfirmed) {
|
|
1989
|
-
return `You just sold ${collectibleName}. It\u2019s been confirmed on the blockchain!`;
|
|
1990
|
-
}
|
|
1991
|
-
if (params.isFailed) {
|
|
1992
|
-
return `Your sale of ${collectibleName} has failed. Please try again.`;
|
|
1993
|
-
}
|
|
1994
|
-
return `You just sold ${collectibleName}. It should be confirmed on the blockchain shortly.`;
|
|
1995
|
-
};
|
|
1996
|
-
|
|
1997
2085
|
// src/react/ui/modals/SellModal/index.tsx
|
|
1998
|
-
import { jsx as jsx22, jsxs as
|
|
2086
|
+
import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1999
2087
|
var useSellModal = (defaultCallbacks) => ({
|
|
2000
2088
|
show: (args) => sellModal$.open({ ...args, callbacks: defaultCallbacks }),
|
|
2001
2089
|
close: sellModal$.close
|
|
@@ -2028,10 +2116,8 @@ var ModalContent2 = observer10(
|
|
|
2028
2116
|
},
|
|
2029
2117
|
collectionAddress,
|
|
2030
2118
|
chainId,
|
|
2031
|
-
tokenId,
|
|
2032
|
-
|
|
2033
|
-
getMessage: (params) => getSellTransactionMessage(params, collectible?.name || ""),
|
|
2034
|
-
type: "sell" /* sell */,
|
|
2119
|
+
collectibleId: tokenId,
|
|
2120
|
+
type: "SELL" /* SELL */,
|
|
2035
2121
|
queriesToInvalidate: [
|
|
2036
2122
|
...collectableKeys.all,
|
|
2037
2123
|
balanceQueries.all
|
|
@@ -2089,7 +2175,7 @@ var ModalContent2 = observer10(
|
|
|
2089
2175
|
const currency = currencies?.find(
|
|
2090
2176
|
(c) => c.contractAddress === order?.priceCurrencyAddress
|
|
2091
2177
|
);
|
|
2092
|
-
return /* @__PURE__ */
|
|
2178
|
+
return /* @__PURE__ */ jsxs16(
|
|
2093
2179
|
ActionModal,
|
|
2094
2180
|
{
|
|
2095
2181
|
store: sellModal$,
|
|
@@ -2100,7 +2186,11 @@ var ModalContent2 = observer10(
|
|
|
2100
2186
|
label: "Accept",
|
|
2101
2187
|
onClick: () => sell({
|
|
2102
2188
|
orderId: order?.orderId,
|
|
2103
|
-
marketplace: order?.marketplace
|
|
2189
|
+
marketplace: order?.marketplace,
|
|
2190
|
+
quantity: order?.quantityRemaining ? parseUnits5(
|
|
2191
|
+
order.quantityRemaining,
|
|
2192
|
+
collectible?.decimals || 0
|
|
2193
|
+
).toString() : "1"
|
|
2104
2194
|
})
|
|
2105
2195
|
}
|
|
2106
2196
|
],
|
|
@@ -2143,13 +2233,13 @@ var ModalContent2 = observer10(
|
|
|
2143
2233
|
|
|
2144
2234
|
// src/react/ui/modals/SuccessfulPurchaseModal/index.tsx
|
|
2145
2235
|
import {
|
|
2146
|
-
Box as
|
|
2236
|
+
Box as Box15,
|
|
2147
2237
|
Button as Button3,
|
|
2148
2238
|
CloseIcon as CloseIcon2,
|
|
2149
2239
|
ExternalLinkIcon,
|
|
2150
2240
|
IconButton as IconButton3,
|
|
2151
2241
|
Image as Image5,
|
|
2152
|
-
Text as
|
|
2242
|
+
Text as Text12
|
|
2153
2243
|
} from "@0xsequence/design-system";
|
|
2154
2244
|
import { observer as observer11 } from "@legendapp/state/react";
|
|
2155
2245
|
import { Close as Close2, Content as Content4, Overlay as Overlay2, Portal as Portal4, Root as Root4 } from "@radix-ui/react-dialog";
|
|
@@ -2197,7 +2287,7 @@ var initialState6 = {
|
|
|
2197
2287
|
var successfulPurchaseModal$ = observable7(initialState6);
|
|
2198
2288
|
|
|
2199
2289
|
// src/react/ui/modals/SuccessfulPurchaseModal/index.tsx
|
|
2200
|
-
import { jsx as jsx23, jsxs as
|
|
2290
|
+
import { jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2201
2291
|
var useSuccessfulPurchaseModal = (callbacks) => {
|
|
2202
2292
|
return {
|
|
2203
2293
|
show: (args) => successfulPurchaseModal$.open({ ...args, defaultCallbacks: callbacks }),
|
|
@@ -2205,12 +2295,12 @@ var useSuccessfulPurchaseModal = (callbacks) => {
|
|
|
2205
2295
|
};
|
|
2206
2296
|
};
|
|
2207
2297
|
var SuccessfulPurchaseModal = observer11(() => {
|
|
2208
|
-
return /* @__PURE__ */ jsx23(Root4, { open: successfulPurchaseModal$.isOpen.get(), children: /* @__PURE__ */
|
|
2298
|
+
return /* @__PURE__ */ jsx23(Root4, { open: successfulPurchaseModal$.isOpen.get(), children: /* @__PURE__ */ jsxs17(Portal4, { children: [
|
|
2209
2299
|
/* @__PURE__ */ jsx23(Overlay2, { className: dialogOverlay }),
|
|
2210
|
-
/* @__PURE__ */
|
|
2211
|
-
/* @__PURE__ */
|
|
2300
|
+
/* @__PURE__ */ jsxs17(Content4, { className: dialogContent.narrow, children: [
|
|
2301
|
+
/* @__PURE__ */ jsxs17(Box15, { display: "flex", flexDirection: "column", gap: "4", width: "full", children: [
|
|
2212
2302
|
/* @__PURE__ */ jsx23(
|
|
2213
|
-
|
|
2303
|
+
Text12,
|
|
2214
2304
|
{
|
|
2215
2305
|
textAlign: "center",
|
|
2216
2306
|
fontSize: "medium",
|
|
@@ -2225,11 +2315,11 @@ var SuccessfulPurchaseModal = observer11(() => {
|
|
|
2225
2315
|
collectibles: successfulPurchaseModal$.state.get().collectibles
|
|
2226
2316
|
}
|
|
2227
2317
|
),
|
|
2228
|
-
/* @__PURE__ */
|
|
2229
|
-
/* @__PURE__ */ jsx23(
|
|
2230
|
-
/* @__PURE__ */ jsx23(
|
|
2231
|
-
/* @__PURE__ */ jsx23(
|
|
2232
|
-
/* @__PURE__ */ jsx23(
|
|
2318
|
+
/* @__PURE__ */ jsxs17(Box15, { display: "flex", alignItems: "center", gap: "1", children: [
|
|
2319
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "normal", fontWeight: "medium", color: "text80", children: "You bought" }),
|
|
2320
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "normal", fontWeight: "medium", color: "text100", children: successfulPurchaseModal$.state.get().collectibles.length }),
|
|
2321
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "normal", fontWeight: "medium", color: "text80", children: "items for" }),
|
|
2322
|
+
/* @__PURE__ */ jsx23(Text12, { fontSize: "normal", fontWeight: "medium", color: "text100", children: successfulPurchaseModal$.state.get().totalPrice })
|
|
2233
2323
|
] }),
|
|
2234
2324
|
/* @__PURE__ */ jsx23(SuccessfulPurchaseActions, {})
|
|
2235
2325
|
] }),
|
|
@@ -2248,7 +2338,7 @@ var SuccessfulPurchaseModal = observer11(() => {
|
|
|
2248
2338
|
] }) });
|
|
2249
2339
|
});
|
|
2250
2340
|
function SuccessfulPurchaseActions() {
|
|
2251
|
-
return /* @__PURE__ */
|
|
2341
|
+
return /* @__PURE__ */ jsxs17(Box15, { display: "flex", flexDirection: "column", gap: "2", children: [
|
|
2252
2342
|
successfulPurchaseModal$.state.ctaOptions.get() && /* @__PURE__ */ jsx23(
|
|
2253
2343
|
Button3,
|
|
2254
2344
|
{
|
|
@@ -2277,10 +2367,10 @@ function SuccessfulPurchaseActions() {
|
|
|
2277
2367
|
function CollectiblesGrid({ collectibles }) {
|
|
2278
2368
|
const total = collectibles.length;
|
|
2279
2369
|
const shownCollectibles = total > 4 ? collectibles.slice(0, 4) : collectibles;
|
|
2280
|
-
return /* @__PURE__ */ jsx23(
|
|
2370
|
+
return /* @__PURE__ */ jsx23(Box15, { className: collectiblesGrid, display: "grid", gap: "2", children: shownCollectibles.map((collectible) => {
|
|
2281
2371
|
const showPlus = total > 4 && collectibles.indexOf(collectible) === 3;
|
|
2282
|
-
return /* @__PURE__ */
|
|
2283
|
-
|
|
2372
|
+
return /* @__PURE__ */ jsxs17(
|
|
2373
|
+
Box15,
|
|
2284
2374
|
{
|
|
2285
2375
|
className: collectiblesGridItem,
|
|
2286
2376
|
position: "relative",
|
|
@@ -2297,7 +2387,7 @@ function CollectiblesGrid({ collectibles }) {
|
|
|
2297
2387
|
}
|
|
2298
2388
|
),
|
|
2299
2389
|
showPlus && /* @__PURE__ */ jsx23(
|
|
2300
|
-
|
|
2390
|
+
Box15,
|
|
2301
2391
|
{
|
|
2302
2392
|
position: "absolute",
|
|
2303
2393
|
top: "0",
|
|
@@ -2309,8 +2399,8 @@ function CollectiblesGrid({ collectibles }) {
|
|
|
2309
2399
|
justifyContent: "center",
|
|
2310
2400
|
background: "backgroundOverlay",
|
|
2311
2401
|
backdropFilter: "blur",
|
|
2312
|
-
children: /* @__PURE__ */
|
|
2313
|
-
|
|
2402
|
+
children: /* @__PURE__ */ jsxs17(
|
|
2403
|
+
Text12,
|
|
2314
2404
|
{
|
|
2315
2405
|
fontSize: "small",
|
|
2316
2406
|
fontWeight: "medium",
|
|
@@ -2346,12 +2436,18 @@ import { useAccount as useAccount5 } from "wagmi";
|
|
|
2346
2436
|
import { observable as observable8 } from "@legendapp/state";
|
|
2347
2437
|
var initialState7 = {
|
|
2348
2438
|
isOpen: false,
|
|
2349
|
-
open: ({
|
|
2439
|
+
open: ({
|
|
2440
|
+
chainId,
|
|
2441
|
+
collectionAddress,
|
|
2442
|
+
collectibleId,
|
|
2443
|
+
callbacks
|
|
2444
|
+
}) => {
|
|
2350
2445
|
transferModal$.state.set({
|
|
2351
2446
|
...transferModal$.state.get(),
|
|
2352
2447
|
chainId,
|
|
2353
2448
|
collectionAddress,
|
|
2354
|
-
|
|
2449
|
+
collectibleId,
|
|
2450
|
+
callbacks
|
|
2355
2451
|
});
|
|
2356
2452
|
transferModal$.isOpen.set(true);
|
|
2357
2453
|
},
|
|
@@ -2367,7 +2463,7 @@ var initialState7 = {
|
|
|
2367
2463
|
receiverAddress: "",
|
|
2368
2464
|
collectionAddress: "0x",
|
|
2369
2465
|
chainId: "",
|
|
2370
|
-
|
|
2466
|
+
collectibleId: "",
|
|
2371
2467
|
quantity: "1"
|
|
2372
2468
|
},
|
|
2373
2469
|
view: "enterReceiverAddress",
|
|
@@ -2376,7 +2472,7 @@ var initialState7 = {
|
|
|
2376
2472
|
var transferModal$ = observable8(initialState7);
|
|
2377
2473
|
|
|
2378
2474
|
// src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx
|
|
2379
|
-
import { Box as
|
|
2475
|
+
import { Box as Box16, Button as Button4, Text as Text13, TextInput } from "@0xsequence/design-system";
|
|
2380
2476
|
import { observable as observable9 } from "@legendapp/state";
|
|
2381
2477
|
import { isAddress } from "viem";
|
|
2382
2478
|
import { useAccount as useAccount4 } from "wagmi";
|
|
@@ -2390,45 +2486,19 @@ function getMessage(key) {
|
|
|
2390
2486
|
return baseMessages[key];
|
|
2391
2487
|
}
|
|
2392
2488
|
|
|
2393
|
-
// src/react/ui/modals/TransferModal/_utils/getTransferTransactionTitleMessage.ts
|
|
2394
|
-
var getTransferTransactionTitle = (params) => {
|
|
2395
|
-
if (params.isConfirmed) {
|
|
2396
|
-
return "Transfer has processed";
|
|
2397
|
-
}
|
|
2398
|
-
if (params.isFailed) {
|
|
2399
|
-
return "Transfer has failed";
|
|
2400
|
-
}
|
|
2401
|
-
return "Transfer is processing";
|
|
2402
|
-
};
|
|
2403
|
-
var getTransferTransactionMessage = (params, collectibleName) => {
|
|
2404
|
-
if (params.isConfirmed) {
|
|
2405
|
-
return `You just tranferred ${collectibleName}. It\u2019s been confirmed on the blockchain!`;
|
|
2406
|
-
}
|
|
2407
|
-
if (params.isFailed) {
|
|
2408
|
-
return `Transferring ${collectibleName} has failed. Please try again.`;
|
|
2409
|
-
}
|
|
2410
|
-
return `You just transferred ${collectibleName}. It should be confirmed on the blockchain shortly.`;
|
|
2411
|
-
};
|
|
2412
|
-
|
|
2413
2489
|
// src/react/ui/modals/TransferModal/_views/enterWalletAddress/useHandleTransfer.tsx
|
|
2414
2490
|
var useHandleTransfer = () => {
|
|
2415
2491
|
const {
|
|
2416
2492
|
receiverAddress,
|
|
2417
2493
|
collectionAddress,
|
|
2418
|
-
|
|
2494
|
+
collectibleId,
|
|
2419
2495
|
quantity,
|
|
2420
2496
|
chainId,
|
|
2421
2497
|
collectionType,
|
|
2422
|
-
|
|
2423
|
-
errorCallbacks
|
|
2498
|
+
callbacks
|
|
2424
2499
|
} = transferModal$.state.get();
|
|
2425
2500
|
const { transferTokensAsync } = useTransferTokens();
|
|
2426
2501
|
const { show: showTransactionStatusModal } = useTransactionStatusModal();
|
|
2427
|
-
const { data: collectible } = useCollectible({
|
|
2428
|
-
collectionAddress,
|
|
2429
|
-
collectibleId: tokenId,
|
|
2430
|
-
chainId
|
|
2431
|
-
});
|
|
2432
2502
|
async function transfer() {
|
|
2433
2503
|
if (collectionType !== "ERC721" /* ERC721 */ && collectionType !== "ERC1155" /* ERC1155 */) {
|
|
2434
2504
|
throw new InvalidContractTypeError(collectionType);
|
|
@@ -2438,7 +2508,7 @@ var useHandleTransfer = () => {
|
|
|
2438
2508
|
const hash = await transferTokensAsync({
|
|
2439
2509
|
receiverAddress,
|
|
2440
2510
|
collectionAddress,
|
|
2441
|
-
tokenId,
|
|
2511
|
+
tokenId: collectibleId,
|
|
2442
2512
|
chainId,
|
|
2443
2513
|
contractType: "ERC721" /* ERC721 */
|
|
2444
2514
|
});
|
|
@@ -2447,20 +2517,14 @@ var useHandleTransfer = () => {
|
|
|
2447
2517
|
hash,
|
|
2448
2518
|
collectionAddress,
|
|
2449
2519
|
chainId,
|
|
2450
|
-
|
|
2520
|
+
collectibleId,
|
|
2451
2521
|
price: void 0,
|
|
2452
|
-
|
|
2453
|
-
getMessage: (params) => getTransferTransactionMessage(params, collectible.name),
|
|
2454
|
-
type: "transfer",
|
|
2455
|
-
callbacks: {
|
|
2456
|
-
onSuccess: successCallbacks?.onTransferSuccess,
|
|
2457
|
-
onUnknownError: errorCallbacks?.onTransferError
|
|
2458
|
-
},
|
|
2522
|
+
type: "TRANSFER" /* TRANSFER */,
|
|
2459
2523
|
queriesToInvalidate: balanceQueries.all
|
|
2460
2524
|
});
|
|
2461
2525
|
} catch (error) {
|
|
2462
2526
|
transferModal$.view.set("enterReceiverAddress");
|
|
2463
|
-
|
|
2527
|
+
callbacks?.onError?.(error);
|
|
2464
2528
|
}
|
|
2465
2529
|
}
|
|
2466
2530
|
if (collectionType === "ERC1155" /* ERC1155 */) {
|
|
@@ -2468,7 +2532,7 @@ var useHandleTransfer = () => {
|
|
|
2468
2532
|
const hash = await transferTokensAsync({
|
|
2469
2533
|
receiverAddress,
|
|
2470
2534
|
collectionAddress,
|
|
2471
|
-
tokenId,
|
|
2535
|
+
tokenId: collectibleId,
|
|
2472
2536
|
chainId,
|
|
2473
2537
|
contractType: "ERC1155" /* ERC1155 */,
|
|
2474
2538
|
quantity: String(quantity)
|
|
@@ -2478,19 +2542,14 @@ var useHandleTransfer = () => {
|
|
|
2478
2542
|
hash,
|
|
2479
2543
|
collectionAddress,
|
|
2480
2544
|
chainId,
|
|
2481
|
-
|
|
2545
|
+
collectibleId,
|
|
2482
2546
|
price: void 0,
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
type: "transfer",
|
|
2486
|
-
callbacks: {
|
|
2487
|
-
onSuccess: successCallbacks?.onTransferSuccess,
|
|
2488
|
-
onUnknownError: errorCallbacks?.onTransferError
|
|
2489
|
-
}
|
|
2547
|
+
type: "TRANSFER" /* TRANSFER */,
|
|
2548
|
+
queriesToInvalidate: balanceQueries.all
|
|
2490
2549
|
});
|
|
2491
2550
|
} catch (error) {
|
|
2492
2551
|
transferModal$.view.set("enterReceiverAddress");
|
|
2493
|
-
|
|
2552
|
+
callbacks?.onError?.(error);
|
|
2494
2553
|
}
|
|
2495
2554
|
}
|
|
2496
2555
|
}
|
|
@@ -2499,10 +2558,10 @@ var useHandleTransfer = () => {
|
|
|
2499
2558
|
var useHandleTransfer_default = useHandleTransfer;
|
|
2500
2559
|
|
|
2501
2560
|
// src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx
|
|
2502
|
-
import { Fragment, jsx as jsx24, jsxs as
|
|
2561
|
+
import { Fragment, jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2503
2562
|
var EnterWalletAddressView = () => {
|
|
2504
2563
|
const { address } = useAccount4();
|
|
2505
|
-
const { collectionAddress,
|
|
2564
|
+
const { collectionAddress, collectibleId, chainId, collectionType } = transferModal$.state.get();
|
|
2506
2565
|
const $quantity = transferModal$.state.quantity;
|
|
2507
2566
|
const $invalidQuantity = observable9(false);
|
|
2508
2567
|
const isWalletAddressValid = isAddress(
|
|
@@ -2511,7 +2570,7 @@ var EnterWalletAddressView = () => {
|
|
|
2511
2570
|
const { data: tokenBalance } = useListBalances({
|
|
2512
2571
|
chainId,
|
|
2513
2572
|
contractAddress: collectionAddress,
|
|
2514
|
-
tokenId,
|
|
2573
|
+
tokenId: collectibleId,
|
|
2515
2574
|
accountAddress: address,
|
|
2516
2575
|
query: { enabled: !!address }
|
|
2517
2576
|
});
|
|
@@ -2532,9 +2591,9 @@ var EnterWalletAddressView = () => {
|
|
|
2532
2591
|
transfer();
|
|
2533
2592
|
transferModal$.view.set("followWalletInstructions");
|
|
2534
2593
|
}
|
|
2535
|
-
return /* @__PURE__ */
|
|
2536
|
-
/* @__PURE__ */ jsx24(
|
|
2537
|
-
/* @__PURE__ */
|
|
2594
|
+
return /* @__PURE__ */ jsxs18(Box16, { display: "grid", gap: "6", flexGrow: "1", children: [
|
|
2595
|
+
/* @__PURE__ */ jsx24(Text13, { color: "white", fontSize: "large", fontWeight: "bold", fontFamily: "body", children: "Transfer your item" }),
|
|
2596
|
+
/* @__PURE__ */ jsxs18(Box16, { display: "flex", flexDirection: "column", gap: "3", children: [
|
|
2538
2597
|
/* @__PURE__ */ jsx24(
|
|
2539
2598
|
AlertMessage,
|
|
2540
2599
|
{
|
|
@@ -2553,7 +2612,7 @@ var EnterWalletAddressView = () => {
|
|
|
2553
2612
|
placeholder: "Enter wallet address of recipient"
|
|
2554
2613
|
}
|
|
2555
2614
|
),
|
|
2556
|
-
collectionType === "ERC1155" /* ERC1155 */ && balanceAmount && /* @__PURE__ */
|
|
2615
|
+
collectionType === "ERC1155" /* ERC1155 */ && balanceAmount && /* @__PURE__ */ jsxs18(Fragment, { children: [
|
|
2557
2616
|
/* @__PURE__ */ jsx24(
|
|
2558
2617
|
QuantityInput,
|
|
2559
2618
|
{
|
|
@@ -2564,7 +2623,7 @@ var EnterWalletAddressView = () => {
|
|
|
2564
2623
|
}
|
|
2565
2624
|
),
|
|
2566
2625
|
/* @__PURE__ */ jsx24(
|
|
2567
|
-
|
|
2626
|
+
Text13,
|
|
2568
2627
|
{
|
|
2569
2628
|
color: insufficientBalance ? "negative" : "text50",
|
|
2570
2629
|
fontSize: "small",
|
|
@@ -2594,13 +2653,13 @@ var EnterWalletAddressView = () => {
|
|
|
2594
2653
|
var enterWalletAddress_default = EnterWalletAddressView;
|
|
2595
2654
|
|
|
2596
2655
|
// src/react/ui/modals/TransferModal/_views/followWalletInstructions/index.tsx
|
|
2597
|
-
import { Box as
|
|
2656
|
+
import { Box as Box17, Button as Button5, Text as Text14 } from "@0xsequence/design-system";
|
|
2598
2657
|
import { observer as observer12 } from "@legendapp/state/react";
|
|
2599
|
-
import { jsx as jsx25, jsxs as
|
|
2658
|
+
import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2600
2659
|
var FollowWalletInstructionsView = observer12(() => {
|
|
2601
|
-
return /* @__PURE__ */
|
|
2602
|
-
/* @__PURE__ */ jsx25(
|
|
2603
|
-
/* @__PURE__ */ jsx25(
|
|
2660
|
+
return /* @__PURE__ */ jsxs19(Box17, { display: "grid", gap: "6", flexGrow: "1", children: [
|
|
2661
|
+
/* @__PURE__ */ jsx25(Text14, { color: "white", fontSize: "large", fontWeight: "bold", fontFamily: "body", children: "Transfer your item" }),
|
|
2662
|
+
/* @__PURE__ */ jsx25(Box17, { display: "flex", flexDirection: "column", gap: "3", children: /* @__PURE__ */ jsx25(
|
|
2604
2663
|
AlertMessage,
|
|
2605
2664
|
{
|
|
2606
2665
|
message: getMessage("followWalletInstructions"),
|
|
@@ -2625,7 +2684,7 @@ var FollowWalletInstructionsView = observer12(() => {
|
|
|
2625
2684
|
var followWalletInstructions_default = FollowWalletInstructionsView;
|
|
2626
2685
|
|
|
2627
2686
|
// src/react/ui/modals/TransferModal/index.tsx
|
|
2628
|
-
import { jsx as jsx26, jsxs as
|
|
2687
|
+
import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2629
2688
|
var useTransferModal = () => {
|
|
2630
2689
|
const { chainId: accountChainId } = useAccount5();
|
|
2631
2690
|
const { show: showSwitchNetworkModal } = useSwitchChainModal();
|
|
@@ -2649,13 +2708,13 @@ var useTransferModal = () => {
|
|
|
2649
2708
|
onError: (callbacks) => {
|
|
2650
2709
|
transferModal$.state.set({
|
|
2651
2710
|
...transferModal$.state.get(),
|
|
2652
|
-
|
|
2711
|
+
callbacks
|
|
2653
2712
|
});
|
|
2654
2713
|
},
|
|
2655
2714
|
onSuccess: (callbacks) => {
|
|
2656
2715
|
transferModal$.state.set({
|
|
2657
2716
|
...transferModal$.state.get(),
|
|
2658
|
-
|
|
2717
|
+
callbacks
|
|
2659
2718
|
});
|
|
2660
2719
|
}
|
|
2661
2720
|
};
|
|
@@ -2667,9 +2726,9 @@ var Modal3 = () => {
|
|
|
2667
2726
|
return /* @__PURE__ */ jsx26(ModalContent3, {});
|
|
2668
2727
|
};
|
|
2669
2728
|
var ModalContent3 = observer13(() => {
|
|
2670
|
-
return /* @__PURE__ */ jsx26(Root5, { open: true, children: /* @__PURE__ */
|
|
2729
|
+
return /* @__PURE__ */ jsx26(Root5, { open: true, children: /* @__PURE__ */ jsxs20(Portal5, { children: [
|
|
2671
2730
|
/* @__PURE__ */ jsx26(Overlay3, { className: dialogOverlay2 }),
|
|
2672
|
-
/* @__PURE__ */
|
|
2731
|
+
/* @__PURE__ */ jsxs20(Content5, { className: transferModalContent, children: [
|
|
2673
2732
|
/* @__PURE__ */ jsx26(TransactionModalView, {}),
|
|
2674
2733
|
/* @__PURE__ */ jsx26(Close3, { onClick: transferModal$.close, className: closeButton2, asChild: true, children: /* @__PURE__ */ jsx26(IconButton4, { size: "xs", "aria-label": "Close modal", icon: CloseIcon3 }) })
|
|
2675
2734
|
] })
|
|
@@ -2688,9 +2747,9 @@ var TransactionModalView = observer13(() => {
|
|
|
2688
2747
|
});
|
|
2689
2748
|
|
|
2690
2749
|
// src/react/ui/modals/modal-provider.tsx
|
|
2691
|
-
import { Fragment as Fragment2, jsx as jsx27, jsxs as
|
|
2750
|
+
import { Fragment as Fragment2, jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2692
2751
|
var ModalProvider = observer14(() => {
|
|
2693
|
-
return /* @__PURE__ */
|
|
2752
|
+
return /* @__PURE__ */ jsxs21(Fragment2, { children: [
|
|
2694
2753
|
/* @__PURE__ */ jsx27(AccountModal, {}),
|
|
2695
2754
|
/* @__PURE__ */ jsx27(CreateListingModal, {}),
|
|
2696
2755
|
/* @__PURE__ */ jsx27(MakeOfferModal, {}),
|
|
@@ -2704,12 +2763,12 @@ var ModalProvider = observer14(() => {
|
|
|
2704
2763
|
});
|
|
2705
2764
|
|
|
2706
2765
|
// src/react/ui/components/collectible-card/CollectibleCard.tsx
|
|
2707
|
-
import { useState as
|
|
2708
|
-
import { Box as
|
|
2766
|
+
import { useState as useState9 } from "react";
|
|
2767
|
+
import { Box as Box21, IconButton as IconButton6, Skeleton as Skeleton8 } from "@0xsequence/design-system";
|
|
2709
2768
|
import { useAccount as useAccount7 } from "wagmi";
|
|
2710
2769
|
|
|
2711
2770
|
// src/react/ui/icons/DiamondEye.tsx
|
|
2712
|
-
import { Box as
|
|
2771
|
+
import { Box as Box18 } from "@0xsequence/design-system";
|
|
2713
2772
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2714
2773
|
var Svg = () => /* @__PURE__ */ jsx28(
|
|
2715
2774
|
"svg",
|
|
@@ -2731,7 +2790,7 @@ var Svg = () => /* @__PURE__ */ jsx28(
|
|
|
2731
2790
|
}
|
|
2732
2791
|
);
|
|
2733
2792
|
var SvgDiamondEyeIcon = ({ size = "sm", ...props }) => /* @__PURE__ */ jsx28(
|
|
2734
|
-
|
|
2793
|
+
Box18,
|
|
2735
2794
|
{
|
|
2736
2795
|
as: Svg,
|
|
2737
2796
|
className: iconVariants({
|
|
@@ -2826,7 +2885,7 @@ var ActionButton = observer15(
|
|
|
2826
2885
|
onClick: () => showTransferModal({
|
|
2827
2886
|
collectionAddress,
|
|
2828
2887
|
chainId,
|
|
2829
|
-
tokenId
|
|
2888
|
+
collectibleId: tokenId
|
|
2830
2889
|
})
|
|
2831
2890
|
}
|
|
2832
2891
|
);
|
|
@@ -2853,12 +2912,12 @@ function ActionButtonBody({ label, onClick }) {
|
|
|
2853
2912
|
}
|
|
2854
2913
|
|
|
2855
2914
|
// src/react/ui/components/collectible-card/Footer.tsx
|
|
2856
|
-
import { Box as
|
|
2857
|
-
import { formatUnits as
|
|
2915
|
+
import { Box as Box20, IconButton as IconButton5, Image as Image6, Text as Text15 } from "@0xsequence/design-system";
|
|
2916
|
+
import { formatUnits as formatUnits4 } from "viem";
|
|
2858
2917
|
import { useAccount as useAccount6 } from "wagmi";
|
|
2859
2918
|
|
|
2860
2919
|
// src/react/ui/icons/Bell.tsx
|
|
2861
|
-
import { Box as
|
|
2920
|
+
import { Box as Box19 } from "@0xsequence/design-system";
|
|
2862
2921
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
2863
2922
|
var Svg2 = () => /* @__PURE__ */ jsx30(
|
|
2864
2923
|
"svg",
|
|
@@ -2880,7 +2939,7 @@ var Svg2 = () => /* @__PURE__ */ jsx30(
|
|
|
2880
2939
|
}
|
|
2881
2940
|
);
|
|
2882
2941
|
var SvgBellIcon = ({ size = "sm", ...props }) => /* @__PURE__ */ jsx30(
|
|
2883
|
-
|
|
2942
|
+
Box19,
|
|
2884
2943
|
{
|
|
2885
2944
|
as: Svg2,
|
|
2886
2945
|
className: iconVariants({
|
|
@@ -2892,7 +2951,7 @@ var SvgBellIcon = ({ size = "sm", ...props }) => /* @__PURE__ */ jsx30(
|
|
|
2892
2951
|
var Bell_default = SvgBellIcon;
|
|
2893
2952
|
|
|
2894
2953
|
// src/react/ui/components/collectible-card/Footer.tsx
|
|
2895
|
-
import { jsx as jsx31, jsxs as
|
|
2954
|
+
import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2896
2955
|
var Footer = ({
|
|
2897
2956
|
name,
|
|
2898
2957
|
type,
|
|
@@ -2910,8 +2969,8 @@ var Footer = ({
|
|
|
2910
2969
|
if (name.length > 17 && !highestOffer) {
|
|
2911
2970
|
name = name.substring(0, 17) + "...";
|
|
2912
2971
|
}
|
|
2913
|
-
return /* @__PURE__ */
|
|
2914
|
-
|
|
2972
|
+
return /* @__PURE__ */ jsxs22(
|
|
2973
|
+
Box20,
|
|
2915
2974
|
{
|
|
2916
2975
|
display: "flex",
|
|
2917
2976
|
flexDirection: "column",
|
|
@@ -2922,8 +2981,8 @@ var Footer = ({
|
|
|
2922
2981
|
position: "relative",
|
|
2923
2982
|
className: !!address && isAnimated ? footer.animated : footer.static,
|
|
2924
2983
|
children: [
|
|
2925
|
-
/* @__PURE__ */
|
|
2926
|
-
|
|
2984
|
+
/* @__PURE__ */ jsxs22(
|
|
2985
|
+
Box20,
|
|
2927
2986
|
{
|
|
2928
2987
|
display: "flex",
|
|
2929
2988
|
alignItems: "center",
|
|
@@ -2932,7 +2991,7 @@ var Footer = ({
|
|
|
2932
2991
|
width: "full",
|
|
2933
2992
|
children: [
|
|
2934
2993
|
/* @__PURE__ */ jsx31(
|
|
2935
|
-
|
|
2994
|
+
Text15,
|
|
2936
2995
|
{
|
|
2937
2996
|
color: "text100",
|
|
2938
2997
|
fontSize: "normal",
|
|
@@ -2961,10 +3020,10 @@ var Footer = ({
|
|
|
2961
3020
|
]
|
|
2962
3021
|
}
|
|
2963
3022
|
),
|
|
2964
|
-
lowestListingPriceAmount && lowestListingCurrency && /* @__PURE__ */
|
|
3023
|
+
lowestListingPriceAmount && lowestListingCurrency && /* @__PURE__ */ jsxs22(Box20, { display: "flex", alignItems: "center", gap: "1", children: [
|
|
2965
3024
|
/* @__PURE__ */ jsx31(Image6, { src: lowestListingCurrency?.imageUrl, width: "3", height: "3" }),
|
|
2966
|
-
/* @__PURE__ */
|
|
2967
|
-
|
|
3025
|
+
/* @__PURE__ */ jsxs22(
|
|
3026
|
+
Text15,
|
|
2968
3027
|
{
|
|
2969
3028
|
color: "text100",
|
|
2970
3029
|
fontSize: "small",
|
|
@@ -2972,7 +3031,7 @@ var Footer = ({
|
|
|
2972
3031
|
textAlign: "left",
|
|
2973
3032
|
fontFamily: "body",
|
|
2974
3033
|
children: [
|
|
2975
|
-
|
|
3034
|
+
formatUnits4(
|
|
2976
3035
|
BigInt(lowestListingPriceAmount),
|
|
2977
3036
|
lowestListingCurrency.decimals
|
|
2978
3037
|
),
|
|
@@ -2992,7 +3051,7 @@ var TokenTypeBalancePill = ({
|
|
|
2992
3051
|
}) => {
|
|
2993
3052
|
const displayText = type === "ERC1155" /* ERC1155 */ ? !!balance ? `Owned: ${balance}` : "ERC-1155" : "ERC-721";
|
|
2994
3053
|
return /* @__PURE__ */ jsx31(
|
|
2995
|
-
|
|
3054
|
+
Text15,
|
|
2996
3055
|
{
|
|
2997
3056
|
background: "backgroundSecondary",
|
|
2998
3057
|
color: "text80",
|
|
@@ -3008,10 +3067,10 @@ var TokenTypeBalancePill = ({
|
|
|
3008
3067
|
};
|
|
3009
3068
|
|
|
3010
3069
|
// src/react/ui/components/collectible-card/CollectibleCard.tsx
|
|
3011
|
-
import { jsx as jsx32, jsxs as
|
|
3070
|
+
import { jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3012
3071
|
function CollectibleSkeleton() {
|
|
3013
|
-
return /* @__PURE__ */
|
|
3014
|
-
|
|
3072
|
+
return /* @__PURE__ */ jsxs23(
|
|
3073
|
+
Box21,
|
|
3015
3074
|
{
|
|
3016
3075
|
className: collectibleCard,
|
|
3017
3076
|
borderRadius: "md",
|
|
@@ -3019,14 +3078,14 @@ function CollectibleSkeleton() {
|
|
|
3019
3078
|
background: "backgroundPrimary",
|
|
3020
3079
|
children: [
|
|
3021
3080
|
/* @__PURE__ */ jsx32(
|
|
3022
|
-
|
|
3081
|
+
Skeleton8,
|
|
3023
3082
|
{
|
|
3024
3083
|
size: "lg",
|
|
3025
3084
|
style: { width: "100%", height: 164, borderRadius: 0, paddingTop: 16 }
|
|
3026
3085
|
}
|
|
3027
3086
|
),
|
|
3028
|
-
/* @__PURE__ */
|
|
3029
|
-
|
|
3087
|
+
/* @__PURE__ */ jsxs23(
|
|
3088
|
+
Box21,
|
|
3030
3089
|
{
|
|
3031
3090
|
display: "flex",
|
|
3032
3091
|
flexDirection: "column",
|
|
@@ -3035,8 +3094,8 @@ function CollectibleSkeleton() {
|
|
|
3035
3094
|
paddingBottom: "4",
|
|
3036
3095
|
marginTop: "2",
|
|
3037
3096
|
children: [
|
|
3038
|
-
/* @__PURE__ */ jsx32(
|
|
3039
|
-
/* @__PURE__ */ jsx32(
|
|
3097
|
+
/* @__PURE__ */ jsx32(Skeleton8, { size: "lg" }),
|
|
3098
|
+
/* @__PURE__ */ jsx32(Skeleton8, { size: "sm" })
|
|
3040
3099
|
]
|
|
3041
3100
|
}
|
|
3042
3101
|
)
|
|
@@ -3057,7 +3116,7 @@ function CollectibleCard({
|
|
|
3057
3116
|
}) {
|
|
3058
3117
|
const { address: accountAddress } = useAccount7();
|
|
3059
3118
|
const collectibleMetadata = lowestListing?.metadata;
|
|
3060
|
-
const [imageLoadingError, setImageLoadingError] =
|
|
3119
|
+
const [imageLoadingError, setImageLoadingError] = useState9(false);
|
|
3061
3120
|
const { data: highestOffer, isLoading: highestOfferLoading } = useHighestOffer({
|
|
3062
3121
|
chainId: String(chainId),
|
|
3063
3122
|
collectionAddress,
|
|
@@ -3075,14 +3134,14 @@ function CollectibleCard({
|
|
|
3075
3134
|
const image = collectibleMetadata?.image;
|
|
3076
3135
|
const externalUrl = collectibleMetadata?.external_url;
|
|
3077
3136
|
return /* @__PURE__ */ jsx32(
|
|
3078
|
-
|
|
3137
|
+
Box21,
|
|
3079
3138
|
{
|
|
3080
3139
|
className: collectibleCard,
|
|
3081
3140
|
borderRadius: "md",
|
|
3082
3141
|
overflow: "hidden",
|
|
3083
3142
|
background: "backgroundPrimary",
|
|
3084
3143
|
children: /* @__PURE__ */ jsx32(
|
|
3085
|
-
|
|
3144
|
+
Box21,
|
|
3086
3145
|
{
|
|
3087
3146
|
display: "flex",
|
|
3088
3147
|
flexDirection: "column",
|
|
@@ -3097,7 +3156,7 @@ function CollectibleCard({
|
|
|
3097
3156
|
cursor: "pointer",
|
|
3098
3157
|
padding: "0",
|
|
3099
3158
|
className: collectibleTileWrapper,
|
|
3100
|
-
children: /* @__PURE__ */
|
|
3159
|
+
children: /* @__PURE__ */ jsxs23("article", { style: { width: "100%" }, children: [
|
|
3101
3160
|
externalUrl && /* @__PURE__ */ jsx32(
|
|
3102
3161
|
IconButton6,
|
|
3103
3162
|
{
|
|
@@ -3138,7 +3197,7 @@ function CollectibleCard({
|
|
|
3138
3197
|
}
|
|
3139
3198
|
),
|
|
3140
3199
|
accountAddress && (highestOffer || lowestListing) && /* @__PURE__ */ jsx32(
|
|
3141
|
-
|
|
3200
|
+
Box21,
|
|
3142
3201
|
{
|
|
3143
3202
|
display: "flex",
|
|
3144
3203
|
alignItems: "center",
|
|
@@ -3176,4 +3235,4 @@ export {
|
|
|
3176
3235
|
ModalProvider,
|
|
3177
3236
|
CollectibleCard
|
|
3178
3237
|
};
|
|
3179
|
-
//# sourceMappingURL=chunk-
|
|
3238
|
+
//# sourceMappingURL=chunk-3LGNSRBR.js.map
|