@vires.finance/dapp
Advanced tools
Comparing version 0.0.61 to 0.0.62
import fetch from 'node-fetch'; | ||
declare type reserveOptionalFields = { | ||
interestReserveRatio?: string; | ||
}; | ||
export declare type getReservesSummaryParams = { | ||
@@ -9,3 +12,3 @@ nodeApi: string; | ||
export declare const advise: ({ nodeApi, evaluator, main, _fetch }: getReservesSummaryParams) => Promise<{ | ||
reserves: Record<"assetId" | "price" | "aTokenId" | "ABCD" | "reserveFactor" | "collateralFactor" | "liquidationThreshold" | "liquidationPenalty" | "currentTotalDeposit" | "storedTotalDeposit" | "currentTotalDebt" | "storedTotalDebt" | "currentTotalReserve" | "storedTotalReserve" | "currentIndex" | "storedIndex" | "lastUpdateHeight" | "utilization" | "aTokenCirculation" | "aTokenPrice" | "APR" | "APY", string>[]; | ||
reserves: (Record<"assetId" | "price" | "aTokenId" | "ABCD" | "reserveFactor" | "collateralFactor" | "liquidationThreshold" | "liquidationPenalty" | "currentTotalDeposit" | "storedTotalDeposit" | "currentTotalDebt" | "storedTotalDebt" | "currentTotalReserve" | "storedTotalReserve" | "currentIndex" | "storedIndex" | "lastUpdateHeight" | "utilization" | "aTokenCirculation" | "aTokenPrice" | "APR" | "APY", string> & reserveOptionalFields)[]; | ||
height: string; | ||
@@ -15,2 +18,4 @@ accountHealthThreshold: string; | ||
collapsePenalty: string; | ||
wavesLeasing?: string | undefined; | ||
}>; | ||
export {}; |
@@ -93,5 +93,9 @@ "use strict"; | ||
.split('['), globalData = _a[0], reservesData = _a.slice(1); | ||
return __assign(__assign({}, parseAndValidate_1.parseAndValidate(globalData, globalFields)), { reserves: reservesData.map(function (x) { | ||
console.log({ | ||
globalData: globalData, | ||
r: reservesData[0], | ||
}); | ||
return __assign(__assign({}, parseAndValidate_1.parseAndValidate()(globalData, globalFields)), { reserves: reservesData.map(function (x) { | ||
return x.replace(']', ''); | ||
}).map(function (x) { return parseAndValidate_1.parseAndValidate(x, reserveFields); }) }); | ||
}).map(function (x) { return parseAndValidate_1.parseAndValidate()(x, reserveFields); }) }); | ||
}; | ||
@@ -98,0 +102,0 @@ var advise = function (_a) { |
@@ -83,5 +83,5 @@ "use strict"; | ||
.split('['), globalData = _a[0], reservesData = _a.slice(1); | ||
return __assign(__assign({}, parseAndValidate_1.parseAndValidate(globalData, globalFields)), { reserves: reservesData.map(function (x) { | ||
return __assign(__assign({}, parseAndValidate_1.parseAndValidate()(globalData, globalFields)), { reserves: reservesData.map(function (x) { | ||
return x.replace(']', ''); | ||
}).map(function (x) { return parseAndValidate_1.parseAndValidate(x, reserveFields); }) }); | ||
}).map(function (x) { return parseAndValidate_1.parseAndValidate()(x, reserveFields); }) }); | ||
}; | ||
@@ -88,0 +88,0 @@ var adviseUser = function (_a) { |
@@ -10,3 +10,5 @@ import fetch from 'node-fetch'; | ||
advise: () => Promise<{ | ||
reserves: Record<"assetId" | "price" | "aTokenId" | "ABCD" | "reserveFactor" | "collateralFactor" | "liquidationThreshold" | "liquidationPenalty" | "currentTotalDeposit" | "storedTotalDeposit" | "currentTotalDebt" | "storedTotalDebt" | "currentTotalReserve" | "storedTotalReserve" | "currentIndex" | "storedIndex" | "lastUpdateHeight" | "utilization" | "aTokenCirculation" | "aTokenPrice" | "APR" | "APY", string>[]; | ||
reserves: (Record<"assetId" | "price" | "aTokenId" | "ABCD" | "reserveFactor" | "collateralFactor" | "liquidationThreshold" | "liquidationPenalty" | "currentTotalDeposit" | "storedTotalDeposit" | "currentTotalDebt" | "storedTotalDebt" | "currentTotalReserve" | "storedTotalReserve" | "currentIndex" | "storedIndex" | "lastUpdateHeight" | "utilization" | "aTokenCirculation" | "aTokenPrice" | "APR" | "APY", string> & { | ||
interestReserveRatio?: string | undefined; | ||
})[]; | ||
height: string; | ||
@@ -16,2 +18,3 @@ accountHealthThreshold: string; | ||
collapsePenalty: string; | ||
wavesLeasing?: string | undefined; | ||
}>; | ||
@@ -18,0 +21,0 @@ adviseUser: (userAddress: string) => Promise<{ |
@@ -1,1 +0,1 @@ | ||
export declare const parseAndValidate: <TProps extends readonly string[]>(data: string, props: TProps) => Record<TProps[number], string>; | ||
export declare const parseAndValidate: <TOptionalProps = {}>() => <TProps extends readonly string[]>(data: string, props: TProps) => Record<TProps[number], string> & TOptionalProps; |
@@ -15,3 +15,3 @@ "use strict"; | ||
exports.parseAndValidate = void 0; | ||
var parseAndValidate = function (data, props) { | ||
var parseAndValidate = function () { return function (data, props) { | ||
var result = data.split(',').map(function (x) { return x.split(':'); }) | ||
@@ -27,4 +27,4 @@ .reduce(function (map, _a) { | ||
return result; | ||
}; | ||
}; }; | ||
exports.parseAndValidate = parseAndValidate; | ||
//# sourceMappingURL=parseAndValidate.js.map |
{ | ||
"name": "@vires.finance/dapp", | ||
"version": "0.0.61", | ||
"version": "0.0.62", | ||
"description": "vires.finance smart contract interactions", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
106487
1618