// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import "./FunctionsBillingRegistryInterface.sol"; /** * @title Chainlink Functions oracle interface. */ interface FunctionsOracleInterface { /** * @notice Gets the stored billing registry address * @return registryAddress The address of Chainlink Functions billing registry contract */ function getRegistry() external view returns (address); /** * @notice Sets the stored billing registry address * @param registryAddress The new address of Chainlink Functions billing registry contract */ function setRegistry(address registryAddress) external; /** * @notice Returns the DON's secp256k1 public key that is used to encrypt secrets * @dev All nodes on the DON have the corresponding private key * needed to decrypt the secrets encrypted with the public key * @return publicKey the DON's public key */ function getDONPublicKey() external view returns (bytes memory); /** * @notice Sets DON's secp256k1 public key used to encrypt secrets * @dev Used to rotate the key * @param donPublicKey The new public key */ function setDONPublicKey(bytes calldata donPublicKey) external; /** * @notice Sets a per-node secp256k1 public key used to encrypt secrets for that node * @dev Callable only by contract owner and DON members * @param node node's address * @param publicKey node's public key */ function setNodePublicKey(address node, bytes calldata publicKey) external; /** * @notice Deletes node's public key * @dev Callable only by contract owner or the node itself * @param node node's address */ function deleteNodePublicKey(address node) external; /** * @notice Return two arrays of equal size containing DON members' addresses and their corresponding * public keys (or empty byte arrays if per-node key is not defined) */ function getAllNodePublicKeys() external view returns (address[] memory, bytes[] memory); /** * @notice Determine the fee charged by the DON that will be split between signing Node Operators for servicing the request * @param data Encoded Chainlink Functions request data, use FunctionsClient API to encode a request * @param billing The request's billing configuration * @return fee Cost in Juels (1e18) of LINK */ function getRequiredFee(bytes calldata data, FunctionsBillingRegistryInterface.RequestBilling calldata billing) external view returns (uint96); /** * @notice Estimate the total cost that will be charged to a subscription to make a request: gas re-imbursement, plus DON fee, plus Registry fee * @param subscriptionId A unique subscription ID allocated by billing system, * a client can make requests from different contracts referencing the same subscription * @param data Encoded Chainlink Functions request data, use FunctionsClient API to encode a request * @param gasLimit Gas limit for the fulfillment callback * @return billedCost Cost in Juels (1e18) of LINK */ function estimateCost( uint64 subscriptionId, bytes calldata data, uint32 gasLimit, uint256 gasPrice ) external view returns (uint96); /** * @notice Sends a request (encoded as data) using the provided subscriptionId * @param subscriptionId A unique subscription ID allocated by billing system, * a client can make requests from different contracts referencing the same subscription * @param data Encoded Chainlink Functions request data, use FunctionsClient API to encode a request * @param gasLimit Gas limit for the fulfillment callback * @return requestId A unique request identifier (unique per DON) */ function sendRequest( uint64 subscriptionId, bytes calldata data, uint32 gasLimit ) external returns (bytes32); }