UNPKG

@magiceden/magiceden-sdk

Version:

A TypeScript SDK for interacting with Magic Eden's API across multiple chains.

58 lines (57 loc) 1.99 kB
import { V3BuyRequest, V3CancelOrderRequest, V3ListRequest, V3PlaceBidRequest, V3SellRequest, V3SubmitSignedOrderRequest, V3TransferRequest } from '../../types/api/v3/request'; import { BaseApiClient, ApiClientOptions } from './base'; import { RetryablePromise } from '../../helpers'; import { V3ExecuteResponse, V3OrderResponse } from '../../types/api/v3/response'; /** * V3 API client implementation (primarily for EVM chains) */ export declare class V3ApiClient extends BaseApiClient { constructor(options: ApiClientOptions); /** * Posts a place bid request to the v3 API. * * Used to place a bid on an NFT. */ placeBid(request: V3PlaceBidRequest): RetryablePromise<V3ExecuteResponse>; /** * Posts a list order request to the v3 API. * * Used to list an NFT for sale. */ list(request: V3ListRequest): RetryablePromise<V3ExecuteResponse>; /** * Posts a buy order to the v3 API. * * Used to fill listings on an NFT. */ buy(request: V3BuyRequest): RetryablePromise<V3ExecuteResponse>; /** * Posts a sell order to the v3 API. * * Used to accept bids on an NFT. */ sell(request: V3SellRequest): RetryablePromise<V3ExecuteResponse>; /** * Posts a cancel order request to the v3 API. * * Used to cancel an order (whether a listing, a bid, etc). */ cancelOrder(request: V3CancelOrderRequest): RetryablePromise<V3ExecuteResponse>; /** * Posts a transfer request to the v3 API. * * Used to transfer one or more NFTs from one address to another. */ transfer(request: V3TransferRequest): RetryablePromise<V3ExecuteResponse>; /** * Posts an submit signed order request to the v3 API */ order(request: V3SubmitSignedOrderRequest): RetryablePromise<V3OrderResponse>; private getRequestPath; /** * Gets the base URL for the v3 API * * @returns Base URL */ getBaseUrl(): string; }