import React, { useEffect, useState } from 'react'; import { WalletMultiButton } from '@solana/wallet-adapter-ant-design'; import { useAnchorWallet } from '@solana/wallet-adapter-react'; import { web3 } from '@project-serum/anchor'; import { CandyShop } from '../core/sdk/.'; import { Orders, Stat, OrderDetail, Sell } from '../core/ui/.'; import { CANDY_SHOP_PROGRAM_ID, CREATOR_ADDRESS, TREASURY_MINT } from './constant/publicKey'; import 'antd/dist/antd.min.css'; interface CandyShopContentProps { network: web3.Cluster; } export const CandyShopContent: React.FC = ({ network }) => { const [candyShop, setCandyShop] = useState(); const [treasuryMint] = useState(new web3.PublicKey(TREASURY_MINT)); const wallet = useAnchorWallet(); useEffect(() => { if (!treasuryMint) return; setCandyShop( new CandyShop( new web3.PublicKey(CREATOR_ADDRESS), treasuryMint, new web3.PublicKey(CANDY_SHOP_PROGRAM_ID), network, { mainnetConnectionUrl: 'https://ssc-dao.genesysgo.net/' } ) ); }, [treasuryMint, network]); if (!candyShop) return null; return (
} filters={FILTERS} />

Order Detail

} wallet={wallet} />

Sell

} />
); }; const FILTERS = [ { name: 'Puppies', identifier: 2036309415 }, { name: 'Smilies', identifier: -38328789 }, { name: 'Puppies + Smilies', identifier: [-38328789, 2036309415] } ];