1
0
Fork 0
forked from lthn/blockchain

Merge remote-tracking branch 'origin/frontend'

This commit is contained in:
wildkif 2019-01-16 12:37:55 +02:00
commit 0ffd3389b4
185 changed files with 15269 additions and 31668 deletions

View file

@ -37,7 +37,6 @@ if(TESTNET)
endif()
set(BUILD_GUI FALSE CACHE BOOL "Build qt-daemon")
set(USE_OPENCL FALSE CACHE BOOL "Build with opencl miner")
set(STATIC ${MSVC} CACHE BOOL "Link libraries statically")
@ -171,18 +170,6 @@ if(BUILD_GUI)
find_package(Qt5Widgets REQUIRED)
endif()
if(USE_OPENCL)
find_package( OpenCL )
if(NOT OpenCL_FOUND)
# add some Opencl
endif()
include_directories( ${OpenCL_INCLUDE_DIRS} )
include_directories( ${OpenCL_INCLUDE_DIR} )
add_definitions(-DUSE_OPENCL)
endif()
set(COMMIT_ID_IN_VERSION ON CACHE BOOL "Include commit ID in version")
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/version")
if (NOT COMMIT_ID_IN_VERSION)

View file

@ -104,6 +104,7 @@ struct response_schema
"\"time_started\": " << ce.time_started << ", "
"\"last_recv\": " << ce.last_recv << ", "
"\"last_send\": " << ce.last_send << ", "
"\"version\": " << ce.version << ", "
"\"is_income\": " << ce.is_income << "}";
if(rs.ns_rsp.v.connections_list.size()-1 != i)
ss << ",";
@ -373,19 +374,19 @@ bool generate_genesis(const std::string& path_config, uint64_t premine_split_amo
uint64_t total_this = 0;
double total_usd_eq = 0;
#define COLUMN_INTERVAL_LAYOUT 30
std::stringstream ss;
ss.precision(10);
ss << std::setw(15) << std::left << "NAME" << std::setw(15) << std::left << "AMOUNT" << std::setw(15) << std::left << "AMOUNT THIS" << std::setw(15) << std::left << "USD EQ" << ENDL;
ss << std::setw(COLUMN_INTERVAL_LAYOUT) << std::left << "NAME" << std::setw(COLUMN_INTERVAL_LAYOUT) << std::left << "AMOUNT" << std::setw(COLUMN_INTERVAL_LAYOUT) << std::left << "AMOUNT THIS" << std::setw(COLUMN_INTERVAL_LAYOUT) << std::left << "USD EQ" << ENDL;
for (auto& se : payments_stat)
{
ss << std::setw(15) << std::left << se.first << std::setw(15) << std::fixed << std::left << se.second.amount_total << std::setw(15) << std::fixed << std::left << print_money(se.second.amount_paid_this) << std::setw(15) << std::fixed << std::left << se.second.amount_usd_eq << ENDL;
ss << std::setw(COLUMN_INTERVAL_LAYOUT) << std::left << se.first << std::setw(COLUMN_INTERVAL_LAYOUT) << std::fixed << std::left << se.second.amount_total << std::setw(COLUMN_INTERVAL_LAYOUT) << std::fixed << std::left << print_money(se.second.amount_paid_this) << std::setw(COLUMN_INTERVAL_LAYOUT) << std::fixed << std::left << se.second.amount_usd_eq << ENDL;
total_this += se.second.amount_paid_this;
total_usd_eq += se.second.amount_usd_eq;
}
ss << ENDL << std::setw(15) << std::left << "TOTAL" << std::setw(15) << std::fixed << std::left << " " << std::setw(15) << std::fixed << std::left << print_money(total_this) << std::setw(15) << std::fixed << std::left << total_usd_eq << ENDL;
ss << ENDL << std::setw(COLUMN_INTERVAL_LAYOUT) << std::left << "TOTAL" << std::setw(COLUMN_INTERVAL_LAYOUT) << std::fixed << std::left << " " << std::setw(COLUMN_INTERVAL_LAYOUT) << std::fixed << std::left << print_money(total_this) << std::setw(COLUMN_INTERVAL_LAYOUT) << std::fixed << std::left << total_usd_eq << ENDL;
ss << ENDL << std::setw(15) << std::left << "PREMINE_AMOUNT" << std::setw(15) << std::fixed << std::left << " " << std::setw(15) << std::fixed << std::left << total_this << "(" << print_money(total_this) <<"THIS)" << ENDL;
ss << ENDL << std::setw(COLUMN_INTERVAL_LAYOUT) << std::left << "PREMINE_AMOUNT" << std::setw(COLUMN_INTERVAL_LAYOUT) << std::fixed << std::left << " " << std::setw(COLUMN_INTERVAL_LAYOUT) << std::fixed << std::left << total_this << "(" << print_money(total_this) <<"THIS)" << ENDL;
epee::log_space::set_console_color(epee::log_space::console_colors::console_color_magenta, true);
std::cout << "GENESIS STAT: " << ENDL << ss.str();
@ -450,6 +451,7 @@ bool generate_genesis(const std::string& path_config, uint64_t premine_split_amo
return true;
}
#undef COLUMN_INTERVAL_LAYOUT
//---------------------------------------------------------------------------------------------------------------
bool handle_get_aliases(po::variables_map& vm)
{

133
src/crypto/wild_keccak.cpp Normal file
View file

@ -0,0 +1,133 @@
// keccak.c
// 19-Nov-11 Markku-Juhani O. Saarinen <mjos@iki.fi>
// A baseline Keccak (3rd round) implementation.
// Memory-hard extension of keccak for PoW
// Copyright (c) 2014 The Boolberry developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "wild_keccak.h"
namespace crypto
{
const uint64_t keccakf_rndc[24] =
{
0x0000000000000001, 0x0000000000008082, 0x800000000000808a,
0x8000000080008000, 0x000000000000808b, 0x0000000080000001,
0x8000000080008081, 0x8000000000008009, 0x000000000000008a,
0x0000000000000088, 0x0000000080008009, 0x000000008000000a,
0x000000008000808b, 0x800000000000008b, 0x8000000000008089,
0x8000000000008003, 0x8000000000008002, 0x8000000000000080,
0x000000000000800a, 0x800000008000000a, 0x8000000080008081,
0x8000000000008080, 0x0000000080000001, 0x8000000080008008
};
const int keccakf_rotc[24] =
{
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 2, 14,
27, 41, 56, 8, 25, 43, 62, 18, 39, 61, 20, 44
};
const int keccakf_piln[24] =
{
10, 7, 11, 17, 18, 3, 5, 16, 8, 21, 24, 4,
15, 23, 19, 13, 12, 2, 20, 14, 22, 9, 6, 1
};
// update the state with given number of rounds
void regular_f::keccakf(uint64_t st[25], int rounds)
{
int i, j, round;
uint64_t t, bc[5];
for (round = 0; round < rounds; round++) {
// Theta
for (i = 0; i < 5; i++)
bc[i] = st[i] ^ st[i + 5] ^ st[i + 10] ^ st[i + 15] ^ st[i + 20];
for (i = 0; i < 5; i++) {
t = bc[(i + 4) % 5] ^ ROTL64(bc[(i + 1) % 5], 1);
for (j = 0; j < 25; j += 5)
st[j + i] ^= t;
}
// Rho Pi
t = st[1];
for (i = 0; i < 24; i++) {
j = keccakf_piln[i];
bc[0] = st[j];
st[j] = ROTL64(t, keccakf_rotc[i]);
t = bc[0];
}
// Chi
for (j = 0; j < 25; j += 5) {
for (i = 0; i < 5; i++)
bc[i] = st[j + i];
for (i = 0; i < 5; i++)
st[j + i] ^= (~bc[(i + 1) % 5]) & bc[(i + 2) % 5];
}
// Iota
st[0] ^= keccakf_rndc[round];
}
}
void mul_f::keccakf(uint64_t st[25], int rounds)
{
int i, j, round;
uint64_t t, bc[5];
for (round = 0; round < rounds; round++) {
// Theta
for (i = 0; i < 5; i++)
{
bc[i] = st[i] ^ st[i + 5] ^ st[i + 10] * st[i + 15] * st[i + 20];//surprise
}
for (i = 0; i < 5; i++) {
t = bc[(i + 4) % 5] ^ ROTL64(bc[(i + 1) % 5], 1);
for (j = 0; j < 25; j += 5)
st[j + i] ^= t;
}
// Rho Pi
t = st[1];
for (i = 0; i < 24; i++) {
j = keccakf_piln[i];
bc[0] = st[j];
st[j] = ROTL64(t, keccakf_rotc[i]);
t = bc[0];
}
// Chi
for (j = 0; j < 25; j += 5) {
for (i = 0; i < 5; i++)
bc[i] = st[j + i];
for (i = 0; i < 5; i++)
st[j + i] ^= (~bc[(i + 1) % 5]) & bc[(i + 2) % 5];
}
// Iota
st[0] ^= keccakf_rndc[round];
}
}
bool generate_scratchpad(const crypto::hash& seed_data, std::vector<crypto::hash>& result_data, uint64_t target_size)
{
//this is very basic implementation, not considered for production (possible to reduce memory by keeping only every x10 item and calc it instead of read)
//TODO: research safe way for scratchpad generation
result_data.resize(target_size);
result_data[0] = crypto::cn_fast_hash(&seed_data, sizeof(seed_data));
//crypto::hash = get_transaction_hash()
for (size_t i = 1; i < target_size; i++)
{
result_data[i] = crypto::cn_fast_hash(&result_data[i - 1], sizeof(result_data[i - 1]));
}
return true;
}
}

284
src/crypto/wild_keccak.h Normal file
View file

@ -0,0 +1,284 @@
// keccak.h
// 19-Nov-11 Markku-Juhani O. Saarinen <mjos@iki.fi>
// Copyright (c) 2014 The Boolberry developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <stdint.h>
#include <string.h>
#include "crypto.h"
extern "C" {
//#include "crypto/alt/KeccakNISTInterface.h"
}
#ifndef KECCAK_ROUNDS
#define KECCAK_ROUNDS 24
#endif
#ifndef ROTL64
#define ROTL64(x, y) (((x) << (y)) | ((x) >> (64 - (y))))
#endif
#define KK_MIXIN_SIZE 24
namespace crypto
{
#define OPT_XOR_4_RES(A_, B_, C_, D_, Res) \
crypto::hash A = A_;crypto::hash B = B_;crypto::hash C = C_; crypto::hash D = D_; \
((uint64_t*)&Res)[0] = ((const uint64_t*)&A)[0] ^ ((const uint64_t*)&B)[0] ^ ((const uint64_t*)&C)[0] ^ ((const uint64_t*)&D)[0]; \
((uint64_t*)&Res)[1] = ((const uint64_t*)&A)[1] ^ ((const uint64_t*)&B)[1] ^ ((const uint64_t*)&C)[1] ^ ((const uint64_t*)&D)[1]; \
((uint64_t*)&Res)[2] = ((const uint64_t*)&A)[2] ^ ((const uint64_t*)&B)[2] ^ ((const uint64_t*)&C)[2] ^ ((const uint64_t*)&D)[2]; \
((uint64_t*)&Res)[3] = ((const uint64_t*)&A)[3] ^ ((const uint64_t*)&B)[3] ^ ((const uint64_t*)&C)[3] ^ ((const uint64_t*)&D)[3];
typedef uint64_t state_t_m[25];
typedef uint64_t mixin_t[KK_MIXIN_SIZE];
//with multiplication, for tests
template<class f_traits>
int keccak_generic(const uint8_t *in, size_t inlen, uint8_t *md, size_t mdlen)
{
state_t_m st;
uint8_t temp[144];
size_t i, rsiz, rsizw;
rsiz = sizeof(state_t_m) == mdlen ? HASH_DATA_AREA : 200 - 2 * mdlen;
rsizw = rsiz / 8;
memset(st, 0, sizeof(st));
for ( ; inlen >= rsiz; inlen -= rsiz, in += rsiz) {
for (i = 0; i < rsizw; i++)
st[i] ^= ((uint64_t *) in)[i];
f_traits::keccakf(st, KECCAK_ROUNDS);
}
// last block and padding
memcpy(temp, in, inlen);
temp[inlen++] = 1;
memset(temp + inlen, 0, rsiz - inlen);
temp[rsiz - 1] |= 0x80;
for (i = 0; i < rsizw; i++)
st[i] ^= ((uint64_t *) temp)[i];
f_traits::keccakf(st, KECCAK_ROUNDS);
memcpy(md, st, mdlen);
return 0;
}
/*inline
void print_state(UINT64* state, const char* comment, size_t rount)
{
printf("master_funct: %s round: %d\r\n", comment, rount);
int i;
for(i = 0; i != 25; i++)
{
printf("[%i]: %p\r\n", i, state[i]);
}
}*/
template<class f_traits, class callback_t>
int wild_keccak(const uint8_t *in, size_t inlen, uint8_t *md, size_t mdlen, callback_t cb)
{
state_t_m st;
uint8_t temp[144];
uint64_t rsiz, rsizw;
rsiz = sizeof(state_t_m) == mdlen ? HASH_DATA_AREA : 200 - 2 * mdlen;
rsizw = rsiz / 8;
memset(&st[0], 0, 25*sizeof(st[0]));
for ( ; inlen >= rsiz; inlen -= rsiz, in += rsiz)
{
for (size_t i = 0; i < rsizw; i++)
st[i] ^= ((uint64_t *) in)[i];
for(size_t ll = 0; ll != KECCAK_ROUNDS; ll++)
{
if(ll != 0)
{//skip first round
mixin_t mix_in;
cb(st, mix_in);
for (size_t k = 0; k < KK_MIXIN_SIZE; k++)
st[k] ^= mix_in[k];
}
//print_state(&st[0], "before_permut", ll);
f_traits::keccakf(st, 1);
//print_state(&st[0], "after_permut", ll);
}
}
// last block and padding
memcpy(temp, in, inlen);
temp[inlen++] = 1;
memset(temp + inlen, 0, rsiz - inlen);
temp[rsiz - 1] |= 0x80;
for (size_t i = 0; i < rsizw; i++)
st[i] ^= ((uint64_t *) temp)[i];
for(size_t ll = 0; ll != KECCAK_ROUNDS; ll++)
{
if(ll != 0)
{//skip first state with
mixin_t mix_in;
cb(st, mix_in);
for (size_t k = 0; k < KK_MIXIN_SIZE; k++)
st[k] ^= mix_in[k];
}
f_traits::keccakf(st, 1);
}
memcpy(md, st, mdlen);
return 0;
}
template<class f_traits, class callback_t>
int wild_keccak2(const uint8_t *in, size_t inlen, uint8_t *md, size_t mdlen, callback_t cb)
{
state_t_m st;
uint8_t temp[144];
uint64_t rsiz, rsizw;
rsiz = sizeof(state_t_m) == mdlen ? HASH_DATA_AREA : 200 - 2 * mdlen;
rsizw = rsiz / 8;
memset(&st[0], 0, 25 * sizeof(st[0]));
for (; inlen >= rsiz; inlen -= rsiz, in += rsiz)
{
for (size_t i = 0; i < rsizw; i++)
st[i] ^= ((uint64_t *)in)[i];
for (int keccak_round = 0; keccak_round != KECCAK_ROUNDS; keccak_round++)
{
f_traits::keccakf(st, keccak_round);
cb(st);
}
}
// last block and padding
memcpy(temp, in, inlen);
temp[inlen++] = 1;
memset(temp + inlen, 0, rsiz - inlen);
temp[rsiz - 1] |= 0x80;
for (size_t i = 0; i < rsizw; i++)
st[i] ^= ((uint64_t *)temp)[i];
for (int keccak_round = 0; keccak_round != KECCAK_ROUNDS; keccak_round++)
{
f_traits::keccakf(st, keccak_round);
cb(st);
}
memcpy(md, st, mdlen);
return 0;
}
template<class f_traits, class callback_t>
int wild_keccak_dbl(const uint8_t *in, size_t inlen, uint8_t *md, size_t mdlen, callback_t cb)
{
//Satoshi's classic
wild_keccak<f_traits>(in, inlen, md, mdlen, cb);
wild_keccak<f_traits>(md, mdlen, md, mdlen, cb);
return 0;
}
template<class f_traits, class callback_t>
int wild_keccak2_dbl(const uint8_t *in, size_t inlen, uint8_t *md, size_t mdlen, callback_t cb)
{
//Satoshi's classic
wild_keccak2<f_traits>(in, inlen, md, mdlen, cb);
wild_keccak2<f_traits>(md, mdlen, md, mdlen, cb);
return 0;
}
class regular_f
{
public:
static void keccakf(uint64_t st[25], int rounds);
};
class mul_f
{
public:
static void keccakf(uint64_t st[25], int rounds);
};
//------------------------------------------------------------------
inline
bool get_wild_keccak2(const std::string& bd, crypto::hash& res, const std::vector<crypto::hash>& scratchpad, uint64_t sz)
{
crypto::wild_keccak2_dbl<crypto::regular_f>(reinterpret_cast<const uint8_t*>(bd.data()), bd.size(), reinterpret_cast<uint8_t*>(&res), sizeof(res), [&](crypto::state_t_m& st)
{
if (!sz)
{
return;
}
const uint64_t* int_array_ptr = (const uint64_t*)&scratchpad[0];
size_t int64_sz = sz * 4;
for (size_t i = 0; i != sizeof(st) / sizeof(st[0]); i++)
{
size_t depend_index = 0;
if (i == 0)
{
depend_index = sizeof(st) / sizeof(st[0]) - 1;
}
else
{
depend_index = i - 1;
}
st[i] ^= int_array_ptr[ int_array_ptr[ int_array_ptr[st[depend_index] % int64_sz] % int64_sz] % int64_sz];
}
});
return true;
}
//------------------------------------------------------------------
inline
bool get_wild_keccak2(const std::string& bd, crypto::hash& res, const std::vector<crypto::hash>& scratchpad)
{
return get_wild_keccak2(bd, res, scratchpad, scratchpad.size());
}
//------------------------------------------------------------------
inline
bool get_wild_keccak(const std::string& bd, crypto::hash& res, uint64_t height, const std::vector<crypto::hash>& scratchpad, uint64_t sz)
{
crypto::wild_keccak_dbl<crypto::mul_f>(reinterpret_cast<const uint8_t*>(bd.data()), bd.size(), reinterpret_cast<uint8_t*>(&res), sizeof(res), [&](crypto::state_t_m& st, crypto::mixin_t& mix)
{
if (!height)
{
memset(&mix, 0, sizeof(mix));
return;
}
#define OPT_GET_H(index) scratchpad[st[index]%sz]
#define OPT_GET_M(index) scratchpad[mix[index]%sz]
for (size_t i = 0; i != 6; i++)
{
OPT_XOR_4_RES(OPT_GET_H(i * 4), OPT_GET_H(i * 4 + 1), OPT_GET_H(i * 4 + 2), OPT_GET_H(i * 4 + 3), (*(crypto::hash*)&mix[i * 4]));
}
});
return true;
}
//------------------------------------------------------------------
bool generate_scratchpad(const crypto::hash& source_data, std::vector<crypto::hash>& result_data, uint64_t target_size);
}

View file

@ -1,76 +0,0 @@
// keccak.c
// 19-Nov-11 Markku-Juhani O. Saarinen <mjos@iki.fi>
// A baseline Keccak (3rd round) implementation.
// Memory-hard extension of keccak for PoW
// Copyright (c) 2014 The Boolberry developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "wild_keccak.h"
namespace crypto
{
const uint64_t keccakf_rndc[24] =
{
0x0000000000000001, 0x0000000000008082, 0x800000000000808a,
0x8000000080008000, 0x000000000000808b, 0x0000000080000001,
0x8000000080008081, 0x8000000000008009, 0x000000000000008a,
0x0000000000000088, 0x0000000080008009, 0x000000008000000a,
0x000000008000808b, 0x800000000000008b, 0x8000000000008089,
0x8000000000008003, 0x8000000000008002, 0x8000000000000080,
0x000000000000800a, 0x800000008000000a, 0x8000000080008081,
0x8000000000008080, 0x0000000080000001, 0x8000000080008008
};
const int keccakf_rotc[24] =
{
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 2, 14,
27, 41, 56, 8, 25, 43, 62, 18, 39, 61, 20, 44
};
const int keccakf_piln[24] =
{
10, 7, 11, 17, 18, 3, 5, 16, 8, 21, 24, 4,
15, 23, 19, 13, 12, 2, 20, 14, 22, 9, 6, 1
};
// update the state with given number of rounds
void regular_f::keccakf2(uint64_t st[25], int round_index)
{
int i, j, round;
uint64_t t, bc[5];
// Theta
for (i = 0; i < 5; i++)
bc[i] = st[i] ^ st[i + 5] ^ st[i + 10] ^ st[i + 15] ^ st[i + 20];
for (i = 0; i < 5; i++) {
t = bc[(i + 4) % 5] ^ ROTL64(bc[(i + 1) % 5], 1);
for (j = 0; j < 25; j += 5)
st[j + i] ^= t;
}
// Rho Pi
t = st[1];
for (i = 0; i < 24; i++) {
j = keccakf_piln[i];
bc[0] = st[j];
st[j] = ROTL64(t, keccakf_rotc[i]);
t = bc[0];
}
// Chi
for (j = 0; j < 25; j += 5) {
for (i = 0; i < 5; i++)
bc[i] = st[j + i];
for (i = 0; i < 5; i++)
st[j + i] ^= (~bc[(i + 1) % 5]) & bc[(i + 2) % 5];
}
// Iota
st[0] ^= keccakf_rndc[round_index];
}
}

View file

@ -1,149 +0,0 @@
// keccak.h
// 19-Nov-11 Markku-Juhani O. Saarinen <mjos@iki.fi>
// Copyright (c) 2014 The Boolberry developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <stdint.h>
#include <string.h>
#include "crypto.h"
extern "C" {
#include "crypto/alt/KeccakNISTInterface.h"
}
#ifndef KECCAK_ROUNDS
#define KECCAK_ROUNDS 24
#endif
#ifndef ROTL64
#define ROTL64(x, y) (((x) << (y)) | ((x) >> (64 - (y))))
#endif
// compute a keccak hash (md) of given byte length from "in"
#define KK_MIXIN_SIZE 24
namespace crypto
{
inline
// void wild_keccak_dbl_opt(const uint8_t *in, size_t inlen, uint8_t *md, size_t mdlen, const UINT64* pscr, UINT64 scr_sz)
// {
// Hash(256, in, inlen*8, md, pscr, scr_sz);
// Hash(256, md, mdlen*8, md, pscr, scr_sz);
// }
template<typename pod_operand_a, typename pod_operand_b>
pod_operand_a xor_pod(const pod_operand_a& a, const pod_operand_b& b)
{
static_assert(sizeof(pod_operand_a) == sizeof(pod_operand_b), "invalid xor_h usage: different sizes");
static_assert(sizeof(pod_operand_a)%8 == 0, "invalid xor_h usage: wrong size");
hash r;
for(size_t i = 0; i != 4; i++)
{
((uint64_t*)&r)[i] = ((const uint64_t*)&a)[i] ^ ((const uint64_t*)&b)[i];
}
return r;
}
#define XOR_2(A, B) crypto::xor_pod(A, B)
#define XOR_3(A, B, C) crypto::xor_pod(A, XOR_2(B, C))
#define XOR_4(A, B, C, D) crypto::xor_pod(A, XOR_3(B, C, D))
#define XOR_5(A, B, C, D, E) crypto::xor_pod(A, XOR_4(B, C, D, E))
#define XOR_8(A, B, C, D, F, G, H, I) crypto::xor_pod(XOR_4(A, B, C, D), XOR_4(F, G, H, I))
typedef uint64_t state_t_m[25];
typedef uint64_t mixin_t[KK_MIXIN_SIZE];
template<class f_traits, class callback_t>
int wild_keccak2(const uint8_t *in, size_t inlen, uint8_t *md, size_t mdlen, callback_t cb)
{
state_t_m st;
uint8_t temp[144];
uint64_t rsiz, rsizw;
rsiz = sizeof(state_t_m) == mdlen ? HASH_DATA_AREA : 200 - 2 * mdlen;
rsizw = rsiz / 8;
memset(&st[0], 0, 25*sizeof(st[0]));
for ( ; inlen >= rsiz; inlen -= rsiz, in += rsiz)
{
for (size_t i = 0; i < rsizw; i++)
st[i] ^= ((uint64_t *) in)[i];
for(size_t keccak_round = 0; keccak_round != KECCAK_ROUNDS; keccak_round++)
{
if(keccak_round != 0)
{//skip first round
mixin_t mix_in;
cb(st, mix_in);
for (size_t k = 0; k < KK_MIXIN_SIZE; k++)
st[k] ^= mix_in[k];
}
//print_state(&st[0], "before_permut", ll);
f_traits::keccakf(st, 1);
//print_state(&st[0], "after_permut", ll);
}
}
// last block and padding
memcpy(temp, in, inlen);
temp[inlen++] = 1;
memset(temp + inlen, 0, rsiz - inlen);
temp[rsiz - 1] |= 0x80;
for (size_t i = 0; i < rsizw; i++)
st[i] ^= ((uint64_t *) temp)[i];
for(size_t keccak_round = 0; keccak_round != KECCAK_ROUNDS; keccak_round++)
{
if(keccak_round != 0)
{//skip first state with
mixin_t mix_in;
cb(st, mix_in);
for (size_t k = 0; k < KK_MIXIN_SIZE; k++)
st[k] ^= mix_in[k];
}
f_traits::keccakf(st, 1);
}
memcpy(md, st, mdlen);
return 0;
}
template<class f_traits, class callback_t>
int wild_keccak2_dbl(const uint8_t *in, size_t inlen, uint8_t *md, size_t mdlen, crypto::hash* pscratchpad, uint64_t sz)
{
//Satoshi's classic
regular_f::wild_keccak2(in, inlen, md, mdlen, cb);
regular_f::wild_keccak2(md, mdlen, md, mdlen, cb);
return 0;
}
class regular_f
{
public:
static void keccakf(uint64_t st[25], int rounds);
};
//
// class mul_f
// {
// public:
// static void keccakf(uint64_t st[25], int rounds);
// };
}

View file

@ -98,13 +98,20 @@ blockchain_storage::blockchain_storage(tx_memory_pool& tx_pool) :m_db(std::share
m_interprocess_locker_file(0),
m_current_fee_median(0),
m_current_fee_median_effective_index(0),
m_is_reorganize_in_process(false)
m_is_reorganize_in_process(false),
m_deinit_is_done(false)
{
m_services_mgr.set_core_runtime_config(m_core_runtime_config);
m_performance_data.epic_failure_happend = false;
}
blockchain_storage::~blockchain_storage()
{
if (!m_deinit_is_done)
deinit();
}
//------------------------------------------------------------------
bool blockchain_storage::have_tx(const crypto::hash &id) const
{
@ -264,7 +271,6 @@ bool blockchain_storage::init(const std::string& config_folder, const boost::pro
if (m_db_storage_minor_compatibility_version < 1)
need_reinit_medians = true;
}
if (need_reinit)
{
clear();
@ -316,6 +322,7 @@ bool blockchain_storage::deinit()
{
m_db.close();
epee::file_io_utils::unlock_and_close_file(m_interprocess_locker_file);
m_deinit_is_done = true;
return true;
}
//------------------------------------------------------------------
@ -1100,16 +1107,16 @@ uint64_t blockchain_storage::get_current_comulative_blocksize_limit() const
return m_db_current_block_cumul_sz_limit;
}
//------------------------------------------------------------------
bool blockchain_storage::create_block_template(block& b,
bool blockchain_storage::create_block_template(block& b, crypto::hash& seed,
const account_public_address& miner_address,
wide_difficulty_type& diffic,
uint64_t& height,
const blobdata& ex_nonce) const
{
return create_block_template(b, miner_address, miner_address, diffic, height, ex_nonce, false, pos_entry());
return create_block_template(b, seed, miner_address, miner_address, diffic, height, ex_nonce, false, pos_entry());
}
//------------------------------------------------------------------
bool blockchain_storage::create_block_template(block& b,
bool blockchain_storage::create_block_template(block& b, crypto::hash& seed,
const account_public_address& miner_address,
const account_public_address& stakeholder_address,
wide_difficulty_type& diffic,
@ -1119,6 +1126,7 @@ bool blockchain_storage::create_block_template(block& b,
const pos_entry& pe,
fill_block_template_func_t custom_fill_block_template_func /* = nullptr */) const
{
seed = m_current_scratchpad_seed;
size_t median_size;
uint64_t already_generated_coins;
CRITICAL_REGION_BEGIN(m_read_lock);
@ -1320,6 +1328,7 @@ bool blockchain_storage::purge_altblock_keyimages_from_big_heap(const block& b,
}
return true;
}
//------------------------------------------------------------------
bool blockchain_storage::handle_alternative_block(const block& b, const crypto::hash& id, block_verification_context& bvc)
{
@ -1347,15 +1356,24 @@ bool blockchain_storage::handle_alternative_block(const block& b, const crypto::
alt_chain_type alt_chain;
{
//we have new block in alternative chain
//build alternative subchain, front -> mainchain, back -> alternative head
//build alternative subchain, front -> mainchain, back -> alternative head
alt_chain_container::iterator alt_it = it_prev; //m_alternative_chains.find()
std::vector<uint64_t> timestamps;
std::list<alt_chain_container::iterator> temp_container;
while (alt_it != m_alternative_chains.end())
{
alt_chain.push_front(alt_it);
temp_container.push_front(alt_it);
timestamps.push_back(alt_it->second.bl.timestamp);
alt_it = m_alternative_chains.find(alt_it->second.bl.prev_id);
}
//TODO: refactoring needed: vector push_front is dramatically ineffective
alt_chain.resize(temp_container.size());
auto it_vec = alt_chain.begin();
for (auto it = temp_container.begin(); it != temp_container.end();it++, it_vec++)
{
*it_vec = *it;
}
if (alt_chain.size())
{
@ -1433,7 +1451,11 @@ bool blockchain_storage::handle_alternative_block(const block& b, const crypto::
}
else
{
proof_of_work = get_block_longhash(abei.bl);
crypto::hash seed = null_hash;
get_seed_for_scratchpad_alt_chain(abei.height, seed, alt_chain);
proof_of_work = m_scratchpad.get_pow_hash(abei.bl, seed);
if (!check_hash(proof_of_work, current_diff))
{
LOG_PRINT_RED_L0("Block with id: " << id
@ -1585,9 +1607,8 @@ bool blockchain_storage::pre_validate_relayed_block(block& bl, block_verificatio
bvc.m_added_to_main_chain = true;
}
else
{
proof_hash = get_block_longhash(bl);
{
proof_hash = m_scratchpad.get_pow_hash(bl, m_current_scratchpad_seed); //get_block_longhash(bl);
if (!check_hash(proof_hash, current_diffic))
{
@ -4226,9 +4247,8 @@ bool blockchain_storage::handle_block_to_main_chain(const block& bl, const crypt
<< "expected: " << get_top_block_id());
return false;
}
#ifdef _DEBUG
uint64_t h = get_block_height(bl);
#endif// _DEBUG
if(!check_block_timestamp_main(bl))
{
@ -4273,7 +4293,12 @@ bool blockchain_storage::handle_block_to_main_chain(const block& bl, const crypt
}
else
{
proof_hash = get_block_longhash(bl);
//++++++++++++++++++++++++++++++++++++++++++++++++++++++
//precaution(do we really need this check?)
check_scratchpad();
//++++++++++++++++++++++++++++++++++++++++++++++++++++++
proof_hash = m_scratchpad.get_pow_hash(bl, m_current_scratchpad_seed);
if (!check_hash(proof_hash, current_diffic))
{
@ -4541,17 +4566,27 @@ void blockchain_storage::on_block_added(const block_extended_info& bei, const cr
{
update_next_comulative_size_limit();
m_timestamps_median_cache.clear();
check_scratchpad();
m_tx_pool.on_blockchain_inc(bei.height, id);
TIME_MEASURE_START_PD(raise_block_core_event);
rise_core_event(CORE_EVENT_BLOCK_ADDED, void_struct());
TIME_MEASURE_FINISH_PD(raise_block_core_event);
}
//------------------------------------------------------------------
bool blockchain_storage::check_scratchpad()
{
if (get_scratchpad_size_for_height(m_db_blocks.size()) != m_scratchpad.size())
{
get_seed_for_scratchpad(m_db_blocks.size(), m_current_scratchpad_seed);
}
return true;
}
//------------------------------------------------------------------
void blockchain_storage::on_block_removed(const block_extended_info& bei)
{
m_tx_pool.on_blockchain_dec(m_db_blocks.size() - 1, get_top_block_id());
m_timestamps_median_cache.clear();
check_scratchpad();
LOG_PRINT_L2("block at height " << bei.height << " was removed from the blockchain");
}
//------------------------------------------------------------------
@ -5285,6 +5320,41 @@ bool blockchain_storage::validate_alt_block_ms_input(const transaction& input_tx
return false;
}
//------------------------------------------------------------------
bool blockchain_storage::get_seed_for_scratchpad(uint64_t height, crypto::hash& seed)const
{
CRITICAL_REGION_LOCAL(m_read_lock);
return get_seed_for_scratchpad_cb(height, seed, [&](uint64_t index) -> crypto::hash
{
return get_block_hash(m_db_blocks[index]->bl);
});
}
//------------------------------------------------------------------
bool blockchain_storage::get_seed_for_scratchpad_alt_chain(uint64_t height, crypto::hash& seed, const alt_chain_type& alt_chain)const
{
CRITICAL_REGION_LOCAL(m_read_lock);
//alt_chain: front -> mainchain, back -> alternative head
uint64_t connection_to_main_chain = height;
if (alt_chain.size())
connection_to_main_chain = alt_chain.front()->second.height;
return get_seed_for_scratchpad_cb(height, seed, [&](uint64_t index) -> crypto::hash
{
if (index < connection_to_main_chain)
{
//addressed to main chain
return get_block_hash(m_db_blocks[index]->bl);
}
else
{
//addressed to alt chain
uint64_t offset = index - connection_to_main_chain;
CHECK_AND_ASSERT_THROW_MES(offset < alt_chain.size(), "Internal error: failed to validate offset(" << offset << ") < alt_chain.size()("<< alt_chain.size() <<")");
CHECK_AND_ASSERT_THROW_MES(alt_chain[offset]->second.height == index, "Internal error: failed to validate offset(" << offset << ") < alt_chain.size()(" << alt_chain.size() << ")");
return get_block_hash(alt_chain[offset]->second.bl);
}
});
}
//------------------------------------------------------------------
bool blockchain_storage::get_transaction_from_pool_or_db(const crypto::hash& tx_id, std::shared_ptr<transaction>& tx_ptr, uint64_t min_allowed_block_height /* = 0 */) const
{
tx_ptr.reset(new transaction());

View file

@ -39,6 +39,7 @@
#include "dispatch_core_events.h"
#include "bc_attachments_service_manager.h"
#include "common/median_db_cache.h"
#include "scratchpad_helper.h"
MARK_AS_POD_C11(crypto::key_image);
@ -151,7 +152,8 @@ namespace currency
std::map<uint64_t, std::vector<crypto::public_key> > outputs_pub_keys;
};
typedef std::unordered_map<crypto::hash, alt_block_extended_info> alt_chain_container;
typedef std::list<alt_chain_container::iterator> alt_chain_type;
//typedef std::list<alt_chain_container::iterator> alt_chain_type;
typedef std::vector<alt_chain_container::iterator> alt_chain_type;
typedef std::unordered_map<crypto::hash, block_extended_info> blocks_ext_by_hash;
@ -163,6 +165,7 @@ namespace currency
//---------------------------------------------------------------------------------
blockchain_storage(tx_memory_pool& tx_pool);
~blockchain_storage();
bool init(const boost::program_options::variables_map& vm) { return init(tools::get_default_data_dir(), vm); }
@ -228,8 +231,8 @@ namespace currency
wide_difficulty_type get_cached_next_difficulty(bool pos) const;
typedef bool fill_block_template_func_t(block &bl, bool pos, size_t median_size, uint64_t already_generated_coins, size_t &total_size, uint64_t &fee, uint64_t height);
bool create_block_template(block& b, const account_public_address& miner_address, const account_public_address& stakeholder_address, wide_difficulty_type& di, uint64_t& height, const blobdata& ex_nonce, bool pos, const pos_entry& pe, fill_block_template_func_t custom_fill_block_template_func = nullptr) const;
bool create_block_template(block& b, const account_public_address& miner_address, wide_difficulty_type& di, uint64_t& height, const blobdata& ex_nonce) const;
bool create_block_template(block& b, crypto::hash& seed, const account_public_address& miner_address, const account_public_address& stakeholder_address, wide_difficulty_type& di, uint64_t& height, const blobdata& ex_nonce, bool pos, const pos_entry& pe, fill_block_template_func_t custom_fill_block_template_func = nullptr) const;
bool create_block_template(block& b, crypto::hash& seed, const account_public_address& miner_address, wide_difficulty_type& di, uint64_t& height, const blobdata& ex_nonce) const;
bool have_block(const crypto::hash& id) const;
size_t get_total_transactions()const;
@ -508,6 +511,9 @@ namespace currency
mutable uint64_t m_current_fee_median;
mutable uint64_t m_current_fee_median_effective_index;
bool m_is_reorganize_in_process;
mutable scratchpad_keeper m_scratchpad;
crypto::hash m_current_scratchpad_seed;
mutable std::atomic<bool> m_deinit_is_done;
bool init_tx_fee_median();
@ -535,6 +541,10 @@ namespace currency
bool validate_alt_block_txs(const block& b, const crypto::hash& id, std::set<crypto::key_image>& collected_keyimages, alt_block_extended_info& abei, const alt_chain_type& alt_chain, uint64_t split_height, uint64_t& ki_lookup_time_total) const;
bool update_alt_out_indexes_for_tx_in_block(const transaction& tx, alt_block_extended_info& abei)const;
bool get_transaction_from_pool_or_db(const crypto::hash& tx_id, std::shared_ptr<transaction>& tx_ptr, uint64_t min_allowed_block_height = 0) const;
bool get_seed_for_scratchpad(uint64_t height, crypto::hash& seed)const ;
bool get_seed_for_scratchpad_alt_chain(uint64_t height, crypto::hash& seed, const alt_chain_type& alt_chain) const ;
bool check_scratchpad();
bool prevalidate_miner_transaction(const block& b, uint64_t height, bool pos)const;
bool validate_transaction(const block& b, uint64_t height, const transaction& tx)const;

View file

@ -32,7 +32,6 @@ namespace currency
//members that supposed to be accessed only from one thread
std::list<block_context_info> m_needed_objects;
std::unordered_set<crypto::hash> m_requested_objects;
std::string m_remote_version;
std::atomic<uint32_t> m_callback_request_count; //in debug purpose: problem with double callback rise
};
@ -51,6 +50,7 @@ namespace currency
uint64_t m_remote_blockchain_height;
uint64_t m_last_response_height;
int64_t m_time_delta;
std::string m_remote_version;
private:
template<class t_core> friend class t_currency_protocol_handler;
uncopybale_currency_context m_priv;

View file

@ -8,7 +8,7 @@
#pragma once
#define CURRENCY_FORMATION_VERSION 74
#define CURRENCY_FORMATION_VERSION 75
#define CURRENCY_MAX_BLOCK_NUMBER 500000000
@ -40,19 +40,29 @@
#define CURRENCY_COINBASE_BLOB_RESERVED_SIZE 1100
#define CURRENCY_MAX_TRANSACTION_BLOB_SIZE (CURRENCY_BLOCK_GRANTED_FULL_REWARD_ZONE - CURRENCY_COINBASE_BLOB_RESERVED_SIZE*2)
#define CURRENCY_FREE_TX_MAX_BLOB_SIZE 1024 // soft txpool-based limit for free-of-charge txs (such as BC_OFFERS_SERVICE_INSTRUCTION_DEL)
#define CURRENCY_DISPLAY_DECIMAL_POINT 8
#define CURRENCY_DISPLAY_DECIMAL_POINT 12
// COIN - number of smallest units in one coin
#define COIN ((uint64_t)100000000) // pow(10, CURRENCY_DISPLAY_DECIMAL_POINT)
#define COIN ((uint64_t)1000000000000) // pow(10, CURRENCY_DISPLAY_DECIMAL_POINT)
#define BASE_REWARD_DUST_THRESHOLD ((uint64_t)1000000) // pow(10, 6) - change this will cause hard-fork!
#define DEFAULT_DUST_THRESHOLD ((uint64_t)0)//((uint64_t)100000) // pow(10, 5)
//#define CURRENCY_SCRATCHPAD_BASE_SIZE 16777216 //count in crypto::hash, to get size in bytes x32
#define CURRENCY_SCRATCHPAD_BASE_SIZE 167 //count in crypto::hash, to get size in bytes x32
#define CURRENCY_SCRATCHPAD_REBUILD_INTERVAL 720 //once a day if block goes once in 2 minute
#define CURRENCY_SCRATCHPAD_BASE_INDEX_ID_OFFSET 20 //offset down from last rebuild height to block id, that used for indexing seed blocks in CURRENCY_SCRATCHPAD_SEED_BLOCKS_WINDOW
#define CURRENCY_SCRATCHPAD_SEED_BLOCKS_WINDOW 700 //window for addressing seed block ids
#define CURRENCY_SCRATCHPAD_GENESIS_SEED "4c98962ddce32c7763bb9326933a4692975ca29a76349ae7a139faa3430cc5ab"
#define TX_DEFAULT_FEE ((uint64_t)100000) // pow(10, 5)
#define TX_MINIMUM_FEE ((uint64_t)100000) // pow(10, 5)
#define CURRENCY_FIXED_REWARD_ZONE_HEIGHT 300 // blocks will have fixed reward up to this height (including)
#define CURRENCY_FIXED_REWARD_ZONE_REWARD_AMOUNT ((uint64_t)100000000) // should be TX_MINIMUM_FEE * CURRENCY_FIXED_REWARD_ZONE_FEE_MULTIPLIER
#define CURRENCY_FIXED_REWARD_ZONE_FEE_MULTIPLIER 1000 // reward in minimum fees for a block in the zone
// #define CURRENCY_FIXED_REWARD_ZONE_HEIGHT 300 // blocks will have fixed reward up to this height (including)
// #define CURRENCY_FIXED_REWARD_ZONE_REWARD_AMOUNT ((uint64_t)100000000) // should be TX_MINIMUM_FEE * CURRENCY_FIXED_REWARD_ZONE_FEE_MULTIPLIER
// #define CURRENCY_FIXED_REWARD_ZONE_FEE_MULTIPLIER 1000 // reward in minimum fees for a block in the zone
#define CURRENCY_TESTNET_CONST_REWARD 1000000000
#define WALLET_MAX_ALLOWED_OUTPUT_AMOUNT ((uint64_t)0xffffffffffffffffLL)
#define CURRENCY_MINER_TX_MAX_OUTS CURRENCY_TX_MAX_ALLOWED_OUTS
@ -167,7 +177,7 @@
#endif
//premine
#define PREMINE_AMOUNT (500000000000000)
#define PREMINE_AMOUNT (2000000000000000000)
//alias registration wallet
#define ALIAS_REWARDS_ACCOUNT_SPEND_PUB_KEY "0000000000000000000000000000000000000000000000000000000000000000" //burn alias money
@ -214,4 +224,4 @@
static_assert(CURRENCY_MINER_TX_MAX_OUTS <= CURRENCY_TX_MAX_ALLOWED_OUTS, "Miner tx must obey normal tx max outs limit");
static_assert(PREMINE_AMOUNT / WALLET_MAX_ALLOWED_OUTPUT_AMOUNT < CURRENCY_MINER_TX_MAX_OUTS, "Premine can't be divided into reasonable number of outs");
static_assert(CURRENCY_FIXED_REWARD_ZONE_REWARD_AMOUNT == TX_MINIMUM_FEE * CURRENCY_FIXED_REWARD_ZONE_FEE_MULTIPLIER, "CURRENCY_FIXED_REWARD_ZONE_REWARD_AMOUNT is incorrect with regard to TX_MINIMUM_FEE");
//static_assert(CURRENCY_FIXED_REWARD_ZONE_REWARD_AMOUNT == TX_MINIMUM_FEE * CURRENCY_FIXED_REWARD_ZONE_FEE_MULTIPLIER, "CURRENCY_FIXED_REWARD_ZONE_REWARD_AMOUNT is incorrect with regard to TX_MINIMUM_FEE");

View file

@ -401,9 +401,14 @@ namespace currency
return m_mempool.add_tx(tx, tx_hash, blob_size, tvc, kept_by_block);
}
//-----------------------------------------------------------------------------------------------
bool core::get_block_template(block& b, crypto::hash& seed, const account_public_address& adr, const account_public_address& stakeholder_address, wide_difficulty_type& diffic, uint64_t& height, const blobdata& ex_nonce, bool pos, const pos_entry& pe)
{
return m_blockchain_storage.create_block_template(b, seed, adr, stakeholder_address, diffic, height, ex_nonce, pos, pe);
}
bool core::get_block_template(block& b, const account_public_address& adr, const account_public_address& stakeholder_address, wide_difficulty_type& diffic, uint64_t& height, const blobdata& ex_nonce, bool pos, const pos_entry& pe)
{
return m_blockchain_storage.create_block_template(b, adr, stakeholder_address, diffic, height, ex_nonce, pos, pe);
crypto::hash seed_subst = currency::null_hash;
return m_blockchain_storage.create_block_template(b, seed_subst, adr, stakeholder_address, diffic, height, ex_nonce, pos, pe);
}
//-----------------------------------------------------------------------------------------------
bool core::find_blockchain_supplement(const std::list<crypto::hash>& qblock_ids, NOTIFY_RESPONSE_CHAIN_ENTRY::request& resp) const

View file

@ -15,11 +15,7 @@
#include "storages/portable_storage_template_helper.h"
#include "tx_pool.h"
#include "blockchain_storage.h"
#ifdef USE_OPENCL
#include "gpu_miner.h"
#else
#include "miner.h"
#endif
#include "connection_context.h"
#include "currency_core/currency_stat_info.h"
#include "warnings.h"
@ -55,13 +51,11 @@ namespace currency
//-------------------- i_miner_handler -----------------------
virtual bool handle_block_found(const block& b, block_verification_context* p_verification_result = nullptr);
virtual bool get_block_template(block& b, const account_public_address& adr, const account_public_address& stakeholder_address, wide_difficulty_type& diffic, uint64_t& height, const blobdata& ex_nonce, bool pos = false, const pos_entry& pe = pos_entry());
virtual bool get_block_template(block& b, crypto::hash& seed, const account_public_address& adr, const account_public_address& stakeholder_address, wide_difficulty_type& diffic, uint64_t& height, const blobdata& ex_nonce, bool pos = false, const pos_entry& pe = pos_entry());
bool get_block_template(block& b, const account_public_address& adr, const account_public_address& stakeholder_address, wide_difficulty_type& diffic, uint64_t& height, const blobdata& ex_nonce, bool pos = false, const pos_entry& pe = pos_entry());
#ifdef USE_OPENCL
gpu_miner& get_miner(){return m_miner;}
#else
miner& get_miner(){ return m_miner; }
#endif
static void init_options(boost::program_options::options_description& desc);
bool init(const boost::program_options::variables_map& vm);
bool set_genesis_block(const block& b);
@ -145,11 +139,7 @@ namespace currency
tx_memory_pool m_mempool;
i_currency_protocol* m_pprotocol;
critical_section m_incoming_tx_lock;
#ifdef USE_OPENCL
gpu_miner m_miner;
#else
miner m_miner;
#endif
account_public_address m_miner_address;
std::string m_config_folder;
currency_protocol_stub m_protocol_stub;

View file

@ -1712,24 +1712,24 @@ namespace currency
}
return true;
}
//--------------------------------------------------------------
crypto::hash get_block_longhash(uint64_t height, const crypto::hash& block_long_ash, uint64_t nonce)
{
//TODO: add wild keccak 2
return null_hash;//TODO;
}
//---------------------------------------------------------------
void get_block_longhash(const block& b, crypto::hash& res)
{
//TODO: add wild keccak 2
}
//---------------------------------------------------------------
crypto::hash get_block_longhash(const block& b)
{
crypto::hash p = null_hash;
get_block_longhash(b, p);
return p;
}
// //--------------------------------------------------------------
// crypto::hash get_block_longhash(uint64_t height, const crypto::hash& block_long_ash, uint64_t nonce)
// {
// //TODO: add wild keccak 2
// return null_hash;//TODO;
// }
// //---------------------------------------------------------------
// void get_block_longhash(const block& b, crypto::hash& res)
// {
// //TODO: add wild keccak 2
// }
// //---------------------------------------------------------------
// crypto::hash get_block_longhash(const block& b)
// {
// crypto::hash p = null_hash;
// get_block_longhash(b, p);
// return p;
// }
//---------------------------------------------------------------
uint64_t get_alias_coast_from_fee(const std::string& alias, uint64_t median_fee)
{
@ -2562,22 +2562,19 @@ namespace currency
{
if (!height)
return PREMINE_AMOUNT;
if (height <= CURRENCY_FIXED_REWARD_ZONE_HEIGHT)
return CURRENCY_FIXED_REWARD_ZONE_REWARD_AMOUNT;
uint64_t reward = 0;
if (is_pos)
reward = already_generated_coins / EMISSION_POS_REWARD_DEVIDER;
else
reward = already_generated_coins / EMISSION_POW_REWARD_DEVIDER;
//crop dust if it make sense
if (reward <= BASE_REWARD_DUST_THRESHOLD)
return reward;
reward = reward - reward%BASE_REWARD_DUST_THRESHOLD;
return reward;
return CURRENCY_TESTNET_CONST_REWARD;
}
//-----------------------------------------------------------------------------------------------
uint64_t get_scratchpad_last_update_rebuild_height(uint64_t h)
{
return h - (h%CURRENCY_SCRATCHPAD_REBUILD_INTERVAL);
}
//-----------------------------------------------------------------------------------------------
uint64_t get_scratchpad_size_for_height(uint64_t h)
{
//let's have ~256MB/year if block interval is 2 minutes
return CURRENCY_SCRATCHPAD_BASE_SIZE + get_scratchpad_last_update_rebuild_height(h)*32;
}
//-----------------------------------------------------------------------------------------------
bool get_block_reward(bool is_pos, size_t median_size, size_t current_block_size, uint64_t already_generated_coins, uint64_t &reward, uint64_t height)

View file

@ -43,6 +43,30 @@
//------
bool parse_hash256(const std::string str_hash, crypto::hash& hash);
template <class T>
std::ostream &print256(std::ostream &o, const T &v) {
return o << "<" << epee::string_tools::pod_to_hex(v) << ">";
}
template <class T>
std::ostream &print16(std::ostream &o, const T &v) {
return o << "<" << epee::string_tools::pod_to_hex(v).substr(0, 5) << "..>";
}
template <class T>
std::string print16(const T &v) {
return std::string("<") + epee::string_tools::pod_to_hex(v).substr(0, 5) + "..>";
}
namespace crypto {
inline std::ostream &operator <<(std::ostream &o, const crypto::public_key &v) { return print256(o, v); }
inline std::ostream &operator <<(std::ostream &o, const crypto::secret_key &v) { return print256(o, v); }
inline std::ostream &operator <<(std::ostream &o, const crypto::key_derivation &v) { return print256(o, v); }
inline std::ostream &operator <<(std::ostream &o, const crypto::key_image &v) { return print256(o, v); }
inline std::ostream &operator <<(std::ostream &o, const crypto::signature &v) { return print256(o, v); }
inline std::ostream &operator <<(std::ostream &o, const crypto::hash &v) { return print256(o, v); }
}
namespace currency
{
@ -308,10 +332,13 @@ namespace currency
bool check_inputs_types_supported(const transaction& tx);
bool check_outs_valid(const transaction& tx);
bool parse_amount(uint64_t& amount, const std::string& str_amount);
crypto::hash get_block_longhash(uint64_t h, const crypto::hash& block_long_ash, uint64_t nonce);
void get_block_longhash(const block& b, crypto::hash& res);
crypto::hash get_block_longhash(const block& b);
// crypto::hash get_block_longhash(uint64_t h, const crypto::hash& block_long_ash, uint64_t nonce);
// void get_block_longhash(const block& b, crypto::hash& res);
// crypto::hash get_block_longhash(const block& b);
bool unserialize_block_complete_entry(const COMMAND_RPC_GET_BLOCKS_FAST::response& serialized,
COMMAND_RPC_GET_BLOCKS_DIRECT::response& unserialized);
@ -411,6 +438,8 @@ namespace currency
size_t get_max_tx_size();
bool get_block_reward(bool is_pos, size_t median_size, size_t current_block_size, uint64_t already_generated_coins, uint64_t &reward, uint64_t height);
uint64_t get_base_block_reward(bool is_pos, uint64_t already_generated_coins, uint64_t height);
uint64_t get_scratchpad_last_update_rebuild_height(uint64_t h);
uint64_t get_scratchpad_size_for_height(uint64_t h);
bool is_payment_id_size_ok(const std::string& payment_id);
std::string get_account_address_as_str(const account_public_address& addr);
std::string get_account_address_and_payment_id_as_str(const account_public_address& addr, const std::string& payment_id);
@ -628,9 +657,41 @@ namespace currency
}
return false;
}
//---------------------------------------------------------------
template<class block_chain_accessor_t>
bool get_seed_for_scratchpad_cb(uint64_t height, crypto::hash& seed, block_chain_accessor_t cb)
{
//CHECK_AND_ASSERT_THROW_MES(m_db_blocks.size() > height, "Internal error: m_db_blocks.size()=" << m_db_blocks.size() << " > height=" << height);
uint64_t last_upd_h = get_scratchpad_last_update_rebuild_height(height);
std::vector<crypto::hash> seed_data;
if (last_upd_h == 0)
{
crypto::hash genesis_seed = null_hash;
bool r = epee::string_tools::hex_to_pod(CURRENCY_SCRATCHPAD_GENESIS_SEED, genesis_seed);
CHECK_AND_ASSERT_THROW_MES(r, "Unable to parse CURRENCY_SCRATCHPAD_GENESIS_SEED " << CURRENCY_SCRATCHPAD_GENESIS_SEED);
LOG_PRINT_MAGENTA("[SCRATCHPAD] GENESIS SEED SELECTED: " << genesis_seed, LOG_LEVEL_1);
seed = genesis_seed;
return true;
}
uint64_t low_bound_window = 0;
CHECK_AND_ASSERT_THROW_MES(last_upd_h >= CURRENCY_SCRATCHPAD_SEED_BLOCKS_WINDOW, "Internal error: last_upd_h(" << last_upd_h << ") < CURRENCY_SCRATCHPAD_SEED_BLOCKS_WINDOW(" << CURRENCY_SCRATCHPAD_SEED_BLOCKS_WINDOW << ")");
low_bound_window = last_upd_h - CURRENCY_SCRATCHPAD_SEED_BLOCKS_WINDOW;
crypto::hash selector_id = cb(last_upd_h - CURRENCY_SCRATCHPAD_BASE_INDEX_ID_OFFSET);
const uint64_t* pselectors = (const uint64_t*)&selector_id;
std::stringstream ss;
for (size_t i = 0; i != 4; i++)
{
seed_data.push_back(cb(low_bound_window + pselectors[i] % CURRENCY_SCRATCHPAD_SEED_BLOCKS_WINDOW));
ss << "[" << std::setw(8) << std::hex << pselectors[i] << "->" << low_bound_window + pselectors[i] % CURRENCY_SCRATCHPAD_SEED_BLOCKS_WINDOW << "]" << seed_data.back() << ENDL;
}
seed = crypto::cn_fast_hash(&seed_data[0], sizeof(seed_data[0]) * seed_data.size());
LOG_PRINT_MAGENTA("[SCRATCHPAD] SEED SELECTED: h = " << last_upd_h << ", selector: " << selector_id << ENDL << ss.str() << "SEED: " << seed, LOG_LEVEL_1);
return true;
}
//---------------------------------------------------------------
template<class t_object>
bool get_object_hash(const t_object& o, crypto::hash& res)
@ -815,46 +876,5 @@ namespace currency
} // namespace currency
template <class T>
std::ostream &print256(std::ostream &o, const T &v) {
return o << "<" << epee::string_tools::pod_to_hex(v) << ">";
}
template <class T>
std::ostream &print16(std::ostream &o, const T &v) {
return o << "<" << epee::string_tools::pod_to_hex(v).substr(0, 5) << "..>";
}
template <class T>
std::string print16(const T &v) {
return std::string("<") + epee::string_tools::pod_to_hex(v).substr(0, 5) + "..>";
}
//POD_MAKE_COMPARABLE(currency, extra_attachment_info)
// namespace std
// {
// inline
// bool operator ==(const currency::transaction& a, const currency::transaction& b)
// {
// return currency::get_transaction_hash(a) == currency::get_transaction_hash(b);
// }
// inline
// bool operator ==(const currency::block& a, const currency::block& b)
// {
// return currency::get_block_hash(a) == currency::get_block_hash(b);
// }
// }
bool parse_hash256(const std::string str_hash, crypto::hash& hash);
namespace crypto {
inline std::ostream &operator <<(std::ostream &o, const crypto::public_key &v) { return print256(o, v); }
inline std::ostream &operator <<(std::ostream &o, const crypto::secret_key &v) { return print256(o, v); }
inline std::ostream &operator <<(std::ostream &o, const crypto::key_derivation &v) { return print256(o, v); }
inline std::ostream &operator <<(std::ostream &o, const crypto::key_image &v) { return print256(o, v); }
inline std::ostream &operator <<(std::ostream &o, const crypto::signature &v) { return print256(o, v); }
inline std::ostream &operator <<(std::ostream &o, const crypto::hash &v) { return print256(o, v); }
}

View file

@ -8,8 +8,7 @@
namespace currency
{
const genesis_tx_raw_data ggenesis_tx_raw = { {
0xe980800500000101,0x4c8e410316deb183,0x05dd061422e91958,0x485eb197e544946e,0xd7140a7b5b9eb8de,0x808000ea57342851,0xd3530316deb183e9,0x3e9a1019308058c6,0x07729e9e4683aead,0xae8521fc934a1d79,0x80000bb75ba1dd6d,0x5b0316deb183e980,0x98baefe7be9750fe,0xa50ef15adc5af73a,0x5086ca4ebadb9e01,0x00a78f2f9069699e,0x0316deb183e98080,0xab49b3c9fa79c665,0xa7ff95caf24e03c0,0xc6633659b32c545e,0x5081ddf42a3e7cbd,0x16deb183e9808000,0x33f1751141376803,0x776c2649e24c29f8,0xa956f3ec171294b2,0x91e727347006cd50,0x8d9c4a02160800cd,0xa4cbac8dd1535e29,0xc1b12659d4ba40f8,0x1b830f7079e20e51,0x8917001563cc51fd,0x17750417bd8617c8,0x000a0e5ebd17ee6e },
0xd080800a00000101,0xd20302e3a2de8bd8,0xa4c656f120022dac,0x6e2f69c4efec713d,0x1dab067faa99d2b0,0x004bc2ed989554f5,0xe3a2de8bd8d08080,0x0c893e3c11110302,0x923c676c08c3b3da,0x9d5f9bab3c153f86,0xceec49611dbff8fa,0x8bd8d0808000a087,0xda75030302e3a2de,0x9c6c996e44fb4fa8,0x57da9b191a0ea5e5,0x8300d36ad5146cb0,0x808000f70b26fb7c,0x0302e3a2de8bd8d0,0x0d971710a6f965c0,0x712f15d0c23ca097,0xab0cccfcffca2772,0x4d79952b97b321f0,0xa2de8bd8d0808000,0x6e95a338730302e3,0x699ed30d4fe42200,0x44acb4ec1910cbae,0xac396ca4d07c6032,0xd8d08080007ca3ab,0xf16e0302e3a2de8b,0xa51960554838e739,0x9e49a3a3891d8589,0xfdec3d1c43ce6c6a,0x8000e9d451bab45d,0x02e3a2de8bd8d080,0x441f83683012d103,0xfe5af148188baa39,0x9a6f3f19372b9a63,0xa3af018f526dbcd0,0xde8bd8d0808000fa,0x3002d9a70302e3a2,0x9f8afd984e34d469,0xb839504b8be18512,0x9d6e2d8197e5347e,0xd0808000321a67f6,0x770302e3a2de8bd8,0x13c5c72e5040ae82,0xd3430b8a3a8b8f3e,0x345f656308d8200e,0x008b35ba6c7ac665,0xe3a2de8bd8d08080,0xf47aaa9ee2230302,0x8c75dbd4e43c096d,0xa8479951e6621d52,0x4614fba0a021d84d,0x7b8b69160d00fb3b,0xb9579673ea1bfcd6,0xe6caa4a7a54184fa,0xe460fcdea2efb79c,0x170015f4099060c6,0x627a17ad0517f176,0x4f17b84817ad0717,0x179de517114f17b9,0x000a0e9f2a177c9f },
{ 0x00 } };
}

View file

@ -11,7 +11,7 @@ namespace currency
#pragma pack(push, 1)
struct genesis_tx_raw_data
{
uint64_t const v[33];
uint64_t const v[63];
uint8_t const r[1];
};
#pragma pack(pop)

View file

@ -9,16 +9,22 @@
namespace currency
{
const std::string ggenesis_tx_pub_key_str = "024a9c8d295e53d18daccba4f840bad45926b1c1510ee279700f831bfd51cc63";
const std::string ggenesis_tx_pub_key_str = "698b7bd6fc1bea739657b9fa8441a5a7a4cae69cb7efa2defc60e4c6609009f4";
const crypto::public_key ggenesis_tx_pub_key = epee::string_tools::parse_tpod_from_hex_string<crypto::public_key>(ggenesis_tx_pub_key_str);
const genesis_tx_dictionary_entry ggenesis_dict[5] = {
{ 785828676124507135ULL,1 },
{ 1231353406545874119ULL,4 },
{ 2713905913089194270ULL,3 },
{ 3738391252528226312ULL,0 },
{ 11261277230714331250ULL,2 }
const genesis_tx_dictionary_entry ggenesis_dict[10] = {
{ 690562910953636312ULL,5 },
{ 940036618224342135ULL,3 },
{ 1343336992873709805ULL,9 },
{ 2417587344126263675ULL,7 },
{ 2976852013260878279ULL,8 },
{ 9662281438621735689ULL,4 },
{ 14708441932961059072ULL,6 },
{ 15678994962012632719ULL,1 },
{ 17191212896741366274ULL,2 },
{ 18291644074790683797ULL,0 }
};
}

View file

@ -24,7 +24,7 @@ namespace currency
}
};
#pragma pack(pop)
extern const genesis_tx_dictionary_entry ggenesis_dict[5];
extern const genesis_tx_dictionary_entry ggenesis_dict[10];
extern const crypto::public_key ggenesis_tx_pub_key;

View file

@ -72,6 +72,7 @@ namespace currency
m_height = height;
++m_template_no;
m_starter_nonce = crypto::rand<uint32_t>();
m_scratchpad.generate(m_seed, height);
return true;
}
//-----------------------------------------------------------------------------------------------------
@ -94,7 +95,7 @@ namespace currency
{
extra_nonce += std::string("|") + m_extra_messages[m_config.current_extra_message_index];
}
if(!m_phandler->get_block_template(bl, m_mine_address, m_mine_address, di, height, extra_nonce))
if(!m_phandler->get_block_template(bl, m_seed, m_mine_address, m_mine_address, di, height, extra_nonce))
{
LOG_ERROR("Failed to get_block_template()");
return false;
@ -305,6 +306,8 @@ namespace currency
uint64_t nonce = m_starter_nonce + th_local_index;
wide_difficulty_type local_diff = 0;
uint32_t local_template_ver = 0;
blobdata local_blob_data;
//uint64_t local_template_height = 0;
block b;
@ -325,6 +328,7 @@ namespace currency
//local_template_height = get_block_height(b);
local_template_ver = m_template_no;
nonce = m_starter_nonce + th_local_index;
local_blob_data = get_block_hashing_blob(b);
}
if(!local_template_ver)//no any set_block_template call
@ -334,7 +338,8 @@ namespace currency
continue;
}
b.nonce = nonce;
crypto::hash h = get_block_longhash(b);
access_nonce_in_block_blob(local_blob_data) = b.nonce;
crypto::hash h = m_scratchpad.get_pow_hash(local_blob_data, m_height, m_seed);
if(check_hash(h, local_diff))
{

View file

@ -33,7 +33,7 @@ namespace currency
struct i_miner_handler
{
virtual bool handle_block_found(const block& b, block_verification_context* p_verification_result = nullptr) = 0;
virtual bool get_block_template(block& b, const account_public_address& adr, const account_public_address& stakeholder_address, wide_difficulty_type& diffic, uint64_t& height, const blobdata& ex_nonce, bool pos = false, const pos_entry& pe = pos_entry()) = 0;
virtual bool get_block_template(block& b, crypto::hash& seed, const account_public_address& adr, const account_public_address& stakeholder_address, wide_difficulty_type& diffic, uint64_t& height, const blobdata& ex_nonce, bool pos = false, const pos_entry& pe = pos_entry()) = 0;
protected:
~i_miner_handler(){};
};
@ -63,15 +63,17 @@ namespace currency
void do_print_hashrate(bool do_hr);
inline
static bool find_nonce_for_given_block(block& bl, const wide_difficulty_type& diffic, uint64_t height)
{
static bool find_nonce_for_given_block(block& bl, const wide_difficulty_type& diffic, uint64_t height, const crypto::hash& seed, scratchpad_keeper& sk)
{
blobdata bd = get_block_hashing_blob(bl);
access_nonce_in_block_blob(bd) = 0;
crypto::hash bl_hash = crypto::cn_fast_hash(bd.data(), bd.size());
uint64_t& nonce_ref = access_nonce_in_block_blob(bd);
nonce_ref = 0;
for(; bl.nonce != std::numeric_limits<uint32_t>::max(); bl.nonce++)
for(; bl.nonce != std::numeric_limits<uint64_t>::max(); bl.nonce++)
{
crypto::hash h = get_block_longhash(height, bl_hash, bl.nonce);
nonce_ref = bl.nonce;
crypto::hash h = sk.get_pow_hash(bd, height, seed);
if(check_hash(h, diffic))
{
LOG_PRINT_L0("Found nonce for block: " << get_block_hash(bl) << "[" << height << "]: PoW:" << h << "(diff:" << diffic << "), ts: " << bl.timestamp);
@ -103,11 +105,13 @@ namespace currency
std::atomic<uint32_t> m_template_no;
std::atomic<uint32_t> m_starter_nonce;
wide_difficulty_type m_diffic;
uint64_t m_height;
std::atomic<uint64_t> m_height;
scratchpad_keeper m_scratchpad;
crypto::hash m_seed;
volatile uint32_t m_thread_index;
volatile uint32_t m_threads_total;
std::atomic<int32_t> m_pausers_count;
::critical_section m_miners_count_lock;
::critical_section m_miners_count_lock;
std::list<boost::thread> m_threads;
::critical_section m_threads_lock;

View file

@ -254,10 +254,10 @@ namespace bc_services
}
//now cut what not needed
auto it = std::next(offers.begin(), std::min(filter.offset, offers.size()));
auto it = std::next(offers.begin(), std::min(filter.offset, static_cast<uint64_t>(offers.size())));
offers.erase(offers.begin(), it);
// cut limit
it = std::next(offers.begin(), std::min(filter.limit, offers.size()));
it = std::next(offers.begin(), std::min(filter.limit, static_cast<uint64_t>(offers.size())));
offers.erase(it, offers.end());
return true;

View file

@ -0,0 +1,54 @@
// Copyright (c) 2018-2019 Zano Project
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "scratchpad_helper.h"
#include "currency_format_utils.h"
namespace currency
{
scratchpad_keeper::scratchpad_keeper():m_seed(null_hash)
{
}
bool scratchpad_keeper::generate(const crypto::hash& scr_seed, uint64_t height)
{
bool r = false;
CRITICAL_REGION_BEGIN(m_lock);
r = crypto::generate_scratchpad(scr_seed, m_scratchpad, get_scratchpad_size_for_height(height));
if (r)
m_seed = scr_seed;
CRITICAL_REGION_END();
return r;
}
crypto::hash scratchpad_keeper::get_pow_hash(const blobdata& bd, uint64_t height, const crypto::hash& scr_seed)
{
crypto::hash res_hash = null_hash;
if (scr_seed != m_seed)
{
bool r = generate(scr_seed, height);
CHECK_AND_ASSERT_THROW_MES(r, "Unable to generate scratchpad");
}
CRITICAL_REGION_BEGIN(m_lock);
CHECK_AND_ASSERT_THROW_MES(get_scratchpad_size_for_height(height) == this->size(), "Fatal error on hash calculation: scratchpad_size=" << m_scratchpad.size() << " at height=" << height << ", scr_seed=" << scr_seed << ", m_seed=" << m_seed);
CHECK_AND_ASSERT_THROW_MES(scr_seed == m_seed, "Fatal error on hash calculation: scratchpad_seed missmatch scr_seed=" << scr_seed << ", m_seed=" << m_seed);
bool res = get_wild_keccak2(bd, res_hash, m_scratchpad);
CHECK_AND_ASSERT_THROW_MES(res, "Fatal error on hash calculation: scratchpad_size=" << m_scratchpad.size());
CRITICAL_REGION_END();
return res_hash;
}
crypto::hash scratchpad_keeper::get_pow_hash(const block& b, const crypto::hash& scr_seed)
{
blobdata bl = get_block_hashing_blob(b);
return get_pow_hash(bl, get_block_height(b), scr_seed);
}
uint64_t scratchpad_keeper::size()
{
return m_scratchpad.size();
}
}

View file

@ -0,0 +1,27 @@
// Copyright (c) 2014-2018 Zano Project
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include "crypto/wild_keccak.h"
#include "currency_protocol/blobdatatype.h"
#include "currency_core/currency_basic.h"
namespace currency
{
class scratchpad_keeper
{
public:
scratchpad_keeper();
bool generate(const crypto::hash& seed, uint64_t height);
crypto::hash get_pow_hash(const blobdata& bd, uint64_t height, const crypto::hash& seed);
crypto::hash get_pow_hash(const block& b, const crypto::hash& seed);
uint64_t size();
private:
scratchpad_keeper(const scratchpad_keeper&) {}
crypto::hash m_seed;
std::vector<crypto::hash> m_scratchpad;
std::recursive_mutex m_lock;
};
}

View file

@ -102,7 +102,7 @@ namespace currency
<< std::setw(25) << std::to_string(cntxt.m_recv_cnt)+ "(" + std::to_string(time(NULL) - cntxt.m_last_recv) + ")" + "/" + std::to_string(cntxt.m_send_cnt) + "(" + std::to_string(time(NULL) - cntxt.m_last_send) + ")"
<< std::setw(25) << get_protocol_state_string(cntxt.m_state)
<< std::setw(20) << std::to_string(time(NULL) - cntxt.m_started)
<< std::setw(20) << cntxt.m_priv.m_remote_version
<< std::setw(20) << cntxt.m_remote_version
<< ENDL;
return true;
});
@ -114,7 +114,7 @@ namespace currency
{
context.m_priv.m_remote_version = hshd.client_version;
context.m_remote_version = hshd.client_version;
if(context.m_state == currency_connection_context::state_befor_handshake && !is_inital)
return true;

View file

@ -83,11 +83,7 @@ int main(int argc, char* argv[])
currency::core::init_options(desc_cmd_sett);
currency::core_rpc_server::init_options(desc_cmd_sett);
nodetool::node_server<currency::t_currency_protocol_handler<currency::core> >::init_options(desc_cmd_sett);
#ifdef USE_OPENCL
currency::gpu_miner::init_options(desc_cmd_sett);
#else
currency::miner::init_options(desc_cmd_sett);
#endif
bc_services::bc_offers_service::init_options(desc_cmd_sett);
@ -105,10 +101,6 @@ int main(int argc, char* argv[])
std::cout << desc_options << std::endl;
return false;
}
#ifdef USE_OPENCL
if (currency::gpu_miner::handle_cli_info_commands(vm))
return false;
#endif
std::string data_dir = command_line::get_arg(vm, command_line::arg_data_dir);
std::string config = command_line::get_arg(vm, command_line::arg_config_file);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -3,7 +3,8 @@
"SETUP_MASTER_PASS": "Setup master password",
"SETUP_CONFIRM_PASS": "Confirm the password",
"MASTER_PASS": "Master password",
"BUTTON_NEXT": "Next"
"BUTTON_NEXT": "Next",
"INCORRECT_PASSWORD": "Invalid password"
},
"COMMON": {
"BACK": "Go back"
@ -24,7 +25,8 @@
"ADD_NEW": "+ Add new",
"ACCOUNT": {
"STAKING": "Staking",
"MESSAGES": "New offers/Messages"
"MESSAGES": "New offers/Messages",
"SYNCING": "Syncing wallet"
},
"SETTINGS": "Settings",
"LOG_OUT": "Log out",
@ -42,19 +44,26 @@
"BUTTON_NEW_WALLET": "Create new wallet",
"BUTTON_OPEN_WALLET": "Open existing wallet",
"BUTTON_RESTORE_BACKUP": "Restore from backup",
"HELP": "How to create wallet?"
"HELP": "How to create wallet?",
"CHOOSE_PATH": "Please choose a path"
},
"CREATE_WALLET": {
"NAME": "Wallet name",
"PASS": "Set wallet password",
"CONFIRM": "Confirm wallet password",
"BUTTON_SELECT": "Select wallet location",
"BUTTON_CREATE": "Create wallet"
"BUTTON_CREATE": "Create wallet",
"TITLE_SAVE": "Save the wallet file.",
"ERROR_CANNOT_SAVE_TOP": "You cannot record a file on top of another file",
"ERROR_CANNOT_SAVE_SYSTEM": "You cannot save a safe file to the system partition"
},
"OPEN_WALLET": {
"NAME": "Wallet name",
"PASS": "Wallet password",
"BUTTON": "Open wallet"
"BUTTON": "Open wallet",
"WITH_ADDRESS_ALREADY_OPEN": "A wallet with this account is already open",
"SAFE_FILE_NOT_FOUND1": "Safe file not found",
"SAFE_FILE_NOT_FOUND2": "<br/><br/> It might have been renamed or moved. <br/> To open it, use the \"Open safe\" button."
},
"RESTORE_WALLET": {
"LABEL_NAME": "Wallet name",
@ -62,7 +71,9 @@
"PASS": "Wallet password",
"CONFIRM": "Confirm wallet password",
"BUTTON_SELECT": "Select wallet location",
"BUTTON_CREATE": "Create wallet"
"BUTTON_CREATE": "Create wallet",
"NOT_CORRECT_FILE_OR_PASSWORD": "Invalid safe file or password does not match",
"CHOOSE_PATH": "Please choose a path"
},
"SEED_PHRASE": {
"TITLE": "Make sure to keep your seed phrase in a safe place. If you forget your seed phrase you will not be able to recover your account.",
@ -109,7 +120,8 @@
"DETAILS": "Additional details",
"MIXIN": "Mixin",
"FEE": "Fee",
"BUTTON": "Send"
"BUTTON": "Send",
"SUCCESS_SENT": "The payment will be received within 20 minutes"
},
"HISTORY": {
"STATUS": "Status",
@ -162,13 +174,38 @@
"PROGRESS_RECEIVE": "Reply received",
"PROGRESS_COMPLETE": "Completed",
"FEE": "Fee",
"PAYMENT": "Payment ID"
"PAYMENT": "Payment ID",
"ACCEPT_STATE_WAIT_BIG": "You have accepted the contract proposal. Please wait for the pledges to be made",
"IGNORED_ACCEPT": "You have ignored the contract proposal",
"BURN_PROPOSAL": "The pledges have been nullified.",
"SUCCESS_FINISH_PROPOSAL": "The contract is complete. The payment has been sent.",
"SEND_CANCEL_PROPOSAL": "Proposal to cancel contract sent to seller",
"IGNORED_CANCEL": "You have ignored the proposal to cancel the contract",
"DEALS_CANCELED_WAIT": "The contract is being cancelled. Please wait for the pledge to be returned",
"WAITING_TIME": "Time until response"
},
"MESSAGES": {
"ADDRESS": "Address",
"MESSAGE": "Message",
"SEND_PLACEHOLDER": "Type a message...",
"SEND_BUTTON": "Send"
},
"ERRORS": {
"NOT_ENOUGH_MONEY": "Insufficient funds in account",
"CORE_BUSY": "Internal error (core is busy)",
"DAEMON_BUSY": "Internal error: deamon is busy",
"NO_MONEY_REMOVE_OFFER": "There is no fee for deleting an offer, but in order to protect the network against flood transactions you need to have at least {{fee}} {{currency}} in your safe",
"NOT_ENOUGH_OUTPUTS_TO_MIX": "For the sake of security, mixed transaction will take several days",
"TRANSACTION_IS_TO_BIG": "This transaction is large and was therefore denied by the network. Try sending the required amount in parts.",
"TRANSFER_ATTEMPT": "There is no connection to the Zano network",
"ACCESS_DENIED": "Access denied",
"TRANSACTION_ERROR": "Error. Payment not completed.",
"BAD_ARG": "Invalid argument",
"WALLET_WRONG_ID": "Invalid wallet ID",
"WRONG_PASSWORD": "Invalid password",
"FILE_RESTORED": "The safe file was corrupted somehow. We have recovered the keys and safe from the blockchain.",
"FILE_NOT_FOUND": "File not found",
"FILE_EXIST": "A file with that name already exists. Enter another name to save the file under",
"FILE_NOT_SAVED": "You cannot save a safe file in this folder. Please choose another folder."
}
}

View file

Before

Width:  |  Height:  |  Size: 644 B

After

Width:  |  Height:  |  Size: 644 B

View file

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve">
<style type="text/css">
.st0{fill:url(#SVGID_1_);}
.st1{fill:url(#SVGID_2_);}
.st2{fill:url(#SVGID_3_);}
</style>
<g>
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="512.55" y1="984.3" x2="512.55" y2="39.3" gradientTransform="matrix(1 0 0 -1 0 1024)">
<stop offset="0" style="stop-color:#1ECED0"/>
<stop offset="0.5" style="stop-color:#8AA9F4"/>
<stop offset="1" style="stop-color:#6A44FB"/>
</linearGradient>
<polygon class="st0" points="679.6,984.7 193.5,305.1 344.4,39.7 831.6,715.3 "/>
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="217.75" y1="700.86" x2="217.75" y2="382.2152" gradientTransform="matrix(1 0 0 -1 0 1024)">
<stop offset="0" style="stop-color:#57B7E3"/>
<stop offset="1" style="stop-color:#7E8AF4;stop-opacity:0"/>
</linearGradient>
<polygon class="st1" points="193.5,305.1 435.5,643.4 0,643.4 "/>
<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="807.25" y1="332.3745" x2="807.25" y2="641.9303" gradientTransform="matrix(1 0 0 -1 0 1024)">
<stop offset="0" style="stop-color:#7C83F4"/>
<stop offset="1" style="stop-color:#68B0E9;stop-opacity:0"/>
</linearGradient>
<polygon class="st2" points="831.6,715.3 590.5,381 1024,381 "/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

Before

Width:  |  Height:  |  Size: 708 B

After

Width:  |  Height:  |  Size: 708 B

View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

Before

Width:  |  Height:  |  Size: 931 B

After

Width:  |  Height:  |  Size: 931 B

View file

@ -1,6 +1,6 @@
button {
border: none;
font-family: 'Open Sans', sans-serif;
font-family: OpenSans, sans-serif;
font-size: 1.5rem;
font-weight: 600;
outline: none;
@ -116,7 +116,7 @@ button {
}
}
input[type='text'], input[type='password'] {
input[type='text'], input[type='password'], select {
border: none;
font-size: 1.4rem;
outline: none;
@ -134,7 +134,7 @@ button {
height: auto;
textarea {
font-family: 'Open Sans', sans-serif;
font-family: OpenSans, sans-serif;
border: none;
font-size: 1.4rem;
outline: none;
@ -273,6 +273,30 @@ input[type='checkbox'].style-checkbox {
}
}
.switch {
@include themify($themes) {
background-color: themed(switchBackgroundColor);
}
.circle {
&.on {
@include themify($themes) {
background-color: themed(blueTextColor);
}
}
&.off {
@include themify($themes) {
background-color: themed(optionalTextColor);
}
}
}
}
.error-block {
font-size: 1.2rem;
text-align: right;
@ -364,12 +388,32 @@ input[type='checkbox'].style-checkbox {
.modal {
@include themify($themes) {
background: themed(tooltipBackgroundColor);
background: themed(modalBackground);
color: themed(mainTextColor);
}
.content {
.icon.error {
@include themify($themes) {
background-color: themed(redTextColor);
}
}
.icon.success {
@include themify($themes) {
background-color: themed(greenTextColor);
}
}
.icon.info {
@include themify($themes) {
background-color: themed(blueTextColor);
}
}
}
.action-button {
@ -379,4 +423,52 @@ input[type='checkbox'].style-checkbox {
color: themed(alternativeTextColor);
}
}
.close-button {
.icon {
@include themify($themes) {
background-color: themed(closeButtonColor);
}
}
}
}
.ngx-contextmenu {
.dropdown-menu {
border: none;
padding: 0;
@include themify($themes) {
background-color: themed(chartOptionsBackgroundColor);
box-shadow: themed(tooltipShadow);
}
}
li {
display: block;
font-family: OpenSans, sans-serif;
font-size: 1.3rem;
text-transform: uppercase;
text-align: center;
}
a {
display: block;
padding: 0.5em 1em;
@include themify($themes) {
color: themed(mainTextColor);
}
&:hover {
@include themify($themes) {
background-color: themed(chartOptionsHoverColor);
color: themed(mainTextColor);
}
}
}
}

View file

@ -10,7 +10,8 @@ $themes: (
alternativeTextColor: #111921,
optionalTextColor: #556576,
blueTextColor: #4db1ff,
redTextColor: #ff5252,
greenTextColor: #5cda9d,
redTextColor: #fe5252,
blueButtonBackgroundColor: #4db1ff,
blueButtonHoverColor: #60b9ff,
disabledButtonBackgroundColor: #90a4ae,
@ -38,7 +39,9 @@ $themes: (
chartOptionsBackgroundColor: #2b3644,
chartOptionsHoverColor: #556576,
tooltipBackgroundColor: #42505f,
tooltipShadow: 0 0 1rem rgba(0, 0, 0, 0.5)
tooltipShadow: 0 0 1rem rgba(0, 0, 0, 0.5),
modalBackground: url(~src/assets/images/background-dark.png),
closeButtonColor: #556576
),
gray: (
bodyBackgroundColor: #101417,
@ -51,7 +54,8 @@ $themes: (
alternativeTextColor: #1a1a1a,
optionalTextColor: #565c62,
blueTextColor: #42a5f5,
redTextColor: #ff5252,
greenTextColor: #47cf8d,
redTextColor: #fe5252,
blueButtonBackgroundColor: #42a5f5,
blueButtonHoverColor: #4dafff,
disabledButtonBackgroundColor: #79848f,
@ -79,7 +83,9 @@ $themes: (
chartOptionsBackgroundColor: #292d31,
chartOptionsHoverColor: #515960,
tooltipBackgroundColor: #3e464c,
tooltipShadow: 0 0 1rem rgba(0, 0, 0, 0.5)
tooltipShadow: 0 0 1rem rgba(0, 0, 0, 0.5),
modalBackground: url(~src/assets/images/background-gray.png),
closeButtonColor: #515960
),
white: (
bodyBackgroundColor: #eeeeee,
@ -92,6 +98,7 @@ $themes: (
alternativeTextColor: #fefefe,
optionalTextColor: #a0a5ab,
blueTextColor: #2c95f1,
greenTextColor: #46c172,
redTextColor: #ff5252,
blueButtonBackgroundColor: #2c95f1,
blueButtonHoverColor: #379ffa,
@ -120,7 +127,9 @@ $themes: (
chartOptionsBackgroundColor: #e0e0e0,
chartOptionsHoverColor: #ffffff,
tooltipBackgroundColor: #ffffff,
tooltipShadow: 0 0 1rem rgba(120, 120, 120, 0.5)
tooltipShadow: 0 0 1rem rgba(120, 120, 120, 0.5),
modalBackground: url(~src/assets/images/background-white.png),
closeButtonColor: #43454b
)
);

View file

@ -81,27 +81,3 @@ app-settings {
app-login {
min-width: inherit;
}
.switch {
@include themify($themes) {
background-color: themed(switchBackgroundColor);
}
.circle {
&.on {
@include themify($themes) {
background-color: themed(blueTextColor);
}
}
&.off {
@include themify($themes) {
background-color: themed(optionalTextColor);
}
}
}
}

View file

@ -17,6 +17,7 @@
&:not(:last-child) {
position: relative;
cursor: pointer;
margin-right: 20px;
&:after {

View file

Before

Width:  |  Height:  |  Size: 644 B

After

Width:  |  Height:  |  Size: 644 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 142 KiB

View file

@ -7,7 +7,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i" rel="stylesheet">
<script type="text/javascript" src="qrc:///qtwebchannel/qwebchannel.js"></script>
</head>
<body>

View file

@ -1,474 +0,0 @@
@import "../variables";
@import "mixins";
#contacts {
padding: 2.5rem 8rem;
.main-options-wrapper {
.contacts-options {
.flex-container-direction(row);
.flex-container-alignment(center, space-between);
margin-bottom: 7rem;
.contacts-options-left {
.flex-container-direction(row);
.contacts-groups {
.dropdown-toggle {
.flex-container;
.flex-container-alignment(center, space-between);
background-color: white !important;
border: 1px solid @contacts-groups-border-color;
border-radius: 4rem;
box-shadow: none;
color: @program-dark-color;
font-size: 3.75rem;
height: 8.25rem;
padding: 0 4rem;
outline-style: none !important;
width: 62.5rem;
z-index: 0;
.filter-option {
text-overflow: ellipsis;
white-space: nowrap;
}
.caret {
position: relative;
margin: 0;
}
}
.dropdown-menu.open {
top: 10.5rem;
border-radius: 2rem;
box-shadow: @box-shadow;
margin: 0;
li {
a {
min-height: 8.25rem;
word-break: break-word;
}
&.divider {
display: block;
background-color: @program-divider-color;
margin: 0 auto;
width: 90%;
}
.edit-groups-item {
.flex-container;
.flex-container-alignment(center, flex-start);
.base-icon {
.icon-sizing(5rem, 5rem, -3.5rem, -4.5rem);
margin-right: 1.5rem;
flex-shrink: 0;
&:before {
content: '#';
}
}
}
}
}
}
.contacts-search {
margin-left: 3.25rem;
}
}
.contacts-buttons {
.flex-container;
.main-options-btn {
.add-contact-icon {
.icon-sizing(4rem, 4rem, -4rem, -5rem);
margin-right: 2rem;
}
&:not(:first-child) {
margin-left: 6rem;
}
}
}
}
}
.contacts-table {
margin-bottom: 3rem;
.contacts-name {
display: inline-flex;
min-width: 22rem;
.flex-container-alignment(center, flex-start);
font-size: 3.75rem;
word-break: break-word;
.base-icon {
.icon-sizing(4rem, 4rem, -4rem, -5rem);
color: @program-table-icon-color;
margin-right: 1rem;
flex-shrink: 0;
}
&:hover {
color: @program-hover-color;
cursor: pointer;
.base-icon {
color: @program-hover-color;
}
}
}
.contacts-account {
.flex-container;
.safe-address {
font-size: 3.25rem;
margin-top: 0.75rem;
margin-bottom: 0.75rem;
.safe-address-wrap {
width: 40rem;
}
.safe-address-inner {
left: inherit;
right: 0;
width: 150%;
.contact-address {
.safe-address-inner-additional {
.flex-container-direction(row-reverse);
.flex-container-alignment(flex-start, space-between);
margin-top: 2rem;
.copy-icon {
cursor: pointer;
float: none;
margin-right: -1rem;
margin-top: 0;
margin-bottom: 0;
&:hover, &.hovered {
color: @program-exuding-color;
}
&.hovered:before {
content: 'A';
}
}
}
&:not(:first-child) {
border-top: 1px solid @program-divider-color;
margin-top: 4rem;
padding-top: 3rem;
}
}
}
}
alias-display:not(.safe-address-inner-alias) {
display: inline-flex;
.safe-alias {
margin-top: 0.75rem;
margin-bottom: 0.75rem;
}
}
}
.contacts-location, .contacts-groups {
max-width: 32.5rem;
}
.contacts-communication-method {
max-width: 43rem;
}
.contacts-note {
.flex-container;
.flex-container-alignment(center, flex-start);
position: relative;
.base-icon {
.icon-sizing(4rem, 4rem, -4rem, -5rem);
cursor: pointer;
}
}
.contacts-menu {
line-height: 0;
visibility: hidden;
.contacts-menu-btn {
background: transparent;
border: none;
padding: 0;
margin: 0;
.base-icon {
.icon-sizing(4rem, 4rem, -4rem, -5rem);
}
}
.contacts-menu-list {
.menu-list(-10.5rem, inherit, -3rem, 38rem);
}
}
tr {
font-size: 3.25rem;
.table-long-item-wrapper {
.table-long-item {
.table-long-item-text {
font-size: 3.25rem;
}
}
}
th:last-child, td:last-child {
width: 10rem;
}
&:hover {
.contacts-menu {
visibility: visible;
}
}
}
}
.export-import-contacts-wrapper {
.flex-container;
color: @export-import-contacts-text-color;
.export-import-contacts-btn {
.flex-container;
.flex-container-alignment(center, center);
background-color: fade(white, 20%);
border: 1px solid @export-import-contacts-border-color;
font-size: 3.5rem;
height: 6rem;
padding: 0;
.base-icon {
.icon-sizing(4rem, 4rem, -4rem, -5rem);
}
&.left-btn {
border-radius: 3rem 0 0 3rem;
border-right: none;
width: 32.5rem;
}
&.right-btn {
border-radius: 0 3rem 3rem 0;
width: 8.5rem;
}
&:hover {
background-color: fade(white, 40%);
color: @program-dark-color;
cursor: pointer;
}
}
.export-import-contacts-menu{
.menu-list(-1rem, inherit, 0, 42.5rem);
}
}
}
#contact-details {
padding: 2.5rem 8rem;
.contact-details-options {
.flex-container-direction(row);
.flex-container-alignment(center, space-between);
margin-bottom: 5.5rem;
.back-btn {
margin: 0 0 1rem;
}
.contact-name {
color: @program-dark-color;
font-size: 7.75rem;
font-weight: 300;
line-height: 7.5rem;
margin-top: 0;
margin-bottom: 5.5rem;
text-align: center;
width: 100%;
}
}
.contacts-data {
margin-top: 11rem;
margin-bottom: 5rem;
.adaptive-form-field-group {
padding-bottom: 7.5rem;
.field-group-label {
min-width: 42rem;
max-width: 42rem;
}
.safe-address-wrapper {
width: 100%;
.general-input-wrapper {
.contact-option-icon {
.icon-sizing(4rem, 4rem, -4rem, -5rem);
min-width: 4rem;
visibility: hidden;
align-self: flex-end;
margin: 1.5rem 0 1.5rem 2rem;
&:hover {
color: @program-hover-color;
}
&.hovered:before {
content: 'A';
}
}
&:hover {
.contact-option-icon {
cursor: pointer;
visibility: visible;
}
}
}
.safe-alias-modal {
margin-top: 4rem;
}
.contacts-data-btn-wrapper {
.flex-container;
flex-wrap: wrap;
.contacts-data-btn {
.flex-container-direction(row);
.flex-container-alignment(center, center);
background: transparent;
border: none;
color: @contacts-accounts-btn-text-color;
font-size: 3rem;
margin: 3rem 13rem 0 0;
padding: 0;
.base-icon {
.icon-sizing(6rem, 6rem, -3rem, -4rem);
margin-right: 1.5rem;
margin-left: -0.5rem;
}
&:hover {
color: @program-hover-color;
}
}
}
}
.contact-connection-wrapper {
.flex-container;
width: 100%;
.messenger-type, angucomplete-alt {
margin-right: 6.5rem;
min-width: 37%;
width: 37%;
}
}
.add-contact-btn {
.flex-container-direction(row);
.flex-container-alignment(center, center);
background: transparent;
border: none;
color: @contacts-accounts-btn-text-color;
font-size: 3rem;
line-height: 7rem;
margin: 0 0 0.25rem;
padding: 0;
.base-icon {
.icon-sizing(6rem, 6rem, -3rem, -4rem);
margin-right: 1.5rem;
margin-left: -0.5rem;
}
&:hover {
color: @program-hover-color;
}
}
.edit-groups-field {
.flex-container;
.flex-container-alignment(center, flex-start);
.edit-groups-icon {
.icon-sizing(5rem, 5rem, -3.5rem, -4.5rem);
margin-right: 1.5rem;
flex-shrink: 0;
&:before {
content: '#';
}
}
}
}
}
.contact-payment-history {
padding: 7rem 2.5rem 6rem;
}
.contact-empty-payments {
color: @program-empty-color;
font-size: 3.75rem;
line-height: 5.5rem;
padding: 12.5rem 0;
text-align: center;
}
.delete-contact-btn {
.flex-container;
.flex-container-alignment(center, center);
background: transparent;
border: none;
color: @program-dark-color;
font-size: 4.25rem;
margin: 1rem auto 0;
padding: 0;
.base-icon {
.icon-sizing(5rem, 4rem, -3.5rem, -5rem);
margin-right: 3rem;
}
}
}

View file

@ -1,221 +0,0 @@
@import "../variables";
@import "mixins";
#dashboard {
padding: 0 8rem 2.5rem;
.main-options-wrapper {
.dashboard-options {
.flex-container;
.flex-container-alignment(center, space-between);
margin-bottom: 7rem;
.top-options-list {
.flex-container;
justify-content: space-between;
flex-grow: 1;
.top-options-item {
background: rgba(255, 255, 255, 0.4);
padding: 2.5rem 0;
flex-basis: 25%;
.top-options-link {
.flex-container-direction(row);
.flex-container-alignment(center, center);
height: 12rem;
color: @dashboard-indicator-text-color;
cursor: pointer;
.base-icon {
.icon-sizing(12rem, 12rem, 0, -1rem);
color: @dashboard-indicator-icon-color;
margin-right: 1rem;
}
.top-options-number {
font-size: 8rem;
font-weight: 200;
line-height: 6rem;
}
&:hover {
color: @program-main-color;
.base-icon {
color: @program-main-color;
}
}
}
&:first-child {
border-radius: 3rem 0 0 3rem;
.top-options-link {
border-radius: 2.75rem 0 0 2.75rem;
}
}
&:not(:first-child) {
border-left: none;
}
&:last-child {
border-radius: 0 3rem 3rem 0;
.top-options-link {
border-radius: 0 2.75rem 2.75rem 0;
}
}
}
}
.dashboard-buttons {
margin-top: 3rem;
}
}
}
.dashboard-slider-wrapper {
margin: 0 -3.5rem;
overflow: hidden;
.dashboard-slider {
.flex-container;
padding-top: 3rem;
width: 200%;
transition: 1s;
.dashboard-slider-item {
max-width: 25%;
min-width: 25%;
padding: 0 3.5rem;
transition: 1s;
}
}
}
.slider-control-wrapper {
.flex-container;
.flex-container-alignment(center, space-between);
padding-top: 2.75rem;
.slider-control-btn {
.flex-container;
.flex-container-alignment(center, center);
background: rgba(255, 255, 255, 0.7);
border: 1px solid @dashboard-slider-border-color;
border-radius: 100%;
color: @dashboard-slider-icon-color;
padding: 0;
height: 7rem;
width: 7rem;
.base-icon {
.icon-sizing(4rem, 4rem, -3rem, -3.75rem);
font-size: 12rem;
}
&.prev-btn {
transform: rotate(180deg);
}
&:hover {
background: white;
color: @program-main-color;
}
}
.slider-status-wrapper {
.flex-container;
.flex-container-alignment(center, center);
line-height: 0;
list-style-type: none;
padding: 0;
margin: 0;
li {
.slider-status-btn {
background: rgba(255, 255, 255, 0.5);
border: none;
border-radius: 100%;
margin: 0 1rem;
padding: 0;
height: 2rem;
width: 2rem;
}
&.active-slide {
.slider-status-btn{
background: white;
border: 1px solid @dashboard-slider-border-color;
height: 2.5rem;
width: 2.5rem;
}
}
}
}
}
.add-widget-btn-wrapper {
.flex-container;
.flex-container-alignment(center, center);
margin: 5rem auto;
.add-widget-btn {
position: relative;
button {
.flex-container;
.flex-container-alignment(center, center);
background: transparent;
border: none;
color: @program-dark-color;
font-size: 4.25rem;
padding: 0;
.base-icon {
.icon-sizing(4rem, 4rem, -4rem, -5rem);
margin-top: 0.5rem;
margin-right: 1.5rem;
z-index: -1;
}
}
.dropdown-menu {
.menu-list(inherit, 50%, inherit, 88rem);
.flex-container-direction(row);
flex-wrap: wrap;
bottom: 0;
transform: translateX(-50%) translateY(-2em);
li {
flex-basis: 50%;
flex-shrink: 0;
button {
border-radius: 0 !important;
}
&.last-element {
flex-basis: 100%;
button {
-webkit-justify-content: center;
justify-content: center;
}
}
}
}
&.open {
.dropdown-menu {
transform: translateX(-50%) translateY(0);
}
}
}
}
}

View file

@ -1,134 +0,0 @@
@import "../variables";
.datepicker {
border: none !important;
border-radius: 2.5rem !important;
-webkit-box-shadow: @box-shadow !important;
box-shadow: @box-shadow !important;
font-family: 'Titillium Web', 'AgoraSansPro', sans-serif;
width: 65rem !important;
.datepicker--pointer {
display: none;
}
.datepicker--nav {
border-bottom: none;
.datepicker--nav-action {
path {
stroke: @datepicker-nav-action-color;
stroke-width: 1px;
}
&:hover {
background: none;
}
}
.datepicker--nav-title {
color: @datepicker-nav-title-color;
font-size: 4rem;
text-transform: uppercase;
font-style: normal !important;
i {
color: @datepicker-nav-title-color;
}
&:hover {
background: none;
}
}
}
.datepicker--content {
color: @program-dark-color;
font-size: 3.25rem;
.datepicker--body {
.datepicker--days-names {
.datepicker--day-name {
color: @datepicker-day-name-color;
font-size: 3.25rem;
text-transform: uppercase;
}
}
.datepicker--cells {
justify-content: space-between;
.datepicker--cell {
height: 7rem !important;
width: 7rem !important;
margin: 0.5rem;
&.-selected- {
color: @program-dark-color;
border-radius: 100%;
background: @datepicker-cell-selected-color;
&:hover {
color: @program-dark-color;
background: @datepicker-cell-selected-color;
}
}
&.-focus- {
border-radius: 100%;
border: 1px solid @datepicker-cell-border-color;
background: transparent;
}
&.-disabled- {
color: @program-dark-color;
&:hover {
border: none !important;
}
}
&.-other-month- {
color: @datepicker-day-other-month-color;
&.-selected- {
&:hover {
color: @datepicker-day-other-month-color;
}
}
&:hover {
border-radius: 100%;
border: 1px solid @datepicker-cell-border-color;
}
}
&.-current- {
color: @program-dark-color;
border-radius: 100%;
border: 1px solid @datepicker-cell-border-color;
&.-selected- {
&:hover {
color: @program-dark-color;
background: @datepicker-cell-selected-color;
}
}
&:hover {
border-radius: 100%;
border: 1px solid @datepicker-cell-border-color;
color: @program-dark-color;
background: transparent;
}
}
}
}
}
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,177 +0,0 @@
@import "../variables";
@import "mixins";
header {
min-height: 36.5rem;
min-width: @min-width;
padding: 0 8rem 5.5rem;
.header-top-wrapper {
.flex-container;
.flex-container-alignment(center, space-between);
min-height: 22rem;
max-height: 22rem;
.header-options-wrapper {
.flex-container;
.flex-container-alignment(center, flex-start);
height: 6rem;
.header-lock-btn {
.icon-sizing(5rem, 8rem, -3.5rem, -3rem);
color: @program-dark-color;
cursor: pointer;
margin-right: 10.5rem;
}
.header-test-network {
color: @program-light-color;
font-size: 3.5rem;
font-weight: 300;
line-height: 6rem;
margin-right: 9.5rem;
.base-icon {
color: @program-light-color;
}
}
.header-status {
font-size: 3.5rem;
font-weight: 300;
line-height: 6rem;
&.online {
color: @program-online-color;
}
&.offline {
color: @program-offline-color;
}
&.loading {
color: @program-light-color;
}
&.sync-wrapper {
.flex-container;
.flex-container-alignment(center, center);
color: @program-online-color;
.sync {
padding-right: 4rem;
}
progress[value] {
-webkit-appearance: none;
appearance: none;
width: 36.5rem;
height: 0.75rem;
&::-webkit-progress-bar{
background-color: @program-progress-bar-bg-color;
border-radius: 1rem;
}
&::-webkit-progress-value{
background-color: @program-progress-bar-fill-color;
border-radius: 1rem;
}
}
.sync-percent {
padding-left: 2.5rem;
opacity: 0.5;
}
}
}
}
.header-logo-wrapper {
.header-logo {
display: block;
background: url("../img/logo.svg") center no-repeat;
background-size: 100%;
height: 7.5rem;
width: 50rem;
}
}
}
.header-nav-wrapper {
.flex-container;
min-height: 10rem;
max-height: 10rem;
.sidebar-nav {
.flex-container;
flex-grow: 1;
.nav-item {
border-top: 1px solid @program-header-border-color;
border-bottom: 1px solid @program-header-border-color;
border-right: 1px solid @program-header-border-color;
flex-grow: 1;
text-align: center;
height: 9rem;
box-sizing: content-box;
.nav-item-link {
display: flex;
justify-content: center;
background: white;
border: none;
color: @program-header-text-color;
margin: 0;
padding: 1.5rem 0;
font-size: 4.25rem;
line-height: 6rem;
width: 100%;
.indicator-number {
border-color: @program-header-indicator-border-color;
color: @program-header-indicator-text-color;
margin-left: 2.5rem;
margin-right: -2rem;
}
&:disabled {
color: @program-header-text-blocked-color;
}
}
&:first-child {
border-left: 1px solid @program-header-border-color;
border-radius: 10rem 0 0 10rem;
.nav-item-link {
border-radius: 9.75rem 0 0 9.75rem;
}
}
&:last-child {
border-radius: 0 10rem 10rem 0;
.nav-item-link {
border-radius: 0 9.75rem 9.75rem 0;
}
}
&:hover:not(.active) {
.nav-item-link:not(:disabled) {
background: @program-header-bg-hover-color;
}
}
&.active {
.nav-item-link {
background: @program-header-bg-active-color;
border-color: @program-header-bg-active-color;
}
}
}
}
}
}

View file

@ -1,83 +0,0 @@
@import "../variables";
.highcharts-container{
width: 100%!important;
}
.highcharts-background {
fill-opacity: 0;
}
.highcharts-tooltip {
span {
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
b {
text-align: center;
}
}
}
.highcharts-input-group {
display: none;
}
.highcharts-range-selector-buttons {
visibility: hidden;
}
.highcharts-scrollbar-thumb{
opacity: 1;
stroke: @highcharts-scrollbar-color;
}
.highcharts-scrollbar-arrow{
display: none;
}
.highcharts-scrollbar-rifles{
stroke: @highcharts-scrollbar-color;
}
.highcharts-axis.highcharts-xaxis {
stroke: @highcharts-axis-line-color;
.highcharts-tick {
stroke: @highcharts-axis-line-color;
}
.highcharts-axis-line {
stroke: @highcharts-axis-line-color;
}
}
.highcharts-grid.highcharts-xaxis-grid.highcharts-navigator-xaxis{
stroke-opacity: 0;
}
.highcharts-label-box.highcharts-tooltip-box {
filter: url("#dropShadow");
&:nth-child(1) {
fill-opacity: 0;
stroke-opacity: 0;
}
&:nth-child(2) {
fill-opacity: 0;
stroke-opacity: 0;
}
&:nth-child(3) {
fill-opacity: 0;
stroke-opacity: 0;
}
}
feFlood {
flood-color: #1f360b;
}

View file

@ -1,239 +0,0 @@
@import "../variables";
@import "mixins";
#history {
padding: 2.5rem 8rem;
}
.history-options {
.flex-container-direction(row);
.flex-container-alignment(center, flex-start);
position: relative;
margin-bottom: 7rem;
.history-search {
margin-left: 3.25rem;
}
}
.history-table {
margin-bottom: 3rem;
table {
thead {
tr {
font-size: 3.25rem;
}
}
tr {
th:first-child {
padding-left: 0;
padding-right: 10rem;
text-align: center;
}
td:first-child {
position: relative;
padding-left: 0;
padding-right: 10rem;
&::after {
content: "";
position: absolute;
top: 0;
bottom: 0;
left: 0;
}
&.history-marker::after {
border-left: 1rem solid @marker-light-green;
}
}
td:last-child {
width: 14rem;
}
&.transaction-blocked {
background-color: @history-transaction-blocked-border-color !important;
color: @history-transaction-blocked-text-color;
.transaction-status-indicator {
.status-graph {
&.income {
stroke: @history-transaction-blocked-status-income-color !important;
}
&.outgoing {
stroke: @history-transaction-blocked-status-outgoing-color !important;
}
}
.status-inner {
.base-icon.income {
color: @history-transaction-blocked-status-income-color !important;
}
.base-icon.outgoing {
color: @history-transaction-blocked-status-outgoing-color !important;
}
}
}
.safe-address {
.safe-address-wrap {
color: @history-transaction-blocked-text-color;
.safe-address-text {
background: -webkit-linear-gradient(left, @history-transaction-blocked-text-color 0, @history-transaction-blocked-text-color 75%, transparent 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
}
.safe-alias {
.safe-alias-btn {
background-color: fade(@history-transaction-blocked-text-color, 20%);
border-color: @history-transaction-blocked-alias-color;
color: @history-transaction-blocked-text-color;
}
}
.history-date {
&:hover {
color: @history-transaction-blocked-hover-color;
.base-icon {
color: @history-transaction-blocked-hover-color;
}
}
}
.history-safe {
&:hover {
color: @history-transaction-blocked-hover-color;
}
}
&:hover {
.history-date {
.base-icon {
opacity: 0.6;
}
}
}
}
&:hover {
.history-date {
.base-icon {
opacity: 0.3;
}
}
}
}
}
.transaction-status-indicator {
margin: 0 auto;
}
.history-safe {
.flex-container;
.flex-container-alignment(center, flex-start);
.history-anonym-icon {
.icon-sizing(4rem, 5rem, -4rem, -4.5rem);
margin-right: 2rem;
}
&:hover {
color: @program-hover-color;
cursor: pointer;
}
}
.history-date {
.flex-container-alignment(center, flex-start);
display: inline-flex;
.base-icon {
.icon-sizing(5rem, 5rem, -3.5rem, -4.5rem);
margin-left: 2rem;
opacity: 0;
}
&:hover {
color: @program-hover-color;
cursor: pointer;
.base-icon {
color: @program-hover-color;
opacity: 0.3;
}
}
}
.history-counterparty {
.flex-container-direction(column);
max-width: 75rem;
.safe-address {
font-size: 3.25rem;
margin-top: 0.75rem;
margin-bottom: 0.75rem;
.safe-address-wrap {
width: 40rem;
}
.safe-address-inner {
left: inherit;
right: 0;
width: 150%;
}
}
alias-display:not(.safe-address-inner-alias) {
display: inline-flex;
.safe-alias {
margin-top: 0.75rem;
margin-bottom: 0.75rem;
}
}
}
.history-comment-wrapper {
.flex-container;
.base-icon {
.icon-sizing(4rem, 4rem, -4rem, -5rem);
&:hover {
cursor: pointer;
}
}
}
.contact-btn {
margin-top: 1.5rem;
padding: 0 1rem;
}
}

View file

@ -1,296 +0,0 @@
@import "../variables";
@import "mixins";
#mining {
padding: 2.5rem 8rem;
.main-options-wrapper {
.mining-options {
margin-bottom: 8rem;
}
}
.calculate-options {
.flex-container;
.flex-container-alignment(center, space-between);
color: @program-main-color;
height: 30.5rem;
padding: 2.5rem 11rem 0;
.calculate-tile {
.flex-container;
font-size: 3.5rem;
label {
.flex-container;
.flex-container-alignment(center, flex-end);
font-weight: 600;
height: 7rem;
line-height: 4.5rem;
margin-bottom: 0;
max-width: 45rem;
padding-right: 3rem;
text-align: end;
}
.general-input-wrapper {
width: 42rem;
}
.calculate-mining-btn {
border: 1px solid @mining-range-border-color;
height: 8rem;
width: 44rem;
font-size: 4rem;
margin-left: 3rem;
}
&:hover, &.focused-line {
label {
color: @program-hover-color;
}
.general-input-wrapper {
border-bottom-color: @program-hover-color;
.general-input {
color: @program-hover-color;
}
::-webkit-input-placeholder {
color: @program-input-placeholder-hover-color;
}
}
}
}
}
.chart-wrapper {
padding-top: 1rem;
padding-bottom: 5rem;
transition: all 0.5s linear;
overflow: hidden;
.chart-label {
.flex-container;
.flex-container-alignment(center, center);
position: relative;
color: @program-dark-color;
font-size: 5rem;
font-style: italic;
font-weight: 300;
padding-top: 5rem;
padding-bottom: 1rem;
.base-icon {
.icon-sizing(4rem, 4rem, -4rem, -5rem);
top: -1rem;
right: -1rem;
color: @program-label-info-color;
}
}
}
.mining-select-wrapper {
.flex-container;
.flex-container-alignment(center, space-between);
flex-grow: 1;
.mining-select {
.flex-container;
.dropdown-toggle {
border-bottom: none;
color: @program-hover-color;
font-size: 5rem;
line-height: 6rem;
padding: 0 3rem 0 0;
.caret {
color: @program-hover-color;
}
}
.dropdown-menu {
border-radius: 2rem;
min-width: 44rem;
width: 100%;
}
&.mining-safe {
padding-left: 5rem;
}
&.mining-view {
padding-left: 5rem;
padding-right: 6rem;
.dropdown-menu {
right: 0;
left: auto;
}
}
}
}
.mined-empty {
.flex-container;
.flex-container-alignment(center, center);
color: @program-empty-color;
font-size: 3.75rem;
height: 35rem;
}
.mined-statistics {
padding: 3rem 0;
.mined-statistics-options {
.flex-container;
.flex-container-alignment(flex-start, space-between);
padding: 7rem 7rem 0;
.chart-range-wrapper {
.flex-container;
.flex-container-alignment(center, space-between);
margin-top: 1rem;
.chart-range-group {
.flex-container;
.flex-container-alignment(center, center);
color: @program-dark-color;
font-size: 3rem;
.chart-range-selector {
.flex-container;
margin: 0 2.5rem;
padding: 0;
li {
border: 1px solid @mining-range-border-color;
color: @mining-range-text-color;
line-height: 5.5rem;
height: 6rem;
width: 13rem;
text-align: center;
list-style-type: none;
&:first-child {
border-radius: 3rem 0 0 3rem;
width: 13.5rem;
}
&:not(:first-child) {
border-left: none;
}
&:last-child {
border-radius: 0 3rem 3rem 0;
width: 13.5rem;
}
}
.active {
background: white;
color: @program-dark-color;
}
}
&:first-child {
margin-right: 8.5rem;
@media screen and (max-width: 1150px) {
margin-right: 2.5rem;
}
}
}
}
.total-mined-chart {
color: @program-dark-color;
font-size: 5rem;
font-style: italic;
font-weight: 300;
line-height: 7rem;
white-space: nowrap;
text-align: right;
}
.total-mined-table {
color: @program-dark-color;
font-size: 5rem;
font-style: italic;
font-weight: 300;
line-height: 7rem;
text-align: right;
width: 100%;
}
}
}
.statistics-table {
margin: 8rem 2.5rem 2.5rem;
overflow: hidden;
transition: height 1s;
table {
tbody {
tr {
td {
width: 33.33%;
.order-icon {
opacity: 0.6;
}
&:first-child {
position: relative;
padding-left: 8rem;
&::after {
content: "";
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
border-left: 1rem solid @marker-light-green;
}
}
}
}
}
}
}
.pagination-wrapper {
margin: 5rem 2.5rem 3rem;
.pagination {
.pages {
color: @program-pagination-text-inactive-color;
}
.next-page, .prev-page {
background-color: transparent;
border-color: @program-main-color;
color: @program-main-color;
}
}
}
#chart-calculate {
width: 100%;
height: 70rem;
}
#chart-statistics{
width: 100%;
height: 142rem;
}
}

View file

@ -1,113 +0,0 @@
@import "../variables";
.flex-container {
display: -webkit-flex;
display: flex;
}
.flex-container-direction(@direction) {
.flex-container;
-webkit-flex-direction: @direction;
flex-direction: @direction;
}
.flex-container-alignment(@align-items, @justify-content) {
-webkit-align-items: @align-items;
align-items: @align-items;
-webkit-justify-content: @justify-content;
justify-content: @justify-content;
}
.general-button(@width, @height) {
.flex-container;
.flex-container-alignment(center, center);
background: fade(white, 40%);
border: none;
border-radius: 10rem;
padding: 0 3rem;
height: @height;
width: @width;
&:hover {
background: fade(white, 55%);
}
&:active {
background: fade(white, 55%);
}
}
.icon-sizing(@height, @width, @top, @left) {
width: @width;
height: @height;
&:before {
top: @top;
left: @left;
}
}
.menu-list(@top, @left, @right, @width) {
position: absolute;
top: @top;
left: @left;
right: @right;
min-width: @width;
padding: 0;
margin: 0;
border: none;
box-shadow: @box-shadow;
border-radius: 2rem;
overflow: hidden;
li {
width: 100%;
button {
.flex-container;
.flex-container-alignment(center, flex-start);
background: transparent;
border: none;
color: @program-exuding-color;
font-size: 3.5rem;
height: 8.25rem;
padding-left: 3rem;
text-align: left;
width: 100%;
white-space: nowrap;
&:disabled {
color: @program-light-color;
}
&:hover {
&:not(:disabled) {
background: @program-select-hover-color;
cursor: pointer;
}
}
}
&:first-child {
button {
border-top-left-radius: 2rem;
border-top-right-radius: 2rem;
}
}
&:last-child {
button {
border-bottom-left-radius: 2rem;
border-bottom-right-radius: 2rem;
}
}
}
.menu-divider {
border-top: 1px solid @program-divider-color;
margin: 0 3.5rem;
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,125 +0,0 @@
@import "../variables";
@import "mixins";
.page-empty {
.flex-container;
.flex-container-alignment(center, center);
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: -1;
color: @program-exuding-color;
text-align: center;
min-height: 150rem;
.one-block {
display: inline-block;
width: 112rem;
&.wider-block {
width: 140rem;
}
h1 {
font-size: 10.75rem;
font-weight: 200;
margin-top:6.5rem;
}
span {
font-size: 6.25rem;
margin-top: 5.5rem;
font-weight: 200;
line-height: 9.5rem;
text-align: center;
}
}
}
.dashboard-empty {
z-index: 0;
margin: 18rem 8rem;
min-height: 100rem;
.main-block {
display: block;
height: 100%;
padding: 0 30rem;
overflow: hidden;
.main-block-row {
.flex-container;
.flex-container-alignment(center, space-between);
width: 155rem;
height: 100%;
transition: transform 0.5s ease-in-out;
.main-block-col {
.flex-container-direction(column);
.flex-container-alignment(center, center);
position: relative;
margin-bottom: 0;
width: 55rem;
transition: all 0.2s ease-in-out;
.main-block-icon {
&.dashboard-create-safe {
background: url('../img/createsafe.svg') no-repeat center;
background-size: 100%;
width: 50rem;
height: 16rem;
}
&.dashboard-open-safe {
background: url('../img/opensafe.svg') no-repeat center;
background-size: 100%;
width: 50rem;
height: 20rem;
margin-top: -4rem;
}
&.dashboard-open-file-safe {
background: url('../img/openfilesafe.svg') no-repeat center;
background-size: 100%;
width: 50rem;
height: 16rem;
margin-top: -1.5rem;
margin-bottom: 1.5rem;
}
&.dashboard-open-smartsafe {
background: url('../img/opensmartsafe.svg') no-repeat center;
background-size: 100%;
width: 50rem;
height: 16rem;
margin-top: -1.5rem;
margin-bottom: 1.5rem;
}
}
.main-block-title {
font-size: 9.5rem;
font-weight: 200;
line-height: 24rem;
margin-bottom: 3rem;
white-space: nowrap;
&.smaller-size {
font-size: 8rem;
}
}
&:hover {
margin-top: -3rem;
}
}
}
.slide-up {
transform: translateY(-100%);
}
}
}

View file

@ -1,118 +0,0 @@
@import "../variables";
@import "mixins";
.main-options-wrapper {
.page-title {
color: @program-dark-color;
font-size: 8rem;
font-weight: 300;
line-height: 9rem;
margin: 0;
}
.back-btn {
.flex-container;
.flex-container-alignment(center, center);
background: transparent;
border: none;
color: @program-dark-color;
font-size: 3.75rem;
padding: 0;
margin: 0;
.base-icon {
.icon-sizing(3rem, 2rem, -4.5rem, -6rem);
margin-right: 2rem;
margin-bottom: -0.5rem;
}
}
.main-options-btn {
.general-button(auto, 8.25rem);
color: @program-button-text-color;
font-size: 4.25rem;
min-width: 45rem;
&.disabled {
color: @program-light-color;
cursor: default;
&:hover {
background: fade(white, 55%);
}
&:active {
background: fade(white, 55%);
}
}
}
.main-options-btn-group {
.flex-container-direction(row);
border-radius: 10rem;
.main-options-btn {
border-radius: 0;
min-width: 33rem;
&.button-in-group {
border-right: 1px solid @program-button-divider-color;
&:first-child {
border-top-left-radius: 10rem;
border-bottom-left-radius: 10rem;
}
&:last-child {
border-top-right-radius: 10rem;
border-bottom-right-radius: 10rem;
margin-right: 0;
}
}
&.button-in-dropdown {
border-top-right-radius: 10rem;
border-bottom-right-radius: 10rem;
.base-icon {
.icon-sizing(2rem, 2rem, -4rem, -5rem);
margin-top: 0.5rem;
margin-left: 2rem;
font-size: 12rem;
}
}
}
.dropdown.open {
.button-in-dropdown {
background: rgba(255, 255, 255, 0.55)!important;
}
}
.dropdown-menu {
.menu-list(10.5rem, inherit, -0.75rem, 47rem);
border-radius: 3rem;
li {
height: auto;
button {
font-size: 3.75rem;
padding: 1.5rem 4rem;
}
&:first-child {
border-top-left-radius: 3rem;
border-top-right-radius: 3rem;
}
&:last-child {
border-bottom-left-radius: 3rem;
border-bottom-right-radius: 3rem;
}
}
}
}
}

View file

@ -1,119 +0,0 @@
@import "../variables";
@import "mixins";
.pagination-wrapper {
.flex-container-direction(row);
.flex-container-alignment(center, space-between);
.display {
.flex-container-direction(row);
.flex-container-alignment(center, space-between);
font-size: 3.75rem;
.display-text {
color: @program-pagination-text-color;
margin-right: 2rem;
}
.display-values {
.flex-container-direction(row);
color: @program-pagination-text-inactive-color;
padding: 0;
margin: 0;
li {
display: inline-block;
margin: 0 2rem;
width: 4rem;
&:hover {
color: @program-pagination-text-color;
cursor: pointer;
}
&.active {
color: @program-pagination-text-color;
}
}
}
}
.show-all {
.flex-container;
color: @program-pagination-text-color;
cursor: pointer;
.base-icon {
.icon-sizing(6rem, 6rem, -3rem, -4rem);
margin-right: 2rem;
&.rotate-icon {
transform: rotate(180deg);
}
}
.show-all-text {
font-size: 3.75rem;
line-height: 6rem;
}
}
.pagination {
.flex-container-direction(row);
.flex-container-alignment(center, space-between);
margin: 0;
.prev-page, .next-page {
.flex-container;
.flex-container-alignment(center, center);
background-color: fade(white, 30%);
border: 1px solid @program-pagination-border-color;
border-radius: 3rem;
color: white;
height: 6rem;
width: 7.5rem;
.pagination-arrow {
.icon-sizing(4rem, 4rem, -3rem, -3.75rem);
font-size: 12rem;
}
&:hover {
background-color: fade(white, 45%);
cursor: pointer;
}
}
.prev-page {
.pagination-arrow {
transform: rotate(180deg);
}
}
.pages {
.flex-container;
color: @program-pagination-pages-color;
font-size: 3.75rem;
margin: 0 2.5rem;
span {
margin: 0 0.5rem;
}
.active-page {
width: 6rem;
.general-input{
border-bottom: none;
color: white;
padding: 0;
text-align: center;
}
}
}
}
}

View file

@ -1,212 +0,0 @@
@import "../variables";
@import "mixins";
.general-panel {
background: @program-panel-bg-color;
border: 1px solid @program-panel-border-color;
border-radius: 3rem;
margin-bottom: 6rem;
.general-panel-header {
.flex-container-direction(row);
.flex-container-alignment(center, flex-start);
background-color: @program-panel-header-bg-color;
border-top-left-radius: 2.75rem;
border-top-right-radius: 2.75rem;
color: @program-dark-color;
font-size: 5rem;
height: 13rem;
padding-left: 4rem;
.general-panel-header-arrow {
.icon-sizing(2rem, 2rem, -5rem, -6rem);
cursor: pointer;
margin-left: 2rem;
}
&.closed-panel {
border-bottom: none;
border-bottom-left-radius: 2.75rem;
border-bottom-right-radius: 2.75rem;
.general-panel-header-arrow {
transform: rotate(180deg);
}
}
}
.general-panel-body {
border-bottom-left-radius: 2.75rem;
border-bottom-right-radius: 2.75rem;
.adaptive-form {
.flex-container-direction(column);
color: @program-exuding-color;
padding-left: 32rem;
padding-right: 37rem;
i {
display: flex;
&.option-icon {
align-self: flex-end;
margin: 1.5rem 0 1.5rem 2rem;
}
}
.adaptive-form-column {
width: 100%;
.adaptive-form-field-group {
.flex-container-direction(row);
.field-group-label {
.flex-container;
.flex-container-alignment(center, flex-end);
position: relative;
color: @program-label-color;
font-size: 3.5rem;
font-weight: 600;
line-height: 3.5rem;
height: 7rem;
padding-right: 2.5rem;
margin: 0;
min-width: 31rem;
max-width: 31rem;
text-align: right;
}
.field-group-error-wrapper {
.flex-container-direction(column);
width: 100%;
.field-group-error {
display: block;
color: @error-color;
font-size: 3.25rem;
line-height: 2.75rem;
font-style: italic;
margin-top: 1.5rem;
}
}
.general-input {
&:hover, &:focus, &:active {
&:read-only:not(.no-hover) {
cursor: pointer;
}
}
}
&:hover, &.focused-line {
&:not(.no-hover) {
color: @program-hover-color;
.general-input {
border-bottom-color: @program-hover-color;
color: @program-hover-color;
&::-webkit-input-placeholder {
color: @program-input-placeholder-hover-color;
}
}
.general-input-wrapper {
border-bottom-color: @program-hover-color;
color: @program-hover-color;
::-webkit-input-placeholder {
color: @program-input-placeholder-hover-color;
}
}
.general-textarea {
border-bottom-color: @program-hover-color;
color: @program-hover-color;
&::-webkit-input-placeholder {
color: @program-input-placeholder-hover-color;
}
}
.general-select {
.dropdown-toggle {
color: @program-hover-color;
border-bottom-color: @program-hover-color;
}
}
}
.option-icon {
cursor: pointer;
visibility: visible;
}
}
}
}
@media screen and (min-width: 1085px) and (max-width: 1164px) {
padding-left: 47rem;
padding-right: 52rem;
}
@media screen and (min-width: 1165px) and (max-width: 1334px) {
.flex-container-direction(row);
padding-left: 9.5rem;
padding-right: 21.5rem;
.adaptive-form-column {
width: 50%;
&:first-child {
margin-right: 9.5rem;
}
&:last-child {
margin-left: 9.5rem;
}
}
}
@media screen and (min-width: 1335px) and (max-width: 1614px) {
.flex-container-direction(row);
padding-left: 16.5rem;
padding-right: 23.5rem;
.adaptive-form-column {
width: 50%;
&:first-child {
margin-right: 9.5rem;
}
&:last-child {
margin-left: 9.5rem;
}
}
}
@media screen and (min-width: 1615px) {
.flex-container-direction(row);
padding-left: 25rem;
padding-right: 31rem;
.adaptive-form-column {
width: 50%;
&:first-child {
margin-right: 9.5rem;
}
&:last-child {
margin-left: 9.5rem;
}
}
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -1,84 +0,0 @@
@import "../variables";
@import "mixins";
#settings {
padding: 2.5rem 8rem;
.main-options-wrapper {
.settings-options {
.flex-container-direction(row);
.flex-container-alignment(center, space-between);
}
}
.settings-panel {
background: @program-panel-bg-color;
border: 1px solid @program-panel-border-color;
border-radius: 3rem;
width: 100%;
.settings-panel-header {
background-color: fade(@program-panel-border-color, 30%);
border-top-left-radius: 2.75rem;
border-top-right-radius: 2.75rem;
color: @program-dark-color;
height: 21rem;
padding-left: 6rem;
h3 {
font-size: 5rem;
line-height: 21rem;
margin: 0;
}
}
.settings-panel-body {
.settings-panel-body-item {
.flex-container;
.flex-container-alignment(center, space-between);
color: @program-main-color;
font-size: 4rem;
height: 21rem;
padding-left: 6rem;
padding-right: 7rem;
.general-select {
max-width: 51.5rem;
.dropdown-menu {
&.open {
max-height: 32rem !important;
.inner{
max-height: inherit !important;
}
}
}
}
.general-range-wrapper {
width: 76rem;
}
.settings-btn {
font-size: 4rem;
height: 8.5rem;
width: 32rem;
}
&:nth-child(even) {
background-color: fade(@program-panel-border-color, 30%);
}
&:first-child {
border-top: none;
}
&:last-child {
border-bottom-left-radius: 2.75rem;
border-bottom-right-radius: 2.75rem;
}
}
}
}
}

View file

@ -1,228 +0,0 @@
@import "../variables";
@import "mixins";
.table-wrapper {
background: @program-table-bg-color;
border: 1px solid @program-table-border-color;
border-radius: 3rem;
-webkit-transform: translateZ(0);
transform: translateZ(0);
table {
border-radius: 3rem;
width: 100%;
thead {
tr {
background-color: @program-table-header-bg-color;
border: none;
border-top-left-radius: 2.75rem;
border-top-right-radius: 2.75rem;
color: @program-exuding-color;
font-size: 3.5rem;
height: 18rem;
th {
font-weight: 400;
padding: 0 1rem;
text-transform: uppercase;
white-space: nowrap;
.ordered-cell {
.flex-container-direction(row);
.flex-container-alignment(center, flex-start);
.order-icon {
.icon-sizing(2rem, 2rem, -5rem, -6rem);
color: @program-light-color;
cursor: pointer;
margin-left: 2rem;
&.rotate-icon {
transform: rotate(180deg);
}
&.active {
color: @program-exuding-color;
}
}
}
&:first-child {
border-top-left-radius: 2.75rem;
padding-left: 4rem;
}
&:last-child {
border-top-right-radius: 2.75rem;
}
}
}
}
tbody {
tr {
border: none;
color: @program-main-color;
font-size: 3.5rem;
height: 18rem;
overflow: hidden;
td {
padding: 3rem 1rem;
safe-address-copy {
align-self: flex-start;
}
&:first-child {
padding-left: 4rem;
overflow: hidden;
}
}
&:nth-child(even) {
background-color: @program-table-header-bg-color;
}
&:last-child {
border-bottom: none;
border-bottom-left-radius: 2.75rem;
border-bottom-right-radius: 2.75rem;
td:first-child {
border-bottom-left-radius: 2.75rem;
}
td:last-child {
border-bottom-right-radius: 2.75rem;
}
}
}
}
}
}
.table-long-item-wrapper {
display: inline-block;
color: @program-main-color;
max-width: 100%;
position: relative;
.table-long-item {
.flex-container;
.flex-container-alignment(center, center);
cursor: pointer;
.table-long-item-text {
overflow: hidden;
white-space: nowrap;
background: -webkit-linear-gradient(left, @program-main-color 0, @program-main-color 75%, transparent 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-size: 3.5rem;
height: 4.5rem;
line-height: 4.5rem;
}
.separator {
color: #a1b2a2;
}
.base-icon {
.icon-sizing(4rem, 4rem, -4rem, -5rem);
min-width: 4rem;
min-height: 4rem;
}
&:hover {
color: @program-hover-color;
.table-long-item-text {
background: -webkit-linear-gradient(left, @program-hover-color 0, @program-hover-color 75%, transparent 100%);
-webkit-background-clip: text;
}
.separator {
color: #cdb495;
}
}
}
&.open {
color: @program-hover-color;
.table-long-item-text {
background: -webkit-linear-gradient(left, @program-hover-color 0, @program-hover-color 75%, transparent 100%);
-webkit-background-clip: text;
span {
color: #cdb495;
}
}
}
}
.table-long-item-inner {
position: absolute;
top: 6.5rem;
left: 0;
background-color: white;
border: none;
border-radius: 2rem;
-webkit-box-shadow: @table-item-shadow;
box-shadow: @table-item-shadow;
color: @program-exuding-color;
font-size: 3.25rem;
padding: 0 3rem;
margin-left: -3rem;
margin-top: 0;
max-height: 90vh;
white-space: nowrap;
z-index: 1;
outline: none;
overflow-y: auto;
display: none;
visibility: hidden;
opacity: 0;
transform: translateY(-2em);
transition: all 0.3s ease-in-out 0s, visibility 0s linear 0.3s, z-index 0s linear 0.01s;
&.open {
visibility: visible;
max-height: 90vh;
opacity: 1;
transform: translateY(0%);
transition-delay: 0s, 0s, 0.3s;
}
div {
.flex-container;
.flex-container-alignment(center, space-between);
height: 8rem;
&:not(:last-child) {
border-bottom: 1px solid #f3f5f4;
}
}
.copy-icon {
.icon-sizing(4rem, 4rem, -4rem, -5rem);
color: @program-copy-icon-color;
cursor: pointer;
margin-left: 5rem;
&:hover, &.hovered {
color: @program-exuding-color;
}
&.hovered:before {
content: 'A';
}
}
}

View file

@ -1,85 +0,0 @@
@import "../variables";
@import "mixins";
.general-tabs {
.flex-container;
margin: 7.5rem auto 5rem;
padding: 0;
.general-tab {
.flex-container;
.flex-container-alignment(center, space-between);
flex: 1 0 0;
background-color: @program-tab-bg-color;
border: 1px solid @program-tab-border-color;
font-size: 6rem;
font-weight: 200;
line-height: 10rem;
button {
.flex-container;
.flex-container-alignment(center, center);
background-color: transparent;
border: none;
color: @program-tab-text-color;
height: 17rem;
line-height: 6rem;
margin: 0;
padding: 0 2rem;
width: 100%;
.base-icon {
.icon-sizing(8rem, 8rem, -2rem, -3rem);
margin-right: 2rem;
&.bigger-indent {
margin-right: 3rem;
}
&.wider-icon {
.icon-sizing(8rem, 10rem, -2rem, -2rem);
}
}
.indicator-number {
font-weight: 400;
margin-top: 1rem;
margin-left: 2.5rem;
}
&:hover, &:active {
background-color: @program-tab-hover-bg-color;
color: @program-dark-color;
cursor: pointer;
}
}
&:first-child {
border-radius: 2rem 0 0 2rem;
button {
border-radius: 1.75rem 0 0 1.75rem;
}
}
&:not(:last-child) {
border-right: none;
}
&:last-child {
border-radius: 0 2rem 2rem 0;
button {
border-radius: 0 1.75rem 1.75rem 0;
}
}
&.tab-active {
button {
background-color: @program-tab-hover-bg-color;
color: @program-dark-color;
}
}
}
}

View file

@ -1,466 +0,0 @@
@import "../variables";
@import "mixins";
.widgets {
.flex-container;
flex-wrap: wrap;
margin: 3.5rem -3.5rem 3.5rem;
.widget-wrapper {
//padding: 0 3.5rem 7rem;
//-webkit-transform: translateZ(0);
//transform: translateZ(0);
padding: 3.5rem 3.5rem;
transition: 0.1s;
.widget-block {
background: fade(white, 60%);
border: 1px solid @program-panel-border-color;
border-radius: 3rem;
.widget-header {
.flex-container;
.flex-container-alignment(center, space-between);
height: 13rem;
padding: 0 5rem;
h3 {
color: @program-exuding-color;
font-size: 5.75rem;
font-weight: 300;
margin: 0;
&.widget-select-wrapper {
.flex-container;
line-height: 6rem;
.widget-select {
.flex-container;
margin-left: 5rem;
.dropdown-toggle {
border-bottom: none;
color: @program-hover-color;
font-size: 5rem;
line-height: 6rem;
margin-bottom: -1rem;
padding: 0 3rem 0 0;
.caret {
color: @program-input-placeholder-hover-color;
}
}
.dropdown-menu {
min-width: 44rem;
}
}
}
}
.widget-menu {
.widget-menu-btn {
.flex-container;
background: transparent;
border: none;
margin: 0;
padding: 0;
.base-icon {
.icon-sizing(4rem, 4rem, -4rem, -5rem);
color: @program-main-color;
}
}
.widget-menu-list {
.menu-list(6.5rem, inherit, -2rem, 46rem);
}
}
}
.widget-body-wrapper {
-webkit-transform: translateZ(0);
transform: translateZ(0);
border-bottom-left-radius: 3rem;
border-bottom-right-radius: 3rem;
overflow: hidden;
.widget-body {
border-bottom-left-radius: 3rem;
border-bottom-right-radius: 3rem;
height: 53rem;
overflow-y: auto;
table {
width: 100%;
thead {
tr {
background-color: fade(white, 40%);
color: @program-exuding-color;
font-size: 3.5rem;
height: 9rem;
th {
font-weight: 400;
padding: 0 1rem;
text-transform: uppercase;
white-space: nowrap;
.ordered-cell {
.flex-container;
.flex-container-alignment(center, flex-start);
.order-icon {
.icon-sizing(2rem, 2rem, -5rem, -6rem);
color: @program-light-color;
cursor: pointer;
margin-left: 2rem;
margin-top: 0.25rem;
&.active {
color: @program-exuding-color;
}
&.rotate-icon {
transform: rotate(180deg);
}
}
}
&:first-child {
padding-left: 5rem;
}
}
}
}
tbody {
tr {
color: @program-main-color;
font-size: 3.25rem;
height: 9rem;
td {
padding: 0 1rem;
.empty-table {
color: @program-empty-color;
text-align: center;
}
&:first-child {
padding-left: 5rem;
position: relative;
}
}
&:nth-child(even) {
background-color: fade(white, 40%);
}
}
}
}
.widget-loading {
.flex-container;
.flex-container-alignment(center, center);
color: @program-empty-color;
height: 100%;
}
}
}
}
&.widget-small {
width: 50%;
}
&.widget-big {
width: 100%;
}
&.drag-not-possible {
.widget-block {
box-shadow: 0 0 10px 3px rgb(255, 95, 95);
background-color: rgba(255, 95, 95, 0.6);
}
}
}
.widget-long-item-wrapper {
max-width: 32rem;
.table-long-item {
.table-long-item-text {
font-size: 3.25rem;
}
}
}
}
.payments-widget {
tr.transaction-blocked {
background-color: @history-transaction-blocked-border-color !important;
color: @history-transaction-blocked-text-color !important;
.transaction-status-indicator {
.status-graph {
&.income {
stroke: @history-transaction-blocked-status-income-color !important;
}
&.outgoing {
stroke: @history-transaction-blocked-status-outgoing-color !important;
}
}
.status-inner {
.base-icon.income {
color: @history-transaction-blocked-status-income-color !important;
}
.base-icon.outgoing {
color: @history-transaction-blocked-status-outgoing-color !important;
}
}
}
}
.payments-marker {
&::after {
content: "";
position: absolute;
top: 0;
bottom: 0;
left: 0;
border-left: 1rem solid @marker-light-green;
}
}
.transaction-status-indicator {
.mined-icon {
font-size: 11rem;
&:before {
top: -2.5rem;
left: -3.5rem;
}
}
}
.payments-comment-wrapper {
.flex-container;
.flex-container-alignment(center, flex-start);
max-width: 9rem;
.base-icon {
.icon-sizing(5rem, 5rem, -3.5rem, -4.5rem);
&:hover {
color: @program-hover-color;
cursor: pointer;
}
}
}
}
.contacts-widget {
tr {
td:last-child {
width: 20rem;
}
&:hover {
.contact-options-btn-wrapper {
visibility: visible;
}
}
}
.contact-name {
.flex-container;
.flex-container-alignment(center, flex-start);
font-size: 3.25rem;
white-space: nowrap;
.base-icon {
.icon-sizing(4rem, 4rem, -4rem, -5rem);
color: @program-table-icon-color;
margin-right: 1rem;
}
&:hover {
color: @program-hover-color;
cursor: pointer;
.base-icon {
color: @program-hover-color;
}
}
}
.contact-connections {
max-width: 36rem;
}
.contact-options-btn-wrapper {
.flex-container;
.flex-container-alignment(center, space-between);
visibility: hidden;
.contact-options-btn {
.flex-container;
background: transparent;
border: none;
margin: 0;
padding: 0;
color: @program-main-color;
.send-money-icon {
.icon-sizing(5rem, 5rem, -3.5rem, -4.5rem);
}
.payments-icon {
.icon-sizing(5rem, 5rem, -3.5rem, -4.5rem);
}
.delete-icon {
.icon-sizing(5rem, 5rem, -3.5rem, -4.5rem);
}
&:disabled {
color: @program-light-color;
}
&:hover {
&:not(:disabled) {
color: @program-hover-color;
}
}
}
}
}
.network-info-widget {
.network-text-wrapper {
display: inline-block;
.base-icon {
.icon-sizing(2rem, 2rem, -5rem, -6rem);
margin-left: 1rem;
}
&:hover {
color: @program-hover-color;
cursor: pointer;
}
}
}
.mining-widget {
border-top: none !important;
height: 58rem !important;
.mining-widget-empty {
.flex-container;
.flex-container-alignment(center, center);
color: @program-empty-color;
font-size: 3.75rem;
height: 100%;
}
.mining-widget-chart {
.chart-range-wrapper {
.flex-container;
.flex-container-alignment(center, space-between);
padding: 2.5rem 7rem;
.chart-range-group {
.flex-container;
.flex-container-alignment(center, center);
color: @program-dark-color;
font-size: 3rem;
.chart-range-selector {
.flex-container;
margin: 0 2.5rem;
padding: 0;
li {
border: 1px solid @mining-range-border-color;
color: @mining-range-text-color;
line-height: 5.5rem;
height: 6rem;
width: 14rem;
text-align: center;
list-style-type: none;
&:first-child {
border-radius: 3rem 0 0 3rem;
width: 14.5rem;
}
&:not(:first-child) {
border-left: none;
}
&:last-child {
border-radius: 0 3rem 3rem 0;
width: 14.5rem;
}
}
.active {
background: white;
color: @program-dark-color;
}
}
}
}
.chart-graph {
height: 47rem;
width: 100%;
}
}
}
//TODO active line when tooltip clicked
/*.active-widget-tr {
background: #dce4d3 !important;
color: #062f1b !important;
.comment {
.icon {
color: #062f1b !important;
}
}
}*/
.red-row{
background-color: #e95145 !important;
color: #FFFFFF;
}

View file

@ -1,173 +0,0 @@
@xs: ~"(max-width: 767px)";
@sm: ~"(min-width: 768px)";
@md: ~"(min-width: 992px)";
@lg: ~"(min-width: 1200px)";
@min-width: 250rem;
@background-image: url('../img/bg_blue.jpg');
@program-online-color: #5d6c78;
@program-offline-color: #cd5044;
@scroll-light-color: fade(white, 70%);
@scroll-dark-color: #7b919e;
@error-color: #e9301d;
@success-color: #1d9f5f;
@box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.25);
@modal-form-shadow: 0 0.5rem 0.75rem 0 rgba(0, 0, 0, 0.15);
@table-item-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.175);
@market-details-shadow: 0 2.5rem 6rem 0 rgba(0, 0, 0, 0.45);
@program-header-text-color: #004d73;
@program-header-text-blocked-color: #aaafb4;
@program-header-border-color: #edf2f4;
@program-header-bg-hover-color: #f4f9fb;
@program-header-bg-active-color: #d5e6f0;
@program-header-indicator-text-color: #b83a2d;
@program-header-indicator-border-color: #d48279;
@program-table-bg-color: fade(white, 60%);
@program-table-header-bg-color: fade(white, 40%);
@program-table-border-color: #e1e8eb;
@program-table-icon-color: #5a7388;
@program-table-button-border-color: #adbbbe;
@program-table-button-border-hover-color: #b3ac90;
@program-table-button-icon-hover-color: #7d5d1f;
@program-tab-bg-color: fade(white, 50%);
@program-tab-hover-bg-color: white;
@program-tab-border-color: #e1e8eb;
@program-tab-text-color: #4d7a92;
@program-filter-button-border-color: #e1e8eb;
@program-options-bg-hover-color: #f1f6f9;
@program-panel-bg-color: fade(white, 60%);
@program-panel-header-bg-color: #d5e6ef;
@program-panel-border-color: #e1e8eb;
@program-panel-divider-color: #e1e8eb;
@program-pagination-text-color: #1f415d;
@program-pagination-text-inactive-color: #83919d;
@program-pagination-border-color: #e3eaec;
@program-pagination-pages-color: #a2bac9;
@marker-red: #f1b2b2;
@marker-yellow: #fce493;
@marker-grey: #aaafb4;
@marker-escrow: #65a9de;
@marker-light-green: #a7c790;
@program-exuding-color: #142839;
@program-main-color: #1f415d;
@program-dark-color: #004d73;
@program-light-color: #929ca4;
@program-empty-color: #7190a1;
@program-hover-color: #74520f;
@program-label-color: #004d73;
@program-label-subtext-color: #417b96;
@program-label-info-color: #548ca8;
@program-modal-header-color: #d5e6ef;
@program-modal-header-close-color: #88a1b5;
@program-modal-divider-color: #dae1e2;
@program-modal-active-line-color: #61de11;
@program-select-hover-color: #eef3f6;
@program-select-selected-color: #e3ecf1;
@program-input-text-color: #142839;
@program-input-border-color: #828d97;
@program-input-placeholder-color: #aaafb4;
@program-input-placeholder-hover-color: #bca577;
@program-input-icon-color: #787f86;
@program-checkbox-border-color: #718ea7;
@program-switch-text-color: #5888a1;
@program-range-border-color: #a2b9c5;
@program-range-selected-color: #4d7a92;
@program-button-bg-color: white;
@program-button-hover-bg-color: #f5f8f9;
@program-button-active-bg-color: #f1f6f9;
@program-button-text-color: #004d73;
@program-button-border-color: #e2eaed;
@program-button-border-hover-color: #e1e2d9;
@program-button-divider-color: #c3ced4;
@program-button-done-icon-color: #60d22d;
@program-button-subtext-color: #709bb1;
@program-clear-button-color: #a64833;
@program-clear-button-hover-color: #a64833;
@program-progress-bar-bg-color: #e1e3e4;
@program-progress-bar-fill-color: #95a2ac;
@program-mined-icon-color: #81be55;
@program-payments-income-color: #67aa3b;
@program-payments-outgoing-color: #e27078;
@program-transaction-status-inner-color: #b4bcc1;
@program-transaction-status-pending-inner-color: #57b85f;
@program-transaction-status-sending-inner-color: #e47661;
@program-copy-icon-color: fade(@program-exuding-color, 50%);
@program-divider-color: #f3f5f4;
@program-selection-bg-color: #e8cca8;
@dashboard-indicator-text-color: #004d73;
@dashboard-indicator-icon-color: #004d73;
@dashboard-slider-border-color: #c6d4dc;
@dashboard-slider-icon-color: #578aa2;
@dashboard-alias-border-color: #c9d4d9;
@safes-indicator-color: #3c7592;
@safes-block-text-color: #8b96a0;
@safes-block-text-open-color: #1f415d;
@safes-block-mined-bg-color: #95b5c7;
@safes-block-mined-icon-color: #ecf1f2;
@safes-alias-border-color: #adbbbe;
@safes-alias-border-hover-color: #d5cab9;
@safes-balance-text-color: #8b96a0;
@safe-pages-switch-bg-color: white;
@safe-pages-switch-bg-hover-color: #f1f6f9;
@safe-pages-switch-border-color: #e9eef2;
@safe-pages-switch-text-color: #9ab1c4;
@safe-pages-switch-text-hover-color: #1f415d;
@safe-balance-indicator-color: #f5b81b;
@safe-mined-indicator-color: #aab5ba;
@safe-mined-completed-indicator-color: #539f42;
@safe-button-border-hover-color: #97835c;
@safe-alias-icon-color: #87929b;
@safe-alias-icon-hover-color: #828d97;
@safe-button-bg-color: fade(white, 80%);
@market-header-icon-color: #6a9cb6;
@market-favorite-color: #cd5044;
@market-detail-divider-color: #ebeeec;
@escrow-transaction-status-color: #338dd4;
@history-transaction-blocked-border-color: #e95145;
@history-transaction-blocked-text-color: #fbe3e2;
@history-transaction-blocked-status-income-color: #a2be7e;
@history-transaction-blocked-status-outgoing-color: #c51616;
@history-transaction-blocked-alias-color: #f2a09b;
@history-transaction-blocked-hover-color: #e7c48e;
@contacts-groups-border-color: #e9eef2;
@contacts-accounts-btn-text-color: #7e858c;
@export-import-contacts-text-color: #004d73;
@export-import-contacts-border-color: #e1e8eb;
@mining-range-text-color: #7190a1;
@mining-range-border-color: #e0e7ed;
@bug-report-button-color: white;
@send-money-contacts-hover-color: #f4f0d7;
@send-money-contacts-icon-hover-color: #97835c;
@send-money-contacts-address-hover-color: #bca577;
@create-safe-progress-bar-step-color: #95b5c7;
@create-safe-progress-bar-bg-color: fade(@create-safe-progress-bar-step-color, 25%);
@create-safe-progress-bar-fill-color: #89b0c6;
@modal-update-text-color: #f4f6e9;
@modal-update-green-color: #61a75b;
@modal-update-yellow-color: #cdb912;
@modal-update-red-color: #e95145;
@datepicker-nav-action-color: #004d73;
@datepicker-nav-title-color: #142839;
@datepicker-day-name-color: #a8b2b9;
@datepicker-day-other-month-color: #5888a1;
@datepicker-cell-border-color: #83a7b9;
@datepicker-cell-selected-color: #d5e6f0;
@highcharts-scrollbar-color: #a5adb5;
@highcharts-axis-line-color: fade(#a5adb5, 75%);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

View file

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1024 1024" style="enable-background:new 0 0 1024 1024;" xml:space="preserve">
<style type="text/css">
.st0{fill:url(#SVGID_1_);}
.st1{fill:url(#SVGID_2_);}
.st2{fill:url(#SVGID_3_);}
</style>
<g>
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="512.55" y1="984.3" x2="512.55" y2="39.3" gradientTransform="matrix(1 0 0 -1 0 1024)">
<stop offset="0" style="stop-color:#1ECED0"/>
<stop offset="0.5" style="stop-color:#8AA9F4"/>
<stop offset="1" style="stop-color:#6A44FB"/>
</linearGradient>
<polygon class="st0" points="679.6,984.7 193.5,305.1 344.4,39.7 831.6,715.3 "/>
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="217.75" y1="700.86" x2="217.75" y2="382.2152" gradientTransform="matrix(1 0 0 -1 0 1024)">
<stop offset="0" style="stop-color:#57B7E3"/>
<stop offset="1" style="stop-color:#7E8AF4;stop-opacity:0"/>
</linearGradient>
<polygon class="st1" points="193.5,305.1 435.5,643.4 0,643.4 "/>
<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="807.25" y1="332.3745" x2="807.25" y2="641.9303" gradientTransform="matrix(1 0 0 -1 0 1024)">
<stop offset="0" style="stop-color:#7C83F4"/>
<stop offset="1" style="stop-color:#68B0E9;stop-opacity:0"/>
</linearGradient>
<polygon class="st2" points="831.6,715.3 590.5,381 1024,381 "/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

Before

Width:  |  Height:  |  Size: 708 B

After

Width:  |  Height:  |  Size: 708 B

View file

Before

Width:  |  Height:  |  Size: 1 KiB

After

Width:  |  Height:  |  Size: 1 KiB

View file

Before

Width:  |  Height:  |  Size: 931 B

After

Width:  |  Height:  |  Size: 931 B

View file

@ -649,7 +649,7 @@ module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
/*! no static exports found */
/***/ (function(module, exports) {
var core = module.exports = { version: '2.5.7' };
var core = module.exports = { version: '2.6.1' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
@ -5497,8 +5497,8 @@ __webpack_require__.r(__webpack_exports__);
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(/*! D:\zano\src\polyfills.ts */"./src/polyfills.ts");
module.exports = __webpack_require__(/*! D:\zano\node_modules\@angular-devkit\build-angular\src\angular-cli-files\models\jit-polyfills.js */"./node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/jit-polyfills.js");
__webpack_require__(/*! D:\Projects\Zano\src\gui\qt-daemon\html_source\src\polyfills.ts */"./src/polyfills.ts");
module.exports = __webpack_require__(/*! D:\Projects\Zano\src\gui\qt-daemon\html_source\node_modules\@angular-devkit\build-angular\src\angular-cli-files\models\jit-polyfills.js */"./node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/jit-polyfills.js");
/***/ })

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -37,4 +37,4 @@ testem.log
# System Files
.DS_Store
Thumbs.db
/package.json
/package-lock.json

View file

@ -24,7 +24,8 @@
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
"src/assets",
"src/files"
],
"styles": [
"src/styles.scss"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,61 @@
{
"name": "zano",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"build --watch": "ng build --output-path \"C:\\Program Files\\Zano\\html/\" --watch",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"copy": "copyfiles -u 1 dist/**/* \"C:\\Program Files\\Zano\\html/\""
},
"private": true,
"dependencies": {
"@angular/animations": "~7.0.0",
"@angular/cdk": "^7.2.0",
"@angular/common": "~7.0.0",
"@angular/compiler": "~7.0.0",
"@angular/core": "~7.0.0",
"@angular/forms": "~7.0.0",
"@angular/http": "~7.0.0",
"@angular/platform-browser": "~7.0.0",
"@angular/platform-browser-dynamic": "~7.0.0",
"@angular/router": "~7.0.0",
"@ngx-translate/core": "^11.0.0",
"@ngx-translate/http-loader": "^4.0.0",
"angular-highcharts": "^7.0.2",
"copyfiles": "^2.1.0",
"core-js": "^2.5.4",
"highcharts": "^6.2.0",
"idlejs": "^2.0.1",
"inputmask": "^4.0.4",
"ngx-contextmenu": "^5.1.1",
"qrcode": "^1.3.0",
"rxjs": "~6.3.3",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.10.0",
"@angular/cli": "~7.0.2",
"@angular/compiler-cli": "~7.0.0",
"@angular/language-service": "~7.0.0",
"@types/highcharts": "^5.0.34",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.1.1"
}
}

View file

@ -1,5 +1,6 @@
import {Directive, ElementRef, Input} from '@angular/core';
import * as Inputmask from 'inputmask';
import {VariablesService} from '../../services/variables.service';
@Directive({
selector: '[appInputValidate]'
@ -16,15 +17,15 @@ export class InputValidateDirective {
// point25: '^\-?[0-9]*(?:\\.25|\\.50|\\.75|)$',
money: {
alias: 'decimal',
digits: 8,
max: 999999999999,
digits: this.variablesService.digits,
max: 99999999.999999999999,
rightAlign: false,
allowMinus: false,
onBeforeMask: (value) => value
}
};
constructor(private el: ElementRef) {
constructor(private el: ElementRef, private variablesService: VariablesService) {
}
@Input('appInputValidate')

View file

@ -1,11 +1,11 @@
<div class="modal">
<div class="content">
<i class="icon"></i>
<div class="message">
<span>Success</span>
<span>Successfully</span>
<i class="icon" [class.error]="type === 'error'" [class.success]="type === 'success'" [class.info]="type === 'info'"></i>
<div class="message-container">
<span class="title">{{title}}</span>
<span class="message">{{message}}</span>
</div>
</div>
<button type="button" class="action-button" (click)="false">OK</button>
<button type="button" class="close-button" (click)="false"><i class="icon close"></i></button>
<button type="button" class="action-button" (click)="onClose()" #btn>OK</button>
<button type="button" class="close-button" (click)="onClose()"><i class="icon close"></i></button>
</div>

View file

@ -13,28 +13,53 @@
position: relative;
display: flex;
flex-direction: column;
background-position: center;
background-size: 200%;
padding: 2rem;
width: 34rem;
background: #1a1a1a;
.content {
display: flex;
margin: 1.2rem 0;
.icon {
flex: 0 0 auto;
width: 4.4rem;
height: 4.4rem;
&.error {
mask: url(~src/assets/icons/modal-alert.svg) no-repeat center;
}
&.success {
mask: url(~src/assets/icons/modal-success.svg) no-repeat center;
}
&.info {
mask: url(~src/assets/icons/modal-info.svg) no-repeat center;
}
}
.message {
.message-container {
display: flex;
flex-direction: column;
margin-left: 2rem;
.title {
font-size: 1.8rem;
font-weight: 600;
line-height: 2.2rem;
}
.message {
font-size: 1.3rem;
line-height: 1.8rem;
margin-top: 0.4rem;
}
}
}
.action-button {
background: #2c95f1;
margin: 1.2rem auto 0.6rem;
width: 10rem;
height: 2.4rem;
@ -42,15 +67,21 @@
.close-button {
position: absolute;
top: 0.5rem;
right: 0.5rem;
top: 0;
right: 0;
display: flex;
align-items: center;
justify-content: center;
background: transparent;
margin: 0;
padding: 0;
width: 1.5rem;
height: 1.5rem;
width: 2.4rem;
height: 2.4rem;
.icon {
mask: url(~src/assets/icons/close.svg) no-repeat center;
width: 2.4rem;
height: 2.4rem;
}
}
}

View file

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import {Component, OnInit, Input, Output, EventEmitter, ViewChild, ElementRef} from '@angular/core';
@Component({
selector: 'app-modal-container',
@ -7,9 +7,25 @@ import { Component, OnInit } from '@angular/core';
})
export class ModalContainerComponent implements OnInit {
constructor() { }
public title: string;
@Input() type: string;
@Input() message: string;
@Output() close = new EventEmitter<boolean>();
@ViewChild('btn') button: ElementRef;
constructor() {}
ngOnInit() {
this.button.nativeElement.focus();
switch (this.type) {
case 'error': this.title = 'Wrong'; break;
case 'success': this.title = 'Success'; break;
case 'info': this.title = 'Information'; break;
default: this.title = 'Unexpected'; break;
}
}
onClose() {
this.close.emit();
}
}

View file

@ -13,11 +13,9 @@ export class StakingSwitchComponent implements OnInit {
@Input() staking: boolean;
@Output() stakingChange = new EventEmitter<boolean>();
constructor(private backend: BackendService, private variablesService: VariablesService) {
}
constructor(private backend: BackendService, private variablesService: VariablesService) {}
ngOnInit() {
}
ngOnInit() {}
toggleStaking() {
const wallet = this.variablesService.getWallet(this.wallet_id);

View file

@ -1,28 +1,36 @@
import {Directive, Input, ElementRef, HostListener, Renderer2} from '@angular/core';
import {Directive, Input, ElementRef, HostListener, Renderer2, HostBinding} from '@angular/core';
@Directive({
selector: '[tooltip]',
host: {
'[style.cursor]': '"pointer"'
}
selector: '[tooltip]'
})
export class TooltipDirective {
@HostBinding('style.cursor') cursor = 'pointer';
@Input('tooltip') tooltipTitle: string;
@Input() placement: string;
@Input() tooltipClass: string;
@Input() delay: number;
tooltip: HTMLElement;
offset = 10;
constructor(private el: ElementRef, private renderer: Renderer2) {}
removeTooltipTimeout;
constructor(private el: ElementRef, private renderer: Renderer2) {
}
@HostListener('mouseenter') onMouseEnter() {
if (!this.tooltip) { this.show(); }
if (!this.tooltip) {
this.show();
} else {
this.cancelHide();
}
}
@HostListener('mouseleave') onMouseLeave() {
if (this.tooltip) { this.hide(); }
if (this.tooltip) {
this.hide();
}
}
show() {
@ -32,12 +40,17 @@ export class TooltipDirective {
hide() {
this.renderer.setStyle(this.tooltip, 'opacity', '0');
window.setTimeout(() => {
this.removeTooltipTimeout = setTimeout(() => {
this.renderer.removeChild(document.body, this.tooltip);
this.tooltip = null;
}, this.delay);
}
cancelHide() {
clearTimeout(this.removeTooltipTimeout);
this.renderer.setStyle(this.tooltip, 'opacity', '1');
}
create() {
this.tooltip = this.renderer.createElement('span');
this.renderer.appendChild(this.tooltip, this.renderer.createText(this.tooltipTitle));
@ -76,8 +89,15 @@ export class TooltipDirective {
}
if (this.placement === 'bottom') {
this.renderer.setStyle(this.tooltip, 'top', hostPos.bottom + 'px');
this.renderer.setStyle(this.tooltip, 'left', hostPos.left + 'px');
if (window.innerHeight < hostPos.bottom + this.tooltip.offsetHeight + parseInt(getComputedStyle(this.tooltip).marginTop, 10)) {
this.renderer.removeClass(this.tooltip, 'ng-tooltip-bottom');
this.renderer.addClass(this.tooltip, 'ng-tooltip-top');
this.renderer.setStyle(this.tooltip, 'top', hostPos.top - tooltipPos.height + 'px');
this.renderer.setStyle(this.tooltip, 'left', hostPos.left + 'px');
} else {
this.renderer.setStyle(this.tooltip, 'top', hostPos.bottom + 'px');
this.renderer.setStyle(this.tooltip, 'left', hostPos.left + 'px');
}
}
if (this.placement === 'left') {

View file

@ -1,16 +1,19 @@
import {Pipe, PipeTransform} from '@angular/core';
import {VariablesService} from '../services/variables.service';
@Pipe({
name: 'intToMoney'
})
export class IntToMoneyPipe implements PipeTransform {
constructor(private variablesService: VariablesService) {}
transform(value: any, args?: any): any {
if (value === 0 || value === undefined) {
return '0';
}
const power = Math.pow(10, 8);
let str = (value / power).toFixed(8);
const power = Math.pow(10, this.variablesService.digits);
let str = (value / power).toFixed(this.variablesService.digits);
for (let i = str.length - 1; i >= 0; i--) {
if (str[i] !== '0') {
str = str.substr(0, i + 1);

View file

@ -1,12 +1,15 @@
import {Pipe, PipeTransform} from '@angular/core';
import {VariablesService} from '../services/variables.service';
@Pipe({
name: 'moneyToInt'
})
export class MoneyToIntPipe implements PipeTransform {
constructor(private variablesService: VariablesService) {}
transform(value: any, args?: any): any {
const CURRENCY_DISPLAY_DECIMAL_POINT = 8;
const CURRENCY_DISPLAY_DECIMAL_POINT = this.variablesService.digits;
let result;
if (value) {
let am_str = value.toString().trim();

View file

@ -1,6 +1,8 @@
import {Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import {TranslateService} from '@ngx-translate/core';
import {VariablesService} from './variables.service';
import {ModalService} from './modal.service';
import {MoneyToIntPipe} from '../pipes/money-to-int.pipe';
@Injectable()
@ -9,9 +11,7 @@ export class BackendService {
backendObject: any;
backendLoaded = false;
constructor(private variablesService: VariablesService, private moneyToIntPipe: MoneyToIntPipe) {
}
constructor(private translate: TranslateService, private variablesService: VariablesService, private modalService: ModalService, private moneyToIntPipe: MoneyToIntPipe) {}
private Debug(type, message) {
switch (type) {
@ -35,11 +35,11 @@ export class BackendService {
switch (error) {
case 'NOT_ENOUGH_MONEY':
error_translate = 'ERROR.NOT_ENOUGH_MONEY';
error_translate = 'ERRORS.NOT_ENOUGH_MONEY';
break;
case 'CORE_BUSY':
if (command !== 'get_all_aliases') {
error_translate = 'INFORMER.CORE_BUSY';
error_translate = 'ERRORS.CORE_BUSY';
}
break;
case 'OVERFLOW':
@ -48,62 +48,62 @@ export class BackendService {
}
break;
case 'INTERNAL_ERROR:daemon is busy':
error_translate = 'INFORMER.DAEMON_BUSY';
error_translate = 'ERRORS.DAEMON_BUSY';
break;
case 'INTERNAL_ERROR:not enough money':
case 'INTERNAL_ERROR:NOT_ENOUGH_MONEY':
if (command === 'cancel_offer') {
// error_translate = $filter('translate')('INFORMER.NO_MONEY_REMOVE_OFFER', {
// 'fee': CONFIG.standart_fee,
// 'currency': CONFIG.currency_symbol
// });
error_translate = this.translate.instant('ERRORS.NO_MONEY_REMOVE_OFFER', {
'fee': '0.01',
'currency': 'ZAN'
});
} else {
error_translate = 'INFORMER.NO_MONEY';
}
break;
case 'INTERNAL_ERROR:not enough outputs to mix':
error_translate = 'MESSAGE.NOT_ENOUGH_OUTPUTS_TO_MIX';
error_translate = 'ERRORS.NOT_ENOUGH_OUTPUTS_TO_MIX';
break;
case 'INTERNAL_ERROR:transaction is too big':
error_translate = 'MESSAGE.TRANSACTION_IS_TO_BIG';
error_translate = 'ERRORS.TRANSACTION_IS_TO_BIG';
break;
case 'INTERNAL_ERROR:Transfer attempt while daemon offline':
error_translate = 'MESSAGE.TRANSFER_ATTEMPT';
error_translate = 'ERRORS.TRANSFER_ATTEMPT';
break;
case 'ACCESS_DENIED':
error_translate = 'INFORMER.ACCESS_DENIED';
error_translate = 'ERRORS.ACCESS_DENIED';
break;
case 'INTERNAL_ERROR:transaction was rejected by daemon':
if (command === 'request_alias_registration') {
error_translate = 'INFORMER.ALIAS_IN_REGISTER';
} else {
error_translate = 'INFORMER.TRANSACTION_ERROR';
}
// if (command === 'request_alias_registration') {
// error_translate = 'INFORMER.ALIAS_IN_REGISTER';
// } else {
error_translate = 'ERRORS.TRANSACTION_ERROR';
// }
break;
case 'INTERNAL_ERROR':
error_translate = 'INFORMER.TRANSACTION_ERROR';
error_translate = 'ERRORS.TRANSACTION_ERROR';
break;
case 'BAD_ARG':
error_translate = 'INFORMER.BAD_ARG';
error_translate = 'ERRORS.BAD_ARG';
break;
case 'WALLET_WRONG_ID':
error_translate = 'INFORMER.WALLET_WRONG_ID';
error_translate = 'ERRORS.WALLET_WRONG_ID';
break;
case 'WRONG_PASSWORD':
case 'WRONG_PASSWORD:invalid password':
params = JSON.parse(params);
if (!params.testEmpty) {
error_translate = 'INFORMER.WRONG_PASSWORD';
error_translate = 'ERRORS.WRONG_PASSWORD';
}
break;
case 'FILE_RESTORED':
if (command === 'open_wallet') {
// error_translate = $filter('translate')('INFORMER.FILE_RESTORED');
error_translate = 'ERRORS.FILE_RESTORED';
}
break;
case 'FILE_NOT_FOUND':
if (command !== 'open_wallet' && command !== 'get_alias_info_by_name' && command !== 'get_alias_info_by_address') {
// error_translate = $filter('translate')('INFORMER.FILE_NOT_FOUND');
error_translate = this.translate.instant('ERRORS.FILE_NOT_FOUND');
params = JSON.parse(params);
if (params.path) {
error_translate += ': ' + params.path;
@ -119,16 +119,16 @@ export class BackendService {
}
break;
case 'ALREADY_EXISTS':
error_translate = 'INFORMER.FILE_EXIST';
error_translate = 'ERRORS.FILE_EXIST';
break;
default:
error_translate = error;
}
if (error.indexOf('FAIL:failed to save file') > -1) {
error_translate = 'INFORMER.FILE_NOT_SAVED';
error_translate = 'ERRORS.FILE_NOT_SAVED';
}
if (error_translate !== '') {
alert(error_translate);
this.modalService.prepareModal('error', error_translate);
}
}
@ -272,7 +272,7 @@ export class BackendService {
}
storeSecureAppData(callback) {
if ( this.variablesService.appPass === '' ) {
if (this.variablesService.appPass === '') {
return callback(false);
}
const wallets = [];
@ -461,6 +461,23 @@ export class BackendService {
this.runCommand('stop_pos_mining', {wallet_id: parseInt(wallet_id, 10)}, callback);
}
openUrlInBrowser(url, callback?) {
this.runCommand('open_url_in_browser', url, callback);
}
is_remnotenode_mode_preconfigured(callback) {
this.runCommand('is_remnotenode_mode_preconfigured', {}, callback);
}
start_backend(node, host, port, callback) {
const params = {
configure_for_remote_node: node,
remote_node_host: host,
remote_node_port: parseInt(port, 10)
};
this.runCommand('start_backend', params, callback);
}
}
@ -653,9 +670,7 @@ export class BackendService {
return this.runCommand('print_log', {msg: msg, log_level: log_level});
},
openUrlInBrowser: function (url, callback) {
return this.runCommand('open_url_in_browser', url, callback);
},

View file

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { ModalService } from './modal.service';
describe('ModalService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: ModalService = TestBed.get(ModalService);
expect(service).toBeTruthy();
});
});

View file

@ -0,0 +1,52 @@
import {Injectable, Injector, ComponentFactoryResolver, EmbeddedViewRef, ApplicationRef, NgZone} from '@angular/core';
import {TranslateService} from '@ngx-translate/core';
import {ModalContainerComponent} from '../directives/modal-container/modal-container.component';
@Injectable()
export class ModalService {
private components: any[] = [];
constructor(
private componentFactoryResolver: ComponentFactoryResolver,
private appRef: ApplicationRef,
private injector: Injector,
private ngZone: NgZone,
private translate: TranslateService
) {}
prepareModal(type, message) {
const length = this.components.push(
this.componentFactoryResolver.resolveComponentFactory(ModalContainerComponent).create(this.injector)
);
this.components[length - 1].instance['type'] = type;
this.components[length - 1].instance['message'] = this.translate.instant(message);
this.components[length - 1].instance['close'].subscribe(() => {
this.removeModal(length - 1);
});
this.ngZone.run(() => {
this.appendModal(length - 1);
});
}
appendModal(index) {
this.appRef.attachView(this.components[index].hostView);
const domElem = (this.components[index].hostView as EmbeddedViewRef<any>).rootNodes[0] as HTMLElement;
document.body.appendChild(domElem);
}
removeModal(index) {
if (this.components[index]) {
this.appRef.detachView(this.components[index].hostView);
this.components[index].destroy();
this.components.splice(index, 1);
} else {
const last = this.components.length - 1;
this.appRef.detachView(this.components[last].hostView);
this.components[last].destroy();
this.components.splice(last, 1);
}
}
}

View file

@ -10,6 +10,7 @@ import {ContextMenuComponent, ContextMenuService} from 'ngx-contextmenu';
})
export class VariablesService {
public digits = 12;
public appPass = '';
public moneyEquivalent = 0;
public defaultTheme = 'dark';
@ -82,7 +83,7 @@ export class VariablesService {
}
startCountdown() {
this.idle.restart();
this.idle.start();
}
stopCountdown() {

View file

@ -75,7 +75,7 @@ const routes: Routes = [
},
{
path: '',
redirectTo: 'send',
redirectTo: 'history',
pathMatch: 'full'
}
]

View file

@ -36,6 +36,16 @@ export class AppComponent implements OnInit, OnDestroy {
this.backend.webkitLaunchedScript();
this.backend.is_remnotenode_mode_preconfigured((status, data) => {
// if (data === 'FALSE') {
// } else {
// }
this.backend.start_backend(false, '127.0.0.1', 11512, (st2, dd2) => {
console.log(st2, dd2);
});
});
this.backend.eventSubscribe('quit_requested', () => {
if (!this.onQuitRequest) {
this.backend.storeSecureAppData(() => {
@ -385,14 +395,16 @@ export class AppComponent implements OnInit, OnDestroy {
}
getMoneyEquivalent() {
// todo now start only once, need check daemon state and re-init
this.http.get('https://api.coinmarketcap.com/v2/ticker/2').subscribe(
this.http.get('https://api.coinmarketcap.com/v2/ticker/406').subscribe(
result => {
if (result.hasOwnProperty('data')) {
this.variablesService.moneyEquivalent = result['data']['quotes']['USD']['price'];
}
},
error => {
setTimeout(() => {
this.getMoneyEquivalent();
}, 60000);
console.warn('Error coinmarketcap', error);
}
);

Some files were not shown because too many files have changed in this diff Show more