Skip to content

InputLibrary

State Variables

INPUT_TYPE

string constant INPUT_TYPE = "Input(uint8 inputType,bytes data)";

INPUT_TYPEHASH

bytes32 constant INPUT_TYPEHASH = keccak256(bytes(INPUT_TYPE));

Functions

createInlineInput

Creates an inline input.

function createInlineInput(bytes memory inlineData) internal pure returns (Input memory);
Parameters
NameTypeDescription
inlineDatabytesThe data for the inline input.
Returns
NameTypeDescription
<none>InputAn Input struct with type Inline and the provided data.

createUrlInput

Creates a URL input.

function createUrlInput(string memory url) internal pure returns (Input memory);
Parameters
NameTypeDescription
urlstringThe URL for the input.
Returns
NameTypeDescription
<none>InputAn Input struct with type Url and the provided URL as data.

eip712Digest

Computes the EIP-712 digest for the given input.

function eip712Digest(Input memory input) internal pure returns (bytes32);
Parameters
NameTypeDescription
inputInputThe input to compute the digest for.
Returns
NameTypeDescription
<none>bytes32The EIP-712 digest of the input.