Skip to content
solidity
import "solidity-scale-codec/src/Xcm/v5/BodyId/BodyIdCodec.sol";

BodyIdCodec

Kind: library

Functions

encode(struct BodyId bodyId)

solidity
function encode(struct BodyId bodyId) internal pure returns (bytes)

Encodes a `BodyId` into bytes.

encodedSizeAt(bytes data, uint256 offset)

solidity
function encodedSizeAt(bytes data, uint256 offset) internal pure returns (uint256)

Returns the number of bytes that a `BodyId` struct would occupy when SCALE-encoded, starting at a given offset in the data.

decode(bytes data)

solidity
function decode(bytes data) internal pure returns (struct BodyId, uint256)

Decodes a `BodyId` from bytes starting at the beginning of the data.

decodeAt(bytes data, uint256 offset)

solidity
function decodeAt(bytes data, uint256 offset) internal pure returns (struct BodyId, uint256)

Decodes a `BodyId` from bytes starting at a given offset.

asMoniker(struct BodyId bodyId)

solidity
function asMoniker(struct BodyId bodyId) internal pure returns (struct MonikerParams)

Helper function to decode a `BodyId` and extract the moniker name if the type is `Moniker`.

asIndex(struct BodyId bodyId)

solidity
function asIndex(struct BodyId bodyId) internal pure returns (struct BodyIndexParams)

Helper function to decode a `BodyId` and extract the index if the type is `Index`.