Skip to content

Commit

Permalink
Added /proverAddress endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
EvgenKor committed May 22, 2024
1 parent b1cf354 commit 9d3c968
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions zp-relayer/services/relayer/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,12 @@ async function getProverFee(req: Request, res: Response) {
res.json(fee)
}

async function getProverAddress(req: Request, res: Response) {
const url = new URL('/address', config.RELAYER_PROVER_URL)
const address = await fetch(url.toString()).then(r => r.json())
res.json(address)
}

function root(req: Request, res: Response) {
return res.sendStatus(200)
}
Expand All @@ -252,6 +258,7 @@ export default {
getSiblings,
getParamsHash,
getProverFee,
getProverAddress,
relayerVersion,
root,
}
1 change: 1 addition & 0 deletions zp-relayer/services/relayer/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export function createRouter({ feeManager, pool }: IRouterConfig) {
})
)
router.get('/proverFee', wrapErr(endpoints.getProverFee))
router.get('/proverAddress', wrapErr(endpoints.getProverAddress))
router.post('/sendTransactions', wrapErr(inject({ pool }, endpoints.sendTransactions)))
router.get('/transactions/v2', wrapErr(inject({ pool }, endpoints.getTransactionsV2)))
router.get('/merkle/root/:index?', wrapErr(inject({ pool }, endpoints.merkleRoot)))
Expand Down

0 comments on commit 9d3c968

Please sign in to comment.