// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

interface INoteKeeper {
    error OnlyAuthorized();
    error NoteNotFound(address from, uint256 index);
    error TransferNotFound(address from, uint256 index);
    error AlreadyRedeemed(address from, uint256 index);
    error IncompleteRedeemPayout();

    struct Note {
        uint256 payout;
        uint48 created;
        uint48 matured;
        uint48 redeemed;
        uint48 marketId;
    }

    function redeem(
        address _user,
        bool _sendGhst,
        uint256[] memory _indexes
    ) external returns (uint256);

    function forceRedeem(
        bytes32 _receiver,
        uint256[] memory _indexes
    ) external returns (uint256);

    function redeemAll(address _user, bool _sendGhst) external returns (uint256);
    function forceRedeemAll(bytes32 _receiver) external returns (uint256);
    function pushNote(address to, uint256 index) external;
    function pullNote(address from, uint256 index) external returns (uint256 newIndex_);
    function indexesFor(address _user) external view returns (uint256[] memory);
    function pendingFor(address _user, uint256 _index) external view returns (uint256 payout_, bool matured_);
}
