@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.
Files changed (258) hide show
  1. package/README.md +8 -0
  2. package/dist/chunk-3TYUQEFM.js +115 -0
  3. package/dist/chunk-3TYUQEFM.js.map +1 -0
  4. package/dist/chunk-4ESPWOBV.js +13 -0
  5. package/dist/chunk-4ESPWOBV.js.map +1 -0
  6. package/dist/chunk-4PFMUVE4.js +78 -0
  7. package/dist/chunk-4PFMUVE4.js.map +1 -0
  8. package/dist/chunk-5WRI5ZAA.js +31 -0
  9. package/dist/chunk-5WRI5ZAA.js.map +1 -0
  10. package/dist/chunk-6S4FYXP6.js +43 -0
  11. package/dist/chunk-6S4FYXP6.js.map +1 -0
  12. package/dist/chunk-7OO74L2K.js +41 -0
  13. package/dist/chunk-7OO74L2K.js.map +1 -0
  14. package/dist/chunk-BBB3XUB4.js +213 -0
  15. package/dist/chunk-BBB3XUB4.js.map +1 -0
  16. package/dist/chunk-BCNFYVAL.js +1 -0
  17. package/dist/chunk-BCNFYVAL.js.map +1 -0
  18. package/dist/chunk-D7QQP6MS.js +2 -0
  19. package/dist/chunk-D7QQP6MS.js.map +1 -0
  20. package/dist/chunk-DBFOPEV6.js +23 -0
  21. package/dist/chunk-DBFOPEV6.js.map +1 -0
  22. package/dist/chunk-EDTC7UES.js +176 -0
  23. package/dist/chunk-EDTC7UES.js.map +1 -0
  24. package/dist/chunk-G3D572BT.js +249 -0
  25. package/dist/chunk-G3D572BT.js.map +1 -0
  26. package/dist/chunk-HGBEC3WX.js +1285 -0
  27. package/dist/chunk-HGBEC3WX.js.map +1 -0
  28. package/dist/chunk-MJ4YU7RW.js +2 -0
  29. package/dist/chunk-MJ4YU7RW.js.map +1 -0
  30. package/dist/chunk-NJ2GXOPW.js +2 -0
  31. package/dist/chunk-NJ2GXOPW.js.map +1 -0
  32. package/dist/chunk-O5JXKTWP.js +1029 -0
  33. package/dist/chunk-O5JXKTWP.js.map +1 -0
  34. package/dist/chunk-O642NH7U.js +15 -0
  35. package/dist/chunk-O642NH7U.js.map +1 -0
  36. package/dist/chunk-QOJXWHRZ.js +71 -0
  37. package/dist/chunk-QOJXWHRZ.js.map +1 -0
  38. package/dist/chunk-QVFMD6S2.js +21 -0
  39. package/dist/chunk-QVFMD6S2.js.map +1 -0
  40. package/dist/chunk-RNUHUVLC.js +214 -0
  41. package/dist/chunk-RNUHUVLC.js.map +1 -0
  42. package/dist/chunk-SM7V6ZWI.js +2740 -0
  43. package/dist/chunk-SM7V6ZWI.js.map +1 -0
  44. package/dist/chunk-STO74F2I.js +14 -0
  45. package/dist/chunk-STO74F2I.js.map +1 -0
  46. package/dist/chunk-TZGLKJRF.js +198 -0
  47. package/dist/chunk-TZGLKJRF.js.map +1 -0
  48. package/dist/chunk-UYRQ5MJQ.js +1027 -0
  49. package/dist/chunk-UYRQ5MJQ.js.map +1 -0
  50. package/dist/chunk-VPGWEMWL.js +162 -0
  51. package/dist/chunk-VPGWEMWL.js.map +1 -0
  52. package/dist/chunk-ZE2LNX65.js +394 -0
  53. package/dist/chunk-ZE2LNX65.js.map +1 -0
  54. package/dist/create-config-Dz0gCiQ0.d.ts +8 -0
  55. package/dist/get-query-client-D46hbjk6.d.ts +5 -0
  56. package/dist/index.css +232 -0
  57. package/dist/index.d.ts +16 -0
  58. package/dist/index.js +76 -0
  59. package/dist/index.js.map +1 -0
  60. package/dist/marketplace-config-DZbtyrma.d.ts +57 -0
  61. package/dist/marketplace.gen-Ceofb9Cs.d.ts +904 -0
  62. package/dist/react/_internal/api/index.d.ts +51 -0
  63. package/dist/react/_internal/api/index.js +134 -0
  64. package/dist/react/_internal/api/index.js.map +1 -0
  65. package/dist/react/_internal/index.d.ts +22 -0
  66. package/dist/react/_internal/index.js +150 -0
  67. package/dist/react/_internal/index.js.map +1 -0
  68. package/dist/react/_internal/wagmi/index.d.ts +12 -0
  69. package/dist/react/_internal/wagmi/index.js +12 -0
  70. package/dist/react/_internal/wagmi/index.js.map +1 -0
  71. package/dist/react/hooks/index.d.ts +381 -0
  72. package/dist/react/hooks/index.js +82 -0
  73. package/dist/react/hooks/index.js.map +1 -0
  74. package/dist/react/index.css +233 -0
  75. package/dist/react/index.css.map +1 -0
  76. package/dist/react/index.d.ts +27 -0
  77. package/dist/react/index.js +113 -0
  78. package/dist/react/index.js.map +1 -0
  79. package/dist/react/ssr/index.d.ts +94 -0
  80. package/dist/react/ssr/index.js +351 -0
  81. package/dist/react/ssr/index.js.map +1 -0
  82. package/dist/react/ui/icons/index.css +25 -0
  83. package/dist/react/ui/icons/index.css.map +1 -0
  84. package/dist/react/ui/icons/index.d.ts +2 -0
  85. package/dist/react/ui/icons/index.js +12 -0
  86. package/dist/react/ui/icons/index.js.map +1 -0
  87. package/dist/react/ui/index.css +233 -0
  88. package/dist/react/ui/index.css.map +1 -0
  89. package/dist/react/ui/index.d.ts +112 -0
  90. package/dist/react/ui/index.js +34 -0
  91. package/dist/react/ui/index.js.map +1 -0
  92. package/dist/react/ui/modals/_internal/components/actionModal/index.css +44 -0
  93. package/dist/react/ui/modals/_internal/components/actionModal/index.css.map +1 -0
  94. package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +31 -0
  95. package/dist/react/ui/modals/_internal/components/actionModal/index.js +39 -0
  96. package/dist/react/ui/modals/_internal/components/actionModal/index.js.map +1 -0
  97. package/dist/react/ui/styles/index.css +36 -0
  98. package/dist/react/ui/styles/index.css.map +1 -0
  99. package/dist/react/ui/styles/index.d.ts +5 -0
  100. package/dist/react/ui/styles/index.js +13 -0
  101. package/dist/react/ui/styles/index.js.map +1 -0
  102. package/dist/sdk-config-xWkdBdrL.d.ts +24 -0
  103. package/dist/services-BIwQ1C1c.d.ts +20 -0
  104. package/dist/styles/index.css +233 -0
  105. package/dist/styles/index.css.map +1 -0
  106. package/dist/styles/index.d.ts +58 -0
  107. package/dist/styles/index.js +5019 -0
  108. package/dist/styles/index.js.map +1 -0
  109. package/dist/styles.css-BVaTR5nO.d.ts +3 -0
  110. package/dist/types/index.d.ts +12 -0
  111. package/dist/types/index.js +39 -0
  112. package/dist/types/index.js.map +1 -0
  113. package/dist/types-BrAQ8-w4.d.ts +12 -0
  114. package/dist/utils/abi/abi/standard/index.d.ts +25 -0
  115. package/dist/utils/abi/abi/standard/index.js +8 -0
  116. package/dist/utils/abi/abi/standard/index.js.map +1 -0
  117. package/dist/utils/abi/abi/token/index.d.ts +1125 -0
  118. package/dist/utils/abi/abi/token/index.js +13 -0
  119. package/dist/utils/abi/abi/token/index.js.map +1 -0
  120. package/dist/utils/abi/clients/index.d.ts +27 -0
  121. package/dist/utils/abi/clients/index.js +13 -0
  122. package/dist/utils/abi/clients/index.js.map +1 -0
  123. package/dist/utils/index.d.ts +23 -0
  124. package/dist/utils/index.js +37 -0
  125. package/dist/utils/index.js.map +1 -0
  126. package/package.json +74 -0
  127. package/src/consts.ts +2 -0
  128. package/src/index.ts +3 -0
  129. package/src/react/_internal/api/get-query-client.ts +32 -0
  130. package/src/react/_internal/api/index.ts +5 -0
  131. package/src/react/_internal/api/marketplace-api.ts +31 -0
  132. package/src/react/_internal/api/marketplace.gen.ts +1911 -0
  133. package/src/react/_internal/api/query-keys.ts +61 -0
  134. package/src/react/_internal/api/services.ts +101 -0
  135. package/src/react/_internal/consts.ts +1 -0
  136. package/src/react/_internal/get-provider.ts +6 -0
  137. package/src/react/_internal/index.ts +5 -0
  138. package/src/react/_internal/types.ts +13 -0
  139. package/src/react/_internal/wagmi/create-config.ts +62 -0
  140. package/src/react/_internal/wagmi/embedded.ts +87 -0
  141. package/src/react/_internal/wagmi/index.ts +3 -0
  142. package/src/react/_internal/wagmi/universal.ts +82 -0
  143. package/src/react/hooks/index.ts +17 -0
  144. package/src/react/hooks/options/marketplaceConfigOptions.ts +62 -0
  145. package/src/react/hooks/useBalanceOfCollectible.tsx +51 -0
  146. package/src/react/hooks/useCollectible.tsx +47 -0
  147. package/src/react/hooks/useCollection.tsx +42 -0
  148. package/src/react/hooks/useCollectionCounts.tsx +61 -0
  149. package/src/react/hooks/useConfig.tsx +15 -0
  150. package/src/react/hooks/useCurrencies.tsx +76 -0
  151. package/src/react/hooks/useFilters.tsx +39 -0
  152. package/src/react/hooks/useFloorOrder.tsx +28 -0
  153. package/src/react/hooks/useGenerateListingTransaction.tsx +63 -0
  154. package/src/react/hooks/useGenerateOfferTransaction.tsx +60 -0
  155. package/src/react/hooks/useGenerateSellTransaction.tsx +43 -0
  156. package/src/react/hooks/useHighestOffer.tsx +46 -0
  157. package/src/react/hooks/useListBalances.tsx +56 -0
  158. package/src/react/hooks/useListCollectibles.tsx +54 -0
  159. package/src/react/hooks/useListOffersForCollectible.tsx +53 -0
  160. package/src/react/hooks/useLowestListing.tsx +47 -0
  161. package/src/react/hooks/useMarketplaceConfig.tsx +10 -0
  162. package/src/react/hooks/useRoyaltyPercentage.tsx +45 -0
  163. package/src/react/hooks/useTransferTokens.tsx +81 -0
  164. package/src/react/index.ts +5 -0
  165. package/src/react/provider.tsx +24 -0
  166. package/src/react/ssr/create-ssr-client.ts +31 -0
  167. package/src/react/ssr/index.ts +1 -0
  168. package/src/react/ui/icons/ArrowUp.tsx +29 -0
  169. package/src/react/ui/icons/CalendarIcon.tsx +29 -0
  170. package/src/react/ui/icons/InfoIcon.tsx +36 -0
  171. package/src/react/ui/icons/InventoryIcon.tsx +41 -0
  172. package/src/react/ui/icons/MinusIcon.tsx +31 -0
  173. package/src/react/ui/icons/PlusIcon.tsx +29 -0
  174. package/src/react/ui/icons/PositiveCircleIcon.tsx +35 -0
  175. package/src/react/ui/icons/index.ts +7 -0
  176. package/src/react/ui/icons/styles.css.ts +35 -0
  177. package/src/react/ui/index.ts +6 -0
  178. package/src/react/ui/modals/Account/index.tsx +29 -0
  179. package/src/react/ui/modals/CreateListingModal/_store.ts +326 -0
  180. package/src/react/ui/modals/CreateListingModal/_utils/getCreateListingTransactionTitleMessage.ts +30 -0
  181. package/src/react/ui/modals/CreateListingModal/index.tsx +146 -0
  182. package/src/react/ui/modals/MakeOfferModal/_store.ts +296 -0
  183. package/src/react/ui/modals/MakeOfferModal/_utils/getMakeOfferTransactionTitleMessage.ts +28 -0
  184. package/src/react/ui/modals/MakeOfferModal/index.tsx +157 -0
  185. package/src/react/ui/modals/SellModal/_store.ts +274 -0
  186. package/src/react/ui/modals/SellModal/_utils/getSellTransactionTitleMessage.ts +28 -0
  187. package/src/react/ui/modals/SellModal/index.tsx +126 -0
  188. package/src/react/ui/modals/SellModal/utils.ts +38 -0
  189. package/src/react/ui/modals/SuccessfulPurchaseModal/_store.ts +58 -0
  190. package/src/react/ui/modals/SuccessfulPurchaseModal/index.tsx +186 -0
  191. package/src/react/ui/modals/SuccessfulPurchaseModal/styles.css.ts +52 -0
  192. package/src/react/ui/modals/TransferModal/_store.ts +58 -0
  193. package/src/react/ui/modals/TransferModal/_utils/getTransferTransactionTitleMessage.ts +28 -0
  194. package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +102 -0
  195. package/src/react/ui/modals/TransferModal/_views/followWalletInstructions/index.tsx +130 -0
  196. package/src/react/ui/modals/TransferModal/index.tsx +92 -0
  197. package/src/react/ui/modals/TransferModal/messages.ts +14 -0
  198. package/src/react/ui/modals/TransferModal/styles.css.ts +20 -0
  199. package/src/react/ui/modals/_internal/components/actionModal/ActionModal.tsx +94 -0
  200. package/src/react/ui/modals/_internal/components/actionModal/index.ts +3 -0
  201. package/src/react/ui/modals/_internal/components/actionModal/store.ts +19 -0
  202. package/src/react/ui/modals/_internal/components/actionModal/styles.css.ts +15 -0
  203. package/src/react/ui/modals/_internal/components/alertMessage/index.tsx +21 -0
  204. package/src/react/ui/modals/_internal/components/alertMessage/styles.css.ts +22 -0
  205. package/src/react/ui/modals/_internal/components/calendar/index.tsx +59 -0
  206. package/src/react/ui/modals/_internal/components/calendarPopover/index.tsx +41 -0
  207. package/src/react/ui/modals/_internal/components/calendarPopover/styles.css.ts +16 -0
  208. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +76 -0
  209. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/styles.css.ts +33 -0
  210. package/src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx +127 -0
  211. package/src/react/ui/modals/_internal/components/expirationDateSelect/styles.css.ts +25 -0
  212. package/src/react/ui/modals/_internal/components/floorPriceText/index.tsx +54 -0
  213. package/src/react/ui/modals/_internal/components/priceInput/index.tsx +72 -0
  214. package/src/react/ui/modals/_internal/components/priceInput/styles.css.ts +23 -0
  215. package/src/react/ui/modals/_internal/components/priceInput/types.ts +4 -0
  216. package/src/react/ui/modals/_internal/components/quantityInput/index.tsx +168 -0
  217. package/src/react/ui/modals/_internal/components/quantityInput/styles.css.ts +30 -0
  218. package/src/react/ui/modals/_internal/components/switchChainModal/index.tsx +132 -0
  219. package/src/react/ui/modals/_internal/components/switchChainModal/store.ts +41 -0
  220. package/src/react/ui/modals/_internal/components/switchChainModal/styles.css.ts +37 -0
  221. package/src/react/ui/modals/_internal/components/timeAgo/index.tsx +32 -0
  222. package/src/react/ui/modals/_internal/components/tokenPreview/index.tsx +58 -0
  223. package/src/react/ui/modals/_internal/components/tokenPreview/styles.css.ts +11 -0
  224. package/src/react/ui/modals/_internal/components/transaction-footer/index.tsx +48 -0
  225. package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +80 -0
  226. package/src/react/ui/modals/_internal/components/transactionHeader/index.tsx +30 -0
  227. package/src/react/ui/modals/_internal/components/transactionPreview/consts.ts +27 -0
  228. package/src/react/ui/modals/_internal/components/transactionPreview/index.tsx +111 -0
  229. package/src/react/ui/modals/_internal/components/transactionPreview/useTransactionPreviewTitle.tsx +24 -0
  230. package/src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx +123 -0
  231. package/src/react/ui/modals/_internal/components/transactionStatusModal/store.ts +87 -0
  232. package/src/react/ui/modals/_internal/components/transactionStatusModal/styles.css.ts +15 -0
  233. package/src/react/ui/modals/_internal/stores/accountModal.ts +3 -0
  234. package/src/react/ui/modals/modal-provider.tsx +27 -0
  235. package/src/react/ui/styles/index.ts +1 -0
  236. package/src/react/ui/styles/modal.css.ts +73 -0
  237. package/src/styles/index.ts +18 -0
  238. package/src/types/api-types.ts +48 -0
  239. package/src/types/index.ts +4 -0
  240. package/src/types/marketplace-config.ts +63 -0
  241. package/src/types/messages.ts +43 -0
  242. package/src/types/sdk-config.ts +23 -0
  243. package/src/types/types.ts +6 -0
  244. package/src/utils/abi/abi/standard/EIP2981.ts +15 -0
  245. package/src/utils/abi/abi/standard/index.ts +1 -0
  246. package/src/utils/abi/abi/token/ERC1155.ts +324 -0
  247. package/src/utils/abi/abi/token/ERC20.ts +185 -0
  248. package/src/utils/abi/abi/token/ERC721.ts +506 -0
  249. package/src/utils/abi/abi/token/index.ts +3 -0
  250. package/src/utils/abi/clients/ERC1155.ts +82 -0
  251. package/src/utils/abi/clients/ERC20.ts +101 -0
  252. package/src/utils/abi/clients/ERC721.ts +97 -0
  253. package/src/utils/abi/clients/index.ts +3 -0
  254. package/src/utils/address.ts +26 -0
  255. package/src/utils/get-public-rpc-client.ts +32 -0
  256. package/src/utils/index.ts +6 -0
  257. package/src/utils/network.ts +5 -0
  258. package/src/utils/price.ts +21 -0
