Skip to content

Commit

Permalink
add mock multi redemption data
Browse files Browse the repository at this point in the history
  • Loading branch information
ewansheldon committed Jan 22, 2025
1 parent 4636374 commit da954b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { getPrices } = require('./src/pricing');
const { estimateSwap, estimateSwapUrl } = require('./src/swap.js');
const { getTransactions, vaultTransactionsAddress } = require('./src/transactions.js');
const { getLiquidationPoolData, liquidationPoolsAddress } = require('./src/liquidationPools.js');
const { getRedemptionData, vaultRedemptionsAddress, getVaultRedemptionData } = require('./src/redemptions.js');
const { getRedemptionData, getRedemptionMultiData, vaultRedemptionsAddress, getVaultRedemptionData } = require('./src/redemptions.js');
const { supplyAddress, getSupplyData } = require('./src/supply.js');
const port = process.env.PORT || 3000;

Expand Down Expand Up @@ -34,14 +34,15 @@ const server = http.createServer(async (req, res) => {
res.end(JSON.stringify(await getLiquidationPoolData(req.url)));
} else if (req.url === '/redemption') {
res.end(JSON.stringify(await getRedemptionData()))
} else if (req.url === '/redemption_multi') {
res.end(JSON.stringify(await getRedemptionMultiData()))
} else if (vaultRedemptionsAddress(req.url)) {
res.end(JSON.stringify(await getVaultRedemptionData(req.url)));
} else if (supplyAddress(req.url)) {
res.end(JSON.stringify(await getSupplyData(req.url)))
}
// }

console.log('end')
res.end();
});

Expand Down
11 changes: 10 additions & 1 deletion src/redemptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,17 @@ const getVaultRedemptionData = async url => {
return []
}

const getRedemptionMultiData = async _ => {
return [
{"tokenID":"7","collateral":"0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f","hypervisor":"0x0000000000000000000000000000000000000000"},
{"tokenID":"50","collateral":"0x0000000000000000000000000000000000000000","hypervisor":"0x52ee1FFBA696c5E9b0Bc177A9f8a3098420EA691"},
{"tokenID":"97","collateral":"0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f","hypervisor":"0x52ee1FFBA696c5E9b0Bc177A9f8a3098420EA691"}
]
}

module.exports = {
getRedemptionData,
vaultRedemptionsAddress,
getVaultRedemptionData
getVaultRedemptionData,
getRedemptionMultiData
};

0 comments on commit da954b3

Please sign in to comment.