Skip to content

Commit

Permalink
remove options api hook from demo
Browse files Browse the repository at this point in the history
  • Loading branch information
SamueleA committed Dec 16, 2024
1 parent 0f11d34 commit 61c77c0
Showing 1 changed file with 37 additions and 45 deletions.
82 changes: 37 additions & 45 deletions examples/react/src/components/Connected.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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 = () => {
Expand Down

0 comments on commit 61c77c0

Please sign in to comment.