Opensea_postorder fails with 400

Hi,
I am using latest moralisreact-moralis package
my opensea_postorder returns 400

Following is my payload for the createsellorder
{“network”:“testnet”,“tokenAddress”:“0x447e265c12b0d8456f49676bbeeef8ee0e1a905c”,“tokenId”:2,“tokenType”:“ERC721”,“userAddress”:“0x55b5f999f01afb57c1a12eedadfa60ac20568839”,“startAmount”:“0.3”,“endAmount”:“0.29”,“expirationTime”:1657224512,"_ApplicationId":“UTXuksOchvpn3kDAheA0Oz8Z6mIrvDoRe5V483NC”,"_ClientVersion":“js1.8.1”,"_InstallationId":“d2515cf2-b48f-4281-91a2-3139f21535fd”,"_SessionToken":“r:234234”}

Your help is appreciated

1 Like

on what chain it happens? what is the response in that image (3 tabs to the right)?

1 Like

I am using rinkeby.
Following is the response
{“code”:141,“error”:{“status”:502,“headers”:{“x-powered-by”:“Express”,“access-control-allow-origin”:"*",“content-type”:“application/json; charset=utf-8”,“content-length”:“14”,“etag”:“W/“e-Tj8n9olBUMQK0x0qT7YAC46tguk””,“x-response-time”:“1575.331ms”,“date”:“Thu, 07 Jul 2022 19:08:57 GMT”,“connection”:“close”},“buffer”:{“type”:“Buffer”,“data”:[123,34,101,114,114,111,114,34,58,116,114,117,101,125]},“text”:"{“error”:true}",“data”:{“error”:true}}}

1 Like

can you paste the server url?

do you have latest version of opensea plugin?

1 Like

Following is the request url

https://auove3impct1.usemoralis.com:2053/server/functions/opensea_postOrder

Yes its latest version of Opensea plugin

1 Like

I don’t know what is the issue, maybe these numbers have to be in Wei?

1 Like

I have converted it to wei
{“network”:“testnet”,“tokenAddress”:“0x447e265c12b0d8456f49676bbeeef8ee0e1a905c”,“tokenId”:4,“tokenType”:“ERC721”,“userAddress”:“0x55b5f999f01afb57c1a12eedadfa60ac20568839”,“startAmount”:“300000000000000000”,“endAmount”:“290000000000000000”,“expirationTime”:1657303169,"_ApplicationId":“UTXuksOchvpn3kDAheA0Oz8Z6mIrvDoRe5V483NC”,"_ClientVersion":“js1.8.0”,"_InstallationId":“eb809d5c-1dab-403f-8303-60113e76dc63”,"_SessionToken":“r:35875a4fe040830442e849de6a5d717a”}

still postOrder is failing

