@xyo-network/chain-bridge 1.20.4 → 1.20.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node/index.mjs +57 -49
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/modules/EVMLiquidityBridgeTransactionCompletionMonitorSentinel/EVMLiquidityBridgeTransactionCompletionMonitorSentinel.d.ts +2 -3
- package/dist/node/modules/EVMLiquidityBridgeTransactionCompletionMonitorSentinel/EVMLiquidityBridgeTransactionCompletionMonitorSentinel.d.ts.map +1 -1
- package/dist/node/queue/flows/createXl1ToEthBridgeJob/createXl1ToEthBridgeJob.d.ts +3 -1
- package/dist/node/queue/flows/createXl1ToEthBridgeJob/createXl1ToEthBridgeJob.d.ts.map +1 -1
- package/dist/node/queue/workers/EthTransactionMonitor.d.ts +2 -4
- package/dist/node/queue/workers/EthTransactionMonitor.d.ts.map +1 -1
- package/dist/node/queue/workers/EthTransactionPreparation.d.ts +2 -4
- package/dist/node/queue/workers/EthTransactionPreparation.d.ts.map +1 -1
- package/dist/node/queue/workers/EthTransactionSubmission.d.ts +2 -4
- package/dist/node/queue/workers/EthTransactionSubmission.d.ts.map +1 -1
- package/dist/node/queue/workers/EthTransactionSubmissionStorage.d.ts +2 -4
- package/dist/node/queue/workers/EthTransactionSubmissionStorage.d.ts.map +1 -1
- package/dist/node/queue/workers/Xl1ToEthBridgeParent.d.ts +2 -4
- package/dist/node/queue/workers/Xl1ToEthBridgeParent.d.ts.map +1 -1
- package/dist/node/queue/workers/Xl1TransactionJobData.d.ts +15 -0
- package/dist/node/queue/workers/Xl1TransactionJobData.d.ts.map +1 -0
- package/dist/node/queue/workers/Xl1TransactionMonitor.d.ts +2 -4
- package/dist/node/queue/workers/Xl1TransactionMonitor.d.ts.map +1 -1
- package/dist/node/queue/workers/Xl1TransactionPreparation.d.ts +2 -3
- package/dist/node/queue/workers/Xl1TransactionPreparation.d.ts.map +1 -1
- package/dist/node/queue/workers/Xl1TransactionSubmission.d.ts +2 -4
- package/dist/node/queue/workers/Xl1TransactionSubmission.d.ts.map +1 -1
- package/dist/node/queue/workers/Xl1TransactionSubmissionStorage.d.ts +2 -4
- package/dist/node/queue/workers/Xl1TransactionSubmissionStorage.d.ts.map +1 -1
- package/dist/node/queue/workers/util/submitEthTransaction.d.ts +3 -2
- package/dist/node/queue/workers/util/submitEthTransaction.d.ts.map +1 -1
- package/dist/node/queue/workers/util/submitXl1Transaction.d.ts +2 -1
- package/dist/node/queue/workers/util/submitXl1Transaction.d.ts.map +1 -1
- package/dist/node/server/app.d.ts.map +1 -1
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteStatus.d.ts.map +1 -1
- package/dist/node/services/Xl1TxState.d.ts +2 -0
- package/dist/node/services/Xl1TxState.d.ts.map +1 -1
- package/dist/node/validation/validateSufficientLiquiditySourceAllowance.d.ts +3 -1
- package/dist/node/validation/validateSufficientLiquiditySourceAllowance.d.ts.map +1 -1
- package/dist/node/validation/validateSufficientLiquiditySourceBalance.d.ts +3 -1
- package/dist/node/validation/validateSufficientLiquiditySourceBalance.d.ts.map +1 -1
- package/package.json +27 -45
- package/src/modules/EVMLiquidityBridgeTransactionCompletionMonitorSentinel/EVMLiquidityBridgeTransactionCompletionMonitorSentinel.ts +5 -4
- package/src/queue/flows/createXl1ToEthBridgeJob/createXl1ToEthBridgeJob.ts +23 -9
- package/src/queue/workers/EthTransactionMonitor.ts +2 -2
- package/src/queue/workers/EthTransactionPreparation.ts +8 -6
- package/src/queue/workers/EthTransactionSubmission.ts +4 -5
- package/src/queue/workers/EthTransactionSubmissionStorage.ts +2 -2
- package/src/queue/workers/Xl1ToEthBridgeParent.ts +2 -2
- package/src/queue/workers/Xl1TransactionJobData.ts +12 -0
- package/src/queue/workers/Xl1TransactionMonitor.ts +2 -2
- package/src/queue/workers/Xl1TransactionPreparation.ts +4 -3
- package/src/queue/workers/Xl1TransactionSubmission.ts +7 -8
- package/src/queue/workers/Xl1TransactionSubmissionStorage.ts +2 -2
- package/src/queue/workers/util/submitEthTransaction.ts +10 -3
- package/src/queue/workers/util/submitXl1Transaction.ts +4 -5
- package/src/server/app.ts +3 -15
- package/src/server/routes/bridge/routeDefinitions/routes/bridgeToRemote.ts +2 -2
- package/src/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteStatus.ts +3 -2
- package/src/services/Xl1TxState.ts +4 -1
- package/src/util/calculateBridgeFees.ts +4 -4
- package/src/validation/validateSufficientLiquiditySourceAllowance.ts +5 -1
- package/src/validation/validateSufficientLiquiditySourceBalance.ts +5 -1
package/dist/node/index.mjs
CHANGED
|
@@ -7,9 +7,8 @@ import { asBridgeConfigContext } from "@xyo-network/chain-orchestration";
|
|
|
7
7
|
import { ActorV3, XyoGatewayRunnerMoniker } from "@xyo-network/xl1-sdk";
|
|
8
8
|
|
|
9
9
|
// src/server/app.ts
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import cors from "cors";
|
|
10
|
+
import { standardErrors } from "@xylabs/express";
|
|
11
|
+
import { sharedMiddleware } from "@xyo-network/chain-orchestration";
|
|
13
12
|
import express from "express";
|
|
14
13
|
|
|
15
14
|
// src/queue/connection.ts
|
|
@@ -118,12 +117,8 @@ import { hexToBigInt, toHex } from "@xylabs/sdk-js";
|
|
|
118
117
|
var calculateBridgeFees = /* @__PURE__ */ __name((srcAmount, feeStructure) => {
|
|
119
118
|
const { feeFixed, feeRateBasisPoints } = feeStructure;
|
|
120
119
|
const srcAmountBigInt = hexToBigInt(srcAmount);
|
|
121
|
-
const feeFixedBigInt = hexToBigInt(feeFixed);
|
|
122
120
|
const feeVariableBigInt = srcAmountBigInt * BigInt(feeRateBasisPoints) / 10000n;
|
|
123
121
|
const feeVariable = toHex(feeVariableBigInt);
|
|
124
|
-
const feeTotalBigInt = feeFixedBigInt + feeVariableBigInt;
|
|
125
|
-
const destAmountBigInt = srcAmountBigInt > feeTotalBigInt ? srcAmountBigInt - feeTotalBigInt : 0n;
|
|
126
|
-
const destAmount = toHex(destAmountBigInt);
|
|
127
122
|
return {
|
|
128
123
|
feeFixed,
|
|
129
124
|
feeVariable,
|
|
@@ -368,8 +363,12 @@ var validateBridgeTransaction = /* @__PURE__ */ __name(async (signedTxBw, intent
|
|
|
368
363
|
// src/validation/validateSufficientLiquiditySourceAllowance.ts
|
|
369
364
|
import { assertEx as assertEx7, hexToBigInt as hexToBigInt3 } from "@xylabs/sdk-js";
|
|
370
365
|
import { isBridgeIntent } from "@xyo-network/xl1-sdk";
|
|
371
|
-
var validateSufficientLiquiditySourceAllowance = /* @__PURE__ */ __name(async (tx, bridgeableToken, bridge, logger) => {
|
|
372
|
-
const
|
|
366
|
+
var validateSufficientLiquiditySourceAllowance = /* @__PURE__ */ __name(async (tx, offChainPayloads, bridgeableToken, bridge, logger) => {
|
|
367
|
+
const allPayloads = [
|
|
368
|
+
...tx[1],
|
|
369
|
+
...offChainPayloads
|
|
370
|
+
];
|
|
371
|
+
const bridgeIntent = assertEx7(allPayloads.find(isBridgeIntent), () => "No bridge intent found");
|
|
373
372
|
const amount = hexToBigInt3(bridgeIntent.destAmount);
|
|
374
373
|
const liquiditySourceAddress = await bridge.liquiditySource();
|
|
375
374
|
const bridgeAddress = await bridge.getAddress();
|
|
@@ -381,8 +380,12 @@ var validateSufficientLiquiditySourceAllowance = /* @__PURE__ */ __name(async (t
|
|
|
381
380
|
// src/validation/validateSufficientLiquiditySourceBalance.ts
|
|
382
381
|
import { assertEx as assertEx8, hexToBigInt as hexToBigInt4 } from "@xylabs/sdk-js";
|
|
383
382
|
import { isBridgeIntent as isBridgeIntent2 } from "@xyo-network/xl1-sdk";
|
|
384
|
-
var validateSufficientLiquiditySourceBalance = /* @__PURE__ */ __name(async (tx, bridgeableToken, bridge, logger) => {
|
|
385
|
-
const
|
|
383
|
+
var validateSufficientLiquiditySourceBalance = /* @__PURE__ */ __name(async (tx, offChainPayloads, bridgeableToken, bridge, logger) => {
|
|
384
|
+
const allPayloads = [
|
|
385
|
+
...tx[1],
|
|
386
|
+
...offChainPayloads
|
|
387
|
+
];
|
|
388
|
+
const bridgeIntent = assertEx8(allPayloads.find(isBridgeIntent2), () => "No bridge intent found");
|
|
386
389
|
const amount = hexToBigInt4(bridgeIntent.destAmount);
|
|
387
390
|
const liquiditySourceAddress = await bridge.liquiditySource();
|
|
388
391
|
const balance = await bridgeableToken.balanceOf(liquiditySourceAddress);
|
|
@@ -436,21 +439,25 @@ var createWorker2 = /* @__PURE__ */ __name((connection2, telemetry2, services) =
|
|
|
436
439
|
const stateMap = assertEx11(services?.ethTxStateMap, () => "ethTxStateMap service not provided");
|
|
437
440
|
const wallet = assertEx11(services?.wallet, () => "wallet service not provided");
|
|
438
441
|
const worker = new Worker2(queueName2, async (job) => {
|
|
439
|
-
const { tx } = job.data;
|
|
442
|
+
const { tx, offChainPayloads } = job.data;
|
|
440
443
|
const hash = await PayloadBuilder5.hash(tx[0]);
|
|
441
444
|
await job.log(`[${hash}] preparing ETH transaction`);
|
|
442
445
|
await job.log(`[${hash}] validating liquiditySource has sufficient allowance`);
|
|
443
|
-
if (!await validateSufficientLiquiditySourceAllowance(tx, bridgeableToken, bridge, job)) {
|
|
446
|
+
if (!await validateSufficientLiquiditySourceAllowance(tx, offChainPayloads, bridgeableToken, bridge, job)) {
|
|
444
447
|
throw new Error("Liquidity source does not have sufficient allowance for the bridge to execute the transaction");
|
|
445
448
|
}
|
|
446
449
|
await job.log(`[${hash}] validated liquiditySource has sufficient allowance`);
|
|
447
450
|
await job.log(`[${hash}] validating liquiditySource has sufficient balance`);
|
|
448
|
-
if (!await validateSufficientLiquiditySourceBalance(tx, bridgeableToken, bridge, job)) {
|
|
451
|
+
if (!await validateSufficientLiquiditySourceBalance(tx, offChainPayloads, bridgeableToken, bridge, job)) {
|
|
449
452
|
throw new Error("Liquidity source does not have sufficient balance for the bridge to execute the transaction");
|
|
450
453
|
}
|
|
451
454
|
await job.log(`[${hash}] validated liquiditySource has sufficient balance`);
|
|
452
455
|
await job.log(`[${hash}] building ETH transaction`);
|
|
453
|
-
const
|
|
456
|
+
const allPayloads = [
|
|
457
|
+
...tx[1],
|
|
458
|
+
...offChainPayloads
|
|
459
|
+
];
|
|
460
|
+
const bridgeIntent = assertEx11(allPayloads.find(isBridgeIntent3), () => "No bridge intent found");
|
|
454
461
|
const amount = hexToBigInt6(bridgeIntent.destAmount);
|
|
455
462
|
const srcAddress = getAddress(bridgeIntent.srcAddress);
|
|
456
463
|
const destAddress = getAddress(bridgeIntent.destAddress);
|
|
@@ -496,9 +503,13 @@ import { Worker as Worker3 } from "bullmq";
|
|
|
496
503
|
import { assertEx as assertEx12, hexToBigInt as hexToBigInt7, toEthAddress } from "@xylabs/sdk-js";
|
|
497
504
|
import { PayloadBuilder as PayloadBuilder6 } from "@xyo-network/sdk-js";
|
|
498
505
|
import { isBridgeIntent as isBridgeIntent4 } from "@xyo-network/xl1-sdk";
|
|
499
|
-
var submitEthTransaction = /* @__PURE__ */ __name(async (tx,
|
|
506
|
+
var submitEthTransaction = /* @__PURE__ */ __name(async (tx, offChainPayloads, bridge, wallet) => {
|
|
500
507
|
const xl1Transaction = assertEx12(tx[0], () => "No corresponding XL1 transaction found");
|
|
501
|
-
const
|
|
508
|
+
const allPayloads = [
|
|
509
|
+
...tx[1],
|
|
510
|
+
...offChainPayloads
|
|
511
|
+
];
|
|
512
|
+
const bridgeIntent = assertEx12(allPayloads.find(isBridgeIntent4), () => "No bridge intent found");
|
|
502
513
|
const srcAddress = toEthAddress(bridgeIntent.srcAddress);
|
|
503
514
|
const destAddress = toEthAddress(bridgeIntent.destAddress);
|
|
504
515
|
const amount = hexToBigInt7(bridgeIntent.destAmount);
|
|
@@ -509,10 +520,8 @@ var submitEthTransaction = /* @__PURE__ */ __name(async (tx, bridgeableToken, br
|
|
|
509
520
|
}, "submitEthTransaction");
|
|
510
521
|
|
|
511
522
|
// src/queue/workers/util/submitXl1Transaction.ts
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
const offChainPayloads = preparedTx[1].filter((p) => !isAllowedBlockPayload(p));
|
|
515
|
-
const result = await gateway.addTransactionToChain(preparedTx, offChainPayloads);
|
|
523
|
+
var submitXl1Transaction = /* @__PURE__ */ __name(async (preparedTx, offChain = [], gateway) => {
|
|
524
|
+
const result = await gateway.addTransactionToChain(preparedTx, offChain);
|
|
516
525
|
return result;
|
|
517
526
|
}, "submitXl1Transaction");
|
|
518
527
|
|
|
@@ -521,11 +530,10 @@ var name3 = "Submit ETH Transaction";
|
|
|
521
530
|
var queueName3 = "eth-tx-submit";
|
|
522
531
|
var createWorker3 = /* @__PURE__ */ __name((connection2, telemetry2, services) => {
|
|
523
532
|
const bridge = assertEx13(services?.bridge, () => "bridge service not provided");
|
|
524
|
-
const bridgeableToken = assertEx13(services?.bridgeableToken, () => "bridgeableToken service not provided");
|
|
525
533
|
const wallet = assertEx13(services?.wallet, () => "wallet service not provided");
|
|
526
534
|
const stateMap = assertEx13(services?.ethTxStateMap, () => "ethTxStateMap service not provided");
|
|
527
535
|
const worker = new Worker3(queueName3, async (job) => {
|
|
528
|
-
const { tx } = job.data;
|
|
536
|
+
const { tx, offChainPayloads } = job.data;
|
|
529
537
|
const hash = await PayloadBuilder7.hash(tx[0]);
|
|
530
538
|
const state = assertEx13(await stateMap.get(hash), () => `[${hash}] state not found`);
|
|
531
539
|
const { submissionHash: existingSubmissionHash } = state;
|
|
@@ -536,7 +544,7 @@ var createWorker3 = /* @__PURE__ */ __name((connection2, telemetry2, services) =
|
|
|
536
544
|
};
|
|
537
545
|
}
|
|
538
546
|
await job.log(`[${hash}] Submitting ETH tx`);
|
|
539
|
-
const submissionHash = assertEx13(await submitEthTransaction(tx,
|
|
547
|
+
const submissionHash = assertEx13(await submitEthTransaction(tx, offChainPayloads, bridge, wallet), () => `[${hash}] submissionHash not found in receipt`);
|
|
540
548
|
await job.log(`[${hash}] Submitted ETH tx and received submission response hash ${submissionHash}`);
|
|
541
549
|
return {
|
|
542
550
|
submissionHash
|
|
@@ -694,12 +702,13 @@ var queueName7 = "xl1-tx-prepare";
|
|
|
694
702
|
var createWorker7 = /* @__PURE__ */ __name((connection2, telemetry2, services) => {
|
|
695
703
|
const stateMap = assertEx16(services?.xl1TxStateMap, () => "xl1TxStateMap service not provided");
|
|
696
704
|
const worker = new Worker7(queueName7, async (job) => {
|
|
697
|
-
const { tx } = job.data;
|
|
705
|
+
const { tx, offChainPayloads = [] } = job.data;
|
|
698
706
|
const hash = await PayloadBuilder10.hash(tx[0]);
|
|
699
707
|
await job.log(`[${hash}] preparing XL1 transaction`);
|
|
700
708
|
const preparedTx = tx;
|
|
701
709
|
await job.log(`[${hash}] storing XL1 preparedTx`);
|
|
702
710
|
await stateMap.set(hash, {
|
|
711
|
+
offChainPayloads,
|
|
703
712
|
preparedTx
|
|
704
713
|
});
|
|
705
714
|
await job.log(`[${hash}] stored XL1 preparedTx`);
|
|
@@ -738,16 +747,16 @@ var createWorker8 = /* @__PURE__ */ __name((connection2, telemetry2, services) =
|
|
|
738
747
|
const { tx } = job.data;
|
|
739
748
|
const hash = await PayloadBuilder11.hash(tx[0]);
|
|
740
749
|
const state = assertEx17(await stateMap.get(hash), () => `[${hash}] state not found`);
|
|
741
|
-
const preparedTx =
|
|
742
|
-
const { submissionHash: existingSubmissionHash } = state;
|
|
750
|
+
const { preparedTx, offChainPayloads = [], submissionHash: existingSubmissionHash } = state;
|
|
743
751
|
if (isDefined9(existingSubmissionHash)) {
|
|
744
752
|
await job.log(`[${hash}] Tx already submitted with submission response hash ${existingSubmissionHash}`);
|
|
745
753
|
return {
|
|
746
754
|
submissionHash: existingSubmissionHash
|
|
747
755
|
};
|
|
748
756
|
}
|
|
757
|
+
const txToSubmit = assertEx17(preparedTx, () => `[${hash}] preparedTx not found`);
|
|
749
758
|
await job.log(`[${hash}] Submitting XL1 tx`);
|
|
750
|
-
const [submissionHash] = await submitXl1Transaction(
|
|
759
|
+
const [submissionHash] = await submitXl1Transaction(txToSubmit, offChainPayloads, gateway);
|
|
751
760
|
await job.log(`[${hash}] Submitted XL1 tx`);
|
|
752
761
|
return {
|
|
753
762
|
submissionHash
|
|
@@ -827,14 +836,15 @@ var getJobIdForXl1ToEthBridgeJob = /* @__PURE__ */ __name(async (tx) => {
|
|
|
827
836
|
}, "getJobIdForXl1ToEthBridgeJob");
|
|
828
837
|
|
|
829
838
|
// src/queue/flows/createXl1ToEthBridgeJob/createXl1ToEthBridgeJob.ts
|
|
830
|
-
var createXl1ToEthBridgeJob = /* @__PURE__ */ __name(async (flowProducer2, tx) => {
|
|
839
|
+
var createXl1ToEthBridgeJob = /* @__PURE__ */ __name(async (flowProducer2, tx, offChainPayloads = []) => {
|
|
831
840
|
const jobId = await getJobIdForXl1ToEthBridgeJob(tx);
|
|
832
841
|
const flow = await flowProducer2.add({
|
|
833
842
|
// Step 0 (runs first as parent job)
|
|
834
843
|
name: Xl1ToEthBridgeParent.name,
|
|
835
844
|
queueName: Xl1ToEthBridgeParent.queueName,
|
|
836
845
|
data: {
|
|
837
|
-
tx
|
|
846
|
+
tx,
|
|
847
|
+
offChainPayloads
|
|
838
848
|
},
|
|
839
849
|
opts: {
|
|
840
850
|
jobId
|
|
@@ -877,7 +887,8 @@ var createXl1ToEthBridgeJob = /* @__PURE__ */ __name(async (flowProducer2, tx) =
|
|
|
877
887
|
name: EthTransactionSubmission.name,
|
|
878
888
|
queueName: EthTransactionSubmission.queueName,
|
|
879
889
|
data: {
|
|
880
|
-
tx
|
|
890
|
+
tx,
|
|
891
|
+
offChainPayloads
|
|
881
892
|
},
|
|
882
893
|
opts: {
|
|
883
894
|
jobId
|
|
@@ -888,7 +899,8 @@ var createXl1ToEthBridgeJob = /* @__PURE__ */ __name(async (flowProducer2, tx) =
|
|
|
888
899
|
name: EthTransactionPreparation.name,
|
|
889
900
|
queueName: EthTransactionPreparation.queueName,
|
|
890
901
|
data: {
|
|
891
|
-
tx
|
|
902
|
+
tx,
|
|
903
|
+
offChainPayloads
|
|
892
904
|
},
|
|
893
905
|
opts: {
|
|
894
906
|
jobId,
|
|
@@ -947,7 +959,8 @@ var createXl1ToEthBridgeJob = /* @__PURE__ */ __name(async (flowProducer2, tx) =
|
|
|
947
959
|
name: Xl1TransactionPreparation.name,
|
|
948
960
|
queueName: Xl1TransactionPreparation.queueName,
|
|
949
961
|
data: {
|
|
950
|
-
tx
|
|
962
|
+
tx,
|
|
963
|
+
offChainPayloads
|
|
951
964
|
},
|
|
952
965
|
opts: {
|
|
953
966
|
jobId,
|
|
@@ -1227,8 +1240,7 @@ var makeBridgeToRemoteRoute = /* @__PURE__ */ __name((config) => {
|
|
|
1227
1240
|
const singedHydratedTransaction = [
|
|
1228
1241
|
signedTxBw,
|
|
1229
1242
|
[
|
|
1230
|
-
transfer
|
|
1231
|
-
bridgeIntent
|
|
1243
|
+
transfer
|
|
1232
1244
|
]
|
|
1233
1245
|
];
|
|
1234
1246
|
const existingFlow = await getXl1ToEthBridgeJob(flowProducer2, singedHydratedTransaction);
|
|
@@ -1236,7 +1248,9 @@ var makeBridgeToRemoteRoute = /* @__PURE__ */ __name((config) => {
|
|
|
1236
1248
|
res.status(200).send();
|
|
1237
1249
|
return;
|
|
1238
1250
|
}
|
|
1239
|
-
await createXl1ToEthBridgeJob(flowProducer2, singedHydratedTransaction
|
|
1251
|
+
await createXl1ToEthBridgeJob(flowProducer2, singedHydratedTransaction, [
|
|
1252
|
+
bridgeIntent
|
|
1253
|
+
]);
|
|
1240
1254
|
const srcConfirmation = await PayloadBuilder14.hash(signedTxBw);
|
|
1241
1255
|
const bridgeCommonFieldsZod = z2.object({}).extend(BridgeSourceObservationFieldsZod.shape);
|
|
1242
1256
|
const bridgeCommonFields = bridgeCommonFieldsZod.parse(bridgeIntent);
|
|
@@ -1344,9 +1358,13 @@ var makeBridgeToRemoteStatusRoute = /* @__PURE__ */ __name((config) => {
|
|
|
1344
1358
|
const result = [];
|
|
1345
1359
|
const queues = getXl1ToEthQueues(config);
|
|
1346
1360
|
const statusQueueJobs = await getStatusQueueJobs(queues, jobId);
|
|
1347
|
-
const tx = statusQueueJobs.xl1ToEthBridgeParentJob?.data
|
|
1361
|
+
const { tx, offChainPayloads = [] } = statusQueueJobs.xl1ToEthBridgeParentJob?.data ?? {};
|
|
1348
1362
|
if (!tx) return res.sendStatus(404);
|
|
1349
|
-
const
|
|
1363
|
+
const allPayloads = [
|
|
1364
|
+
...tx[1],
|
|
1365
|
+
...offChainPayloads
|
|
1366
|
+
];
|
|
1367
|
+
const bridgeIntent = allPayloads.find(isBridgeIntent5);
|
|
1350
1368
|
if (!bridgeIntent) return res.sendStatus(404);
|
|
1351
1369
|
result[0] = asBridgeIntent(PayloadBuilder15.omitMeta(bridgeIntent));
|
|
1352
1370
|
const { xl1TransactionMonitorJob } = statusQueueJobs;
|
|
@@ -1412,17 +1430,7 @@ var addRoutes = /* @__PURE__ */ __name((app, config, gateway) => {
|
|
|
1412
1430
|
var getApp = /* @__PURE__ */ __name((config, gateway) => {
|
|
1413
1431
|
addInstrumentation();
|
|
1414
1432
|
const app = express();
|
|
1415
|
-
app
|
|
1416
|
-
app.use(cors());
|
|
1417
|
-
app.use(compression());
|
|
1418
|
-
app.use(responseProfiler);
|
|
1419
|
-
app.use(getJsonBodyParser(getJsonBodyParserOptions({
|
|
1420
|
-
limit: "1mb"
|
|
1421
|
-
})));
|
|
1422
|
-
app.use(standardResponses);
|
|
1423
|
-
disableExpressDefaultPoweredByHeader(app);
|
|
1424
|
-
app.use(customPoweredByHeader);
|
|
1425
|
-
disableCaseSensitiveRouting(app);
|
|
1433
|
+
sharedMiddleware(app);
|
|
1426
1434
|
addFlowProducer(app, config);
|
|
1427
1435
|
addRoutes(app, config, gateway);
|
|
1428
1436
|
app.use(standardErrors);
|