@basetime/a2w-api-ts
Version:
Client library that communicates with the addtowallet API.
17 lines (16 loc) • 562 B
TypeScript
/**
* Represents a class that can make HTTP requests to the a2w API.
*/
export interface Requester {
/**
* Sends a request using the fetcher and returns the response.
*
* Adds the bearer token to the headers and catches errors.
*
* @param url The url to send the request to.
* @param options The fetch options.
* @param authenticate Whether to authenticate the request.
* @returns {T} The response from the endpoint.
*/
fetch: <T>(url: string, options: RequestInit, authenticate?: boolean) => Promise<T>;
}