> For the complete documentation index, see [llms.txt](https://docs.fly.trade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fly.trade/developers/deprecated-magpie-contracts/magpieaggregator-diamond-proxy/data-transfer/libcommon.md).

# 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>
