@0xsequence/marketplace-sdk 0.0.1
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/README.md +8 -0
- package/dist/chunk-3TYUQEFM.js +115 -0
- package/dist/chunk-3TYUQEFM.js.map +1 -0
- package/dist/chunk-4ESPWOBV.js +13 -0
- package/dist/chunk-4ESPWOBV.js.map +1 -0
- package/dist/chunk-4PFMUVE4.js +78 -0
- package/dist/chunk-4PFMUVE4.js.map +1 -0
- package/dist/chunk-5WRI5ZAA.js +31 -0
- package/dist/chunk-5WRI5ZAA.js.map +1 -0
- package/dist/chunk-6S4FYXP6.js +43 -0
- package/dist/chunk-6S4FYXP6.js.map +1 -0
- package/dist/chunk-7OO74L2K.js +41 -0
- package/dist/chunk-7OO74L2K.js.map +1 -0
- package/dist/chunk-BBB3XUB4.js +213 -0
- package/dist/chunk-BBB3XUB4.js.map +1 -0
- package/dist/chunk-BCNFYVAL.js +1 -0
- package/dist/chunk-BCNFYVAL.js.map +1 -0
- package/dist/chunk-D7QQP6MS.js +2 -0
- package/dist/chunk-D7QQP6MS.js.map +1 -0
- package/dist/chunk-DBFOPEV6.js +23 -0
- package/dist/chunk-DBFOPEV6.js.map +1 -0
- package/dist/chunk-EDTC7UES.js +176 -0
- package/dist/chunk-EDTC7UES.js.map +1 -0
- package/dist/chunk-G3D572BT.js +249 -0
- package/dist/chunk-G3D572BT.js.map +1 -0
- package/dist/chunk-HGBEC3WX.js +1285 -0
- package/dist/chunk-HGBEC3WX.js.map +1 -0
- package/dist/chunk-MJ4YU7RW.js +2 -0
- package/dist/chunk-MJ4YU7RW.js.map +1 -0
- package/dist/chunk-NJ2GXOPW.js +2 -0
- package/dist/chunk-NJ2GXOPW.js.map +1 -0
- package/dist/chunk-O5JXKTWP.js +1029 -0
- package/dist/chunk-O5JXKTWP.js.map +1 -0
- package/dist/chunk-O642NH7U.js +15 -0
- package/dist/chunk-O642NH7U.js.map +1 -0
- package/dist/chunk-QOJXWHRZ.js +71 -0
- package/dist/chunk-QOJXWHRZ.js.map +1 -0
- package/dist/chunk-QVFMD6S2.js +21 -0
- package/dist/chunk-QVFMD6S2.js.map +1 -0
- package/dist/chunk-RNUHUVLC.js +214 -0
- package/dist/chunk-RNUHUVLC.js.map +1 -0
- package/dist/chunk-SM7V6ZWI.js +2740 -0
- package/dist/chunk-SM7V6ZWI.js.map +1 -0
- package/dist/chunk-STO74F2I.js +14 -0
- package/dist/chunk-STO74F2I.js.map +1 -0
- package/dist/chunk-TZGLKJRF.js +198 -0
- package/dist/chunk-TZGLKJRF.js.map +1 -0
- package/dist/chunk-UYRQ5MJQ.js +1027 -0
- package/dist/chunk-UYRQ5MJQ.js.map +1 -0
- package/dist/chunk-VPGWEMWL.js +162 -0
- package/dist/chunk-VPGWEMWL.js.map +1 -0
- package/dist/chunk-ZE2LNX65.js +394 -0
- package/dist/chunk-ZE2LNX65.js.map +1 -0
- package/dist/create-config-Dz0gCiQ0.d.ts +8 -0
- package/dist/get-query-client-D46hbjk6.d.ts +5 -0
- package/dist/index.css +232 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +76 -0
- package/dist/index.js.map +1 -0
- package/dist/marketplace-config-DZbtyrma.d.ts +57 -0
- package/dist/marketplace.gen-Ceofb9Cs.d.ts +904 -0
- package/dist/react/_internal/api/index.d.ts +51 -0
- package/dist/react/_internal/api/index.js +134 -0
- package/dist/react/_internal/api/index.js.map +1 -0
- package/dist/react/_internal/index.d.ts +22 -0
- package/dist/react/_internal/index.js +150 -0
- package/dist/react/_internal/index.js.map +1 -0
- package/dist/react/_internal/wagmi/index.d.ts +12 -0
- package/dist/react/_internal/wagmi/index.js +12 -0
- package/dist/react/_internal/wagmi/index.js.map +1 -0
- package/dist/react/hooks/index.d.ts +381 -0
- package/dist/react/hooks/index.js +82 -0
- package/dist/react/hooks/index.js.map +1 -0
- package/dist/react/index.css +233 -0
- package/dist/react/index.css.map +1 -0
- package/dist/react/index.d.ts +27 -0
- package/dist/react/index.js +113 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/ssr/index.d.ts +94 -0
- package/dist/react/ssr/index.js +351 -0
- package/dist/react/ssr/index.js.map +1 -0
- package/dist/react/ui/icons/index.css +25 -0
- package/dist/react/ui/icons/index.css.map +1 -0
- package/dist/react/ui/icons/index.d.ts +2 -0
- package/dist/react/ui/icons/index.js +12 -0
- package/dist/react/ui/icons/index.js.map +1 -0
- package/dist/react/ui/index.css +233 -0
- package/dist/react/ui/index.css.map +1 -0
- package/dist/react/ui/index.d.ts +112 -0
- package/dist/react/ui/index.js +34 -0
- package/dist/react/ui/index.js.map +1 -0
- package/dist/react/ui/modals/_internal/components/actionModal/index.css +44 -0
- package/dist/react/ui/modals/_internal/components/actionModal/index.css.map +1 -0
- package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +31 -0
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +39 -0
- package/dist/react/ui/modals/_internal/components/actionModal/index.js.map +1 -0
- package/dist/react/ui/styles/index.css +36 -0
- package/dist/react/ui/styles/index.css.map +1 -0
- package/dist/react/ui/styles/index.d.ts +5 -0
- package/dist/react/ui/styles/index.js +13 -0
- package/dist/react/ui/styles/index.js.map +1 -0
- package/dist/sdk-config-xWkdBdrL.d.ts +24 -0
- package/dist/services-BIwQ1C1c.d.ts +20 -0
- package/dist/styles/index.css +233 -0
- package/dist/styles/index.css.map +1 -0
- package/dist/styles/index.d.ts +58 -0
- package/dist/styles/index.js +5019 -0
- package/dist/styles/index.js.map +1 -0
- package/dist/styles.css-BVaTR5nO.d.ts +3 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.js +39 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types-BrAQ8-w4.d.ts +12 -0
- package/dist/utils/abi/abi/standard/index.d.ts +25 -0
- package/dist/utils/abi/abi/standard/index.js +8 -0
- package/dist/utils/abi/abi/standard/index.js.map +1 -0
- package/dist/utils/abi/abi/token/index.d.ts +1125 -0
- package/dist/utils/abi/abi/token/index.js +13 -0
- package/dist/utils/abi/abi/token/index.js.map +1 -0
- package/dist/utils/abi/clients/index.d.ts +27 -0
- package/dist/utils/abi/clients/index.js +13 -0
- package/dist/utils/abi/clients/index.js.map +1 -0
- package/dist/utils/index.d.ts +23 -0
- package/dist/utils/index.js +37 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +74 -0
- package/src/consts.ts +2 -0
- package/src/index.ts +3 -0
- package/src/react/_internal/api/get-query-client.ts +32 -0
- package/src/react/_internal/api/index.ts +5 -0
- package/src/react/_internal/api/marketplace-api.ts +31 -0
- package/src/react/_internal/api/marketplace.gen.ts +1911 -0
- package/src/react/_internal/api/query-keys.ts +61 -0
- package/src/react/_internal/api/services.ts +101 -0
- package/src/react/_internal/consts.ts +1 -0
- package/src/react/_internal/get-provider.ts +6 -0
- package/src/react/_internal/index.ts +5 -0
- package/src/react/_internal/types.ts +13 -0
- package/src/react/_internal/wagmi/create-config.ts +62 -0
- package/src/react/_internal/wagmi/embedded.ts +87 -0
- package/src/react/_internal/wagmi/index.ts +3 -0
- package/src/react/_internal/wagmi/universal.ts +82 -0
- package/src/react/hooks/index.ts +17 -0
- package/src/react/hooks/options/marketplaceConfigOptions.ts +62 -0
- package/src/react/hooks/useBalanceOfCollectible.tsx +51 -0
- package/src/react/hooks/useCollectible.tsx +47 -0
- package/src/react/hooks/useCollection.tsx +42 -0
- package/src/react/hooks/useCollectionCounts.tsx +61 -0
- package/src/react/hooks/useConfig.tsx +15 -0
- package/src/react/hooks/useCurrencies.tsx +76 -0
- package/src/react/hooks/useFilters.tsx +39 -0
- package/src/react/hooks/useFloorOrder.tsx +28 -0
- package/src/react/hooks/useGenerateListingTransaction.tsx +63 -0
- package/src/react/hooks/useGenerateOfferTransaction.tsx +60 -0
- package/src/react/hooks/useGenerateSellTransaction.tsx +43 -0
- package/src/react/hooks/useHighestOffer.tsx +46 -0
- package/src/react/hooks/useListBalances.tsx +56 -0
- package/src/react/hooks/useListCollectibles.tsx +54 -0
- package/src/react/hooks/useListOffersForCollectible.tsx +53 -0
- package/src/react/hooks/useLowestListing.tsx +47 -0
- package/src/react/hooks/useMarketplaceConfig.tsx +10 -0
- package/src/react/hooks/useRoyaltyPercentage.tsx +45 -0
- package/src/react/hooks/useTransferTokens.tsx +81 -0
- package/src/react/index.ts +5 -0
- package/src/react/provider.tsx +24 -0
- package/src/react/ssr/create-ssr-client.ts +31 -0
- package/src/react/ssr/index.ts +1 -0
- package/src/react/ui/icons/ArrowUp.tsx +29 -0
- package/src/react/ui/icons/CalendarIcon.tsx +29 -0
- package/src/react/ui/icons/InfoIcon.tsx +36 -0
- package/src/react/ui/icons/InventoryIcon.tsx +41 -0
- package/src/react/ui/icons/MinusIcon.tsx +31 -0
- package/src/react/ui/icons/PlusIcon.tsx +29 -0
- package/src/react/ui/icons/PositiveCircleIcon.tsx +35 -0
- package/src/react/ui/icons/index.ts +7 -0
- package/src/react/ui/icons/styles.css.ts +35 -0
- package/src/react/ui/index.ts +6 -0
- package/src/react/ui/modals/Account/index.tsx +29 -0
- package/src/react/ui/modals/CreateListingModal/_store.ts +326 -0
- package/src/react/ui/modals/CreateListingModal/_utils/getCreateListingTransactionTitleMessage.ts +30 -0
- package/src/react/ui/modals/CreateListingModal/index.tsx +146 -0
- package/src/react/ui/modals/MakeOfferModal/_store.ts +296 -0
- package/src/react/ui/modals/MakeOfferModal/_utils/getMakeOfferTransactionTitleMessage.ts +28 -0
- package/src/react/ui/modals/MakeOfferModal/index.tsx +157 -0
- package/src/react/ui/modals/SellModal/_store.ts +274 -0
- package/src/react/ui/modals/SellModal/_utils/getSellTransactionTitleMessage.ts +28 -0
- package/src/react/ui/modals/SellModal/index.tsx +126 -0
- package/src/react/ui/modals/SellModal/utils.ts +38 -0
- package/src/react/ui/modals/SuccessfulPurchaseModal/_store.ts +58 -0
- package/src/react/ui/modals/SuccessfulPurchaseModal/index.tsx +186 -0
- package/src/react/ui/modals/SuccessfulPurchaseModal/styles.css.ts +52 -0
- package/src/react/ui/modals/TransferModal/_store.ts +58 -0
- package/src/react/ui/modals/TransferModal/_utils/getTransferTransactionTitleMessage.ts +28 -0
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +102 -0
- package/src/react/ui/modals/TransferModal/_views/followWalletInstructions/index.tsx +130 -0
- package/src/react/ui/modals/TransferModal/index.tsx +92 -0
- package/src/react/ui/modals/TransferModal/messages.ts +14 -0
- package/src/react/ui/modals/TransferModal/styles.css.ts +20 -0
- package/src/react/ui/modals/_internal/components/actionModal/ActionModal.tsx +94 -0
- package/src/react/ui/modals/_internal/components/actionModal/index.ts +3 -0
- package/src/react/ui/modals/_internal/components/actionModal/store.ts +19 -0
- package/src/react/ui/modals/_internal/components/actionModal/styles.css.ts +15 -0
- package/src/react/ui/modals/_internal/components/alertMessage/index.tsx +21 -0
- package/src/react/ui/modals/_internal/components/alertMessage/styles.css.ts +22 -0
- package/src/react/ui/modals/_internal/components/calendar/index.tsx +59 -0
- package/src/react/ui/modals/_internal/components/calendarPopover/index.tsx +41 -0
- package/src/react/ui/modals/_internal/components/calendarPopover/styles.css.ts +16 -0
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +76 -0
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/styles.css.ts +33 -0
- package/src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx +127 -0
- package/src/react/ui/modals/_internal/components/expirationDateSelect/styles.css.ts +25 -0
- package/src/react/ui/modals/_internal/components/floorPriceText/index.tsx +54 -0
- package/src/react/ui/modals/_internal/components/priceInput/index.tsx +72 -0
- package/src/react/ui/modals/_internal/components/priceInput/styles.css.ts +23 -0
- package/src/react/ui/modals/_internal/components/priceInput/types.ts +4 -0
- package/src/react/ui/modals/_internal/components/quantityInput/index.tsx +168 -0
- package/src/react/ui/modals/_internal/components/quantityInput/styles.css.ts +30 -0
- package/src/react/ui/modals/_internal/components/switchChainModal/index.tsx +132 -0
- package/src/react/ui/modals/_internal/components/switchChainModal/store.ts +41 -0
- package/src/react/ui/modals/_internal/components/switchChainModal/styles.css.ts +37 -0
- package/src/react/ui/modals/_internal/components/timeAgo/index.tsx +32 -0
- package/src/react/ui/modals/_internal/components/tokenPreview/index.tsx +58 -0
- package/src/react/ui/modals/_internal/components/tokenPreview/styles.css.ts +11 -0
- package/src/react/ui/modals/_internal/components/transaction-footer/index.tsx +48 -0
- package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +80 -0
- package/src/react/ui/modals/_internal/components/transactionHeader/index.tsx +30 -0
- package/src/react/ui/modals/_internal/components/transactionPreview/consts.ts +27 -0
- package/src/react/ui/modals/_internal/components/transactionPreview/index.tsx +111 -0
- package/src/react/ui/modals/_internal/components/transactionPreview/useTransactionPreviewTitle.tsx +24 -0
- package/src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx +123 -0
- package/src/react/ui/modals/_internal/components/transactionStatusModal/store.ts +87 -0
- package/src/react/ui/modals/_internal/components/transactionStatusModal/styles.css.ts +15 -0
- package/src/react/ui/modals/_internal/stores/accountModal.ts +3 -0
- package/src/react/ui/modals/modal-provider.tsx +27 -0
- package/src/react/ui/styles/index.ts +1 -0
- package/src/react/ui/styles/modal.css.ts +73 -0
- package/src/styles/index.ts +18 -0
- package/src/types/api-types.ts +48 -0
- package/src/types/index.ts +4 -0
- package/src/types/marketplace-config.ts +63 -0
- package/src/types/messages.ts +43 -0
- package/src/types/sdk-config.ts +23 -0
- package/src/types/types.ts +6 -0
- package/src/utils/abi/abi/standard/EIP2981.ts +15 -0
- package/src/utils/abi/abi/standard/index.ts +1 -0
- package/src/utils/abi/abi/token/ERC1155.ts +324 -0
- package/src/utils/abi/abi/token/ERC20.ts +185 -0
- package/src/utils/abi/abi/token/ERC721.ts +506 -0
- package/src/utils/abi/abi/token/index.ts +3 -0
- package/src/utils/abi/clients/ERC1155.ts +82 -0
- package/src/utils/abi/clients/ERC20.ts +101 -0
- package/src/utils/abi/clients/ERC721.ts +97 -0
- package/src/utils/abi/clients/index.ts +3 -0
- package/src/utils/address.ts +26 -0
- package/src/utils/get-public-rpc-client.ts +32 -0
- package/src/utils/index.ts +6 -0
- package/src/utils/network.ts +5 -0
- package/src/utils/price.ts +21 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type ChainId, type QueryArg, collectableKeys } from '@internal';
|
|
2
|
+
import { queryOptions, useQuery } from '@tanstack/react-query';
|
|
3
|
+
import type { Hex } from 'viem';
|
|
4
|
+
import { getContract } from 'viem';
|
|
5
|
+
import { EIP2981_ABI } from '../../utils/abi/abi/standard/EIP2981';
|
|
6
|
+
import { getPublicRpcClient } from '../../utils/get-public-rpc-client';
|
|
7
|
+
|
|
8
|
+
type UseRoyaletyPercentageArgs = {
|
|
9
|
+
chainId: ChainId;
|
|
10
|
+
collectionAddress: string;
|
|
11
|
+
collectibleId: string;
|
|
12
|
+
} & QueryArg;
|
|
13
|
+
|
|
14
|
+
const fetchRoyaletyPercentage = async (args: UseRoyaletyPercentageArgs) => {
|
|
15
|
+
const publicClient = getPublicRpcClient(args.chainId);
|
|
16
|
+
|
|
17
|
+
const contract = getContract({
|
|
18
|
+
address: args.collectionAddress as Hex,
|
|
19
|
+
abi: EIP2981_ABI,
|
|
20
|
+
client: publicClient,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
const [_, royaltyPercentage] = await contract.read.royaltyInfo([
|
|
25
|
+
BigInt(args.collectibleId),
|
|
26
|
+
100n,
|
|
27
|
+
]);
|
|
28
|
+
|
|
29
|
+
return royaltyPercentage;
|
|
30
|
+
} catch {
|
|
31
|
+
//TODO: dont swallow errors
|
|
32
|
+
return 0n;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const royaletyPercentageOptions = (args: UseRoyaletyPercentageArgs) =>
|
|
37
|
+
queryOptions({
|
|
38
|
+
...args.query,
|
|
39
|
+
queryKey: [...collectableKeys.royaltyPercentage, args],
|
|
40
|
+
queryFn: () => fetchRoyaletyPercentage(args),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const useRoyaltyPercentage = (args: UseRoyaletyPercentageArgs) => {
|
|
44
|
+
return useQuery(royaletyPercentageOptions(args));
|
|
45
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { ContractType, ChainId } from '@internal';
|
|
2
|
+
import { ERC1155_ABI } from '../../utils';
|
|
3
|
+
import { type Abi, erc721Abi, type Address, type Hex } from 'viem';
|
|
4
|
+
import { useAccount, useWriteContract } from 'wagmi';
|
|
5
|
+
|
|
6
|
+
interface BaseTransferParams {
|
|
7
|
+
chainId: ChainId;
|
|
8
|
+
collectionAddress: Hex;
|
|
9
|
+
tokenId: string;
|
|
10
|
+
receiverAddress: Address;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface ERC721TransferParams extends BaseTransferParams {
|
|
14
|
+
contractType: ContractType.ERC721;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface ERC1155TransferParams extends BaseTransferParams {
|
|
18
|
+
contractType: ContractType.ERC1155;
|
|
19
|
+
quantity: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type TransferTokensParams = ERC721TransferParams | ERC1155TransferParams;
|
|
23
|
+
|
|
24
|
+
const prepareTransferConfig = (
|
|
25
|
+
params: TransferTokensParams,
|
|
26
|
+
accountAddress: Address,
|
|
27
|
+
) => {
|
|
28
|
+
if (params.contractType === 'ERC721') {
|
|
29
|
+
return {
|
|
30
|
+
abi: erc721Abi as Abi,
|
|
31
|
+
address: params.collectionAddress,
|
|
32
|
+
functionName: 'safeTransferFrom',
|
|
33
|
+
args: [
|
|
34
|
+
accountAddress,
|
|
35
|
+
params.receiverAddress,
|
|
36
|
+
BigInt(params.tokenId),
|
|
37
|
+
] as const,
|
|
38
|
+
} as const;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
abi: ERC1155_ABI as Abi,
|
|
43
|
+
address: params.collectionAddress,
|
|
44
|
+
functionName: 'safeTransferFrom',
|
|
45
|
+
args: [
|
|
46
|
+
accountAddress,
|
|
47
|
+
params.receiverAddress,
|
|
48
|
+
BigInt(params.tokenId),
|
|
49
|
+
params.quantity,
|
|
50
|
+
'0x', // data
|
|
51
|
+
] as const,
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const useTransferTokens = () => {
|
|
56
|
+
const { address: accountAddress } = useAccount();
|
|
57
|
+
const {
|
|
58
|
+
writeContractAsync,
|
|
59
|
+
data: hash,
|
|
60
|
+
isPending,
|
|
61
|
+
isError,
|
|
62
|
+
isSuccess,
|
|
63
|
+
} = useWriteContract();
|
|
64
|
+
|
|
65
|
+
const transferTokensAsync = async (params: TransferTokensParams) => {
|
|
66
|
+
if (!accountAddress) {
|
|
67
|
+
throw new Error('No wallet connected');
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const config = prepareTransferConfig(params, accountAddress);
|
|
71
|
+
return await writeContractAsync(config);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
transferTokensAsync,
|
|
76
|
+
hash,
|
|
77
|
+
transferring: isPending,
|
|
78
|
+
transferFailed: isError,
|
|
79
|
+
transferSuccess: isSuccess,
|
|
80
|
+
};
|
|
81
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { createContext } from 'react';
|
|
4
|
+
import '@0xsequence/design-system/styles.css';
|
|
5
|
+
import type { SdkConfig } from '@types';
|
|
6
|
+
import { PROVIDER_ID } from './_internal/get-provider';
|
|
7
|
+
|
|
8
|
+
export const MarketplaceSdkContext = createContext({} as SdkConfig);
|
|
9
|
+
|
|
10
|
+
export type MarketplaceSdkProviderProps = {
|
|
11
|
+
config: SdkConfig;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export function MarketplaceProvider({
|
|
16
|
+
config,
|
|
17
|
+
children,
|
|
18
|
+
}: MarketplaceSdkProviderProps) {
|
|
19
|
+
return (
|
|
20
|
+
<MarketplaceSdkContext.Provider value={config}>
|
|
21
|
+
<div id={PROVIDER_ID}>{children}</div>
|
|
22
|
+
</MarketplaceSdkContext.Provider>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type State, cookieToInitialState } from 'wagmi';
|
|
2
|
+
import type { SdkConfig } from '../../types/sdk-config';
|
|
3
|
+
import { getQueryClient } from '../_internal/api/get-query-client';
|
|
4
|
+
import { createWagmiConfig } from '../_internal/wagmi/create-config';
|
|
5
|
+
import { marketplaceConfigOptions } from '../hooks/options/marketplaceConfigOptions.ts';
|
|
6
|
+
|
|
7
|
+
type InitSSRClientArgs = {
|
|
8
|
+
cookie: string;
|
|
9
|
+
config: SdkConfig;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type InitialState = { wagmi?: State };
|
|
13
|
+
|
|
14
|
+
const marketplaceConfig = async (config: SdkConfig) => {
|
|
15
|
+
const queryClient = getQueryClient();
|
|
16
|
+
const configOptions = marketplaceConfigOptions(config);
|
|
17
|
+
return queryClient.fetchQuery(configOptions);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const initialState = async (args: InitSSRClientArgs): Promise<InitialState> => {
|
|
21
|
+
const marketConfig = await marketplaceConfig(args.config);
|
|
22
|
+
const wagmiConfig = createWagmiConfig(marketConfig, args.config, true);
|
|
23
|
+
return { wagmi: cookieToInitialState(wagmiConfig, args.cookie) };
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const createSSRClient = (args: InitSSRClientArgs) => {
|
|
27
|
+
const getMarketplaceConfig = async () => marketplaceConfig(args.config);
|
|
28
|
+
const getInitialState = async () => initialState(args);
|
|
29
|
+
const config = args.config;
|
|
30
|
+
return { getInitialState, getMarketplaceConfig, config };
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './create-ssr-client';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { iconVariants } from './styles.css';
|
|
2
|
+
import { Box, type IconProps } from '@0xsequence/design-system';
|
|
3
|
+
|
|
4
|
+
const Svg = () => (
|
|
5
|
+
<svg
|
|
6
|
+
width="12"
|
|
7
|
+
height="12"
|
|
8
|
+
viewBox="0 0 12 12"
|
|
9
|
+
fill="none"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
d="M8.65039 6.03638L9.28679 5.39999L5.96859 2.08179L2.65039 5.39999L3.28679 6.03638L5.51859 3.80458V9.91822H6.41859V3.80458L8.65039 6.03638Z"
|
|
14
|
+
fill="#D1D1D1"
|
|
15
|
+
/>
|
|
16
|
+
</svg>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const SvgArrowUpIcon = ({ size = 'sm', ...props }: IconProps) => (
|
|
20
|
+
<Box
|
|
21
|
+
as={Svg}
|
|
22
|
+
className={iconVariants({
|
|
23
|
+
size,
|
|
24
|
+
})}
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export default SvgArrowUpIcon;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Box, type IconProps } from '@0xsequence/design-system';
|
|
2
|
+
import { iconVariants } from './styles.css';
|
|
3
|
+
|
|
4
|
+
const Svg = () => (
|
|
5
|
+
<svg
|
|
6
|
+
width="20"
|
|
7
|
+
height="20"
|
|
8
|
+
viewBox="0 0 20 20"
|
|
9
|
+
fill="none"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
d="M4.57634 17.5C3.73146 17.5 3.08946 17.2816 2.65034 16.8449C2.21678 16.4081 2 15.7586 2 14.8965V5.10352C2 4.24135 2.21678 3.59189 2.65034 3.15513C3.08946 2.71838 3.73146 2.5 4.57634 2.5H15.4237C16.2741 2.5 16.9161 2.72121 17.3497 3.16364C17.7832 3.6004 18 4.24702 18 5.10352V14.8965C18 15.753 17.7832 16.3996 17.3497 16.8364C16.9161 17.2788 16.2741 17.5 15.4237 17.5H4.57634ZM4.55133 15.9515H15.4403C15.7738 15.9515 16.0295 15.8636 16.2074 15.6877C16.3908 15.5062 16.4825 15.2396 16.4825 14.888V7.44328C16.4825 7.08593 16.3908 6.81934 16.2074 6.64351C16.0295 6.46767 15.7738 6.37975 15.4403 6.37975H4.55133C4.21782 6.37975 3.96213 6.46767 3.78426 6.64351C3.61195 6.81934 3.52579 7.08593 3.52579 7.44328V14.888C3.52579 15.2396 3.61195 15.5062 3.78426 15.6877C3.96213 15.8636 4.21782 15.9515 4.55133 15.9515ZM8.48671 9.17896C8.34775 9.17896 8.25048 9.15343 8.19489 9.10238C8.13931 9.05133 8.11152 8.95207 8.11152 8.80459V8.33664C8.11152 8.19484 8.13931 8.09841 8.19489 8.04736C8.25048 7.99064 8.34775 7.96228 8.48671 7.96228H8.94528C9.0898 7.96228 9.18708 7.99064 9.2371 8.04736C9.29269 8.09841 9.32048 8.19484 9.32048 8.33664V8.80459C9.32048 8.95207 9.29269 9.05133 9.2371 9.10238C9.18708 9.15343 9.0898 9.17896 8.94528 9.17896H8.48671ZM11.0714 9.17896C10.9269 9.17896 10.8268 9.15343 10.7712 9.10238C10.7212 9.05133 10.6962 8.95207 10.6962 8.80459V8.33664C10.6962 8.19484 10.7212 8.09841 10.7712 8.04736C10.8268 7.99064 10.9269 7.96228 11.0714 7.96228H11.5383C11.6773 7.96228 11.7745 7.99064 11.8301 8.04736C11.8857 8.09841 11.9135 8.19484 11.9135 8.33664V8.80459C11.9135 8.95207 11.8857 9.05133 11.8301 9.10238C11.7745 9.15343 11.6773 9.17896 11.5383 9.17896H11.0714ZM13.6477 9.17896C13.5088 9.17896 13.4115 9.15343 13.3559 9.10238C13.3003 9.05133 13.2725 8.95207 13.2725 8.80459V8.33664C13.2725 8.19484 13.3003 8.09841 13.3559 8.04736C13.4115 7.99064 13.5088 7.96228 13.6477 7.96228H14.1146C14.2592 7.96228 14.3564 7.99064 14.4065 8.04736C14.462 8.09841 14.4898 8.19484 14.4898 8.33664V8.80459C14.4898 8.95207 14.462 9.05133 14.4065 9.10238C14.3564 9.15343 14.2592 9.17896 14.1146 9.17896H13.6477ZM5.90203 11.7825C5.75751 11.7825 5.65746 11.7541 5.60188 11.6974C5.55185 11.6407 5.52684 11.5442 5.52684 11.4081V10.9317C5.52684 10.7842 5.55185 10.6849 5.60188 10.6339C5.65746 10.5828 5.75751 10.5573 5.90203 10.5573H6.36894C6.5079 10.5573 6.60518 10.5828 6.66076 10.6339C6.71635 10.6849 6.74414 10.7842 6.74414 10.9317V11.4081C6.74414 11.5442 6.71635 11.6407 6.66076 11.6974C6.60518 11.7541 6.5079 11.7825 6.36894 11.7825H5.90203ZM8.48671 11.7825C8.34775 11.7825 8.25048 11.7541 8.19489 11.6974C8.13931 11.6407 8.11152 11.5442 8.11152 11.4081V10.9317C8.11152 10.7842 8.13931 10.6849 8.19489 10.6339C8.25048 10.5828 8.34775 10.5573 8.48671 10.5573H8.94528C9.0898 10.5573 9.18708 10.5828 9.2371 10.6339C9.29269 10.6849 9.32048 10.7842 9.32048 10.9317V11.4081C9.32048 11.5442 9.29269 11.6407 9.2371 11.6974C9.18708 11.7541 9.0898 11.7825 8.94528 11.7825H8.48671ZM11.0714 11.7825C10.9269 11.7825 10.8268 11.7541 10.7712 11.6974C10.7212 11.6407 10.6962 11.5442 10.6962 11.4081V10.9317C10.6962 10.7842 10.7212 10.6849 10.7712 10.6339C10.8268 10.5828 10.9269 10.5573 11.0714 10.5573H11.5383C11.6773 10.5573 11.7745 10.5828 11.8301 10.6339C11.8857 10.6849 11.9135 10.7842 11.9135 10.9317V11.4081C11.9135 11.5442 11.8857 11.6407 11.8301 11.6974C11.7745 11.7541 11.6773 11.7825 11.5383 11.7825H11.0714ZM13.6477 11.7825C13.5088 11.7825 13.4115 11.7541 13.3559 11.6974C13.3003 11.6407 13.2725 11.5442 13.2725 11.4081V10.9317C13.2725 10.7842 13.3003 10.6849 13.3559 10.6339C13.4115 10.5828 13.5088 10.5573 13.6477 10.5573H14.1146C14.2592 10.5573 14.3564 10.5828 14.4065 10.6339C14.462 10.6849 14.4898 10.7842 14.4898 10.9317V11.4081C14.4898 11.5442 14.462 11.6407 14.4065 11.6974C14.3564 11.7541 14.2592 11.7825 14.1146 11.7825H13.6477ZM5.90203 14.369C5.75751 14.369 5.65746 14.3434 5.60188 14.2924C5.55185 14.2414 5.52684 14.1421 5.52684 13.9946V13.5267C5.52684 13.3849 5.55185 13.2884 5.60188 13.2374C5.65746 13.1807 5.75751 13.1523 5.90203 13.1523H6.36894C6.5079 13.1523 6.60518 13.1807 6.66076 13.2374C6.71635 13.2884 6.74414 13.3849 6.74414 13.5267V13.9946C6.74414 14.1421 6.71635 14.2414 6.66076 14.2924C6.60518 14.3434 6.5079 14.369 6.36894 14.369H5.90203ZM8.48671 14.369C8.34775 14.369 8.25048 14.3434 8.19489 14.2924C8.13931 14.2414 8.11152 14.1421 8.11152 13.9946V13.5267C8.11152 13.3849 8.13931 13.2884 8.19489 13.2374C8.25048 13.1807 8.34775 13.1523 8.48671 13.1523H8.94528C9.0898 13.1523 9.18708 13.1807 9.2371 13.2374C9.29269 13.2884 9.32048 13.3849 9.32048 13.5267V13.9946C9.32048 14.1421 9.29269 14.2414 9.2371 14.2924C9.18708 14.3434 9.0898 14.369 8.94528 14.369H8.48671ZM11.0714 14.369C10.9269 14.369 10.8268 14.3434 10.7712 14.2924C10.7212 14.2414 10.6962 14.1421 10.6962 13.9946V13.5267C10.6962 13.3849 10.7212 13.2884 10.7712 13.2374C10.8268 13.1807 10.9269 13.1523 11.0714 13.1523H11.5383C11.6773 13.1523 11.7745 13.1807 11.8301 13.2374C11.8857 13.2884 11.9135 13.3849 11.9135 13.5267V13.9946C11.9135 14.1421 11.8857 14.2414 11.8301 14.2924C11.7745 14.3434 11.6773 14.369 11.5383 14.369H11.0714Z"
|
|
14
|
+
fill="white"
|
|
15
|
+
/>
|
|
16
|
+
</svg>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const SvgCalendarIcon = ({ size = 'sm', ...props }: IconProps) => (
|
|
20
|
+
<Box
|
|
21
|
+
as={Svg}
|
|
22
|
+
className={iconVariants({
|
|
23
|
+
size,
|
|
24
|
+
})}
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export default SvgCalendarIcon;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Box, type IconProps } from '@0xsequence/design-system';
|
|
2
|
+
import { iconVariants } from './styles.css';
|
|
3
|
+
|
|
4
|
+
const Svg = () => (
|
|
5
|
+
<svg
|
|
6
|
+
width="20"
|
|
7
|
+
height="20"
|
|
8
|
+
viewBox="0 0 20 20"
|
|
9
|
+
fill="none"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
>
|
|
12
|
+
<path d="M10.75 8.75V13.75H9.25V8.75H10.75Z" fill="white" />
|
|
13
|
+
<path
|
|
14
|
+
d="M9.37508 7.47656C9.55997 7.65885 9.78263 7.75 10.043 7.75C10.2097 7.75 10.3634 7.70833 10.504 7.625C10.6446 7.53906 10.7579 7.42578 10.8438 7.28516C10.9324 7.14193 10.9779 6.98438 10.9805 6.8125C10.9779 6.55729 10.8829 6.33854 10.6954 6.15625C10.5079 5.97396 10.2904 5.88281 10.043 5.88281C9.78263 5.88281 9.55997 5.97396 9.37508 6.15625C9.19279 6.33854 9.10294 6.55729 9.10555 6.8125C9.10294 7.07031 9.19279 7.29167 9.37508 7.47656Z"
|
|
15
|
+
fill="white"
|
|
16
|
+
/>
|
|
17
|
+
<path
|
|
18
|
+
fillRule="evenodd"
|
|
19
|
+
clipRule="evenodd"
|
|
20
|
+
d="M10 18C14.4183 18 18 14.4183 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 14.4183 5.58172 18 10 18ZM10 16.5C13.5899 16.5 16.5 13.5899 16.5 10C16.5 6.41015 13.5899 3.5 10 3.5C6.41015 3.5 3.5 6.41015 3.5 10C3.5 13.5899 6.41015 16.5 10 16.5Z"
|
|
21
|
+
fill="white"
|
|
22
|
+
/>
|
|
23
|
+
</svg>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const SvgInfoIcon = ({ size = 'sm', ...props }: IconProps) => (
|
|
27
|
+
<Box
|
|
28
|
+
as={Svg}
|
|
29
|
+
className={iconVariants({
|
|
30
|
+
size,
|
|
31
|
+
})}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export default SvgInfoIcon;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Box, type IconProps } from '@0xsequence/design-system';
|
|
2
|
+
import { iconVariants } from './styles.css';
|
|
3
|
+
|
|
4
|
+
const Svg = () => (
|
|
5
|
+
<svg
|
|
6
|
+
width="20"
|
|
7
|
+
height="20"
|
|
8
|
+
viewBox="0 0 20 20"
|
|
9
|
+
fill="none"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
d="M2 4C2 2.89543 2.85961 2 3.92 2H6.48C7.54039 2 8.4 2.89543 8.4 4V6.66667C8.4 7.77124 7.54039 8.66667 6.48 8.66667H3.92C2.85961 8.66667 2 7.77124 2 6.66667V4Z"
|
|
14
|
+
fill="white"
|
|
15
|
+
/>
|
|
16
|
+
<path
|
|
17
|
+
d="M11.6 4C11.6 2.89543 12.4596 2 13.52 2H16.08C17.1404 2 18 2.89543 18 4V6.66667C18 7.77124 17.1404 8.66667 16.08 8.66667H13.52C12.4596 8.66667 11.6 7.77124 11.6 6.66667V4Z"
|
|
18
|
+
fill="white"
|
|
19
|
+
/>
|
|
20
|
+
<path
|
|
21
|
+
d="M2 13.3333C2 12.2288 2.85961 11.3333 3.92 11.3333H6.48C7.54039 11.3333 8.4 12.2288 8.4 13.3333V16C8.4 17.1046 7.54039 18 6.48 18H3.92C2.85961 18 2 17.1046 2 16V13.3333Z"
|
|
22
|
+
fill="white"
|
|
23
|
+
/>
|
|
24
|
+
<path
|
|
25
|
+
d="M11.6 13.3333C11.6 12.2288 12.4596 11.3333 13.52 11.3333H16.08C17.1404 11.3333 18 12.2288 18 13.3333V16C18 17.1046 17.1404 18 16.08 18H13.52C12.4596 18 11.6 17.1046 11.6 16V13.3333Z"
|
|
26
|
+
fill="white"
|
|
27
|
+
/>
|
|
28
|
+
</svg>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const SvgInventoryIcon = ({ size = 'sm', ...props }: IconProps) => (
|
|
32
|
+
<Box
|
|
33
|
+
as={Svg}
|
|
34
|
+
className={iconVariants({
|
|
35
|
+
size,
|
|
36
|
+
})}
|
|
37
|
+
{...props}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export default SvgInventoryIcon;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Box, type IconProps } from '@0xsequence/design-system';
|
|
2
|
+
import { iconVariants } from './styles.css';
|
|
3
|
+
|
|
4
|
+
const Svg = () => (
|
|
5
|
+
<svg
|
|
6
|
+
width="16"
|
|
7
|
+
height="16"
|
|
8
|
+
viewBox="0 0 16 16"
|
|
9
|
+
fill="none"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
fillRule="evenodd"
|
|
14
|
+
clipRule="evenodd"
|
|
15
|
+
d="M13.2303 8.60039L3.4375 8.60039L3.4375 7.40039L13.2303 7.40039V8.60039Z"
|
|
16
|
+
fill="white"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const SvgMinusIcon = ({ size = 'sm', ...props }: IconProps) => (
|
|
22
|
+
<Box
|
|
23
|
+
as={Svg}
|
|
24
|
+
className={iconVariants({
|
|
25
|
+
size,
|
|
26
|
+
})}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
export default SvgMinusIcon;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Box, type IconProps } from '@0xsequence/design-system';
|
|
2
|
+
import { iconVariants } from './styles.css';
|
|
3
|
+
|
|
4
|
+
const Svg = () => (
|
|
5
|
+
<svg
|
|
6
|
+
width="16"
|
|
7
|
+
height="16"
|
|
8
|
+
viewBox="0 0 16 16"
|
|
9
|
+
fill="none"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
d="M8.65529 7.45725V2.40039H7.45529V7.45724H2.39844V8.65725H7.45529V13.7141H8.65529V8.65725H13.7121V7.45725H8.65529Z"
|
|
14
|
+
fill="white"
|
|
15
|
+
/>
|
|
16
|
+
</svg>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const SvgPlusIcon = ({ size = 'sm', ...props }: IconProps) => (
|
|
20
|
+
<Box
|
|
21
|
+
as={Svg}
|
|
22
|
+
className={iconVariants({
|
|
23
|
+
size,
|
|
24
|
+
})}
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export default SvgPlusIcon;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Box, type IconProps } from '@0xsequence/design-system';
|
|
2
|
+
import { iconVariants } from './styles.css';
|
|
3
|
+
|
|
4
|
+
const Svg = () => (
|
|
5
|
+
<svg
|
|
6
|
+
width="24"
|
|
7
|
+
height="24"
|
|
8
|
+
viewBox="0 0 24 24"
|
|
9
|
+
fill="none"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
>
|
|
12
|
+
<path
|
|
13
|
+
d="M21.6004 11.9999C21.6004 17.3018 17.3023 21.5999 12.0004 21.5999C6.69846 21.5999 2.40039 17.3018 2.40039 11.9999C2.40039 6.69797 6.69846 2.3999 12.0004 2.3999C17.3023 2.3999 21.6004 6.69797 21.6004 11.9999Z"
|
|
14
|
+
fill="#14A554"
|
|
15
|
+
/>
|
|
16
|
+
<path
|
|
17
|
+
fillRule="evenodd"
|
|
18
|
+
clipRule="evenodd"
|
|
19
|
+
d="M16.5798 7.79868L10.8701 16.7999L7.20039 12.6764L8.03544 11.9332L10.7199 14.9497L15.6359 7.1999L16.5798 7.79868Z"
|
|
20
|
+
fill="white"
|
|
21
|
+
/>
|
|
22
|
+
</svg>
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const SvgPositiveCircleIcon = ({ size = 'sm', ...props }: IconProps) => (
|
|
26
|
+
<Box
|
|
27
|
+
as={Svg}
|
|
28
|
+
className={iconVariants({
|
|
29
|
+
size,
|
|
30
|
+
})}
|
|
31
|
+
{...props}
|
|
32
|
+
/>
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
export default SvgPositiveCircleIcon;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { vars } from '@0xsequence/design-system';
|
|
2
|
+
import { type RecipeVariants, recipe } from '@vanilla-extract/recipes';
|
|
3
|
+
|
|
4
|
+
export const iconVariants = recipe({
|
|
5
|
+
base: {
|
|
6
|
+
flexShrink: 0,
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
variants: {
|
|
10
|
+
size: {
|
|
11
|
+
xs: {
|
|
12
|
+
height: vars.lineHeights[4],
|
|
13
|
+
width: vars.lineHeights[4],
|
|
14
|
+
},
|
|
15
|
+
sm: {
|
|
16
|
+
height: vars.lineHeights[5],
|
|
17
|
+
width: vars.lineHeights[5],
|
|
18
|
+
},
|
|
19
|
+
md: {
|
|
20
|
+
height: vars.lineHeights[6],
|
|
21
|
+
width: vars.lineHeights[6],
|
|
22
|
+
},
|
|
23
|
+
lg: {
|
|
24
|
+
height: vars.lineHeights[7],
|
|
25
|
+
width: vars.lineHeights[7],
|
|
26
|
+
},
|
|
27
|
+
xl: {
|
|
28
|
+
height: vars.lineHeights[9],
|
|
29
|
+
width: vars.lineHeights[9],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export type IconVariants = RecipeVariants<typeof iconVariants>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './modals/modal-provider';
|
|
2
|
+
export { useCreateListingModal } from './modals/CreateListingModal';
|
|
3
|
+
export { useMakeOfferModal } from './modals/MakeOfferModal';
|
|
4
|
+
export { useSuccessfulPurchaseModal } from './modals/SuccessfulPurchaseModal';
|
|
5
|
+
export { useTransferModal } from './modals/TransferModal';
|
|
6
|
+
export { useSellModal } from './modals/SellModal';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Box, Button, Modal, Text } from '@0xsequence/design-system';
|
|
2
|
+
import { observable } from '@legendapp/state';
|
|
3
|
+
import { observer } from '@legendapp/state/react';
|
|
4
|
+
import { useAccount } from 'wagmi';
|
|
5
|
+
|
|
6
|
+
const accountModalOpen$ = observable(false);
|
|
7
|
+
|
|
8
|
+
export const useAccountModal = () => {
|
|
9
|
+
return {
|
|
10
|
+
show: () => accountModalOpen$.set(true),
|
|
11
|
+
hide: () => accountModalOpen$.set(false),
|
|
12
|
+
toggle: () => accountModalOpen$.toggle(),
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const AccountModal = observer(function AccountModal() {
|
|
17
|
+
const { address } = useAccount();
|
|
18
|
+
return (
|
|
19
|
+
accountModalOpen$.get() && (
|
|
20
|
+
<Modal>
|
|
21
|
+
<Box>
|
|
22
|
+
<Text>Wallet address</Text>
|
|
23
|
+
<Text>{address}</Text>
|
|
24
|
+
</Box>
|
|
25
|
+
<Button label="Sign out" />
|
|
26
|
+
</Modal>
|
|
27
|
+
)
|
|
28
|
+
);
|
|
29
|
+
});
|