File: src/Xcm/v5/AssetInstance/AssetInstanceCodec.sol
AssetInstanceCodec
Kind: library
ABI Surface
Errors
error InvalidAssetInstanceLength()error InvalidAssetInstanceVariant(uint8 variant)
Function Surface
function encode(struct AssetInstance assetInstance) internal pure returns (bytes)- Encodes an
AssetInstancestruct into bytes.
- Encodes an
function encodedSizeAt(bytes data, uint256 offset) internal pure returns (uint256)- Returns the total number of bytes that an
AssetInstancewould occupy when encoded, based on the type and payload.
- Returns the total number of bytes that an
function decode(bytes data) internal pure returns (struct AssetInstance, uint256)- Decodes an
AssetInstancestruct from bytes starting at the beginning of the data.
- Decodes an
function decodeAt(bytes data, uint256 offset) internal pure returns (struct AssetInstance, uint256)- Decodes an
AssetInstancestruct from bytes starting at a given offset.
- Decodes an
function asIndex(struct AssetInstance assetInstance) internal pure returns (struct IndexParams)- Extracts the index value from an
Indexasset instance. Reverts if the asset instance is not of typeIndexor if the decoded index exceeds the maximum value foruint128.
- Extracts the index value from an
function asArray4(struct AssetInstance assetInstance) internal pure returns (struct Array4Params)- Extracts the 4-byte data from an
Array4asset instance. Reverts if the asset instance is not of typeArray4.
- Extracts the 4-byte data from an
function asArray8(struct AssetInstance assetInstance) internal pure returns (struct Array8Params)- Extracts the 8-byte data from an
Array8asset instance. Reverts if the asset instance is not of typeArray8.
- Extracts the 8-byte data from an
function asArray16(struct AssetInstance assetInstance) internal pure returns (struct Array16Params)- Extracts the 16-byte data from an
Array16asset instance. Reverts if the asset instance is not of typeArray16.
- Extracts the 16-byte data from an
function asArray32(struct AssetInstance assetInstance) internal pure returns (struct Array32Params)- Extracts the 32-byte data from an
Array32asset instance. Reverts if the asset instance is not of typeArray32.
- Extracts the 32-byte data from an
function \_assertVariant(struct AssetInstance assetInstance, enum AssetInstanceVariant expected) private pure