Skip to content

Commit

Permalink
return redemption data from redis
Browse files Browse the repository at this point in the history
  • Loading branch information
ewansheldon committed Jan 17, 2025
1 parent f7a7316 commit 029c1f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/redemptions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { ethers } = require("ethers");
const { redisClient } = require("./redis");
const managerABI = [
{
"type": "function",
Expand Down Expand Up @@ -148,15 +149,15 @@ const managerABI = [
];

const getRedemptionData = async _ => {
return {tokenID: '29', collateral: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', value: ethers.utils.parseEther('1500').toString()};
return await redisClient.HGETALL('redemption');
};

const vaultRedemptionsAddress = url => {
const split = url.split('/');
return split.length === 3 && split[1] === 'redemptions' && split[2];
}

const getVaultRedemptionData = url => {
const getVaultRedemptionData = async url => {
return [{
collateral: 'ETH',
amount: '0.5',
Expand Down
2 changes: 0 additions & 2 deletions src/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ const redisClient = createClient({
redisClient.on('error', err => console.log('Redis Client Error', err));

async function main() {
console.log('hi')
await redisClient.connect();
console.log('connected')
}

main().catch((error) => {
Expand Down

0 comments on commit 029c1f0

Please sign in to comment.