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

io.neow3j.protocol.core.BlockParameterIndex Maven / Gradle / Ivy

package io.neow3j.protocol.core;

import io.neow3j.utils.Numeric;
import com.fasterxml.jackson.annotation.JsonValue;

import java.math.BigInteger;

/**
 * BlockParameter implementation that takes a numeric value.
 */
public class BlockParameterIndex implements BlockParameter {

    private BigInteger blockIndex;

    public BlockParameterIndex(BigInteger blockIndex) {
        this.blockIndex = blockIndex;
    }

    public BlockParameterIndex(long blockIndex) {
        this(BigInteger.valueOf(blockIndex));
    }

    @Override
    @JsonValue
    public String getValue() {
        return Numeric.encodeQuantity(blockIndex);
    }

    public BigInteger getBlockIndex() {
        return blockIndex;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy