Skip to content

Commit

Permalink
smalling naming nits
Browse files Browse the repository at this point in the history
  • Loading branch information
Defi-Moses committed Sep 11, 2024
1 parent f08dffd commit 5d772f0
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions packages/rest-api/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,31 +476,31 @@ app.get('/getSynapseTxId', (req, res) => {
try {
const query = req.query
const originChainId = Number(query.originChainId)
const bridgeModuleName = String(query.bridgeModuleName)
const bridgeModule = String(query.bridgeModule)
const txHash = String(query.txHash)

if (!originChainId || !bridgeModuleName || !txHash) {
if (!originChainId || !bridgeModule || !txHash) {
res.status(400).send({
message: 'Invalid request: Missing required parameters',
})
return
}

Synapse.getSynapseTxId(originChainId, bridgeModuleName, txHash)
Synapse.getSynapseTxId(originChainId, bridgeModule, txHash)
.then((synapseTxId) => {
res.json({ synapseTxId })
})
.catch((err) => {
res.status(400).send({
message:
'Ensure that your request matches the following format: /getSynapseTxId?originChainId=8453&bridgeModuleName=SynapseRFQ&txHash=0x4acd82091b54cf584d50adcad9f57c61055beaca130016ecc3798d3d61f5487a',
'Ensure that your request matches the following format: /getSynapseTxId?originChainId=8453&bridgeModule=SynapseRFQ&txHash=0x4acd82091b54cf584d50adcad9f57c61055beaca130016ecc3798d3d61f5487a',
error: err.message,
})
})
} catch (err) {
res.status(400).send({
message:
'Ensure that your request matches the following format: /getSynapseTxId?originChainId=8453&bridgeModuleName=SynapseRFQ&txHash=0x4acd82091b54cf584d50adcad9f57c61055beaca130016ecc3798d3d61f5487a',
'Ensure that your request matches the following format: /getSynapseTxId?originChainId=8453&bridgeModule=SynapseRFQ&txHash=0x4acd82091b54cf584d50adcad9f57c61055beaca130016ecc3798d3d61f5487a',
error: err.message,
})
}
Expand All @@ -511,10 +511,10 @@ app.get('/getBridgeTxStatus', async (req, res) => {
try {
const query = req.query
const destChainId = Number(query.destChainId)
const bridgeModuleName = String(query.bridgeModuleName)
const bridgeModule = String(query.bridgeModule)
const synapseTxId = String(query.synapseTxId)

if (!destChainId || !bridgeModuleName || !synapseTxId) {
if (!destChainId || !bridgeModule || !synapseTxId) {
res.status(400).send({
message: 'Invalid request: Missing required parameters',
})
Expand All @@ -524,7 +524,7 @@ app.get('/getBridgeTxStatus', async (req, res) => {
try {
const status = await Synapse.getBridgeTxStatus(
destChainId,
bridgeModuleName,
bridgeModule,
synapseTxId
)

Expand Down Expand Up @@ -561,7 +561,9 @@ app.get('/getBridgeTxStatus', async (req, res) => {
})

const graphqlData = await graphqlResponse.json()
res.json({ status, graphqlData })
const toInfo = graphqlData.data.bridgeTransactions[0]?.toInfo || null

res.json({ status, toInfo })
} else {
res.json({ status })
}
Expand Down

0 comments on commit 5d772f0

Please sign in to comment.