@xyo-network/chain-bridge 1.19.13 → 1.19.15
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/BridgeActor.d.ts +3 -2
- package/dist/node/BridgeActor.d.ts.map +1 -1
- package/dist/node/config/getBridgeEscrowAddress.d.ts +3 -3
- package/dist/node/config/getBridgeEscrowAddress.d.ts.map +1 -1
- package/dist/node/config/getBridgeFeesAddress.d.ts +3 -3
- package/dist/node/config/getBridgeFeesAddress.d.ts.map +1 -1
- package/dist/node/config/getBridgeSettings.d.ts +2 -2
- package/dist/node/config/getBridgeSettings.d.ts.map +1 -1
- package/dist/node/config/getBridgeWalletAccount.d.ts +3 -3
- package/dist/node/config/getBridgeWalletAccount.d.ts.map +1 -1
- package/dist/node/config/getFeeStructure.d.ts +2 -2
- package/dist/node/config/getFeeStructure.d.ts.map +1 -1
- package/dist/node/config/getGateway.d.ts +3 -2
- package/dist/node/config/getGateway.d.ts.map +1 -1
- package/dist/node/config/getMaxBridgeAmount.d.ts +2 -2
- package/dist/node/config/getMaxBridgeAmount.d.ts.map +1 -1
- package/dist/node/config/getMinBridgeAmount.d.ts +2 -2
- package/dist/node/config/getMinBridgeAmount.d.ts.map +1 -1
- package/dist/node/config/getRemoteChainId.d.ts +3 -2
- package/dist/node/config/getRemoteChainId.d.ts.map +1 -1
- package/dist/node/config/getRemoteTokenAddress.d.ts +2 -2
- package/dist/node/config/getRemoteTokenAddress.d.ts.map +1 -1
- package/dist/node/config/getTransferAddresses.d.ts +2 -2
- package/dist/node/config/getTransferAddresses.d.ts.map +1 -1
- package/dist/node/config/getXl1ChainId.d.ts +3 -2
- package/dist/node/config/getXl1ChainId.d.ts.map +1 -1
- package/dist/node/config/getXl1TokenAddress.d.ts +2 -2
- package/dist/node/config/getXl1TokenAddress.d.ts.map +1 -1
- package/dist/node/index.mjs +72 -553
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/modules/EVMLiquidityBridgeTransactionCompletionMonitorSentinel/EVMLiquidityBridgeTransactionCompletionMonitorSentinel.d.ts.map +1 -1
- package/dist/node/modules/XL1TransactionCompletionMonitorSentinel/XL1TransactionCompletionMonitorSentinel.d.ts.map +1 -1
- package/dist/node/queue/connection.d.ts +2 -2
- package/dist/node/queue/connection.d.ts.map +1 -1
- package/dist/node/queue/workers/EthTransactionPreparation.d.ts.map +1 -1
- package/dist/node/server/addFlowProducer.d.ts +2 -2
- package/dist/node/server/addFlowProducer.d.ts.map +1 -1
- package/dist/node/server/addWorkers.d.ts +2 -2
- package/dist/node/server/addWorkers.d.ts.map +1 -1
- package/dist/node/server/app.d.ts +3 -3
- package/dist/node/server/app.d.ts.map +1 -1
- package/dist/node/server/index.d.ts +0 -2
- package/dist/node/server/index.d.ts.map +1 -1
- package/dist/node/server/routes/addRoutes.d.ts +3 -2
- package/dist/node/server/routes/addRoutes.d.ts.map +1 -1
- package/dist/node/server/routes/bridge/addBridgeRoutes.d.ts +3 -2
- package/dist/node/server/routes/bridge/addBridgeRoutes.d.ts.map +1 -1
- package/dist/node/server/routes/bridge/routeDefinitions/getRouteDefinitions.d.ts +3 -2
- package/dist/node/server/routes/bridge/routeDefinitions/getRouteDefinitions.d.ts.map +1 -1
- package/dist/node/server/routes/bridge/routeDefinitions/pathParams/ChainIdPathParam.d.ts +2 -2
- package/dist/node/server/routes/bridge/routeDefinitions/pathParams/ChainIdPathParam.d.ts.map +1 -1
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeConfig.d.ts +2 -2
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeConfig.d.ts.map +1 -1
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeFromRemoteStatus.d.ts +2 -2
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeFromRemoteStatus.d.ts.map +1 -1
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeToRemote.d.ts +2 -2
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeToRemote.d.ts.map +1 -1
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteEstimate.d.ts +3 -2
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteEstimate.d.ts.map +1 -1
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteStatus.d.ts +2 -2
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteStatus.d.ts.map +1 -1
- package/dist/node/server/server.d.ts +3 -10
- package/dist/node/server/server.d.ts.map +1 -1
- package/dist/node/{manifest → services}/getIterableMap.d.ts +2 -2
- package/dist/node/services/getIterableMap.d.ts.map +1 -0
- package/dist/node/services/getServices.d.ts +9 -0
- package/dist/node/services/getServices.d.ts.map +1 -0
- package/dist/node/services/index.d.ts +1 -0
- package/dist/node/services/index.d.ts.map +1 -1
- package/dist/node/util/BridgeFees.d.ts +7 -0
- package/dist/node/util/BridgeFees.d.ts.map +1 -0
- package/dist/node/util/bridgeFeesAsBigInt.d.ts +7 -0
- package/dist/node/util/bridgeFeesAsBigInt.d.ts.map +1 -0
- package/dist/node/util/calculateBridgeFees.d.ts +4 -8
- package/dist/node/util/calculateBridgeFees.d.ts.map +1 -1
- package/dist/node/util/createBridgeTransfer.d.ts +14 -0
- package/dist/node/util/createBridgeTransfer.d.ts.map +1 -0
- package/dist/node/util/generateBridgeEstimate.d.ts +3 -2
- package/dist/node/util/generateBridgeEstimate.d.ts.map +1 -1
- package/dist/node/util/index.d.ts +3 -0
- package/dist/node/util/index.d.ts.map +1 -1
- package/dist/node/util/validateBridgeEstimate.d.ts +3 -2
- package/dist/node/util/validateBridgeEstimate.d.ts.map +1 -1
- package/dist/node/util/validateBridgeEstimateExact.d.ts +3 -2
- package/dist/node/util/validateBridgeEstimateExact.d.ts.map +1 -1
- package/dist/node/util/validateBridgeTransaction.d.ts +3 -2
- package/dist/node/util/validateBridgeTransaction.d.ts.map +1 -1
- package/package.json +39 -49
- package/src/BridgeActor.ts +3 -3
- package/src/config/getBridgeEscrowAddress.ts +5 -5
- package/src/config/getBridgeFeesAddress.ts +5 -5
- package/src/config/getBridgeSettings.ts +2 -2
- package/src/config/getBridgeWalletAccount.ts +7 -4
- package/src/config/getFeeStructure.ts +3 -3
- package/src/config/getGateway.ts +5 -4
- package/src/config/getMaxBridgeAmount.ts +3 -3
- package/src/config/getMinBridgeAmount.ts +3 -3
- package/src/config/getRemoteChainId.ts +4 -3
- package/src/config/getRemoteTokenAddress.ts +3 -3
- package/src/config/getTransferAddresses.ts +2 -2
- package/src/config/getXl1ChainId.ts +4 -3
- package/src/config/getXl1TokenAddress.ts +3 -3
- package/src/interface/service/Observer/LiquidityPoolBridgeObserver/LiquidityPoolBridgeObserver.ts +1 -1
- package/src/interface/service/Relay/LiquidityPoolBridgeRelay/LiquidityPoolBridgeRelay.ts +1 -1
- package/src/interface/util/getBridgeIntentIdentifier.ts +1 -1
- package/src/modules/EVMLiquidityBridgeTransactionCompletionMonitorSentinel/EVMLiquidityBridgeTransactionCompletionMonitorSentinel.ts +1 -1
- package/src/modules/XL1TransactionCompletionMonitorSentinel/XL1TransactionCompletionMonitorSentinel.ts +1 -1
- package/src/queue/connection.ts +3 -3
- package/src/queue/workers/EthTransactionMonitor.ts +1 -1
- package/src/queue/workers/EthTransactionPreparation.ts +2 -4
- package/src/queue/workers/EthTransactionSubmission.ts +1 -1
- package/src/queue/workers/Xl1TransactionMonitor.ts +1 -1
- package/src/queue/workers/Xl1TransactionPreparation.ts +1 -1
- package/src/queue/workers/Xl1TransactionSubmission.ts +1 -1
- package/src/queue/workers/util/submitEthTransaction.ts +1 -1
- package/src/server/addFlowProducer.ts +2 -2
- package/src/server/addWorkers.ts +2 -2
- package/src/server/app.ts +3 -4
- package/src/server/index.ts +2 -2
- package/src/server/routes/addRoutes.ts +3 -2
- package/src/server/routes/bridge/addBridgeRoutes.ts +3 -2
- package/src/server/routes/bridge/routeDefinitions/getRouteDefinitions.ts +3 -2
- package/src/server/routes/bridge/routeDefinitions/pathParams/ChainIdPathParam.ts +3 -2
- package/src/server/routes/bridge/routeDefinitions/routes/bridgeConfig.ts +3 -2
- package/src/server/routes/bridge/routeDefinitions/routes/bridgeFromRemoteStatus.ts +3 -2
- package/src/server/routes/bridge/routeDefinitions/routes/bridgeToRemote.ts +4 -3
- package/src/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteEstimate.ts +3 -2
- package/src/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteStatus.ts +3 -4
- package/src/server/server.ts +7 -48
- package/src/{manifest → services}/getIterableMap.ts +2 -2
- package/src/{manifest → services}/getServices.ts +9 -13
- package/src/services/index.ts +1 -0
- package/src/util/BridgeFees.ts +7 -0
- package/src/util/bridgeFeesAsBigInt.ts +15 -0
- package/src/util/calculateBridgeFees.ts +5 -11
- package/src/util/createBridgeTransfer.ts +31 -0
- package/src/util/generateBridgeEstimate.ts +9 -17
- package/src/util/index.ts +3 -0
- package/src/util/validateBridgeEstimate.ts +4 -5
- package/src/util/validateBridgeEstimateExact.ts +4 -5
- package/src/util/validateBridgeTransaction.ts +4 -3
- package/dist/node/indexers/index.d.ts +0 -2
- package/dist/node/indexers/index.d.ts.map +0 -1
- package/dist/node/manifest/getIterableMap.d.ts.map +0 -1
- package/dist/node/manifest/getModuleLocator.d.ts +0 -15
- package/dist/node/manifest/getModuleLocator.d.ts.map +0 -1
- package/dist/node/manifest/getNode.d.ts +0 -15
- package/dist/node/manifest/getNode.d.ts.map +0 -1
- package/dist/node/manifest/getServices.d.ts +0 -13
- package/dist/node/manifest/getServices.d.ts.map +0 -1
- package/dist/node/manifest/index.d.ts +0 -7
- package/dist/node/manifest/index.d.ts.map +0 -1
- package/dist/node/manifest/nodeManifest.d.ts +0 -6
- package/dist/node/manifest/nodeManifest.d.ts.map +0 -1
- package/dist/node/manifest/private/index.d.ts +0 -5
- package/dist/node/manifest/private/index.d.ts.map +0 -1
- package/dist/node/manifest/public/index.d.ts +0 -14
- package/dist/node/manifest/public/index.d.ts.map +0 -1
- package/dist/node/server/routes/dataLake/addDataLakeRoutes.d.ts +0 -3
- package/dist/node/server/routes/dataLake/addDataLakeRoutes.d.ts.map +0 -1
- package/dist/node/server/routes/dataLake/archivistMiddleware.d.ts +0 -10
- package/dist/node/server/routes/dataLake/archivistMiddleware.d.ts.map +0 -1
- package/dist/node/server/routes/dataLake/index.d.ts +0 -2
- package/dist/node/server/routes/dataLake/index.d.ts.map +0 -1
- package/src/indexers/index.ts +0 -1
- package/src/manifest/getModuleLocator.ts +0 -153
- package/src/manifest/getNode.ts +0 -40
- package/src/manifest/index.ts +0 -6
- package/src/manifest/node.json +0 -17
- package/src/manifest/nodeManifest.ts +0 -8
- package/src/manifest/private/index.ts +0 -4
- package/src/manifest/public/Ethereum.json +0 -48
- package/src/manifest/public/XL1.json +0 -48
- package/src/manifest/public/index.ts +0 -23
- package/src/server/routes/dataLake/addDataLakeRoutes.ts +0 -9
- package/src/server/routes/dataLake/archivistMiddleware.ts +0 -85
- package/src/server/routes/dataLake/index.ts +0 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { RouteDefinition } from '@xylabs/express'
|
|
2
|
-
import type {
|
|
2
|
+
import type { BridgeConfig } from '@xyo-network/chain-orchestration'
|
|
3
|
+
import type { XyoGatewayRunner } from '@xyo-network/xl1-sdk'
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
makeBridgeConfigRoute, makeBridgeFromRemoteStatusRoute, makeBridgeToRemoteEstimateRoute, makeBridgeToRemoteRoute, makeBridgeToRemoteStatusRoute,
|
|
6
7
|
} from './routes/index.ts'
|
|
7
8
|
|
|
8
|
-
export const getRouteDefinitions = (config:
|
|
9
|
+
export const getRouteDefinitions = (config: BridgeConfig, gateway: XyoGatewayRunner): RouteDefinition[] => {
|
|
9
10
|
return [
|
|
10
11
|
makeBridgeConfigRoute(config),
|
|
11
12
|
makeBridgeToRemoteEstimateRoute(config, gateway),
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
asHex, HexZod, isUndefined,
|
|
3
3
|
} from '@xylabs/sdk-js'
|
|
4
|
-
import type {
|
|
4
|
+
import type { BridgeConfig } from '@xyo-network/chain-orchestration'
|
|
5
|
+
import type { ChainId } from '@xyo-network/xl1-sdk'
|
|
5
6
|
|
|
6
7
|
import { getRemoteChainId } from '../../../../../config/index.ts'
|
|
7
8
|
|
|
8
|
-
export const getRemoteChainIdZod = (config:
|
|
9
|
+
export const getRemoteChainIdZod = (config: BridgeConfig) => {
|
|
9
10
|
const remoteChainId: ChainId = getRemoteChainId(config)
|
|
10
11
|
return HexZod.superRefine((val, ctx) => {
|
|
11
12
|
const chainId = asHex(val)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { RouteDefinition } from '@xylabs/express'
|
|
2
2
|
import { requestHandlerValidator } from '@xylabs/express'
|
|
3
|
-
import {
|
|
3
|
+
import type { BridgeConfig } from '@xyo-network/chain-orchestration'
|
|
4
|
+
import { BridgeSettingsZod } from '@xyo-network/chain-orchestration'
|
|
4
5
|
import type { z } from 'zod'
|
|
5
6
|
|
|
6
7
|
import { getBridgeSettings } from '../../../../../config/index.ts'
|
|
@@ -10,7 +11,7 @@ export type BridgeConfigResponse = z.infer<typeof BridgeConfigResponseZod>
|
|
|
10
11
|
|
|
11
12
|
const validateRequest = requestHandlerValidator({ response: BridgeConfigResponseZod })
|
|
12
13
|
|
|
13
|
-
export const makeBridgeConfigRoute = (config:
|
|
14
|
+
export const makeBridgeConfigRoute = (config: BridgeConfig): RouteDefinition => {
|
|
14
15
|
return {
|
|
15
16
|
method: 'get',
|
|
16
17
|
path: '/bridge/chains/:chainId/config',
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { RouteDefinition } from '@xylabs/express'
|
|
2
2
|
import { requestHandlerValidator } from '@xylabs/express'
|
|
3
3
|
import { toAddress, toHex } from '@xylabs/sdk-js'
|
|
4
|
+
import type { BridgeConfig } from '@xyo-network/chain-orchestration'
|
|
4
5
|
import { PayloadZodStrictOfSchema } from '@xyo-network/payload-model'
|
|
5
|
-
import type { BridgeDestinationObservation
|
|
6
|
+
import type { BridgeDestinationObservation } from '@xyo-network/xl1-sdk'
|
|
6
7
|
import {
|
|
7
8
|
BridgeDestinationObservationFieldsZod,
|
|
8
9
|
BridgeDestinationObservationSchema,
|
|
@@ -12,7 +13,7 @@ import { z } from 'zod'
|
|
|
12
13
|
import { getBridgeSettings } from '../../../../../config/index.ts'
|
|
13
14
|
import { getRemoteChainIdZod } from '../pathParams/index.ts'
|
|
14
15
|
|
|
15
|
-
export const makeBridgeFromRemoteStatusRoute = (config:
|
|
16
|
+
export const makeBridgeFromRemoteStatusRoute = (config: BridgeConfig): RouteDefinition => {
|
|
16
17
|
const params = z.object({
|
|
17
18
|
chainId: getRemoteChainIdZod(config),
|
|
18
19
|
nonce: z.string().nonempty(),
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { RouteDefinition } from '@xylabs/express'
|
|
2
2
|
import { requestHandlerValidator } from '@xylabs/express'
|
|
3
|
-
import {
|
|
3
|
+
import type { BridgeConfig } from '@xyo-network/chain-orchestration'
|
|
4
4
|
import { PayloadZodLooseOfSchema, PayloadZodStrictOfSchema } from '@xyo-network/payload-model'
|
|
5
|
+
import { PayloadBuilder } from '@xyo-network/sdk-js'
|
|
5
6
|
import type {
|
|
6
|
-
BridgeSourceObservation, BridgeSourceObservationFields,
|
|
7
|
+
BridgeSourceObservation, BridgeSourceObservationFields, SignedHydratedTransaction,
|
|
7
8
|
} from '@xyo-network/xl1-sdk'
|
|
8
9
|
import {
|
|
9
10
|
BridgeIntentFieldsZod, BridgeIntentSchema, BridgeSourceObservationFieldsZod, BridgeSourceObservationSchema, SignedTransactionBoundWitnessZod, TransferZod,
|
|
@@ -24,7 +25,7 @@ export type BridgeToRemoteBody = z.infer<typeof BridgeToRemoteBodyZod>
|
|
|
24
25
|
export const BridgeToRemoteResponseZod = PayloadZodStrictOfSchema(BridgeSourceObservationSchema).extend(BridgeSourceObservationFieldsZod.shape)
|
|
25
26
|
export type BridgeToRemoteResponse = z.infer<typeof BridgeToRemoteResponseZod>
|
|
26
27
|
|
|
27
|
-
export const makeBridgeToRemoteRoute = (config:
|
|
28
|
+
export const makeBridgeToRemoteRoute = (config: BridgeConfig): RouteDefinition => {
|
|
28
29
|
const params = z.object({ chainId: getRemoteChainIdZod(config) })
|
|
29
30
|
|
|
30
31
|
const validateRequest = requestHandlerValidator({
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { RouteDefinition } from '@xylabs/express'
|
|
2
2
|
import { requestHandlerValidator } from '@xylabs/express'
|
|
3
3
|
import { assertEx, toAddress } from '@xylabs/sdk-js'
|
|
4
|
+
import type { BridgeConfig } from '@xyo-network/chain-orchestration'
|
|
4
5
|
import { PayloadZodStrictOfSchema } from '@xyo-network/payload-model'
|
|
5
|
-
import type {
|
|
6
|
+
import type { XyoGatewayRunner } from '@xyo-network/xl1-sdk'
|
|
6
7
|
import {
|
|
7
8
|
BridgeIntentFieldsZod, BridgeIntentSchema, buildUnsignedTransaction, toXL1BlockNumber, TransactionBoundWitnessZod, TransferZod,
|
|
8
9
|
} from '@xyo-network/xl1-sdk'
|
|
@@ -27,7 +28,7 @@ export const BridgeToRemoteEstimateResponseZod = z.tuple([
|
|
|
27
28
|
|
|
28
29
|
export type BridgeToRemoteEstimateResponse = z.infer<typeof BridgeToRemoteEstimateResponseZod>
|
|
29
30
|
|
|
30
|
-
export const makeBridgeToRemoteEstimateRoute = (config:
|
|
31
|
+
export const makeBridgeToRemoteEstimateRoute = (config: BridgeConfig, gateway: XyoGatewayRunner): RouteDefinition => {
|
|
31
32
|
const params = z.object({ chainId: getRemoteChainIdZod(config) })
|
|
32
33
|
const validateRequest = requestHandlerValidator({
|
|
33
34
|
params, body: BridgeToRemoteEstimateBodyZod, response: BridgeToRemoteEstimateResponseZod,
|
|
@@ -3,10 +3,9 @@ import { requestHandlerValidator } from '@xylabs/express'
|
|
|
3
3
|
import {
|
|
4
4
|
asAddress, asHex, toHex,
|
|
5
5
|
} from '@xylabs/sdk-js'
|
|
6
|
+
import type { BridgeConfig } from '@xyo-network/chain-orchestration'
|
|
6
7
|
import { PayloadZodStrictOfSchema } from '@xyo-network/payload-model'
|
|
7
|
-
import type {
|
|
8
|
-
BridgeDestinationObservation, BridgeSourceObservation, Config,
|
|
9
|
-
} from '@xyo-network/xl1-sdk'
|
|
8
|
+
import type { BridgeDestinationObservation, BridgeSourceObservation } from '@xyo-network/xl1-sdk'
|
|
10
9
|
import {
|
|
11
10
|
BridgeDestinationObservationFieldsZod, BridgeDestinationObservationSchema, BridgeIntentFieldsZod, BridgeIntentSchema, BridgeSourceObservationFieldsZod,
|
|
12
11
|
BridgeSourceObservationSchema,
|
|
@@ -32,7 +31,7 @@ export const BridgeToRemoteStatusResponseZod = z.union([
|
|
|
32
31
|
])
|
|
33
32
|
export type BridgeToRemoteStatusResponse = z.infer<typeof BridgeToRemoteStatusResponseZod>
|
|
34
33
|
|
|
35
|
-
export const makeBridgeToRemoteStatusRoute = (config:
|
|
34
|
+
export const makeBridgeToRemoteStatusRoute = (config: BridgeConfig): RouteDefinition => {
|
|
36
35
|
const params = z.object({
|
|
37
36
|
chainId: getRemoteChainIdZod(config),
|
|
38
37
|
nonce: z.string().nonempty(),
|
package/src/server/server.ts
CHANGED
|
@@ -1,59 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from '@xylabs/sdk-js'
|
|
4
|
-
import { boot } from '@xyo-network/bios'
|
|
5
|
-
import type { BiosExternalInterface } from '@xyo-network/bios-model'
|
|
6
|
-
import type { NodeInstance } from '@xyo-network/node-model'
|
|
7
|
-
import { HDWallet } from '@xyo-network/wallet'
|
|
8
|
-
import type { Config, XyoGatewayRunner } from '@xyo-network/xl1-sdk'
|
|
1
|
+
import type { BridgeConfigContext } from '@xyo-network/chain-orchestration'
|
|
2
|
+
import type { XyoGatewayRunner } from '@xyo-network/xl1-sdk'
|
|
9
3
|
|
|
10
|
-
import {
|
|
4
|
+
import { getServices } from '../services/index.ts'
|
|
11
5
|
import { addWorkers } from './addWorkers.ts'
|
|
12
6
|
import { getApp } from './app.ts'
|
|
13
7
|
|
|
14
8
|
const hostname = '::'
|
|
15
9
|
// const hostname = '0.0.0.0'
|
|
16
10
|
|
|
17
|
-
|
|
18
|
-
const getSeedPhrase = async (bios: BiosExternalInterface, config: Config, logger?: Logger): Promise<string> => {
|
|
19
|
-
const storedSeedPhrase = await bios.seedPhraseStore.get('os')
|
|
20
|
-
logger?.debug(`[Bridge] Stored mnemonic: ${storedSeedPhrase}`)
|
|
21
|
-
const { mnemonic } = config.actors.api
|
|
22
|
-
if (isString(storedSeedPhrase) && isString(mnemonic)) {
|
|
23
|
-
logger?.warn('[Bridge] Stored mnemonic does not match supplied. Updating stored mnemonic to supplied.')
|
|
24
|
-
await bios.seedPhraseStore.set('os', mnemonic)
|
|
25
|
-
} else {
|
|
26
|
-
let seedPhrase: string
|
|
27
|
-
if (isString(mnemonic)) {
|
|
28
|
-
seedPhrase = mnemonic
|
|
29
|
-
} else {
|
|
30
|
-
seedPhrase = HDWallet.generateMnemonic()
|
|
31
|
-
logger?.log('[Bridge] No mnemonic provided, using random mnemonic. This is not recommended for production use.')
|
|
32
|
-
logger?.log(`[Bridge] Mnemonic: ${seedPhrase}`)
|
|
33
|
-
}
|
|
34
|
-
await bios.seedPhraseStore.set('os', seedPhrase)
|
|
35
|
-
}
|
|
36
|
-
return assertEx(await bios.seedPhraseStore.get('os'), () => 'Unable to acquire mnemonic from bios')
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
interface GetServerContext {
|
|
40
|
-
config: Config
|
|
41
|
-
logger?: Logger
|
|
42
|
-
node?: NodeInstance
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export const getServer = async (context: GetServerContext, gateway: XyoGatewayRunner) => {
|
|
11
|
+
export const getServer = async (context: BridgeConfigContext, gateway: XyoGatewayRunner) => {
|
|
46
12
|
const { logger, config } = context
|
|
47
|
-
const { port
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
const wallet = await HDWallet.fromPhrase(seedPhrase)
|
|
51
|
-
const nodeContext = {
|
|
52
|
-
wallet, logger, config,
|
|
53
|
-
}
|
|
54
|
-
const node = context.node ?? await getNode(nodeContext)
|
|
55
|
-
const app = getApp(node, config, gateway)
|
|
56
|
-
const services = await getServices({ config, logger }, gateway)
|
|
13
|
+
const { port } = config
|
|
14
|
+
const app = getApp(config, gateway)
|
|
15
|
+
const services = await getServices(context, gateway)
|
|
57
16
|
addWorkers(config, services)
|
|
58
17
|
const server = app.listen(port, hostname, () => logger?.log(`[Bridge] Server listening at http://${hostname}:${port}`))
|
|
59
18
|
server.setTimeout(20_000)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseMongoSdk, type BaseMongoSdkPrivateConfig } from '@xylabs/mongo'
|
|
2
2
|
import { MongoMap } from '@xyo-network/chain-protocol'
|
|
3
|
-
import type {
|
|
3
|
+
import type { BaseConfig, IterableMap } from '@xyo-network/xl1-sdk'
|
|
4
4
|
import { hasMongoConfig, mapToMapType } from '@xyo-network/xl1-sdk'
|
|
5
5
|
import type { Document } from 'mongodb'
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ import type { Document } from 'mongodb'
|
|
|
11
11
|
* @returns The iterable map
|
|
12
12
|
*/
|
|
13
13
|
export const getIterableMap = async <K extends {} = string, V extends Document = Document>(
|
|
14
|
-
config:
|
|
14
|
+
config: BaseConfig,
|
|
15
15
|
collection: string,
|
|
16
16
|
): Promise<IterableMap<K, V>> => {
|
|
17
17
|
const mongoConfig = config.storage?.mongo
|
|
@@ -1,34 +1,30 @@
|
|
|
1
|
-
import type { Hash
|
|
1
|
+
import type { Hash } from '@xylabs/sdk-js'
|
|
2
2
|
import { assertEx, isDefined } from '@xylabs/sdk-js'
|
|
3
|
+
import type { BridgeConfig, BridgeConfigContext } from '@xyo-network/chain-orchestration'
|
|
3
4
|
import { initEvmProvider } from '@xyo-network/chain-orchestration'
|
|
4
5
|
import { BridgeableToken__factory, LiquidityPoolBridge__factory } from '@xyo-network/typechain'
|
|
5
6
|
import { HDWallet } from '@xyo-network/wallet'
|
|
6
|
-
import type {
|
|
7
|
+
import type { XyoGatewayRunner } from '@xyo-network/xl1-sdk'
|
|
7
8
|
import { getAddress, Wallet } from 'ethers'
|
|
8
9
|
|
|
9
|
-
import type {
|
|
10
|
-
EthTxState, IBridgeServiceCollection, Xl1TxState,
|
|
11
|
-
} from '../services/index.ts'
|
|
10
|
+
import type { EthTxState } from './EthTxState.ts'
|
|
12
11
|
import { getIterableMap } from './getIterableMap.ts'
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
config: Config
|
|
16
|
-
logger?: Logger
|
|
17
|
-
}
|
|
12
|
+
import type { IBridgeServiceCollection } from './IBridgeServiceCollection.ts'
|
|
13
|
+
import type { Xl1TxState } from './Xl1TxState.ts'
|
|
18
14
|
|
|
19
15
|
/**
|
|
20
16
|
* Used for retrieving a service collection
|
|
21
17
|
* @returns A service collection
|
|
22
18
|
*/
|
|
23
|
-
export const getServices = async (context:
|
|
19
|
+
export const getServices = async (context: BridgeConfigContext, gateway: XyoGatewayRunner): Promise<IBridgeServiceCollection> => {
|
|
24
20
|
const { config } = context
|
|
25
21
|
|
|
26
22
|
const ethTxStateMap = await getIterableMap<Hash, EthTxState>(config, 'liquidity_bridge_xl1_to_eth_eth_tx_state')
|
|
27
23
|
const xl1TxStateMap = await getIterableMap<Hash, Xl1TxState>(config, 'liquidity_bridge_xl1_to_eth_xl1_tx_state')
|
|
28
|
-
const provider = await initEvmProvider(
|
|
24
|
+
const provider = await initEvmProvider(context)
|
|
29
25
|
const {
|
|
30
26
|
remoteBridgeContractAddress, remoteChainWalletPrivateKey, remoteTokenAddress, mnemonic,
|
|
31
|
-
} = config
|
|
27
|
+
} = config as BridgeConfig
|
|
32
28
|
const account = isDefined(mnemonic) ? await HDWallet.fromPhrase(mnemonic) : await HDWallet.random()
|
|
33
29
|
const wallet = new Wallet(remoteChainWalletPrivateKey, provider)
|
|
34
30
|
const bridgeableToken = BridgeableToken__factory.connect(getAddress(remoteTokenAddress), wallet)
|
package/src/services/index.ts
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { hexToBigInt } from '@xylabs/sdk-js'
|
|
2
|
+
|
|
3
|
+
import type { BridgeFees } from './BridgeFees.ts'
|
|
4
|
+
|
|
5
|
+
export const bridgeFeesAsBigInt = (fees: BridgeFees): {
|
|
6
|
+
feeFixed: bigint
|
|
7
|
+
feeVariable: bigint
|
|
8
|
+
srcAmount: bigint
|
|
9
|
+
} => {
|
|
10
|
+
return {
|
|
11
|
+
feeFixed: hexToBigInt(fees.feeFixed),
|
|
12
|
+
feeVariable: hexToBigInt(fees.feeVariable),
|
|
13
|
+
srcAmount: hexToBigInt(fees.srcAmount),
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import type { Hex } from '@xylabs/sdk-js'
|
|
2
2
|
import { hexToBigInt, toHex } from '@xylabs/sdk-js'
|
|
3
|
-
import type {
|
|
3
|
+
import type { BridgeConfig } from '@xyo-network/chain-orchestration'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import type { BridgeFees } from './BridgeFees.ts'
|
|
6
6
|
|
|
7
|
-
export
|
|
8
|
-
destAmount: Hex
|
|
9
|
-
feeFixed: Hex
|
|
10
|
-
feeVariable: Hex
|
|
11
|
-
}
|
|
7
|
+
export type FeeStructure = Pick<BridgeConfig, 'feeFixed' | 'feeRateBasisPoints'>
|
|
12
8
|
|
|
13
|
-
export const calculateBridgeFees = (srcAmount: Hex, feeStructure: FeeStructure):
|
|
9
|
+
export const calculateBridgeFees = (srcAmount: Hex, feeStructure: FeeStructure): BridgeFees => {
|
|
14
10
|
const { feeFixed, feeRateBasisPoints } = feeStructure
|
|
15
11
|
|
|
16
12
|
// Format source input
|
|
@@ -32,8 +28,6 @@ export const calculateBridgeFees = (srcAmount: Hex, feeStructure: FeeStructure):
|
|
|
32
28
|
const destAmount = toHex(destAmountBigInt)
|
|
33
29
|
|
|
34
30
|
return {
|
|
35
|
-
|
|
36
|
-
feeFixed,
|
|
37
|
-
feeVariable,
|
|
31
|
+
feeFixed, feeVariable, srcAmount,
|
|
38
32
|
}
|
|
39
33
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Address, Hex } from '@xylabs/sdk-js'
|
|
2
|
+
import { hexToBigInt } from '@xylabs/sdk-js'
|
|
3
|
+
import type { Transfer } from '@xyo-network/xl1-sdk'
|
|
4
|
+
import { createTransferPayload } from '@xyo-network/xl1-sdk'
|
|
5
|
+
|
|
6
|
+
import type { BridgeFees } from './BridgeFees.ts'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Calculates the transfer representing the bridging of funds including the appropriate amounts for the bridge fees
|
|
10
|
+
* @param sender The client attempting to bridge
|
|
11
|
+
* @param srcAmount The amount the client is attempting to bridge
|
|
12
|
+
* @param escrowAddress The address in which bridged funds will be held until the transfer is executed on the destination chain
|
|
13
|
+
* @param feesAddress The address to which bridge fees will be paid
|
|
14
|
+
* @param context An object containing the necessary fee and amount information to construct the transfer context
|
|
15
|
+
* @returns A transfer representing the bridging of funds including the appropriate amounts for the bridge fees
|
|
16
|
+
*/
|
|
17
|
+
export const createBridgeTransfer = (sender: Address, srcAmount: Hex, escrowAddress: Address, feesAddress: Address, context: BridgeFees): Transfer => {
|
|
18
|
+
const { feeFixed, feeVariable } = context
|
|
19
|
+
const escrowAmount = hexToBigInt(srcAmount)
|
|
20
|
+
const feesAmount = hexToBigInt(feeFixed) + hexToBigInt(feeVariable)
|
|
21
|
+
const transfers: Record<Address, bigint>
|
|
22
|
+
// If the escrow and fee addresses are the same
|
|
23
|
+
= escrowAddress === feesAddress
|
|
24
|
+
// combine the amounts into a single transfer to that address
|
|
25
|
+
? { [feesAddress]: escrowAmount + feesAmount }
|
|
26
|
+
// otherwise, create separate transfers to the escrow and fees addresses
|
|
27
|
+
: { [escrowAddress]: escrowAmount, [feesAddress]: feesAmount }
|
|
28
|
+
const transfer = createTransferPayload(sender, transfers, context)
|
|
29
|
+
|
|
30
|
+
return transfer
|
|
31
|
+
}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import type { Hex } from '@xylabs/sdk-js'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { toAddress } from '@xylabs/sdk-js'
|
|
3
|
+
import type { BridgeConfig } from '@xyo-network/chain-orchestration'
|
|
4
|
+
import { PayloadBuilder } from '@xyo-network/sdk-js'
|
|
4
5
|
import type {
|
|
5
|
-
BridgeIntent, BridgeIntentFields,
|
|
6
|
-
Transfer,
|
|
6
|
+
BridgeIntent, BridgeIntentFields, Transfer,
|
|
7
7
|
} from '@xyo-network/xl1-sdk'
|
|
8
|
-
import { BridgeIntentSchema
|
|
8
|
+
import { BridgeIntentSchema } from '@xyo-network/xl1-sdk'
|
|
9
9
|
import { v4 } from 'uuid'
|
|
10
10
|
|
|
11
11
|
import { getBridgeSettings } from '../config/index.ts'
|
|
12
12
|
import { calculateBridgeFees } from './calculateBridgeFees.ts'
|
|
13
|
+
import { createBridgeTransfer } from './createBridgeTransfer.ts'
|
|
13
14
|
|
|
14
15
|
export const generateBridgeEstimate = async (
|
|
15
16
|
srcAddress: Hex,
|
|
16
17
|
srcAmount: Hex,
|
|
17
18
|
destAddress: Hex,
|
|
18
|
-
config:
|
|
19
|
+
config: BridgeConfig,
|
|
19
20
|
nonceOverride?: string,
|
|
20
21
|
): Promise<[BridgeIntent, Transfer]> => {
|
|
21
22
|
const {
|
|
@@ -26,9 +27,6 @@ export const generateBridgeEstimate = async (
|
|
|
26
27
|
|
|
27
28
|
// Calculate fees and destination amount
|
|
28
29
|
const fees = calculateBridgeFees(srcAmount, { feeFixed, feeRateBasisPoints })
|
|
29
|
-
const {
|
|
30
|
-
destAmount, feeFixed: feeFixedAmount, feeVariable,
|
|
31
|
-
} = fees
|
|
32
30
|
|
|
33
31
|
// Generate a unique nonce for the bridge intent
|
|
34
32
|
const nonce = nonceOverride ?? v4()
|
|
@@ -44,20 +42,14 @@ export const generateBridgeEstimate = async (
|
|
|
44
42
|
// Destination
|
|
45
43
|
dest: remoteChainId,
|
|
46
44
|
destAddress,
|
|
47
|
-
destAmount,
|
|
45
|
+
destAmount: srcAmount, // This is a 1:1 bridge. Fees are handled at the transfer level, not the bridge intent level.
|
|
48
46
|
destToken: remoteTokenAddress,
|
|
49
47
|
nonce,
|
|
50
48
|
}
|
|
51
49
|
const bridgeIntent: BridgeIntent = new PayloadBuilder<BridgeIntent>({ schema: BridgeIntentSchema }).fields(bridgeIntentFields).build()
|
|
52
50
|
|
|
53
51
|
// Build the transfer
|
|
54
|
-
const
|
|
55
|
-
destAmount, feeFixed: feeFixedAmount, feeVariable,
|
|
56
|
-
}
|
|
57
|
-
const transfer: Transfer = createTransferPayload(sender, {
|
|
58
|
-
[escrowAddress]: hexToBigInt(destAmount),
|
|
59
|
-
[feesAddress]: hexToBigInt(feeFixedAmount) + hexToBigInt(feeVariable),
|
|
60
|
-
}, context)
|
|
52
|
+
const transfer = createBridgeTransfer(sender, srcAmount, escrowAddress, feesAddress, fees)
|
|
61
53
|
|
|
62
54
|
return [bridgeIntent, transfer]
|
|
63
55
|
}
|
package/src/util/index.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
export * from './BridgeFees.ts'
|
|
2
|
+
export * from './bridgeFeesAsBigInt.ts'
|
|
1
3
|
export * from './calculateBridgeFees.ts'
|
|
4
|
+
export * from './createBridgeTransfer.ts'
|
|
2
5
|
export * from './generateBridgeEstimate.ts'
|
|
3
6
|
export * from './getConfigFromEnv.ts'
|
|
4
7
|
export * from './validateBridgeEstimate.ts'
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { hexToBigInt, isUndefined } from '@xylabs/sdk-js'
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
} from '@xyo-network/xl1-sdk'
|
|
2
|
+
import type { BridgeConfig } from '@xyo-network/chain-orchestration'
|
|
3
|
+
import type { BridgeIntent, Transfer } from '@xyo-network/xl1-sdk'
|
|
5
4
|
|
|
6
5
|
import { getBridgeSettings } from '../config/index.ts'
|
|
7
6
|
import { calculateBridgeFees } from './calculateBridgeFees.js'
|
|
@@ -18,7 +17,7 @@ import { calculateBridgeFees } from './calculateBridgeFees.js'
|
|
|
18
17
|
export const validateBridgeEstimate = async (
|
|
19
18
|
intent: BridgeIntent,
|
|
20
19
|
transfer: Transfer,
|
|
21
|
-
config:
|
|
20
|
+
config: BridgeConfig,
|
|
22
21
|
): Promise<boolean> => {
|
|
23
22
|
const {
|
|
24
23
|
escrowAddress, feeFixed, feeRateBasisPoints, feesAddress, remoteChainId, remoteTokenAddress, xl1ChainId, xl1TokenAddress,
|
|
@@ -53,7 +52,7 @@ export const validateBridgeEstimate = async (
|
|
|
53
52
|
if (feeAmount < expectedFeeTotal) return false
|
|
54
53
|
|
|
55
54
|
// 4. Check derived dest amount
|
|
56
|
-
if (hexToBigInt(intent.destAmount) !== hexToBigInt(fees.
|
|
55
|
+
if (hexToBigInt(intent.destAmount) !== hexToBigInt(fees.srcAmount)) {
|
|
57
56
|
return false
|
|
58
57
|
}
|
|
59
58
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { isUndefined } from '@xylabs/sdk-js'
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
} from '@xyo-network/xl1-sdk'
|
|
2
|
+
import type { BridgeConfig } from '@xyo-network/chain-orchestration'
|
|
3
|
+
import { PayloadBuilder } from '@xyo-network/sdk-js'
|
|
4
|
+
import type { BridgeIntent, Transfer } from '@xyo-network/xl1-sdk'
|
|
6
5
|
|
|
7
6
|
import { generateBridgeEstimate } from './generateBridgeEstimate.ts'
|
|
8
7
|
|
|
@@ -17,7 +16,7 @@ import { generateBridgeEstimate } from './generateBridgeEstimate.ts'
|
|
|
17
16
|
export const validateBridgeEstimateExact = async (
|
|
18
17
|
intent: BridgeIntent,
|
|
19
18
|
transfer: Transfer,
|
|
20
|
-
config:
|
|
19
|
+
config: BridgeConfig,
|
|
21
20
|
): Promise<boolean> => {
|
|
22
21
|
const {
|
|
23
22
|
srcAddress, srcAmount, destAddress,
|
|
@@ -2,9 +2,10 @@ import { asAddress, isDefined } from '@xylabs/sdk-js'
|
|
|
2
2
|
import {
|
|
3
3
|
addressesContains, BoundWitnessValidator, payloadHashesContainsAll,
|
|
4
4
|
} from '@xyo-network/boundwitness-validator'
|
|
5
|
-
import {
|
|
5
|
+
import type { BridgeConfig } from '@xyo-network/chain-orchestration'
|
|
6
|
+
import { PayloadBuilder } from '@xyo-network/sdk-js'
|
|
6
7
|
import type {
|
|
7
|
-
BridgeIntent,
|
|
8
|
+
BridgeIntent,
|
|
8
9
|
TransactionBoundWitness, Transfer,
|
|
9
10
|
} from '@xyo-network/xl1-sdk'
|
|
10
11
|
|
|
@@ -25,7 +26,7 @@ export const validateBridgeTransaction = async (
|
|
|
25
26
|
signedTxBw: TransactionBoundWitness,
|
|
26
27
|
intent: BridgeIntent,
|
|
27
28
|
transfer: Transfer,
|
|
28
|
-
config:
|
|
29
|
+
config: BridgeConfig,
|
|
29
30
|
): Promise<boolean> => {
|
|
30
31
|
const { srcAddress } = intent
|
|
31
32
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/indexers/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,OAAO,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getIterableMap.d.ts","sourceRoot":"","sources":["../../../src/manifest/getIterableMap.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAE/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAU,CAAC,SAAS,EAAE,GAAG,MAAM,EAAE,CAAC,SAAS,QAAQ,GAAG,QAAQ,EACvF,QAAQ,MAAM,EACd,YAAY,MAAM,KACjB,OAAO,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAkB3B,CAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Logger } from '@xylabs/sdk-js';
|
|
2
|
-
import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator';
|
|
3
|
-
import type { Config, ProviderFactoryLocator } from '@xyo-network/xl1-sdk';
|
|
4
|
-
export interface GetLocatorContext {
|
|
5
|
-
config: Config;
|
|
6
|
-
locator: ProviderFactoryLocator;
|
|
7
|
-
logger?: Logger;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Used for retrieving a locator with the necessary modules registered for testing
|
|
11
|
-
* operation of the node (entirely in memory)
|
|
12
|
-
* @returns A locator with the necessary modules registered
|
|
13
|
-
*/
|
|
14
|
-
export declare const getModuleLocator: (context: GetLocatorContext) => Promise<ModuleFactoryLocator>;
|
|
15
|
-
//# sourceMappingURL=getModuleLocator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getModuleLocator.d.ts","sourceRoot":"","sources":["../../../src/manifest/getModuleLocator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,MAAM,EAAE,MAAM,gBAAgB,CAAA;AASlD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAG1E,OAAO,KAAK,EACoB,MAAM,EAAe,sBAAsB,EAC1E,MAAM,sBAAsB,CAAA;AAY7B,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,sBAAsB,CAAA;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAU,SAAS,iBAAiB,kCAuFhE,CAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type Logger } from '@xylabs/sdk-js';
|
|
2
|
-
import type { WalletInstance } from '@xyo-network/wallet-model';
|
|
3
|
-
import type { Config } from '@xyo-network/xl1-sdk';
|
|
4
|
-
export interface GetNodeContext {
|
|
5
|
-
config: Config;
|
|
6
|
-
logger?: Logger;
|
|
7
|
-
wallet: WalletInstance;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Creates a node with the xyo-chain modules registered
|
|
11
|
-
* @param context The context to use for the node
|
|
12
|
-
* @returns A node with the xyo-chain modules registered
|
|
13
|
-
*/
|
|
14
|
-
export declare const getNode: (context: GetNodeContext) => Promise<import("@xyo-network/node-memory").MemoryNode<import("@xyo-network/node-memory").MemoryNodeParams, import("@xyo-network/node-model").NodeModuleEventData>>;
|
|
15
|
-
//# sourceMappingURL=getNode.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getNode.d.ts","sourceRoot":"","sources":["../../../src/manifest/getNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAEtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EACV,MAAM,EACP,MAAM,sBAAsB,CAAA;AAO7B,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,cAAc,CAAA;CACvB;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAU,SAAS,cAAc,uKAgBpD,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Logger } from '@xylabs/sdk-js';
|
|
2
|
-
import type { Config, XyoGatewayRunner } from '@xyo-network/xl1-sdk';
|
|
3
|
-
import type { IBridgeServiceCollection } from '../services/index.ts';
|
|
4
|
-
export interface GetServicesContext {
|
|
5
|
-
config: Config;
|
|
6
|
-
logger?: Logger;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Used for retrieving a service collection
|
|
10
|
-
* @returns A service collection
|
|
11
|
-
*/
|
|
12
|
-
export declare const getServices: (context: GetServicesContext, gateway: XyoGatewayRunner) => Promise<IBridgeServiceCollection>;
|
|
13
|
-
//# sourceMappingURL=getServices.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getServices.d.ts","sourceRoot":"","sources":["../../../src/manifest/getServices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAKlD,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAGpE,OAAO,KAAK,EACE,wBAAwB,EACrC,MAAM,sBAAsB,CAAA;AAG7B,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAU,SAAS,kBAAkB,EAAE,SAAS,gBAAgB,KAAG,OAAO,CAAC,wBAAwB,CAsB1H,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/manifest/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nodeManifest.d.ts","sourceRoot":"","sources":["../../../src/manifest/nodeManifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAIzE;;GAEG;AACH,eAAO,MAAM,YAAY,EAAsB,sBAAsB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/manifest/private/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,qBAAqB,SAAK,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ModuleManifest, PackageManifestPayload } from '@xyo-network/manifest-model';
|
|
2
|
-
/**
|
|
3
|
-
* XL1 Node Manifest
|
|
4
|
-
*/
|
|
5
|
-
export declare const XL1NodeManifest: PackageManifestPayload;
|
|
6
|
-
/**
|
|
7
|
-
* Ethereum Node Manifest
|
|
8
|
-
*/
|
|
9
|
-
export declare const EthereumNodeManifest: PackageManifestPayload;
|
|
10
|
-
/**
|
|
11
|
-
* Public Child Manifests
|
|
12
|
-
*/
|
|
13
|
-
export declare const PublicChildManifests: ModuleManifest[];
|
|
14
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/manifest/public/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAMzF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAyB,sBAAsB,CAAA;AAE3E;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAA8B,sBAAsB,CAAA;AAErF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,cAAc,EAGhD,CAAA"}
|