# LibCommon

It contains an enum and structs that are used to encapsulate and pass relevant information and parameters for data transfer operations. They store details such as the data transfer protocol, transfer key, payload, and data transfer type. The specific usage and implementation of these structs would depend on the context and requirements of the data transfer system or protocol being used.

### DataTransferKey

```solidity
enum DataTransferType {
    Wormhole,
    LayerZero
}
```

### DataTransferInProtocol

```solidity
struct DataTransferInProtocol {
    uint16 networkId;
    DataTransferType dataTransferType;
    bytes payload;
}
```

<table><thead><tr><th>Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>networkId
</code></pre></td><td><pre><code>uint16
</code></pre></td><td>This field is of type <code>uint16</code> and represents the network ID of the data transfer protocol.</td></tr><tr><td><pre><code>dataTransferType
</code></pre></td><td><pre><code>DataTransferType
</code></pre></td><td>This field is of type <code>DataTransferType</code> (an enum) and represents the type of data transfer, either Wormhole or LayerZero.</td></tr><tr><td><pre><code>payload
</code></pre></td><td><pre><code>bytes
</code></pre></td><td>This field is of type <code>bytes</code> and represents the payload of the data transfer.</td></tr></tbody></table>

### DataTransferInArgs

```solidity
struct DataTransferInArgs {
    DataTransferInProtocol protocol;
    TransferKey transferKey;
    bytes payload;
}
```

<table><thead><tr><th>Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>protocol
</code></pre></td><td><pre><code>DataTransferInProtocol
</code></pre></td><td>This field is of type <code>DataTransferInProtocol</code> and represents the data transfer protocol details, including the network ID, data transfer type, and payload.</td></tr><tr><td><pre><code>transferKey
</code></pre></td><td><pre><code>TransferKey
</code></pre></td><td>This field is of type <code>TransferKey</code> and represents a transfer key associated with the data transfer.</td></tr><tr><td><pre><code>payload
</code></pre></td><td><pre><code>bytes
</code></pre></td><td>This field is of type <code>bytes</code> and represents the payload of the data transfer.</td></tr></tbody></table>

### DataTransferOutArgs

```solidity
struct DataTransferOutArgs {
    DataTransferType dataTransferType;
    bytes payload;
}
```

<table><thead><tr><th>Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>dataTransferType
</code></pre></td><td><pre><code>DataTransferType
</code></pre></td><td>This field is of type <code>DataTransferType</code> (an enum) and represents the type of data transfer, either Wormhole or LayerZero.</td></tr><tr><td><pre><code>payload
</code></pre></td><td><pre><code>bytes
</code></pre></td><td>This field is of type <code>bytes</code> and represents the payload of the data transfer.</td></tr></tbody></table>


---

# 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/developers/deprecated-magpie-contracts/magpieaggregator-diamond-proxy/data-transfer/libcommon.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.
