package io.synor.privacy;

import com.google.gson.annotations.SerializedName;

/**
 * Privacy SDK type definitions.
 */
public class PrivacyTypes {

    // ==================== Confidential Transactions ====================

    public static class ConfidentialTxInput {
        @SerializedName("commitment")
        public String commitment;

        @SerializedName("blinding_factor")
        public String blindingFactor;

        @SerializedName("value")
        public String value;

        @SerializedName("key_image")
        public String keyImage;
    }

    public static class ConfidentialTxOutput {
        @SerializedName("commitment")
        public String commitment;

        @SerializedName("blinding_factor")
        public String blindingFactor;

        @SerializedName("value")
        public String value;

        @SerializedName("recipient_public_key")
        public String recipientPublicKey;

        @SerializedName("range_proof")
        public String rangeProof;
    }

    public static class ConfidentialTransaction {
        @SerializedName("id")
        public String id;

        @SerializedName("inputs")
        public ConfidentialTxInput[] inputs;

        @SerializedName("outputs")
        public ConfidentialTxOutput[] outputs;

        @SerializedName("fee")
        public String fee;

        @SerializedName("excess")
        public String excess;

        @SerializedName("excess_sig")
        public String excessSig;

        @SerializedName("kernel_offset")
        public String kernelOffset;
    }

    // ==================== Commitments ====================

    public static class Commitment {
        @SerializedName("commitment")
        public String commitment;

        @SerializedName("blinding_factor")
        public String blindingFactor;
    }

    public static class RangeProof {
        @SerializedName("proof")
        public String proof;

        @SerializedName("commitment")
        public String commitment;

        @SerializedName("min_value")
        public long minValue;

        @SerializedName("max_value")
        public long maxValue;
    }

    // ==================== Ring Signatures ====================

    public static class RingSignature {
        @SerializedName("c0")
        public String c0;

        @SerializedName("s")
        public String[] s;

        @SerializedName("key_image")
        public String keyImage;

        @SerializedName("ring")
        public String[] ring;
    }

    // ==================== Stealth Addresses ====================

    public static class StealthKeyPair {
        @SerializedName("spend_public_key")
        public String spendPublicKey;

        @SerializedName("spend_private_key")
        public String spendPrivateKey;

        @SerializedName("view_public_key")
        public String viewPublicKey;

        @SerializedName("view_private_key")
        public String viewPrivateKey;
    }

    public static class StealthAddress {
        @SerializedName("address")
        public String address;

        @SerializedName("ephemeral_public_key")
        public String ephemeralPublicKey;

        @SerializedName("tx_public_key")
        public String txPublicKey;
    }

    public static class StealthOutput {
        @SerializedName("tx_hash")
        public String txHash;

        @SerializedName("output_index")
        public int outputIndex;

        @SerializedName("stealth_address")
        public String stealthAddress;

        @SerializedName("amount")
        public String amount;

        @SerializedName("block_height")
        public long blockHeight;
    }
}
