// SPDX-License-Identifier: MIT pragma solidity ^0.8.19; /// @title Library of types that are used for fulfillment of a Functions request library FunctionsResponse { // Used to send request information from the Router to the Coordinator struct RequestMeta { bytes data; // ══════════════════╸ CBOR encoded Chainlink Functions request // data, use FunctionsRequest library to encode a request bytes32 flags; // ═══════════════╸ Per-subscription flags address requestingContract; // ══╗ The client contract that is sending the request uint96 availableBalance; // ═════╝ Common LINK balance of the subscription that is controlled by the // Router to be used for all consumer requests. uint72 adminFee; // ═════════════╗ Flat fee (in Juels of LINK) that will be paid to the // Router Owner for operation of the network uint64 subscriptionId; // ║ Identifier of the billing subscription that will be charged for the request uint64 initiatedRequests; // ║ The number of requests that have been started uint32 callbackGasLimit; // ║ The amount of gas that the callback to the consuming contract will be given uint16 dataVersion; // ══════════╝ The version of the structure of the CBOR encoded request data uint64 completedRequests; // ════╗ The number of requests that have successfully completed or timed out address subscriptionOwner; // ═══╝ The owner of the billing subscription } enum FulfillResult { FULFILLED, // 0 USER_CALLBACK_ERROR, // 1 INVALID_REQUEST_ID, // 2 COST_EXCEEDS_COMMITMENT, // 3 INSUFFICIENT_GAS_PROVIDED, // 4 SUBSCRIPTION_BALANCE_INVARIANT_VIOLATION, // 5 INVALID_COMMITMENT // 6 } struct Commitment { bytes32 requestId; // ═════════════════╸ A unique identifier for a Chainlink Functions request address coordinator; // ═══════════════╗ The Coordinator contract that manages the DON that is servicing a request uint96 estimatedTotalCostJuels; // ════╝ The maximum cost in Juels (1e18) of LINK that will be charged to // fulfill a request address client; // ════════════════════╗ The client contract that sent the request uint64 subscriptionId; // ║ Identifier of the billing subscription that will be charged for the request uint32 callbackGasLimit; // ═══════════╝ The amount of gas that the callback to the consuming contract will be given uint72 adminFee; // ═══════════════════╗ Flat fee (in Juels of LINK) that // will be paid to the Router Owner for operation of the network uint72 donFee; // ║ Fee (in Juels of LINK) that will be split between Node Operators for // servicing a request uint40 gasOverheadBeforeCallback; // ║ Represents the average gas execution cost before the fulfillment callback. uint40 gasOverheadAfterCallback; // ║ Represents the average gas execution cost after the fulfillment callback. uint32 timeoutTimestamp; // ═══════════╝ The timestamp at which a request will be eligible to be timed out } }