All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bloxbean.cardano.client.coinselection.UtxoSelector Maven / Gradle / Ivy

There is a newer version: 0.6.2
Show newest version
package com.bloxbean.cardano.client.coinselection;

import com.bloxbean.cardano.client.api.exception.ApiException;
import com.bloxbean.cardano.client.api.model.Utxo;

import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.function.Predicate;

/**
 * Implement this interface to find Utxo by predicate
 */
public interface UtxoSelector {

    /**
     * Find the first utxo matching the predicate
     * @param address Script address
     * @param predicate Predicate to filter utxos
     * @return An optional with matching Utxo
     * @throws ApiException if error
     */
    Optional findFirst(String address, Predicate predicate) throws ApiException;

    /**
     * Find the first utxo matching the predicate
     * @param address Script address
     * @param predicate Predicate to filter utxos
     * @param excludeUtxos Utxos to exclude
     * @return An optional with matching Utxo
     * @throws ApiException if error
     */
    Optional findFirst(String address, Predicate predicate, Set excludeUtxos) throws ApiException;

    /**
     * Find all utxos matching the predicate
     * @param address Script address
     * @param predicate Predicate to filter utxos
     * @return List of Utxos
     * @throws ApiException if error
     */
    List findAll(String address, Predicate predicate) throws ApiException;

    /**
     * Find all utxos matching the predicate
     * @param address ScriptAddress Script address
     * @param predicate Predicate Predicate to filter utxos
     * @param excludeUtxos Utxos to exclude
     * @return List of Utxos
     * @throws ApiException if error
     */
    List findAll(String address, Predicate predicate, Set excludeUtxos) throws ApiException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy