import "solidity-scale-codec/src/Xcm/v5/AssetInstance/AssetInstanceCodec.sol";AssetInstanceCodec
Kind: library
Functions
function encode(struct AssetInstance assetInstance) internal pure returns (bytes)function encodedSizeAt(bytes data, uint256 offset) internal pure returns (uint256)function decode(bytes data) internal pure returns (struct AssetInstance, uint256)function decodeAt(bytes data, uint256 offset) internal pure returns (struct AssetInstance, uint256)function asIndex(struct AssetInstance assetInstance) internal pure returns (struct IndexParams)function asArray4(struct AssetInstance assetInstance) internal pure returns (struct Array4Params)function asArray8(struct AssetInstance assetInstance) internal pure returns (struct Array8Params)function asArray16(struct AssetInstance assetInstance) internal pure returns (struct Array16Params)function asArray32(struct AssetInstance assetInstance) internal pure returns (struct Array32Params)
encode(struct AssetInstance assetInstance)
function encode(struct AssetInstance assetInstance) internal pure returns (bytes)Encodes an `AssetInstance` struct into bytes.
encodedSizeAt(bytes data, uint256 offset)
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.
decode(bytes data)
function decode(bytes data) internal pure returns (struct AssetInstance, uint256)Decodes an `AssetInstance` struct from bytes starting at the beginning of the data.
decodeAt(bytes data, uint256 offset)
function decodeAt(bytes data, uint256 offset) internal pure returns (struct AssetInstance, uint256)Decodes an `AssetInstance` struct from bytes starting at a given offset.
asIndex(struct AssetInstance assetInstance)
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`.
asArray4(struct AssetInstance assetInstance)
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`.
asArray8(struct AssetInstance assetInstance)
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`.
asArray16(struct AssetInstance assetInstance)
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`.
asArray32(struct AssetInstance assetInstance)
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`.