@xlink-network/xlink-sdk
Version:
42 lines (39 loc) • 1.4 kB
TypeScript
import { S as SDKGlobalContext } from '../types.internal-BwEnb5-y.js';
import 'viem';
import '../evmUtils/evmContractAddresses.js';
import './types/knownIds.js';
import '../xlinkSdkUtils/types.js';
import './BigNumber.js';
import 'big.js';
import './typeHelpers.js';
declare function requestAPI<T>(sdkContext: Pick<SDKGlobalContext, "backendAPI">, options: {
path: string;
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
query?: Record<string, string>;
body?: Record<string, unknown>;
}): Promise<T>;
declare const readAPIResponse: <T>(resp: Response) => Promise<T>;
declare class TooManyRequestsError extends Error {
requestUrl: string;
retryAfter?: number;
constructor(resp: Response, options?: ErrorConstructorOptions);
}
declare class ThirdPartyRequestError extends Error {
serviceName: string;
isThirdPartyRequestError: boolean;
static fromSerializedError(err: any): undefined | ThirdPartyRequestError;
constructor(serviceName: string, options?: ErrorConstructorOptions);
}
declare class RequestError extends Error {
response: {
url: string;
status: number;
body: string;
};
constructor(response: {
url: string;
status: number;
body: string;
}, options?: ErrorConstructorOptions);
}
export { RequestError, ThirdPartyRequestError, TooManyRequestsError, readAPIResponse, requestAPI };