Hi. Completed the tutorial about âAmazon clone with Moralisâ. Itâs not working. Here is the part where am having an issue:
import { Select, Button, Modal, Input } from 'antd'
import { ShoppingCartOutlined } from '@ant-design/icons'
import { useState } from 'react'
import { useMoralis } from 'react-moralis'
const { Option } = Select
function Purchase({ book }) {
const [isModalVisible, setIsModalVisible] = useState(false)
const [delivery, setDelivery] = useState('')
const { Moralis, account } = useMoralis()
const handleOk = async () => {
// Get The Price of MATIC
const options = {
address: '0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0',
chain: 'eth',
}
const price = await Moralis.Web3API.token.getTokenPrice(options)
const priceMatic = book.price / price.usdPrice
// Send Matic to book store owner address
const options1 = {
type: 'native',
amount: Moralis.Units.ETH(priceMatic),
receiver: '0xf6aE1d525c27Dd2fd4Fc71ce56a7e10Eb71d2***',
}
let result = await Moralis.transfer(options1)
when pressing the âokâ button Metamask does not pop up to complete the transfer.
Tried to even copy the code from projectâs github, still not working.
Someone advised me to somehow use âawait Moralis.enableWeb3()ââŚstill no result.
So, does the tutorial contain a mistake? Or what the hell am I doing wrong?!
The dude kept on saying âhow awesome is that, one line of code one line of codeâŚâ one line of code seems not to be working))))