@xyo-network/chain-bridge 1.19.16 → 1.19.18
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 +256 -145
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/queue/flowProducer.d.ts +2 -1
- package/dist/node/queue/flowProducer.d.ts.map +1 -1
- package/dist/node/queue/flows/createXl1ToEthBridgeJob.d.ts.map +1 -1
- package/dist/node/queue/index.d.ts +1 -0
- package/dist/node/queue/index.d.ts.map +1 -1
- package/dist/node/queue/telemetry.d.ts +3 -0
- package/dist/node/queue/telemetry.d.ts.map +1 -0
- package/dist/node/queue/workers/EthTransactionMonitor.d.ts +9 -0
- package/dist/node/queue/workers/EthTransactionMonitor.d.ts.map +1 -1
- package/dist/node/queue/workers/EthTransactionPreparation.d.ts +7 -1
- package/dist/node/queue/workers/EthTransactionPreparation.d.ts.map +1 -1
- package/dist/node/queue/workers/EthTransactionSubmission.d.ts +8 -0
- package/dist/node/queue/workers/EthTransactionSubmission.d.ts.map +1 -1
- package/dist/node/queue/workers/WorkerDescription.d.ts +2 -1
- package/dist/node/queue/workers/WorkerDescription.d.ts.map +1 -1
- package/dist/node/queue/workers/Xl1ToEthBridgeParent.d.ts +3 -0
- package/dist/node/queue/workers/Xl1ToEthBridgeParent.d.ts.map +1 -1
- package/dist/node/queue/workers/Xl1TransactionMonitor.d.ts +6 -0
- package/dist/node/queue/workers/Xl1TransactionMonitor.d.ts.map +1 -1
- package/dist/node/queue/workers/Xl1TransactionPreparation.d.ts +7 -0
- package/dist/node/queue/workers/Xl1TransactionPreparation.d.ts.map +1 -1
- package/dist/node/queue/workers/Xl1TransactionSubmission.d.ts +8 -0
- package/dist/node/queue/workers/Xl1TransactionSubmission.d.ts.map +1 -1
- package/dist/node/queue/workers/createWorkers.d.ts +2 -1
- package/dist/node/queue/workers/createWorkers.d.ts.map +1 -1
- package/dist/node/queue/workers/util/AsyncLogger.d.ts +5 -0
- package/dist/node/queue/workers/util/AsyncLogger.d.ts.map +1 -0
- package/dist/node/queue/workers/util/index.d.ts +3 -2
- package/dist/node/queue/workers/util/index.d.ts.map +1 -1
- package/dist/node/queue/workers/util/{validateSufficientAllowance.d.ts → validateSufficientLiquiditySourceAllowance.d.ts} +3 -7
- package/dist/node/queue/workers/util/validateSufficientLiquiditySourceAllowance.d.ts.map +1 -0
- package/dist/node/queue/workers/util/{validateSufficientBalance.d.ts → validateSufficientLiquiditySourceBalance.d.ts} +3 -7
- package/dist/node/queue/workers/util/validateSufficientLiquiditySourceBalance.d.ts.map +1 -0
- package/dist/node/queue/workers/util/validateSufficientRunnerEthBalanceForGas.d.ts +14 -0
- package/dist/node/queue/workers/util/validateSufficientRunnerEthBalanceForGas.d.ts.map +1 -0
- package/dist/node/server/addFlowProducer.d.ts.map +1 -1
- package/dist/node/server/addWorkers.d.ts.map +1 -1
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteStatus.d.ts.map +1 -1
- package/dist/node/util/BridgeFees.d.ts +7 -1
- package/dist/node/util/BridgeFees.d.ts.map +1 -1
- package/package.json +30 -35
- package/src/config/getBridgeWalletAccount.ts +1 -1
- package/src/config/getGateway.ts +1 -1
- package/src/queue/flowProducer.ts +3 -2
- package/src/queue/flows/createXl1ToEthBridgeJob.ts +12 -2
- package/src/queue/index.ts +1 -0
- package/src/queue/telemetry.ts +12 -0
- package/src/queue/workers/EthTransactionMonitor.ts +10 -6
- package/src/queue/workers/EthTransactionPreparation.ts +17 -9
- package/src/queue/workers/EthTransactionSubmission.ts +8 -28
- package/src/queue/workers/WorkerDescription.ts +2 -1
- package/src/queue/workers/Xl1ToEthBridgeParent.ts +8 -5
- package/src/queue/workers/Xl1TransactionMonitor.ts +7 -5
- package/src/queue/workers/Xl1TransactionPreparation.ts +7 -7
- package/src/queue/workers/Xl1TransactionSubmission.ts +6 -5
- package/src/queue/workers/createWorkers.ts +9 -8
- package/src/queue/workers/util/AsyncLogger.ts +5 -0
- package/src/queue/workers/util/index.ts +3 -2
- package/src/queue/workers/util/{validateSufficientAllowance.ts → validateSufficientLiquiditySourceAllowance.ts} +3 -6
- package/src/queue/workers/util/{validateSufficientBalance.ts → validateSufficientLiquiditySourceBalance.ts} +3 -6
- package/src/queue/workers/util/validateSufficientRunnerEthBalanceForGas.ts +57 -0
- package/src/server/addFlowProducer.ts +5 -2
- package/src/server/addWorkers.ts +6 -2
- package/src/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteStatus.ts +130 -65
- package/src/services/getServices.ts +1 -1
- package/src/util/BridgeFees.ts +10 -1
- package/dist/node/queue/workers/util/validateSufficientAllowance.d.ts.map +0 -1
- package/dist/node/queue/workers/util/validateSufficientBalance.d.ts.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FlowProducer } from 'bullmq';
|
|
2
|
+
import type { BullMQOtel } from 'bullmq-otel';
|
|
2
3
|
import type { Redis } from 'ioredis';
|
|
3
|
-
export declare const getFlowProducer: (connection: Redis) => FlowProducer;
|
|
4
|
+
export declare const getFlowProducer: (connection: Redis, telemetry?: BullMQOtel) => FlowProducer;
|
|
4
5
|
//# sourceMappingURL=flowProducer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowProducer.d.ts","sourceRoot":"","sources":["../../../src/queue/flowProducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAIpC,eAAO,MAAM,eAAe,GAAI,YAAY,KAAK,
|
|
1
|
+
{"version":3,"file":"flowProducer.d.ts","sourceRoot":"","sources":["../../../src/queue/flowProducer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAIpC,eAAO,MAAM,eAAe,GAAI,YAAY,KAAK,EAAE,YAAY,UAAU,iBAIxE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createXl1ToEthBridgeJob.d.ts","sourceRoot":"","sources":["../../../../src/queue/flows/createXl1ToEthBridgeJob.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createXl1ToEthBridgeJob.d.ts","sourceRoot":"","sources":["../../../../src/queue/flows/createXl1ToEthBridgeJob.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAO1C;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAClC,cAAc,YAAY,EAC1B,IAAI,yBAAyB,sCAmE9B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/queue/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/queue/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../../src/queue/telemetry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAKxC,eAAO,MAAM,YAAY,kBAIxB,CAAA"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import type { SignedHydratedTransaction } from '@xyo-network/xl1-sdk';
|
|
1
2
|
import type { WorkerDescription } from './WorkerDescription.ts';
|
|
3
|
+
export type EthTransactionMonitorJobData = {
|
|
4
|
+
tx: SignedHydratedTransaction;
|
|
5
|
+
};
|
|
6
|
+
export interface EthTransactionMonitorJobReturn {
|
|
7
|
+
blockHash: string;
|
|
8
|
+
blockNumber: number;
|
|
9
|
+
submissionHash: string;
|
|
10
|
+
}
|
|
2
11
|
export declare const EthTransactionMonitor: WorkerDescription;
|
|
3
12
|
//# sourceMappingURL=EthTransactionMonitor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthTransactionMonitor.d.ts","sourceRoot":"","sources":["../../../../src/queue/workers/EthTransactionMonitor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthTransactionMonitor.d.ts","sourceRoot":"","sources":["../../../../src/queue/workers/EthTransactionMonitor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAOrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,MAAM,MAAM,4BAA4B,GAAG;IAAE,EAAE,EAAE,yBAAyB,CAAA;CAAE,CAAA;AAC5E,MAAM,WAAW,8BAA8B;IAC7C,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;CACvB;AAoCD,eAAO,MAAM,qBAAqB,EAAE,iBAEnC,CAAA"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { type SignedHydratedTransaction } from '@xyo-network/xl1-sdk';
|
|
2
|
+
import type { BullMQOtel } from 'bullmq-otel';
|
|
1
3
|
import type { Redis } from 'ioredis';
|
|
2
4
|
import type { IBridgeServiceCollection } from '../../services/index.ts';
|
|
3
5
|
import type { WorkerDescription } from './WorkerDescription.ts';
|
|
4
|
-
export
|
|
6
|
+
export type EthTransactionPrepareJobData = {
|
|
7
|
+
tx: SignedHydratedTransaction;
|
|
8
|
+
};
|
|
9
|
+
export type EthTransactionPrepareJobReturn = Record<string, never>;
|
|
10
|
+
export declare const createWorker: (connection: Redis, telemetry?: BullMQOtel, services?: IBridgeServiceCollection) => void;
|
|
5
11
|
export declare const EthTransactionPreparation: WorkerDescription;
|
|
6
12
|
//# sourceMappingURL=EthTransactionPreparation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthTransactionPreparation.d.ts","sourceRoot":"","sources":["../../../../src/queue/workers/EthTransactionPreparation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthTransactionPreparation.d.ts","sourceRoot":"","sources":["../../../../src/queue/workers/EthTransactionPreparation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAGrF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAIvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,MAAM,MAAM,4BAA4B,GAAG;IAAE,EAAE,EAAE,yBAAyB,CAAA;CAAE,CAAA;AAC5E,MAAM,MAAM,8BAA8B,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AAKlE,eAAO,MAAM,YAAY,GAAI,YAAY,KAAK,EAAE,YAAY,UAAU,EAAE,WAAW,wBAAwB,SAmD1G,CAAA;AAED,eAAO,MAAM,yBAAyB,EAAE,iBAEvC,CAAA"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import { type SignedHydratedTransaction } from '@xyo-network/xl1-sdk';
|
|
2
|
+
import type { EthTxState } from '../../services/index.ts';
|
|
1
3
|
import type { WorkerDescription } from './WorkerDescription.ts';
|
|
4
|
+
export type EthTransactionSubmissionJobData = {
|
|
5
|
+
tx: SignedHydratedTransaction;
|
|
6
|
+
};
|
|
7
|
+
export interface EthTransactionSubmissionJobReturn {
|
|
8
|
+
submissionHash: Required<EthTxState>['submissionHash'];
|
|
9
|
+
}
|
|
2
10
|
export declare const EthTransactionSubmission: WorkerDescription;
|
|
3
11
|
//# sourceMappingURL=EthTransactionSubmission.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EthTransactionSubmission.d.ts","sourceRoot":"","sources":["../../../../src/queue/workers/EthTransactionSubmission.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EthTransactionSubmission.d.ts","sourceRoot":"","sources":["../../../../src/queue/workers/EthTransactionSubmission.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAMrE,OAAO,KAAK,EAAE,UAAU,EAA4B,MAAM,yBAAyB,CAAA;AAEnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,MAAM,MAAM,+BAA+B,GAAG;IAAE,EAAE,EAAE,yBAAyB,CAAA;CAAE,CAAA;AAE/E,MAAM,WAAW,iCAAiC;IAChD,cAAc,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,gBAAgB,CAAC,CAAA;CACvD;AAqDD,eAAO,MAAM,wBAAwB,EAAE,iBAEtC,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { BullMQOtel } from 'bullmq-otel';
|
|
1
2
|
import type { Redis } from 'ioredis';
|
|
2
3
|
import type { IBridgeServiceCollection } from '../../services/index.ts';
|
|
3
4
|
export interface WorkerDescription {
|
|
4
|
-
createWorker: (connection: Redis, services?: IBridgeServiceCollection) => void;
|
|
5
|
+
createWorker: (connection: Redis, telemetry?: BullMQOtel, services?: IBridgeServiceCollection) => void;
|
|
5
6
|
name: string;
|
|
6
7
|
queueName: string;
|
|
7
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkerDescription.d.ts","sourceRoot":"","sources":["../../../../src/queue/workers/WorkerDescription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAEvE,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE,wBAAwB,KAAK,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"WorkerDescription.d.ts","sourceRoot":"","sources":["../../../../src/queue/workers/WorkerDescription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAEvE,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,wBAAwB,KAAK,IAAI,CAAA;IACtG,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;CAClB"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { WorkerDescription } from './WorkerDescription.ts';
|
|
2
|
+
export type Xl1ToEthBridgeParentJobData = {};
|
|
3
|
+
export interface Xl1ToEthBridgeParentJobReturn {
|
|
4
|
+
}
|
|
2
5
|
export declare const Xl1ToEthBridgeParent: WorkerDescription;
|
|
3
6
|
//# sourceMappingURL=Xl1ToEthBridgeParent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Xl1ToEthBridgeParent.d.ts","sourceRoot":"","sources":["../../../../src/queue/workers/Xl1ToEthBridgeParent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Xl1ToEthBridgeParent.d.ts","sourceRoot":"","sources":["../../../../src/queue/workers/Xl1ToEthBridgeParent.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,MAAM,MAAM,2BAA2B,GAAG,EAAE,CAAA;AAC5C,MAAM,WAAW,6BAA6B;CAAI;AAyBlD,eAAO,MAAM,oBAAoB,EAAE,iBAElC,CAAA"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import type { SignedHydratedTransaction } from '@xyo-network/xl1-sdk';
|
|
1
2
|
import type { WorkerDescription } from './WorkerDescription.ts';
|
|
3
|
+
export type Xl1TransactionMonitorJobData = {
|
|
4
|
+
tx: SignedHydratedTransaction;
|
|
5
|
+
};
|
|
6
|
+
export interface Xl1TransactionMonitorJobReturn {
|
|
7
|
+
}
|
|
2
8
|
export declare const Xl1TransactionMonitor: WorkerDescription;
|
|
3
9
|
//# sourceMappingURL=Xl1TransactionMonitor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Xl1TransactionMonitor.d.ts","sourceRoot":"","sources":["../../../../src/queue/workers/Xl1TransactionMonitor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Xl1TransactionMonitor.d.ts","sourceRoot":"","sources":["../../../../src/queue/workers/Xl1TransactionMonitor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAOrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,MAAM,MAAM,4BAA4B,GAAG;IAAE,EAAE,EAAE,yBAAyB,CAAA;CAAE,CAAA;AAE5E,MAAM,WAAW,8BAA8B;CAC9C;AA2DD,eAAO,MAAM,qBAAqB,EAAE,iBAEnC,CAAA"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import type { SignedHydratedTransaction } from '@xyo-network/xl1-sdk';
|
|
1
2
|
import type { WorkerDescription } from './WorkerDescription.ts';
|
|
3
|
+
export type Xl1TransactionPreparationJobData = {
|
|
4
|
+
tx: SignedHydratedTransaction;
|
|
5
|
+
};
|
|
6
|
+
export interface Xl1TransactionPreparationJobReturn {
|
|
7
|
+
preparedTx: SignedHydratedTransaction;
|
|
8
|
+
}
|
|
2
9
|
export declare const Xl1TransactionPreparation: WorkerDescription;
|
|
3
10
|
//# sourceMappingURL=Xl1TransactionPreparation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Xl1TransactionPreparation.d.ts","sourceRoot":"","sources":["../../../../src/queue/workers/Xl1TransactionPreparation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Xl1TransactionPreparation.d.ts","sourceRoot":"","sources":["../../../../src/queue/workers/Xl1TransactionPreparation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAOrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,MAAM,MAAM,gCAAgC,GAAG;IAAE,EAAE,EAAE,yBAAyB,CAAA;CAAE,CAAA;AAChF,MAAM,WAAW,kCAAkC;IAAG,UAAU,EAAE,yBAAyB,CAAA;CAAE;AAgC7F,eAAO,MAAM,yBAAyB,EAAE,iBAEvC,CAAA"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import { type SignedHydratedTransaction } from '@xyo-network/xl1-sdk';
|
|
2
|
+
import type { Xl1TxState } from '../../services/index.ts';
|
|
1
3
|
import type { WorkerDescription } from './WorkerDescription.ts';
|
|
4
|
+
export type Xl1TransactionSubmissionJobData = {
|
|
5
|
+
tx: SignedHydratedTransaction;
|
|
6
|
+
};
|
|
7
|
+
export interface Xl1TransactionSubmissionJobReturn {
|
|
8
|
+
submissionHash: Required<Xl1TxState>['submissionHash'];
|
|
9
|
+
}
|
|
2
10
|
export declare const Xl1TransactionSubmission: WorkerDescription;
|
|
3
11
|
//# sourceMappingURL=Xl1TransactionSubmission.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Xl1TransactionSubmission.d.ts","sourceRoot":"","sources":["../../../../src/queue/workers/Xl1TransactionSubmission.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Xl1TransactionSubmission.d.ts","sourceRoot":"","sources":["../../../../src/queue/workers/Xl1TransactionSubmission.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAMrE,OAAO,KAAK,EAA4B,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,MAAM,MAAM,+BAA+B,GAAG;IAAE,EAAE,EAAE,yBAAyB,CAAA;CAAE,CAAA;AAE/E,MAAM,WAAW,iCAAiC;IAChD,cAAc,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,gBAAgB,CAAC,CAAA;CACvD;AAqDD,eAAO,MAAM,wBAAwB,EAAE,iBAEtC,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import type { BullMQOtel } from 'bullmq-otel';
|
|
1
2
|
import type { Redis } from 'ioredis';
|
|
2
3
|
import type { IBridgeServiceCollection } from '../../services/index.ts';
|
|
3
|
-
export declare const createWorkers: (connection: Redis, services: IBridgeServiceCollection) => void;
|
|
4
|
+
export declare const createWorkers: (connection: Redis, telemetry: BullMQOtel, services: IBridgeServiceCollection) => void;
|
|
4
5
|
//# sourceMappingURL=createWorkers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createWorkers.d.ts","sourceRoot":"","sources":["../../../../src/queue/workers/createWorkers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAWvE,eAAO,MAAM,aAAa,GAAI,YAAY,KAAK,EAAE,UAAU,wBAAwB,
|
|
1
|
+
{"version":3,"file":"createWorkers.d.ts","sourceRoot":"","sources":["../../../../src/queue/workers/createWorkers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAA;AAWvE,eAAO,MAAM,aAAa,GAAI,YAAY,KAAK,EAAE,WAAW,UAAU,EAAE,UAAU,wBAAwB,SAQzG,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AsyncLogger.d.ts","sourceRoot":"","sources":["../../../../../src/queue/workers/util/AsyncLogger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhD,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,UAAU,CAAC,OAAO,CAAC,CAAA;CAC9C"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './submitEthTransaction.ts';
|
|
2
2
|
export * from './submitXl1Transaction.ts';
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
3
|
+
export * from './validateSufficientLiquiditySourceAllowance.ts';
|
|
4
|
+
export * from './validateSufficientLiquiditySourceBalance.ts';
|
|
5
|
+
export * from './validateSufficientRunnerEthBalanceForGas.ts';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/queue/workers/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/queue/workers/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,iDAAiD,CAAA;AAC/D,cAAc,+CAA+C,CAAA;AAC7D,cAAc,+CAA+C,CAAA"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import type { Promisable } from '@xylabs/sdk-js';
|
|
2
1
|
import type { BridgeableToken, LiquidityPoolBridge } from '@xyo-network/typechain';
|
|
3
2
|
import { type SignedHydratedTransaction } from '@xyo-network/xl1-sdk';
|
|
4
|
-
|
|
5
|
-
log: (message: string) => Promisable<unknown>;
|
|
6
|
-
}
|
|
3
|
+
import type { AsyncLogger } from './AsyncLogger.ts';
|
|
7
4
|
/**
|
|
8
5
|
* Checks if the liquidity source has sufficient allowance for the bridge to execute the transaction. This doesn't
|
|
9
6
|
* ensure that (due to race conditions) the transaction will succeed, but is a quick check to avoid
|
|
@@ -14,6 +11,5 @@ interface IAsyncLogger {
|
|
|
14
11
|
* @param logger Optional logger for asynchronous logging
|
|
15
12
|
* @returns True if the liquidity source allowance is sufficient to execute the bridge
|
|
16
13
|
*/
|
|
17
|
-
export declare const
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=validateSufficientAllowance.d.ts.map
|
|
14
|
+
export declare const validateSufficientLiquiditySourceAllowance: (tx: SignedHydratedTransaction, bridgeableToken: BridgeableToken, bridge: LiquidityPoolBridge, logger?: AsyncLogger) => Promise<boolean>;
|
|
15
|
+
//# sourceMappingURL=validateSufficientLiquiditySourceAllowance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateSufficientLiquiditySourceAllowance.d.ts","sourceRoot":"","sources":["../../../../../src/queue/workers/util/validateSufficientLiquiditySourceAllowance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAClF,OAAO,EAAkB,KAAK,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAErF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD;;;;;;;;;GASG;AACH,eAAO,MAAM,0CAA0C,GACrD,IAAI,yBAAyB,EAC7B,iBAAiB,eAAe,EAChC,QAAQ,mBAAmB,EAC3B,SAAS,WAAW,qBAcrB,CAAA"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import type { Promisable } from '@xylabs/sdk-js';
|
|
2
1
|
import type { BridgeableToken, LiquidityPoolBridge } from '@xyo-network/typechain';
|
|
3
2
|
import { type SignedHydratedTransaction } from '@xyo-network/xl1-sdk';
|
|
4
|
-
|
|
5
|
-
log: (message: string) => Promisable<unknown>;
|
|
6
|
-
}
|
|
3
|
+
import type { AsyncLogger } from './AsyncLogger.ts';
|
|
7
4
|
/**
|
|
8
5
|
* Checks if the liquidity source has sufficient balance for the bridge to execute the transaction. This doesn't
|
|
9
6
|
* ensure that (due to race conditions) the transaction will succeed, but is a quick check to avoid
|
|
@@ -14,6 +11,5 @@ interface IAsyncLogger {
|
|
|
14
11
|
* @param logger Optional logger for asynchronous logging
|
|
15
12
|
* @returns True if the liquidity source balance is sufficient to execute the bridge
|
|
16
13
|
*/
|
|
17
|
-
export declare const
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=validateSufficientBalance.d.ts.map
|
|
14
|
+
export declare const validateSufficientLiquiditySourceBalance: (tx: SignedHydratedTransaction, bridgeableToken: BridgeableToken, bridge: LiquidityPoolBridge, logger?: AsyncLogger) => Promise<boolean>;
|
|
15
|
+
//# sourceMappingURL=validateSufficientLiquiditySourceBalance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateSufficientLiquiditySourceBalance.d.ts","sourceRoot":"","sources":["../../../../../src/queue/workers/util/validateSufficientLiquiditySourceBalance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAClF,OAAO,EAAkB,KAAK,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAErF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD;;;;;;;;;GASG;AACH,eAAO,MAAM,wCAAwC,GACnD,IAAI,yBAAyB,EAC7B,iBAAiB,eAAe,EAChC,QAAQ,mBAAmB,EAC3B,SAAS,WAAW,qBAarB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ContractTransaction, Wallet } from 'ethers';
|
|
2
|
+
import type { AsyncLogger } from './AsyncLogger.ts';
|
|
3
|
+
/**
|
|
4
|
+
* Validates that the wallet (the account that will submit the tx) has enough ETH
|
|
5
|
+
* to cover the estimated gas cost (plus a buffer) for the transaction.
|
|
6
|
+
* @param preparedTx The transaction that is being prepared for submission.
|
|
7
|
+
* This should be a fully populated transaction (to/from/data/value) except for gas fields.
|
|
8
|
+
* @param wallet The wallet that will be used to submit the transaction.
|
|
9
|
+
* @param logger Optional logger for asynchronous logging.
|
|
10
|
+
* @param bufferBps The buffer to apply to the estimated gas cost, in basis points (1/100th of a percent).
|
|
11
|
+
* @returns A boolean indicating whether the wallet has sufficient ETH to cover the estimated gas cost with the buffer applied.
|
|
12
|
+
*/
|
|
13
|
+
export declare const validateSufficientRunnerEthBalanceForGas: (preparedTx: ContractTransaction, wallet: Wallet, logger?: AsyncLogger, bufferBps?: bigint) => Promise<boolean>;
|
|
14
|
+
//# sourceMappingURL=validateSufficientRunnerEthBalanceForGas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateSufficientRunnerEthBalanceForGas.d.ts","sourceRoot":"","sources":["../../../../../src/queue/workers/util/validateSufficientRunnerEthBalanceForGas.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAInD;;;;;;;;;GASG;AACH,eAAO,MAAM,wCAAwC,GACnD,YAAY,mBAAmB,EAC/B,QAAQ,MAAM,EACd,SAAS,WAAW,EACpB,YAAW,MAA+B,qBAmC3C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addFlowProducer.d.ts","sourceRoot":"","sources":["../../../src/server/addFlowProducer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"addFlowProducer.d.ts","sourceRoot":"","sources":["../../../src/server/addFlowProducer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAMtC,eAAO,MAAM,eAAe,GAAI,KAAK,OAAO,EAAE,QAAQ,YAAY,KAAG,OAMpE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addWorkers.d.ts","sourceRoot":"","sources":["../../../src/server/addWorkers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"addWorkers.d.ts","sourceRoot":"","sources":["../../../src/server/addWorkers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAMpE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAA;AAEpE,eAAO,MAAM,UAAU,GAAI,QAAQ,YAAY,EAAE,UAAU,wBAAwB,SAIlF,CAAA"}
|
package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteStatus.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridgeToRemoteStatus.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"bridgeToRemoteStatus.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAWpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAiBvB,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAK1C,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AA0E1F,eAAO,MAAM,6BAA6B,GAAI,QAAQ,YAAY,KAAG,eA2DpE,CAAA"}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Hex, type JsonObject } from '@xylabs/sdk-js';
|
|
2
|
+
import { z } from 'zod';
|
|
2
3
|
export interface BridgeFees extends JsonObject {
|
|
3
4
|
feeFixed: Hex;
|
|
4
5
|
feeVariable: Hex;
|
|
5
6
|
srcAmount: Hex;
|
|
6
7
|
}
|
|
8
|
+
export declare const BridgeFeesZod: z.ZodObject<{
|
|
9
|
+
feeFixed: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
10
|
+
feeVariable: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
11
|
+
srcAmount: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
12
|
+
}, z.core.$strip>;
|
|
7
13
|
//# sourceMappingURL=BridgeFees.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BridgeFees.d.ts","sourceRoot":"","sources":["../../../src/util/BridgeFees.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"BridgeFees.d.ts","sourceRoot":"","sources":["../../../src/util/BridgeFees.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EAAU,KAAK,UAAU,EAClC,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,WAAW,UAAW,SAAQ,UAAU;IAC5C,QAAQ,EAAE,GAAG,CAAA;IACb,WAAW,EAAE,GAAG,CAAA;IAChB,SAAS,EAAE,GAAG,CAAA;CACf;AAED,eAAO,MAAM,aAAa;;;;iBAIxB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/chain-bridge",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.18",
|
|
4
4
|
"description": "XYO Layer One Bridge",
|
|
5
5
|
"homepage": "https://xylabs.com",
|
|
6
6
|
"bugs": {
|
|
@@ -55,24 +55,24 @@
|
|
|
55
55
|
"@xylabs/express": "~5.0.80",
|
|
56
56
|
"@xylabs/mongo": "~5.0.80",
|
|
57
57
|
"@xylabs/sdk-js": "~5.0.80",
|
|
58
|
-
"@xyo-network/boundwitness-validator": "~5.3.
|
|
59
|
-
"@xyo-network/chain-orchestration": "~1.19.
|
|
60
|
-
"@xyo-network/chain-protocol": "~1.19.
|
|
61
|
-
"@xyo-network/chain-services": "~1.19.
|
|
62
|
-
"@xyo-network/sdk-js": "~5.3.
|
|
63
|
-
"@xyo-network/sentinel-abstract": "~5.3.
|
|
64
|
-
"@xyo-network/sentinel-model": "~5.3.
|
|
58
|
+
"@xyo-network/boundwitness-validator": "~5.3.10",
|
|
59
|
+
"@xyo-network/chain-orchestration": "~1.19.18",
|
|
60
|
+
"@xyo-network/chain-protocol": "~1.19.18",
|
|
61
|
+
"@xyo-network/chain-services": "~1.19.18",
|
|
62
|
+
"@xyo-network/sdk-js": "~5.3.10",
|
|
63
|
+
"@xyo-network/sentinel-abstract": "~5.3.10",
|
|
64
|
+
"@xyo-network/sentinel-model": "~5.3.10",
|
|
65
65
|
"@xyo-network/typechain": "~4.1.1",
|
|
66
|
-
"@xyo-network/wallet": "~5.3.
|
|
67
|
-
"@xyo-network/
|
|
68
|
-
"@xyo-network/xl1-sdk": "~1.24.24",
|
|
66
|
+
"@xyo-network/wallet-model": "~5.3.10",
|
|
67
|
+
"@xyo-network/xl1-sdk": "~1.24.29",
|
|
69
68
|
"async-mutex": "~0.5.0",
|
|
70
|
-
"bullmq": "~5.
|
|
69
|
+
"bullmq": "~5.70.1",
|
|
70
|
+
"bullmq-otel": "~1.3.0",
|
|
71
71
|
"compression": "~1.8.1",
|
|
72
72
|
"cors": "~2.8.6",
|
|
73
73
|
"ethers": "^6.16.0",
|
|
74
74
|
"express": "~5.2.1",
|
|
75
|
-
"ioredis": "5.9.
|
|
75
|
+
"ioredis": "5.9.3",
|
|
76
76
|
"uuid": "~13.0.0",
|
|
77
77
|
"yargs-parser": "~22.0.0"
|
|
78
78
|
},
|
|
@@ -83,41 +83,36 @@
|
|
|
83
83
|
"@types/express": "5.0.6",
|
|
84
84
|
"@types/express-serve-static-core": "~5.1.1",
|
|
85
85
|
"@types/node": "~25.3.0",
|
|
86
|
-
"@xylabs/axios": "~5.0.80",
|
|
87
86
|
"@xylabs/mongo": "~5.0.80",
|
|
88
87
|
"@xylabs/sdk-js": "~5.0.80",
|
|
89
88
|
"@xylabs/ts-scripts-yarn3": "~7.3.2",
|
|
90
89
|
"@xylabs/tsconfig": "~7.3.2",
|
|
91
90
|
"@xylabs/vitest-extended": "~5.0.80",
|
|
92
|
-
"@xyo-network/account": "~5.3.
|
|
93
|
-
"@xyo-network/account-model": "~5.3.
|
|
94
|
-
"@xyo-network/archivist-abstract": "~5.3.
|
|
95
|
-
"@xyo-network/archivist-
|
|
96
|
-
"@xyo-network/archivist-
|
|
97
|
-
"@xyo-network/archivist-view": "~5.3.7",
|
|
91
|
+
"@xyo-network/account": "~5.3.10",
|
|
92
|
+
"@xyo-network/account-model": "~5.3.10",
|
|
93
|
+
"@xyo-network/archivist-abstract": "~5.3.10",
|
|
94
|
+
"@xyo-network/archivist-mongodb": "~5.3.10",
|
|
95
|
+
"@xyo-network/archivist-view": "~5.3.10",
|
|
98
96
|
"@xyo-network/bios": "~7.2.1",
|
|
99
97
|
"@xyo-network/bios-model": "~7.2.1",
|
|
100
|
-
"@xyo-network/boundwitness-builder": "~5.3.
|
|
101
|
-
"@xyo-network/chain-protocol": "~1.19.
|
|
102
|
-
"@xyo-network/chain-services": "~1.19.
|
|
103
|
-
"@xyo-network/chain-telemetry": "~1.19.
|
|
104
|
-
"@xyo-network/
|
|
105
|
-
"@xyo-network/module-abstract": "~5.3.
|
|
106
|
-
"@xyo-network/
|
|
107
|
-
"@xyo-network/
|
|
108
|
-
"@xyo-network/
|
|
109
|
-
"@xyo-network/sdk
|
|
110
|
-
"@xyo-network/sentinel-memory": "~5.3.7",
|
|
111
|
-
"@xyo-network/wallet": "~5.3.7",
|
|
112
|
-
"@xyo-network/xl1-sdk": "~1.24.24",
|
|
98
|
+
"@xyo-network/boundwitness-builder": "~5.3.10",
|
|
99
|
+
"@xyo-network/chain-protocol": "~1.19.18",
|
|
100
|
+
"@xyo-network/chain-services": "~1.19.18",
|
|
101
|
+
"@xyo-network/chain-telemetry": "~1.19.18",
|
|
102
|
+
"@xyo-network/module-abstract": "~5.3.10",
|
|
103
|
+
"@xyo-network/module-abstract-mongodb": "~5.3.10",
|
|
104
|
+
"@xyo-network/node-memory": "~5.3.10",
|
|
105
|
+
"@xyo-network/sdk-js": "~5.3.10",
|
|
106
|
+
"@xyo-network/sentinel-memory": "~5.3.10",
|
|
107
|
+
"@xyo-network/xl1-sdk": "~1.24.29",
|
|
113
108
|
"async-mutex": "~0.5.0",
|
|
114
109
|
"axios": "~1.13.5",
|
|
115
110
|
"dotenv": "~17.3.1",
|
|
116
|
-
"eslint": "^9.39.
|
|
111
|
+
"eslint": "^9.39.3",
|
|
117
112
|
"ethers": "^6.16.0",
|
|
118
113
|
"http-status-codes": "~2.3.0",
|
|
119
114
|
"mongodb": "~7.1.0",
|
|
120
|
-
"nodemon": "~3.1.
|
|
115
|
+
"nodemon": "~3.1.14",
|
|
121
116
|
"tslib": "~2.8.1",
|
|
122
117
|
"typescript": "~5.9.3",
|
|
123
118
|
"vitest": "~4.0.18",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Address, Promisable } from '@xylabs/sdk-js'
|
|
2
2
|
import { isDefined, isUndefined } from '@xylabs/sdk-js'
|
|
3
|
-
import { HDWallet } from '@xyo-network/
|
|
3
|
+
import { HDWallet } from '@xyo-network/sdk-js'
|
|
4
4
|
import type { WalletInstance } from '@xyo-network/wallet-model'
|
|
5
5
|
import type { ActorConfig } from '@xyo-network/xl1-sdk'
|
|
6
6
|
import { ADDRESS_INDEX, generateXyoBaseWalletFromPhrase } from '@xyo-network/xl1-sdk'
|
package/src/config/getGateway.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assertEx, isDefined } from '@xylabs/sdk-js'
|
|
2
2
|
import type { BridgeConfig } from '@xyo-network/chain-orchestration'
|
|
3
|
-
import { HDWallet } from '@xyo-network/
|
|
3
|
+
import { HDWallet } from '@xyo-network/sdk-js'
|
|
4
4
|
import type {
|
|
5
5
|
RpcSchemaMap, TransportFactory, XyoGatewayRunner,
|
|
6
6
|
} from '@xyo-network/xl1-sdk'
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { isDefined } from '@xylabs/sdk-js'
|
|
2
2
|
import { FlowProducer } from 'bullmq'
|
|
3
|
+
import type { BullMQOtel } from 'bullmq-otel'
|
|
3
4
|
import type { Redis } from 'ioredis'
|
|
4
5
|
|
|
5
6
|
let flowProducer: FlowProducer | undefined
|
|
6
7
|
|
|
7
|
-
export const getFlowProducer = (connection: Redis) => {
|
|
8
|
+
export const getFlowProducer = (connection: Redis, telemetry?: BullMQOtel) => {
|
|
8
9
|
if (isDefined(flowProducer)) return flowProducer
|
|
9
|
-
flowProducer = new FlowProducer({ connection })
|
|
10
|
+
flowProducer = new FlowProducer({ connection, telemetry })
|
|
10
11
|
return flowProducer
|
|
11
12
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PayloadBuilder } from '@xyo-network/sdk-js'
|
|
1
2
|
import type { SignedHydratedTransaction } from '@xyo-network/xl1-sdk'
|
|
2
3
|
import type { FlowProducer } from 'bullmq'
|
|
3
4
|
|
|
@@ -16,17 +17,21 @@ export const createXl1ToEthBridgeJob = async (
|
|
|
16
17
|
flowProducer: FlowProducer,
|
|
17
18
|
tx: SignedHydratedTransaction,
|
|
18
19
|
) => {
|
|
20
|
+
const jobId = await PayloadBuilder.hash(tx[0])
|
|
19
21
|
const flow = await flowProducer.add({
|
|
20
22
|
name: Xl1ToEthBridgeParent.name,
|
|
21
23
|
queueName: Xl1ToEthBridgeParent.queueName,
|
|
22
24
|
data: { tx },
|
|
25
|
+
opts: { jobId },
|
|
23
26
|
children: [
|
|
24
27
|
{
|
|
25
28
|
// Step 6 (runs after child completes)
|
|
26
29
|
name: EthTransactionMonitor.name,
|
|
27
30
|
queueName: EthTransactionMonitor.queueName,
|
|
28
31
|
data: { tx },
|
|
29
|
-
opts: {
|
|
32
|
+
opts: {
|
|
33
|
+
jobId, attempts: 60, backoff: { type: 'fixed', delay: 5000 },
|
|
34
|
+
},
|
|
30
35
|
children: [
|
|
31
36
|
{
|
|
32
37
|
// Step 5
|
|
@@ -39,25 +44,30 @@ export const createXl1ToEthBridgeJob = async (
|
|
|
39
44
|
name: EthTransactionPreparation.name,
|
|
40
45
|
queueName: EthTransactionPreparation.queueName,
|
|
41
46
|
data: { tx },
|
|
47
|
+
opts: { jobId },
|
|
42
48
|
children: [
|
|
43
49
|
{
|
|
44
50
|
// Step 3
|
|
45
51
|
name: Xl1TransactionMonitor.name,
|
|
46
52
|
queueName: Xl1TransactionMonitor.queueName,
|
|
47
53
|
data: { tx },
|
|
48
|
-
opts: {
|
|
54
|
+
opts: {
|
|
55
|
+
jobId, attempts: 60, backoff: { type: 'fixed', delay: 5000 },
|
|
56
|
+
},
|
|
49
57
|
children: [
|
|
50
58
|
{
|
|
51
59
|
// Step 2
|
|
52
60
|
name: Xl1TransactionSubmission.name,
|
|
53
61
|
queueName: Xl1TransactionSubmission.queueName,
|
|
54
62
|
data: { tx },
|
|
63
|
+
opts: { jobId },
|
|
55
64
|
children: [
|
|
56
65
|
{
|
|
57
66
|
// Step 1 (runs first as deepest child)
|
|
58
67
|
name: Xl1TransactionPreparation.name,
|
|
59
68
|
queueName: Xl1TransactionPreparation.queueName,
|
|
60
69
|
data: { tx },
|
|
70
|
+
opts: { jobId },
|
|
61
71
|
},
|
|
62
72
|
],
|
|
63
73
|
},
|
package/src/queue/index.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { isDefined } from '@xylabs/sdk-js'
|
|
2
|
+
import type { BullMQOtelOptions } from 'bullmq-otel'
|
|
3
|
+
import { BullMQOtel } from 'bullmq-otel'
|
|
4
|
+
|
|
5
|
+
let telemetry: BullMQOtel | undefined
|
|
6
|
+
const options: BullMQOtelOptions = { enableMetrics: true }
|
|
7
|
+
|
|
8
|
+
export const getTelemetry = () => {
|
|
9
|
+
if (isDefined(telemetry)) return telemetry
|
|
10
|
+
telemetry = new BullMQOtel(options)
|
|
11
|
+
return telemetry
|
|
12
|
+
}
|
|
@@ -3,26 +3,28 @@ import { PayloadBuilder } from '@xyo-network/sdk-js'
|
|
|
3
3
|
import type { SignedHydratedTransaction } from '@xyo-network/xl1-sdk'
|
|
4
4
|
import type { Job } from 'bullmq'
|
|
5
5
|
import { Worker } from 'bullmq'
|
|
6
|
+
import type { BullMQOtel } from 'bullmq-otel'
|
|
6
7
|
import type { Redis } from 'ioredis'
|
|
7
8
|
|
|
8
9
|
import type { IBridgeServiceCollection } from '../../services/index.ts'
|
|
9
10
|
import type { WorkerDescription } from './WorkerDescription.ts'
|
|
10
11
|
|
|
11
|
-
type
|
|
12
|
-
interface
|
|
12
|
+
export type EthTransactionMonitorJobData = { tx: SignedHydratedTransaction }
|
|
13
|
+
export interface EthTransactionMonitorJobReturn {
|
|
13
14
|
blockHash: string
|
|
14
15
|
blockNumber: number
|
|
16
|
+
submissionHash: string
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
const name = 'Monitor Submitted ETH Transaction'
|
|
18
20
|
const queueName = 'eth-tx-monitor'
|
|
19
|
-
const createWorker = (connection: Redis, services?: IBridgeServiceCollection) => {
|
|
21
|
+
const createWorker = (connection: Redis, telemetry?: BullMQOtel, services?: IBridgeServiceCollection) => {
|
|
20
22
|
const provider = assertEx(services?.provider, () => 'provider service not provided')
|
|
21
23
|
const stateMap = assertEx(services?.ethTxStateMap, () => 'ethTxStateMap service not provided')
|
|
22
24
|
|
|
23
25
|
const worker = new Worker(
|
|
24
26
|
queueName,
|
|
25
|
-
async (job: Job<
|
|
27
|
+
async (job: Job<EthTransactionMonitorJobData, EthTransactionMonitorJobReturn>) => {
|
|
26
28
|
const { tx } = job.data
|
|
27
29
|
const hash = await PayloadBuilder.hash(tx[0])
|
|
28
30
|
const state = assertEx(await stateMap.get(hash), () => 'State not found')
|
|
@@ -32,9 +34,11 @@ const createWorker = (connection: Redis, services?: IBridgeServiceCollection) =>
|
|
|
32
34
|
const { blockHash, blockNumber } = receipt
|
|
33
35
|
state.confirmationHash = blockHash
|
|
34
36
|
await stateMap.set(hash, state)
|
|
35
|
-
return {
|
|
37
|
+
return {
|
|
38
|
+
blockHash, blockNumber, submissionHash,
|
|
39
|
+
}
|
|
36
40
|
},
|
|
37
|
-
{ connection },
|
|
41
|
+
{ connection, telemetry },
|
|
38
42
|
)
|
|
39
43
|
|
|
40
44
|
worker.on('failed', (job, err) => {
|