'Set transaction in metamask with api call using react js
I use TatumIO for creating NFT mp, this thing provides you to use api calls to make transactions like mint, sell, buy, create etc. A little explanation before question.
So, anyone knows how to send this api call to metamask, and get the private key for the body request ? I know that I nust use ethers js or web3, but have no idea
fetch(
"https://api-eu1.tatum.io/v3/blockchain/marketplace/listing/sell",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": X_API_KEY,
"x-testnet-type": "ethereum-rinkeby",
mode: "no-corse",
},
body: '{"chain":"ETH","contractAddress":" 0x3b2ca1396ef624abc6d446913afc37622085f6ca","nftAddress":"0xf5de760f2e916647fd766B4AD9E85ff943cE3A2b","seller":"0xbAAD6E65c6e4755d4c0753A9ca522d07B8270fF0","listingId":"2000","amount":"1","tokenId":"582618","price":"0.00001","isErc721":true,"fromPrivateKey":""}',
}
)
.then((response) => {
console.log(response);
})
.catch((err) => {
console.error(err);
});
Will glad to see your tips, thank you
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|