@f5i23q999d/cow-sdk
Version:
<p align="center"> <img width="400" src="https://github.com/cowprotocol/cow-sdk/raw/main/docs/images/CoW.png" /> </p>
24 lines • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.assertIsQuoteAndPost = exports.assertIsBridgeQuoteAndPost = exports.isQuoteAndPost = exports.isBridgeQuoteAndPost = void 0;
function isBridgeQuoteAndPost(quote) {
return 'bridge' in quote;
}
exports.isBridgeQuoteAndPost = isBridgeQuoteAndPost;
function isQuoteAndPost(quote) {
return !isBridgeQuoteAndPost(quote);
}
exports.isQuoteAndPost = isQuoteAndPost;
function assertIsBridgeQuoteAndPost(quote) {
if (!isBridgeQuoteAndPost(quote)) {
throw new Error('Quote result is not of type BridgeQuoteAndPost. Are you sure the sell and buy chains different?');
}
}
exports.assertIsBridgeQuoteAndPost = assertIsBridgeQuoteAndPost;
function assertIsQuoteAndPost(quote) {
if (!isQuoteAndPost(quote)) {
throw new Error('Quote result is not of type QuoteAndPost. Are you sure the sell and buy chains are the same?');
}
}
exports.assertIsQuoteAndPost = assertIsQuoteAndPost;
//# sourceMappingURL=utils.js.map