/*
 * Copyright 2014 http://Bither.net
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package net.bither.bitherj.db;

import net.bither.bitherj.core.Out;
import net.bither.bitherj.core.Tx;
import net.bither.bitherj.utils.Sha256Hash;

import java.util.HashMap;
import java.util.List;

public interface ITxProvider {
    public List<Tx> getTxAndDetailByAddress(String address);

    public List<Tx> getPublishedTxs();

    public Tx getTxDetailByTxHash(byte[] txHash);


    public boolean isExist(byte[] txHash);

    public void add(Tx txItem);

    public void addTxs(List<Tx> txItems);


    public void remove(byte[] txHash);


    public boolean isAddressContainsTx(String address, Tx txItem);
    public boolean isTxDoubleSpendWithConfirmedTx(Tx tx);
    public List<String> getInAddresses(Tx tx);


    public void confirmTx(int blockNo, List<byte[]> txHashes);

    public void unConfirmTxByBlockNo(int blockNo);

    public List<Tx> getUnspendTxWithAddress(String address);

    public List<Out> getUnspendOutWithAddress(String address);

    public List<Out> getUnSpendOutCanSpendWithAddress(String address);

    public List<Out> getUnSpendOutButNotConfirmWithAddress(String address);

    public int txCount(String address);

    public void txSentBySelfHasSaw(byte[] txHash);

    public List<Out> getOuts();

    public List<Out> getUnSpentOuts();

    public List<Tx> getRecentlyTxsByAddress(String address, int greateThanBlockNo, int limit);

    public List<Long> txInValues(byte[] txHash);

    public HashMap<Sha256Hash, Tx> getTxDependencies(Tx txItem);


}

@@ -2082,11 +2082,174 @@
 Item);%0A%0A
+    public void completeInSignature(List%3Cbyte%5B%5D%3E txHashes, List%3CInteger%3E inSns, List%3Cbyte%5B%5D%3E inSignature);%0A    public int needCompleteInSignature(String address);%0A
 %0A%7D%0A

add two method for complete ins' signature