contract WhooseWalletAdmin is managed {
    mapping(address => address) contracts;

    function addContract(address addr) public returns(bool success) {
        contracts[addr] = addr;
        return true;
    }

    function removeContract(address addr) public onlyAdmin returns(bool success) {
        delete contracts[addr];
        return true;
    }

    function getContract(address addr) public view onlyAdmin returns(address addr_res) {
        return contracts[addr];
    }

    // ERC725
    function getKey(address _walletAddress, bytes32 _key)
        public view onlyAdmin returns(uint256[] purposes, uint256 keyType, bytes32 key) {
        WhooseWallet _wallet = WhooseWallet(_walletAddress);
        return _wallet.getKey(_key);
    }

    function keyHasPurpose(address _walletAddress, bytes32 _key, uint256 _purpose)
        public view onlyAdmin returns (bool exists) {
        WhooseWallet _wallet = WhooseWallet(_walletAddress);
        return _wallet.keyHasPurpose(_key, _purpose);
    }

    function getKeysByPurpose(address _walletAddress, uint256 _purpose)
        public view onlyAdmin returns(bytes32[] keys) {
        WhooseWallet _wallet = WhooseWallet(_walletAddress);
        return _wallet.getKeysByPurpose(_purpose);
    }

    function addKey(address _walletAddress, bytes32 _key, uint256 _purpose, uint256 _keyType)
        public onlyAdmin returns (bool success) {
        WhooseWallet _wallet = WhooseWallet(_walletAddress);
        return _wallet.addKey(_key, _purpose, _keyType);
    }

    function addKeys(address _walletAddress, bytes32[] _keys, uint256 _purpose, uint256 _keyType)
        public onlyAdmin returns (bool success) {
        WhooseWallet _wallet = WhooseWallet(_walletAddress);
        return _wallet.addKeys(_keys, _purpose, _keyType);
    }

    function removeKey(address _walletAddress, bytes32 _key, uint256 _purpose)
        public onlyAdmin returns (bool success) {
        WhooseWallet _wallet = WhooseWallet(_walletAddress);
        return _wallet.removeKey(_key, _purpose);
    }

    function execute(address _walletAddress, address _to, uint256 _value, bytes _data)
        public onlyAdmin returns (uint256 executionId) {
        WhooseWallet _wallet = WhooseWallet(_walletAddress);
        return _wallet.execute(_to, _value, _data);
    }

    function approve(address _walletAddress, uint256 _id, bool _approve)
        public onlyAdmin returns (bool success) {
        WhooseWallet _wallet = WhooseWallet(_walletAddress);
        return _wallet.approve(_id, _approve);
    }

    // ERC735
    function getClaim(address _walletAddress, bytes32 _claimId)
        public onlyAdmin view returns(uint256 topic, uint256 scheme, address issuer, bytes signature, bytes data, string uri) {
        WhooseWallet _wallet = WhooseWallet(_walletAddress);
        return _wallet.getClaim(_claimId);
    }

    function getClaimIdsByTopic(address _walletAddress, uint256 _topic)
        public onlyAdmin view returns(bytes32[] claimIds) {
        WhooseWallet _wallet = WhooseWallet(_walletAddress);
        return _wallet.getClaimIdsByTopic(_topic);
    }

    function addClaim(address _walletAddress, uint256 _topic, uint256 _scheme, address issuer, bytes _signature, bytes _data, string _uri)
        public onlyAdmin returns (bytes32 claimRequestId) {
        WhooseWallet _wallet = WhooseWallet(_walletAddress);
        return _wallet.addClaim(_topic, _scheme, issuer, _signature, _data, _uri);
    }

    function removeClaim(address _walletAddress, bytes32 _claimId)
        public onlyAdmin returns (bool success) {
        WhooseWallet _wallet = WhooseWallet(_walletAddress);
        return _wallet.removeClaim(_claimId);
    }

    function kill(address _walletAddress)
        public onlyAdmin returns (bool success) {
        WhooseWallet _wallet = WhooseWallet(_walletAddress);
        _wallet.destruct();
        return true;
    }
}
function getClaim(address _walletAddress, bytes32 _claimId)
    public onlyAdmin view returns(uint256 topic, uint256 scheme, address issuer, bytes signature, bytes data, string uri) {
    WhooseWallet _wallet = WhooseWallet(_walletAddress);
    return _wallet.getClaim(_claimId);
}

// ERC735