SingleIdentifierID

ISingleIdentifierRegistry

interface ISingleIdentifierID {
    /// @notice Emitter data in registry
    /// @param emitterId - Id of that emitter
    /// @param schemaId - Id of schema used by that emitter
    /// @param expirationDate - Timestamp when emitter becomes invalid
    /// @param fee - Fees for creating and updating SIDs
    /// @param registryChainId - Id of the chain where the registry is deployed
    /// @param owner - Address that can act as that emitter
    struct Emitter {
        bytes32 emitterId;
        bytes32 schemaId;
        uint64 expirationDate;
        uint256 fee;
        uint256 registryChainId;
        address owner;
    }
    
    /// @notice Emitters data
    function emitters(bytes32 emitterId) external view returns(Emitter);

    /// @notice Sum of all fees charged by emitter in contract balance
    function emittersBalances(bytes32 emitterId) external view returns(uint256);

    /// @notice Checks signature and sends SID registering message
    /// @param _emitterId - Id of emitter that should be used for registering SID
    /// @param _connectorId - Id of connector that should be used for sending registering message
    /// @param _data - Data that would be sent with registering message
    /// @param _signature - Operators signature with RegisterParams
    /// @param _metadata - Metadata that would be sent with registering message
    function registerSID(
        bytes32 _emitterId,
        uint32 _connectorId,
        bytes calldata _data,
        bytes calldata _signature,
        string calldata _metadata
    ) external payable checkEmitter(_emitterId);

    /// @notice Checks signature and sends SID update message
    /// @param _emitterId - Id of emitter that should be used for updating SID
    /// @param _connectorId - Id of connector that should be used for sending updating message
    /// @param _sidId - Id of SID that should be updated
    /// @param _expirationDate - Timestamp when SID expires
    /// @param _data - Data that would be sent with updating message
    /// @param _metadata - Metadata that would be sent with updating message
    /// @param _signature - Operators signature with RegistryEmitterParams
    function updateSID(
        bytes32 _emitterId,
        uint32 _connectorId,
        bytes32 _sidId,
        uint64 _expirationDate,
        bytes calldata _data,
        string calldata _metadata,
        bytes memory _signature
    ) external payable checkEmitter(_emitterId);

    /// @notice Updates fee for emitter
    /// @param _emitterId - Id of emitter that should be updated
    /// @param _registeringFee - New fee for registering SID
    /// @param _updatingFee - New fee for updating SID
    function updateFee(bytes32 _emitterId, uint256 _registeringFee, uint256 _updatingFee) external;

    /// @notice Sends fees collected by emitter to specified address
    /// @param _emitterId - Id of emitter whose fees should be withdrawn
    /// @param _receiver - Address where fees should be sent, can't be 0x0
    function withdraw(bytes32 _emitterId, address payable _receiver) external;

    /// @notice Returns emitter data
    /// @param _emitterId - Id of the emitter
    /// @return emitterId - Id of the emitter
    /// @return schemaId - Id of the schema that is used by the emitter
    /// @return expirationDate - Timestamp when emitter expires
    /// @return registeringFee - Fee that is collected by the emitter for registering SID
    /// @return updatingFee - Fee that is collected by the emitter for updating SID
    /// @return registryChainId - Id of the chain with registry
    /// @return owner - Address of the emitters owner
    function getEmitter(bytes32 _emitterId) external view returns (
        bytes32 emitterId,
        bytes32 schemaId,
        uint64 expirationDate,
        uint256 registeringFee,
        uint256 updatingFee,
        uint256 registryChainId,
        address owner
    );

    /// @notice Registers new emitter
    /// @param _schemaId - Id of schema that would be used by the emitter
    /// @param _registryChainId - Id of the chain with registry
    /// @param _emitterAddress - Address of the emitters owner
    /// @param _expirationDate - Timestamp when emitter expires
    /// @param _registeringFee - Fee that would be collected by the emitter for registering SID
    /// @param _updatingFee - Fee that would be collected by the emitter for updating SID
    /// @param _signature - Operators signature with RegistryEmitterParams
    /// @return Id of the newly created emitter
    function registerEmitter(
        bytes32 _schemaId,
        uint256 _registryChainId,
        address _emitterAddress,
        uint64 _expirationDate,
        uint256 _registeringFee,
        uint256 _updatingFee,
        bytes calldata _signature
    ) public returns (bytes32);
    
