import { ModuleConfiguration } from '@imtbl/config'; import { OrderbookModuleConfiguration, OrderbookOverrides } from './config/config'; import { CancelOrdersResult } from './openapi/sdk'; import { BidResult, CancelOrdersOnChainResponse, CollectionBidResult, CreateBidParams, CreateCollectionBidParams, CreateListingParams, FeeValue, FulfillBulkOrdersResponse, FulfillmentListing, FulfillmentOrder, FulfillOrderResponse, ListBidsParams, ListBidsResult, ListCollectionBidsParams, ListCollectionBidsResult, ListingResult, ListListingsParams, ListListingsResult, ListTradesParams, ListTradesResult, PrepareBidParams, PrepareBidResponse, PrepareBulkListingsParams, PrepareBulkListingsResponse, PrepareCancelOrdersResponse, PrepareCollectionBidParams, PrepareCollectionBidResponse, PrepareListingParams, PrepareListingResponse, TradeResult } from './types'; /** * zkEVM orderbook SDK * @constructor * @param {OrderbookModuleConfiguration} config - Configuration for Immutable services. */ export declare class Orderbook { private apiClient; private seaport; private orderbookConfig; constructor(config: ModuleConfiguration); /** * Returns the default expiry date for orders, set to 2 years from the current time. * @returns {Date} A Date object set to 2 years from now */ static defaultOrderExpiry(): Date; /** * Return the configuration for the orderbook module. * @return {OrderbookModuleConfiguration} The configuration for the orderbook module. */ config(): OrderbookModuleConfiguration; /** * Get a listing by ID * @param {string} listingId - The listingId to find. * @return {ListingResult} The returned listing result. */ getListing(listingId: string): Promise; /** * Get a bid by ID * @param {string} bidId - The bidId to find. * @return {BidResult} The returned bid result. */ getBid(bidId: string): Promise; /** * Get a collection bid by ID * @param {string} collectionBidId - The collectionBidId to find. * @return {CollectionBidResult} The returned collection bid result. */ getCollectionBid(collectionBidId: string): Promise; /** * Get a trade by ID * @param {string} tradeId - The tradeId to find. * @return {TradeResult} The returned trade result. */ getTrade(tradeId: string): Promise; /** * List listings. This method is used to get a list of listings filtered by conditions specified * in the params object. * @param {ListListingsParams} listOrderParams - Filtering, ordering and page parameters. * @return {ListListingsResult} The paged listings. */ listListings(listOrderParams: ListListingsParams): Promise; /** * List bids. This method is used to get a list of bids filtered by conditions specified * in the params object. * @param {ListBidsParams} listOrderParams - Filtering, ordering and page parameters. * @return {ListBidsResult} The paged bids. */ listBids(listOrderParams: ListBidsParams): Promise; /** * List collection bids. This method is used to get a list of collection bids filtered * by conditions specified in the params object. * @param {ListCollectionBidsParams} listOrderParams - Filtering, ordering and page parameters. * @return {ListCollectionBidsResult} The paged collection bids. */ listCollectionBids(listOrderParams: ListCollectionBidsParams): Promise; /** * List trades. This method is used to get a list of trades filtered by conditions specified * in the params object * @param {ListTradesParams} listTradesParams - Filtering, ordering and page parameters. * @return {ListTradesResult} The paged trades. */ listTrades(listTradesParams: ListTradesParams): Promise; /** * Get required transactions and messages for signing to facilitate creating bulk listings. * Once the transactions are submitted and the message signed, call the * {@linkcode PrepareBulkListingsResponse.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). * @param {PrepareBulkListingsParams} prepareBulkListingsParams - Details about the listings * to be created. * @return {PrepareBulkListingsResponse} PrepareBulkListingsResponse includes * any unsigned approval transactions, the typed bulk order message for signing and * the {@linkcode PrepareBulkListingsResponse.completeListings} method that can be called with * the signature(s) to create the listings. */ prepareBulkListings({ makerAddress, listingParams, }: PrepareBulkListingsParams): Promise; /** * Get required transactions and messages for signing prior to creating a listing * through the {@linkcode createListing} method * @param {PrepareListingParams} prepareListingParams - Details about the listing to be created. * @return {PrepareListingResponse} PrepareListingResponse includes * the unsigned approval transaction, the typed order message for signing and * the order components that can be submitted to {@linkcode createListing} with a signature. */ prepareListing({ makerAddress, sell, buy, orderStart, orderExpiry, }: PrepareListingParams): Promise; /** * Create a listing * @param {CreateListingParams} createListingParams - create a listing with the given params. * @return {ListingResult} The result of the listing created in the Immutable services. */ createListing(createListingParams: CreateListingParams): Promise; /** * Get required transactions and messages for signing prior to creating a bid * through the {@linkcode createBid} method * @param {PrepareBidParams} prepareBidParams - Details about the bid to be created. * @return {PrepareBidResponse} PrepareBidResponse includes * the unsigned approval transaction, the typed order message for signing and * the order components that can be submitted to {@linkcode createBid} with a signature. */ prepareBid({ makerAddress, sell, buy, orderStart, orderExpiry, }: PrepareBidParams): Promise; /** * Create a bid * @param {CreateBidParams} createBidParams - create a bid with the given params. * @return {BidResult} The result of the bid created in the Immutable services. */ createBid(createBidParams: CreateBidParams): Promise; /** * Get required transactions and messages for signing prior to creating a collection bid * through the {@linkcode createCollectionBid} method * @param {PrepareCollectionBidParams} - Details about the collection bid to be created. * @return {PrepareCollectionBidResponse} PrepareCollectionBidResponse includes * the unsigned approval transaction, the typed order message for signing and * the order components that can be submitted to {@linkcode createCollectionBid} with a signature. */ prepareCollectionBid({ makerAddress, sell, buy, orderStart, orderExpiry, }: PrepareCollectionBidParams): Promise; /** * Create a collection bid * @param {CreateCollectionBidParams} createCollectionBidParams create a collection bid * with the given params. * @return {CollectionBidResult} The result of the collection bid created * in the Immutable services. */ createCollectionBid(createCollectionBidParams: CreateCollectionBidParams): Promise; /** * 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. * @param {string} orderId - The orderId to fulfil * @param {string} takerAddress - The address of the account fulfilling the order * @param {FeeValue[]} takerFees - Taker ecosystem fees to be paid * @param {string} [amountToFill] - Amount of the order to fill, defaults to sell item amount. * Only applies to ERC1155 orders * @param {string} [tokenId] - The token ID to fulfill for criteria-based orders * @returns {Promise} A promise that resolves to the approval and fulfilment * transactions */ fulfillOrder(orderId: string, takerAddress: string, takerFees: FeeValue[], amountToFill?: string, tokenId?: string): Promise; /** * 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. * @param {FulfillmentOrder[]} orders - The details of the orders to fulfil, amounts * to fill and taker ecosystem fees to be paid. * @param {string} takerAddress - The address of the account fulfilling the order. * @return {FulfillBulkOrdersResponse} Approval and fulfilment transactions. */ fulfillBulkOrders(orders: FulfillmentOrder[] | FulfillmentListing[], takerAddress: string): Promise; /** * Cancelling orders is a gasless alternative to on-chain cancellation exposed with * {@linkcode cancelOrdersOnChain}. For the orderbook to authenticate the cancellation, * the creator of the orders must sign an EIP712 message containing the orderIds. * @param {string} orderIds - The orderIds to attempt to cancel. * @return {PrepareCancelOrdersResponse} The signable action to cancel the orders. */ prepareOrderCancellations(orderIds: string[]): Promise; /** * Cancelling orders is a gasless alternative to on-chain cancellation exposed with * {@linkcode 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. * @param {string[]} orderIds - The orderIds to attempt to cancel * @param {string} accountAddress - The address of the account cancelling the orders * @param {string} signature - The EIP-712 signature obtained by signing the message from * {@linkcode prepareOrderCancellations} * @return {CancelOrdersResult} The result of the off-chain cancellation request containing: * - cancelled_orders: Array of successfully cancelled order IDs * - pending_orders: Array of order IDs pending * cancellation * @throws {Error} If the signature is invalid or the account is not * authorized to cancel the orders */ cancelOrders(orderIds: string[], accountAddress: string, signature: string): Promise; /** * 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. * @param {string[]} orderIds - The orderIds to cancel. * @param {string} accountAddress - The address of the account cancelling the order. * @return {CancelOrdersOnChainResponse} The unsigned cancel order action */ cancelOrdersOnChain(orderIds: string[], accountAddress: string): Promise; }