// Copyright (C) 2020-2022 Notus Network
//
// Notus Network is free software distributed under the MIT software license,
// see the accompanying file LICENSE in the main directory of the
// project or http://www.opensource.org/licenses/mit-license.php
// for more details.
//
// Redistribution and use in source and binary forms with or without
// modifications are permitted.

export type Block = {
  info: Info;
  cipher: Cipher;
  hash: Hash;
  miner: Miner;
  nonce: Nonce2;
  prev: string;
  sign: string;
};

export type Nonce2 = {
  block: string;
  data: string;
  info: string;
};

type Nonce = {
  method: number;
  type: number;
  difficulty: number;
};

type Keeper = {
  key: boolean;
  block: boolean;
  file: boolean;
  tor: boolean;
};

type Node = {
  id: string;
  master: boolean;
  replicant: boolean;
  broadcaster: boolean;
  miner: boolean;
  executor: boolean;
  keeper: Keeper;
};

type Info = {
  version: number;
  type: number;
  uID: string;
  time: string;
  multi: boolean;
  rowNo: number;
  nonce: Nonce;
  node: Node;
  prevList: Record<string, string>;
};

type Cipher = {
  ver: string;
  data: string;
  sign: string;
};

type Hash = {
  block: string;
  data: string;
  info: string;
  FINAL: string;
};

type Map = {
  block: Record<number, string>;
  data: Record<number, string>;
  info: Record<number, string>;
};

type Miner = {
  count: Record<string, number>;
  map: Map;
  sign: string;
};
