import {
HydricGateway,
HydricRateLimitError,
HydricNotFoundError,
} from "@hydric/gateway";
const hydric = new HydricGateway({ apiKey: "..." });
try {
const data = await hydric.tokenBaskets.getSingleChainById({
chainId: 1,
basketId: "non-existent-basket",
});
} catch (error) {
if (error instanceof HydricRateLimitError) {
console.error("Slow down! Use exponential backoff.");
} else if (error instanceof HydricNotFoundError) {
console.error("The specific basket or chain combination was not found.");
} else {
console.error("An unexpected error occurred:", error.message);
}
}