UNPKG

opensea-js

Version:

TypeScript SDK for the OpenSea marketplace helps developers build new experiences using NFTs and our marketplace data

23 lines (21 loc) 835 B
/** * Fetcher context interface for making HTTP requests to the OpenSea API. * This interface abstracts the HTTP methods used by specialized API clients. */ export interface Fetcher { /** * Generic fetch method for GET requests with automatic rate limit retry * @param apiPath Path to URL endpoint under API * @param query URL query params. Will be used to create a URLSearchParams object. * @returns The response from the API. */ get<T>(apiPath: string, query?: object): Promise<T>; /** * Generic post method for POST requests with automatic rate limit retry * @param apiPath Path to URL endpoint under API * @param body Data to send. * @param opts Optional connection options. * @returns The response from the API. */ post<T>(apiPath: string, body?: object, opts?: object): Promise<T>; }