@0xsequence/marketplace-sdk 0.5.3 → 0.5.5
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/{builder-types-wOwfTJpd.d.ts → builder-types-Jl3Ymws8.d.ts} +1 -1
- package/dist/chunk-3BLBZYQX.js +56 -0
- package/dist/chunk-3BLBZYQX.js.map +1 -0
- package/dist/{chunk-BZD2LDJJ.js → chunk-7C7ADZ2H.js} +2 -2
- package/dist/{chunk-H5YWG6WN.js → chunk-AXTDPTRD.js} +317 -147
- package/dist/chunk-AXTDPTRD.js.map +1 -0
- package/dist/{chunk-BVXIRVEC.js → chunk-CIPPTQDA.js} +219 -72
- package/dist/chunk-CIPPTQDA.js.map +1 -0
- package/dist/{chunk-Y7YTLAO2.js → chunk-P7UNMRZ5.js} +3 -3
- package/dist/{chunk-WSCUPAGR.js → chunk-SA3U25NU.js} +2 -1
- package/dist/{chunk-WSCUPAGR.js.map → chunk-SA3U25NU.js.map} +1 -1
- package/dist/{chunk-MWDG7UTB.js → chunk-ZBLU3Q22.js} +1 -1
- package/dist/{create-config-Bltg8Enl.d.ts → create-config-DOUq8Day.d.ts} +2 -2
- package/dist/index.d.ts +4 -3
- package/dist/index.js +8 -8
- package/dist/{sdk-config-B32_2bG3.d.ts → marketplace.gen-D0ADxbfH.d.ts} +1 -24
- package/dist/react/_internal/api/index.d.ts +4 -2
- package/dist/react/_internal/api/index.js +1 -1
- package/dist/react/_internal/databeat/index.css +82 -0
- package/dist/react/_internal/databeat/index.css.map +1 -0
- package/dist/react/_internal/databeat/index.d.ts +68 -0
- package/dist/react/_internal/databeat/index.js +26 -0
- package/dist/react/_internal/databeat/index.js.map +1 -0
- package/dist/react/_internal/index.d.ts +6 -5
- package/dist/react/_internal/index.js +1 -1
- package/dist/react/_internal/wagmi/index.d.ts +4 -3
- package/dist/react/hooks/index.d.ts +446 -5
- package/dist/react/hooks/index.js +19 -5
- package/dist/react/index.d.ts +7 -6
- package/dist/react/index.js +22 -7
- package/dist/react/ssr/index.js +1 -0
- package/dist/react/ssr/index.js.map +1 -1
- package/dist/react/ui/components/collectible-card/index.d.ts +4 -3
- package/dist/react/ui/components/collectible-card/index.js +8 -7
- package/dist/react/ui/components/marketplace-logos/index.js +1 -1
- package/dist/react/ui/index.d.ts +4 -3
- package/dist/react/ui/index.js +8 -7
- package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +4 -3
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +6 -6
- package/dist/sdk-config-xWkdBdrL.d.ts +24 -0
- package/dist/{services-BRBVE0mm.d.ts → services-Dd2MoBTM.d.ts} +2 -1
- package/dist/types/index.d.ts +4 -3
- package/dist/types/index.js +1 -1
- package/dist/{types-BY3husBh.d.ts → types-vOfhbBkR.d.ts} +3 -2
- package/dist/utils/abi/index.js +5 -5
- package/dist/utils/index.d.ts +4 -3
- package/dist/utils/index.js +8 -8
- package/package.json +2 -1
- package/src/react/_internal/api/query-keys.ts +1 -0
- package/src/react/_internal/databeat/index.ts +63 -0
- package/src/react/_internal/databeat/types.ts +70 -0
- package/src/react/hooks/__tests__/useComparePrices.test.tsx +215 -0
- package/src/react/hooks/__tests__/useConvertPriceToUSD.test.tsx +173 -0
- package/src/react/hooks/__tests__/useListCollectiblesPaginated.test.tsx +217 -0
- package/src/react/hooks/index.ts +3 -0
- package/src/react/hooks/useComparePrices.tsx +106 -0
- package/src/react/hooks/useConvertPriceToUSD.tsx +102 -0
- package/src/react/hooks/useFilters.tsx +9 -3
- package/src/react/hooks/useListCollectiblesPaginated.tsx +78 -0
- package/src/react/ui/components/collectible-card/CollectibleCard.tsx +1 -0
- package/src/react/ui/components/collectible-card/Footer.tsx +10 -2
- package/src/react/ui/modals/BuyModal/hooks/useBuyCollectable.ts +30 -3
- package/src/react/ui/modals/CreateListingModal/hooks/useTransactionSteps.tsx +40 -4
- package/src/react/ui/modals/MakeOfferModal/hooks/useTransactionSteps.tsx +26 -2
- package/src/react/ui/modals/SellModal/Modal.tsx +3 -1
- package/src/react/ui/modals/SellModal/hooks/useSell.tsx +10 -7
- package/src/react/ui/modals/SellModal/hooks/useTransactionSteps.tsx +51 -13
- package/src/react/ui/modals/_internal/components/floorPriceText/index.tsx +30 -12
- package/src/react/ui/modals/_internal/components/priceInput/__tests__/index.test.tsx +51 -4
- package/src/react/ui/modals/_internal/components/priceInput/index.tsx +24 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/chunk-BVXIRVEC.js.map +0 -1
- package/dist/chunk-H5YWG6WN.js.map +0 -1
- /package/dist/{chunk-BZD2LDJJ.js.map → chunk-7C7ADZ2H.js.map} +0 -0
- /package/dist/{chunk-Y7YTLAO2.js.map → chunk-P7UNMRZ5.js.map} +0 -0
- /package/dist/{chunk-MWDG7UTB.js.map → chunk-ZBLU3Q22.js.map} +0 -0
- /package/src/react/ui/modals/BuyModal/hooks/__tests__/{useBuyCollectable.test.tsx → useBuyCollectable.test.tsx.bak} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Observable } from '@legendapp/state';
|
|
2
|
-
import type
|
|
2
|
+
import { type Address, type Hex, formatUnits } from 'viem';
|
|
3
3
|
import type { OrderbookKind } from '../../../../../types';
|
|
4
4
|
import {
|
|
5
5
|
ExecuteType,
|
|
@@ -10,17 +10,21 @@ import {
|
|
|
10
10
|
collectableKeys,
|
|
11
11
|
getMarketplaceClient,
|
|
12
12
|
} from '../../../../_internal';
|
|
13
|
+
import { useAnalytics } from '../../../../_internal/databeat';
|
|
13
14
|
import { TransactionType } from '../../../../_internal/types';
|
|
14
15
|
import type { ListingInput } from '../../../../_internal/types';
|
|
15
|
-
import { useWallet } from '../../../../_internal/wallet/useWallet';
|
|
16
16
|
import type {
|
|
17
17
|
SignatureStep,
|
|
18
18
|
TransactionStep as WalletTransactionStep,
|
|
19
19
|
} from '../../../../_internal/utils';
|
|
20
|
-
import {
|
|
20
|
+
import { useWallet } from '../../../../_internal/wallet/useWallet';
|
|
21
|
+
import {
|
|
22
|
+
useConfig,
|
|
23
|
+
useCurrencies,
|
|
24
|
+
useGenerateListingTransaction,
|
|
25
|
+
} from '../../../../hooks';
|
|
21
26
|
import { useTransactionStatusModal } from '../../_internal/components/transactionStatusModal';
|
|
22
27
|
import type { ModalCallbacks } from '../../_internal/types';
|
|
23
|
-
|
|
24
28
|
interface UseTransactionStepsArgs {
|
|
25
29
|
listingInput: ListingInput;
|
|
26
30
|
chainId: string;
|
|
@@ -44,7 +48,11 @@ export const useTransactionSteps = ({
|
|
|
44
48
|
const expiry = new Date(Number(listingInput.listing.expiry) * 1000);
|
|
45
49
|
const { show: showTransactionStatusModal } = useTransactionStatusModal();
|
|
46
50
|
const sdkConfig = useConfig();
|
|
51
|
+
const { data: currencies } = useCurrencies({
|
|
52
|
+
chainId: Number(chainId),
|
|
53
|
+
});
|
|
47
54
|
const marketplaceClient = getMarketplaceClient(chainId, sdkConfig);
|
|
55
|
+
const analytics = useAnalytics();
|
|
48
56
|
const { generateListingTransactionAsync, isPending: generatingSteps } =
|
|
49
57
|
useGenerateListingTransaction({
|
|
50
58
|
chainId,
|
|
@@ -164,6 +172,34 @@ export const useTransactionSteps = ({
|
|
|
164
172
|
steps$.transaction.isExecuting.set(false);
|
|
165
173
|
steps$.transaction.exist.set(false);
|
|
166
174
|
}
|
|
175
|
+
|
|
176
|
+
if (hash || orderId) {
|
|
177
|
+
const currencyDecimal =
|
|
178
|
+
currencies?.find(
|
|
179
|
+
(currency) =>
|
|
180
|
+
currency.contractAddress === listingInput.listing.currencyAddress,
|
|
181
|
+
)?.decimals || 0;
|
|
182
|
+
|
|
183
|
+
const currencyValueRaw = Number(listingInput.listing.pricePerToken);
|
|
184
|
+
const currencyValueDecimal = Number(
|
|
185
|
+
formatUnits(BigInt(currencyValueRaw), currencyDecimal),
|
|
186
|
+
);
|
|
187
|
+
|
|
188
|
+
analytics.trackCreateListing({
|
|
189
|
+
props: {
|
|
190
|
+
orderbookKind,
|
|
191
|
+
collectionAddress,
|
|
192
|
+
currencyAddress: listingInput.listing.currencyAddress,
|
|
193
|
+
currencySymbol: '',
|
|
194
|
+
chainId,
|
|
195
|
+
txnHash: hash || '',
|
|
196
|
+
},
|
|
197
|
+
nums: {
|
|
198
|
+
currencyValueDecimal,
|
|
199
|
+
currencyValueRaw,
|
|
200
|
+
},
|
|
201
|
+
});
|
|
202
|
+
}
|
|
167
203
|
} catch (error) {
|
|
168
204
|
steps$.transaction.isExecuting.set(false);
|
|
169
205
|
steps$.transaction.exist.set(false);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Observable } from '@legendapp/state';
|
|
2
|
-
import type
|
|
2
|
+
import { type Address, type Hex, formatUnits } from 'viem';
|
|
3
3
|
import { OrderbookKind, type Price } from '../../../../../types';
|
|
4
4
|
import {
|
|
5
5
|
ExecuteType,
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
collectableKeys,
|
|
11
11
|
getMarketplaceClient,
|
|
12
12
|
} from '../../../../_internal';
|
|
13
|
+
import { useAnalytics } from '../../../../_internal/databeat';
|
|
13
14
|
import { TransactionType } from '../../../../_internal/types';
|
|
14
15
|
import type { OfferInput } from '../../../../_internal/types';
|
|
15
16
|
import type {
|
|
@@ -21,7 +22,6 @@ import { useConfig, useCurrency } from '../../../../hooks';
|
|
|
21
22
|
import { useGenerateOfferTransaction } from '../../../../hooks/useGenerateOfferTransaction';
|
|
22
23
|
import { useTransactionStatusModal } from '../../_internal/components/transactionStatusModal';
|
|
23
24
|
import type { ModalCallbacks } from '../../_internal/types';
|
|
24
|
-
|
|
25
25
|
export type ExecutionState = 'approval' | 'offer' | null;
|
|
26
26
|
|
|
27
27
|
interface UseTransactionStepsArgs {
|
|
@@ -47,6 +47,7 @@ export const useTransactionSteps = ({
|
|
|
47
47
|
const expiry = new Date(Number(offerInput.offer.expiry) * 1000);
|
|
48
48
|
const { show: showTransactionStatusModal } = useTransactionStatusModal();
|
|
49
49
|
const sdkConfig = useConfig();
|
|
50
|
+
const analytics = useAnalytics();
|
|
50
51
|
const marketplaceClient = getMarketplaceClient(chainId, sdkConfig);
|
|
51
52
|
const { generateOfferTransactionAsync, isPending: generatingSteps } =
|
|
52
53
|
useGenerateOfferTransaction({
|
|
@@ -177,6 +178,29 @@ export const useTransactionSteps = ({
|
|
|
177
178
|
steps$.transaction.isExecuting.set(false);
|
|
178
179
|
steps$.transaction.exist.set(false);
|
|
179
180
|
}
|
|
181
|
+
|
|
182
|
+
if (hash || orderId) {
|
|
183
|
+
const currencyDecimal = currency?.decimals || 0;
|
|
184
|
+
const currencyValueRaw = Number(offerInput.offer.pricePerToken);
|
|
185
|
+
const currencyValueDecimal = Number(
|
|
186
|
+
formatUnits(BigInt(currencyValueRaw), currencyDecimal),
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
analytics.trackCreateOffer({
|
|
190
|
+
props: {
|
|
191
|
+
orderbookKind,
|
|
192
|
+
collectionAddress,
|
|
193
|
+
currencyAddress: offerInput.offer.currencyAddress,
|
|
194
|
+
currencySymbol: currency?.symbol || '',
|
|
195
|
+
chainId,
|
|
196
|
+
txnHash: hash || '',
|
|
197
|
+
},
|
|
198
|
+
nums: {
|
|
199
|
+
currencyValueDecimal,
|
|
200
|
+
currencyValueRaw,
|
|
201
|
+
},
|
|
202
|
+
});
|
|
203
|
+
}
|
|
180
204
|
} catch (error) {
|
|
181
205
|
steps$.transaction.isExecuting.set(false);
|
|
182
206
|
steps$.transaction.exist.set(false);
|
|
@@ -11,8 +11,8 @@ import { LoadingModal } from '../_internal/components/actionModal/LoadingModal';
|
|
|
11
11
|
import TokenPreview from '../_internal/components/tokenPreview';
|
|
12
12
|
import TransactionDetails from '../_internal/components/transactionDetails';
|
|
13
13
|
import TransactionHeader from '../_internal/components/transactionHeader';
|
|
14
|
-
import { sellModal$ } from './store';
|
|
15
14
|
import { useSell } from './hooks/useSell';
|
|
15
|
+
import { sellModal$ } from './store';
|
|
16
16
|
|
|
17
17
|
export const SellModal = () => {
|
|
18
18
|
return <Show if={sellModal$.isOpen}>{() => <Modal />}</Show>;
|
|
@@ -58,6 +58,8 @@ const Modal = observer(() => {
|
|
|
58
58
|
collectible?.decimals || 0,
|
|
59
59
|
).toString()
|
|
60
60
|
: '1',
|
|
61
|
+
pricePerToken: order?.priceAmount ?? '',
|
|
62
|
+
currencyAddress: order?.priceCurrencyAddress ?? '',
|
|
61
63
|
},
|
|
62
64
|
],
|
|
63
65
|
callbacks,
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import type { Observable } from '@legendapp/state';
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import type { MarketplaceKind, TransactionSteps } from '../../../../_internal';
|
|
2
4
|
import type { ModalCallbacks } from '../../_internal/types';
|
|
3
5
|
import { useGetTokenApprovalData } from './useGetTokenApproval';
|
|
4
6
|
import { useTransactionSteps } from './useTransactionSteps';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
|
|
8
|
+
export type SellOrder = {
|
|
9
|
+
orderId: string;
|
|
10
|
+
quantity: string;
|
|
11
|
+
pricePerToken: string;
|
|
12
|
+
currencyAddress: string;
|
|
13
|
+
};
|
|
11
14
|
|
|
12
15
|
interface UseSellArgs {
|
|
13
16
|
collectibleId: string;
|
|
14
17
|
chainId: string;
|
|
15
18
|
collectionAddress: string;
|
|
16
19
|
marketplace: MarketplaceKind;
|
|
17
|
-
ordersData: Array<
|
|
20
|
+
ordersData: Array<SellOrder>;
|
|
18
21
|
callbacks?: ModalCallbacks;
|
|
19
22
|
closeMainModal: () => void;
|
|
20
23
|
steps$: Observable<TransactionSteps>;
|
|
@@ -1,27 +1,32 @@
|
|
|
1
|
+
import type { Observable } from '@legendapp/state';
|
|
2
|
+
import { formatUnits } from 'viem';
|
|
3
|
+
import type { Address, Hex } from 'viem';
|
|
1
4
|
import {
|
|
2
|
-
balanceQueries,
|
|
3
|
-
collectableKeys,
|
|
4
5
|
ExecuteType,
|
|
5
|
-
getMarketplaceClient,
|
|
6
6
|
type MarketplaceKind,
|
|
7
|
-
type OrderData,
|
|
8
7
|
type Step,
|
|
9
8
|
StepType,
|
|
10
9
|
type TransactionSteps,
|
|
10
|
+
balanceQueries,
|
|
11
|
+
collectableKeys,
|
|
12
|
+
getMarketplaceClient,
|
|
11
13
|
} from '../../../../_internal';
|
|
12
|
-
import
|
|
14
|
+
import { useAnalytics } from '../../../../_internal/databeat';
|
|
13
15
|
import { TransactionType } from '../../../../_internal/types';
|
|
14
|
-
import { useTransactionStatusModal } from '../../_internal/components/transactionStatusModal';
|
|
15
|
-
import type { Address, Hex } from 'viem';
|
|
16
|
-
import type { Observable } from '@legendapp/state';
|
|
17
|
-
import { useWallet } from '../../../../_internal/wallet/useWallet';
|
|
18
16
|
import type {
|
|
19
17
|
SignatureStep,
|
|
20
18
|
TransactionStep,
|
|
21
19
|
} from '../../../../_internal/utils';
|
|
22
|
-
import {
|
|
20
|
+
import { useWallet } from '../../../../_internal/wallet/useWallet';
|
|
21
|
+
import {
|
|
22
|
+
useConfig,
|
|
23
|
+
useCurrencies,
|
|
24
|
+
useGenerateSellTransaction,
|
|
25
|
+
} from '../../../../hooks';
|
|
23
26
|
import { useFees } from '../../BuyModal/hooks/useFees';
|
|
24
|
-
|
|
27
|
+
import { useTransactionStatusModal } from '../../_internal/components/transactionStatusModal';
|
|
28
|
+
import type { ModalCallbacks } from '../../_internal/types';
|
|
29
|
+
import type { SellOrder } from './useSell';
|
|
25
30
|
export type ExecutionState = 'approval' | 'sell' | null;
|
|
26
31
|
|
|
27
32
|
interface UseTransactionStepsArgs {
|
|
@@ -29,7 +34,7 @@ interface UseTransactionStepsArgs {
|
|
|
29
34
|
chainId: string;
|
|
30
35
|
collectionAddress: string;
|
|
31
36
|
marketplace: MarketplaceKind;
|
|
32
|
-
ordersData: Array<
|
|
37
|
+
ordersData: Array<SellOrder>;
|
|
33
38
|
callbacks?: ModalCallbacks;
|
|
34
39
|
closeMainModal: () => void;
|
|
35
40
|
steps$: Observable<TransactionSteps>;
|
|
@@ -49,10 +54,16 @@ export const useTransactionSteps = ({
|
|
|
49
54
|
const { show: showTransactionStatusModal } = useTransactionStatusModal();
|
|
50
55
|
const sdkConfig = useConfig();
|
|
51
56
|
const marketplaceClient = getMarketplaceClient(chainId, sdkConfig);
|
|
57
|
+
const analytics = useAnalytics();
|
|
58
|
+
|
|
52
59
|
const { amount, receiver } = useFees({
|
|
53
60
|
chainId: Number(chainId),
|
|
54
61
|
collectionAddress: collectionAddress,
|
|
55
62
|
});
|
|
63
|
+
|
|
64
|
+
const { data: currencies } = useCurrencies({
|
|
65
|
+
chainId: Number(chainId),
|
|
66
|
+
});
|
|
56
67
|
const { generateSellTransactionAsync, isPending: generatingSteps } =
|
|
57
68
|
useGenerateSellTransaction({
|
|
58
69
|
chainId,
|
|
@@ -163,10 +174,37 @@ export const useTransactionSteps = ({
|
|
|
163
174
|
|
|
164
175
|
if (orderId) {
|
|
165
176
|
// no need to wait for receipt, because the order is already created
|
|
166
|
-
|
|
167
177
|
steps$.transaction.isExecuting.set(false);
|
|
168
178
|
steps$.transaction.exist.set(false);
|
|
169
179
|
}
|
|
180
|
+
|
|
181
|
+
if (hash || orderId) {
|
|
182
|
+
const currency = currencies?.find(
|
|
183
|
+
(currency) =>
|
|
184
|
+
currency.contractAddress === ordersData[0].currencyAddress,
|
|
185
|
+
);
|
|
186
|
+
const currencyDecimal = currency?.decimals || 0;
|
|
187
|
+
const currencySymbol = currency?.symbol || '';
|
|
188
|
+
const currencyValueRaw = Number(ordersData[0].pricePerToken);
|
|
189
|
+
const currencyValueDecimal = Number(
|
|
190
|
+
formatUnits(BigInt(currencyValueRaw), currencyDecimal),
|
|
191
|
+
);
|
|
192
|
+
|
|
193
|
+
analytics.trackSellItems({
|
|
194
|
+
props: {
|
|
195
|
+
marketplaceKind: marketplace,
|
|
196
|
+
collectionAddress,
|
|
197
|
+
currencyAddress: ordersData[0].currencyAddress,
|
|
198
|
+
currencySymbol,
|
|
199
|
+
chainId,
|
|
200
|
+
txnHash: hash || '',
|
|
201
|
+
},
|
|
202
|
+
nums: {
|
|
203
|
+
currencyValueDecimal,
|
|
204
|
+
currencyValueRaw,
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
}
|
|
170
208
|
} catch (error) {
|
|
171
209
|
steps$.transaction.isExecuting.set(false);
|
|
172
210
|
steps$.transaction.exist.set(false);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Text } from '@0xsequence/design-system';
|
|
2
2
|
import type { Hex } from 'viem';
|
|
3
3
|
import type { Price } from '../../../../../../types';
|
|
4
|
-
import {
|
|
5
|
-
import { useLowestListing } from '../../../../../hooks';
|
|
4
|
+
import { useComparePrices, useLowestListing } from '../../../../../hooks';
|
|
6
5
|
|
|
7
6
|
export default function FloorPriceText({
|
|
8
7
|
chainId,
|
|
@@ -26,20 +25,39 @@ export default function FloorPriceText({
|
|
|
26
25
|
|
|
27
26
|
const floorPriceRaw = listing?.order?.priceAmount;
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
const { data: priceComparison, isLoading: comparisonLoading } =
|
|
29
|
+
useComparePrices({
|
|
30
|
+
chainId,
|
|
31
|
+
priceAmountRaw: price.amountRaw || '0',
|
|
32
|
+
priceCurrencyAddress: price.currency.contractAddress,
|
|
33
|
+
compareToPriceAmountRaw: floorPriceRaw || '0',
|
|
34
|
+
compareToPriceCurrencyAddress:
|
|
35
|
+
listing?.order?.priceCurrencyAddress || price.currency.contractAddress,
|
|
36
|
+
query: {
|
|
37
|
+
enabled: !!floorPriceRaw && !listingLoading && price.amountRaw !== '0',
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
if (
|
|
42
|
+
!floorPriceRaw ||
|
|
43
|
+
listingLoading ||
|
|
44
|
+
price.amountRaw === '0' ||
|
|
45
|
+
comparisonLoading
|
|
46
|
+
) {
|
|
30
47
|
return null;
|
|
31
48
|
}
|
|
32
49
|
|
|
33
|
-
|
|
34
|
-
inputPriceRaw: BigInt(price.amountRaw),
|
|
35
|
-
basePriceRaw: BigInt(floorPriceRaw),
|
|
36
|
-
decimals: price.currency.decimals,
|
|
37
|
-
});
|
|
50
|
+
let floorPriceDifferenceText = 'Same as floor price';
|
|
38
51
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
52
|
+
if (priceComparison) {
|
|
53
|
+
if (priceComparison.status === 'same') {
|
|
54
|
+
floorPriceDifferenceText = 'Same as floor price';
|
|
55
|
+
} else {
|
|
56
|
+
floorPriceDifferenceText = `${priceComparison.percentageDifferenceFormatted}% ${
|
|
57
|
+
priceComparison.status === 'below' ? 'below' : 'above'
|
|
58
|
+
} floor price`;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
43
61
|
|
|
44
62
|
return (
|
|
45
63
|
<Text
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
2
1
|
import { observable } from '@legendapp/state';
|
|
2
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
3
3
|
import PriceInput from '..';
|
|
4
4
|
import type { Currency, Price } from '../../../../../../../types';
|
|
5
|
+
import { CurrencyStatus } from '../../../../../../_internal';
|
|
5
6
|
import {
|
|
6
|
-
|
|
7
|
-
screen,
|
|
7
|
+
act,
|
|
8
8
|
cleanup,
|
|
9
9
|
fireEvent,
|
|
10
|
+
render,
|
|
11
|
+
screen,
|
|
12
|
+
waitFor,
|
|
10
13
|
} from '../../../../../../_internal/test-utils';
|
|
11
|
-
import { CurrencyStatus } from '../../../../../../_internal';
|
|
12
14
|
|
|
13
15
|
vi.mock('../hooks/usePriceInput', () => ({
|
|
14
16
|
usePriceInput: vi.fn(({ onPriceChange }) => ({
|
|
@@ -34,6 +36,7 @@ vi.mock('../../../../../hooks/useCurrencyBalance', () => ({
|
|
|
34
36
|
})),
|
|
35
37
|
}));
|
|
36
38
|
|
|
39
|
+
// TODO: Remove local mocks
|
|
37
40
|
// Mock currency data
|
|
38
41
|
const MOCK_CURRENCY: Currency = {
|
|
39
42
|
symbol: 'USDC',
|
|
@@ -50,6 +53,15 @@ const MOCK_CURRENCY: Currency = {
|
|
|
50
53
|
updatedAt: new Date().toISOString(),
|
|
51
54
|
};
|
|
52
55
|
|
|
56
|
+
// Mock currency with different decimals
|
|
57
|
+
const MOCK_CURRENCY_HIGH_DECIMALS: Currency = {
|
|
58
|
+
...MOCK_CURRENCY,
|
|
59
|
+
symbol: 'aPOL',
|
|
60
|
+
contractAddress: '0x5678' as `0x${string}`,
|
|
61
|
+
name: 'aPOL Token',
|
|
62
|
+
decimals: 18,
|
|
63
|
+
};
|
|
64
|
+
|
|
53
65
|
// Mock price data
|
|
54
66
|
const createMockPrice = (amount = '0'): Price => ({
|
|
55
67
|
amountRaw: amount,
|
|
@@ -121,4 +133,39 @@ describe('PriceInput', () => {
|
|
|
121
133
|
|
|
122
134
|
expect(onPriceChange).not.toHaveBeenCalled();
|
|
123
135
|
});
|
|
136
|
+
|
|
137
|
+
it('should adjust raw amount when currency decimals change', async () => {
|
|
138
|
+
// Create a price observable with initial currency (6 decimals)
|
|
139
|
+
const price$ = observable<Price | undefined>(createMockPrice());
|
|
140
|
+
const onPriceChange = vi.fn();
|
|
141
|
+
|
|
142
|
+
render(
|
|
143
|
+
<PriceInput
|
|
144
|
+
{...defaultProps}
|
|
145
|
+
$price={price$}
|
|
146
|
+
onPriceChange={onPriceChange}
|
|
147
|
+
/>,
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
// Enter a price value
|
|
151
|
+
const input = screen.getByRole('textbox', { name: /price/i });
|
|
152
|
+
|
|
153
|
+
act(() => {
|
|
154
|
+
fireEvent.change(input, { target: { value: '1000' } });
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
// Verify initial raw amount (with 6 decimals)
|
|
158
|
+
expect(price$.get()?.amountRaw).toBe('1000000000');
|
|
159
|
+
|
|
160
|
+
// Change currency to one with 18 decimals
|
|
161
|
+
act(() => {
|
|
162
|
+
price$.currency.set(MOCK_CURRENCY_HIGH_DECIMALS);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
// Wait for the effect to process
|
|
166
|
+
await waitFor(() => {
|
|
167
|
+
// The raw amount should be adjusted for the new currency's decimals
|
|
168
|
+
expect(price$.get()?.amountRaw).toBe('1000000000000000000000');
|
|
169
|
+
});
|
|
170
|
+
});
|
|
124
171
|
});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Box, NumericInput, Text } from '@0xsequence/design-system';
|
|
2
2
|
import type { Observable } from '@legendapp/state';
|
|
3
|
+
import { use$ } from '@legendapp/state/react';
|
|
4
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
5
|
import { type Hex, parseUnits } from 'viem';
|
|
4
6
|
import { useAccount } from 'wagmi';
|
|
5
7
|
import type { Price } from '../../../../../../types';
|
|
8
|
+
import { useCurrencyBalance } from '../../../../../hooks/useCurrencyBalance';
|
|
6
9
|
import CurrencyImage from '../currencyImage';
|
|
7
10
|
import CurrencyOptionsSelect from '../currencyOptionsSelect';
|
|
8
11
|
import { priceInputCurrencyImage, priceInputWrapper } from './styles.css';
|
|
9
|
-
import { use$ } from '@legendapp/state/react';
|
|
10
|
-
import { useCurrencyBalance } from '../../../../../hooks/useCurrencyBalance';
|
|
11
|
-
import { useState } from 'react';
|
|
12
12
|
|
|
13
13
|
type PriceInputProps = {
|
|
14
14
|
collectionAddress: Hex;
|
|
@@ -55,6 +55,27 @@ export default function PriceInput({
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
const [value, setValue] = useState('0');
|
|
58
|
+
const prevCurrencyDecimals = useRef(currencyDecimals);
|
|
59
|
+
|
|
60
|
+
// Handle currency changes and adjust the raw amount accordingly
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (prevCurrencyDecimals.current !== currencyDecimals && value !== '0') {
|
|
63
|
+
try {
|
|
64
|
+
// If the user has entered a value and the currency decimals have changed,
|
|
65
|
+
// we need to adjust the raw amount to maintain the same displayed value
|
|
66
|
+
const parsedAmount = parseUnits(value, Number(currencyDecimals));
|
|
67
|
+
$price.amountRaw.set(parsedAmount.toString());
|
|
68
|
+
|
|
69
|
+
if (onPriceChange && parsedAmount !== 0n) {
|
|
70
|
+
onPriceChange();
|
|
71
|
+
}
|
|
72
|
+
} catch {
|
|
73
|
+
$price.amountRaw.set('0');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
prevCurrencyDecimals.current = currencyDecimals;
|
|
78
|
+
}, [currencyDecimals, $price.amountRaw, value, onPriceChange]);
|
|
58
79
|
|
|
59
80
|
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
60
81
|
const newValue = event.target.value;
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/consts.ts","./src/index.ts","./src/react/index.ts","./src/react/provider.tsx","./src/react/__tests__/provider.test.tsx","./src/react/_internal/consts.ts","./src/react/_internal/get-provider.ts","./src/react/_internal/index.ts","./src/react/_internal/logger.ts","./src/react/_internal/test-utils.tsx","./src/react/_internal/types.ts","./src/react/_internal/utils.ts","./src/react/_internal/api/get-query-client.ts","./src/react/_internal/api/index.ts","./src/react/_internal/api/marketplace-api.ts","./src/react/_internal/api/marketplace.gen.ts","./src/react/_internal/api/query-keys.ts","./src/react/_internal/api/services.ts","./src/react/_internal/api/zod-schema.ts","./src/react/_internal/api/__mocks__/indexer.msw.ts","./src/react/_internal/api/__mocks__/marketplace.msw.ts","./src/react/_internal/api/__mocks__/metadata.msw.ts","./src/react/_internal/test/setup.ts","./src/react/_internal/test/mocks/publicclient.ts","./src/react/_internal/test/mocks/wagmi.ts","./src/react/_internal/test/mocks/wallet.ts","./src/react/_internal/wagmi/create-config.ts","./src/react/_internal/wagmi/embedded.ts","./src/react/_internal/wagmi/index.ts","./src/react/_internal/wagmi/universal.ts","./src/react/_internal/wagmi/__tests__/create-config.test.ts","./src/react/_internal/wallet/usewallet.ts","./src/react/_internal/wallet/wallet.ts","./src/react/hooks/index.ts","./src/react/hooks/useautoselectfeeoption.tsx","./src/react/hooks/usebalanceofcollectible.tsx","./src/react/hooks/usecancelorder.tsx","./src/react/hooks/usecanceltransactionsteps.tsx","./src/react/hooks/usecheckoutoptions.tsx","./src/react/hooks/usecollectible.tsx","./src/react/hooks/usecollection.tsx","./src/react/hooks/usecollectionbalancedetails.tsx","./src/react/hooks/usecollectiondetails.tsx","./src/react/hooks/usecollectiondetailspolling.tsx","./src/react/hooks/useconfig.tsx","./src/react/hooks/usecountlistingsforcollectible.tsx","./src/react/hooks/usecountofcollectables.tsx","./src/react/hooks/usecountoffersforcollectible.tsx","./src/react/hooks/usecurrencies.tsx","./src/react/hooks/usecurrency.tsx","./src/react/hooks/usecurrencybalance.tsx","./src/react/hooks/usefilters.tsx","./src/react/hooks/usefloororder.tsx","./src/react/hooks/usegeneratebuytransaction.tsx","./src/react/hooks/usegeneratecanceltransaction.tsx","./src/react/hooks/usegeneratelistingtransaction.tsx","./src/react/hooks/usegenerateoffertransaction.tsx","./src/react/hooks/usegenerateselltransaction.tsx","./src/react/hooks/usegetreceiptfromhash.tsx","./src/react/hooks/usehighestoffer.tsx","./src/react/hooks/uselistbalances.tsx","./src/react/hooks/uselistcollectibleactivities.tsx","./src/react/hooks/uselistcollectibles.tsx","./src/react/hooks/uselistcollectionactivities.tsx","./src/react/hooks/uselistcollections.tsx","./src/react/hooks/uselistlistingsforcollectible.tsx","./src/react/hooks/uselistoffersforcollectible.tsx","./src/react/hooks/uselowestlisting.tsx","./src/react/hooks/usemarketplaceconfig.tsx","./src/react/hooks/useroyaltypercentage.tsx","./src/react/hooks/usetransfertokens.tsx","./src/react/hooks/__tests__/useautoselectfeeoption.test.tsx","./src/react/hooks/__tests__/usebalanceofcollectible.test.tsx","./src/react/hooks/__tests__/usecancelorder.test.tsx","./src/react/hooks/__tests__/usecanceltransactionsteps.test.tsx","./src/react/hooks/__tests__/usecollectible.test.tsx","./src/react/hooks/__tests__/usecollection.test.tsx","./src/react/hooks/__tests__/usecollectionbalancedetails.test.tsx","./src/react/hooks/__tests__/usecollectiondetails.test.tsx","./src/react/hooks/__tests__/usecollectiondetailspolling.test.tsx","./src/react/hooks/__tests__/usecountlistingsforcollectible.test.tsx","./src/react/hooks/__tests__/usecountofcollectables.test.tsx","./src/react/hooks/__tests__/usecountoffersforcollectible.test.tsx","./src/react/hooks/__tests__/usecurrencies.test.tsx","./src/react/hooks/__tests__/usecurrency.test.tsx","./src/react/hooks/__tests__/usecurrencybalance.test.tsx","./src/react/hooks/__tests__/usefilters.test.tsx","./src/react/hooks/__tests__/usefloororder.test.tsx","./src/react/hooks/__tests__/usegeneratebuytransaction.test.tsx","./src/react/hooks/__tests__/usegeneratecanceltransaction.test.tsx","./src/react/hooks/__tests__/usegeneratelistingtransaction.test.tsx","./src/react/hooks/__tests__/usegenerateoffertransaction.test.tsx","./src/react/hooks/__tests__/usegenerateselltransaction.test.tsx","./src/react/hooks/__tests__/usehighestoffer.test.tsx","./src/react/hooks/__tests__/uselistbalances.test.tsx","./src/react/hooks/__tests__/uselistcollectibleactivities.test.tsx","./src/react/hooks/__tests__/uselistcollectibles.test.tsx","./src/react/hooks/__tests__/uselistcollectionactivities.test.tsx","./src/react/hooks/__tests__/uselistcollections.test.tsx","./src/react/hooks/__tests__/uselistlistingsforcollectible.test.tsx","./src/react/hooks/__tests__/uselistoffersforcollectible.test.tsx","./src/react/hooks/__tests__/uselowestlisting.test.tsx","./src/react/hooks/__tests__/usemarketplaceconfig.test.tsx","./src/react/hooks/__tests__/useroyaltypercentage.test.tsx","./src/react/hooks/options/marketplaceconfigoptions.ts","./src/react/hooks/options/__mocks__/marketplaceconfig.msw.ts","./src/react/hooks/options/__tests__/marketplaceconfigoptions.test.tsx","./src/react/ssr/create-ssr-client.ts","./src/react/ssr/index.ts","./src/react/ui/index.ts","./src/react/ui/components/_internals/action-button/actionbutton.tsx","./src/react/ui/components/_internals/action-button/store.ts","./src/react/ui/components/_internals/action-button/styles.css.ts","./src/react/ui/components/_internals/action-button/types.ts","./src/react/ui/components/_internals/action-button/components/actionbuttonbody.tsx","./src/react/ui/components/_internals/action-button/components/nonowneractions.tsx","./src/react/ui/components/_internals/action-button/components/owneractions.tsx","./src/react/ui/components/_internals/action-button/hooks/useactionbuttonlogic.ts","./src/react/ui/components/_internals/custom-network-image/customnetworkimage.tsx","./src/react/ui/components/_internals/custom-network-image/styles.css.ts","./src/react/ui/components/_internals/custom-select/customselect.tsx","./src/react/ui/components/_internals/custom-select/styles.css.ts","./src/react/ui/components/_internals/custom-select/__tests__/customselect.test.tsx","./src/react/ui/components/_internals/pill/pill.tsx","./src/react/ui/components/collectible-card/collectiblecard.tsx","./src/react/ui/components/collectible-card/footer.tsx","./src/react/ui/components/collectible-card/index.ts","./src/react/ui/components/collectible-card/styles.css.ts","./src/react/ui/components/marketplace-logos/index.ts","./src/react/ui/components/marketplace-logos/marketplace-logos.tsx","./src/react/ui/icons/arrowup.tsx","./src/react/ui/icons/bell.tsx","./src/react/ui/icons/calendaricon.tsx","./src/react/ui/icons/carticon.tsx","./src/react/ui/icons/diamondeye.tsx","./src/react/ui/icons/infoicon.tsx","./src/react/ui/icons/inventoryicon.tsx","./src/react/ui/icons/minusicon.tsx","./src/react/ui/icons/plusicon.tsx","./src/react/ui/icons/positivecircleicon.tsx","./src/react/ui/icons/index.ts","./src/react/ui/icons/styles.css.ts","./src/react/ui/modals/modal-provider.tsx","./src/react/ui/modals/buymodal/modal.tsx","./src/react/ui/modals/buymodal/index.tsx","./src/react/ui/modals/buymodal/store.ts","./src/react/ui/modals/buymodal/__tests__/modal.test.tsx","./src/react/ui/modals/buymodal/__tests__/store.test.ts","./src/react/ui/modals/buymodal/hooks/usebuycollectable.ts","./src/react/ui/modals/buymodal/hooks/usecheckoutoptions.ts","./src/react/ui/modals/buymodal/hooks/usefees.ts","./src/react/ui/modals/buymodal/hooks/useloaddata.ts","./src/react/ui/modals/buymodal/hooks/__tests__/usebuycollectable.test.tsx","./src/react/ui/modals/buymodal/hooks/__tests__/usecheckoutoptions.test.tsx","./src/react/ui/modals/buymodal/hooks/__tests__/usefees.test.tsx","./src/react/ui/modals/buymodal/hooks/__tests__/useloaddata.test.tsx","./src/react/ui/modals/buymodal/modals/checkoutmodal.tsx","./src/react/ui/modals/buymodal/modals/modal1155.tsx","./src/react/ui/modals/buymodal/modals/__tests__/checkoutmodal.test.tsx","./src/react/ui/modals/buymodal/modals/__tests__/modal1155.test.tsx","./src/react/ui/modals/createlistingmodal/modal.tsx","./src/react/ui/modals/createlistingmodal/index.tsx","./src/react/ui/modals/createlistingmodal/store.ts","./src/react/ui/modals/createlistingmodal/__tests__/modal.test.tsx","./src/react/ui/modals/createlistingmodal/hooks/usecreatelisting.tsx","./src/react/ui/modals/createlistingmodal/hooks/usegettokenapproval.ts","./src/react/ui/modals/createlistingmodal/hooks/usetransactionsteps.tsx","./src/react/ui/modals/makeoffermodal/modal.tsx","./src/react/ui/modals/makeoffermodal/index.tsx","./src/react/ui/modals/makeoffermodal/store.ts","./src/react/ui/modals/makeoffermodal/__tests__/modal.test.tsx","./src/react/ui/modals/makeoffermodal/hooks/usegettokenapproval.tsx","./src/react/ui/modals/makeoffermodal/hooks/usemakeoffer.tsx","./src/react/ui/modals/makeoffermodal/hooks/usetransactionsteps.tsx","./src/react/ui/modals/sellmodal/modal.tsx","./src/react/ui/modals/sellmodal/index.tsx","./src/react/ui/modals/sellmodal/store.ts","./src/react/ui/modals/sellmodal/utils.ts","./src/react/ui/modals/sellmodal/__tests__/modal.test.tsx","./src/react/ui/modals/sellmodal/hooks/usegettokenapproval.tsx","./src/react/ui/modals/sellmodal/hooks/usesell.tsx","./src/react/ui/modals/sellmodal/hooks/usetransactionsteps.tsx","./src/react/ui/modals/successfulpurchasemodal/_store.ts","./src/react/ui/modals/successfulpurchasemodal/index.tsx","./src/react/ui/modals/successfulpurchasemodal/styles.css.ts","./src/react/ui/modals/successfulpurchasemodal/__tests__/modal.test.tsx","./src/react/ui/modals/transfermodal/_store.ts","./src/react/ui/modals/transfermodal/index.tsx","./src/react/ui/modals/transfermodal/messages.ts","./src/react/ui/modals/transfermodal/styles.css.ts","./src/react/ui/modals/transfermodal/_views/enterwalletaddress/index.tsx","./src/react/ui/modals/transfermodal/_views/enterwalletaddress/usehandletransfer.tsx","./src/react/ui/modals/transfermodal/_views/followwalletinstructions/index.tsx","./src/react/ui/modals/_internal/types.ts","./src/react/ui/modals/_internal/components/actionmodal/actionmodal.tsx","./src/react/ui/modals/_internal/components/actionmodal/errormodal.tsx","./src/react/ui/modals/_internal/components/actionmodal/loadingmodal.tsx","./src/react/ui/modals/_internal/components/actionmodal/index.ts","./src/react/ui/modals/_internal/components/actionmodal/store.ts","./src/react/ui/modals/_internal/components/actionmodal/styles.css.ts","./src/react/ui/modals/_internal/components/alertmessage/index.tsx","./src/react/ui/modals/_internal/components/alertmessage/styles.css.ts","./src/react/ui/modals/_internal/components/calendar/index.tsx","./src/react/ui/modals/_internal/components/calendarpopover/index.tsx","./src/react/ui/modals/_internal/components/calendarpopover/styles.css.ts","./src/react/ui/modals/_internal/components/currencyimage/index.tsx","./src/react/ui/modals/_internal/components/currencyoptionsselect/index.tsx","./src/react/ui/modals/_internal/components/currencyoptionsselect/__tests__/index.test.tsx","./src/react/ui/modals/_internal/components/expirationdateselect/index.tsx","./src/react/ui/modals/_internal/components/floorpricetext/index.tsx","./src/react/ui/modals/_internal/components/priceinput/index.tsx","./src/react/ui/modals/_internal/components/priceinput/styles.css.ts","./src/react/ui/modals/_internal/components/priceinput/types.ts","./src/react/ui/modals/_internal/components/priceinput/__tests__/index.test.tsx","./src/react/ui/modals/_internal/components/quantityinput/index.tsx","./src/react/ui/modals/_internal/components/quantityinput/styles.css.ts","./src/react/ui/modals/_internal/components/switchchainmodal/index.tsx","./src/react/ui/modals/_internal/components/switchchainmodal/store.ts","./src/react/ui/modals/_internal/components/switchchainmodal/styles.css.ts","./src/react/ui/modals/_internal/components/switchchainmodal/__tests__/switchchainmodal.test.tsx","./src/react/ui/modals/_internal/components/timeago/index.tsx","./src/react/ui/modals/_internal/components/tokenpreview/index.tsx","./src/react/ui/modals/_internal/components/tokenpreview/styles.css.ts","./src/react/ui/modals/_internal/components/transaction-footer/index.tsx","./src/react/ui/modals/_internal/components/transactiondetails/index.tsx","./src/react/ui/modals/_internal/components/transactionheader/index.tsx","./src/react/ui/modals/_internal/components/transactionpreview/consts.ts","./src/react/ui/modals/_internal/components/transactionpreview/index.tsx","./src/react/ui/modals/_internal/components/transactionpreview/usetransactionpreviewtitle.tsx","./src/react/ui/modals/_internal/components/transactionstatusmodal/index.tsx","./src/react/ui/modals/_internal/components/transactionstatusmodal/store.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/styles.css.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/__tests__/transactionstatusmodal.test.tsx","./src/react/ui/modals/_internal/components/transactionstatusmodal/__tests__/utils.test.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/hooks/usetransactionstatus.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/util/getformattedtype.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/util/getmessage.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/util/gettitle.ts","./src/react/ui/modals/_internal/components/waasfeeoptionsbox/index.tsx","./src/react/ui/modals/_internal/components/waasfeeoptionsbox/store.ts","./src/react/ui/modals/_internal/components/waasfeeoptionsbox/styles.css.ts","./src/react/ui/modals/_internal/components/waasfeeoptionsselect/waasfeeoptionsselect.tsx","./src/react/ui/modals/_internal/stores/accountmodal.ts","./src/react/ui/styles/index.ts","./src/react/ui/styles/modal.css.ts","./src/styles/index.ts","./src/types/api-types.ts","./src/types/builder-types.ts","./src/types/custom.d.ts","./src/types/index.ts","./src/types/messages.ts","./src/types/sdk-config.ts","./src/types/types.ts","./src/utils/address.ts","./src/utils/date.ts","./src/utils/get-public-rpc-client.ts","./src/utils/getmarketplacedetails.ts","./src/utils/index.ts","./src/utils/network.ts","./src/utils/price.ts","./src/utils/__tests__/address.test.ts","./src/utils/__tests__/date.test.ts","./src/utils/__tests__/get-public-rpc-client.test.ts","./src/utils/__tests__/getmarketplacedetails.test.ts","./src/utils/__tests__/price.test.ts","./src/utils/_internal/error/base.ts","./src/utils/_internal/error/config.ts","./src/utils/_internal/error/context.ts","./src/utils/_internal/error/transaction.ts","./src/utils/abi/index.ts","./src/utils/abi/marketplace/eip2981.ts","./src/utils/abi/marketplace/index.ts","./src/utils/abi/marketplace/sequence-marketplace-v1.ts","./src/utils/abi/marketplace/sequence-marketplace-v2.ts","./src/utils/abi/token/erc1155.ts","./src/utils/abi/token/erc20.ts","./src/utils/abi/token/erc721.ts","./src/utils/abi/token/index.ts","./tsup.config.ts"],"version":"5.7.3"}
|
|
1
|
+
{"root":["./src/consts.ts","./src/index.ts","./src/react/index.ts","./src/react/provider.tsx","./src/react/__tests__/provider.test.tsx","./src/react/_internal/consts.ts","./src/react/_internal/get-provider.ts","./src/react/_internal/index.ts","./src/react/_internal/logger.ts","./src/react/_internal/test-utils.tsx","./src/react/_internal/types.ts","./src/react/_internal/utils.ts","./src/react/_internal/api/get-query-client.ts","./src/react/_internal/api/index.ts","./src/react/_internal/api/marketplace-api.ts","./src/react/_internal/api/marketplace.gen.ts","./src/react/_internal/api/query-keys.ts","./src/react/_internal/api/services.ts","./src/react/_internal/api/zod-schema.ts","./src/react/_internal/api/__mocks__/indexer.msw.ts","./src/react/_internal/api/__mocks__/marketplace.msw.ts","./src/react/_internal/api/__mocks__/metadata.msw.ts","./src/react/_internal/databeat/index.ts","./src/react/_internal/databeat/types.ts","./src/react/_internal/test/setup.ts","./src/react/_internal/test/mocks/publicclient.ts","./src/react/_internal/test/mocks/wagmi.ts","./src/react/_internal/test/mocks/wallet.ts","./src/react/_internal/wagmi/create-config.ts","./src/react/_internal/wagmi/embedded.ts","./src/react/_internal/wagmi/index.ts","./src/react/_internal/wagmi/universal.ts","./src/react/_internal/wagmi/__tests__/create-config.test.ts","./src/react/_internal/wallet/usewallet.ts","./src/react/_internal/wallet/wallet.ts","./src/react/hooks/index.ts","./src/react/hooks/useautoselectfeeoption.tsx","./src/react/hooks/usebalanceofcollectible.tsx","./src/react/hooks/usecancelorder.tsx","./src/react/hooks/usecanceltransactionsteps.tsx","./src/react/hooks/usecheckoutoptions.tsx","./src/react/hooks/usecollectible.tsx","./src/react/hooks/usecollection.tsx","./src/react/hooks/usecollectionbalancedetails.tsx","./src/react/hooks/usecollectiondetails.tsx","./src/react/hooks/usecollectiondetailspolling.tsx","./src/react/hooks/usecompareprices.tsx","./src/react/hooks/useconfig.tsx","./src/react/hooks/useconvertpricetousd.tsx","./src/react/hooks/usecountlistingsforcollectible.tsx","./src/react/hooks/usecountofcollectables.tsx","./src/react/hooks/usecountoffersforcollectible.tsx","./src/react/hooks/usecurrencies.tsx","./src/react/hooks/usecurrency.tsx","./src/react/hooks/usecurrencybalance.tsx","./src/react/hooks/usefilters.tsx","./src/react/hooks/usefloororder.tsx","./src/react/hooks/usegeneratebuytransaction.tsx","./src/react/hooks/usegeneratecanceltransaction.tsx","./src/react/hooks/usegeneratelistingtransaction.tsx","./src/react/hooks/usegenerateoffertransaction.tsx","./src/react/hooks/usegenerateselltransaction.tsx","./src/react/hooks/usegetreceiptfromhash.tsx","./src/react/hooks/usehighestoffer.tsx","./src/react/hooks/uselistbalances.tsx","./src/react/hooks/uselistcollectibleactivities.tsx","./src/react/hooks/uselistcollectibles.tsx","./src/react/hooks/uselistcollectiblespaginated.tsx","./src/react/hooks/uselistcollectionactivities.tsx","./src/react/hooks/uselistcollections.tsx","./src/react/hooks/uselistlistingsforcollectible.tsx","./src/react/hooks/uselistoffersforcollectible.tsx","./src/react/hooks/uselowestlisting.tsx","./src/react/hooks/usemarketplaceconfig.tsx","./src/react/hooks/useroyaltypercentage.tsx","./src/react/hooks/usetransfertokens.tsx","./src/react/hooks/__tests__/useautoselectfeeoption.test.tsx","./src/react/hooks/__tests__/usebalanceofcollectible.test.tsx","./src/react/hooks/__tests__/usecancelorder.test.tsx","./src/react/hooks/__tests__/usecanceltransactionsteps.test.tsx","./src/react/hooks/__tests__/usecollectible.test.tsx","./src/react/hooks/__tests__/usecollection.test.tsx","./src/react/hooks/__tests__/usecollectionbalancedetails.test.tsx","./src/react/hooks/__tests__/usecollectiondetails.test.tsx","./src/react/hooks/__tests__/usecollectiondetailspolling.test.tsx","./src/react/hooks/__tests__/usecompareprices.test.tsx","./src/react/hooks/__tests__/useconvertpricetousd.test.tsx","./src/react/hooks/__tests__/usecountlistingsforcollectible.test.tsx","./src/react/hooks/__tests__/usecountofcollectables.test.tsx","./src/react/hooks/__tests__/usecountoffersforcollectible.test.tsx","./src/react/hooks/__tests__/usecurrencies.test.tsx","./src/react/hooks/__tests__/usecurrency.test.tsx","./src/react/hooks/__tests__/usecurrencybalance.test.tsx","./src/react/hooks/__tests__/usefilters.test.tsx","./src/react/hooks/__tests__/usefloororder.test.tsx","./src/react/hooks/__tests__/usegeneratebuytransaction.test.tsx","./src/react/hooks/__tests__/usegeneratecanceltransaction.test.tsx","./src/react/hooks/__tests__/usegeneratelistingtransaction.test.tsx","./src/react/hooks/__tests__/usegenerateoffertransaction.test.tsx","./src/react/hooks/__tests__/usegenerateselltransaction.test.tsx","./src/react/hooks/__tests__/usehighestoffer.test.tsx","./src/react/hooks/__tests__/uselistbalances.test.tsx","./src/react/hooks/__tests__/uselistcollectibleactivities.test.tsx","./src/react/hooks/__tests__/uselistcollectibles.test.tsx","./src/react/hooks/__tests__/uselistcollectiblespaginated.test.tsx","./src/react/hooks/__tests__/uselistcollectionactivities.test.tsx","./src/react/hooks/__tests__/uselistcollections.test.tsx","./src/react/hooks/__tests__/uselistlistingsforcollectible.test.tsx","./src/react/hooks/__tests__/uselistoffersforcollectible.test.tsx","./src/react/hooks/__tests__/uselowestlisting.test.tsx","./src/react/hooks/__tests__/usemarketplaceconfig.test.tsx","./src/react/hooks/__tests__/useroyaltypercentage.test.tsx","./src/react/hooks/options/marketplaceconfigoptions.ts","./src/react/hooks/options/__mocks__/marketplaceconfig.msw.ts","./src/react/hooks/options/__tests__/marketplaceconfigoptions.test.tsx","./src/react/ssr/create-ssr-client.ts","./src/react/ssr/index.ts","./src/react/ui/index.ts","./src/react/ui/components/_internals/action-button/actionbutton.tsx","./src/react/ui/components/_internals/action-button/store.ts","./src/react/ui/components/_internals/action-button/styles.css.ts","./src/react/ui/components/_internals/action-button/types.ts","./src/react/ui/components/_internals/action-button/components/actionbuttonbody.tsx","./src/react/ui/components/_internals/action-button/components/nonowneractions.tsx","./src/react/ui/components/_internals/action-button/components/owneractions.tsx","./src/react/ui/components/_internals/action-button/hooks/useactionbuttonlogic.ts","./src/react/ui/components/_internals/custom-network-image/customnetworkimage.tsx","./src/react/ui/components/_internals/custom-network-image/styles.css.ts","./src/react/ui/components/_internals/custom-select/customselect.tsx","./src/react/ui/components/_internals/custom-select/styles.css.ts","./src/react/ui/components/_internals/custom-select/__tests__/customselect.test.tsx","./src/react/ui/components/_internals/pill/pill.tsx","./src/react/ui/components/collectible-card/collectiblecard.tsx","./src/react/ui/components/collectible-card/footer.tsx","./src/react/ui/components/collectible-card/index.ts","./src/react/ui/components/collectible-card/styles.css.ts","./src/react/ui/components/marketplace-logos/index.ts","./src/react/ui/components/marketplace-logos/marketplace-logos.tsx","./src/react/ui/icons/arrowup.tsx","./src/react/ui/icons/bell.tsx","./src/react/ui/icons/calendaricon.tsx","./src/react/ui/icons/carticon.tsx","./src/react/ui/icons/diamondeye.tsx","./src/react/ui/icons/infoicon.tsx","./src/react/ui/icons/inventoryicon.tsx","./src/react/ui/icons/minusicon.tsx","./src/react/ui/icons/plusicon.tsx","./src/react/ui/icons/positivecircleicon.tsx","./src/react/ui/icons/index.ts","./src/react/ui/icons/styles.css.ts","./src/react/ui/modals/modal-provider.tsx","./src/react/ui/modals/buymodal/modal.tsx","./src/react/ui/modals/buymodal/index.tsx","./src/react/ui/modals/buymodal/store.ts","./src/react/ui/modals/buymodal/__tests__/modal.test.tsx","./src/react/ui/modals/buymodal/__tests__/store.test.ts","./src/react/ui/modals/buymodal/hooks/usebuycollectable.ts","./src/react/ui/modals/buymodal/hooks/usecheckoutoptions.ts","./src/react/ui/modals/buymodal/hooks/usefees.ts","./src/react/ui/modals/buymodal/hooks/useloaddata.ts","./src/react/ui/modals/buymodal/hooks/__tests__/usecheckoutoptions.test.tsx","./src/react/ui/modals/buymodal/hooks/__tests__/usefees.test.tsx","./src/react/ui/modals/buymodal/hooks/__tests__/useloaddata.test.tsx","./src/react/ui/modals/buymodal/modals/checkoutmodal.tsx","./src/react/ui/modals/buymodal/modals/modal1155.tsx","./src/react/ui/modals/buymodal/modals/__tests__/checkoutmodal.test.tsx","./src/react/ui/modals/buymodal/modals/__tests__/modal1155.test.tsx","./src/react/ui/modals/createlistingmodal/modal.tsx","./src/react/ui/modals/createlistingmodal/index.tsx","./src/react/ui/modals/createlistingmodal/store.ts","./src/react/ui/modals/createlistingmodal/__tests__/modal.test.tsx","./src/react/ui/modals/createlistingmodal/hooks/usecreatelisting.tsx","./src/react/ui/modals/createlistingmodal/hooks/usegettokenapproval.ts","./src/react/ui/modals/createlistingmodal/hooks/usetransactionsteps.tsx","./src/react/ui/modals/makeoffermodal/modal.tsx","./src/react/ui/modals/makeoffermodal/index.tsx","./src/react/ui/modals/makeoffermodal/store.ts","./src/react/ui/modals/makeoffermodal/__tests__/modal.test.tsx","./src/react/ui/modals/makeoffermodal/hooks/usegettokenapproval.tsx","./src/react/ui/modals/makeoffermodal/hooks/usemakeoffer.tsx","./src/react/ui/modals/makeoffermodal/hooks/usetransactionsteps.tsx","./src/react/ui/modals/sellmodal/modal.tsx","./src/react/ui/modals/sellmodal/index.tsx","./src/react/ui/modals/sellmodal/store.ts","./src/react/ui/modals/sellmodal/utils.ts","./src/react/ui/modals/sellmodal/__tests__/modal.test.tsx","./src/react/ui/modals/sellmodal/hooks/usegettokenapproval.tsx","./src/react/ui/modals/sellmodal/hooks/usesell.tsx","./src/react/ui/modals/sellmodal/hooks/usetransactionsteps.tsx","./src/react/ui/modals/successfulpurchasemodal/_store.ts","./src/react/ui/modals/successfulpurchasemodal/index.tsx","./src/react/ui/modals/successfulpurchasemodal/styles.css.ts","./src/react/ui/modals/successfulpurchasemodal/__tests__/modal.test.tsx","./src/react/ui/modals/transfermodal/_store.ts","./src/react/ui/modals/transfermodal/index.tsx","./src/react/ui/modals/transfermodal/messages.ts","./src/react/ui/modals/transfermodal/styles.css.ts","./src/react/ui/modals/transfermodal/_views/enterwalletaddress/index.tsx","./src/react/ui/modals/transfermodal/_views/enterwalletaddress/usehandletransfer.tsx","./src/react/ui/modals/transfermodal/_views/followwalletinstructions/index.tsx","./src/react/ui/modals/_internal/types.ts","./src/react/ui/modals/_internal/components/actionmodal/actionmodal.tsx","./src/react/ui/modals/_internal/components/actionmodal/errormodal.tsx","./src/react/ui/modals/_internal/components/actionmodal/loadingmodal.tsx","./src/react/ui/modals/_internal/components/actionmodal/index.ts","./src/react/ui/modals/_internal/components/actionmodal/store.ts","./src/react/ui/modals/_internal/components/actionmodal/styles.css.ts","./src/react/ui/modals/_internal/components/alertmessage/index.tsx","./src/react/ui/modals/_internal/components/alertmessage/styles.css.ts","./src/react/ui/modals/_internal/components/calendar/index.tsx","./src/react/ui/modals/_internal/components/calendarpopover/index.tsx","./src/react/ui/modals/_internal/components/calendarpopover/styles.css.ts","./src/react/ui/modals/_internal/components/currencyimage/index.tsx","./src/react/ui/modals/_internal/components/currencyoptionsselect/index.tsx","./src/react/ui/modals/_internal/components/currencyoptionsselect/__tests__/index.test.tsx","./src/react/ui/modals/_internal/components/expirationdateselect/index.tsx","./src/react/ui/modals/_internal/components/floorpricetext/index.tsx","./src/react/ui/modals/_internal/components/priceinput/index.tsx","./src/react/ui/modals/_internal/components/priceinput/styles.css.ts","./src/react/ui/modals/_internal/components/priceinput/types.ts","./src/react/ui/modals/_internal/components/priceinput/__tests__/index.test.tsx","./src/react/ui/modals/_internal/components/quantityinput/index.tsx","./src/react/ui/modals/_internal/components/quantityinput/styles.css.ts","./src/react/ui/modals/_internal/components/switchchainmodal/index.tsx","./src/react/ui/modals/_internal/components/switchchainmodal/store.ts","./src/react/ui/modals/_internal/components/switchchainmodal/styles.css.ts","./src/react/ui/modals/_internal/components/switchchainmodal/__tests__/switchchainmodal.test.tsx","./src/react/ui/modals/_internal/components/timeago/index.tsx","./src/react/ui/modals/_internal/components/tokenpreview/index.tsx","./src/react/ui/modals/_internal/components/tokenpreview/styles.css.ts","./src/react/ui/modals/_internal/components/transaction-footer/index.tsx","./src/react/ui/modals/_internal/components/transactiondetails/index.tsx","./src/react/ui/modals/_internal/components/transactionheader/index.tsx","./src/react/ui/modals/_internal/components/transactionpreview/consts.ts","./src/react/ui/modals/_internal/components/transactionpreview/index.tsx","./src/react/ui/modals/_internal/components/transactionpreview/usetransactionpreviewtitle.tsx","./src/react/ui/modals/_internal/components/transactionstatusmodal/index.tsx","./src/react/ui/modals/_internal/components/transactionstatusmodal/store.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/styles.css.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/__tests__/transactionstatusmodal.test.tsx","./src/react/ui/modals/_internal/components/transactionstatusmodal/__tests__/utils.test.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/hooks/usetransactionstatus.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/util/getformattedtype.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/util/getmessage.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/util/gettitle.ts","./src/react/ui/modals/_internal/components/waasfeeoptionsbox/index.tsx","./src/react/ui/modals/_internal/components/waasfeeoptionsbox/store.ts","./src/react/ui/modals/_internal/components/waasfeeoptionsbox/styles.css.ts","./src/react/ui/modals/_internal/components/waasfeeoptionsselect/waasfeeoptionsselect.tsx","./src/react/ui/modals/_internal/stores/accountmodal.ts","./src/react/ui/styles/index.ts","./src/react/ui/styles/modal.css.ts","./src/styles/index.ts","./src/types/api-types.ts","./src/types/builder-types.ts","./src/types/custom.d.ts","./src/types/index.ts","./src/types/messages.ts","./src/types/sdk-config.ts","./src/types/types.ts","./src/utils/address.ts","./src/utils/date.ts","./src/utils/get-public-rpc-client.ts","./src/utils/getmarketplacedetails.ts","./src/utils/index.ts","./src/utils/network.ts","./src/utils/price.ts","./src/utils/__tests__/address.test.ts","./src/utils/__tests__/date.test.ts","./src/utils/__tests__/get-public-rpc-client.test.ts","./src/utils/__tests__/getmarketplacedetails.test.ts","./src/utils/__tests__/price.test.ts","./src/utils/_internal/error/base.ts","./src/utils/_internal/error/config.ts","./src/utils/_internal/error/context.ts","./src/utils/_internal/error/transaction.ts","./src/utils/abi/index.ts","./src/utils/abi/marketplace/eip2981.ts","./src/utils/abi/marketplace/index.ts","./src/utils/abi/marketplace/sequence-marketplace-v1.ts","./src/utils/abi/marketplace/sequence-marketplace-v2.ts","./src/utils/abi/token/erc1155.ts","./src/utils/abi/token/erc20.ts","./src/utils/abi/token/erc721.ts","./src/utils/abi/token/index.ts","./tsup.config.ts"],"version":"5.7.3"}
|