request payload for post order is
{“message”:"{“types”:{“EIP712Domain”:[{“name”:“name”,“type”:“string”},{“name”:“version”,“type”:“string”},{“name”:“chainId”,“type”:“uint256”},{“name”:“verifyingContract”,“type”:“address”}],“Order”:[{“name”:“exchange”,“type”:“address”},{“name”:“maker”,“type”:“address”},{“name”:“taker”,“type”:“address”},{“name”:“makerRelayerFee”,“type”:“uint256”},{“name”:“takerRelayerFee”,“type”:“uint256”},{“name”:“makerProtocolFee”,“type”:“uint256”},{“name”:“takerProtocolFee”,“type”:“uint256”},{“name”:“feeRecipient”,“type”:“address”},{“name”:“feeMethod”,“type”:“uint8”},{“name”:“side”,“type”:“uint8”},{“name”:“saleKind”,“type”:“uint8”},{“name”:“target”,“type”:“address”},{“name”:“howToCall”,“type”:“uint8”},{“name”:“calldata”,“type”:“bytes”},{“name”:“replacementPattern”,“type”:“bytes”},{“name”:“staticTarget”,“type”:“address”},{“name”:“staticExtradata”,“type”:“bytes”},{“name”:“paymentToken”,“type”:“address”},{“name”:“basePrice”,“type”:“uint256”},{“name”:“extra”,“type”:“uint256”},{“name”:“listingTime”,“type”:“uint256”},{“name”:“expirationTime”,“type”:“uint256”},{“name”:“salt”,“type”:“uint256”},{“name”:“nonce”,“type”:“uint256”}]},“domain”:{“name”:“Wyvern Exchange Contract”,“version”:“2.3”,“chainId”:4,“verifyingContract”:“0xdd54d660178b28f6033a953b0e55073cfa7e3744”},“primaryType”:“Order”,“message”:{“maker”:“0x55b5f999f01afb57c1a12eedadfa60ac20568839”,“exchange”:“0xdd54d660178b28f6033a953b0e55073cfa7e3744”,“taker”:“0x0000000000000000000000000000000000000000”,“makerRelayerFee”:“250”,“takerRelayerFee”:“0”,“makerProtocolFee”:“0”,“takerProtocolFee”:“0”,“feeRecipient”:“0x5b3256965e7c3cf26e11fcaf296dfc8807c01073”,“feeMethod”:1,“side”:1,“saleKind”:1,“target”:“0x447e265c12b0d8456f49676bbeeef8ee0e1a905c”,“howToCall”:0,“calldata”:“0x23b872dd00000000000000000000000055b5f999f01afb57c1a12eedadfa60ac2056883900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004”,“replacementPattern”:“0x000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000”,“staticTarget”:“0x0000000000000000000000000000000000000000”,“staticExtradata”:“0x”,“paymentToken”:“0x0000000000000000000000000000000000000000”,“basePrice”:“300000000000000000000000000000000000”,“extra”:“10000000000000000000000000000000000”,“listingTime”:“1657299477”,“expirationTime”:“1657303169”,“salt”:“75881639447718648994744769966839365430216416546271016294301609840938728010806”,“nonce”:0}}",“orderSide”:1,“signature”:“0x5e6b128c604ef14d84ad4353647d8a2de1715c86935737b93dca698170fb81e24fed92bdbc66bdfe080087ca61f14a1c1a415b0f33ccc9fa643d5333eb72292f1c”,"_ApplicationId":“UTXuksOchvpn3kDAheA0Oz8Z6mIrvDoRe5V483NC”,"_ClientVersion":“js1.8.0”,"_InstallationId":“eb809d5c-1dab-403f-8303-60113e76dc63”,"_SessionToken":“r:35875a4fe040830442e849de6a5d717a”}

following is response

{“code”:141,“error”:{“status”:502,“headers”:{“x-powered-by”:“Express”,“access-control-allow-origin”:"*",“content-type”:“application/json; charset=utf-8”,“content-length”:“14”,“etag”:“W/“e-Tj8n9olBUMQK0x0qT7YAC46tguk””,“x-response-time”:“1307.651ms”,“date”:“Fri, 08 Jul 2022 16:59:47 GMT”,“connection”:“close”},“buffer”:{“type”:“Buffer”,“data”:[123,34,101,114,114,111,114,34,58,116,114,117,101,125]},“text”:"{“error”:true}",“data”:{“error”:true}}}

1 Like

i have the same problem

it is happenning in rinkeby. and it doesn’t show the exact error just says “error: true”. please fix it asap.

can you share more of your code that you use?

await Moralis.Plugins.opensea.createBuyOrder({
        network: "testnet",
        tokenAddress: "0x5812693d19b203175f4b888312f52fd0e1fdd992",
        tokenId: 1,
        tokenType: "ERC721",
        amount: 0.01,
        userAddress: web3Account,
        paymentTokenAddress: "0xc778417e063141139fce010982780140aa0cd5ab",
      });

it’s not the code trust me. I’m just using the exact same code in the docs. it even gets the signature but after that, it gets that error from the server.

This is all I see in logs:

POST /postOrder 502

no more details

1 Like

Exactly, what is the problem then?

My Request Payload:

message: "{\"types\":{\"EIP712Domain\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"version\",\"type\":\"string\"},{\"name\":\"chainId\",\"type\":\"uint256\"},{\"name\":\"verifyingContract\",\"type\":\"address\"}],\"Order\":[{\"name\":\"exchange\",\"type\":\"address\"},{\"name\":\"maker\",\"type\":\"address\"},{\"name\":\"taker\",\"type\":\"address\"},{\"name\":\"makerRelayerFee\",\"type\":\"uint256\"},{\"name\":\"takerRelayerFee\",\"type\":\"uint256\"},{\"name\":\"makerProtocolFee\",\"type\":\"uint256\"},{\"name\":\"takerProtocolFee\",\"type\":\"uint256\"},{\"name\":\"feeRecipient\",\"type\":\"address\"},{\"name\":\"feeMethod\",\"type\":\"uint8\"},{\"name\":\"side\",\"type\":\"uint8\"},{\"name\":\"saleKind\",\"type\":\"uint8\"},{\"name\":\"target\",\"type\":\"address\"},{\"name\":\"howToCall\",\"type\":\"uint8\"},{\"name\":\"calldata\",\"type\":\"bytes\"},{\"name\":\"replacementPattern\",\"type\":\"bytes\"},{\"name\":\"staticTarget\",\"type\":\"address\"},{\"name\":\"staticExtradata\",\"type\":\"bytes\"},{\"name\":\"paymentToken\",\"type\":\"address\"},{\"name\":\"basePrice\",\"type\":\"uint256\"},{\"name\":\"extra\",\"type\":\"uint256\"},{\"name\":\"listingTime\",\"type\":\"uint256\"},{\"name\":\"expirationTime\",\"type\":\"uint256\"},{\"name\":\"salt\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"}]},\"domain\":{\"name\":\"Wyvern Exchange Contract\",\"version\":\"2.3\",\"chainId\":4,\"verifyingContract\":\"0xdd54d660178b28f6033a953b0e55073cfa7e3744\"},\"primaryType\":\"Order\",\"message\":{\"maker\":\"0xbc017240e4f8591dc731c81ff4320f748c58245c\",\"exchange\":\"0xdd54d660178b28f6033a953b0e55073cfa7e3744\",\"taker\":\"0x0000000000000000000000000000000000000000\",\"makerRelayerFee\":\"0\",\"takerRelayerFee\":\"250\",\"makerProtocolFee\":\"0\",\"takerProtocolFee\":\"0\",\"feeRecipient\":\"0x5b3256965e7c3cf26e11fcaf296dfc8807c01073\",\"feeMethod\":1,\"side\":0,\"saleKind\":0,\"target\":\"0x45b594792a5cdc008d0de1c1d69faa3d16b3ddc1\",\"howToCall\":1,\"calldata\":\"0xfb16a5950000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bc017240e4f8591dc731c81ff4320f748c58245c0000000000000000000000005812693d19b203175f4b888312f52fd0e1fdd9920000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000\",\"replacementPattern\":\"0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"staticTarget\":\"0x0000000000000000000000000000000000000000\",\"staticExtradata\":\"0x\",\"paymentToken\":\"0xc778417e063141139fce010982780140aa0cd5ab\",\"basePrice\":\"10000000000000000\",\"extra\":\"0\",\"listingTime\":\"1657373415\",\"expirationTime\":\"1657891915\",\"salt\":\"60305269590030726079528815861115489691181610983694980174615687559223482418029\",\"nonce\":0}}"
orderSide: 0
signature: "0x673772ccef58fdb9484cb69b5d076b809823a1562c61bf51e129ca403d5148a57fcfeff9ecfd054b58c024c586c49dfa27774dd2fb5549723fd58942274d15d21c"
_ApplicationId: "jp3gNi5x4g8SJfBJZFxsgBoSrRFXkztFmowsRkta"
_ClientVersion: "js1.8.1"
_InstallationId: "979cafa1-2c60-4b54-95e0-ad3ab36efd29"
_SessionToken: "r:d82bd0a3aa8b695dcce4ef016deca790"

Response: (400 status code): https://qxoiwnjve7kx.usemoralis.com:2053/server/functions/opensea_postOrder

code: 141
error: {status: 502, headers: {x-powered-by: "Express", access-control-allow-origin: "*",…},…}
buffer: {type: "Buffer", data: [123, 34, 101, 114, 114, 111, 114, 34, 58, 116, 114, 117, 101, 125]}
data: [123, 34, 101, 114, 114, 111, 114, 34, 58, 116, 114, 117, 101, 125]
type: "Buffer"
data: {error: true}
headers: {x-powered-by: "Express", access-control-allow-origin: "*",…}
status: 502
text: "{\"error\":true}"

what should i do?

you could try to use the opensea API directly, I don’t know if that would be easier

what are the steps to reproduce that error?
starting from 0

to create a buy order first you connect your metamask to the site. then you go for creating the order. for that you need to sign some data. after you sign that it sends the signature and data to moralis server. that’s where the error happens. remember moralis does all of these steps you just give it some data.

there is a reason. we have to use moralis

I mean, the code that you execute for those steps, it is only that code that you pasted, nothing more?

yes, you can check the documentation,

it is not the code even if it was, Moralis should send the error detail so I can find out which part is wrong.

Any update over this issue
as i am still facing same