To sell NFTs for ETH on the IMX marketplace, I am able to place sell orders for ERC721tokens like this:
const orderData = {
buy: {
amount: tokentosell.sellprice,
type: 'ETH'
},
sell: {
amount: '1',
tokenAddress: tokentosell.token_address,
tokenId: tokentosell.token_id,
type: 'ERC721',
},
fees: [
{
address: '0x383b14727ac2bD3923f1583789d5385C3A26f91E',
fee_percentage: 0.5,
},
],
} as unknown as UnsignedOrderRequest;
const createOrder = async (
wallet: WalletConnection, // WalletConnection containing the L1 and L2 signers
orderData: UnsignedOrderRequest // Order Data from the previous step
) => {
const response = await client.createOrder(wallet, orderData);
return response;
};
createOrder(wallet, orderData)
.then((result) => {
console.log(result);
})
.catch((e) => {
console.log(e);
});
But I do not have a clue how to sell them for ERC20 tokens. I would think the call would at least need the token address of the ERC20 token (GODS) but UnsignedOrderRequest interface does not even have that option.
Any tips?