@1inch/limit-order-protocol
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -142,3 +142,6 @@ "use strict"; | ||
parseContractResponse(response) { | ||
return this.providerConnector.decodeABIParameter('string', limit_order_protocol_const_1.ZX + response.slice(10)); | ||
// Aurora network wraps revert message into Revert() | ||
const matched = response.match(/Revert\(([^)]+)\)/); | ||
const message = matched && matched[1] ? matched[1] : response; | ||
return this.providerConnector.decodeABIParameter('string', limit_order_protocol_const_1.ZX + message.slice(10)); | ||
} | ||
@@ -151,2 +154,13 @@ isMsgContainsCorrectCode(message) { | ||
} | ||
else { | ||
try { | ||
const matchParsed = this.parseContractResponse(message).match(regex); | ||
if (matchParsed) { | ||
return !matchParsed[0].includes('0'); | ||
} | ||
} | ||
catch (e) { | ||
console.error(e); | ||
} | ||
} | ||
return null; | ||
@@ -153,0 +167,0 @@ } |
{ | ||
"name": "@1inch/limit-order-protocol", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "Utility for limit order protocol", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -26,3 +26,3 @@ <p align="center"> | ||
| ------------------------------------------------------------------------ | --------------------------------------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------- | | ||
| ![Statements](https://img.shields.io/badge/Coverage-81.19%25-yellow.svg) | ![Branches](https://img.shields.io/badge/Coverage-91.75%25-brightgreen.svg) | ![Functions](https://img.shields.io/badge/Coverage-81.54%25-yellow.svg) | ![Lines](https://img.shields.io/badge/Coverage-81.19%25-yellow.svg) | | ||
| ![Statements](https://img.shields.io/badge/Coverage-81.42%25-yellow.svg) | ![Branches](https://img.shields.io/badge/Coverage-92.23%25-brightgreen.svg) | ![Functions](https://img.shields.io/badge/Coverage-81.54%25-yellow.svg) | ![Lines](https://img.shields.io/badge/Coverage-81.42%25-yellow.svg) | | ||
@@ -29,0 +29,0 @@ ## Installation |
Sorry, the diff of this file is not supported yet
174970
2946