Skip to content

How to cancel an Order using Web3.js? #66

Answered by antho1404
inartin asked this question in Q&A
Discussion options

You must be logged in to vote

I think the type of your orderJson is not the right one. To cancel the order, you need to have the structure of the order as defined here in the cancel function.

In your screenshot, you have an order containing the type, which is not part of the structure defined in the smart contract.

This order needs to be converted to the correct structure. So far, the only way I could do that is to use a function orderToStruct in the @rarible/protocol-ethereum-sdk that is used to fill the order but can be used to cancel it as well.

Try including the SDK and use the following.

// Import the function from '@rarible/protocol-ethereum-sdk/build/order/sign-order'
import { orderToStruct } from '@rarible/pro…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by inartin
Comment options

You must be logged in to vote
1 reply
@antho1404
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants