@0xsequence/marketplace-sdk 0.2.0 → 0.3.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 (204) hide show
  1. package/dist/chess-tile-6BS5MQT5.png +0 -0
  2. package/dist/chunk-22NLQ3AS.js +3078 -0
  3. package/dist/chunk-22NLQ3AS.js.map +1 -0
  4. package/dist/chunk-3OHM45R3.js +1294 -0
  5. package/dist/chunk-3OHM45R3.js.map +1 -0
  6. package/dist/{chunk-4E34HVSA.js → chunk-4YU2UPYH.js} +29 -74
  7. package/dist/chunk-4YU2UPYH.js.map +1 -0
  8. package/dist/chunk-7NJETFMF.js +21 -0
  9. package/dist/chunk-7NJETFMF.js.map +1 -0
  10. package/dist/{chunk-UYRQ5MJQ.js → chunk-FUM4OGOQ.js} +4 -4
  11. package/dist/chunk-FUM4OGOQ.js.map +1 -0
  12. package/dist/{chunk-FCQCNLFZ.js → chunk-G33554LK.js} +4 -1
  13. package/dist/chunk-G33554LK.js.map +1 -0
  14. package/dist/{chunk-7OO74L2K.js → chunk-GJAKQ5Q3.js} +40 -1
  15. package/dist/chunk-GJAKQ5Q3.js.map +1 -0
  16. package/dist/{chunk-GZIA25G4.js → chunk-GZG2QO64.js} +22 -6
  17. package/dist/chunk-GZG2QO64.js.map +1 -0
  18. package/dist/chunk-MCI3KOSQ.js +2 -0
  19. package/dist/{chunk-5EOVZAKT.js → chunk-O7UQGT43.js} +891 -100
  20. package/dist/chunk-O7UQGT43.js.map +1 -0
  21. package/dist/{chunk-CSN7YD5Q.js → chunk-Q57TEA3Z.js} +20 -2
  22. package/dist/chunk-Q57TEA3Z.js.map +1 -0
  23. package/dist/{chunk-VEX7FDL6.js → chunk-SBVLWSRZ.js} +2 -2
  24. package/dist/{chunk-VEX7FDL6.js.map → chunk-SBVLWSRZ.js.map} +1 -1
  25. package/dist/{chunk-6S4FYXP6.js → chunk-SPW24Y7I.js} +40 -1
  26. package/dist/chunk-SPW24Y7I.js.map +1 -0
  27. package/dist/chunk-UISBTKFF.js +1 -0
  28. package/dist/{chunk-LFQB477Y.js → chunk-WA433WAJ.js} +9 -33
  29. package/dist/chunk-WA433WAJ.js.map +1 -0
  30. package/dist/{chunk-O5JXKTWP.js → chunk-WFE6OCYF.js} +4 -4
  31. package/dist/chunk-WFE6OCYF.js.map +1 -0
  32. package/dist/chunk-XX4EVWBF.js +1292 -0
  33. package/dist/chunk-XX4EVWBF.js.map +1 -0
  34. package/dist/chunk-Y7YO5TLE.js +53 -0
  35. package/dist/chunk-Y7YO5TLE.js.map +1 -0
  36. package/dist/index.css +1 -50
  37. package/dist/index.d.ts +5 -7
  38. package/dist/index.js +158 -73
  39. package/dist/index.js.map +1 -1
  40. package/dist/{marketplace.gen-Ceofb9Cs.d.ts → marketplace.gen-BLP7822q.d.ts} +17 -5
  41. package/dist/react/_internal/api/index.d.ts +4 -2
  42. package/dist/react/_internal/api/index.js +1 -1
  43. package/dist/react/_internal/index.d.ts +3 -3
  44. package/dist/react/_internal/index.js +7 -7
  45. package/dist/react/hooks/index.css +82 -0
  46. package/dist/react/hooks/index.css.map +1 -0
  47. package/dist/react/hooks/index.d.ts +577 -427
  48. package/dist/react/hooks/index.js +39 -7
  49. package/dist/react/index.css +86 -81
  50. package/dist/react/index.css.map +1 -1
  51. package/dist/react/index.d.ts +6 -5
  52. package/dist/react/index.js +49 -16
  53. package/dist/react/ssr/index.js +4 -3
  54. package/dist/react/ssr/index.js.map +1 -1
  55. package/dist/react/ui/components/index.css +241 -0
  56. package/dist/react/ui/components/index.css.map +1 -0
  57. package/dist/react/ui/components/index.d.ts +23 -0
  58. package/dist/react/ui/components/index.js +25 -0
  59. package/dist/react/ui/icons/index.js +3 -2
  60. package/dist/react/ui/icons/index.js.map +1 -1
  61. package/dist/react/ui/index.css +86 -81
  62. package/dist/react/ui/index.css.map +1 -1
  63. package/dist/react/ui/index.d.ts +34 -33
  64. package/dist/react/ui/index.js +17 -12
  65. package/dist/react/ui/modals/_internal/components/actionModal/index.js +6 -17
  66. package/dist/react/ui/modals/_internal/components/actionModal/index.js.map +1 -1
  67. package/dist/react/ui/styles/index.d.ts +1 -1
  68. package/dist/{services-Dei25J6_.d.ts → services-C9-lvWcC.d.ts} +1 -1
  69. package/dist/styles/index.css +1 -50
  70. package/dist/styles/index.css.map +1 -1
  71. package/dist/styles/index.d.ts +1 -5
  72. package/dist/styles/index.js +10 -12
  73. package/dist/types/index.d.ts +2 -2
  74. package/dist/types/index.js +2 -2
  75. package/dist/{types-BzZVURNL.d.ts → types-QqXjNuUP.d.ts} +1 -1
  76. package/dist/utils/abi/index.d.ts +2 -0
  77. package/dist/utils/abi/index.js +21 -0
  78. package/dist/utils/abi/marketplace/index.d.ts +805 -0
  79. package/dist/utils/abi/marketplace/index.js +12 -0
  80. package/dist/utils/abi/{abi/token → token}/index.js +1 -2
  81. package/dist/utils/abi/token/index.js.map +1 -0
  82. package/dist/utils/index.d.ts +7 -7
  83. package/dist/utils/index.js +12 -14
  84. package/package.json +17 -15
  85. package/src/react/_internal/api/get-query-client.ts +3 -3
  86. package/src/react/_internal/api/marketplace.gen.ts +34 -10
  87. package/src/react/_internal/api/query-keys.ts +8 -0
  88. package/src/react/_internal/transaction-machine/execute-transaction.ts +592 -0
  89. package/src/react/_internal/transaction-machine/useTransactionMachine.ts +66 -0
  90. package/src/react/hooks/index.ts +7 -0
  91. package/src/react/hooks/useBuyCollectable.tsx +38 -0
  92. package/src/react/hooks/useCancelOrder.tsx +38 -0
  93. package/src/react/hooks/useCheckoutOptions.tsx +46 -43
  94. package/src/react/hooks/useCountOfCollectables.tsx +52 -52
  95. package/src/react/hooks/useCreateListing.tsx +65 -0
  96. package/src/react/hooks/useCurrencies.tsx +60 -60
  97. package/src/react/hooks/useCurrency.tsx +64 -0
  98. package/src/react/hooks/useGenerateBuyTransaction.tsx +71 -0
  99. package/src/react/hooks/useGenerateCancelTransaction.tsx +50 -0
  100. package/src/react/hooks/useListBalances.tsx +2 -3
  101. package/src/react/hooks/useListCollectibles.tsx +5 -6
  102. package/src/react/hooks/useListCollections.tsx +88 -0
  103. package/src/react/hooks/useListListingsForCollectible.tsx +61 -0
  104. package/src/react/hooks/useListOffersForCollectible.tsx +14 -16
  105. package/src/react/hooks/useMakeOffer.tsx +62 -0
  106. package/src/react/hooks/useRoyaltyPercentage.tsx +1 -1
  107. package/src/react/hooks/useSell.tsx +62 -0
  108. package/src/react/ui/components/_internals/action-button/ActionButton.tsx +156 -0
  109. package/src/react/ui/components/_internals/custom-network-image/CustomNetworkImage.tsx +27 -0
  110. package/src/react/ui/components/_internals/custom-network-image/styles.css.ts +51 -0
  111. package/src/react/ui/components/_internals/custom-select/CustomSelect.tsx +63 -0
  112. package/src/react/ui/components/_internals/custom-select/styles.css.ts +64 -0
  113. package/src/react/ui/components/_internals/pill/Pill.tsx +20 -0
  114. package/src/react/ui/components/collectible-card/CollectibleCard.tsx +191 -0
  115. package/src/react/ui/components/collectible-card/Footer.tsx +128 -0
  116. package/src/react/ui/components/collectible-card/styles.css.ts +62 -0
  117. package/src/react/ui/components/index.ts +1 -0
  118. package/src/react/ui/icons/Bell.tsx +31 -0
  119. package/src/react/ui/icons/DiamondEye.tsx +31 -0
  120. package/src/react/ui/images/chess-tile.png +0 -0
  121. package/src/react/ui/index.ts +4 -0
  122. package/src/react/ui/modals/BuyModal/_store.ts +53 -0
  123. package/src/react/ui/modals/BuyModal/index.tsx +119 -0
  124. package/src/react/ui/modals/CreateListingModal/_store.ts +35 -312
  125. package/src/react/ui/modals/CreateListingModal/index.tsx +216 -157
  126. package/src/react/ui/modals/MakeOfferModal/_store.ts +34 -276
  127. package/src/react/ui/modals/MakeOfferModal/index.tsx +195 -136
  128. package/src/react/ui/modals/SellModal/_store.ts +29 -262
  129. package/src/react/ui/modals/SellModal/index.tsx +156 -122
  130. package/src/react/ui/modals/SuccessfulPurchaseModal/_store.ts +17 -3
  131. package/src/react/ui/modals/SuccessfulPurchaseModal/index.tsx +3 -2
  132. package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +92 -92
  133. package/src/react/ui/modals/TransferModal/index.tsx +10 -17
  134. package/src/react/ui/modals/_internal/components/actionModal/ActionModal.tsx +1 -0
  135. package/src/react/ui/modals/_internal/components/actionModal/ErrorModal.tsx +18 -0
  136. package/src/react/ui/modals/_internal/components/actionModal/LoadingModal.tsx +18 -0
  137. package/src/react/ui/modals/_internal/components/calendarPopover/index.tsx +1 -0
  138. package/src/react/ui/modals/_internal/components/calendarPopover/overrides.css +8 -0
  139. package/src/react/ui/modals/_internal/components/calendarPopover/styles.css.ts +10 -4
  140. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +10 -13
  141. package/src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx +23 -9
  142. package/src/react/ui/modals/_internal/components/priceInput/index.tsx +7 -18
  143. package/src/react/ui/modals/_internal/components/switchChainModal/index.tsx +17 -44
  144. package/src/react/ui/modals/_internal/components/switchChainModal/store.ts +10 -8
  145. package/src/react/ui/modals/_internal/components/tokenPreview/index.tsx +14 -3
  146. package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +4 -2
  147. package/src/react/ui/modals/_internal/components/transactionHeader/index.tsx +4 -4
  148. package/src/react/ui/modals/_internal/components/transactionPreview/index.tsx +4 -2
  149. package/src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx +13 -10
  150. package/src/react/ui/modals/_internal/types.ts +13 -0
  151. package/src/react/ui/modals/modal-provider.tsx +2 -1
  152. package/src/styles/index.ts +0 -2
  153. package/src/types/custom.d.ts +1 -0
  154. package/src/utils/abi/index.ts +2 -0
  155. package/src/utils/abi/marketplace/index.ts +3 -0
  156. package/src/utils/abi/marketplace/sequence-marketplace-v1.ts +463 -0
  157. package/src/utils/abi/marketplace/sequence-marketplace-v2.ts +802 -0
  158. package/src/utils/index.ts +2 -3
  159. package/src/utils/network.ts +4 -2
  160. package/tsconfig.tsbuildinfo +1 -1
  161. package/dist/chunk-4E34HVSA.js.map +0 -1
  162. package/dist/chunk-5EOVZAKT.js.map +0 -1
  163. package/dist/chunk-6JWGELXL.js +0 -214
  164. package/dist/chunk-6JWGELXL.js.map +0 -1
  165. package/dist/chunk-6S4FYXP6.js.map +0 -1
  166. package/dist/chunk-7OO74L2K.js.map +0 -1
  167. package/dist/chunk-BCNFYVAL.js +0 -1
  168. package/dist/chunk-CSN7YD5Q.js.map +0 -1
  169. package/dist/chunk-D7QQP6MS.js +0 -2
  170. package/dist/chunk-DBFOPEV6.js +0 -23
  171. package/dist/chunk-DBFOPEV6.js.map +0 -1
  172. package/dist/chunk-FCQCNLFZ.js.map +0 -1
  173. package/dist/chunk-GZIA25G4.js.map +0 -1
  174. package/dist/chunk-LFQB477Y.js.map +0 -1
  175. package/dist/chunk-MD4JHPMH.js +0 -2815
  176. package/dist/chunk-MD4JHPMH.js.map +0 -1
  177. package/dist/chunk-O5JXKTWP.js.map +0 -1
  178. package/dist/chunk-PE2LLUTJ.js +0 -213
  179. package/dist/chunk-PE2LLUTJ.js.map +0 -1
  180. package/dist/chunk-QVFMD6S2.js +0 -21
  181. package/dist/chunk-QVFMD6S2.js.map +0 -1
  182. package/dist/chunk-UYRQ5MJQ.js.map +0 -1
  183. package/dist/utils/abi/abi/standard/index.d.ts +0 -25
  184. package/dist/utils/abi/abi/standard/index.js +0 -8
  185. package/dist/utils/abi/clients/index.d.ts +0 -27
  186. package/dist/utils/abi/clients/index.js +0 -13
  187. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/styles.css.ts +0 -33
  188. package/src/react/ui/modals/_internal/components/expirationDateSelect/styles.css.ts +0 -25
  189. package/src/utils/abi/abi/standard/index.ts +0 -1
  190. package/src/utils/abi/clients/ERC1155.ts +0 -82
  191. package/src/utils/abi/clients/ERC20.ts +0 -101
  192. package/src/utils/abi/clients/ERC721.ts +0 -97
  193. package/src/utils/abi/clients/index.ts +0 -3
  194. /package/dist/{chunk-BCNFYVAL.js.map → chunk-MCI3KOSQ.js.map} +0 -0
  195. /package/dist/{chunk-D7QQP6MS.js.map → chunk-UISBTKFF.js.map} +0 -0
  196. /package/dist/{utils/abi/abi/standard → react/ui/components}/index.js.map +0 -0
  197. /package/dist/utils/abi/{abi/token/index.js.map → index.js.map} +0 -0
  198. /package/dist/utils/abi/{clients → marketplace}/index.js.map +0 -0
  199. /package/dist/utils/abi/{abi/token → token}/index.d.ts +0 -0
  200. /package/src/utils/abi/{abi/standard → marketplace}/EIP2981.ts +0 -0
  201. /package/src/utils/abi/{abi/token → token}/ERC1155.ts +0 -0
  202. /package/src/utils/abi/{abi/token → token}/ERC20.ts +0 -0
  203. /package/src/utils/abi/{abi/token → token}/ERC721.ts +0 -0
  204. /package/src/utils/abi/{abi/token → token}/index.ts +0 -0
@@ -1,101 +0,0 @@
1
- import type { Hex, WalletClient } from 'viem';
2
- import { encodeFunctionData, getContract, maxUint256 } from 'viem';
3
- import type { GetWalletClientData } from 'wagmi/query';
4
-
5
- import { getPublicRpcClient } from '../../get-public-rpc-client';
6
- import { ERC20_ABI } from '../abi/token/ERC20';
7
-
8
- export class ERC20 {
9
- static approve = async (
10
- erc20Address: string,
11
- spender: string,
12
- amount: bigint,
13
- signer: GetWalletClientData<any, any>,
14
- ): Promise<string> => {
15
- const txHash = await signer.writeContract({
16
- chain: signer.chain,
17
- address: erc20Address as Hex,
18
- abi: ERC20_ABI,
19
- functionName: 'approve',
20
- args: [spender as Hex, amount],
21
- });
22
-
23
- return txHash;
24
- };
25
-
26
- static approve_data = (spender: string, amount: bigint): string => {
27
- return encodeFunctionData({
28
- abi: ERC20_ABI,
29
- functionName: 'approve',
30
- args: [spender as Hex, amount],
31
- });
32
- };
33
-
34
- static approveInfinite = async (
35
- erc20Address: string,
36
- spender: string,
37
- signer: GetWalletClientData<any, any>,
38
- ): Promise<string> => {
39
- const txHash = await signer.writeContract({
40
- chain: signer.chain,
41
- address: erc20Address as Hex,
42
- abi: ERC20_ABI,
43
- functionName: 'approve',
44
- args: [spender as Hex, maxUint256],
45
- });
46
-
47
- return txHash;
48
- };
49
-
50
- static approveInfinite_data = (spender: string): string => {
51
- return encodeFunctionData({
52
- abi: ERC20_ABI,
53
- functionName: 'approve',
54
- args: [spender as Hex, maxUint256],
55
- });
56
- };
57
-
58
- static getAllowance = async (
59
- erc20Address: string,
60
- owner: string,
61
- spender: string,
62
- chainId: number,
63
- ): Promise<bigint> => {
64
- const contract = getERC20Contract({
65
- contractAddress: erc20Address,
66
- chainId,
67
- });
68
- return contract.read.allowance([owner as Hex, spender as Hex]);
69
- };
70
-
71
- static balanceOf = async (
72
- erc20Address: string,
73
- owner: string,
74
- chainId: number,
75
- ): Promise<bigint> => {
76
- const contract = getERC20Contract({
77
- contractAddress: erc20Address,
78
- chainId,
79
- });
80
- return contract.read.balanceOf([owner as Hex]);
81
- };
82
- }
83
-
84
- interface ContractInstanceParams {
85
- contractAddress: string;
86
- chainId: number;
87
- signer?: WalletClient;
88
- }
89
-
90
- const getERC20Contract = (args: ContractInstanceParams) => {
91
- const publicClient = getPublicRpcClient(args.chainId);
92
-
93
- return getContract({
94
- address: args.contractAddress as Hex,
95
- abi: ERC20_ABI,
96
- client: {
97
- public: publicClient,
98
- wallet: args.signer,
99
- },
100
- });
101
- };
@@ -1,97 +0,0 @@
1
- import type { Hex, WalletClient } from 'viem';
2
- import { encodeFunctionData, getContract } from 'viem';
3
- import type { GetWalletClientData } from 'wagmi/query';
4
-
5
- import { getPublicRpcClient } from '../../get-public-rpc-client';
6
- import { ERC721_ABI } from '../abi/token/ERC721';
7
-
8
- export class ERC721 {
9
- static setApprovalForAll = async (
10
- ERC721Address: string,
11
- operator: string,
12
- approved: boolean,
13
- signer: GetWalletClientData<any, any>,
14
- ): Promise<string> => {
15
- const txHash = await signer.writeContract({
16
- chain: signer.chain,
17
- address: ERC721Address as Hex,
18
- abi: ERC721_ABI,
19
- functionName: 'setApprovalForAll',
20
- args: [operator as Hex, approved],
21
- });
22
-
23
- return txHash;
24
- };
25
-
26
- static setApprovalForAll_data = (
27
- operator: string,
28
- approved: boolean,
29
- ): string => {
30
- return encodeFunctionData({
31
- abi: ERC721_ABI,
32
- functionName: 'setApprovalForAll',
33
- args: [operator as Hex, approved],
34
- });
35
- };
36
-
37
- static approve = async (
38
- ERC721Address: string,
39
- to: string,
40
- tokenId: string,
41
- signer: GetWalletClientData<any, any>,
42
- ): Promise<string> => {
43
- const txHash = await signer.writeContract({
44
- chain: signer.chain,
45
- address: ERC721Address as Hex,
46
- abi: ERC721_ABI,
47
- functionName: 'approve',
48
- args: [to as Hex, BigInt(tokenId)],
49
- });
50
-
51
- return txHash;
52
- };
53
-
54
- static isApprovedForAll = async (
55
- ERC721Address: string,
56
- owner: string,
57
- operator: string,
58
- chainId: number,
59
- ) => {
60
- const contract = getERC721Contract({
61
- contractAddress: ERC721Address,
62
- chainId,
63
- });
64
- return contract.read.isApprovedForAll([owner as Hex, operator as Hex]);
65
- };
66
-
67
- static balanceOf = async (
68
- ERC721Address: string,
69
- owner: string,
70
- chainId: number,
71
- ): Promise<bigint> => {
72
- const contract = getERC721Contract({
73
- contractAddress: ERC721Address,
74
- chainId,
75
- });
76
- return contract.read.balanceOf([owner as Hex]);
77
- };
78
- }
79
-
80
- interface ContractInstanceParams {
81
- contractAddress: string;
82
- chainId: number;
83
- signer?: WalletClient;
84
- }
85
-
86
- const getERC721Contract = (args: ContractInstanceParams) => {
87
- const publicClient = getPublicRpcClient(args.chainId);
88
-
89
- return getContract({
90
- address: args.contractAddress as Hex,
91
- abi: ERC721_ABI,
92
- client: {
93
- public: publicClient,
94
- wallet: args.signer,
95
- },
96
- });
97
- };
@@ -1,3 +0,0 @@
1
- export * from './ERC1155';
2
- export * from './ERC20';
3
- export * from './ERC721';
File without changes
File without changes
File without changes
File without changes
File without changes