I want to create listing via OpenSea API with Python. I have response: {"errors":["['Invalid order signature']"]}. I couldn't find and information in docs what to sign. Currently I am signing Order Parameters. Here is my code: import requests from web3.auto import w3 from eth_account.messages import encode_defunct import time def create_order_model(): current_time = int(time.time()) order = { "offerer": "0xd107AC5e5830BB95f880cA3b1270ccCdAA0A3c5e", "zone": "0x00000000e88fe2628ebc5da81d2b3cead633e89e", "zoneHash": "0x3000000000000000000000000000000000000000000000000000000000000000", "startTime": current_time, "endTime": current_time + 2629743, # current_time + 1 month in seconds "orderType": 2, "offer": [ { "itemType": 2, "token": "0x45aeb17Db4dd06FF9Ca6cB1E37455AAF761Bdc14", "identifierOrCriteria": "1", "startAmount": "1", "endAmount": "1", }, ], "consideration": [ { "itemType": 0, "token": "0x0000000000000000000000000000000000000000", "identifierOrCriteria": "0", "startAmount": "9750000000000000000", "endAmount": "9750000000000000000", "recipient": "0xd107AC5e5830BB95f880cA3b1270ccCdAA0A3c5e", }, { "itemType": 0, "token": "0x0000000000000000000000000000000000000000", "identifierOrCriteria": "0", "startAmount": "250000000000000000", "endAmount": "250000000000000000", "recipient": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", }, ], "totalOriginalConsiderationItems": 2, "salt": 12686911856931635052326433555881236148, "conduitKey": "0x0000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f0000", "nonce": 0, "counter": 0 } return order def sing_order(msg): private_key = "PRIVATE_KEY" message = encode_defunct(text=str(msg)) signed_message = w3.eth.account.sign_message(message, private_key=private_key) return signed_message.signature.hex() def main(): url = "https://testnets-api.opensea.io/v2/orders/goerli/seaport/listings" headers = { "accept": "application/json", "content-type": "application/json" } order_parameters = create_order_model() print(order_parameters) signature = sing_order(order_parameters) print(signature) params = {"parameters": order_parameters, "signature": str(signature)} response = requests.post(url, headers=headers, json=params) print(response.text) if __name__ == '__main__': main() Inside seaport-js(SDK for javascript: https://github.com/ProjectOpenSea/s...ee57735ad17f2bdb4a91ac7c6/src/seaport.ts#L386) I found that there is function to sign data singOrder() and tried to convert this idea to Python. This is how converted by me sign_order look: def sing_order(msg): private_key = "PRIVATE_KEY" domain_data = { "name": "Seaport", "version": "1.1", "chainId": 5, "verifyingContract": "0x00000000e88fe2628ebc5da81d2b3cead633e89e", } eip_721_order_type = { "OrderComponents": [ {"name": "offerer", "type": "address"}, {"name": "zone", "type": "address"}, {"name": "offer", "type": "OfferItem[]"}, {"name": "consideration", "type": "ConsiderationItem[]"}, {"name": "orderType", "type": "uint8"}, {"name": "startTime", "type": "uint256"}, {"name": "endTime", "type": "uint256"}, {"name": "zoneHash", "type": "bytes32"}, {"name": "salt", "type": "uint256"}, {"name": "conduitKey", "type": "bytes32"}, {"name": "counter", "type": "uint256"}, ], "OfferItem": [ {"name": "itemType", "type": "uint8"}, {"name": "token", "type": "address"}, {"name": "identifierOrCriteria", "type": "uint256"}, {"name": "startAmount", "type": "uint256"}, {"name": "endAmount", "type": "uint256"}, ], "ConsiderationItem": [ {"name": "itemType", "type": "uint8"}, {"name": "token", "type": "address"}, {"name": "identifierOrCriteria", "type": "uint256"}, {"name": "startAmount", "type": "uint256"}, {"name": "endAmount", "type": "uint256"}, {"name": "recipient", "type": "address"}, ], } order_components = str(msg) message = encode_defunct(text=(str(domain_data) + str(eip_721_order_type) + str(order_components))) signed_message = w3.eth.account.sign_message(message, private_key=private_key) return signed_message.signature.hex() Do you know how to properly sign an order that will be acceptable by OpenSea API? Continue reading...