Skip to content

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 AssetInstance struct into bytes.
  • function encodedSizeAt(bytes data, uint256 offset) internal pure returns (uint256)
    • Returns the total number of bytes that an AssetInstance would occupy when encoded, based on the type and payload.
  • function decode(bytes data) internal pure returns (struct AssetInstance, uint256)
    • Decodes an AssetInstance struct from bytes starting at the beginning of the data.
  • function decodeAt(bytes data, uint256 offset) internal pure returns (struct AssetInstance, uint256)
    • Decodes an AssetInstance struct from bytes starting at a given offset.
  • function asIndex(struct AssetInstance assetInstance) internal pure returns (struct IndexParams)
    • Extracts the index value from an Index asset instance. Reverts if the asset instance is not of type Index or if the decoded index exceeds the maximum value for uint128.
  • function asArray4(struct AssetInstance assetInstance) internal pure returns (struct Array4Params)
    • Extracts the 4-byte data from an Array4 asset instance. Reverts if the asset instance is not of type Array4.
  • function asArray8(struct AssetInstance assetInstance) internal pure returns (struct Array8Params)
    • Extracts the 8-byte data from an Array8 asset instance. Reverts if the asset instance is not of type Array8.
  • function asArray16(struct AssetInstance assetInstance) internal pure returns (struct Array16Params)
    • Extracts the 16-byte data from an Array16 asset instance. Reverts if the asset instance is not of type Array16.
  • function asArray32(struct AssetInstance assetInstance) internal pure returns (struct Array32Params)
    • Extracts the 32-byte data from an Array32 asset instance. Reverts if the asset instance is not of type Array32.
  • function \_assertVariant(struct AssetInstance assetInstance, enum AssetInstanceVariant expected) private pure

Created with solidity-doc-generator