zkEVM orderbook SDK

Configuration for Immutable services.

Constructors

Methods

  • Returns Date

  • Get an order by ID

    Parameters

    • listingId: string

      The listingId to find.

    Returns Promise<ListingResult>

    The returned order result.

  • Get a trade by ID

    Parameters

    • tradeId: string

      The tradeId to find.

    Returns Promise<TradeResult>

    The returned order result.

  • List orders. This method is used to get a list of orders filtered by conditions specified in the params object.

    Parameters

    Returns Promise<ListListingsResult>

    The paged orders.

  • List trades. This method is used to get a list of trades filtered by conditions specified in the params object

    Parameters

    Returns Promise<ListTradesResult>

    The paged trades.

  • Get required transactions and messages for signing to facilitate creating bulk listings. Once the transactions are submitted and the message signed, call the completeListings method provided in the return type with the signature. This method supports up to 20 listing creations at a time. It can also be used for individual listings to simplify integration code paths.

    Bulk listings created using an EOA (Metamask) will require a single listing confirmation signature. Bulk listings creating using a smart contract wallet will require multiple listing confirmation signatures(as many as the number of orders).

    Parameters

    Returns Promise<PrepareBulkListingsResponse>

    PrepareListingResponse includes any unsigned approval transactions, the typed bulk order message for signing and the createListings method that can be called with the signature(s) to create the listings.

  • Get required transactions and messages for signing prior to creating a listing through the createListing method

    Parameters

    Returns Promise<PrepareListingResponse>

    PrepareListingResponse includes the unsigned approval transaction, the typed order message for signing and the order components that can be submitted to createListing with a signature.

  • Create an order

    Parameters

    Returns Promise<ListingResult>

    The result of the order created in the Immutable services.

  • Get unsigned transactions that can be submitted to fulfil an open order. If the approval transaction exists it must be signed and submitted to the chain before the fulfilment transaction can be submitted or it will be reverted.

    Parameters

    • listingId: string

      The listingId to fulfil.

    • takerAddress: string

      The address of the account fulfilling the order.

    • takerFees: FeeValue[]

      Taker ecosystem fees to be paid.

    • OptionalamountToFill: string

      Amount of the order to fill, defaults to sell item amount. Only applies to ERC1155 orders

    Returns Promise<FulfillOrderResponse>

    Approval and fulfilment transactions.

  • Get unsigned transactions that can be submitted to fulfil multiple open orders. If approval transactions exist, they must be signed and submitted to the chain before the fulfilment transaction can be submitted or it will be reverted.

    Parameters

    • listings: FulfillmentListing[]

      The details of the listings to fulfil, amounts to fill and taker ecosystem fees to be paid.

    • takerAddress: string

      The address of the account fulfilling the order.

    Returns Promise<FulfillBulkOrdersResponse>

    Approval and fulfilment transactions.

  • Cancelling orders is a gasless alternative to on-chain cancellation exposed with cancelOrdersOnChain. For the orderbook to authenticate the cancellation, the creator of the orders must sign an EIP712 message containing the orderIds

    Parameters

    • orderIds: string[]

      The orderIds to attempt to cancel.

    Returns Promise<PrepareCancelOrdersResponse>

    The signable action to cancel the orders.

  • Cancelling orders is a gasless alternative to on-chain cancellation exposed with cancelOrdersOnChain. Orders cancelled this way cannot be fulfilled and will be removed from the orderbook. If there is pending fulfillment data outstanding for the order, its cancellation will be pending until the fulfillment window has passed. prepareOffchainOrderCancellations can be used to get the signable action that is signed to get the signature required for this call.

    Parameters

    • orderIds: string[]

      The orderIds to attempt to cancel.

    • accountAddress: string

      The address of the account cancelling the orders.

    • signature: string

    Returns Promise<CancelOrdersResult>

    The result of the off-chain cancellation request

  • Get an unsigned order cancellation transaction. Orders can only be cancelled by the account that created them. All of the orders must be from the same seaport contract. If trying to cancel orders from multiple seaport contracts, group the orderIds by seaport contract and call this method for each group.

    Parameters

    • orderIds: string[]

      The orderIds to cancel.

    • accountAddress: string

      The address of the account cancelling the order.

    Returns Promise<CancelOrdersOnChainResponse>

    The unsigned cancel order action