0x-api icon indicating copy to clipboard operation
0x-api copied to clipboard

Questions about errors

Open Disti4ct opened this issue 4 years ago • 1 comments

  • how fast 0x can find a new liquidity pool? I created a new one on the Ropsten testnet few days ago, but any way get this error {"field":"sellAmount","code":1004,"reason":"INSUFFICIENT_ASSET_LIQUIDITY"}

  • what does this error mean:

1008 Internal error

I got it when I was trying to post a new limit order. A response error: {code: 1008, field: "signedOrder[0]", reason: "Internal error"}

It happened when I've created a new signature with private key await order.getSignatureWithKey(privateKey)


I made all strings in the lower case and got this. There are no specific errors in the array: {code: 100, reason: "Validation Failed", validationErrors: Array(0)}

Code for this step:

  const order = new LimitOrder({
    chainId,
    verifyingContract: '0xdef1c0ded9bec7f1a1670819833240f027b25eff'.toLowerCase(),
    makerToken: makerAssetAddress.toLowerCase(),
    takerToken: takerAssetAddress.toLowerCase(),
    makerAmount: new BigNumber(makerUnitAmount),
    takerAmount: new BigNumber(takerUnitAmount),
    maker: makerAddress.toLowerCase(),
    expiry: new BigNumber(now).plus(expiresInSec),
    salt: new BigNumber(now),
    takerTokenFeeAmount: new BigNumber(0),
    taker: NULL_ADDRESS,
    sender: NULL_ADDRESS,
    pool: NULL_ADDRESS,
    feeRecipient: NULL_ADDRESS,
  })

  order.signature = await order.getSignatureWithKey(privateKey.toLowerCase())

Disti4ct avatar Aug 20 '21 07:08 Disti4ct

This code doesn't work. The order the same as above, but in this case let me show how I sign through a web3 provider:

  const web3 = new Web3(
    new Web3.providers.HttpProvider('https://ropsten.infura.io/v3/....')
  )

  const signature = await order.getSignatureWithProviderAsync(
    web3.currentProvider,
    SignatureType.EIP712
  )

Screenshot 2021-08-20 02:05:12 source line

methond send in the http provider package does not return a Promise. source method. It uses a callback method

Disti4ct avatar Aug 24 '21 10:08 Disti4ct