    /// @notice Generates digest for registering SID
    /// @param _schemaId - Id of schema that should be used for registering SID
    /// @param _user - Address of the user that should be registered
    /// @param _data - SID data
    /// @param _metadata - SID metadata
    /// @return Digest for registering SID
    function getRegisteringSidDigest(
        bytes32 _schemaId,
        address _user,
        bytes calldata _data,
        string calldata _metadata
    ) public view returns (bytes32);

    /// @notice Generates digest for updating SID
    /// @param _sidId - Id of SID that should be updated
    /// @param _expirationDate - Timestamp when updated SID should expire
    /// @param _data - Updated SID data
    /// @param _metadata - Updated SID metadata
    /// @return Digest for updating SID
    function getUpdatingSidDigest(
        bytes32 _sidId,
        uint64 _expirationDate,
        bytes calldata _data,
        string calldata _metadata
    ) public view returns (bytes32);

    /// @notice Generates digest for registering emitter
    /// @param _schemaId - Id of schema that should be used for registering emitter
    /// @param _registryChainId - Id of the chain with registry
    /// @param _emitterAddress - Address of the emitters owner
    /// @param _expirationDate - Timestamp when emitter expires
    /// @param _registeringFee - Fee that would be collected by the emitter for registering SID
    /// @param _updatingFee - Fee that would be collected by the emitter for updating SID
    /// @return Digest for registering emitter
    function getRegisteringEmitterDigest(
        bytes32 _schemaId,
        uint256 _registryChainId,
        address _emitterAddress,
        uint64 _expirationDate,
        uint256 _registeringFee,
        uint256 _updatingFee
    ) public view returns (bytes32);

    /// @notice Calculates fee for registering SID
    /// @param _emitterId - Id of the emitter that will be used for registering SID
    /// @param _connectorId - Id of the connector that will be used for sending registering message
    /// @param _user - Address of the user that will be registered, NOTE only that address will be allowed to register SID
    /// @param _expirationDate - Timestamp when SID expires
    /// @param _data - SID data
    /// @param _metadata - SID metadata
    /// @return Fee that should be paid for registering SID
    function calculateRegisteringSidFee(
        bytes32 _emitterId,
        uint32 _connectorId,
        address _user,
        uint64 _expirationDate,
        bytes calldata _data,
        string calldata _metadata
    ) public view returns (uint256);
    
    /// @notice Calculates fee for updating SID
    /// @param _emitterId - Id of the emitter that will be used for updating SID
    /// @param _connectorId - Id of the connector that will be used for sending updating message
    /// @param _sidId - Id of the SID that will be updated
    /// @param _expirationDate - Timestamp when SID expires
    /// @param _data - SID data
    /// @param _metadata - SID metadata
    /// @return Fee that should be paid for updating SID
    function calculateUpdatingSidFee(
        bytes32 _emitterId,
        uint32 _connectorId,
        bytes32 _sidId,
        uint64 _expirationDate,
        bytes calldata _data,
        string calldata _metadata
    ) public view returns (uint256);

    /// @notice Composes registering SID message
    /// @param _schemaId - Id of schema that should be used for registering SID
    /// @param _user - Address of the user that should be registered
    /// @param _expirationDate - Timestamp when SID expires
    /// @param _data - SID data
    /// @param _metadata - SID metadata
    /// @return Registering SID message
    function _composeRegisteringSidMessage(
        bytes32 _schemaId,
        address _user,
        uint64 _expirationDate,
        bytes calldata _data,
        string calldata _metadata
    ) internal view returns (bytes memory);

    /// @notice Composes updating SID message
    /// @param _sidId - Id of SID that should be updated
    /// @param _expirationDate - Timestamp when SID expires
    /// @param _data - SID data
    /// @param _metadata - SID metadata
    /// @return Updating SID message
    function _composeUpdatingSidMessage(
        bytes32 _sidId,
        uint64 _expirationDate,
        bytes calldata _data,
        string calldata _metadata
    ) internal view returns (bytes memory);
}

ABI

Last updated