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

io.blockfrost.sdk.impl.retrofit.BlocksApi Maven / Gradle / Ivy

package io.blockfrost.sdk.impl.retrofit;

import io.blockfrost.sdk.api.model.Block;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Path;
import retrofit2.http.Query;

import java.util.List;

public interface BlocksApi {
    /**
     * Specific block in a slot in an epoch
     * Return the content of a requested block for a specific slot in an epoch
     *
     * @param epochNumber Epoch for specific epoch slot. (required)
     * @param slotNumber  Slot position for requested block. (required)
     * @return Call<Block>
     */
    @GET("blocks/epoch/{epoch_number}/slot/{slot_number}")
    Call blocksEpochEpochNumberSlotSlotNumberGet(
            @Header("project_id") String projectId,
            @Path("epoch_number") Integer epochNumber,
            @Path("slot_number") Integer slotNumber
    );

    /**
     * Specific block
     * Return the content of a requested block.
     *
     * @param hashOrNumber Hash of the requested block. (required)
     * @return Call<Block>
     */
    @GET("blocks/{hash_or_number}")
    Call blocksHashOrNumberGet(
            @Header("project_id") String projectId,
            @Path("hash_or_number") String hashOrNumber
    );

    /**
     * Listing of next blocks
     * Return the list of blocks following a specific block.
     *
     * @param hashOrNumber Hash of the requested block. (required)
     * @param count        The number of results displayed on one page. (optional, default to 100)
     * @param page         The page number for listing the results. (optional, default to 1)
     * @return Call<List<Block>>
     */
    @GET("blocks/{hash_or_number}/next")
    Call> blocksHashOrNumberNextGet(
            @Header("project_id") String projectId,
            @Path("hash_or_number") String hashOrNumber,
            @Query("count") Integer count,
            @Query("page") Integer page
    );

    /**
     * Listing of previous blocks
     * Return the list of blocks preceding a specific block.
     *
     * @param hashOrNumber Hash of the requested block (required)
     * @param count        The number of results displayed on one page. (optional, default to 100)
     * @param page         The page number for listing the results. (optional, default to 1)
     * @return Call<List<Block>>
     */
    @GET("blocks/{hash_or_number}/previous")
    Call> blocksHashOrNumberPreviousGet(
            @Header("project_id") String projectId,
            @Path("hash_or_number") String hashOrNumber,
            @Query("count") Integer count,
            @Query("page") Integer page
    );

    /**
     * Block transactions
     * Return the transactions within the block.
     *
     * @param hashOrNumber Hash of the requested block. (required)
     * @param count        The number of results displayed on one page. (optional, default to 100)
     * @param page         The page number for listing the results. (optional, default to 1)
     * @param order        Ordered by tx index in the block. The ordering of items from the point of view of the blockchain, not the page listing itself. By default, we return oldest first, newest last.  (optional, default to asc)
     * @return Call<List<String>>
     */
    @GET("blocks/{hash_or_number}/txs")
    Call> blocksHashOrNumberTxsGet(
            @Path("hash_or_number") String hashOrNumber, @Query("count") Integer count, @Query("page") Integer page, @Query("order") String order
    );

    /**
     * Latest block
     * Return the latest block available to the backends, also known as the tip of the blockchain.
     *
     * @return Call<Block>
     */
    @GET("blocks/latest")
    Call blocksLatestGet(@Header("project_id") String projectId);


    /**
     * Latest block transactions
     * Return the transactions within the latest block.
     *
     * @param count The number of results displayed on one page. (optional, default to 100)
     * @param page  The page number for listing the results. (optional, default to 1)
     * @param order Ordered by tx index in the block. The ordering of items from the point of view of the blockchain, not the page listing itself. By default, we return oldest first, newest last.  (optional, default to asc)
     * @return Call<List<String>>
     */
    @GET("blocks/latest/txs")
    Call> blocksLatestTxsGet(
            @Header("project_id") String projectId,
            @Query("count") Integer count,
            @Query("page") Integer page,
            @Query("order") String order
    );

    /**
     * Specific block in a slot
     * Return the content of a requested block for a specific slot.
     *
     * @param slotNumber Slot position for requested block. (required)
     * @return Call<Block>
     */
    @GET("blocks/slot/{slot_number}")
    Call blocksSlotSlotNumberGet(
            @Header("project_id") String projectId,
            @Path("slot_number") Integer slotNumber
    );

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy