Created
April 30, 2021 02:41
-
-
Save apow2/1baa1a646e536f26aab7456caaf20550 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
export const transfer= (contract) => (to) => async (tokenId) => { | |
let myContract = await contract; | |
try { | |
let tx = await get(web3).eth.sendTransaction({ | |
gasPrice: get(web3).utils.toHex(get(web3).utils.toWei("225", "gwei")), | |
gasLimit: get(web3).utils.toHex("600000"), | |
from: get(selectedAccount), | |
to: contractAddress, | |
data: myContract.methods.transfer(to, tokenId).encodeABI(), | |
}); | |
console.log("Receipt from transfer", tx); | |
alert("Your Item has been transferred!"); | |
} catch (err) { | |
console.warn("Error: " + err); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment