-1

i was trying to write a trading bot with x2y2 api, one instruction from x2y2 confused me:

Before creating listings, the signer must approve the item's transfer by the X2Y2: ERC 721 Delegate contract with the setApprovalForAll function on the item's contract. https://x2y2.readme.io/reference/creating-orderslistings

i tried to interact with the nft contract by python

w3 = Web3(Web3.HTTPProvider(node_url, request_kwargs={"proxies": proxy}))

contract = w3.eth.contract(address=nft_contract_addr, abi=nft_abi)
contract.functions.setApprovalForAll(contract_addr, True)

but the setApprovalForAll function from this nft contract abi(0x705B9DBD0D5607BEAFe12E2fB74d64268d3bA35F) doesn't receive my wallet address or signer as a parameter,how do I correctly interact with the nft contract to approve x2y2 list my all nfts?

TylerH
  • 20,799
  • 66
  • 75
  • 101

1 Answers1

0

it depends on whether you add your wallet on web3 middle ware or not. if you are not you can use buildTransaction like this

tx = contract.functions.setApprovalForAll(contract_addr, True).buildTransaction(
        {
            "from" : account,
            "nonce": nonce,
        }
    )
Mun_sunouk
  • 11
  • 4