# Interface - IBridge

```solidity
// SPDX-License-Identifier: MIT
pragma solidity 0.8.22;

import {IMessageBus} from "../../interfaces/celer/IMessageBus.sol";
import {StargateSettings, WormholeBridgeSettings, CelerBridgeSettings} from "../../libraries/LibMagpieAggregator.sol";
import {TransferKey} from "../../libraries/LibTransferKey.sol";
import {BridgeInArgs, BridgeOutArgs, RefundArgs} from "../LibCommon.sol";

interface IBridge {
    event UpdateStargateSettings(address indexed sender, StargateSettings stargateSettings);

    /// @dev Allows the contract owner to update the settings required for interaction with stargate.
    /// @param stargateSettings Stargate related parameters.
    function updateStargateSettings(StargateSettings calldata stargateSettings) external;

    event UpdateWormholeBridgeSettings(address indexed sender, WormholeBridgeSettings wormholeBridgeSettings);

    /// @dev Allows the contract owner to update the settings required for interaction with wormhole
    /// @param wormholeBridgeSettings Wormhole bridge related parameters.
    function updateWormholeBridgeSettings(WormholeBridgeSettings calldata wormholeBridgeSettings) external;

    event AddCelerChainIds(address indexed sender, uint16[] networkIds, uint64[] chainIds);

    /// @dev Allows the contract owner to add Celer chain ids to the corresponding magpie network ids.
    /// @param networkIds An array containing identifiers for Magpie networks.
    /// @param chainIds An array containing chain identifiers corresponding to the network ids.
    function addCelerChainIds(uint16[] calldata networkIds, uint64[] calldata chainIds) external;

    event UpdateCelerBridgeSettings(address indexed sender, CelerBridgeSettings celerBridgeSettings);

    /// @dev Allows the contract owner to updates the Celer bridge settings.
    /// @param celerBridgeSettings Celer bridge related parameters.
    function updateCelerBridgeSettings(CelerBridgeSettings calldata celerBridgeSettings) external;

    event AddMagpieStargateBridgeAddresses(
        address indexed sender,
        uint16[] networkIds,
        bytes32[] magpieStargateBridgeAddresses
    );

    /// @dev Allows the contract owner to add Magpie stargate bridge address to its corresponding network id.
    /// @param networkIds An array containing identifiers for Magpie networks.
    /// @param magpieStargateBridgeAddresses An array containing addresses of Magpie stargate bridge corresponding to the network ids.
    function addMagpieStargateBridgeAddresses(
        uint16[] calldata networkIds,
        bytes32[] calldata magpieStargateBridgeAddresses
    ) external;

    event AddMagpieStargateBridgeV2Addresses(
        address indexed sender,
        uint16[] networkIds,
        bytes32[] magpieStargateBridgeAddresses
    );

    /// @dev Allows the contract owner to add Magpie stargate bridge V2 address to its corresponding network id.
    /// @param networkIds An array containing identifiers for Magpie networks.
    /// @param magpieStargateBridgeAddresses An array containing addresses of Magpie stargate bridge V2 corresponding to the network ids.
    function addMagpieStargateBridgeV2Addresses(
        uint16[] calldata networkIds,
        bytes32[] calldata magpieStargateBridgeAddresses
    ) external;

    event AddMagpieCelerBridgeAddresses(
        address indexed sender,
        uint16[] networkIds,
        bytes32[] magpieCelerBridgeAddresses
    );

    /// @dev Allows the contract owner to add Magpie Celer bridge addresses.
    /// @param networkIds An array containing identifiers for Magpie networks.
    /// @param magpieCelerBridgeAddresses An array containing Magpie celer bridge addresses corresponding to the networks in networkIds.
    function addMagpieCelerBridgeAddresses(
        uint16[] calldata networkIds,
        bytes32[] calldata magpieCelerBridgeAddresses
    ) external;

    /// @dev Deposits assets to the specified bridge.
    /// @param bridgeInArgs Arguments that are required for bridgeIn.
    function bridgeIn(BridgeInArgs calldata bridgeInArgs) external payable;

    /// @dev Withdraws assets from the specified bridge.
    /// @param bridgeOutArgs Arguments that are required for bridgeOut.
    function bridgeOut(BridgeOutArgs calldata bridgeOutArgs) external payable returns (uint256 amount);

    /// @dev Retrieves the Wormhole token sequence
    /// @param tokenSequence The token sequence that is generated by Magpie protocol for the specific crosschain swap.
    /// @return Value of the Wormhole token sequence.
    function getWormholeTokenSequence(uint64 tokenSequence) external view returns (uint64);
}
```

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fly.trade/flycn/developers/deprecated-magpie-contracts/magpieaggregator-diamond-proxy/bridge/interface-ibridge.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
