opensea-js icon indicating copy to clipboard operation
opensea-js copied to clipboard

Number underflow when try to use fractional ETH in order

Open MaximusDecimus opened this issue 3 years ago • 5 comments

		const listing = await openseaSDK.createSellOrder({
			asset: {
				tokenId,
				tokenAddress,
			},
			accountAddress,
			startAmount: 0.1,
			expirationTime
		})

Causes error

underflow [ See: https://links.ethers.org/v5-errors-NUMERIC_FAULT-underflow ] (fault="underflow", operation="BigNumber.from", value=0.1, code=NUMERIC_FAULT, version=bignumber/5.7.0)

MaximusDecimus avatar Jun 02 '23 12:06 MaximusDecimus

I am having a hard time reproducing the error on my end. Can you let me know what tokenAddress you are using? Also if you could send over the entire error logs it could be helpful.

JoshuaSchmidt-OpenSea avatar Jun 02 '23 14:06 JoshuaSchmidt-OpenSea

@JoshuaSchmidt-OpenSea Hey Please find the real payload example below

{
    "asset": {
        "tokenId": "2254",
        "tokenAddress": "0x7172b87400b850069c425ecd18f2c2553b7fb479"
    },
    "accountAddress": "0xe05eb8fcd5203aa6cceebc4bd5e926f1e76dc405",
    "startAmount": 0.1,
    "expirationTime": 1686431934
}

MaximusDecimus avatar Jun 04 '23 19:06 MaximusDecimus

same for this one

{
    "asset": {
        "tokenId": "2105",
        "tokenAddress": "0x75c51f0ee60963454f27e196a8d9095eb47cb886"
    },
    "accountAddress": "0xe05eb8fcd5203aa6cceebc4bd5e926f1e76dc405",
    "startAmount": 0.1,
    "expirationTime": 1686557552
}

MaximusDecimus avatar Jun 05 '23 08:06 MaximusDecimus

@MaximusDecimus Thanks, I was able to recreate the error. I will work on a fix for it. But for now, if you pass in the startAmount as a string, you will avoid this error.

JoshuaSchmidt-OpenSea avatar Jun 05 '23 14:06 JoshuaSchmidt-OpenSea

Got it, thanks

MaximusDecimus avatar Jun 05 '23 14:06 MaximusDecimus