Names support for Vending Minter dashboard > Execute
This commit is contained in:
parent
c28d1bbd09
commit
3706102a39
@ -25,6 +25,7 @@ import { FaArrowRight } from 'react-icons/fa'
|
|||||||
import { useMutation } from 'react-query'
|
import { useMutation } from 'react-query'
|
||||||
import { withMetadata } from 'utils/layout'
|
import { withMetadata } from 'utils/layout'
|
||||||
import { links } from 'utils/links'
|
import { links } from 'utils/links'
|
||||||
|
import { resolveAddress } from 'utils/resolveAddress'
|
||||||
|
|
||||||
const VendingMinterExecutePage: NextPage = () => {
|
const VendingMinterExecutePage: NextPage = () => {
|
||||||
const { vendingMinter: contract } = useContracts()
|
const { vendingMinter: contract } = useContracts()
|
||||||
@ -32,6 +33,7 @@ const VendingMinterExecutePage: NextPage = () => {
|
|||||||
const [lastTx, setLastTx] = useState('')
|
const [lastTx, setLastTx] = useState('')
|
||||||
|
|
||||||
const [timestamp, setTimestamp] = useState<Date | undefined>(undefined)
|
const [timestamp, setTimestamp] = useState<Date | undefined>(undefined)
|
||||||
|
const [resolvedRecipientAddress, setResolvedRecipientAddress] = useState<string>('')
|
||||||
|
|
||||||
const comboboxState = useExecuteComboboxState()
|
const comboboxState = useExecuteComboboxState()
|
||||||
const type = comboboxState.value?.id
|
const type = comboboxState.value?.id
|
||||||
@ -94,7 +96,7 @@ const VendingMinterExecutePage: NextPage = () => {
|
|||||||
contract: contractState.value,
|
contract: contractState.value,
|
||||||
tokenId: tokenIdState.value,
|
tokenId: tokenIdState.value,
|
||||||
messages,
|
messages,
|
||||||
recipient: recipientState.value,
|
recipient: resolvedRecipientAddress,
|
||||||
txSigner: wallet.address,
|
txSigner: wallet.address,
|
||||||
price: priceState.value ? priceState.value.toString() : '0',
|
price: priceState.value ? priceState.value.toString() : '0',
|
||||||
type,
|
type,
|
||||||
@ -183,6 +185,15 @@ const VendingMinterExecutePage: NextPage = () => {
|
|||||||
if (initial && initial.length > 0) contractState.onChange(initial)
|
if (initial && initial.length > 0) contractState.onChange(initial)
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
const resolveRecipientAddress = async () => {
|
||||||
|
await resolveAddress(recipientState.value.trim(), wallet).then((resolvedAddress) => {
|
||||||
|
setResolvedRecipientAddress(resolvedAddress)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
useEffect(() => {
|
||||||
|
void resolveRecipientAddress()
|
||||||
|
}, [recipientState.value])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="py-6 px-12 space-y-4">
|
<section className="py-6 px-12 space-y-4">
|
||||||
<NextSeo title="Execute Vending Minter Contract" />
|
<NextSeo title="Execute Vending Minter Contract" />
|
||||||
|
Loading…
Reference in New Issue
Block a user