ProjectOpenSea / opensea-js

TypeScript SDK for the OpenSea marketplace
https://docs.opensea.io/reference
MIT License
2.28k stars 964 forks source link

I did not find the API to cancel the order, may I ask how to cancel the order #163

Closed niao-yu closed 3 years ago

damjankuznar commented 3 years ago

There is no API endpoint for cancelling orders on Ethereum, since the order needs to be cancelled on-chain by submitting a Cancel transaction.

You can use SDK to submit the cancel transaction: https://github.com/ProjectOpenSea/opensea-js/blob/dadc216a3adadc5506bc159c597da2090cf78636/src/seaport.ts#L884

niao-yu commented 3 years ago

Thank you. That took care of my problem.

Astrophe commented 3 years ago

Hi there, I am also trying to cancel offers, but am getting the following error when I pass a valid wallet address with active offers and an Order object: index.js:1 error:BigNumber Error: new BigNumber() not a number: [object Object] Here's my code: try { await seaport.cancelOrder({ order: Order, accountAddress: userWallet }) .catch(err => console.error('error:' + err)); } catch (error) { console.log(error) }

Any assistance would be greatly appreciated!

mohammaddwaqas commented 2 years ago

Hi there, I am trying to cancel order using Opensea sdk, but getting different errors, could you guys please tell how to use this cancel order function. For this I dont have metamask instead having having custom wallet for which private keys are stored into backend. LIKE I dont have mnemonics while have a private keys for this. So using private keys how I can cancel the order using OpenSea SDK. Thanks

Astrophe commented 2 years ago

You really shouldn't cancel orders as it's quite expensive. Rather you can empty the weth from your wallet, rendering the transaction invalid, until it expires...and you should never create a transaction without an expiration date.

https://twitter.com/ryansethwalter https://www.linkedin.com/in/ryansethwalter/

On Thu, Apr 14, 2022 at 12:36 AM Muhammad Waqas @.***> wrote:

Hi there, I am trying to cancel order using Opensea sdk, but getting different errors, could you guys please tell how to use this cancel order function. For this I dont have metamask instead having having custom wallet for which private keys are stored into backend. LIKE I dont have mnemonics while have a private keys for this. So using private keys how I can cancel the order using OpenSea SDK. Thanks

— Reply to this email directly, view it on GitHub https://github.com/ProjectOpenSea/opensea-js/issues/163#issuecomment-1098546185, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJHY2PZZBZ3KGSPTLWK67MTVE5D7RANCNFSM5DPXM2BA . You are receiving this because you commented.Message ID: @.***>

-- The information transmitted is intended only for the person or entity to which it is addressed and may contain proprietary, business-confidential, and/or privileged material. If you are not the intended recipient of this message you are hereby notified that any use, review, retransmission, dissemination, distribution, reproduction or any action taken in reliance upon this message is prohibited. If you received this in error, please contact the sender and delete the material from any computer. If you have entered into a NDA with Astrophe Enterprises, LLC or any of its subsidiaries or joint ventures, including OneGift LLC, Astrophe Solutions LLC, or Pelham Enterprises, LLC and subsidiaries, the information transmitted is included in the definition of "Confidential Information".

This email is for discussion purposes only and cannot be used to create a binding contract.

mohammaddwaqas commented 2 years ago

Hi @Astrophe appreciate your comment and suggestion as well. The reason why I am asking to cancel order is that I have configured my NFT platform with OpenSea for this I have implemented the functionality for creating sell order using the Opensea API, Now I want that if user wants to cancel their order they should be able to. As on Opensea there is a functionality to cancel listing which is in turn is a cancel order. The exact same functionality I want to utilise in my Platform using the Opensea SDK. I hope you understand my concerns. So could you please tell me then how can I cancel my order.

rashi293 commented 11 months ago

@mohammaddwaqas hello, I'm trying to do the same thing in my application. Will you please let me know how you did cancelOrder using the API?

RealIanX commented 9 months ago

As said above, it's not possible to cancel an order with the opensea-js API. You should cancel it directly on-chain interacting with seaport (but you will need to pay gas fees). Creating an order with a short end time is the best practice to avoid this.