mirror of
https://github.com/RoboSats/robosats.git
synced 2025-09-13 00:56:22 +00:00
* Add swappable baseurls (network and coordinators) * Add testnet bitcoin styles * Small fixes * Small fixes
14 lines
640 B
TypeScript
14 lines
640 B
TypeScript
import ApiWebClient from './ApiWebClient';
|
|
import ApiNativeClient from './ApiNativeClient';
|
|
|
|
export interface ApiClient {
|
|
post: (baseUrl: string, path: string, body: object) => Promise<object | undefined>;
|
|
put: (baseUrl: string, path: string, body: object) => Promise<object | undefined>;
|
|
get: (baseUrl: string, path: string) => Promise<object | undefined>;
|
|
delete: (baseUrl: string, path: string) => Promise<object | undefined>;
|
|
fileImageUrl?: (baseUrl: string, path: string) => Promise<string | undefined>;
|
|
}
|
|
|
|
export const apiClient: ApiClient =
|
|
window.ReactNativeWebView != null ? new ApiNativeClient() : new ApiWebClient();
|