From 61c77c0937328b8841d6a8959aae822899fb1bae Mon Sep 17 00:00:00 2001 From: samuelea Date: Mon, 16 Dec 2024 12:46:08 -0500 Subject: [PATCH] remove options api hook from demo --- examples/react/src/components/Connected.tsx | 82 ++++++++++----------- 1 file changed, 37 insertions(+), 45 deletions(-) diff --git a/examples/react/src/components/Connected.tsx b/examples/react/src/components/Connected.tsx index eb181c85..22c030a3 100644 --- a/examples/react/src/components/Connected.tsx +++ b/examples/react/src/components/Connected.tsx @@ -7,13 +7,7 @@ import { validateEthProof, getModalPositionCss } from '@0xsequence/kit' -import { - useCheckoutModal, - useAddFundsModal, - useERC1155SaleContractPaymentModal, - useSwapModal, - useERC1155SaleContractCheckout -} from '@0xsequence/kit-checkout' +import { useCheckoutModal, useAddFundsModal, useERC1155SaleContractPaymentModal, useSwapModal } from '@0xsequence/kit-checkout' import type { SwapModalSettings } from '@0xsequence/kit-checkout' import { CardButton, Header } from '@0xsequence/kit-example-shared-components' import { useOpenWalletModal } from '@0xsequence/kit-wallet' @@ -47,8 +41,7 @@ export const Connected = () => { const { setOpenWalletModal } = useOpenWalletModal() const { triggerCheckout } = useCheckoutModal() const { triggerAddFunds } = useAddFundsModal() - // const { openERC1155SaleContractPaymentModal } = useERC1155SaleContractPaymentModal() - const { openCheckoutModal } = useERC1155SaleContractCheckout(getErc1155SaleContractConfig(address || '')) + const { openERC1155SaleContractPaymentModal } = useERC1155SaleContractPaymentModal() const { data: walletClient } = useWalletClient() const storage = useStorage() @@ -339,42 +332,41 @@ export const Connected = () => { // const contractId = '674eb55a3d739107bbd18ecb' // // ERC-20 contract - // const currencyAddress = '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359' - // const salesContractAddress = '0xe65b75eb7c58ffc0bf0e671d64d0e1c6cd0d3e5b' - // const collectionAddress = '0xdeb398f41ccd290ee5114df7e498cf04fac916cb' - // const price = '20000' - // const contractId = '674eb5613d739107bbd18ed2' - - // const chainId = 137 - - // openERC1155SaleContractPaymentModal({ - // collectibles: [ - // { - // tokenId: '1', - // quantity: '1' - // } - // ], - // chain: chainId, - // price, - // targetContractAddress: salesContractAddress, - // recipientAddress: address, - // currencyAddress, - // collectionAddress, - // creditCardProviders: ['sardine', 'transak'], - // transakConfig: { - // contractId, - // apiKey: '5911d9ec-46b5-48fa-a755-d59a715ff0cf' - // }, - // isDev: false, - // copyrightText: 'ⓒ2024 Sequence', - // onSuccess: (txnHash: string) => { - // console.log('success!', txnHash) - // }, - // onError: (error: Error) => { - // console.error(error) - // } - // }) - openCheckoutModal() + const currencyAddress = '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359' + const salesContractAddress = '0xe65b75eb7c58ffc0bf0e671d64d0e1c6cd0d3e5b' + const collectionAddress = '0xdeb398f41ccd290ee5114df7e498cf04fac916cb' + const price = '20000' + const contractId = '674eb5613d739107bbd18ed2' + + const chainId = 137 + + openERC1155SaleContractPaymentModal({ + collectibles: [ + { + tokenId: '1', + quantity: '1' + } + ], + chain: chainId, + price, + targetContractAddress: salesContractAddress, + recipientAddress: address, + currencyAddress, + collectionAddress, + creditCardProviders: ['sardine', 'transak'], + transakConfig: { + contractId, + apiKey: '5911d9ec-46b5-48fa-a755-d59a715ff0cf' + }, + isDev: false, + copyrightText: 'ⓒ2024 Sequence', + onSuccess: (txnHash: string) => { + console.log('success!', txnHash) + }, + onError: (error: Error) => { + console.error(error) + } + }) } const onCheckoutInfoConfirm = () => {