I am trying to buy an NFT on OpenSea, when executing the fulfillOrder() method, I get an error saying The requested acconut has not been authorized by the user
.
This is my code where I initialize the web3 provider and stuff:
this.web3 = new Web3(this.magic.rpcProvider);
const provider = new ethers.providers.Web3Provider(
window.ethereum,
"goerli"
);
this.seaport = new Seaport(provider);
Here is the code to buy the NFT:
const { executeAllActions } = await seaport.createOrder(
{
offer: [
{
amount: parseEther("0.27").toString(),
// WETH on goerli
token: "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6",
},
],
consideration: [
{
itemType: ItemType.ERC1155,
token: contractAddress,
identifier: tokenId,
recipient: walletAddress,
},
],
},
walletAddress
);
const order = await executeAllActions();
const { executeAllActions: executeAllFulfillActions } =
await seaport.fulfillOrder({
order,
accountAddress: "0x4b865b674e7a2258569f9275a48d0cb18e021588",
});
const transaction = executeAllFulfillActions();
console.log(transaction, "transaction");
The createOrder() makes me sign with my wallet, and I even get all the way to the console log at the bottom and it does in fact log the transaction. But then Metamask throws this error: