Created
July 30, 2020 06:03
-
-
Save arefaslani/43168d993aa93a753e1076dcfc08bb69 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const startMint = async () => { | |
setIsMinting(true); | |
const user = await magic.user.getMetadata(); | |
contract.mint({ | |
from: user.publicAddress, | |
id: license.offering.id, | |
amount: values.amount, | |
onTransactionCreated: transactionHash => { | |
setField("transactionHash", transactionHash); | |
}, | |
onComplete: () => setIsMinting(false) | |
}); | |
}; | |
// ... | |
useEffect(() => { | |
biconomy | |
.onEvent(biconomy.READY, async () => { | |
setBiconomyReady(true); | |
}) | |
.onEvent(biconomy.ERROR, (error, message) => { | |
setFieldError("transactionHash", message); | |
}); | |
}, []); | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment