Skip to content

Instantly share code, notes, and snippets.

@arefaslani
Created July 30, 2020 06:03
Show Gist options
  • Save arefaslani/43168d993aa93a753e1076dcfc08bb69 to your computer and use it in GitHub Desktop.
Save arefaslani/43168d993aa93a753e1076dcfc08bb69 to your computer and use it in GitHub Desktop.
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