REST
The HTTP layer. Owns the base URL, authentication and retry/timeout policy, and exposes thin verb helpers (get/post/patch/delete).
The HTTP layer. Owns the base URL, authentication and retry/timeout policy, and exposes thin verb helpers (get/post/patch/delete). Managers call these — they never touch fetch directly.
Constructor
REST
constructor(options: RESTOptions)Parameters
options:RESTOptions
Properties
baseURL
baseURL: stringversion
readonly version: stringMethods
setApiKey()
Replace the API key used for subsequent requests.
setApiKey(apiKey: string): thisParameters
apiKey:string
Returns this
get()
get<T>(path: string, options?: RequestOptions): Promise<T>Parameters
path:stringoptions(optional):RequestOptions
Returns Promise<T>
post()
post<T>(path: string, options?: RequestOptions): Promise<T>Parameters
path:stringoptions(optional):RequestOptions
Returns Promise<T>
put()
put<T>(path: string, options?: RequestOptions): Promise<T>Parameters
path:stringoptions(optional):RequestOptions
Returns Promise<T>
patch()
patch<T>(path: string, options?: RequestOptions): Promise<T>Parameters
path:stringoptions(optional):RequestOptions
Returns Promise<T>
delete()
delete<T>(path: string, options?: RequestOptions): Promise<T>Parameters
path:stringoptions(optional):RequestOptions
Returns Promise<T>
buildURL()
Build the absolute URL for a route, applying the version prefix + query.
buildURL(path: string, query?: RequestOptions['query']): stringParameters
path:stringquery(optional):RequestOptions['query']
Returns string
request()
Core request with retry, timeout and structured error handling.
request<T>(method: string, path: string, options?: RequestOptions): Promise<T>Parameters
method:stringpath:stringoptions(optional):RequestOptions
Returns Promise<T>
Customer
A customer record, optionally enriched with on-chain payment stats. Reference for the Customer class of @cosmosapp/pay_sdk: its members and their signatures.
BaseManager
Base class for all resource managers. Each manager owns a slice of the API (payment intents, webhooks, ...) and a lightweight in-memory cache of the structures…