-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #463 from EYBlockchain/daveroga/add-optimist-endpo…
…int-contract-address daveroga/Add contract-address endpoint in optimist
- Loading branch information
Showing
4 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
Route for depositing (minting) a crypto commitment. | ||
This code assumes that the Shield contract already has approval to spend | ||
funds on a zkp deposit | ||
*/ | ||
import express from 'express'; | ||
import logger from 'common-files/utils/logger.mjs'; | ||
import { getContractAddress } from 'common-files/utils/contract.mjs'; | ||
|
||
const router = express.Router(); | ||
|
||
router.get('/:contract', async (req, res, next) => { | ||
logger.debug('contract-address endpoint received GET'); | ||
const { contract } = req.params; | ||
try { | ||
const address = await getContractAddress(contract); | ||
logger.debug(`returning address ${address}`); | ||
res.json({ address }); | ||
} catch (err) { | ||
logger.error(err); | ||
next(err); | ||
} | ||
}); | ||
|
||
export default router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters