Skip to content

Commit b87ffc0

Browse files
committed
hotfix - handling undefined res from request for strategies
1 parent 556d113 commit b87ffc0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@bancor/carbon-sdk",
33
"type": "module",
44
"source": "src/index.ts",
5-
"version": "0.0.115-DEV",
5+
"version": "0.0.116-DEV",
66
"description": "The SDK is a READ-ONLY tool, intended to facilitate working with Carbon contracts. It's a convenient wrapper around our matching algorithm, allowing programs and users get a ready to use transaction data that will allow them to manage strategies and fulfill trades",
77
"main": "dist/index.cjs",
88
"module": "dist/index.js",

src/contracts-api/Reader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default class Reader implements Fetcher {
9595
token1,
9696
0,
9797
0
98-
);
98+
) ?? [];
9999
return res.map((r) => toStrategy(r));
100100
}
101101

@@ -117,7 +117,7 @@ export default class Reader implements Fetcher {
117117
if (!results || results.length === 0) return [];
118118
console.debug('results', results);
119119
return results.map((result, i) => {
120-
const strategiesResult = result[0] as StrategyStructOutput[];
120+
const strategiesResult = result[0] as StrategyStructOutput[] ?? [];
121121
return {
122122
pair: pairs[i],
123123
strategies: strategiesResult.map((r) => toStrategy(r)),

0 commit comments

Comments
 (0)