import "solidity-scale-codec/src/Xcm/v5/Instruction/InstructionCodec.sol";InstructionCodec
Kind: library
Functions
function encode(struct Instruction instruction) internal pure returns (bytes)function encodedSizeAt(bytes data, uint256 offset) internal pure returns (uint256)function decode(bytes data) internal pure returns (struct Instruction, uint256)function decodeAt(bytes data, uint256 offset) internal pure returns (struct Instruction, uint256)function asTransact(struct Instruction instruction) internal pure returns (struct TransactParams)function asClearOrigin(struct Instruction instruction) internal purefunction asRefundSurplus(struct Instruction instruction) internal purefunction asClearError(struct Instruction instruction) internal purefunction asTrap(struct Instruction instruction) internal pure returns (struct TrapParams)function asUnsubscribeVersion(struct Instruction instruction) internal purefunction asBurnAsset(struct Instruction instruction) internal pure returns (struct BurnAssetParams)function asClearTransactStatus(struct Instruction instruction) internal purefunction asLockAsset(struct Instruction instruction) internal pure returns (struct LockAssetParams)function asSetTopic(struct Instruction instruction) internal pure returns (struct SetTopicParams)function asClearTopic(struct Instruction instruction) internal purefunction asPayFees(struct Instruction instruction) internal pure returns (struct PayFeesParams)function asSetHints(struct Instruction instruction) internal pure returns (struct SetHintsParams)
encode(struct Instruction instruction)
function encode(struct Instruction instruction) internal pure returns (bytes)Encodes an `Instruction` into SCALE bytes.
encodedSizeAt(bytes data, uint256 offset)
function encodedSizeAt(bytes data, uint256 offset) internal pure returns (uint256)Returns the number of bytes that an `Instruction` occupies when SCALE-encoded.
decode(bytes data)
function decode(bytes data) internal pure returns (struct Instruction, uint256)Decodes an `Instruction` from SCALE bytes starting at the beginning.
decodeAt(bytes data, uint256 offset)
function decodeAt(bytes data, uint256 offset) internal pure returns (struct Instruction, uint256)Decodes an `Instruction` from SCALE bytes starting at a given offset.
asWithdrawAsset(struct Instruction instruction)
function asWithdrawAsset(struct Instruction instruction) internal pure returns (struct WithdrawAssetParams)Extracts the decoded `WithdrawAssetParams` from a `WithdrawAsset` instruction. Reverts if the instruction is not of type `WithdrawAsset`.
asReserveAssetDeposited(struct Instruction instruction)
function asReserveAssetDeposited(struct Instruction instruction) internal pure returns (struct ReserveAssetDepositedParams)Extracts the decoded `ReserveAssetDepositedParams` from a `ReserveAssetDeposited` instruction. Reverts if the instruction is not of type `ReserveAssetDeposited`.
asReceiveTeleportedAsset(struct Instruction instruction)
function asReceiveTeleportedAsset(struct Instruction instruction) internal pure returns (struct ReceiveTeleportedAssetParams)Extracts the decoded `ReceiveTeleportedAssetParams` from a `ReceiveTeleportedAsset` instruction. Reverts if the instruction is not of type `ReceiveTeleportedAsset`.
asQueryResponse(struct Instruction instruction)
function asQueryResponse(struct Instruction instruction) internal pure returns (struct QueryResponseParams)Extracts the decoded `QueryResponseParams` from a `QueryResponse` instruction. Reverts if the instruction is not of type `QueryResponse`.
asTransferAsset(struct Instruction instruction)
function asTransferAsset(struct Instruction instruction) internal pure returns (struct TransferAssetParams)Extracts the decoded `TransferAssetParams` from a `TransferAsset` instruction. Reverts if the instruction is not of type `TransferAsset`.
asTransferReserveAsset(struct Instruction instruction)
function asTransferReserveAsset(struct Instruction instruction) internal pure returns (struct TransferReserveAssetParams)Extracts the decoded `TransferReserveAssetParams` from a `TransferReserveAsset` instruction. Reverts if the instruction is not of type `TransferReserveAsset`.
asTransact(struct Instruction instruction)
function asTransact(struct Instruction instruction) internal pure returns (struct TransactParams)Extracts the decoded `TransactParams` from a `Transact` instruction. Reverts if the instruction is not of type `Transact`.
asHrmpNewChannelOpenRequest(struct Instruction instruction)
function asHrmpNewChannelOpenRequest(struct Instruction instruction) internal pure returns (struct HrmpNewChannelOpenRequestParams)Extracts the decoded `HrmpNewChannelOpenRequestParams` from a `HrmpNewChannelOpenRequest` instruction. Reverts if the instruction is not of type `HrmpNewChannelOpenRequest`.
asHrmpChannelAccepted(struct Instruction instruction)
function asHrmpChannelAccepted(struct Instruction instruction) internal pure returns (struct HrmpChannelAcceptedParams)Extracts the decoded `HrmpChannelAcceptedParams` from a `HrmpChannelAccepted` instruction. Reverts if the instruction is not of type `HrmpChannelAccepted`.
asHrmpChannelClosing(struct Instruction instruction)
function asHrmpChannelClosing(struct Instruction instruction) internal pure returns (struct HrmpChannelClosingParams)Extracts the decoded `HrmpChannelClosingParams` from a `HrmpChannelClosing` instruction. Reverts if the instruction is not of type `HrmpChannelClosing`.
asClearOrigin(struct Instruction instruction)
function asClearOrigin(struct Instruction instruction) internal pureValidates a `ClearOrigin` instruction payload. Reverts if the instruction is not of type `ClearOrigin` or the payload is invalid.
asDescendOrigin(struct Instruction instruction)
function asDescendOrigin(struct Instruction instruction) internal pure returns (struct DescendOriginParams)Extracts the decoded `DescendOriginParams` from a `DescendOrigin` instruction. Reverts if the instruction is not of type `DescendOrigin`.
asReportError(struct Instruction instruction)
function asReportError(struct Instruction instruction) internal pure returns (struct ReportErrorParams)Extracts the decoded `ReportErrorParams` from a `ReportError` instruction. Reverts if the instruction is not of type `ReportError`.
asDepositAsset(struct Instruction instruction)
function asDepositAsset(struct Instruction instruction) internal pure returns (struct DepositAssetParams)Extracts the decoded `DepositAssetParams` from a `DepositAsset` instruction. Reverts if the instruction is not of type `DepositAsset`.
asDepositReserveAsset(struct Instruction instruction)
function asDepositReserveAsset(struct Instruction instruction) internal pure returns (struct DepositReserveAssetParams)Extracts the decoded `DepositReserveAssetParams` from a `DepositReserveAsset` instruction. Reverts if the instruction is not of type `DepositReserveAsset`.
asExchangeAsset(struct Instruction instruction)
function asExchangeAsset(struct Instruction instruction) internal pure returns (struct ExchangeAssetParams)Extracts the decoded `ExchangeAssetParams` from a `ExchangeAsset` instruction. Reverts if the instruction is not of type `ExchangeAsset`.
asInitiateReserveWithdraw(struct Instruction instruction)
function asInitiateReserveWithdraw(struct Instruction instruction) internal pure returns (struct InitiateReserveWithdrawParams)Extracts the decoded `InitiateReserveWithdrawParams` from a `InitiateReserveWithdraw` instruction. Reverts if the instruction is not of type `InitiateReserveWithdraw`.
asInitiateTeleport(struct Instruction instruction)
function asInitiateTeleport(struct Instruction instruction) internal pure returns (struct InitiateTeleportParams)Extracts the decoded `InitiateTeleportParams` from a `InitiateTeleport` instruction. Reverts if the instruction is not of type `InitiateTeleport`.
asReportHolding(struct Instruction instruction)
function asReportHolding(struct Instruction instruction) internal pure returns (struct ReportHoldingParams)Extracts the decoded `ReportHoldingParams` from a `ReportHolding` instruction. Reverts if the instruction is not of type `ReportHolding`.
asBuyExecution(struct Instruction instruction)
function asBuyExecution(struct Instruction instruction) internal pure returns (struct BuyExecutionParams)Extracts the decoded `BuyExecutionParams` from a `BuyExecution` instruction. Reverts if the instruction is not of type `BuyExecution`.
asRefundSurplus(struct Instruction instruction)
function asRefundSurplus(struct Instruction instruction) internal pureValidates a `RefundSurplus` instruction payload. Reverts if the instruction is not of type `RefundSurplus` or the payload is invalid.
asSetErrorHandler(struct Instruction instruction)
function asSetErrorHandler(struct Instruction instruction) internal pure returns (struct SetErrorHandlerParams)Extracts the decoded `SetErrorHandlerParams` from a `SetErrorHandler` instruction. Reverts if the instruction is not of type `SetErrorHandler`.
asSetAppendix(struct Instruction instruction)
function asSetAppendix(struct Instruction instruction) internal pure returns (struct SetAppendixParams)Extracts the decoded `SetAppendixParams` from a `SetAppendix` instruction. Reverts if the instruction is not of type `SetAppendix`.
asClearError(struct Instruction instruction)
function asClearError(struct Instruction instruction) internal pureValidates a `ClearError` instruction payload. Reverts if the instruction is not of type `ClearError` or the payload is invalid.
asClaimAsset(struct Instruction instruction)
function asClaimAsset(struct Instruction instruction) internal pure returns (struct ClaimAssetParams)Extracts the decoded `ClaimAssetParams` from a `ClaimAsset` instruction. Reverts if the instruction is not of type `ClaimAsset`.
asTrap(struct Instruction instruction)
function asTrap(struct Instruction instruction) internal pure returns (struct TrapParams)Extracts the decoded `TrapParams` from a `Trap` instruction. Reverts if the instruction is not of type `Trap`.
asSubscribeVersion(struct Instruction instruction)
function asSubscribeVersion(struct Instruction instruction) internal pure returns (struct SubscribeVersionParams)Extracts the decoded `SubscribeVersionParams` from a `SubscribeVersion` instruction. Reverts if the instruction is not of type `SubscribeVersion`.
asUnsubscribeVersion(struct Instruction instruction)
function asUnsubscribeVersion(struct Instruction instruction) internal pureValidates a `UnsubscribeVersion` instruction payload. Reverts if the instruction is not of type `UnsubscribeVersion` or the payload is invalid.
asBurnAsset(struct Instruction instruction)
function asBurnAsset(struct Instruction instruction) internal pure returns (struct BurnAssetParams)Extracts the decoded `BurnAssetParams` from a `BurnAsset` instruction. Reverts if the instruction is not of type `BurnAsset`.
asExpectAsset(struct Instruction instruction)
function asExpectAsset(struct Instruction instruction) internal pure returns (struct ExpectAssetParams)Extracts the decoded `ExpectAssetParams` from a `ExpectAsset` instruction. Reverts if the instruction is not of type `ExpectAsset`.
asExpectOrigin(struct Instruction instruction)
function asExpectOrigin(struct Instruction instruction) internal pure returns (struct ExpectOriginParams)Extracts the decoded `ExpectOriginParams` from a `ExpectOrigin` instruction. Reverts if the instruction is not of type `ExpectOrigin`.
asExpectError(struct Instruction instruction)
function asExpectError(struct Instruction instruction) internal pure returns (struct ExpectErrorParams)Extracts the decoded `ExpectErrorParams` from a `ExpectError` instruction. Reverts if the instruction is not of type `ExpectError`.
asExpectTransactStatus(struct Instruction instruction)
function asExpectTransactStatus(struct Instruction instruction) internal pure returns (struct ExpectTransactStatusParams)Extracts the decoded `ExpectTransactStatusParams` from a `ExpectTransactStatus` instruction. Reverts if the instruction is not of type `ExpectTransactStatus`.
asQueryPallet(struct Instruction instruction)
function asQueryPallet(struct Instruction instruction) internal pure returns (struct QueryPalletParams)Extracts the decoded `QueryPalletParams` from a `QueryPallet` instruction. Reverts if the instruction is not of type `QueryPallet`.
asExpectPallet(struct Instruction instruction)
function asExpectPallet(struct Instruction instruction) internal pure returns (struct ExpectPalletParams)Extracts the decoded `ExpectPalletParams` from a `ExpectPallet` instruction. Reverts if the instruction is not of type `ExpectPallet`.
asReportTransactStatus(struct Instruction instruction)
function asReportTransactStatus(struct Instruction instruction) internal pure returns (struct ReportTransactStatusParams)Extracts the decoded `ReportTransactStatusParams` from a `ReportTransactStatus` instruction. Reverts if the instruction is not of type `ReportTransactStatus`.
asClearTransactStatus(struct Instruction instruction)
function asClearTransactStatus(struct Instruction instruction) internal pureValidates a `ClearTransactStatus` instruction payload. Reverts if the instruction is not of type `ClearTransactStatus` or the payload is invalid.
asUniversalOrigin(struct Instruction instruction)
function asUniversalOrigin(struct Instruction instruction) internal pure returns (struct UniversalOriginParams)Extracts the decoded `UniversalOriginParams` from a `UniversalOrigin` instruction. Reverts if the instruction is not of type `UniversalOrigin`.
asExportMessage(struct Instruction instruction)
function asExportMessage(struct Instruction instruction) internal pure returns (struct ExportMessageParams)Extracts the decoded `ExportMessageParams` from a `ExportMessage` instruction. Reverts if the instruction is not of type `ExportMessage`.
asLockAsset(struct Instruction instruction)
function asLockAsset(struct Instruction instruction) internal pure returns (struct LockAssetParams)Extracts the decoded `LockAssetParams` from a `LockAsset` instruction. Reverts if the instruction is not of type `LockAsset`.
asUnlockAsset(struct Instruction instruction)
function asUnlockAsset(struct Instruction instruction) internal pure returns (struct UnlockAssetParams)Extracts the decoded `UnlockAssetParams` from a `UnlockAsset` instruction. Reverts if the instruction is not of type `UnlockAsset`.
asNoteUnlockable(struct Instruction instruction)
function asNoteUnlockable(struct Instruction instruction) internal pure returns (struct NoteUnlockableParams)Extracts the decoded `NoteUnlockableParams` from a `NoteUnlockable` instruction. Reverts if the instruction is not of type `NoteUnlockable`.
asRequestUnlock(struct Instruction instruction)
function asRequestUnlock(struct Instruction instruction) internal pure returns (struct RequestUnlockParams)Extracts the decoded `RequestUnlockParams` from a `RequestUnlock` instruction. Reverts if the instruction is not of type `RequestUnlock`.
asSetFeesMode(struct Instruction instruction)
function asSetFeesMode(struct Instruction instruction) internal pure returns (struct SetFeesModeParams)Extracts the decoded `SetFeesModeParams` from a `SetFeesMode` instruction. Reverts if the instruction is not of type `SetFeesMode`.
asSetTopic(struct Instruction instruction)
function asSetTopic(struct Instruction instruction) internal pure returns (struct SetTopicParams)Extracts the decoded `SetTopicParams` from a `SetTopic` instruction. Reverts if the instruction is not of type `SetTopic`.
asClearTopic(struct Instruction instruction)
function asClearTopic(struct Instruction instruction) internal pureValidates a `ClearTopic` instruction payload. Reverts if the instruction is not of type `ClearTopic` or the payload is invalid.
asAliasOrigin(struct Instruction instruction)
function asAliasOrigin(struct Instruction instruction) internal pure returns (struct AliasOriginParams)Extracts the decoded `AliasOriginParams` from a `AliasOrigin` instruction. Reverts if the instruction is not of type `AliasOrigin`.
asUnpaidExecution(struct Instruction instruction)
function asUnpaidExecution(struct Instruction instruction) internal pure returns (struct UnpaidExecutionParams)Extracts the decoded `UnpaidExecutionParams` from a `UnpaidExecution` instruction. Reverts if the instruction is not of type `UnpaidExecution`.
asPayFees(struct Instruction instruction)
function asPayFees(struct Instruction instruction) internal pure returns (struct PayFeesParams)Extracts the decoded `PayFeesParams` from a `PayFees` instruction. Reverts if the instruction is not of type `PayFees`.
asInitiateTransfer(struct Instruction instruction)
function asInitiateTransfer(struct Instruction instruction) internal pure returns (struct InitiateTransferParams)Extracts the decoded `InitiateTransferParams` from a `InitiateTransfer` instruction. Reverts if the instruction is not of type `InitiateTransfer`.
asExecuteWithOrigin(struct Instruction instruction)
function asExecuteWithOrigin(struct Instruction instruction) internal pure returns (struct ExecuteWithOriginParams)Extracts the decoded `ExecuteWithOriginParams` from a `ExecuteWithOrigin` instruction. Reverts if the instruction is not of type `ExecuteWithOrigin`.
asSetHints(struct Instruction instruction)
function asSetHints(struct Instruction instruction) internal pure returns (struct SetHintsParams)Extracts the decoded `SetHintsParams` from a `SetHints` instruction. Reverts if the instruction is not of type `SetHints`.