@xyo-network/chain-bridge 1.23.0 → 1.23.2
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 +1251 -1083
- package/dist/node/index.mjs.map +7 -1
- package/dist/node/server/routes/bridge/routeDefinitions/getRouteDefinitions.d.ts.map +1 -1
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeFromRemoteEstimate.d.ts +93 -0
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeFromRemoteEstimate.d.ts.map +1 -0
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeFromRemoteStatus.d.ts.map +1 -1
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteEstimate.d.ts +1 -1
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteMaxEstimate.d.ts +1 -1
- package/dist/node/server/routes/bridge/routeDefinitions/routes/index.d.ts +1 -0
- package/dist/node/server/routes/bridge/routeDefinitions/routes/index.d.ts.map +1 -1
- package/dist/node/services/BridgeFulfillmentState.d.ts +1 -1
- package/dist/node/services/IBridgeServiceCollection.d.ts +4 -0
- package/dist/node/services/IBridgeServiceCollection.d.ts.map +1 -1
- package/dist/node/services/evm/getRemoteConfirmationDepth.d.ts.map +1 -1
- package/dist/node/services/getServices.d.ts.map +1 -1
- package/dist/node/services/queue/flows/createEthToXl1BridgeJob/createEthToXl1BridgeJob.d.ts +1 -1
- package/dist/node/services/queue/workers/Xl1ReserveTxFulfillment.d.ts.map +1 -1
- package/dist/node/services/queue/workers/util/buildEthToXl1BridgePayloads.d.ts +44 -0
- package/dist/node/services/queue/workers/util/buildEthToXl1BridgePayloads.d.ts.map +1 -0
- package/dist/node/services/queue/workers/util/buildEthToXl1ReserveTx.d.ts +22 -6
- package/dist/node/services/queue/workers/util/buildEthToXl1ReserveTx.d.ts.map +1 -1
- package/dist/node/services/queue/workers/util/index.d.ts +1 -0
- package/dist/node/services/queue/workers/util/index.d.ts.map +1 -1
- package/dist/node/services/queue/workers/util/resolveEvmBlockTagAtDepth.d.ts +18 -7
- package/dist/node/services/queue/workers/util/resolveEvmBlockTagAtDepth.d.ts.map +1 -1
- package/dist/node/services/validation/index.d.ts +1 -0
- package/dist/node/services/validation/index.d.ts.map +1 -1
- package/dist/node/services/validation/validateAmountMeetsMinBridgeAmount.d.ts +20 -0
- package/dist/node/services/validation/validateAmountMeetsMinBridgeAmount.d.ts.map +1 -0
- package/package.json +26 -26
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRouteDefinitions.d.ts","sourceRoot":"","sources":["../../../../../../src/server/routes/bridge/routeDefinitions/getRouteDefinitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"getRouteDefinitions.d.ts","sourceRoot":"","sources":["../../../../../../src/server/routes/bridge/routeDefinitions/getRouteDefinitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAO5D,eAAO,MAAM,mBAAmB,GAAI,QAAQ,YAAY,EAAE,SAAS,gBAAgB,KAAG,eAAe,EAUpG,CAAA"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { RouteDefinition } from '@xylabs/express';
|
|
2
|
+
import type { BridgeConfig } from '@xyo-network/chain-orchestration';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
/**
|
|
5
|
+
* Request body mirrors `BridgeToRemoteEstimateBodyZod` exactly. The semantic flips:
|
|
6
|
+
* - `srcAddress` is the user's EVM source
|
|
7
|
+
* - `destAddress` is the user's XL1 destination
|
|
8
|
+
* - `srcAmount` is the gross EVM deposit
|
|
9
|
+
*/
|
|
10
|
+
export declare const BridgeFromRemoteEstimateBodyZod: z.ZodObject<{
|
|
11
|
+
srcAddress: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
12
|
+
srcAmount: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
13
|
+
destAddress: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export type BridgeFromRemoteEstimateBody = z.infer<typeof BridgeFromRemoteEstimateBodyZod>;
|
|
16
|
+
/**
|
|
17
|
+
* 3-tuple matching the outbound estimate response shape. The TransactionBoundWitness here is
|
|
18
|
+
* unsigned and represents what the BRIDGE will sign at Stage 2 fulfillment (sender =
|
|
19
|
+
* bridgeAccount.address) — not signable by the user. It's purely informational: a projection
|
|
20
|
+
* of the XL1 transaction that will appear on-chain after the user deposits on EVM.
|
|
21
|
+
*
|
|
22
|
+
* Outbound's TxBw is *both* signable-by-user AND a preview of on-chain artifact (because the
|
|
23
|
+
* user is the signer). Inbound separates these — the user's initiating action is on EVM, the
|
|
24
|
+
* concluding artifact is on XL1 signed by someone else. The estimate aligns on the "on-chain
|
|
25
|
+
* artifact" view for cross-direction symmetry.
|
|
26
|
+
*/
|
|
27
|
+
export declare const BridgeFromRemoteEstimateResponseZod: z.ZodTuple<[z.ZodObject<{
|
|
28
|
+
schema: z.ZodLiteral<"network.xyo.boundwitness" & {
|
|
29
|
+
readonly __schema: true;
|
|
30
|
+
}>;
|
|
31
|
+
addresses: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<Lowercase<string> & {
|
|
32
|
+
readonly __hex: true;
|
|
33
|
+
} & {
|
|
34
|
+
readonly __address: true;
|
|
35
|
+
}, string>>>;
|
|
36
|
+
payload_hashes: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHash, string>>>;
|
|
37
|
+
payload_schemas: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xyo-network/sdk-js").BrandedSchema<string>, string>>>;
|
|
38
|
+
previous_hashes: z.ZodArray<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHash, string>>>>;
|
|
39
|
+
$destination: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<Lowercase<string> & {
|
|
40
|
+
readonly __hex: true;
|
|
41
|
+
} & {
|
|
42
|
+
readonly __address: true;
|
|
43
|
+
}, string>>>;
|
|
44
|
+
$sourceQuery: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHash, string>>>;
|
|
45
|
+
$signatures: z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>, z.ZodNull]>>;
|
|
46
|
+
nbf: z.ZodPipe<z.ZodNumber, z.ZodTransform<import("@xyo-network/xl1-sdk").XL1BlockNumber, number>>;
|
|
47
|
+
exp: z.ZodPipe<z.ZodNumber, z.ZodTransform<import("@xyo-network/xl1-sdk").XL1BlockNumber, number>>;
|
|
48
|
+
fees: z.ZodObject<{
|
|
49
|
+
base: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
50
|
+
gasLimit: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
51
|
+
gasPrice: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
52
|
+
priority: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
chain: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
55
|
+
from: z.ZodPipe<z.ZodString, z.ZodTransform<Lowercase<string> & {
|
|
56
|
+
readonly __hex: true;
|
|
57
|
+
} & {
|
|
58
|
+
readonly __address: true;
|
|
59
|
+
}, string>>;
|
|
60
|
+
script: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
61
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
62
|
+
schema: z.ZodLiteral<"network.xyo.chain.bridge.intent" & {
|
|
63
|
+
readonly __schema: true;
|
|
64
|
+
}>;
|
|
65
|
+
src: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
66
|
+
srcAddress: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
67
|
+
srcAmount: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
68
|
+
srcToken: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
69
|
+
dest: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
70
|
+
destAddress: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
71
|
+
destAmount: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
72
|
+
destToken: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
73
|
+
nonce: z.ZodString;
|
|
74
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
75
|
+
schema: z.ZodLiteral<"network.xyo.transfer" & {
|
|
76
|
+
readonly __schema: true;
|
|
77
|
+
}>;
|
|
78
|
+
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
|
|
79
|
+
epoch: z.ZodNumber;
|
|
80
|
+
from: z.ZodPipe<z.ZodString, z.ZodTransform<Lowercase<string> & {
|
|
81
|
+
readonly __hex: true;
|
|
82
|
+
} & {
|
|
83
|
+
readonly __address: true;
|
|
84
|
+
}, string>>;
|
|
85
|
+
transfers: z.ZodRecord<z.ZodPipe<z.ZodString, z.ZodTransform<Lowercase<string> & {
|
|
86
|
+
readonly __hex: true;
|
|
87
|
+
} & {
|
|
88
|
+
readonly __address: true;
|
|
89
|
+
}, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>>;
|
|
90
|
+
}, z.core.$strip>], null>;
|
|
91
|
+
export type BridgeFromRemoteEstimateResponse = z.infer<typeof BridgeFromRemoteEstimateResponseZod>;
|
|
92
|
+
export declare const makeBridgeFromRemoteEstimateRoute: (config: BridgeConfig) => RouteDefinition;
|
|
93
|
+
//# sourceMappingURL=bridgeFromRemoteEstimate.d.ts.map
|
package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeFromRemoteEstimate.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridgeFromRemoteEstimate.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/routes/bridge/routeDefinitions/routes/bridgeFromRemoteEstimate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAKtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAKpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAUvB;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B;;;;iBAI1C,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAE1F;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAI9C,CAAA;AAEF,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAA;AAElG,eAAO,MAAM,iCAAiC,GAAI,QAAQ,YAAY,KAAG,eA2ExE,CAAA"}
|
package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeFromRemoteStatus.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridgeFromRemoteStatus.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/routes/bridge/routeDefinitions/routes/bridgeFromRemoteStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"bridgeFromRemoteStatus.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/routes/bridge/routeDefinitions/routes/bridgeFromRemoteStatus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAKtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAUpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAwBvB,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAK5C,CAAA;AACF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA;AA8C9F,eAAO,MAAM,+BAA+B,GAAI,QAAQ,YAAY,KAAG,eAmDtE,CAAA"}
|
|
@@ -3,9 +3,9 @@ import type { BridgeConfig } from '@xyo-network/chain-orchestration';
|
|
|
3
3
|
import type { XyoGatewayRunner } from '@xyo-network/xl1-sdk';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
export declare const BridgeToRemoteEstimateBodyZod: z.ZodObject<{
|
|
6
|
-
destAddress: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
7
6
|
srcAddress: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
8
7
|
srcAmount: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
8
|
+
destAddress: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
10
|
export type BridgeToRemoteEstimateBody = z.infer<typeof BridgeToRemoteEstimateBodyZod>;
|
|
11
11
|
export declare const BridgeToRemoteEstimateResponseZod: z.ZodTuple<[z.ZodObject<{
|
package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteMaxEstimate.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import type { BridgeConfig } from '@xyo-network/chain-orchestration';
|
|
|
3
3
|
import type { XyoGatewayRunner } from '@xyo-network/xl1-sdk';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
export declare const BridgeToRemoteMaxEstimateBodyZod: z.ZodObject<{
|
|
6
|
-
destAddress: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
7
6
|
srcAddress: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
8
7
|
srcAmount: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
8
|
+
destAddress: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/sdk-js").BrandedHex, string>>;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
10
|
export type BridgeToRemoteMaxEstimateBody = z.infer<typeof BridgeToRemoteMaxEstimateBodyZod>;
|
|
11
11
|
export declare const BridgeToRemoteMaxEstimateResponseZod: z.ZodTuple<[z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/routes/bridge/routeDefinitions/routes/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,qBAAqB,CAAA;AACnC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,2BAA2B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/server/routes/bridge/routeDefinitions/routes/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,qBAAqB,CAAA;AACnC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,2BAA2B,CAAA"}
|
|
@@ -21,7 +21,7 @@ export interface Attempt {
|
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Lifecycle state for a single EVM→XL1 bridge fulfillment, keyed in the IterableMap by the
|
|
24
|
-
* bridge identity string `evm
|
|
24
|
+
* bridge identity string `evm-{chainId}-{contract}-{bridgeId}`.
|
|
25
25
|
*
|
|
26
26
|
* Phase resolution: the state isn't a strict tagged union — instead, presence of the
|
|
27
27
|
* `fulfilled` and `failed` fields drives terminal short-circuits, and `currentAttempt` /
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/sdk-js';
|
|
2
|
+
import type { BridgeConfig } from '@xyo-network/chain-orchestration';
|
|
2
3
|
import type { AccountInstance } from '@xyo-network/sdk-js';
|
|
3
4
|
import type { BridgeableToken, LiquidityPoolBridge } from '@xyo-network/typechain';
|
|
4
5
|
import type { IterableMap, XyoGatewayRunner } from '@xyo-network/xl1-sdk';
|
|
@@ -14,6 +15,9 @@ export interface IBridgeServiceCollection {
|
|
|
14
15
|
/** EVM→XL1 reverse bridge fulfillment state, keyed by bridge identity string. */
|
|
15
16
|
bridgeFulfillmentMap: IterableMap<string, BridgeFulfillmentState>;
|
|
16
17
|
bridgeableToken: BridgeableToken;
|
|
18
|
+
/** Live BridgeConfig — workers read this at fulfillment time (no scan-time snapshot)
|
|
19
|
+
* so current fee/min/max settings apply to settlement. */
|
|
20
|
+
config: BridgeConfig;
|
|
17
21
|
ethTxStateMap: IterableMap<Hash, EthTxState>;
|
|
18
22
|
evmBridgeCursorMap: IterableMap<string, EvmBridgeCursor>;
|
|
19
23
|
gateway: XyoGatewayRunner;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IBridgeServiceCollection.d.ts","sourceRoot":"","sources":["../../../src/services/IBridgeServiceCollection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE9C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,eAAe,CAAA;IACxB,MAAM,EAAE,mBAAmB,CAAA;IAC3B,iFAAiF;IACjF,oBAAoB,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAA;IACjE,eAAe,EAAE,eAAe,CAAA;IAChC,aAAa,EAAE,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;IAC5C,kBAAkB,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IACxD,OAAO,EAAE,gBAAgB,CAAA;IACzB,QAAQ,EAAE,QAAQ,CAAA;IAClB,uBAAuB,EAAE,oBAAoB,CAAA;IAC7C,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;CAC7C"}
|
|
1
|
+
{"version":3,"file":"IBridgeServiceCollection.d.ts","sourceRoot":"","sources":["../../../src/services/IBridgeServiceCollection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE9C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,eAAe,CAAA;IACxB,MAAM,EAAE,mBAAmB,CAAA;IAC3B,iFAAiF;IACjF,oBAAoB,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAA;IACjE,eAAe,EAAE,eAAe,CAAA;IAChC;8DAC0D;IAC1D,MAAM,EAAE,YAAY,CAAA;IACpB,aAAa,EAAE,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;IAC5C,kBAAkB,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IACxD,OAAO,EAAE,gBAAgB,CAAA;IACzB,QAAQ,EAAE,QAAQ,CAAA;IAClB,uBAAuB,EAAE,oBAAoB,CAAA;IAC7C,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;CAC7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRemoteConfirmationDepth.d.ts","sourceRoot":"","sources":["../../../../src/services/evm/getRemoteConfirmationDepth.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAoBpE,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"getRemoteConfirmationDepth.d.ts","sourceRoot":"","sources":["../../../../src/services/evm/getRemoteConfirmationDepth.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAoBpE,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,WAAW,CAAA;AAmBvD,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,YAAY,GAAG,oBAAoB,CAIrF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getServices.d.ts","sourceRoot":"","sources":["../../../src/services/getServices.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AAGzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAO5D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAI7E;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAU,SAAS,mBAAmB,EAAE,SAAS,gBAAgB,KAAG,OAAO,CAAC,wBAAwB,
|
|
1
|
+
{"version":3,"file":"getServices.d.ts","sourceRoot":"","sources":["../../../src/services/getServices.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AAGzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAO5D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAI7E;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAU,SAAS,mBAAmB,EAAE,SAAS,gBAAgB,KAAG,OAAO,CAAC,wBAAwB,CAoC3H,CAAA"}
|
|
@@ -21,7 +21,7 @@ export interface EthToXl1BridgeJobContext {
|
|
|
21
21
|
* └─ eth-event-verify (Stage 1 — verify once, write canonical, deepest-first)
|
|
22
22
|
*
|
|
23
23
|
* All three jobs share the same jobId from getJobIdForEthToXl1BridgeJob — the deterministic
|
|
24
|
-
* `evm
|
|
24
|
+
* `evm-{chainId}-{contract}-{bridgeId}` form. That id IS the bridge's immutable identity:
|
|
25
25
|
* - BullMQ dedup makes scanner re-enqueues no-ops automatically.
|
|
26
26
|
* - The status route reconstructs the jobId from the URL parameter without contract reads.
|
|
27
27
|
* - Manual retry from BullBoard re-runs the *same* job rather than creating a parallel one.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Xl1ReserveTxFulfillment.d.ts","sourceRoot":"","sources":["../../../../../src/services/queue/workers/Xl1ReserveTxFulfillment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAAe,GAAG,EAC1B,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"Xl1ReserveTxFulfillment.d.ts","sourceRoot":"","sources":["../../../../../src/services/queue/workers/Xl1ReserveTxFulfillment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAAe,GAAG,EAC1B,MAAM,gBAAgB,CAAA;AAOvB,OAAO,KAAK,EACV,OAAO,EACR,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAcjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,MAAM,WAAW,8BAA8B;IAC7C,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,mCAAmC;IACnC,eAAe,EAAE,OAAO,CAAA;IACxB,oBAAoB;IACpB,UAAU,EAAE,GAAG,CAAA;IACf,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAA;IAChB,wDAAwD;IACxD,UAAU,EAAE,OAAO,CAAA;IACnB,sFAAsF;IACtF,eAAe,EAAE,GAAG,CAAA;CACrB;AAED,MAAM,MAAM,0BAA0B,GAAG,GAAG,CAAC,8BAA8B,EAAE,IAAI,CAAC,CAAA;AAmRlF,eAAO,MAAM,uBAAuB,EAAE,iBAErC,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Address, Hex } from '@xylabs/sdk-js';
|
|
2
|
+
import type { BridgeIntent, ChainId, Transfer } from '@xyo-network/xl1-sdk';
|
|
3
|
+
export interface BuildEthToXl1BridgePayloadsOptions {
|
|
4
|
+
/** Gross EVM deposit, in atto. */
|
|
5
|
+
amount: bigint;
|
|
6
|
+
/** XL1 address that signs the Transfer (the bridge wallet for Stage 2; the bridge wallet
|
|
7
|
+
* is also the projected `from` for the inbound estimate route). */
|
|
8
|
+
bridgeAccountAddress: Address;
|
|
9
|
+
/** Contract-assigned bridge id for Stage 2; projected `nextBridgeToId + 1` for the
|
|
10
|
+
* estimate route. */
|
|
11
|
+
bridgeId: bigint;
|
|
12
|
+
destAddress: Address;
|
|
13
|
+
evmChainId: Hex;
|
|
14
|
+
evmContractAddress: Address;
|
|
15
|
+
evmSrcAddress: Address;
|
|
16
|
+
evmTokenAddress: Hex;
|
|
17
|
+
feesAddress: Address;
|
|
18
|
+
feesAmount: bigint;
|
|
19
|
+
xl1ChainId: ChainId;
|
|
20
|
+
xl1TokenAddress: Hex;
|
|
21
|
+
}
|
|
22
|
+
export interface EthToXl1BridgePayloads {
|
|
23
|
+
intent: BridgeIntent;
|
|
24
|
+
transfer: Transfer;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Builds the Transfer + BridgeIntent pair that defines an EVM→XL1 reserve transfer at the
|
|
28
|
+
* payload level — without committing to whether the transaction will be signed (Stage 2
|
|
29
|
+
* fulfillment) or returned as a projection (`/bridgeFromRemote/estimate`). Both code paths
|
|
30
|
+
* route through here so the fee split, intent semantics, and nonce format stay in lockstep.
|
|
31
|
+
*
|
|
32
|
+
* Field semantics in the intent: `srcAmount = amount` (gross EVM deposit) and
|
|
33
|
+
* `destAmount = amount - feesAmount` (net XL1 credit). The fee is directly derivable as
|
|
34
|
+
* `srcAmount - destAmount` — mirrors the outbound semantic where `destAmount` is what hits
|
|
35
|
+
* destAddress.
|
|
36
|
+
*
|
|
37
|
+
* Transfer outputs collapse to a single entry when `feesAmount === 0n` or when
|
|
38
|
+
* `destAddress === feesAddress` (mirrors `createBridgeTransfer.ts:23-27`).
|
|
39
|
+
*
|
|
40
|
+
* The caller is responsible for ensuring `amount >= feesAmount` (typically by enforcing
|
|
41
|
+
* `minBridgeAmount` upstream). An assertEx guards against negative destination amounts.
|
|
42
|
+
*/
|
|
43
|
+
export declare function buildEthToXl1BridgePayloads(options: BuildEthToXl1BridgePayloadsOptions): EthToXl1BridgePayloads;
|
|
44
|
+
//# sourceMappingURL=buildEthToXl1BridgePayloads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildEthToXl1BridgePayloads.d.ts","sourceRoot":"","sources":["../../../../../../src/services/queue/workers/util/buildEthToXl1BridgePayloads.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAGlD,OAAO,KAAK,EACV,YAAY,EAAE,OAAO,EAAE,QAAQ,EAChC,MAAM,sBAAsB,CAAA;AAG7B,MAAM,WAAW,kCAAkC;IACjD,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAA;IACd;uEACmE;IACnE,oBAAoB,EAAE,OAAO,CAAA;IAC7B;yBACqB;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,GAAG,CAAA;IACf,kBAAkB,EAAE,OAAO,CAAA;IAC3B,aAAa,EAAE,OAAO,CAAA;IACtB,eAAe,EAAE,GAAG,CAAA;IACpB,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;IACnB,eAAe,EAAE,GAAG,CAAA;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,YAAY,CAAA;IACpB,QAAQ,EAAE,QAAQ,CAAA;CACnB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,kCAAkC,GAAG,sBAAsB,CA4C/G"}
|
|
@@ -2,6 +2,8 @@ import type { Address, Hex } from '@xylabs/sdk-js';
|
|
|
2
2
|
import type { AccountInstance } from '@xyo-network/sdk-js';
|
|
3
3
|
import type { ChainId, SignedHydratedTransaction, XL1BlockNumber } from '@xyo-network/xl1-sdk';
|
|
4
4
|
export interface BuildEthToXl1ReserveTxOptions {
|
|
5
|
+
/** Gross deposit on the EVM side (from `bridgesToRemote[id].amount`). The user's destination
|
|
6
|
+
* credit is `amount - feesAmount`; the fees address receives `feesAmount`. */
|
|
5
7
|
amount: bigint;
|
|
6
8
|
bridgeAccount: AccountInstance;
|
|
7
9
|
/** Contract-assigned bridge id from `bridgesToRemote(bridgeId)` storage. */
|
|
@@ -14,23 +16,37 @@ export interface BuildEthToXl1ReserveTxOptions {
|
|
|
14
16
|
/** Tx hash of the EVM transaction that emitted BridgedToRemote(bridgeId). */
|
|
15
17
|
evmTxHash: Hex;
|
|
16
18
|
exp: XL1BlockNumber;
|
|
19
|
+
/** XL1 address that receives the bridge fee. Pass the same value as `destAddress` to
|
|
20
|
+
* collapse to a single-output Transfer (the user effectively pays themselves). */
|
|
21
|
+
feesAddress: Address;
|
|
22
|
+
/** Total fee, in atto, to be credited to `feesAddress`. Caller is responsible for ensuring
|
|
23
|
+
* `amount >= feesAmount` (typically by enforcing `amount >= minBridgeAmount` upstream).
|
|
24
|
+
* Computed as `hexToBigInt(feeFixed) + hexToBigInt(feeVariable)`. */
|
|
25
|
+
feesAmount: bigint;
|
|
17
26
|
nbf: XL1BlockNumber;
|
|
18
27
|
xl1ChainId: ChainId;
|
|
19
28
|
xl1TokenAddress: Hex;
|
|
20
29
|
}
|
|
21
30
|
/**
|
|
22
|
-
* Builds a signed XL1 transaction that
|
|
23
|
-
* the
|
|
24
|
-
*
|
|
25
|
-
*
|
|
31
|
+
* Builds a signed XL1 transaction that settles an EVM→XL1 inbound bridge. The Transfer
|
|
32
|
+
* splits the gross `amount` between `destAddress` (net = amount - feesAmount) and
|
|
33
|
+
* `feesAddress`, mirroring the XL1→EVM outbound model where `createBridgeTransfer` splits
|
|
34
|
+
* the user's source amount between escrow and fees. `BridgeIntent` + `BridgeSourceObservation`
|
|
35
|
+
* attach the cross-chain provenance off-chain.
|
|
26
36
|
*
|
|
27
37
|
* The Transfer payload is what actually moves balance on XL1 (on-chain). The intent +
|
|
28
38
|
* source observation are off-chain provenance: they record what cross-chain operation this
|
|
29
39
|
* transfer represents and which EVM tx emitted the source-side `BridgedToRemote` event.
|
|
30
40
|
*
|
|
31
|
-
*
|
|
41
|
+
* Field semantics in the intent/observation: `srcAmount = amount` (gross EVM deposit) and
|
|
42
|
+
* `destAmount = amount - feesAmount` (net XL1 credit). This makes the fee directly derivable
|
|
43
|
+
* from the intent (`srcAmount - destAmount`) without consulting external config — the
|
|
44
|
+
* inbound mirror of how the outbound flow records what hits destAddress as `destAmount`.
|
|
45
|
+
*
|
|
46
|
+
* The BridgeIntent.nonce is the deterministic `evm-{chainId}-{contract}-{bridgeId}` form so
|
|
32
47
|
* it aligns with the BullMQ jobId and the status route's URL `:nonce` parameter — a single
|
|
33
|
-
* canonical id ties the same logical bridge across all surfaces.
|
|
48
|
+
* canonical id ties the same logical bridge across all surfaces. Dash delimiter is used
|
|
49
|
+
* because BullMQ rejects custom jobIds containing `:`.
|
|
34
50
|
*/
|
|
35
51
|
export declare function buildEthToXl1ReserveTx(options: BuildEthToXl1ReserveTxOptions): Promise<SignedHydratedTransaction>;
|
|
36
52
|
//# sourceMappingURL=buildEthToXl1ReserveTx.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildEthToXl1ReserveTx.d.ts","sourceRoot":"","sources":["../../../../../../src/services/queue/workers/util/buildEthToXl1ReserveTx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAE1D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"buildEthToXl1ReserveTx.d.ts","sourceRoot":"","sources":["../../../../../../src/services/queue/workers/util/buildEthToXl1ReserveTx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAElD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAE1D,OAAO,KAAK,EACe,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAC5E,MAAM,sBAAsB,CAAA;AAK7B,MAAM,WAAW,6BAA6B;IAC5C;kFAC8E;IAC9E,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,eAAe,CAAA;IAC9B,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,GAAG,CAAA;IACf,kBAAkB,EAAE,OAAO,CAAA;IAC3B,aAAa,EAAE,OAAO,CAAA;IACtB,eAAe,EAAE,GAAG,CAAA;IACpB,6EAA6E;IAC7E,SAAS,EAAE,GAAG,CAAA;IACd,GAAG,EAAE,cAAc,CAAA;IACnB;sFACkF;IAClF,WAAW,EAAE,OAAO,CAAA;IACpB;;yEAEqE;IACrE,UAAU,EAAE,MAAM,CAAA;IAClB,GAAG,EAAE,cAAc,CAAA;IACnB,UAAU,EAAE,OAAO,CAAA;IACnB,eAAe,EAAE,GAAG,CAAA;CACrB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,yBAAyB,CAAC,CAgEpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/services/queue/workers/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/services/queue/workers/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAA;AAChD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA"}
|
|
@@ -3,14 +3,25 @@ import type { EvmConfirmationDepth } from '../../../evm/index.ts';
|
|
|
3
3
|
/**
|
|
4
4
|
* Resolves an EvmConfirmationDepth into the concrete block reference used by `eth_call`
|
|
5
5
|
* / `eth_getLogs` / `nextBridgeToId({ blockTag })` / `bridgesToRemote(id, { blockTag })` /
|
|
6
|
-
* `queryFilter(filter, fromBlock, toBlock)`. Return
|
|
7
|
-
*
|
|
6
|
+
* `queryFilter(filter, fromBlock, toBlock)`. Return type covers all three forms ethers
|
|
7
|
+
* accepts as BlockTag and that typechain's `queryFilter` overload tolerates (`string |
|
|
8
|
+
* number`).
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
10
|
+
* Three branches, picked to avoid an unnecessary RPC round-trip *and* to avoid a class of
|
|
11
|
+
* pre-deploy-block bugs:
|
|
11
12
|
*
|
|
12
|
-
* 'finalized': forwarded as-is.
|
|
13
|
-
*
|
|
13
|
+
* - 'finalized': forwarded as-is. Resolved server-side, so no head fetch needed.
|
|
14
|
+
*
|
|
15
|
+
* - depth === 0: returns 'latest' rather than computing `head - 0`. Semantically
|
|
16
|
+
* identical ("trust head, no reorg buffer"), but materially safer. ethers v6 caches
|
|
17
|
+
* `getBlockNumber()` for up to `pollingInterval` ms (~1s WS, ~4s JSON-RPC), so a
|
|
18
|
+
* stale read can hand back a block number from BEFORE the contract was deployed —
|
|
19
|
+
* then `eth_call` at that historical block returns `0x` (no code at that address
|
|
20
|
+
* yet) and ethers throws BAD_DATA. Letting the server resolve 'latest' at call time
|
|
21
|
+
* sidesteps the race entirely. Also saves the head-fetch round-trip.
|
|
22
|
+
*
|
|
23
|
+
* - numeric depth > 0: subtract from the current head and clamp to >= 0. The head fetch
|
|
24
|
+
* is unavoidable here — we need a specific past block, not the live head.
|
|
14
25
|
*/
|
|
15
|
-
export declare function resolveEvmBlockTagAtDepth(provider: Provider, depth: EvmConfirmationDepth): Promise<number | 'finalized'>;
|
|
26
|
+
export declare function resolveEvmBlockTagAtDepth(provider: Provider, depth: EvmConfirmationDepth): Promise<number | 'latest' | 'finalized'>;
|
|
16
27
|
//# sourceMappingURL=resolveEvmBlockTagAtDepth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveEvmBlockTagAtDepth.d.ts","sourceRoot":"","sources":["../../../../../../src/services/queue/workers/util/resolveEvmBlockTagAtDepth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAEjE
|
|
1
|
+
{"version":3,"file":"resolveEvmBlockTagAtDepth.d.ts","sourceRoot":"","sources":["../../../../../../src/services/queue/workers/util/resolveEvmBlockTagAtDepth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAEjE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,yBAAyB,CAC7C,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,oBAAoB,GAC1B,OAAO,CAAC,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAC,CAK1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/validation/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAA;AAChD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,iDAAiD,CAAA;AAC/D,cAAc,+CAA+C,CAAA;AAC7D,cAAc,+CAA+C,CAAA;AAC7D,cAAc,0CAA0C,CAAA;AACxD,cAAc,gDAAgD,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/validation/index.ts"],"names":[],"mappings":"AAAA,cAAc,yCAAyC,CAAA;AACvD,cAAc,kCAAkC,CAAA;AAChD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,iDAAiD,CAAA;AAC/D,cAAc,+CAA+C,CAAA;AAC7D,cAAc,+CAA+C,CAAA;AAC7D,cAAc,0CAA0C,CAAA;AACxD,cAAc,gDAAgD,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Hex } from '@xylabs/sdk-js';
|
|
2
|
+
export interface ValidateAmountMeetsMinBridgeAmountArgs {
|
|
3
|
+
/** Gross deposit amount in atto. For EVM→XL1 this is `bridgesToRemote[id].amount`. */
|
|
4
|
+
amount: bigint;
|
|
5
|
+
/** Configured floor (Hex-encoded atto), shared with the XL1→EVM outbound direction
|
|
6
|
+
* (BridgeConfig.minBridgeAmount). */
|
|
7
|
+
minBridgeAmount: Hex;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Returns true if `amount >= minBridgeAmount`. Used by Stage 2 of the EVM→XL1 inbound flow
|
|
11
|
+
* to short-circuit fulfillment for deposits below the bridge's configured floor.
|
|
12
|
+
*
|
|
13
|
+
* The contract (`LiquidityPoolBridge.bridgeToRemote`) does NOT enforce a minimum — it only
|
|
14
|
+
* rejects zero and over-max. So any inbound deposit smaller than what the bridge service
|
|
15
|
+
* considers economical (post-fee) reaches Stage 2 and must be filtered here. Failed
|
|
16
|
+
* inbound deposits sit in the EVM-side `liquiditySource` reserve and are operator-refundable
|
|
17
|
+
* out-of-band; this is documented behavior, not a protocol guarantee.
|
|
18
|
+
*/
|
|
19
|
+
export declare function validateAmountMeetsMinBridgeAmount({ amount, minBridgeAmount, }: ValidateAmountMeetsMinBridgeAmountArgs): boolean;
|
|
20
|
+
//# sourceMappingURL=validateAmountMeetsMinBridgeAmount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateAmountMeetsMinBridgeAmount.d.ts","sourceRoot":"","sources":["../../../../src/services/validation/validateAmountMeetsMinBridgeAmount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAGzC,MAAM,WAAW,sCAAsC;IACrD,sFAAsF;IACtF,MAAM,EAAE,MAAM,CAAA;IACd;yCACqC;IACrC,eAAe,EAAE,GAAG,CAAA;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,kCAAkC,CAAC,EACjD,MAAM,EACN,eAAe,GAChB,EAAE,sCAAsC,GAAG,OAAO,CAElD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/chain-bridge",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.2",
|
|
4
4
|
"description": "XYO Layer One Bridge",
|
|
5
5
|
"homepage": "https://xylabs.com",
|
|
6
6
|
"bugs": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"README.md"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@xyo-network/chain-orchestration": "~1.23.
|
|
39
|
-
"@xyo-network/chain-protocol-driver-mongodb": "~1.23.
|
|
38
|
+
"@xyo-network/chain-orchestration": "~1.23.2",
|
|
39
|
+
"@xyo-network/chain-protocol-driver-mongodb": "~1.23.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@bitauth/libauth": "~3.0.0",
|
|
@@ -47,14 +47,14 @@
|
|
|
47
47
|
"@opentelemetry/context-async-hooks": "~2.7.1",
|
|
48
48
|
"@opentelemetry/context-zone": "~2.7.1",
|
|
49
49
|
"@opentelemetry/core": "~2.7.1",
|
|
50
|
-
"@opentelemetry/exporter-prometheus": "~0.
|
|
51
|
-
"@opentelemetry/exporter-trace-otlp-grpc": "~0.
|
|
52
|
-
"@opentelemetry/exporter-trace-otlp-http": "~0.
|
|
50
|
+
"@opentelemetry/exporter-prometheus": "~0.218",
|
|
51
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "~0.218",
|
|
52
|
+
"@opentelemetry/exporter-trace-otlp-http": "~0.218",
|
|
53
53
|
"@opentelemetry/host-metrics": "~0.38.3",
|
|
54
|
-
"@opentelemetry/instrumentation": "~0.
|
|
55
|
-
"@opentelemetry/instrumentation-express": "~0.
|
|
56
|
-
"@opentelemetry/instrumentation-http": "~0.
|
|
57
|
-
"@opentelemetry/instrumentation-runtime-node": "~0.
|
|
54
|
+
"@opentelemetry/instrumentation": "~0.218",
|
|
55
|
+
"@opentelemetry/instrumentation-express": "~0.66",
|
|
56
|
+
"@opentelemetry/instrumentation-http": "~0.218",
|
|
57
|
+
"@opentelemetry/instrumentation-runtime-node": "~0.31",
|
|
58
58
|
"@opentelemetry/resources": "~2.7.1",
|
|
59
59
|
"@opentelemetry/sdk-metrics": "~2.7.1",
|
|
60
60
|
"@opentelemetry/sdk-trace-base": "^2.7.1",
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"@xylabs/mongo": "^5.1.2",
|
|
72
72
|
"@xylabs/sdk-js": "^5.1.2",
|
|
73
73
|
"@xylabs/threads": "~5.1.2",
|
|
74
|
-
"@xylabs/toolchain": "~
|
|
75
|
-
"@xylabs/tsconfig": "~
|
|
74
|
+
"@xylabs/toolchain": "~8.0.4",
|
|
75
|
+
"@xylabs/tsconfig": "~8.0.4",
|
|
76
76
|
"@xylabs/vitest-extended": "~5.1.2",
|
|
77
77
|
"@xyo-network/account": "~5.6.2",
|
|
78
78
|
"@xyo-network/account-model": "~5.6.3",
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
"@xyo-network/typechain": "^4.1.3",
|
|
100
100
|
"@xyo-network/wallet": "~5.6.2",
|
|
101
101
|
"@xyo-network/wallet-model": "^5.6.3",
|
|
102
|
-
"@xyo-network/xl1-protocol-sdk": "~1.30.
|
|
103
|
-
"@xyo-network/xl1-sdk": "^1.30.
|
|
102
|
+
"@xyo-network/xl1-protocol-sdk": "~1.30.2",
|
|
103
|
+
"@xyo-network/xl1-sdk": "^1.30.2",
|
|
104
104
|
"ajv": "^8.20.0",
|
|
105
105
|
"async-mutex": "^0.5.0",
|
|
106
106
|
"bn.js": "^5.2.3",
|
|
@@ -134,9 +134,9 @@
|
|
|
134
134
|
"shallowequal": "~1.1.0",
|
|
135
135
|
"store2": "~2.14.4",
|
|
136
136
|
"tslib": "^2.8.1",
|
|
137
|
-
"typescript": "~
|
|
137
|
+
"typescript": "~6.0.3",
|
|
138
138
|
"uuid": "~14.0.0",
|
|
139
|
-
"vite": "^8.0.
|
|
139
|
+
"vite": "^8.0.13",
|
|
140
140
|
"vitest": "^4.1.6",
|
|
141
141
|
"vitest-mock-extended": "~4.0.0",
|
|
142
142
|
"wasm-feature-detect": "~1.8.0",
|
|
@@ -146,9 +146,9 @@
|
|
|
146
146
|
"winston-transport": "~4.9.0",
|
|
147
147
|
"yargs-parser": "~22.0.0",
|
|
148
148
|
"zod": "~4.4.3",
|
|
149
|
-
"@xyo-network/chain-
|
|
150
|
-
"@xyo-network/chain-test-helpers": "~1.23.
|
|
151
|
-
"@xyo-network/chain-
|
|
149
|
+
"@xyo-network/chain-protocol-test": "~1.23.2",
|
|
150
|
+
"@xyo-network/chain-test-helpers": "~1.23.2",
|
|
151
|
+
"@xyo-network/chain-services": "~1.23.2"
|
|
152
152
|
},
|
|
153
153
|
"peerDependencies": {
|
|
154
154
|
"@bitauth/libauth": "~3.0",
|
|
@@ -159,14 +159,14 @@
|
|
|
159
159
|
"@opentelemetry/context-async-hooks": "~2.7",
|
|
160
160
|
"@opentelemetry/context-zone": "~2.7",
|
|
161
161
|
"@opentelemetry/core": "~2.7",
|
|
162
|
-
"@opentelemetry/exporter-prometheus": "~0.
|
|
163
|
-
"@opentelemetry/exporter-trace-otlp-grpc": "~0.
|
|
164
|
-
"@opentelemetry/exporter-trace-otlp-http": "~0.
|
|
162
|
+
"@opentelemetry/exporter-prometheus": "~0.218",
|
|
163
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "~0.218",
|
|
164
|
+
"@opentelemetry/exporter-trace-otlp-http": "~0.218",
|
|
165
165
|
"@opentelemetry/host-metrics": "~0.38",
|
|
166
|
-
"@opentelemetry/instrumentation": "~0.
|
|
167
|
-
"@opentelemetry/instrumentation-express": "~0.
|
|
168
|
-
"@opentelemetry/instrumentation-http": "~0.
|
|
169
|
-
"@opentelemetry/instrumentation-runtime-node": "~0.
|
|
166
|
+
"@opentelemetry/instrumentation": "~0.218",
|
|
167
|
+
"@opentelemetry/instrumentation-express": "~0.66",
|
|
168
|
+
"@opentelemetry/instrumentation-http": "~0.218",
|
|
169
|
+
"@opentelemetry/instrumentation-runtime-node": "~0.31",
|
|
170
170
|
"@opentelemetry/resources": "~2.7",
|
|
171
171
|
"@opentelemetry/sdk-metrics": "~2.7",
|
|
172
172
|
"@opentelemetry/sdk-trace-base": "^2.7",
|