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

com.fireblocks.sdk.model.TransactionRequest Maven / Gradle / Ivy

/*
 * Fireblocks API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.6.2
 * Contact: [email protected]
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

package com.fireblocks.sdk.model;


import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.StringJoiner;

/** TransactionRequest */
@JsonPropertyOrder({
    TransactionRequest.JSON_PROPERTY_OPERATION,
    TransactionRequest.JSON_PROPERTY_NOTE,
    TransactionRequest.JSON_PROPERTY_EXTERNAL_TX_ID,
    TransactionRequest.JSON_PROPERTY_ASSET_ID,
    TransactionRequest.JSON_PROPERTY_SOURCE,
    TransactionRequest.JSON_PROPERTY_DESTINATION,
    TransactionRequest.JSON_PROPERTY_DESTINATIONS,
    TransactionRequest.JSON_PROPERTY_AMOUNT,
    TransactionRequest.JSON_PROPERTY_TREAT_AS_GROSS_AMOUNT,
    TransactionRequest.JSON_PROPERTY_FORCE_SWEEP,
    TransactionRequest.JSON_PROPERTY_FEE_LEVEL,
    TransactionRequest.JSON_PROPERTY_FEE,
    TransactionRequest.JSON_PROPERTY_PRIORITY_FEE,
    TransactionRequest.JSON_PROPERTY_FAIL_ON_LOW_FEE,
    TransactionRequest.JSON_PROPERTY_MAX_FEE,
    TransactionRequest.JSON_PROPERTY_MAX_TOTAL_FEE,
    TransactionRequest.JSON_PROPERTY_GAS_LIMIT,
    TransactionRequest.JSON_PROPERTY_GAS_PRICE,
    TransactionRequest.JSON_PROPERTY_NETWORK_FEE,
    TransactionRequest.JSON_PROPERTY_REPLACE_TX_BY_HASH,
    TransactionRequest.JSON_PROPERTY_EXTRA_PARAMETERS,
    TransactionRequest.JSON_PROPERTY_CUSTOMER_REF_ID,
    TransactionRequest.JSON_PROPERTY_TRAVEL_RULE_MESSAGE,
    TransactionRequest.JSON_PROPERTY_AUTO_STAKING,
    TransactionRequest.JSON_PROPERTY_NETWORK_STAKING,
    TransactionRequest.JSON_PROPERTY_CPU_STAKING,
    TransactionRequest.JSON_PROPERTY_USE_GASLESS
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class TransactionRequest {
    public static final String JSON_PROPERTY_OPERATION = "operation";
    private TransactionOperation operation = TransactionOperation.TRANSFER;

    public static final String JSON_PROPERTY_NOTE = "note";
    private String note;

    public static final String JSON_PROPERTY_EXTERNAL_TX_ID = "externalTxId";
    private String externalTxId;

    public static final String JSON_PROPERTY_ASSET_ID = "assetId";
    private String assetId;

    public static final String JSON_PROPERTY_SOURCE = "source";
    private SourceTransferPeerPath source;

    public static final String JSON_PROPERTY_DESTINATION = "destination";
    private DestinationTransferPeerPath destination;

    public static final String JSON_PROPERTY_DESTINATIONS = "destinations";
    private List destinations;

    public static final String JSON_PROPERTY_AMOUNT = "amount";
    private TransactionRequestAmount amount;

    public static final String JSON_PROPERTY_TREAT_AS_GROSS_AMOUNT = "treatAsGrossAmount";
    private Boolean treatAsGrossAmount;

    public static final String JSON_PROPERTY_FORCE_SWEEP = "forceSweep";
    private Boolean forceSweep;

    /**
     * For UTXO or EVM-based blockchains only. Defines the blockchain fee level which will be payed
     * for the transaction. Alternatively, specific fee estimation parameters exist below.
     */
    public enum FeeLevelEnum {
        LOW("LOW"),

        MEDIUM("MEDIUM"),

        HIGH("HIGH");

        private String value;

        FeeLevelEnum(String value) {
            this.value = value;
        }

        @JsonValue
        public String getValue() {
            return value;
        }

        @Override
        public String toString() {
            return String.valueOf(value);
        }

        @JsonCreator
        public static FeeLevelEnum fromValue(String value) {
            for (FeeLevelEnum b : FeeLevelEnum.values()) {
                if (b.value.equals(value)) {
                    return b;
                }
            }
            throw new IllegalArgumentException("Unexpected value '" + value + "'");
        }
    }

    public static final String JSON_PROPERTY_FEE_LEVEL = "feeLevel";
    private FeeLevelEnum feeLevel;

    public static final String JSON_PROPERTY_FEE = "fee";
    private TransactionRequestFee fee;

    public static final String JSON_PROPERTY_PRIORITY_FEE = "priorityFee";
    private TransactionRequestPriorityFee priorityFee;

    public static final String JSON_PROPERTY_FAIL_ON_LOW_FEE = "failOnLowFee";
    private Boolean failOnLowFee;

    public static final String JSON_PROPERTY_MAX_FEE = "maxFee";
    private String maxFee;

    public static final String JSON_PROPERTY_MAX_TOTAL_FEE = "maxTotalFee";
    private String maxTotalFee;

    public static final String JSON_PROPERTY_GAS_LIMIT = "gasLimit";
    private TransactionRequestGasLimit gasLimit;

    public static final String JSON_PROPERTY_GAS_PRICE = "gasPrice";
    private TransactionRequestGasPrice gasPrice;

    public static final String JSON_PROPERTY_NETWORK_FEE = "networkFee";
    private TransactionRequestNetworkFee networkFee;

    public static final String JSON_PROPERTY_REPLACE_TX_BY_HASH = "replaceTxByHash";
    private String replaceTxByHash;

    public static final String JSON_PROPERTY_EXTRA_PARAMETERS = "extraParameters";
    private Object extraParameters;

    public static final String JSON_PROPERTY_CUSTOMER_REF_ID = "customerRefId";
    private String customerRefId;

    public static final String JSON_PROPERTY_TRAVEL_RULE_MESSAGE = "travelRuleMessage";
    private TravelRuleCreateTransactionRequest travelRuleMessage;

    public static final String JSON_PROPERTY_AUTO_STAKING = "autoStaking";
    private Boolean autoStaking;

    public static final String JSON_PROPERTY_NETWORK_STAKING = "networkStaking";
    private TransactionRequestNetworkStaking networkStaking;

    public static final String JSON_PROPERTY_CPU_STAKING = "cpuStaking";
    private TransactionRequestNetworkStaking cpuStaking;

    public static final String JSON_PROPERTY_USE_GASLESS = "useGasless";
    private Boolean useGasless;

    public TransactionRequest() {}

    public TransactionRequest operation(TransactionOperation operation) {
        this.operation = operation;
        return this;
    }

    /**
     * Get operation
     *
     * @return operation
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_OPERATION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public TransactionOperation getOperation() {
        return operation;
    }

    @JsonProperty(JSON_PROPERTY_OPERATION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setOperation(TransactionOperation operation) {
        this.operation = operation;
    }

    public TransactionRequest note(String note) {
        this.note = note;
        return this;
    }

    /**
     * Custom note, not sent to the blockchain, to describe the transaction at your Fireblocks
     * workspace.
     *
     * @return note
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_NOTE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getNote() {
        return note;
    }

    @JsonProperty(JSON_PROPERTY_NOTE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setNote(String note) {
        this.note = note;
    }

    public TransactionRequest externalTxId(String externalTxId) {
        this.externalTxId = externalTxId;
        return this;
    }

    /**
     * An optional but highly recommended parameter. Fireblocks will reject future transactions with
     * same ID. You should set this to a unique ID representing the transaction, to avoid submitting
     * the same transaction twice. This helps with cases where submitting the transaction responds
     * with an error code due to Internet interruptions, but the transaction was actually sent and
     * processed. To validate whether a transaction has been processed, [Find a specific transaction
     * by external transaction
     * ID](https://developers.fireblocks.com/reference/get_transactions-external-tx-id-externaltxid).
     * There is no specific format required for this parameter.
     *
     * @return externalTxId
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_EXTERNAL_TX_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getExternalTxId() {
        return externalTxId;
    }

    @JsonProperty(JSON_PROPERTY_EXTERNAL_TX_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setExternalTxId(String externalTxId) {
        this.externalTxId = externalTxId;
    }

    public TransactionRequest assetId(String assetId) {
        this.assetId = assetId;
        return this;
    }

    /**
     * The ID of the asset to transfer, for `TRANSFER`, `MINT` or
     * `BURN` operations. [See the list of supported assets and their IDs on
     * Fireblocks.](https://developers.fireblocks.com/reference/get_supported-assets)
     *
     * @return assetId
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_ASSET_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getAssetId() {
        return assetId;
    }

    @JsonProperty(JSON_PROPERTY_ASSET_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setAssetId(String assetId) {
        this.assetId = assetId;
    }

    public TransactionRequest source(SourceTransferPeerPath source) {
        this.source = source;
        return this;
    }

    /**
     * Get source
     *
     * @return source
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_SOURCE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public SourceTransferPeerPath getSource() {
        return source;
    }

    @JsonProperty(JSON_PROPERTY_SOURCE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setSource(SourceTransferPeerPath source) {
        this.source = source;
    }

    public TransactionRequest destination(DestinationTransferPeerPath destination) {
        this.destination = destination;
        return this;
    }

    /**
     * Get destination
     *
     * @return destination
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_DESTINATION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public DestinationTransferPeerPath getDestination() {
        return destination;
    }

    @JsonProperty(JSON_PROPERTY_DESTINATION)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setDestination(DestinationTransferPeerPath destination) {
        this.destination = destination;
    }

    public TransactionRequest destinations(List destinations) {
        this.destinations = destinations;
        return this;
    }

    public TransactionRequest addDestinationsItem(TransactionRequestDestination destinationsItem) {
        if (this.destinations == null) {
            this.destinations = new ArrayList<>();
        }
        this.destinations.add(destinationsItem);
        return this;
    }

    /**
     * For UTXO based blockchains, you can send a single transaction to multiple destinations.
     *
     * @return destinations
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_DESTINATIONS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public List getDestinations() {
        return destinations;
    }

    @JsonProperty(JSON_PROPERTY_DESTINATIONS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setDestinations(List destinations) {
        this.destinations = destinations;
    }

    public TransactionRequest amount(TransactionRequestAmount amount) {
        this.amount = amount;
        return this;
    }

    /**
     * Get amount
     *
     * @return amount
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_AMOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public TransactionRequestAmount getAmount() {
        return amount;
    }

    @JsonProperty(JSON_PROPERTY_AMOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setAmount(TransactionRequestAmount amount) {
        this.amount = amount;
    }

    public TransactionRequest treatAsGrossAmount(Boolean treatAsGrossAmount) {
        this.treatAsGrossAmount = treatAsGrossAmount;
        return this;
    }

    /**
     * \"When set to `true`, the fee will be deducted from the requested
     * amount.\" **Note**: This parameter can only be considered if a transaction’s asset is a
     * base asset, such as ETH or MATIC. If the asset can’t be used for transaction fees, like USDC,
     * this parameter is ignored and the fee is deducted from the relevant base asset wallet in the
     * source account.
     *
     * @return treatAsGrossAmount
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_TREAT_AS_GROSS_AMOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Boolean getTreatAsGrossAmount() {
        return treatAsGrossAmount;
    }

    @JsonProperty(JSON_PROPERTY_TREAT_AS_GROSS_AMOUNT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setTreatAsGrossAmount(Boolean treatAsGrossAmount) {
        this.treatAsGrossAmount = treatAsGrossAmount;
    }

    public TransactionRequest forceSweep(Boolean forceSweep) {
        this.forceSweep = forceSweep;
        return this;
    }

    /**
     * For Polkadot, Kusama and Westend transactions only. When set to true, Fireblocks will empty
     * the asset wallet. **Note:** If set to true when the source account is exactly 1 DOT, the
     * transaction will fail. Any amount more or less than 1 DOT succeeds. This is a Polkadot
     * blockchain limitation.
     *
     * @return forceSweep
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_FORCE_SWEEP)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Boolean getForceSweep() {
        return forceSweep;
    }

    @JsonProperty(JSON_PROPERTY_FORCE_SWEEP)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setForceSweep(Boolean forceSweep) {
        this.forceSweep = forceSweep;
    }

    public TransactionRequest feeLevel(FeeLevelEnum feeLevel) {
        this.feeLevel = feeLevel;
        return this;
    }

    /**
     * For UTXO or EVM-based blockchains only. Defines the blockchain fee level which will be payed
     * for the transaction. Alternatively, specific fee estimation parameters exist below.
     *
     * @return feeLevel
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_FEE_LEVEL)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public FeeLevelEnum getFeeLevel() {
        return feeLevel;
    }

    @JsonProperty(JSON_PROPERTY_FEE_LEVEL)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setFeeLevel(FeeLevelEnum feeLevel) {
        this.feeLevel = feeLevel;
    }

    public TransactionRequest fee(TransactionRequestFee fee) {
        this.fee = fee;
        return this;
    }

    /**
     * Get fee
     *
     * @return fee
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_FEE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public TransactionRequestFee getFee() {
        return fee;
    }

    @JsonProperty(JSON_PROPERTY_FEE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setFee(TransactionRequestFee fee) {
        this.fee = fee;
    }

    public TransactionRequest priorityFee(TransactionRequestPriorityFee priorityFee) {
        this.priorityFee = priorityFee;
        return this;
    }

    /**
     * Get priorityFee
     *
     * @return priorityFee
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_PRIORITY_FEE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public TransactionRequestPriorityFee getPriorityFee() {
        return priorityFee;
    }

    @JsonProperty(JSON_PROPERTY_PRIORITY_FEE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setPriorityFee(TransactionRequestPriorityFee priorityFee) {
        this.priorityFee = priorityFee;
    }

    public TransactionRequest failOnLowFee(Boolean failOnLowFee) {
        this.failOnLowFee = failOnLowFee;
        return this;
    }

    /**
     * When set to `true`, in case the current `MEDIUM` fee level is higher than
     * the one specified in the transaction, the transaction will fail to avoid getting stuck with
     * no confirmations.
     *
     * @return failOnLowFee
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_FAIL_ON_LOW_FEE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Boolean getFailOnLowFee() {
        return failOnLowFee;
    }

    @JsonProperty(JSON_PROPERTY_FAIL_ON_LOW_FEE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setFailOnLowFee(Boolean failOnLowFee) {
        this.failOnLowFee = failOnLowFee;
    }

    public TransactionRequest maxFee(String maxFee) {
        this.maxFee = maxFee;
        return this;
    }

    /**
     * The maximum fee (gas price or fee per byte) that should be payed for the transaction. In case
     * the current value of the requested `feeLevel` is higher than this requested maximum
     * fee. Represented by a numeric string for accurate precision.
     *
     * @return maxFee
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_MAX_FEE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getMaxFee() {
        return maxFee;
    }

    @JsonProperty(JSON_PROPERTY_MAX_FEE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setMaxFee(String maxFee) {
        this.maxFee = maxFee;
    }

    public TransactionRequest maxTotalFee(String maxTotalFee) {
        this.maxTotalFee = maxTotalFee;
        return this;
    }

    /**
     * For BTC-based blockchains only. The maximum fee (in the units of the fee-paying asset) that
     * should be paid for the transaction.
     *
     * @return maxTotalFee
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_MAX_TOTAL_FEE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getMaxTotalFee() {
        return maxTotalFee;
    }

    @JsonProperty(JSON_PROPERTY_MAX_TOTAL_FEE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setMaxTotalFee(String maxTotalFee) {
        this.maxTotalFee = maxTotalFee;
    }

    public TransactionRequest gasLimit(TransactionRequestGasLimit gasLimit) {
        this.gasLimit = gasLimit;
        return this;
    }

    /**
     * Get gasLimit
     *
     * @return gasLimit
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_GAS_LIMIT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public TransactionRequestGasLimit getGasLimit() {
        return gasLimit;
    }

    @JsonProperty(JSON_PROPERTY_GAS_LIMIT)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setGasLimit(TransactionRequestGasLimit gasLimit) {
        this.gasLimit = gasLimit;
    }

    public TransactionRequest gasPrice(TransactionRequestGasPrice gasPrice) {
        this.gasPrice = gasPrice;
        return this;
    }

    /**
     * Get gasPrice
     *
     * @return gasPrice
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_GAS_PRICE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public TransactionRequestGasPrice getGasPrice() {
        return gasPrice;
    }

    @JsonProperty(JSON_PROPERTY_GAS_PRICE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setGasPrice(TransactionRequestGasPrice gasPrice) {
        this.gasPrice = gasPrice;
    }

    public TransactionRequest networkFee(TransactionRequestNetworkFee networkFee) {
        this.networkFee = networkFee;
        return this;
    }

    /**
     * Get networkFee
     *
     * @return networkFee
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_NETWORK_FEE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public TransactionRequestNetworkFee getNetworkFee() {
        return networkFee;
    }

    @JsonProperty(JSON_PROPERTY_NETWORK_FEE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setNetworkFee(TransactionRequestNetworkFee networkFee) {
        this.networkFee = networkFee;
    }

    public TransactionRequest replaceTxByHash(String replaceTxByHash) {
        this.replaceTxByHash = replaceTxByHash;
        return this;
    }

    /**
     * For EVM-based blockchains only. In case a transaction is stuck, specify the hash of the stuck
     * transaction to replace it by this transaction with a higher fee, or to replace it with this
     * transaction with a zero fee and drop it from the blockchain.
     *
     * @return replaceTxByHash
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_REPLACE_TX_BY_HASH)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getReplaceTxByHash() {
        return replaceTxByHash;
    }

    @JsonProperty(JSON_PROPERTY_REPLACE_TX_BY_HASH)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setReplaceTxByHash(String replaceTxByHash) {
        this.replaceTxByHash = replaceTxByHash;
    }

    public TransactionRequest extraParameters(Object extraParameters) {
        this.extraParameters = extraParameters;
        return this;
    }

    /**
     * Additional protocol / operation specific key-value parameters: For UTXO-based blockchain
     * input selection, add the key `inputsSelection` with the value set the [input
     * selection
     * structure.](https://developers.fireblocks.com/reference/transaction-objects#inputsselection)
     * The inputs can be retrieved from the [Retrieve Unspent Inputs
     * endpoint.](https://developers.fireblocks.com/reference/get_vault-accounts-vaultaccountid-assetid-unspent-inputs)
     * For `RAW` operations, add the key `rawMessageData` with the value set to
     * the [raw message data
     * structure.](https://developers.fireblocks.com/reference/raw-signing-objects#rawmessagedata)
     * For `CONTRACT_CALL` operations, add the key `contractCallData` with the
     * value set to the Ethereum smart contract Application Binary Interface (ABI) payload. The
     * Fireblocks [development
     * libraries](https://developers.fireblocks.com/docs/ethereum-development#convenience-libraries)
     * are recommended for building contract call transactions.
     *
     * @return extraParameters
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_EXTRA_PARAMETERS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Object getExtraParameters() {
        return extraParameters;
    }

    @JsonProperty(JSON_PROPERTY_EXTRA_PARAMETERS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setExtraParameters(Object extraParameters) {
        this.extraParameters = extraParameters;
    }

    public TransactionRequest customerRefId(String customerRefId) {
        this.customerRefId = customerRefId;
        return this;
    }

    /**
     * The ID for AML providers to associate the owner of funds with transactions.
     *
     * @return customerRefId
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_CUSTOMER_REF_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public String getCustomerRefId() {
        return customerRefId;
    }

    @JsonProperty(JSON_PROPERTY_CUSTOMER_REF_ID)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setCustomerRefId(String customerRefId) {
        this.customerRefId = customerRefId;
    }

    public TransactionRequest travelRuleMessage(
            TravelRuleCreateTransactionRequest travelRuleMessage) {
        this.travelRuleMessage = travelRuleMessage;
        return this;
    }

    /**
     * Get travelRuleMessage
     *
     * @return travelRuleMessage
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_TRAVEL_RULE_MESSAGE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public TravelRuleCreateTransactionRequest getTravelRuleMessage() {
        return travelRuleMessage;
    }

    @JsonProperty(JSON_PROPERTY_TRAVEL_RULE_MESSAGE)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setTravelRuleMessage(TravelRuleCreateTransactionRequest travelRuleMessage) {
        this.travelRuleMessage = travelRuleMessage;
    }

    public TransactionRequest autoStaking(Boolean autoStaking) {
        this.autoStaking = autoStaking;
        return this;
    }

    /**
     * This feature is no longer supported.
     *
     * @return autoStaking
     * @deprecated
     */
    @Deprecated
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_AUTO_STAKING)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Boolean getAutoStaking() {
        return autoStaking;
    }

    @JsonProperty(JSON_PROPERTY_AUTO_STAKING)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setAutoStaking(Boolean autoStaking) {
        this.autoStaking = autoStaking;
    }

    public TransactionRequest networkStaking(TransactionRequestNetworkStaking networkStaking) {
        this.networkStaking = networkStaking;
        return this;
    }

    /**
     * Get networkStaking
     *
     * @return networkStaking
     * @deprecated
     */
    @Deprecated
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_NETWORK_STAKING)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public TransactionRequestNetworkStaking getNetworkStaking() {
        return networkStaking;
    }

    @JsonProperty(JSON_PROPERTY_NETWORK_STAKING)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setNetworkStaking(TransactionRequestNetworkStaking networkStaking) {
        this.networkStaking = networkStaking;
    }

    public TransactionRequest cpuStaking(TransactionRequestNetworkStaking cpuStaking) {
        this.cpuStaking = cpuStaking;
        return this;
    }

    /**
     * Get cpuStaking
     *
     * @return cpuStaking
     * @deprecated
     */
    @Deprecated
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_CPU_STAKING)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public TransactionRequestNetworkStaking getCpuStaking() {
        return cpuStaking;
    }

    @JsonProperty(JSON_PROPERTY_CPU_STAKING)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setCpuStaking(TransactionRequestNetworkStaking cpuStaking) {
        this.cpuStaking = cpuStaking;
    }

    public TransactionRequest useGasless(Boolean useGasless) {
        this.useGasless = useGasless;
        return this;
    }

    /**
     * - Override the default gaslsess configuration by sending true\\false
     *
     * @return useGasless
     */
    @jakarta.annotation.Nullable
    @JsonProperty(JSON_PROPERTY_USE_GASLESS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public Boolean getUseGasless() {
        return useGasless;
    }

    @JsonProperty(JSON_PROPERTY_USE_GASLESS)
    @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
    public void setUseGasless(Boolean useGasless) {
        this.useGasless = useGasless;
    }

    /** Return true if this TransactionRequest object is equal to o. */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TransactionRequest transactionRequest = (TransactionRequest) o;
        return Objects.equals(this.operation, transactionRequest.operation)
                && Objects.equals(this.note, transactionRequest.note)
                && Objects.equals(this.externalTxId, transactionRequest.externalTxId)
                && Objects.equals(this.assetId, transactionRequest.assetId)
                && Objects.equals(this.source, transactionRequest.source)
                && Objects.equals(this.destination, transactionRequest.destination)
                && Objects.equals(this.destinations, transactionRequest.destinations)
                && Objects.equals(this.amount, transactionRequest.amount)
                && Objects.equals(this.treatAsGrossAmount, transactionRequest.treatAsGrossAmount)
                && Objects.equals(this.forceSweep, transactionRequest.forceSweep)
                && Objects.equals(this.feeLevel, transactionRequest.feeLevel)
                && Objects.equals(this.fee, transactionRequest.fee)
                && Objects.equals(this.priorityFee, transactionRequest.priorityFee)
                && Objects.equals(this.failOnLowFee, transactionRequest.failOnLowFee)
                && Objects.equals(this.maxFee, transactionRequest.maxFee)
                && Objects.equals(this.maxTotalFee, transactionRequest.maxTotalFee)
                && Objects.equals(this.gasLimit, transactionRequest.gasLimit)
                && Objects.equals(this.gasPrice, transactionRequest.gasPrice)
                && Objects.equals(this.networkFee, transactionRequest.networkFee)
                && Objects.equals(this.replaceTxByHash, transactionRequest.replaceTxByHash)
                && Objects.equals(this.extraParameters, transactionRequest.extraParameters)
                && Objects.equals(this.customerRefId, transactionRequest.customerRefId)
                && Objects.equals(this.travelRuleMessage, transactionRequest.travelRuleMessage)
                && Objects.equals(this.autoStaking, transactionRequest.autoStaking)
                && Objects.equals(this.networkStaking, transactionRequest.networkStaking)
                && Objects.equals(this.cpuStaking, transactionRequest.cpuStaking)
                && Objects.equals(this.useGasless, transactionRequest.useGasless);
    }

    @Override
    public int hashCode() {
        return Objects.hash(
                operation,
                note,
                externalTxId,
                assetId,
                source,
                destination,
                destinations,
                amount,
                treatAsGrossAmount,
                forceSweep,
                feeLevel,
                fee,
                priorityFee,
                failOnLowFee,
                maxFee,
                maxTotalFee,
                gasLimit,
                gasPrice,
                networkFee,
                replaceTxByHash,
                extraParameters,
                customerRefId,
                travelRuleMessage,
                autoStaking,
                networkStaking,
                cpuStaking,
                useGasless);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class TransactionRequest {\n");
        sb.append("    operation: ").append(toIndentedString(operation)).append("\n");
        sb.append("    note: ").append(toIndentedString(note)).append("\n");
        sb.append("    externalTxId: ").append(toIndentedString(externalTxId)).append("\n");
        sb.append("    assetId: ").append(toIndentedString(assetId)).append("\n");
        sb.append("    source: ").append(toIndentedString(source)).append("\n");
        sb.append("    destination: ").append(toIndentedString(destination)).append("\n");
        sb.append("    destinations: ").append(toIndentedString(destinations)).append("\n");
        sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
        sb.append("    treatAsGrossAmount: ")
                .append(toIndentedString(treatAsGrossAmount))
                .append("\n");
        sb.append("    forceSweep: ").append(toIndentedString(forceSweep)).append("\n");
        sb.append("    feeLevel: ").append(toIndentedString(feeLevel)).append("\n");
        sb.append("    fee: ").append(toIndentedString(fee)).append("\n");
        sb.append("    priorityFee: ").append(toIndentedString(priorityFee)).append("\n");
        sb.append("    failOnLowFee: ").append(toIndentedString(failOnLowFee)).append("\n");
        sb.append("    maxFee: ").append(toIndentedString(maxFee)).append("\n");
        sb.append("    maxTotalFee: ").append(toIndentedString(maxTotalFee)).append("\n");
        sb.append("    gasLimit: ").append(toIndentedString(gasLimit)).append("\n");
        sb.append("    gasPrice: ").append(toIndentedString(gasPrice)).append("\n");
        sb.append("    networkFee: ").append(toIndentedString(networkFee)).append("\n");
        sb.append("    replaceTxByHash: ").append(toIndentedString(replaceTxByHash)).append("\n");
        sb.append("    extraParameters: ").append(toIndentedString(extraParameters)).append("\n");
        sb.append("    customerRefId: ").append(toIndentedString(customerRefId)).append("\n");
        sb.append("    travelRuleMessage: ")
                .append(toIndentedString(travelRuleMessage))
                .append("\n");
        sb.append("    autoStaking: ").append(toIndentedString(autoStaking)).append("\n");
        sb.append("    networkStaking: ").append(toIndentedString(networkStaking)).append("\n");
        sb.append("    cpuStaking: ").append(toIndentedString(cpuStaking)).append("\n");
        sb.append("    useGasless: ").append(toIndentedString(useGasless)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first
     * line).
     */
    private String toIndentedString(Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }

    /**
     * Convert the instance into URL query string.
     *
     * @return URL query string
     */
    public String toUrlQueryString() {
        return toUrlQueryString(null);
    }

    /**
     * Convert the instance into URL query string.
     *
     * @param prefix prefix of the query string
     * @return URL query string
     */
    public String toUrlQueryString(String prefix) {
        String suffix = "";
        String containerSuffix = "";
        String containerPrefix = "";
        if (prefix == null) {
            // style=form, explode=true, e.g. /pet?name=cat&type=manx
            prefix = "";
        } else {
            // deepObject style e.g. /pet?id[name]=cat&id[type]=manx
            prefix = prefix + "[";
            suffix = "]";
            containerSuffix = "]";
            containerPrefix = "[";
        }

        StringJoiner joiner = new StringJoiner("&");

        // add `operation` to the URL query string
        if (getOperation() != null) {
            joiner.add(
                    String.format(
                            "%soperation%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            String.valueOf(getOperation()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `note` to the URL query string
        if (getNote() != null) {
            joiner.add(
                    String.format(
                            "%snote%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(String.valueOf(getNote()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `externalTxId` to the URL query string
        if (getExternalTxId() != null) {
            joiner.add(
                    String.format(
                            "%sexternalTxId%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            String.valueOf(getExternalTxId()),
                                            StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `assetId` to the URL query string
        if (getAssetId() != null) {
            joiner.add(
                    String.format(
                            "%sassetId%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(String.valueOf(getAssetId()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `source` to the URL query string
        if (getSource() != null) {
            joiner.add(getSource().toUrlQueryString(prefix + "source" + suffix));
        }

        // add `destination` to the URL query string
        if (getDestination() != null) {
            joiner.add(getDestination().toUrlQueryString(prefix + "destination" + suffix));
        }

        // add `destinations` to the URL query string
        if (getDestinations() != null) {
            for (int i = 0; i < getDestinations().size(); i++) {
                if (getDestinations().get(i) != null) {
                    joiner.add(
                            getDestinations()
                                    .get(i)
                                    .toUrlQueryString(
                                            String.format(
                                                    "%sdestinations%s%s",
                                                    prefix,
                                                    suffix,
                                                    "".equals(suffix)
                                                            ? ""
                                                            : String.format(
                                                                    "%s%d%s",
                                                                    containerPrefix,
                                                                    i,
                                                                    containerSuffix))));
                }
            }
        }

        // add `amount` to the URL query string
        if (getAmount() != null) {
            joiner.add(getAmount().toUrlQueryString(prefix + "amount" + suffix));
        }

        // add `treatAsGrossAmount` to the URL query string
        if (getTreatAsGrossAmount() != null) {
            joiner.add(
                    String.format(
                            "%streatAsGrossAmount%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            String.valueOf(getTreatAsGrossAmount()),
                                            StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `forceSweep` to the URL query string
        if (getForceSweep() != null) {
            joiner.add(
                    String.format(
                            "%sforceSweep%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            String.valueOf(getForceSweep()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `feeLevel` to the URL query string
        if (getFeeLevel() != null) {
            joiner.add(
                    String.format(
                            "%sfeeLevel%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(String.valueOf(getFeeLevel()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `fee` to the URL query string
        if (getFee() != null) {
            joiner.add(getFee().toUrlQueryString(prefix + "fee" + suffix));
        }

        // add `priorityFee` to the URL query string
        if (getPriorityFee() != null) {
            joiner.add(getPriorityFee().toUrlQueryString(prefix + "priorityFee" + suffix));
        }

        // add `failOnLowFee` to the URL query string
        if (getFailOnLowFee() != null) {
            joiner.add(
                    String.format(
                            "%sfailOnLowFee%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            String.valueOf(getFailOnLowFee()),
                                            StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `maxFee` to the URL query string
        if (getMaxFee() != null) {
            joiner.add(
                    String.format(
                            "%smaxFee%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(String.valueOf(getMaxFee()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `maxTotalFee` to the URL query string
        if (getMaxTotalFee() != null) {
            joiner.add(
                    String.format(
                            "%smaxTotalFee%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            String.valueOf(getMaxTotalFee()),
                                            StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `gasLimit` to the URL query string
        if (getGasLimit() != null) {
            joiner.add(getGasLimit().toUrlQueryString(prefix + "gasLimit" + suffix));
        }

        // add `gasPrice` to the URL query string
        if (getGasPrice() != null) {
            joiner.add(getGasPrice().toUrlQueryString(prefix + "gasPrice" + suffix));
        }

        // add `networkFee` to the URL query string
        if (getNetworkFee() != null) {
            joiner.add(getNetworkFee().toUrlQueryString(prefix + "networkFee" + suffix));
        }

        // add `replaceTxByHash` to the URL query string
        if (getReplaceTxByHash() != null) {
            joiner.add(
                    String.format(
                            "%sreplaceTxByHash%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            String.valueOf(getReplaceTxByHash()),
                                            StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `extraParameters` to the URL query string
        if (getExtraParameters() != null) {
            joiner.add(
                    String.format(
                            "%sextraParameters%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            String.valueOf(getExtraParameters()),
                                            StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `customerRefId` to the URL query string
        if (getCustomerRefId() != null) {
            joiner.add(
                    String.format(
                            "%scustomerRefId%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            String.valueOf(getCustomerRefId()),
                                            StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `travelRuleMessage` to the URL query string
        if (getTravelRuleMessage() != null) {
            joiner.add(
                    getTravelRuleMessage().toUrlQueryString(prefix + "travelRuleMessage" + suffix));
        }

        // add `autoStaking` to the URL query string
        if (getAutoStaking() != null) {
            joiner.add(
                    String.format(
                            "%sautoStaking%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            String.valueOf(getAutoStaking()),
                                            StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        // add `networkStaking` to the URL query string
        if (getNetworkStaking() != null) {
            joiner.add(getNetworkStaking().toUrlQueryString(prefix + "networkStaking" + suffix));
        }

        // add `cpuStaking` to the URL query string
        if (getCpuStaking() != null) {
            joiner.add(getCpuStaking().toUrlQueryString(prefix + "cpuStaking" + suffix));
        }

        // add `useGasless` to the URL query string
        if (getUseGasless() != null) {
            joiner.add(
                    String.format(
                            "%suseGasless%s=%s",
                            prefix,
                            suffix,
                            URLEncoder.encode(
                                            String.valueOf(getUseGasless()), StandardCharsets.UTF_8)
                                    .replaceAll("\\+", "%20")));
        }

        return joiner.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy