@xyo-network/chain-bridge 1.18.0 → 1.18.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/config/asChainId.d.ts +1 -1
- package/dist/node/config/asChainId.d.ts.map +1 -1
- package/dist/node/config/getBridgeEscrowAddress.d.ts +1 -1
- package/dist/node/config/getBridgeEscrowAddress.d.ts.map +1 -1
- package/dist/node/config/getBridgeFeesAddress.d.ts +1 -1
- package/dist/node/config/getBridgeFeesAddress.d.ts.map +1 -1
- package/dist/node/config/getBridgeSettings.d.ts +1 -1
- package/dist/node/config/getBridgeSettings.d.ts.map +1 -1
- package/dist/node/config/getBridgeWalletAccount.d.ts +1 -1
- package/dist/node/config/getBridgeWalletAccount.d.ts.map +1 -1
- package/dist/node/config/getFeeStructure.d.ts +1 -1
- package/dist/node/config/getFeeStructure.d.ts.map +1 -1
- package/dist/node/config/getGateway.d.ts +1 -1
- package/dist/node/config/getGateway.d.ts.map +1 -1
- package/dist/node/config/getMaxBridgeAmount.d.ts +1 -1
- package/dist/node/config/getMaxBridgeAmount.d.ts.map +1 -1
- package/dist/node/config/getMinBridgeAmount.d.ts +1 -1
- package/dist/node/config/getMinBridgeAmount.d.ts.map +1 -1
- package/dist/node/config/getRemoteChainId.d.ts +1 -2
- package/dist/node/config/getRemoteChainId.d.ts.map +1 -1
- package/dist/node/config/getRemoteTokenAddress.d.ts +1 -1
- package/dist/node/config/getRemoteTokenAddress.d.ts.map +1 -1
- package/dist/node/config/getTransferAddresses.d.ts +1 -1
- package/dist/node/config/getTransferAddresses.d.ts.map +1 -1
- package/dist/node/config/getXl1ChainId.d.ts +1 -2
- package/dist/node/config/getXl1ChainId.d.ts.map +1 -1
- package/dist/node/config/getXl1TokenAddress.d.ts +1 -1
- package/dist/node/config/getXl1TokenAddress.d.ts.map +1 -1
- package/dist/node/index.mjs +55 -77
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/interface/interface/ChainBridgeRelayInterface.d.ts +1 -1
- package/dist/node/interface/interface/ChainBridgeRelayInterface.d.ts.map +1 -1
- package/dist/node/interface/interface/ObservationIndexerInterface.d.ts +1 -1
- package/dist/node/interface/interface/ObservationIndexerInterface.d.ts.map +1 -1
- package/dist/node/interface/interface/Params.d.ts +1 -1
- package/dist/node/interface/interface/Params.d.ts.map +1 -1
- package/dist/node/interface/repository/RepositoryInterface.d.ts +1 -1
- package/dist/node/interface/repository/RepositoryInterface.d.ts.map +1 -1
- package/dist/node/interface/service/Observer/ERC20TransferObserver/ERC20TransferObserver.d.ts +3 -2
- package/dist/node/interface/service/Observer/ERC20TransferObserver/ERC20TransferObserver.d.ts.map +1 -1
- package/dist/node/interface/service/Observer/LiquidityPoolBridgeObserver/LiquidityPoolBridgeObserver.d.ts +7 -6
- package/dist/node/interface/service/Observer/LiquidityPoolBridgeObserver/LiquidityPoolBridgeObserver.d.ts.map +1 -1
- package/dist/node/interface/service/Observer/Observer.d.ts +2 -2
- package/dist/node/interface/service/Observer/Observer.d.ts.map +1 -1
- package/dist/node/interface/service/Relay/ChainBridgeRelay/ChainBridgeRelayInterface.d.ts +1 -1
- package/dist/node/interface/service/Relay/ChainBridgeRelay/ChainBridgeRelayInterface.d.ts.map +1 -1
- package/dist/node/interface/service/Relay/ChainBridgeRelay/ChainBridgeRelayService.d.ts +4 -3
- package/dist/node/interface/service/Relay/ChainBridgeRelay/ChainBridgeRelayService.d.ts.map +1 -1
- package/dist/node/interface/service/Relay/LiquidityPoolBridgeRelay/LiquidityPoolBridgeRelay.d.ts +4 -3
- package/dist/node/interface/service/Relay/LiquidityPoolBridgeRelay/LiquidityPoolBridgeRelay.d.ts.map +1 -1
- package/dist/node/interface/util/getBridgeIntentIdentifier.d.ts +1 -1
- package/dist/node/interface/util/getBridgeIntentIdentifier.d.ts.map +1 -1
- package/dist/node/manifest/{getLocator.d.ts → getModuleLocator.d.ts} +4 -3
- package/dist/node/manifest/getModuleLocator.d.ts.map +1 -0
- package/dist/node/manifest/getNode.d.ts +1 -1
- package/dist/node/manifest/getNode.d.ts.map +1 -1
- package/dist/node/manifest/getServices.d.ts +1 -1
- package/dist/node/manifest/getServices.d.ts.map +1 -1
- package/dist/node/manifest/index.d.ts +1 -1
- package/dist/node/manifest/index.d.ts.map +1 -1
- package/dist/node/modules/EVMLiquidityBridgeTransactionCompletionMonitorSentinel/EVMLiquidityBridgeTransactionCompletionMonitorSentinel.d.ts +1 -2
- package/dist/node/modules/EVMLiquidityBridgeTransactionCompletionMonitorSentinel/EVMLiquidityBridgeTransactionCompletionMonitorSentinel.d.ts.map +1 -1
- package/dist/node/modules/XL1TransactionCompletionMonitorSentinel/XL1TransactionCompletionMonitorSentinel.d.ts +1 -2
- package/dist/node/modules/XL1TransactionCompletionMonitorSentinel/XL1TransactionCompletionMonitorSentinel.d.ts.map +1 -1
- package/dist/node/queue/connection.d.ts +1 -1
- package/dist/node/queue/connection.d.ts.map +1 -1
- package/dist/node/queue/flows/createXl1ToEthBridgeJob.d.ts +1 -1
- package/dist/node/queue/flows/createXl1ToEthBridgeJob.d.ts.map +1 -1
- package/dist/node/server/app.d.ts +1 -1
- package/dist/node/server/app.d.ts.map +1 -1
- package/dist/node/server/flowProducer.d.ts +1 -1
- package/dist/node/server/flowProducer.d.ts.map +1 -1
- package/dist/node/server/routes/addRoutes.d.ts +1 -1
- package/dist/node/server/routes/addRoutes.d.ts.map +1 -1
- package/dist/node/server/routes/bridge/addBridgeRoutes.d.ts +1 -1
- package/dist/node/server/routes/bridge/addBridgeRoutes.d.ts.map +1 -1
- package/dist/node/server/routes/bridge/routeDefinitions/getRouteDefinitions.d.ts +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/node/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteStatus.d.ts.map +1 -1
- package/dist/node/server/server.d.ts +1 -1
- package/dist/node/server/server.d.ts.map +1 -1
- package/dist/node/services/IBridgeServiceCollection.d.ts +1 -1
- package/dist/node/services/IBridgeServiceCollection.d.ts.map +1 -1
- package/dist/node/services/Xl1TxState.d.ts +1 -1
- package/dist/node/services/Xl1TxState.d.ts.map +1 -1
- package/dist/node/util/calculateBridgeFees.d.ts +1 -1
- package/dist/node/util/calculateBridgeFees.d.ts.map +1 -1
- package/dist/node/util/generateBridgeEstimate.d.ts +1 -2
- package/dist/node/util/generateBridgeEstimate.d.ts.map +1 -1
- package/dist/node/util/validateBridgeEstimate.d.ts +1 -2
- package/dist/node/util/validateBridgeEstimate.d.ts.map +1 -1
- package/dist/node/util/validateBridgeEstimateExact.d.ts +1 -2
- package/dist/node/util/validateBridgeEstimateExact.d.ts.map +1 -1
- package/dist/node/util/validateBridgeTransaction.d.ts +1 -2
- package/dist/node/util/validateBridgeTransaction.d.ts.map +1 -1
- package/package.json +68 -68
- package/src/config/asChainId.ts +1 -1
- package/src/config/getBridgeEscrowAddress.ts +1 -1
- package/src/config/getBridgeFeesAddress.ts +1 -1
- package/src/config/getBridgeSettings.ts +1 -1
- package/src/config/getBridgeWalletAccount.ts +2 -2
- package/src/config/getFeeStructure.ts +1 -1
- package/src/config/getGateway.ts +11 -11
- package/src/config/getMaxBridgeAmount.ts +1 -1
- package/src/config/getMinBridgeAmount.ts +1 -1
- package/src/config/getRemoteChainId.ts +1 -2
- package/src/config/getRemoteTokenAddress.ts +1 -1
- package/src/config/getTransferAddresses.ts +1 -1
- package/src/config/getXl1ChainId.ts +1 -2
- package/src/config/getXl1TokenAddress.ts +1 -1
- package/src/interface/interface/ChainBridgeRelayInterface.ts +1 -1
- package/src/interface/interface/ObservationIndexerInterface.ts +1 -1
- package/src/interface/interface/Params.ts +1 -1
- package/src/interface/repository/RepositoryInterface.ts +1 -1
- package/src/interface/service/Observer/ERC20TransferObserver/ERC20TransferObserver.ts +5 -4
- package/src/interface/service/Observer/LiquidityPoolBridgeObserver/LiquidityPoolBridgeObserver.ts +11 -10
- package/src/interface/service/Observer/Observer.ts +3 -3
- package/src/interface/service/Relay/ChainBridgeRelay/ChainBridgeRelayInterface.ts +1 -1
- package/src/interface/service/Relay/ChainBridgeRelay/ChainBridgeRelayService.ts +4 -3
- package/src/interface/service/Relay/LiquidityPoolBridgeRelay/LiquidityPoolBridgeRelay.ts +6 -5
- package/src/interface/util/getBridgeIntentIdentifier.ts +1 -1
- package/src/manifest/{getLocator.ts → getModuleLocator.ts} +21 -31
- package/src/manifest/getNode.ts +10 -4
- package/src/manifest/getServices.ts +5 -24
- package/src/manifest/index.ts +1 -1
- package/src/modules/EVMLiquidityBridgeTransactionCompletionMonitorSentinel/EVMLiquidityBridgeTransactionCompletionMonitorSentinel.ts +8 -7
- package/src/modules/XL1TransactionCompletionMonitorSentinel/XL1TransactionCompletionMonitorSentinel.ts +4 -4
- package/src/queue/connection.ts +1 -1
- package/src/queue/flows/createXl1ToEthBridgeJob.ts +1 -1
- package/src/queue/workers/ethTransactionMonitor.ts +1 -1
- package/src/queue/workers/ethTransactionPreparation.ts +2 -2
- package/src/queue/workers/ethTransactionSubmission.ts +1 -1
- package/src/queue/workers/xl1TransactionMonitor.ts +2 -2
- package/src/queue/workers/xl1TransactionPreparation.ts +1 -1
- package/src/queue/workers/xl1TransactionSubmission.ts +1 -1
- package/src/server/app.ts +1 -1
- package/src/server/flowProducer.ts +1 -1
- package/src/server/routes/addRoutes.ts +1 -1
- package/src/server/routes/bridge/addBridgeRoutes.ts +1 -1
- package/src/server/routes/bridge/routeDefinitions/getRouteDefinitions.ts +1 -1
- package/src/server/routes/bridge/routeDefinitions/pathParams/ChainIdPathParam.ts +1 -2
- package/src/server/routes/bridge/routeDefinitions/routes/bridgeConfig.ts +1 -1
- package/src/server/routes/bridge/routeDefinitions/routes/bridgeFromRemoteStatus.ts +2 -3
- package/src/server/routes/bridge/routeDefinitions/routes/bridgeToRemote.ts +4 -4
- package/src/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteEstimate.ts +3 -3
- package/src/server/routes/bridge/routeDefinitions/routes/bridgeToRemoteStatus.ts +4 -3
- package/src/server/server.ts +1 -1
- package/src/services/IBridgeServiceCollection.ts +1 -1
- package/src/services/Xl1TxState.ts +1 -1
- package/src/util/calculateBridgeFees.ts +1 -1
- package/src/util/generateBridgeEstimate.ts +4 -4
- package/src/util/validateBridgeEstimate.ts +3 -2
- package/src/util/validateBridgeEstimateExact.ts +3 -2
- package/src/util/validateBridgeTransaction.ts +3 -3
- package/dist/node/manifest/getLocator.d.ts.map +0 -1
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
asHex, assertEx, hexFromBigInt, hexToBigInt, isNull,
|
|
4
4
|
toAddress,
|
|
5
5
|
} from '@xylabs/sdk-js'
|
|
6
|
-
import { BaseAccountableService } from '@xyo-network/chain-services'
|
|
7
6
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
8
7
|
import type { LiquidityPoolBridge } from '@xyo-network/typechain'
|
|
9
8
|
import { LiquidityPoolBridge__factory } from '@xyo-network/typechain'
|
|
9
|
+
import { AbstractCreatableProvider } from '@xyo-network/xl1-sdk'
|
|
10
10
|
import {
|
|
11
11
|
type BridgeDestinationObservation, BridgeDestinationObservationSchema, type BridgeIntent,
|
|
12
|
-
} from '@xyo-network/xl1-
|
|
12
|
+
} from '@xyo-network/xl1-sdk'
|
|
13
13
|
import type { WebSocketProvider } from 'ethers'
|
|
14
14
|
import { getAddress, Wallet } from 'ethers'
|
|
15
15
|
|
|
@@ -30,7 +30,8 @@ export type LiquidityPoolBridgeRelayParams = BridgeServiceParams & {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export class LiquidityPoolBridgeRelay<TParams extends LiquidityPoolBridgeRelayParams = LiquidityPoolBridgeRelayParams>
|
|
33
|
-
extends
|
|
33
|
+
extends AbstractCreatableProvider<TParams> implements ChainBridgeRelayInterface {
|
|
34
|
+
moniker = 'LiquidityPoolBridgeRelay'
|
|
34
35
|
protected _bridge: LiquidityPoolBridge | undefined
|
|
35
36
|
protected _bridgeChainId: Hex | undefined
|
|
36
37
|
protected _bridgeRemoteChainId: Hex | undefined
|
|
@@ -107,7 +108,7 @@ export class LiquidityPoolBridgeRelay<TParams extends LiquidityPoolBridgeRelayPa
|
|
|
107
108
|
getAddress(bridgeIntent.srcAddress),
|
|
108
109
|
getAddress(bridgeIntent.destAddress),
|
|
109
110
|
amount,
|
|
110
|
-
|
|
111
|
+
nonce,
|
|
111
112
|
)
|
|
112
113
|
return true
|
|
113
114
|
}
|
|
@@ -203,7 +204,7 @@ export class LiquidityPoolBridgeRelay<TParams extends LiquidityPoolBridgeRelayPa
|
|
|
203
204
|
getAddress(bridgeIntent.srcAddress),
|
|
204
205
|
getAddress(bridgeIntent.destAddress),
|
|
205
206
|
amount,
|
|
206
|
-
|
|
207
|
+
nonce,
|
|
207
208
|
)
|
|
208
209
|
const confirmation = await tx.wait()
|
|
209
210
|
const transactionResponse = await confirmation?.getTransaction()
|
|
@@ -2,7 +2,7 @@ import type { Hash } from '@xylabs/sdk-js'
|
|
|
2
2
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
3
3
|
import {
|
|
4
4
|
type BridgeDestinationObservation, type BridgeIntent, BridgeIntentSchema, type BridgeSourceObservation,
|
|
5
|
-
} from '@xyo-network/xl1-
|
|
5
|
+
} from '@xyo-network/xl1-sdk'
|
|
6
6
|
|
|
7
7
|
export const getBridgeIntentFromObservation = (observation: BridgeSourceObservation | BridgeDestinationObservation, nonce: string): BridgeIntent => {
|
|
8
8
|
const {
|
|
@@ -11,15 +11,14 @@ import { AbstractModule, LoggerModuleStatusReporter } from '@xyo-network/module-
|
|
|
11
11
|
import { ModuleFactoryLocator } from '@xyo-network/module-factory-locator'
|
|
12
12
|
import type { MongoDBModuleParamsV2 } from '@xyo-network/module-model-mongodb'
|
|
13
13
|
import { MemorySentinel } from '@xyo-network/sentinel-memory'
|
|
14
|
-
import { HDWallet } from '@xyo-network/wallet'
|
|
15
|
-
import type { BridgeDestinationObservation, SignedHydratedTransaction } from '@xyo-network/xl1-protocol'
|
|
16
14
|
import type {
|
|
17
|
-
Config, IterableMap,
|
|
18
|
-
|
|
15
|
+
BridgeDestinationObservation, Config, IterableMap, ProviderFactoryLocator, SignedHydratedTransaction,
|
|
16
|
+
XyoGatewayRunner,
|
|
17
|
+
} from '@xyo-network/xl1-sdk'
|
|
19
18
|
import {
|
|
20
|
-
hasMongoConfig, mapToMapType,
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
hasMongoConfig, mapToMapType,
|
|
20
|
+
XyoGatewayRunnerMoniker,
|
|
21
|
+
} from '@xyo-network/xl1-sdk'
|
|
23
22
|
import type { Document } from 'mongodb'
|
|
24
23
|
|
|
25
24
|
import type { EVMLiquidityBridgeTransactionCompletionMonitorSentinelParams, XL1TransactionCompletionMonitorSentinelParams } from '../modules/index.ts'
|
|
@@ -30,6 +29,7 @@ import {
|
|
|
30
29
|
|
|
31
30
|
export interface GetLocatorContext {
|
|
32
31
|
config: Config
|
|
32
|
+
locator: ProviderFactoryLocator
|
|
33
33
|
logger?: Logger
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -38,8 +38,10 @@ export interface GetLocatorContext {
|
|
|
38
38
|
* operation of the node (entirely in memory)
|
|
39
39
|
* @returns A locator with the necessary modules registered
|
|
40
40
|
*/
|
|
41
|
-
export const
|
|
42
|
-
const {
|
|
41
|
+
export const getModuleLocator = async (context: GetLocatorContext) => {
|
|
42
|
+
const {
|
|
43
|
+
config, locator, logger,
|
|
44
|
+
} = context
|
|
43
45
|
const { otlpEndpoint } = config.telemetry?.otel ?? {}
|
|
44
46
|
const { path: endpoint = '/metrics', port: port = 9468 } = config.telemetry?.metrics?.scrape ?? {}
|
|
45
47
|
const { traceProvider, meterProvider } = await initTelemetry({
|
|
@@ -54,7 +56,7 @@ export const getLocator = async (context: GetLocatorContext) => {
|
|
|
54
56
|
if (isDefined(logger)) AbstractModule.defaultLogger = logger
|
|
55
57
|
const statusReporter = logger ? new LoggerModuleStatusReporter(logger) : undefined
|
|
56
58
|
|
|
57
|
-
const
|
|
59
|
+
const moduleLocator = new ModuleFactoryLocator()
|
|
58
60
|
// If there's a MongoDB configuration
|
|
59
61
|
const mongoConfig = config.storage?.mongo
|
|
60
62
|
if (hasMongoConfig(mongoConfig)) {
|
|
@@ -69,21 +71,21 @@ export const getLocator = async (context: GetLocatorContext) => {
|
|
|
69
71
|
meterProvider, payloadSdkConfig, statusReporter, traceProvider,
|
|
70
72
|
}
|
|
71
73
|
// Register the MongoDB Archivist as the default
|
|
72
|
-
|
|
74
|
+
moduleLocator.register(MongoDBArchivistV2.factory(params), undefined, true)
|
|
73
75
|
}
|
|
74
76
|
|
|
75
|
-
|
|
77
|
+
moduleLocator.register(MemoryArchivist.factory({
|
|
76
78
|
traceProvider, meterProvider, statusReporter,
|
|
77
79
|
}))
|
|
78
|
-
|
|
80
|
+
moduleLocator.register(MemorySentinel.factory({
|
|
79
81
|
traceProvider, meterProvider, statusReporter,
|
|
80
82
|
}))
|
|
81
|
-
|
|
83
|
+
moduleLocator.register(ViewArchivist.factory({
|
|
82
84
|
traceProvider, meterProvider, statusReporter,
|
|
83
85
|
}))
|
|
84
86
|
|
|
85
|
-
const gateway = await
|
|
86
|
-
const viewer = assertEx(gateway.
|
|
87
|
+
const gateway = await locator.getInstance<XyoGatewayRunner>(XyoGatewayRunnerMoniker)
|
|
88
|
+
const viewer = assertEx(gateway.connection.viewer, () => 'Gateway viewer is not defined')
|
|
87
89
|
const pendingXl1ToEthXl1BridgeIntentTransactions = await getIterableMap<Hash, SignedHydratedTransaction>(
|
|
88
90
|
config,
|
|
89
91
|
'liquidity_bridge_xl1_to_eth_xl1_pending',
|
|
@@ -102,7 +104,7 @@ export const getLocator = async (context: GetLocatorContext) => {
|
|
|
102
104
|
traceProvider,
|
|
103
105
|
viewer,
|
|
104
106
|
}
|
|
105
|
-
|
|
107
|
+
moduleLocator.register(XL1TransactionCompletionMonitorSentinel.factory(xl1TransactionCompletionMonitorSentinelParams))
|
|
106
108
|
|
|
107
109
|
const completedEthXl1BridgeTransactions = await getIterableMap<Hash, BridgeDestinationObservation>(
|
|
108
110
|
config,
|
|
@@ -120,21 +122,9 @@ export const getLocator = async (context: GetLocatorContext) => {
|
|
|
120
122
|
statusReporter,
|
|
121
123
|
traceProvider,
|
|
122
124
|
}
|
|
123
|
-
|
|
125
|
+
moduleLocator.register(EVMLiquidityBridgeTransactionCompletionMonitorSentinel.factory(evmLiquidityBridgeTransactionCompletionMonitorSentinelParams))
|
|
124
126
|
|
|
125
|
-
return
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const getGateway = async (
|
|
129
|
-
config: Config,
|
|
130
|
-
): Promise<XyoGatewayRunner> => {
|
|
131
|
-
const { mnemonic, chainRpcApiUrl: endpoint } = config.bridge
|
|
132
|
-
const walletPromise = isDefined(mnemonic) ? HDWallet.fromPhrase(mnemonic) : HDWallet.random()
|
|
133
|
-
const account = await walletPromise
|
|
134
|
-
const signer = new SimpleXyoSigner(account)
|
|
135
|
-
const connection = await SimpleXyoConnection.create()
|
|
136
|
-
const gateway = new SimpleXyoGatewayRunner(connection, signer)
|
|
137
|
-
return gateway
|
|
127
|
+
return moduleLocator
|
|
138
128
|
}
|
|
139
129
|
|
|
140
130
|
/**
|
package/src/manifest/getNode.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { Logger } from '@xylabs/sdk-js'
|
|
2
2
|
import { ManifestWrapper } from '@xyo-network/manifest-wrapper'
|
|
3
3
|
import type { WalletInstance } from '@xyo-network/wallet-model'
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
Config, RpcSchemaMap, TransportFactory,
|
|
6
|
+
} from '@xyo-network/xl1-sdk'
|
|
7
|
+
import { buildJsonRpcProviderLocator, HttpRpcTransport } from '@xyo-network/xl1-sdk'
|
|
5
8
|
|
|
6
|
-
import {
|
|
9
|
+
import { getModuleLocator } from './getModuleLocator.ts'
|
|
7
10
|
import { NodeManifest } from './nodeManifest.ts'
|
|
8
11
|
import { PrivateChildManifests } from './private/index.ts'
|
|
9
12
|
import { PublicChildManifests } from './public/index.ts'
|
|
@@ -21,8 +24,11 @@ export interface GetNodeContext {
|
|
|
21
24
|
*/
|
|
22
25
|
export const getNode = async (context: GetNodeContext) => {
|
|
23
26
|
const { wallet } = context
|
|
24
|
-
const
|
|
25
|
-
const
|
|
27
|
+
const { chainRpcApiUrl: endpoint } = context.config.bridge
|
|
28
|
+
const transportFactory: TransportFactory = (schemas: RpcSchemaMap) => new HttpRpcTransport(endpoint, schemas)
|
|
29
|
+
const locator = await buildJsonRpcProviderLocator({ transportFactory })
|
|
30
|
+
const moduleLocator = await getModuleLocator({ ...context, locator })
|
|
31
|
+
const wrapper = new ManifestWrapper(NodeManifest, wallet, moduleLocator, PublicChildManifests, PrivateChildManifests)
|
|
26
32
|
const [node, ...childNodes] = await wrapper.loadNodes()
|
|
27
33
|
if (childNodes?.length > 0) {
|
|
28
34
|
await Promise.all(childNodes.map(childNode => node.register(childNode)))
|
|
@@ -5,20 +5,15 @@ import { MongoMap } from '@xyo-network/chain-protocol'
|
|
|
5
5
|
import { initEvmProvider } from '@xyo-network/chain-services'
|
|
6
6
|
import { LiquidityPoolBridge__factory } from '@xyo-network/typechain'
|
|
7
7
|
import { HDWallet } from '@xyo-network/wallet'
|
|
8
|
-
import type {
|
|
9
|
-
Config, IterableMap, XyoGatewayRunner,
|
|
10
|
-
} from '@xyo-network/xl1-protocol-sdk'
|
|
8
|
+
import type { Config, IterableMap } from '@xyo-network/xl1-sdk'
|
|
11
9
|
import {
|
|
12
|
-
hasMongoConfig,
|
|
13
|
-
|
|
14
|
-
} from '@xyo-network/xl1-
|
|
15
|
-
import type { SimpleXyoConnection } from '@xyo-network/xl1-providers'
|
|
16
|
-
import { buildJsonRpcProviderLocator } from '@xyo-network/xl1-providers'
|
|
17
|
-
import type { RpcSchemaMap, TransportFactory } from '@xyo-network/xl1-rpc'
|
|
18
|
-
import { HttpRpcTransport } from '@xyo-network/xl1-rpc'
|
|
10
|
+
hasMongoConfig,
|
|
11
|
+
mapToMapType,
|
|
12
|
+
} from '@xyo-network/xl1-sdk'
|
|
19
13
|
import { getAddress, Wallet } from 'ethers'
|
|
20
14
|
import type { Document } from 'mongodb'
|
|
21
15
|
|
|
16
|
+
import { getGateway } from '../config/index.ts'
|
|
22
17
|
import type {
|
|
23
18
|
EthTxState, IBridgeServiceCollection, Xl1TxState,
|
|
24
19
|
} from '../services/index.ts'
|
|
@@ -60,20 +55,6 @@ export const getServices = async (context: GetServicesContext): Promise<IBridgeS
|
|
|
60
55
|
}
|
|
61
56
|
}
|
|
62
57
|
|
|
63
|
-
const getGateway = async (
|
|
64
|
-
config: Config,
|
|
65
|
-
): Promise<XyoGatewayRunner> => {
|
|
66
|
-
const { mnemonic, chainRpcApiUrl: endpoint } = config.bridge
|
|
67
|
-
const walletPromise = isDefined(mnemonic) ? HDWallet.fromPhrase(mnemonic) : HDWallet.random()
|
|
68
|
-
const account = await walletPromise
|
|
69
|
-
const signer = new SimpleXyoSigner(account)
|
|
70
|
-
const transportFactory: TransportFactory = (schemas: RpcSchemaMap) => new HttpRpcTransport(endpoint, schemas)
|
|
71
|
-
const locator = await buildJsonRpcProviderLocator({ transportFactory })
|
|
72
|
-
const connection = await locator.getInstance<SimpleXyoConnection>(XyoConnectionMoniker)
|
|
73
|
-
const gateway = new SimpleXyoGatewayRunner(connection, signer)
|
|
74
|
-
return gateway
|
|
75
|
-
}
|
|
76
|
-
|
|
77
58
|
/**
|
|
78
59
|
* Gets an iterable map based on the storage instructions in the config
|
|
79
60
|
* @param config The config containing storage instructions
|
package/src/manifest/index.ts
CHANGED
|
@@ -13,13 +13,14 @@ import type {
|
|
|
13
13
|
SentinelConfig, SentinelInstance, SentinelModuleEventData, SentinelParams,
|
|
14
14
|
} from '@xyo-network/sentinel-model'
|
|
15
15
|
import { type LiquidityPoolBridge, LiquidityPoolBridge__factory } from '@xyo-network/typechain'
|
|
16
|
+
import type {
|
|
17
|
+
BridgeDestinationObservation, BridgeIntent, IterableMap, MapType,
|
|
18
|
+
SignedHydratedTransaction,
|
|
19
|
+
} from '@xyo-network/xl1-sdk'
|
|
16
20
|
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import {
|
|
21
|
-
flattenHydratedTransaction, flattenHydratedTransactions, tryUnflattenHydratedTransaction,
|
|
22
|
-
} from '@xyo-network/xl1-protocol-sdk'
|
|
21
|
+
BridgeDestinationObservationSchema, flattenHydratedTransaction, flattenHydratedTransactions, isBridgeIntent,
|
|
22
|
+
tryUnflattenHydratedTransaction,
|
|
23
|
+
} from '@xyo-network/xl1-sdk'
|
|
23
24
|
import { Mutex } from 'async-mutex'
|
|
24
25
|
import { getAddress } from 'ethers/address'
|
|
25
26
|
import type { Provider } from 'ethers/providers'
|
|
@@ -222,7 +223,7 @@ export class EVMLiquidityBridgeTransactionCompletionMonitorSentinel<
|
|
|
222
223
|
const nonce = await this.wallet.getNonce()
|
|
223
224
|
const srcAddress = getAddress(bridgeIntent.srcAddress)
|
|
224
225
|
const destAddress = getAddress(bridgeIntent.destAddress)
|
|
225
|
-
const tx = await this.bridge.bridgeFromRemote(srcAddress, destAddress, amount,
|
|
226
|
+
const tx = await this.bridge.bridgeFromRemote(srcAddress, destAddress, amount, nonce)
|
|
226
227
|
const confirmation = await tx.wait()
|
|
227
228
|
const transactionResponse = await confirmation?.getTransaction()
|
|
228
229
|
const destConfirmation = asHex(transactionResponse?.hash ?? '', true)
|
|
@@ -10,13 +10,13 @@ import { AbstractSentinel } from '@xyo-network/sentinel-abstract'
|
|
|
10
10
|
import type {
|
|
11
11
|
SentinelConfig, SentinelInstance, SentinelModuleEventData, SentinelParams,
|
|
12
12
|
} from '@xyo-network/sentinel-model'
|
|
13
|
-
import type { SignedHydratedTransaction } from '@xyo-network/xl1-protocol'
|
|
14
13
|
import type {
|
|
15
|
-
IterableMap, MapType,
|
|
16
|
-
|
|
14
|
+
IterableMap, MapType, SignedHydratedTransaction,
|
|
15
|
+
XyoViewer,
|
|
16
|
+
} from '@xyo-network/xl1-sdk'
|
|
17
17
|
import {
|
|
18
18
|
flattenHydratedTransaction, flattenHydratedTransactions, tryUnflattenHydratedTransaction,
|
|
19
|
-
} from '@xyo-network/xl1-
|
|
19
|
+
} from '@xyo-network/xl1-sdk'
|
|
20
20
|
import { Mutex } from 'async-mutex'
|
|
21
21
|
|
|
22
22
|
export const XL1TransactionCompletionMonitorSentinelConfigSchema = 'network.xyo.sentinel.chain.transaction.completion.monitor.config'
|
package/src/queue/connection.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assertEx } from '@xylabs/sdk-js'
|
|
2
2
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
3
|
-
import type { SignedHydratedTransaction } from '@xyo-network/xl1-
|
|
3
|
+
import type { SignedHydratedTransaction } from '@xyo-network/xl1-sdk'
|
|
4
4
|
import type { Job } from 'bullmq'
|
|
5
5
|
import { Worker } from 'bullmq'
|
|
6
6
|
import type { Redis } from 'ioredis'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assertEx, hexToBigInt } from '@xylabs/sdk-js'
|
|
2
2
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
3
|
-
import { isBridgeIntent, type SignedHydratedTransaction } from '@xyo-network/xl1-
|
|
3
|
+
import { isBridgeIntent, type SignedHydratedTransaction } from '@xyo-network/xl1-sdk'
|
|
4
4
|
import type { Job } from 'bullmq'
|
|
5
5
|
import { Worker } from 'bullmq'
|
|
6
6
|
import { getAddress } from 'ethers'
|
|
@@ -30,7 +30,7 @@ export const createWorker = (connection: Redis) => {
|
|
|
30
30
|
const amount = hexToBigInt(bridgeIntent.destAmount)
|
|
31
31
|
const srcAddress = getAddress(bridgeIntent.srcAddress)
|
|
32
32
|
const destAddress = getAddress(bridgeIntent.destAddress)
|
|
33
|
-
const preparedTx = await bridge.getFunction('bridgeFromRemote').populateTransaction(srcAddress, destAddress, amount)
|
|
33
|
+
const preparedTx = await bridge.getFunction('bridgeFromRemote').populateTransaction(srcAddress, destAddress, amount, 0n)
|
|
34
34
|
await job.log(`[${hash}] built ETH transaction`)
|
|
35
35
|
await job.log(`[${hash}] storing ETH preparedTx`)
|
|
36
36
|
await stateMap.set(hash, { preparedTx })
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assertEx, isDefined } from '@xylabs/sdk-js'
|
|
2
2
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
3
|
-
import { type SignedHydratedTransaction } from '@xyo-network/xl1-
|
|
3
|
+
import { type SignedHydratedTransaction } from '@xyo-network/xl1-sdk'
|
|
4
4
|
import type { Job } from 'bullmq'
|
|
5
5
|
import { Worker } from 'bullmq'
|
|
6
6
|
import type { Redis } from 'ioredis'
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
assertEx, isDefined, isNull,
|
|
3
3
|
} from '@xylabs/sdk-js'
|
|
4
4
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
5
|
-
import type { SignedHydratedTransaction } from '@xyo-network/xl1-
|
|
5
|
+
import type { SignedHydratedTransaction } from '@xyo-network/xl1-sdk'
|
|
6
6
|
import type { Job } from 'bullmq'
|
|
7
7
|
import { UnrecoverableError, Worker } from 'bullmq'
|
|
8
8
|
import type { Redis } from 'ioredis'
|
|
@@ -27,7 +27,7 @@ const createWorker = (connection: Redis) => {
|
|
|
27
27
|
// Get the hash of the transaction
|
|
28
28
|
const hash = await PayloadBuilder.hash(tx[0])
|
|
29
29
|
// Get the state of the transaction
|
|
30
|
-
const viewer = assertEx(gateway.
|
|
30
|
+
const viewer = assertEx(gateway.connection.viewer, () => `[${hash}] viewer not defined on gateway`)
|
|
31
31
|
const state = assertEx(await stateMap.get(hash), () => `[${hash}] state not found`)
|
|
32
32
|
|
|
33
33
|
// Check for transaction inclusion on chain
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
2
|
-
import type { SignedHydratedTransaction } from '@xyo-network/xl1-
|
|
2
|
+
import type { SignedHydratedTransaction } from '@xyo-network/xl1-sdk'
|
|
3
3
|
import type { Job } from 'bullmq'
|
|
4
4
|
import { Worker } from 'bullmq'
|
|
5
5
|
import type { Redis } from 'ioredis'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assertEx, isDefined } from '@xylabs/sdk-js'
|
|
2
2
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
3
|
-
import type { SignedHydratedTransaction } from '@xyo-network/xl1-
|
|
3
|
+
import type { SignedHydratedTransaction } from '@xyo-network/xl1-sdk'
|
|
4
4
|
import type { Job } from 'bullmq'
|
|
5
5
|
import { Worker } from 'bullmq'
|
|
6
6
|
import type { Redis } from 'ioredis'
|
package/src/server/app.ts
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
standardErrors, standardResponses,
|
|
4
4
|
} from '@xylabs/express'
|
|
5
5
|
import type { NodeInstance } from '@xyo-network/node-model'
|
|
6
|
-
import type { Config } from '@xyo-network/xl1-
|
|
6
|
+
import type { Config } from '@xyo-network/xl1-sdk'
|
|
7
7
|
import compression from 'compression'
|
|
8
8
|
import cors from 'cors'
|
|
9
9
|
import type { Express } from 'express'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RouteDefinition } from '@xylabs/express'
|
|
2
|
-
import type { Config } from '@xyo-network/xl1-
|
|
2
|
+
import type { Config } from '@xyo-network/xl1-sdk'
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
makeBridgeConfigRoute, makeBridgeFromRemoteStatusRoute, makeBridgeToRemoteEstimateRoute, makeBridgeToRemoteRoute, makeBridgeToRemoteStatusRoute,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
asHex, HexZod, isUndefined,
|
|
3
3
|
} from '@xylabs/sdk-js'
|
|
4
|
-
import type { ChainId } from '@xyo-network/xl1-
|
|
5
|
-
import type { Config } from '@xyo-network/xl1-protocol-sdk'
|
|
4
|
+
import type { ChainId, Config } from '@xyo-network/xl1-sdk'
|
|
6
5
|
|
|
7
6
|
import { getRemoteChainId } from '../../../../../config/index.ts'
|
|
8
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RouteDefinition } from '@xylabs/express'
|
|
2
2
|
import { requestHandlerValidator } from '@xylabs/express'
|
|
3
|
-
import { BridgeSettingsZod, type Config } from '@xyo-network/xl1-
|
|
3
|
+
import { BridgeSettingsZod, type Config } from '@xyo-network/xl1-sdk'
|
|
4
4
|
|
|
5
5
|
import { getBridgeSettings } from '../../../../../config/index.ts'
|
|
6
6
|
|
|
@@ -2,12 +2,11 @@ import type { RouteDefinition } from '@xylabs/express'
|
|
|
2
2
|
import { requestHandlerValidator } from '@xylabs/express'
|
|
3
3
|
import { toAddress, toHex } from '@xylabs/sdk-js'
|
|
4
4
|
import { PayloadZodStrictOfSchema } from '@xyo-network/payload-model'
|
|
5
|
-
import type { BridgeDestinationObservation } from '@xyo-network/xl1-
|
|
5
|
+
import type { BridgeDestinationObservation, Config } from '@xyo-network/xl1-sdk'
|
|
6
6
|
import {
|
|
7
7
|
BridgeDestinationObservationFieldsZod,
|
|
8
8
|
BridgeDestinationObservationSchema,
|
|
9
|
-
} from '@xyo-network/xl1-
|
|
10
|
-
import type { Config } from '@xyo-network/xl1-protocol-sdk'
|
|
9
|
+
} from '@xyo-network/xl1-sdk'
|
|
11
10
|
import { z } from 'zod'
|
|
12
11
|
|
|
13
12
|
import { getBridgeSettings } from '../../../../../config/index.ts'
|
|
@@ -3,12 +3,12 @@ import { requestHandlerValidator } from '@xylabs/express'
|
|
|
3
3
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
4
4
|
import { PayloadZodStrictOfSchema } from '@xyo-network/payload-model'
|
|
5
5
|
import type {
|
|
6
|
-
BridgeSourceObservation, BridgeSourceObservationFields,
|
|
7
|
-
|
|
6
|
+
BridgeSourceObservation, BridgeSourceObservationFields, Config,
|
|
7
|
+
SignedHydratedTransaction,
|
|
8
|
+
} from '@xyo-network/xl1-sdk'
|
|
8
9
|
import {
|
|
9
10
|
BridgeIntentFieldsZod, BridgeIntentSchema, BridgeSourceObservationFieldsZod, BridgeSourceObservationSchema, SignedTransactionBoundWitnessZod, TransferZod,
|
|
10
|
-
} from '@xyo-network/xl1-
|
|
11
|
-
import { type Config } from '@xyo-network/xl1-protocol-sdk'
|
|
11
|
+
} from '@xyo-network/xl1-sdk'
|
|
12
12
|
import { z } from 'zod'
|
|
13
13
|
|
|
14
14
|
import { createXl1ToEthBridgeJob } from '../../../../../queue/index.ts'
|
|
@@ -2,10 +2,10 @@ import type { RouteDefinition } from '@xylabs/express'
|
|
|
2
2
|
import { requestHandlerValidator } from '@xylabs/express'
|
|
3
3
|
import { assertEx, toAddress } from '@xylabs/sdk-js'
|
|
4
4
|
import { PayloadZodLooseOfSchema, PayloadZodStrictOfSchema } from '@xyo-network/payload-model'
|
|
5
|
+
import { buildUnsignedTransaction, type Config } from '@xyo-network/xl1-sdk'
|
|
5
6
|
import {
|
|
6
7
|
BridgeIntentFieldsZod, BridgeIntentSchema, toXL1BlockNumber, TransactionBoundWitnessZod, TransferSchema,
|
|
7
|
-
} from '@xyo-network/xl1-
|
|
8
|
-
import { buildUnsignedTransaction, type Config } from '@xyo-network/xl1-protocol-sdk'
|
|
8
|
+
} from '@xyo-network/xl1-sdk'
|
|
9
9
|
import { z } from 'zod'
|
|
10
10
|
|
|
11
11
|
import { getGateway, getXl1ChainId } from '../../../../../config/index.ts'
|
|
@@ -41,7 +41,7 @@ export const makeBridgeToRemoteEstimateRoute = (config: Config): RouteDefinition
|
|
|
41
41
|
|
|
42
42
|
// Use viewer to get current block
|
|
43
43
|
const gateway = await getGateway(config)
|
|
44
|
-
const viewer = assertEx(gateway.
|
|
44
|
+
const viewer = assertEx(gateway.connection.viewer, () => new Error('Viewer not available on gateway connection'))
|
|
45
45
|
const currentBlockNumber = await viewer.currentBlockNumber()
|
|
46
46
|
// Calculate nbf/exp
|
|
47
47
|
const nbf = toXL1BlockNumber(currentBlockNumber, true)
|
|
@@ -4,12 +4,13 @@ import {
|
|
|
4
4
|
asAddress, asHex, toHex,
|
|
5
5
|
} from '@xylabs/sdk-js'
|
|
6
6
|
import { PayloadZodStrictOfSchema } from '@xyo-network/payload-model'
|
|
7
|
-
import type {
|
|
7
|
+
import type {
|
|
8
|
+
BridgeDestinationObservation, BridgeSourceObservation, Config,
|
|
9
|
+
} from '@xyo-network/xl1-sdk'
|
|
8
10
|
import {
|
|
9
11
|
BridgeDestinationObservationFieldsZod, BridgeDestinationObservationSchema, BridgeIntentFieldsZod, BridgeIntentSchema, BridgeSourceObservationFieldsZod,
|
|
10
12
|
BridgeSourceObservationSchema,
|
|
11
|
-
} from '@xyo-network/xl1-
|
|
12
|
-
import type { Config } from '@xyo-network/xl1-protocol-sdk'
|
|
13
|
+
} from '@xyo-network/xl1-sdk'
|
|
13
14
|
import { z } from 'zod'
|
|
14
15
|
|
|
15
16
|
import { getBridgeSettings } from '../../../../../config/index.ts'
|
package/src/server/server.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { boot } from '@xyo-network/bios'
|
|
|
5
5
|
import type { BiosExternalInterface } from '@xyo-network/bios-model'
|
|
6
6
|
import type { NodeInstance } from '@xyo-network/node-model'
|
|
7
7
|
import { HDWallet } from '@xyo-network/wallet'
|
|
8
|
-
import { type Config } from '@xyo-network/xl1-
|
|
8
|
+
import { type Config } from '@xyo-network/xl1-sdk'
|
|
9
9
|
|
|
10
10
|
import { getNode, getServices } from '../manifest/index.ts'
|
|
11
11
|
import { getApp } from './app.ts'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/sdk-js'
|
|
2
2
|
import type { AccountInstance } from '@xyo-network/account-model'
|
|
3
3
|
import type { LiquidityPoolBridge } from '@xyo-network/typechain'
|
|
4
|
-
import type { IterableMap, XyoGatewayRunner } from '@xyo-network/xl1-
|
|
4
|
+
import type { IterableMap, XyoGatewayRunner } from '@xyo-network/xl1-sdk'
|
|
5
5
|
import type { Provider, Wallet } from 'ethers'
|
|
6
6
|
|
|
7
7
|
import type { EthTxState } from './EthTxState.ts'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Hex } from '@xylabs/sdk-js'
|
|
2
2
|
import { hexToBigInt, toHex } from '@xylabs/sdk-js'
|
|
3
|
-
import type { Config } from '@xyo-network/xl1-
|
|
3
|
+
import type { Config } from '@xyo-network/xl1-sdk'
|
|
4
4
|
|
|
5
5
|
export type FeeStructure = Pick<Config['bridge'], 'feeFixed' | 'feeRateBasisPoints'>
|
|
6
6
|
|
|
@@ -2,10 +2,10 @@ import type { Hex } from '@xylabs/sdk-js'
|
|
|
2
2
|
import { hexToBigInt, toAddress } from '@xylabs/sdk-js'
|
|
3
3
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
4
4
|
import type {
|
|
5
|
-
BridgeIntent, BridgeIntentFields,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
5
|
+
BridgeIntent, BridgeIntentFields, Config,
|
|
6
|
+
Transfer,
|
|
7
|
+
} from '@xyo-network/xl1-sdk'
|
|
8
|
+
import { BridgeIntentSchema, createTransferPayload } from '@xyo-network/xl1-sdk'
|
|
9
9
|
import { v4 } from 'uuid'
|
|
10
10
|
|
|
11
11
|
import { getBridgeSettings } from '../config/index.ts'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { hexToBigInt, isUndefined } from '@xylabs/sdk-js'
|
|
2
|
-
import type {
|
|
3
|
-
|
|
2
|
+
import type {
|
|
3
|
+
BridgeIntent, Config, Transfer,
|
|
4
|
+
} from '@xyo-network/xl1-sdk'
|
|
4
5
|
|
|
5
6
|
import { getBridgeSettings } from '../config/index.ts'
|
|
6
7
|
import { calculateBridgeFees } from './calculateBridgeFees.js'
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { isUndefined } from '@xylabs/sdk-js'
|
|
2
2
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
3
|
-
import type {
|
|
4
|
-
|
|
3
|
+
import type {
|
|
4
|
+
BridgeIntent, Config, Transfer,
|
|
5
|
+
} from '@xyo-network/xl1-sdk'
|
|
5
6
|
|
|
6
7
|
import { generateBridgeEstimate } from './generateBridgeEstimate.ts'
|
|
7
8
|
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
} from '@xyo-network/boundwitness-validator'
|
|
5
5
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
6
6
|
import type {
|
|
7
|
-
BridgeIntent,
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
BridgeIntent, Config,
|
|
8
|
+
TransactionBoundWitness, Transfer,
|
|
9
|
+
} from '@xyo-network/xl1-sdk'
|
|
10
10
|
|
|
11
11
|
import { getXl1ChainId } from '../config/index.ts'
|
|
12
12
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getLocator.d.ts","sourceRoot":"","sources":["../../../src/manifest/getLocator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,MAAM,EAAE,MAAM,gBAAgB,CAAA;AASlD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAK1E,OAAO,KAAK,EACV,MAAM,EACP,MAAM,+BAA+B,CAAA;AAatC,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAU,SAAS,iBAAiB,kCAqF1D,CAAA"}
|