@kamino-finance/scope-sdk
Version:
Scope Oracle SDK
22 lines • 772 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateFeedParam = validateFeedParam;
exports.validatePricesParam = validatePricesParam;
function validateFeedParam(feedParam) {
if (feedParam) {
const { feed, config } = feedParam;
if (feed && config) {
throw new Error('Only one of feed or config is allowed');
}
}
}
function validatePricesParam(pricesParam) {
if (pricesParam) {
validateFeedParam(pricesParam);
const { feed, config, prices } = pricesParam;
if ((feed || config) && prices) {
throw new Error(`Only one of feed, config, or prices is allowed. Received ${JSON.stringify(pricesParam)}`);
}
}
}
//# sourceMappingURL=Param.js.map