@@ -0,0 +1,123 @@
1
+ import { observer } from '@legendapp/state/react';
2
+ import {
3
+ type ConfirmationStatus,
4
+ type StatusOrderType,
5
+ transactionStatusModal$,
6
+ } from './store';
7
+ import { Close, Content, Overlay, Portal, Root } from '@radix-ui/react-dialog';
8
+ import {
9
+ closeButton,
10
+ dialogOverlay,
11
+ transactionStatusModalContent,
12
+ } from './styles.css';
13
+ import {
14
+ CloseIcon,
15
+ IconButton,
16
+ Skeleton,
17
+ Text,
18
+ } from '@0xsequence/design-system';
19
+ import { useCollectible } from '@react-hooks/useCollectible';
20
+ import type { Hex } from 'viem';
21
+ import TransactionPreview from '../transactionPreview';
22
+ import type { Price, TokenMetadata } from '@types';
23
+ import TransactionFooter from '../transaction-footer';
24
+ import { useTransactionReceipt } from 'wagmi';
25
+
26
+ export type ShowTransactionStatusModalArgs = {
27
+ hash: Hex;
28
+ price?: Price;
29
+ collectionAddress: string;
30
+ chainId: string;
31
+ tokenId: string;
32
+ getTitle?: (props: ConfirmationStatus) => string;
33
+ getMessage?: (props: ConfirmationStatus) => string;
34
+ type: StatusOrderType;
35
+ };
36
+
37
+ export const useTransactionStatusModal = () => {
38
+ return {
39
+ show: (args: ShowTransactionStatusModalArgs) =>
40
+ transactionStatusModal$.open(args),
41
+ close: () => transactionStatusModal$.close(),
42
+ };
43
+ };
44
+
45
+ const TransactionStatusModal = observer(() => {
46
+ const {
47
+ hash,
48
+ price,
49
+ collectionAddress,
50
+ chainId,
51
+ tokenId,
52
+ getTitle,
53
+ getMessage,
54
+ } = transactionStatusModal$.state.get();
55
+ const { data: collectible } = useCollectible({
56
+ collectionAddress,
57
+ chainId,
58
+ collectibleId: tokenId,
59
+ });
60
+ const {
61
+ isLoading: isConfirming,
62
+ isSuccess: isConfirmed,
63
+ isError: isFailed,
64
+ } = useTransactionReceipt({ hash });
65
+ const title = getTitle && getTitle({ isConfirmed, isConfirming, isFailed });
66
+ const message =
67
+ getMessage && getMessage({ isConfirmed, isConfirming, isFailed });
68
+
69
+ return (
70
+ <Root open={transactionStatusModal$.isOpen.get()}>
71
+ <Portal>
72
+ <Overlay className={dialogOverlay} />
73
+
74
+ <Content className={transactionStatusModalContent}>
75
+ {title ? (
76
+ <Text fontSize="large" fontWeight="bold" color="text100">
77
+ {title}
78
+ </Text>
79
+ ) : (
80
+ <Skeleton width="16" height="6" />
81
+ )}
82
+
83
+ {message ? (
84
+ <Text fontSize="small" color="text80">
85
+ {message}
86
+ </Text>
87
+ ) : (
88
+ <Skeleton width="20" height="4" />
89
+ )}
90
+
91
+ <TransactionPreview
92
+ price={price}
93
+ collectionAddress={collectionAddress}
94
+ chainId={chainId}
95
+ collectible={collectible as TokenMetadata}
96
+ isConfirming={isConfirming}
97
+ isConfirmed={isConfirmed}
98
+ isFailed={isFailed}
99
+ />
100
+
101
+ <TransactionFooter
102
+ transactionHash={hash!}
103
+ isConfirming={isConfirming}
104
+ isConfirmed={isConfirmed}
105
+ isFailed={isFailed}
106
+ />
107
+
108
+ <Close
109
+ onClick={() => {
110
+ transactionStatusModal$.close();
111
+ }}
112
+ className={closeButton}
113
+ asChild
114
+ >
115
+ <IconButton size="xs" aria-label="Close modal" icon={CloseIcon} />
116
+ </Close>
117
+ </Content>
118
+ </Portal>
119
+ </Root>
120
+ );
121
+ });
122
+
123
+ export default TransactionStatusModal;
@@ -0,0 +1,87 @@
1
+ import { observable } from '@legendapp/state';
2
+ import type { ShowTransactionStatusModalArgs } from '.';
3
+ import type { TransactionStatus } from '@0xsequence/indexer';
4
+ import type { Hex } from 'viem';
5
+ import type { StepType } from '@internal';
6
+ import type { Price } from '@types';
7
+
8
+ export type ConfirmationStatus = {
9
+ isConfirming: boolean;
10
+ isConfirmed: boolean;
11
+ isFailed: boolean;
12
+ };
13
+
14
+ export type TransactionStatusExtended = TransactionStatus | 'PENDING';
15
+
16
+ export type StatusOrderType =
17
+ | Pick<
18
+ typeof StepType,
19
+ 'sell' | 'createListing' | 'createOffer' | 'buy'
20
+ >[keyof Pick<
21
+ typeof StepType,
22
+ 'sell' | 'createListing' | 'createOffer' | 'buy'
23
+ >]
24
+ | 'transfer';
25
+
26
+ export interface TransactionStatusModalState {
27
+ isOpen: boolean;
28
+ open: (args: ShowTransactionStatusModalArgs) => void;
29
+ close: () => void;
30
+ state: {
31
+ hash: Hex | undefined;
32
+ status: TransactionStatusExtended;
33
+ type: StatusOrderType | undefined;
34
+ price: Price | undefined;
35
+ collectionAddress: string;
36
+ chainId: string;
37
+ tokenId: string;
38
+ getTitle?: (params: ConfirmationStatus) => string;
39
+ getMessage?: (params: ConfirmationStatus) => string;
40
+ };
41
+ }
42
+
43
+ export const initialState: TransactionStatusModalState = {
44
+ isOpen: false,
45
+ open: ({
46
+ hash,
47
+ price,
48
+ collectionAddress,
49
+ chainId,
50
+ tokenId,
51
+ getTitle,
52
+ getMessage,
53
+ type,
54
+ }) => {
55
+ transactionStatusModal$.state.set({
56
+ ...transactionStatusModal$.state.get(),
57
+ hash,
58
+ price,
59
+ collectionAddress,
60
+ chainId,
61
+ tokenId,
62
+ getTitle,
63
+ getMessage,
64
+ type,
65
+ });
66
+ transactionStatusModal$.isOpen.set(true);
67
+ },
68
+ close: () => {
69
+ transactionStatusModal$.isOpen.set(false);
70
+ transactionStatusModal$.state.set({
71
+ ...initialState.state,
72
+ });
73
+ },
74
+ state: {
75
+ hash: undefined,
76
+ status: 'PENDING',
77
+ price: undefined,
78
+ collectionAddress: '',
79
+ chainId: '',
80
+ tokenId: '',
81
+ getTitle: undefined,
82
+ getMessage: undefined,
83
+ type: undefined,
84
+ },
85
+ };
86
+
87
+ export const transactionStatusModal$ = observable(initialState);
@@ -0,0 +1,15 @@
1
+ import { atoms } from '@0xsequence/design-system';
2
+ import { dialogContent } from '../../../../styles/index';
3
+ import { style } from '@vanilla-extract/css';
4
+
5
+ export { closeButton, dialogOverlay } from '../../../../styles/modal.css';
6
+
7
+ export const transactionStatusModalContent = style([
8
+ dialogContent.wide,
9
+ atoms({
10
+ display: 'grid',
11
+ flexDirection: 'column',
12
+ gap: '6',
13
+ padding: '7',
14
+ }),
15
+ ]);
@@ -0,0 +1,3 @@
1
+ import { observable } from '@legendapp/state';
2
+
3
+ export const _accountModalOpen$ = observable(false);
@@ -0,0 +1,27 @@
1
+ import { observer } from '@legendapp/state/react';
2
+ import SwitchChainModal from './_internal/components/switchChainModal';
3
+ import TransactionStatusModal from './_internal/components/transactionStatusModal';
4
+ import { AccountModal } from './Account';
5
+ import { CreateListingModal } from './CreateListingModal';
6
+ import { MakeOfferModal } from './MakeOfferModal';
7
+ import { SellModal } from './SellModal';
8
+ import SuccessfulPurchaseModal from './SuccessfulPurchaseModal';
9
+ import { TransferModal } from './TransferModal';
10
+ import { _accountModalOpen$ } from './_internal/stores/accountModal';
11
+
12
+ export const ModalProvider = observer(() => {
13
+ return (
14
+ <>
15
+ <AccountModal />
16
+ <CreateListingModal />
17
+ <MakeOfferModal />
18
+ <TransferModal />
19
+ <SellModal />
20
+ <SuccessfulPurchaseModal />
21
+
22
+ {/* Helper modals */}
23
+ <SwitchChainModal />
24
+ <TransactionStatusModal />
25
+ </>
26
+ );
27
+ });
@@ -0,0 +1 @@
1
+ export * from './modal.css';
@@ -0,0 +1,73 @@
1
+ import { atoms } from '@0xsequence/design-system';
2
+ import { style } from '@vanilla-extract/css';
3
+ import { styleVariants } from '@vanilla-extract/css';
4
+
5
+ export const dialogOverlay = style([
6
+ atoms({
7
+ background: 'backgroundBackdrop',
8
+ position: 'fixed',
9
+ inset: '0',
10
+ zIndex: '20',
11
+ }),
12
+ ]);
13
+
14
+ const dialogContentBase = style([
15
+ atoms({
16
+ display: 'flex',
17
+ background: 'backgroundPrimary',
18
+ borderRadius: 'lg',
19
+ position: 'fixed',
20
+ zIndex: '20',
21
+ }),
22
+ {
23
+ top: '50%',
24
+ left: '50%',
25
+ transform: 'translate(-50%, -50%)',
26
+ padding: '24px',
27
+ },
28
+ ]);
29
+
30
+ export const dialogContent = styleVariants({
31
+ narrow: [
32
+ dialogContentBase,
33
+ {
34
+ width: '360px',
35
+ '@media': {
36
+ 'screen and (max-width: 360px)': {
37
+ width: '100%',
38
+ bottom: '0',
39
+ transform: 'unset',
40
+ top: 'unset',
41
+ left: 'unset',
42
+ borderBottomLeftRadius: '0 !important',
43
+ borderBottomRightRadius: '0 !important',
44
+ },
45
+ },
46
+ },
47
+ ],
48
+ wide: [
49
+ dialogContentBase,
50
+ {
51
+ width: '540px',
52
+ '@media': {
53
+ 'screen and (max-width: 540px)': {
54
+ width: '100%',
55
+ bottom: '0',
56
+ transform: 'unset',
57
+ top: 'unset',
58
+ left: 'unset',
59
+ borderBottomLeftRadius: '0 !important',
60
+ borderBottomRightRadius: '0 !important',
61
+ },
62
+ },
63
+ },
64
+ ],
65
+ });
66
+
67
+ export const closeButton = style([
68
+ atoms({
69
+ position: 'absolute',
70
+ right: '6',
71
+ top: '6',
72
+ }),
73
+ ]);
@@ -0,0 +1,18 @@
1
+ /* icon styles */
2
+ export * from '../react/ui/icons/styles.css';
3
+
4
+ /* modal components styles */
5
+ export * from '../react/ui/modals/_internal/components/actionModal/styles.css';
6
+ export * from '../react/ui/modals/_internal/components/calendarPopover/styles.css';
7
+ export * from '../react/ui/modals/_internal/components/currencyOptionsSelect/styles.css';
8
+ export * from '../react/ui/modals/_internal/components/expirationDateSelect/styles.css';
9
+ export * from '../react/ui/modals/_internal/components/priceInput/styles.css';
10
+ export * from '../react/ui/modals/_internal/components/quantityInput/styles.css';
11
+ export * from '../react/ui/modals/_internal/components/tokenPreview/styles.css';
12
+ export * from '../react/ui/modals/_internal/components/alertMessage/styles.css';
13
+ export * from '../react/ui/modals/_internal/components/switchChainModal/styles.css';
14
+
15
+ /* modal styles */
16
+ export * from '../react/ui/styles/index';
17
+ export * from '../react/ui/modals/SuccessfulPurchaseModal/styles.css';
18
+ export * from '../react/ui/modals/TransferModal/styles.css';
@@ -0,0 +1,48 @@
1
+ export {
2
+ SortOrder,
3
+ PropertyType,
4
+ MarketplaceKind,
5
+ OrderbookKind,
6
+ SourceKind,
7
+ OrderSide,
8
+ OrderStatus,
9
+ ContractType,
10
+ CollectionStatus,
11
+ ProjectStatus,
12
+ CollectibleStatus,
13
+ WalletKind,
14
+ StepType,
15
+ TransactionCrypto,
16
+ ExecuteType,
17
+ } from '@internal';
18
+ export type {
19
+ TokenMetadata,
20
+ Asset,
21
+ Page,
22
+ SortBy,
23
+ Filter,
24
+ PropertyFilter,
25
+ CollectiblesFilter,
26
+ Order,
27
+ FeeBreakdown,
28
+ CollectibleOrder,
29
+ OrderFilter,
30
+ Activity,
31
+ Collection,
32
+ CollectionConfig,
33
+ CollectionLastSynced,
34
+ Project,
35
+ Collectible,
36
+ Currency,
37
+ OrderData,
38
+ AdditionalFee,
39
+ Step,
40
+ PostRequest,
41
+ CreateReq,
42
+ GetOrdersInput,
43
+ Signature,
44
+ Domain,
45
+ CheckoutOptionsMarketplaceOrder,
46
+ CheckoutOptionsItem,
47
+ CheckoutOptions,
48
+ } from '@internal';
@@ -0,0 +1,4 @@
1
+ export * from './api-types';
2
+ export * from './marketplace-config';
3
+ export * from './sdk-config';
4
+ export * from './types';
@@ -0,0 +1,63 @@
1
+ import type { ChainId } from '@0xsequence/network';
2
+
3
+ interface Socials {
4
+ twitter?: string;
5
+ website?: string;
6
+ discord?: string;
7
+ instagram?: string;
8
+ tiktok?: string;
9
+ youtube?: string;
10
+ }
11
+
12
+ enum WalletOptions {
13
+ Sequence = 'sequence',
14
+ Metamask = 'metamask',
15
+ WalletConnect = 'walletconnect',
16
+ Coinbase = 'coinbase',
17
+ Injected = 'injected',
18
+ Ledger = 'ledger',
19
+ Rainbow = 'rainbow',
20
+ }
21
+
22
+ type NewWalletConnectors = 'walletconnect' | 'coinbase';
23
+ interface WalletOptionsNew {
24
+ connectors: NewWalletConnectors[];
25
+ includeEIP6963Wallets: boolean;
26
+ walletType: 'embedded' | 'universal';
27
+ }
28
+
29
+ interface Collection {
30
+ collectionAddress: string;
31
+ chainId: ChainId;
32
+ exchanges?: string[];
33
+ marketplaceFeePercentage: number;
34
+ bannerUrl?: string;
35
+ marketplaceType: 'p2p' | 'orderbook' | 'amm';
36
+ currencyOptions?: string[];
37
+ }
38
+
39
+ type LandingPageLayout = 'default' | 'big_left_banner' | 'floating_header';
40
+
41
+ export interface MarketplaceConfig {
42
+ projectId: number; // builder project Id
43
+ publisherId: string;
44
+ title: string;
45
+ shortDescription: string;
46
+ socials?: Socials;
47
+ faviconUrl: string;
48
+ landingBannerUrl: string;
49
+ logoUrl?: string;
50
+ fontUrl?: string;
51
+ ogImage?: string;
52
+ titleTemplate: string;
53
+ disableLiquidityProviderTools?: boolean;
54
+ walletOptions: WalletOptions[];
55
+ walletOptionsNew?: WalletOptionsNew;
56
+ collections: Collection[];
57
+ landingPageLayout: LandingPageLayout;
58
+ // Appended in the sdk
59
+ cssString: string;
60
+ // Appended in the sdk
61
+
62
+ manifestUrl: string;
63
+ }
@@ -0,0 +1,43 @@
1
+ type ApproveTokenMessageCallbacks = {
2
+ onSuccess?: () => void;
3
+ onUnknownError?: (error: Error | unknown) => void;
4
+ };
5
+
6
+ export type SwitchChainMessageCallbacks = {
7
+ onSuccess?: () => void;
8
+ onSwitchingNotSupported?: () => void;
9
+ onUserRejectedRequest?: () => void;
10
+ onUnknownError?: (error: Error | unknown) => void;
11
+ };
12
+
13
+ type MakeOfferMessageCallbacks = {
14
+ onSuccess?: () => void;
15
+ onUnknownError?: (error: Error | unknown) => void;
16
+ };
17
+
18
+ type CreateListingMessageCallbacks = {
19
+ onSuccess?: () => void;
20
+ onUnknownError?: (error: Error | unknown) => void;
21
+ };
22
+
23
+ type SellCollectibleMessageCallbacks = {
24
+ onSuccess?: () => void;
25
+ onUnknownError?: (error: Error | unknown) => void;
26
+ };
27
+
28
+ type TransferCollectiblesMessageCallbacks = {
29
+ onSuccess?: () => void;
30
+ onUnknownError?: (error: Error | unknown) => void;
31
+ };
32
+
33
+ export type Messages =
34
+ | {
35
+ approveToken?: ApproveTokenMessageCallbacks;
36
+ switchChain?: SwitchChainMessageCallbacks;
37
+
38
+ createListing?: CreateListingMessageCallbacks;
39
+ makeOffer?: MakeOfferMessageCallbacks;
40
+ sellCollectible?: SellCollectibleMessageCallbacks;
41
+ transferCollectibles?: TransferCollectiblesMessageCallbacks;
42
+ }
43
+ | undefined;
@@ -0,0 +1,23 @@
1
+ export type Env = 'development' | 'next' | 'production';
2
+
3
+ export type SdkConfig = {
4
+ projectAccessKey: string;
5
+ projectId: string;
6
+ wallet?: {
7
+ walletConnectProjectId?: string;
8
+ embedded?: {
9
+ waasConfigKey: string;
10
+ googleClientId?: string;
11
+ appleClientId?: string;
12
+ appleRedirectURI?: string;
13
+ };
14
+ };
15
+ _internal?: {
16
+ devAccessKey?: string;
17
+ nextAccessKey?: string;
18
+ builderEnv?: Env;
19
+ marketplaceEnv?: Env;
20
+ metadataEnv?: Env;
21
+ indexerEnv?: Env;
22
+ };
23
+ };
@@ -0,0 +1,6 @@
1
+ import type { Currency } from '@types';
2
+
3
+ export type Price = {
4
+ amountRaw: string;
5
+ currency: Currency;
6
+ };
@@ -0,0 +1,15 @@
1
+ export const EIP2981_ABI = [
2
+ {
3
+ inputs: [
4
+ { internalType: 'uint256', name: '', type: 'uint256' },
5
+ { internalType: 'uint256', name: '_saleCost', type: 'uint256' },
6
+ ],
7
+ name: 'royaltyInfo',
8
+ outputs: [
9
+ { internalType: 'address', name: 'receiver', type: 'address' },
10
+ { internalType: 'uint256', name: 'royaltyAmount', type: 'uint256' },
11
+ ],
12
+ stateMutability: 'view',
13
+ type: 'function',
14
+ },
15
+ ] as const;
@@ -0,0 +1 @@
1
+ export * from './EIP2981';