Example of code below producing error -the Error: "Error: Server Error: Validation error: Private transactions should not include marketplace fees."
Code worked fine 6 months ago. Just updated OpenSea apiKey aswell
import { ethers, JsonRpcProvider } from "ethers";
import { OpenSeaSDK, Chain } from "opensea-js";
import csv from "csvtojson";
const provider = new JsonRpcProvider(
"https://eth-mainnet.g.alchemy.com/v2/###################",
);
const PRIVATE_KEY = "###################"
const walletWithProvider = new ethers.Wallet(PRIVATE_KEY, provider);
const openseaSDK = new OpenSeaSDK(walletWithProvider, {
chain: Chain.Mainnet,
apiKey: "###################",
});
const CSV_FILE_PATH = "####";
const buyerAddresses = await csv().fromFile(CSV_FILE_PATH);
onst tokenAddress = "###################";
const tokenId = "###################";
const expirationTime = Math.round(Date.now() / 1000 + 60 * 60 * 24 * 181);
const accountAddress = "###################"; //
for (let i = 0; i <= buyerAddresses.length; i++) {
const buyerAdd = buyerAddresses[i];
const buyerAddress = buyerAdd.address;
console.log("NFT Token ID: " + tokenId + "," + " Private Listed to: " + buyerAddress + " - Expires in :" + expirationTime);
const run = async () => {
try {
const listing = await openseaSDK.createListing({
asset: {
tokenId,
tokenAddress,
},
tokenType: 'ERC1155',
accountAddress,
quantity: "1",
startAmount: "0.0001",
buyerAddress,
expirationTime,
});
} catch(e) {
console.log(e);
await run();
}
return
}
await run();
}
Component
API
Have you ensured that all of these are up to date?
What version of opensea-js are you on?
7.1.22
What function is the bug in?
openseaSDK.createListing
Operating System
Linux
Describe the bug
Example of code below producing error -the Error: "Error: Server Error: Validation error: Private transactions should not include marketplace fees."
Code worked fine 6 months ago. Just updated OpenSea apiKey aswell
Any ideas?