@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.
- package/dist/chess-tile-6BS5MQT5.png +0 -0
- package/dist/chunk-22NLQ3AS.js +3078 -0
- package/dist/chunk-22NLQ3AS.js.map +1 -0
- package/dist/chunk-3OHM45R3.js +1294 -0
- package/dist/chunk-3OHM45R3.js.map +1 -0
- package/dist/{chunk-4E34HVSA.js → chunk-4YU2UPYH.js} +29 -74
- package/dist/chunk-4YU2UPYH.js.map +1 -0
- package/dist/chunk-7NJETFMF.js +21 -0
- package/dist/chunk-7NJETFMF.js.map +1 -0
- package/dist/{chunk-UYRQ5MJQ.js → chunk-FUM4OGOQ.js} +4 -4
- package/dist/chunk-FUM4OGOQ.js.map +1 -0
- package/dist/{chunk-FCQCNLFZ.js → chunk-G33554LK.js} +4 -1
- package/dist/chunk-G33554LK.js.map +1 -0
- package/dist/{chunk-7OO74L2K.js → chunk-GJAKQ5Q3.js} +40 -1
- package/dist/chunk-GJAKQ5Q3.js.map +1 -0
- package/dist/{chunk-GZIA25G4.js → chunk-GZG2QO64.js} +22 -6
- package/dist/chunk-GZG2QO64.js.map +1 -0
- package/dist/chunk-MCI3KOSQ.js +2 -0
- package/dist/{chunk-5EOVZAKT.js → chunk-O7UQGT43.js} +891 -100
- package/dist/chunk-O7UQGT43.js.map +1 -0
- package/dist/{chunk-CSN7YD5Q.js → chunk-Q57TEA3Z.js} +20 -2
- package/dist/chunk-Q57TEA3Z.js.map +1 -0
- package/dist/{chunk-VEX7FDL6.js → chunk-SBVLWSRZ.js} +2 -2
- package/dist/{chunk-VEX7FDL6.js.map → chunk-SBVLWSRZ.js.map} +1 -1
- package/dist/{chunk-6S4FYXP6.js → chunk-SPW24Y7I.js} +40 -1
- package/dist/chunk-SPW24Y7I.js.map +1 -0
- package/dist/chunk-UISBTKFF.js +1 -0
- package/dist/{chunk-LFQB477Y.js → chunk-WA433WAJ.js} +9 -33
- package/dist/chunk-WA433WAJ.js.map +1 -0
- package/dist/{chunk-O5JXKTWP.js → chunk-WFE6OCYF.js} +4 -4
- package/dist/chunk-WFE6OCYF.js.map +1 -0
- package/dist/chunk-XX4EVWBF.js +1292 -0
- package/dist/chunk-XX4EVWBF.js.map +1 -0
- package/dist/chunk-Y7YO5TLE.js +53 -0
- package/dist/chunk-Y7YO5TLE.js.map +1 -0
- package/dist/index.css +1 -50
- package/dist/index.d.ts +5 -7
- package/dist/index.js +158 -73
- package/dist/index.js.map +1 -1
- package/dist/{marketplace.gen-Ceofb9Cs.d.ts → marketplace.gen-BLP7822q.d.ts} +17 -5
- package/dist/react/_internal/api/index.d.ts +4 -2
- package/dist/react/_internal/api/index.js +1 -1
- package/dist/react/_internal/index.d.ts +3 -3
- package/dist/react/_internal/index.js +7 -7
- package/dist/react/hooks/index.css +82 -0
- package/dist/react/hooks/index.css.map +1 -0
- package/dist/react/hooks/index.d.ts +577 -427
- package/dist/react/hooks/index.js +39 -7
- package/dist/react/index.css +86 -81
- package/dist/react/index.css.map +1 -1
- package/dist/react/index.d.ts +6 -5
- package/dist/react/index.js +49 -16
- package/dist/react/ssr/index.js +4 -3
- package/dist/react/ssr/index.js.map +1 -1
- package/dist/react/ui/components/index.css +241 -0
- package/dist/react/ui/components/index.css.map +1 -0
- package/dist/react/ui/components/index.d.ts +23 -0
- package/dist/react/ui/components/index.js +25 -0
- package/dist/react/ui/icons/index.js +3 -2
- package/dist/react/ui/icons/index.js.map +1 -1
- package/dist/react/ui/index.css +86 -81
- package/dist/react/ui/index.css.map +1 -1
- package/dist/react/ui/index.d.ts +34 -33
- package/dist/react/ui/index.js +17 -12
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +6 -17
- package/dist/react/ui/modals/_internal/components/actionModal/index.js.map +1 -1
- package/dist/react/ui/styles/index.d.ts +1 -1
- package/dist/{services-Dei25J6_.d.ts → services-C9-lvWcC.d.ts} +1 -1
- package/dist/styles/index.css +1 -50
- package/dist/styles/index.css.map +1 -1
- package/dist/styles/index.d.ts +1 -5
- package/dist/styles/index.js +10 -12
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +2 -2
- package/dist/{types-BzZVURNL.d.ts → types-QqXjNuUP.d.ts} +1 -1
- package/dist/utils/abi/index.d.ts +2 -0
- package/dist/utils/abi/index.js +21 -0
- package/dist/utils/abi/marketplace/index.d.ts +805 -0
- package/dist/utils/abi/marketplace/index.js +12 -0
- package/dist/utils/abi/{abi/token → token}/index.js +1 -2
- package/dist/utils/abi/token/index.js.map +1 -0
- package/dist/utils/index.d.ts +7 -7
- package/dist/utils/index.js +12 -14
- package/package.json +17 -15
- package/src/react/_internal/api/get-query-client.ts +3 -3
- package/src/react/_internal/api/marketplace.gen.ts +34 -10
- package/src/react/_internal/api/query-keys.ts +8 -0
- package/src/react/_internal/transaction-machine/execute-transaction.ts +592 -0
- package/src/react/_internal/transaction-machine/useTransactionMachine.ts +66 -0
- package/src/react/hooks/index.ts +7 -0
- package/src/react/hooks/useBuyCollectable.tsx +38 -0
- package/src/react/hooks/useCancelOrder.tsx +38 -0
- package/src/react/hooks/useCheckoutOptions.tsx +46 -43
- package/src/react/hooks/useCountOfCollectables.tsx +52 -52
- package/src/react/hooks/useCreateListing.tsx +65 -0
- package/src/react/hooks/useCurrencies.tsx +60 -60
- package/src/react/hooks/useCurrency.tsx +64 -0
- package/src/react/hooks/useGenerateBuyTransaction.tsx +71 -0
- package/src/react/hooks/useGenerateCancelTransaction.tsx +50 -0
- package/src/react/hooks/useListBalances.tsx +2 -3
- package/src/react/hooks/useListCollectibles.tsx +5 -6
- package/src/react/hooks/useListCollections.tsx +88 -0
- package/src/react/hooks/useListListingsForCollectible.tsx +61 -0
- package/src/react/hooks/useListOffersForCollectible.tsx +14 -16
- package/src/react/hooks/useMakeOffer.tsx +62 -0
- package/src/react/hooks/useRoyaltyPercentage.tsx +1 -1
- package/src/react/hooks/useSell.tsx +62 -0
- package/src/react/ui/components/_internals/action-button/ActionButton.tsx +156 -0
- package/src/react/ui/components/_internals/custom-network-image/CustomNetworkImage.tsx +27 -0
- package/src/react/ui/components/_internals/custom-network-image/styles.css.ts +51 -0
- package/src/react/ui/components/_internals/custom-select/CustomSelect.tsx +63 -0
- package/src/react/ui/components/_internals/custom-select/styles.css.ts +64 -0
- package/src/react/ui/components/_internals/pill/Pill.tsx +20 -0
- package/src/react/ui/components/collectible-card/CollectibleCard.tsx +191 -0
- package/src/react/ui/components/collectible-card/Footer.tsx +128 -0
- package/src/react/ui/components/collectible-card/styles.css.ts +62 -0
- package/src/react/ui/components/index.ts +1 -0
- package/src/react/ui/icons/Bell.tsx +31 -0
- package/src/react/ui/icons/DiamondEye.tsx +31 -0
- package/src/react/ui/images/chess-tile.png +0 -0
- package/src/react/ui/index.ts +4 -0
- package/src/react/ui/modals/BuyModal/_store.ts +53 -0
- package/src/react/ui/modals/BuyModal/index.tsx +119 -0
- package/src/react/ui/modals/CreateListingModal/_store.ts +35 -312
- package/src/react/ui/modals/CreateListingModal/index.tsx +216 -157
- package/src/react/ui/modals/MakeOfferModal/_store.ts +34 -276
- package/src/react/ui/modals/MakeOfferModal/index.tsx +195 -136
- package/src/react/ui/modals/SellModal/_store.ts +29 -262
- package/src/react/ui/modals/SellModal/index.tsx +156 -122
- package/src/react/ui/modals/SuccessfulPurchaseModal/_store.ts +17 -3
- package/src/react/ui/modals/SuccessfulPurchaseModal/index.tsx +3 -2
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +92 -92
- package/src/react/ui/modals/TransferModal/index.tsx +10 -17
- package/src/react/ui/modals/_internal/components/actionModal/ActionModal.tsx +1 -0
- package/src/react/ui/modals/_internal/components/actionModal/ErrorModal.tsx +18 -0
- package/src/react/ui/modals/_internal/components/actionModal/LoadingModal.tsx +18 -0
- package/src/react/ui/modals/_internal/components/calendarPopover/index.tsx +1 -0
- package/src/react/ui/modals/_internal/components/calendarPopover/overrides.css +8 -0
- package/src/react/ui/modals/_internal/components/calendarPopover/styles.css.ts +10 -4
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +10 -13
- package/src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx +23 -9
- package/src/react/ui/modals/_internal/components/priceInput/index.tsx +7 -18
- package/src/react/ui/modals/_internal/components/switchChainModal/index.tsx +17 -44
- package/src/react/ui/modals/_internal/components/switchChainModal/store.ts +10 -8
- package/src/react/ui/modals/_internal/components/tokenPreview/index.tsx +14 -3
- package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +4 -2
- package/src/react/ui/modals/_internal/components/transactionHeader/index.tsx +4 -4
- package/src/react/ui/modals/_internal/components/transactionPreview/index.tsx +4 -2
- package/src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx +13 -10
- package/src/react/ui/modals/_internal/types.ts +13 -0
- package/src/react/ui/modals/modal-provider.tsx +2 -1
- package/src/styles/index.ts +0 -2
- package/src/types/custom.d.ts +1 -0
- package/src/utils/abi/index.ts +2 -0
- package/src/utils/abi/marketplace/index.ts +3 -0
- package/src/utils/abi/marketplace/sequence-marketplace-v1.ts +463 -0
- package/src/utils/abi/marketplace/sequence-marketplace-v2.ts +802 -0
- package/src/utils/index.ts +2 -3
- package/src/utils/network.ts +4 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/chunk-4E34HVSA.js.map +0 -1
- package/dist/chunk-5EOVZAKT.js.map +0 -1
- package/dist/chunk-6JWGELXL.js +0 -214
- package/dist/chunk-6JWGELXL.js.map +0 -1
- package/dist/chunk-6S4FYXP6.js.map +0 -1
- package/dist/chunk-7OO74L2K.js.map +0 -1
- package/dist/chunk-BCNFYVAL.js +0 -1
- package/dist/chunk-CSN7YD5Q.js.map +0 -1
- package/dist/chunk-D7QQP6MS.js +0 -2
- package/dist/chunk-DBFOPEV6.js +0 -23
- package/dist/chunk-DBFOPEV6.js.map +0 -1
- package/dist/chunk-FCQCNLFZ.js.map +0 -1
- package/dist/chunk-GZIA25G4.js.map +0 -1
- package/dist/chunk-LFQB477Y.js.map +0 -1
- package/dist/chunk-MD4JHPMH.js +0 -2815
- package/dist/chunk-MD4JHPMH.js.map +0 -1
- package/dist/chunk-O5JXKTWP.js.map +0 -1
- package/dist/chunk-PE2LLUTJ.js +0 -213
- package/dist/chunk-PE2LLUTJ.js.map +0 -1
- package/dist/chunk-QVFMD6S2.js +0 -21
- package/dist/chunk-QVFMD6S2.js.map +0 -1
- package/dist/chunk-UYRQ5MJQ.js.map +0 -1
- package/dist/utils/abi/abi/standard/index.d.ts +0 -25
- package/dist/utils/abi/abi/standard/index.js +0 -8
- package/dist/utils/abi/clients/index.d.ts +0 -27
- package/dist/utils/abi/clients/index.js +0 -13
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/styles.css.ts +0 -33
- package/src/react/ui/modals/_internal/components/expirationDateSelect/styles.css.ts +0 -25
- package/src/utils/abi/abi/standard/index.ts +0 -1
- package/src/utils/abi/clients/ERC1155.ts +0 -82
- package/src/utils/abi/clients/ERC20.ts +0 -101
- package/src/utils/abi/clients/ERC721.ts +0 -97
- package/src/utils/abi/clients/index.ts +0 -3
- /package/dist/{chunk-BCNFYVAL.js.map → chunk-MCI3KOSQ.js.map} +0 -0
- /package/dist/{chunk-D7QQP6MS.js.map → chunk-UISBTKFF.js.map} +0 -0
- /package/dist/{utils/abi/abi/standard → react/ui/components}/index.js.map +0 -0
- /package/dist/utils/abi/{abi/token/index.js.map → index.js.map} +0 -0
- /package/dist/utils/abi/{clients → marketplace}/index.js.map +0 -0
- /package/dist/utils/abi/{abi/token → token}/index.d.ts +0 -0
- /package/src/utils/abi/{abi/standard → marketplace}/EIP2981.ts +0 -0
- /package/src/utils/abi/{abi/token → token}/ERC1155.ts +0 -0
- /package/src/utils/abi/{abi/token → token}/ERC20.ts +0 -0
- /package/src/utils/abi/{abi/token → token}/ERC721.ts +0 -0
- /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
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|