@xyo-network/chain-bridge 1.19.7 → 1.19.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@ var connection;
14
14
  var maxRetriesPerRequest = null;
15
15
  var getConnection = /* @__PURE__ */ __name((config) => {
16
16
  if (isDefined(connection)) return connection;
17
- const { redisHost: host, redisPort: port } = config.bridge;
17
+ const { redisHost: host, redisPort: port } = config.actors.bridge;
18
18
  connection = new Redis({
19
19
  host,
20
20
  port,
@@ -493,20 +493,20 @@ var asToken = /* @__PURE__ */ __name((value) => {
493
493
  // src/config/getBridgeEscrowAddress.ts
494
494
  import { asAddress as asAddress2, assertEx as assertEx8 } from "@xylabs/sdk-js";
495
495
  var tryGetBridgeEscrowAddress = /* @__PURE__ */ __name((config) => {
496
- const address = asAddress2(config.bridge.escrowAddress);
496
+ const address = asAddress2(config.actors.bridge.escrowAddress);
497
497
  return address;
498
498
  }, "tryGetBridgeEscrowAddress");
499
499
 
500
500
  // src/config/getBridgeFeesAddress.ts
501
501
  import { asAddress as asAddress3, assertEx as assertEx9 } from "@xylabs/sdk-js";
502
502
  var tryGetBridgeFeesAddress = /* @__PURE__ */ __name((config) => {
503
- const address = asAddress3(config.bridge.feesAddress);
503
+ const address = asAddress3(config.actors.bridge.feesAddress);
504
504
  return address;
505
505
  }, "tryGetBridgeFeesAddress");
506
506
 
507
507
  // src/config/getFeeStructure.ts
508
508
  var getFeeStructure = /* @__PURE__ */ __name((config) => {
509
- const { feeFixed, feeRateBasisPoints } = config.bridge;
509
+ const { feeFixed, feeRateBasisPoints } = config.actors.bridge;
510
510
  return {
511
511
  feeFixed,
512
512
  feeRateBasisPoints
@@ -515,27 +515,27 @@ var getFeeStructure = /* @__PURE__ */ __name((config) => {
515
515
 
516
516
  // src/config/getMaxBridgeAmount.ts
517
517
  var getMaxBridgeAmount = /* @__PURE__ */ __name((config) => {
518
- const { maxBridgeAmount } = config.bridge;
518
+ const { maxBridgeAmount } = config.actors.bridge;
519
519
  return maxBridgeAmount;
520
520
  }, "getMaxBridgeAmount");
521
521
 
522
522
  // src/config/getMinBridgeAmount.ts
523
523
  var getMinBridgeAmount = /* @__PURE__ */ __name((config) => {
524
- const { minBridgeAmount } = config.bridge;
524
+ const { minBridgeAmount } = config.actors.bridge;
525
525
  return minBridgeAmount;
526
526
  }, "getMinBridgeAmount");
527
527
 
528
528
  // src/config/getRemoteChainId.ts
529
529
  import { assertEx as assertEx10 } from "@xylabs/sdk-js";
530
530
  var getRemoteChainId = /* @__PURE__ */ __name((config) => {
531
- const remoteChainId = assertEx10(asChainId(config.bridge.remoteChainId), () => "Invalid remote chain ID in config");
531
+ const remoteChainId = assertEx10(asChainId(config.actors.bridge.remoteChainId), () => "Invalid remote chain ID in config");
532
532
  return remoteChainId;
533
533
  }, "getRemoteChainId");
534
534
 
535
535
  // src/config/getRemoteTokenAddress.ts
536
536
  import { assertEx as assertEx11 } from "@xylabs/sdk-js";
537
537
  var getRemoteTokenAddress = /* @__PURE__ */ __name((config) => {
538
- const token = asToken(config.bridge.remoteTokenAddress);
538
+ const token = asToken(config.actors.bridge.remoteTokenAddress);
539
539
  return assertEx11(token, () => "Remote token address is not defined in bridge configuration");
540
540
  }, "getRemoteTokenAddress");
541
541
 
@@ -546,7 +546,7 @@ import { ADDRESS_INDEX, generateXyoBaseWalletFromPhrase } from "@xyo-network/xl1
546
546
  var accountServiceSingleton;
547
547
  var getBridgeWalletAccount = /* @__PURE__ */ __name(async (config) => {
548
548
  if (accountServiceSingleton) return accountServiceSingleton;
549
- let walletPhrase = config.bridge.mnemonic;
549
+ let walletPhrase = config.actors.bridge.mnemonic;
550
550
  if (isUndefined(walletPhrase)) {
551
551
  console.log("[Bridge] No wallet mnemonic specified!");
552
552
  const randomMnemonic = HDWallet.generateMnemonic();
@@ -576,7 +576,7 @@ var getTransferAddresses = /* @__PURE__ */ __name(async (config) => {
576
576
  // src/config/getXl1ChainId.ts
577
577
  import { assertEx as assertEx12, isDefined as isDefined7 } from "@xylabs/sdk-js";
578
578
  var getXl1ChainId = /* @__PURE__ */ __name((config) => {
579
- const xl1ChainId = config.bridge.xl1ChainId;
579
+ const xl1ChainId = config.actors.bridge.xl1ChainId;
580
580
  if (isDefined7(xl1ChainId)) {
581
581
  return assertEx12(asChainId(xl1ChainId), () => "Invalid xl1ChainId in bridge config");
582
582
  }
@@ -586,7 +586,7 @@ var getXl1ChainId = /* @__PURE__ */ __name((config) => {
586
586
  // src/config/getXl1TokenAddress.ts
587
587
  import { isDefined as isDefined8 } from "@xylabs/sdk-js";
588
588
  var getXl1TokenAddress = /* @__PURE__ */ __name((config) => {
589
- const token = asToken(config.bridge.xl1TokenAddress);
589
+ const token = asToken(config.actors.bridge.xl1TokenAddress);
590
590
  if (isDefined8(token)) return token;
591
591
  return getXl1ChainId(config);
592
592
  }, "getXl1TokenAddress");
@@ -622,7 +622,7 @@ import { ADDRESS_INDEX as ADDRESS_INDEX2, buildJsonRpcProviderLocator, generateX
622
622
  var gatewayInstance;
623
623
  var getGateway = /* @__PURE__ */ __name(async (config) => {
624
624
  if (isDefined9(gatewayInstance)) return gatewayInstance;
625
- const { mnemonic, chainRpcApiUrl: endpoint } = config.bridge;
625
+ const { mnemonic, chainRpcApiUrl: endpoint } = config.actors.bridge;
626
626
  const walletPhrase = isDefined9(mnemonic) ? mnemonic : HDWallet2.generateMnemonic();
627
627
  const wallet = await generateXyoBaseWalletFromPhrase2(walletPhrase);
628
628
  const signerAccount = await wallet.derivePath(ADDRESS_INDEX2.XYO);
@@ -1434,7 +1434,7 @@ var getModuleLocator = /* @__PURE__ */ __name(async (context) => {
1434
1434
  const provider = await initEvmProvider({
1435
1435
  config
1436
1436
  });
1437
- const bridgeAddress = config.bridge.remoteBridgeContractAddress;
1437
+ const bridgeAddress = config.actors.bridge.remoteBridgeContractAddress;
1438
1438
  const evmLiquidityBridgeTransactionCompletionMonitorSentinelParams = {
1439
1439
  bridgeAddress,
1440
1440
  completedTransactions: completedEthXl1BridgeTransactions,
@@ -1507,7 +1507,7 @@ var NodeManifest = node_default;
1507
1507
  // src/manifest/getNode.ts
1508
1508
  var getNode = /* @__PURE__ */ __name(async (context) => {
1509
1509
  const { config, wallet } = context;
1510
- const { chainRpcApiUrl: endpoint } = config.bridge;
1510
+ const { chainRpcApiUrl: endpoint } = config.actors.bridge;
1511
1511
  const transportFactory = /* @__PURE__ */ __name((schemas) => new HttpRpcTransport2(endpoint, schemas), "transportFactory");
1512
1512
  const signerAccount = await getBridgeWalletAccount(config);
1513
1513
  const locator = await buildJsonRpcProviderLocator2({
@@ -1575,7 +1575,7 @@ var getServices = /* @__PURE__ */ __name(async (context) => {
1575
1575
  const provider = await initEvmProvider2({
1576
1576
  config
1577
1577
  });
1578
- const { remoteBridgeContractAddress, remoteChainWalletPrivateKey, remoteTokenAddress, mnemonic } = config.bridge;
1578
+ const { remoteBridgeContractAddress, remoteChainWalletPrivateKey, remoteTokenAddress, mnemonic } = config.actors.bridge;
1579
1579
  const account = isDefined14(mnemonic) ? await HDWallet3.fromPhrase(mnemonic) : await HDWallet3.random();
1580
1580
  const wallet = new Wallet2(remoteChainWalletPrivateKey, provider);
1581
1581
  const bridgeableToken = BridgeableToken__factory.connect(getAddress3(remoteTokenAddress), wallet);
@@ -1605,7 +1605,7 @@ var hostname = "::";
1605
1605
  var getSeedPhrase = /* @__PURE__ */ __name(async (bios, config, logger) => {
1606
1606
  const storedSeedPhrase = await bios.seedPhraseStore.get("os");
1607
1607
  logger?.debug(`[Bridge] Stored mnemonic: ${storedSeedPhrase}`);
1608
- const { mnemonic } = config.api;
1608
+ const { mnemonic } = config.actors.api;
1609
1609
  if (isString(storedSeedPhrase) && isString(mnemonic)) {
1610
1610
  logger?.warn("[Bridge] Stored mnemonic does not match supplied. Updating stored mnemonic to supplied.");
1611
1611
  await bios.seedPhraseStore.set("os", mnemonic);
@@ -1624,7 +1624,7 @@ var getSeedPhrase = /* @__PURE__ */ __name(async (bios, config, logger) => {
1624
1624
  }, "getSeedPhrase");
1625
1625
  var getServer = /* @__PURE__ */ __name(async (context) => {
1626
1626
  const { logger, config } = context;
1627
- const { port, mnemonic } = config.bridge;
1627
+ const { port, mnemonic } = config.actors.bridge;
1628
1628
  const bios = await boot();
1629
1629
  const seedPhrase = isDefined15(mnemonic) ? mnemonic : await getSeedPhrase(bios, config, logger);
1630
1630
  const wallet = await HDWallet4.fromPhrase(seedPhrase);