pretty
This commit is contained in:
@@ -3,7 +3,6 @@ import ContractCache from "../../src/endpoints/CirculatingSupply";
|
||||
let contract: ContractCache;
|
||||
let config: ConfigHandler;
|
||||
|
||||
|
||||
describe("Get circulating supply", (): void => {
|
||||
beforeAll(async (): Promise<void> => {
|
||||
contract = new ContractCache();
|
||||
@@ -13,13 +12,12 @@ describe("Get circulating supply", (): void => {
|
||||
it("Get circulating supply amounts", async (): Promise<void> => {
|
||||
const response = await contract.getCirculatingSupply();
|
||||
|
||||
let initial: number = +(response.initial_supply.amount);
|
||||
let mixmining: number = +(response.mixmining_reserve.amount);
|
||||
let vest: number = +(response.vesting_tokens.amount);
|
||||
let circsupply: number = +(response.circulating_supply.amount);
|
||||
let initial: number = +response.initial_supply.amount;
|
||||
let mixmining: number = +response.mixmining_reserve.amount;
|
||||
let vest: number = +response.vesting_tokens.amount;
|
||||
let circsupply: number = +response.circulating_supply.amount;
|
||||
|
||||
expect(typeof response.vesting_tokens.amount).toBe('string');
|
||||
expect(typeof response.vesting_tokens.amount).toBe("string");
|
||||
expect(initial - mixmining - vest).toStrictEqual(circsupply);
|
||||
|
||||
});
|
||||
});
|
||||
@@ -4,7 +4,6 @@ import ConfigHandler from "../../src/config/configHandler";
|
||||
let contract: ContractCache;
|
||||
let config: ConfigHandler;
|
||||
|
||||
|
||||
describe("Get epoch info", (): void => {
|
||||
beforeAll(async (): Promise<void> => {
|
||||
contract = new ContractCache();
|
||||
@@ -13,28 +12,26 @@ describe("Get epoch info", (): void => {
|
||||
|
||||
it("Get epoch reward params", async (): Promise<void> => {
|
||||
const response = await contract.getEpochRewardParams();
|
||||
expect(typeof response.interval.reward_pool).toBe('string');
|
||||
expect(typeof response.interval.staking_supply_scale_factor).toBe('string');
|
||||
expect(typeof response.interval.staking_supply).toBe('string');
|
||||
expect(typeof response.interval.epoch_reward_budget).toBe('string');
|
||||
expect(typeof response.interval.stake_saturation_point).toBe('string');
|
||||
expect(typeof response.interval.sybil_resistance).toBe('string');
|
||||
expect(typeof response.interval.active_set_work_factor).toBe('string');
|
||||
expect(typeof response.interval.interval_pool_emission).toBe('string');
|
||||
expect(typeof response.active_set_size).toBe('number');
|
||||
expect(typeof response.rewarded_set_size).toBe('number');
|
||||
expect(typeof response.interval.reward_pool).toBe("string");
|
||||
expect(typeof response.interval.staking_supply_scale_factor).toBe("string");
|
||||
expect(typeof response.interval.staking_supply).toBe("string");
|
||||
expect(typeof response.interval.epoch_reward_budget).toBe("string");
|
||||
expect(typeof response.interval.stake_saturation_point).toBe("string");
|
||||
expect(typeof response.interval.sybil_resistance).toBe("string");
|
||||
expect(typeof response.interval.active_set_work_factor).toBe("string");
|
||||
expect(typeof response.interval.interval_pool_emission).toBe("string");
|
||||
expect(typeof response.active_set_size).toBe("number");
|
||||
expect(typeof response.rewarded_set_size).toBe("number");
|
||||
});
|
||||
|
||||
it("Get current epoch", async (): Promise<void> => {
|
||||
const response = await contract.getCurrentEpoch();
|
||||
expect(typeof response.id).toBe('number');
|
||||
expect(typeof response.epochs_in_interval).toBe('number');
|
||||
expect(typeof response.current_epoch_id).toBe('number');
|
||||
expect(typeof response.current_epoch_start).toBe('string');
|
||||
expect(typeof response.epoch_length.secs).toBe('number');
|
||||
expect(typeof response.epoch_length.nanos).toBe('number');
|
||||
expect(typeof response.total_elapsed_epochs).toBe('number');
|
||||
expect(typeof response.id).toBe("number");
|
||||
expect(typeof response.epochs_in_interval).toBe("number");
|
||||
expect(typeof response.current_epoch_id).toBe("number");
|
||||
expect(typeof response.current_epoch_start).toBe("string");
|
||||
expect(typeof response.epoch_length.secs).toBe("number");
|
||||
expect(typeof response.epoch_length.nanos).toBe("number");
|
||||
expect(typeof response.total_elapsed_epochs).toBe("number");
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
+14
-17
@@ -4,7 +4,6 @@ import ConfigHandler from "../../../src/config/configHandler";
|
||||
let contract: ContractCache;
|
||||
let config: ConfigHandler;
|
||||
|
||||
|
||||
describe("Get gateway data", (): void => {
|
||||
beforeAll(async (): Promise<void> => {
|
||||
contract = new ContractCache();
|
||||
@@ -15,36 +14,34 @@ describe("Get gateway data", (): void => {
|
||||
const response = await contract.getGateways();
|
||||
response.forEach((gateway) => {
|
||||
//overview
|
||||
expect(typeof gateway.owner).toBe('string');
|
||||
expect(typeof gateway.block_height).toBe('number');
|
||||
expect(typeof gateway.owner).toBe("string");
|
||||
expect(typeof gateway.block_height).toBe("number");
|
||||
|
||||
if (gateway.proxy === null) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
expect(typeof gateway.proxy).toBe('string');
|
||||
} else {
|
||||
expect(typeof gateway.proxy).toBe("string");
|
||||
}
|
||||
|
||||
//pledge_amount
|
||||
expect(typeof gateway.pledge_amount.denom).toBe('string');
|
||||
expect(typeof gateway.pledge_amount.amount).toBe('string');
|
||||
expect(typeof gateway.pledge_amount.denom).toBe("string");
|
||||
expect(typeof gateway.pledge_amount.amount).toBe("string");
|
||||
|
||||
//gateway
|
||||
expect(typeof gateway.gateway.host).toBe('string');
|
||||
expect(typeof gateway.gateway.mix_port).toBe('number');
|
||||
expect(typeof gateway.gateway.clients_port).toBe('number');
|
||||
expect(typeof gateway.gateway.location).toBe('string');
|
||||
expect(typeof gateway.gateway.sphinx_key).toBe('string');
|
||||
expect(typeof gateway.gateway.identity_key).toBe('string');
|
||||
expect(typeof gateway.gateway.version).toBe('string');
|
||||
expect(typeof gateway.gateway.host).toBe("string");
|
||||
expect(typeof gateway.gateway.mix_port).toBe("number");
|
||||
expect(typeof gateway.gateway.clients_port).toBe("number");
|
||||
expect(typeof gateway.gateway.location).toBe("string");
|
||||
expect(typeof gateway.gateway.sphinx_key).toBe("string");
|
||||
expect(typeof gateway.gateway.identity_key).toBe("string");
|
||||
expect(typeof gateway.gateway.version).toBe("string");
|
||||
});
|
||||
});
|
||||
|
||||
it("Get blacklisted gateways", async (): Promise<void> => {
|
||||
const response = await contract.getBlacklistedGateways();
|
||||
response.forEach(function (value) {
|
||||
expect(typeof value).toBe('string');
|
||||
expect(typeof value).toBe("string");
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
+56
-58
@@ -4,7 +4,6 @@ import ConfigHandler from "../../../src/config/configHandler";
|
||||
let contract: ContractCache;
|
||||
let config: ConfigHandler;
|
||||
|
||||
|
||||
describe("Get mixnode data", (): void => {
|
||||
beforeAll(async (): Promise<void> => {
|
||||
contract = new ContractCache();
|
||||
@@ -16,39 +15,38 @@ describe("Get mixnode data", (): void => {
|
||||
|
||||
response.forEach((mixnode) => {
|
||||
//bond information overview
|
||||
expect(typeof mixnode.bond_information.mix_id).toBe('number');
|
||||
expect(typeof mixnode.bond_information.owner).toBe('string');
|
||||
expect(typeof mixnode.bond_information.original_pledge.amount).toBe('string');
|
||||
expect(typeof mixnode.bond_information.original_pledge.denom).toBe('string');
|
||||
expect(typeof mixnode.bond_information.layer).toBe('number');
|
||||
expect(typeof mixnode.bond_information.bonding_height).toBe('number');
|
||||
expect(typeof mixnode.bond_information.is_unbonding).toBe('boolean');
|
||||
expect(typeof mixnode.bond_information.mix_id).toBe("number");
|
||||
expect(typeof mixnode.bond_information.owner).toBe("string");
|
||||
expect(typeof mixnode.bond_information.original_pledge.amount).toBe("string");
|
||||
expect(typeof mixnode.bond_information.original_pledge.denom).toBe("string");
|
||||
expect(typeof mixnode.bond_information.layer).toBe("number");
|
||||
expect(typeof mixnode.bond_information.bonding_height).toBe("number");
|
||||
expect(typeof mixnode.bond_information.is_unbonding).toBe("boolean");
|
||||
|
||||
if (mixnode.bond_information.proxy === null) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
expect(typeof mixnode.bond_information.proxy).toBe('string');
|
||||
} else {
|
||||
expect(typeof mixnode.bond_information.proxy).toBe("string");
|
||||
}
|
||||
|
||||
//mixnode
|
||||
expect(typeof mixnode.bond_information.mix_node.host).toBe('string')
|
||||
expect(typeof mixnode.bond_information.mix_node.host).toBe("string");
|
||||
expect(mixnode.bond_information.mix_node.http_api_port).toStrictEqual(8000);
|
||||
expect(typeof mixnode.bond_information.mix_node.verloc_port).toBe('number')
|
||||
expect(typeof mixnode.bond_information.mix_node.mix_port).toBe('number')
|
||||
expect(typeof mixnode.bond_information.mix_node.verloc_port).toBe("number");
|
||||
expect(typeof mixnode.bond_information.mix_node.mix_port).toBe("number");
|
||||
expect(mixnode.bond_information.mix_node.mix_port).toStrictEqual(1789);
|
||||
expect(mixnode.bond_information.mix_node.verloc_port).toStrictEqual(1790)
|
||||
expect(mixnode.bond_information.mix_node.verloc_port).toStrictEqual(1790);
|
||||
|
||||
let identitykey = mixnode.bond_information.mix_node.identity_key
|
||||
if (typeof identitykey === 'string') {
|
||||
const identitykey = mixnode.bond_information.mix_node.identity_key;
|
||||
if (typeof identitykey === "string") {
|
||||
if (identitykey.length === 43) {
|
||||
return true
|
||||
}
|
||||
else expect(identitykey).toHaveLength(44);
|
||||
}
|
||||
|
||||
let sphinx = mixnode.bond_information.mix_node.sphinx_key
|
||||
if (typeof sphinx === 'string') {
|
||||
const sphinx = mixnode.bond_information.mix_node.sphinx_key
|
||||
if (typeof sphinx === "string") {
|
||||
if (sphinx.length === 43) {
|
||||
return true
|
||||
}
|
||||
@@ -56,15 +54,15 @@ describe("Get mixnode data", (): void => {
|
||||
}
|
||||
|
||||
//rewarding details
|
||||
expect(typeof mixnode.rewarding_details.cost_params.profit_margin_percent).toBe('string')
|
||||
expect(typeof mixnode.rewarding_details.cost_params.interval_operating_cost.denom).toBe('string')
|
||||
expect(typeof mixnode.rewarding_details.cost_params.interval_operating_cost.amount).toBe('string')
|
||||
expect(typeof mixnode.rewarding_details.operator).toBe('string')
|
||||
expect(typeof mixnode.rewarding_details.delegates).toBe('string')
|
||||
expect(typeof mixnode.rewarding_details.total_unit_reward).toBe('string')
|
||||
expect(typeof mixnode.rewarding_details.unit_delegation).toBe('string')
|
||||
expect(typeof mixnode.rewarding_details.last_rewarded_epoch).toBe('number')
|
||||
expect(typeof mixnode.rewarding_details.unique_delegations).toBe('number')
|
||||
expect(typeof mixnode.rewarding_details.cost_params.profit_margin_percent).toBe("string");
|
||||
expect(typeof mixnode.rewarding_details.cost_params.interval_operating_cost.denom).toBe("string");
|
||||
expect(typeof mixnode.rewarding_details.cost_params.interval_operating_cost.amount).toBe("string");
|
||||
expect(typeof mixnode.rewarding_details.operator).toBe("string");
|
||||
expect(typeof mixnode.rewarding_details.delegates).toBe("string");
|
||||
expect(typeof mixnode.rewarding_details.total_unit_reward).toBe("string");
|
||||
expect(typeof mixnode.rewarding_details.unit_delegation).toBe("string");
|
||||
expect(typeof mixnode.rewarding_details.last_rewarded_epoch).toBe("number");
|
||||
expect(typeof mixnode.rewarding_details.unique_delegations).toBe("number");
|
||||
|
||||
});
|
||||
});
|
||||
@@ -73,39 +71,39 @@ describe("Get mixnode data", (): void => {
|
||||
const response = await contract.getMixnodesDetailed();
|
||||
response.forEach((mixnode) => {
|
||||
// overview details
|
||||
expect(typeof mixnode.estimated_delegators_apy).toBe('string');
|
||||
expect(typeof mixnode.estimated_operator_apy).toBe('string');
|
||||
expect(typeof mixnode.performance).toBe('string');
|
||||
expect(typeof mixnode.uncapped_stake_saturation).toBe('string');
|
||||
expect(typeof mixnode.stake_saturation).toBe('string');
|
||||
expect(typeof mixnode.family).toBe('string');
|
||||
expect(typeof mixnode.estimated_delegators_apy).toBe("string");
|
||||
expect(typeof mixnode.estimated_operator_apy).toBe("string");
|
||||
expect(typeof mixnode.performance).toBe("string");
|
||||
expect(typeof mixnode.uncapped_stake_saturation).toBe("string");
|
||||
expect(typeof mixnode.stake_saturation).toBe("string");
|
||||
expect(typeof mixnode.family).toBe("string");
|
||||
|
||||
//mixnode details bond info
|
||||
expect(typeof mixnode.mixnode_details.bond_information.mix_id).toBe('number')
|
||||
expect(typeof mixnode.mixnode_details.bond_information.owner).toBe('string');
|
||||
expect(typeof mixnode.mixnode_details.bond_information.original_pledge.amount).toBe('string');
|
||||
expect(typeof mixnode.mixnode_details.bond_information.original_pledge.denom).toBe('string');
|
||||
expect(typeof mixnode.mixnode_details.bond_information.layer).toBe('number');
|
||||
expect(typeof mixnode.mixnode_details.bond_information.bonding_height).toBe('number');
|
||||
expect(typeof mixnode.mixnode_details.bond_information.is_unbonding).toBe('boolean');
|
||||
expect(typeof mixnode.mixnode_details.bond_information.mix_id).toBe("number")
|
||||
expect(typeof mixnode.mixnode_details.bond_information.owner).toBe("string");
|
||||
expect(typeof mixnode.mixnode_details.bond_information.original_pledge.amount).toBe("string");
|
||||
expect(typeof mixnode.mixnode_details.bond_information.original_pledge.denom).toBe("string");
|
||||
expect(typeof mixnode.mixnode_details.bond_information.layer).toBe("number");
|
||||
expect(typeof mixnode.mixnode_details.bond_information.bonding_height).toBe("number");
|
||||
expect(typeof mixnode.mixnode_details.bond_information.is_unbonding).toBe("boolean");
|
||||
|
||||
if (mixnode.mixnode_details.bond_information.proxy === null) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
expect(typeof mixnode.mixnode_details.bond_information.proxy).toBe('string');
|
||||
expect(typeof mixnode.mixnode_details.bond_information.proxy).toBe("string");
|
||||
}
|
||||
|
||||
//mixnode
|
||||
expect(typeof mixnode.mixnode_details.bond_information.mix_node.host).toBe('string')
|
||||
expect(typeof mixnode.mixnode_details.bond_information.mix_node.host).toBe("string")
|
||||
expect(mixnode.mixnode_details.bond_information.mix_node.http_api_port).toStrictEqual(8000);
|
||||
expect(typeof mixnode.mixnode_details.bond_information.mix_node.verloc_port).toBe('number')
|
||||
expect(typeof mixnode.mixnode_details.bond_information.mix_node.mix_port).toBe('number')
|
||||
expect(typeof mixnode.mixnode_details.bond_information.mix_node.verloc_port).toBe("number")
|
||||
expect(typeof mixnode.mixnode_details.bond_information.mix_node.mix_port).toBe("number")
|
||||
expect(mixnode.mixnode_details.bond_information.mix_node.mix_port).toStrictEqual(1789);
|
||||
expect(mixnode.mixnode_details.bond_information.mix_node.verloc_port).toStrictEqual(1790)
|
||||
|
||||
let identitykey2 = mixnode.mixnode_details.bond_information.mix_node.identity_key
|
||||
if (typeof identitykey2 === 'string') {
|
||||
if (typeof identitykey2 === "string") {
|
||||
if (identitykey2.length === 43) {
|
||||
return true
|
||||
}
|
||||
@@ -113,7 +111,7 @@ describe("Get mixnode data", (): void => {
|
||||
}
|
||||
|
||||
let sphinx2 = mixnode.mixnode_details.bond_information.mix_node.sphinx_key
|
||||
if (typeof sphinx2 === 'string') {
|
||||
if (typeof sphinx2 === "string") {
|
||||
if (sphinx2.length === 43) {
|
||||
return true
|
||||
}
|
||||
@@ -121,15 +119,15 @@ describe("Get mixnode data", (): void => {
|
||||
}
|
||||
|
||||
//mixnode rewarding info
|
||||
expect(typeof mixnode.mixnode_details.rewarding_details.cost_params.profit_margin_percent).toBe('string')
|
||||
expect(typeof mixnode.mixnode_details.rewarding_details.cost_params.interval_operating_cost.denom).toBe('string')
|
||||
expect(typeof mixnode.mixnode_details.rewarding_details.cost_params.interval_operating_cost.amount).toBe('string')
|
||||
expect(typeof mixnode.mixnode_details.rewarding_details.operator).toBe('string')
|
||||
expect(typeof mixnode.mixnode_details.rewarding_details.delegates).toBe('string')
|
||||
expect(typeof mixnode.mixnode_details.rewarding_details.total_unit_reward).toBe('string')
|
||||
expect(typeof mixnode.mixnode_details.rewarding_details.unit_delegation).toBe('string')
|
||||
expect(typeof mixnode.mixnode_details.rewarding_details.last_rewarded_epoch).toBe('number')
|
||||
expect(typeof mixnode.mixnode_details.rewarding_details.unique_delegations).toBe('number')
|
||||
expect(typeof mixnode.mixnode_details.rewarding_details.cost_params.profit_margin_percent).toBe("string")
|
||||
expect(typeof mixnode.mixnode_details.rewarding_details.cost_params.interval_operating_cost.denom).toBe("string")
|
||||
expect(typeof mixnode.mixnode_details.rewarding_details.cost_params.interval_operating_cost.amount).toBe("string")
|
||||
expect(typeof mixnode.mixnode_details.rewarding_details.operator).toBe("string")
|
||||
expect(typeof mixnode.mixnode_details.rewarding_details.delegates).toBe("string")
|
||||
expect(typeof mixnode.mixnode_details.rewarding_details.total_unit_reward).toBe("string")
|
||||
expect(typeof mixnode.mixnode_details.rewarding_details.unit_delegation).toBe("string")
|
||||
expect(typeof mixnode.mixnode_details.rewarding_details.last_rewarded_epoch).toBe("number")
|
||||
expect(typeof mixnode.mixnode_details.rewarding_details.unique_delegations).toBe("number")
|
||||
|
||||
});
|
||||
});
|
||||
@@ -138,7 +136,7 @@ describe("Get mixnode data", (): void => {
|
||||
const response = await contract.getActiveMixnodes();
|
||||
response.forEach(function (mixnode) {
|
||||
expect(mixnode.rewarding_details.cost_params.profit_margin_percent).toBeTruthy()
|
||||
expect(typeof mixnode.bond_information.layer).toBe('number')
|
||||
expect(typeof mixnode.bond_information.layer).toBe("number")
|
||||
});
|
||||
});
|
||||
|
||||
@@ -166,7 +164,7 @@ describe("Get mixnode data", (): void => {
|
||||
it("Get blacklisted mixnodes", async (): Promise<void> => {
|
||||
const response = await contract.getBlacklistedMixnodes();
|
||||
response.forEach(function (value) {
|
||||
expect(typeof value).toBe('number');
|
||||
expect(typeof value).toBe("number");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"test:prod": "TEST_ENV=prod jest --forceExit --detectOpenHandles --passWithNoTests",
|
||||
"build": "tsc",
|
||||
"lint": "eslint --ext .js,.ts,.tsx .",
|
||||
"lint:fix": "eslint --fix",
|
||||
"lint:fix": "eslint src --fix",
|
||||
"cleanup": "rm -rf node_modules; rm -rf dist; yarn install"
|
||||
},
|
||||
"author": "Nymtech",
|
||||
|
||||
@@ -23,7 +23,7 @@ class ConfigHandler {
|
||||
|
||||
private constructor() {
|
||||
this.setCommonConfig();
|
||||
this.setEnvironmentConfig(process.env.TEST_ENV || "qa" || "prod" );
|
||||
this.setEnvironmentConfig(process.env.TEST_ENV || "qa" || "prod");
|
||||
}
|
||||
|
||||
public static getInstance(): ConfigHandler {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import {
|
||||
Detailed
|
||||
} from "../types/CirculatingSupplyTypes";
|
||||
import { Detailed } from "../types/CirculatingSupplyTypes";
|
||||
import { APIClient } from "./abstracts/APIClient";
|
||||
|
||||
export default class ContractCache extends APIClient {
|
||||
@@ -13,5 +11,5 @@ export default class ContractCache extends APIClient {
|
||||
route: `circulating-supply`,
|
||||
});
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
BlacklistedGateways,
|
||||
BlacklistedMixnodes,
|
||||
CurrentEpoch,
|
||||
Mixnode
|
||||
} from "../types/ContractCacheTypes";
|
||||
import { APIClient } from "./abstracts/APIClient";
|
||||
|
||||
@@ -81,16 +80,15 @@ export default class ContractCache extends APIClient {
|
||||
|
||||
public async getEpochRewardParams(): Promise<EpochRewardParams> {
|
||||
const response = await this.restClient.sendGet({
|
||||
route: `epoch/reward_params`
|
||||
route: `epoch/reward_params`,
|
||||
});
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public async getCurrentEpoch(): Promise<CurrentEpoch> {
|
||||
const response = await this.restClient.sendGet({
|
||||
route: `epoch/current`
|
||||
route: `epoch/current`,
|
||||
});
|
||||
return response.data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { AxiosResponse } from "axios";
|
||||
import {
|
||||
ActiveStatus,
|
||||
AvgUptime,
|
||||
ComputeRewardEstimation,
|
||||
CoreCount,
|
||||
DetailedGateway,
|
||||
DetailedMixnodes,
|
||||
@@ -54,7 +52,6 @@ export default class Status extends APIClient {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
|
||||
// MIXNODES
|
||||
|
||||
public async getMixnodeStatusReport(mix_id: number): Promise<Report> {
|
||||
@@ -98,7 +95,7 @@ export default class Status extends APIClient {
|
||||
): Promise<RewardEstimation> {
|
||||
const response = await this.restClient.sendPost({
|
||||
route: `/mixnode/${mix_id}/compute-reward-estimation`,
|
||||
data: {
|
||||
data: {
|
||||
// performance: "10",
|
||||
active_in_rewarded_set: true,
|
||||
// pledge_amount: 10,
|
||||
@@ -108,7 +105,7 @@ export default class Status extends APIClient {
|
||||
// amount: "250000000"
|
||||
// },
|
||||
// profit_margin_percent: 10
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
return response.data;
|
||||
@@ -122,9 +119,7 @@ export default class Status extends APIClient {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public async getMixnodeAverageUptime(
|
||||
mix_id: number
|
||||
): Promise<AvgUptime> {
|
||||
public async getMixnodeAverageUptime(mix_id: number): Promise<AvgUptime> {
|
||||
const response = await this.restClient.sendGet({
|
||||
route: `/mixnode/${mix_id}/avg_uptime`,
|
||||
});
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
export type Detailed = {
|
||||
initial_supply: InitialSupply;
|
||||
mixmining_reserve: MixminingReserve;
|
||||
vesting_tokens: VestingTokens;
|
||||
circulating_supply: CirculatingSupply;
|
||||
};
|
||||
|
||||
export type InitialSupply = {
|
||||
demon: "unym";
|
||||
amount: string;
|
||||
};
|
||||
initial_supply: InitialSupply;
|
||||
mixmining_reserve: MixminingReserve;
|
||||
vesting_tokens: VestingTokens;
|
||||
circulating_supply: CirculatingSupply;
|
||||
};
|
||||
|
||||
export type MixminingReserve = {
|
||||
demon: "unym";
|
||||
amount: string;
|
||||
};
|
||||
export type InitialSupply = {
|
||||
demon: "unym";
|
||||
amount: string;
|
||||
};
|
||||
|
||||
export type VestingTokens = {
|
||||
demon: "unym";
|
||||
amount: string;
|
||||
};
|
||||
export type MixminingReserve = {
|
||||
demon: "unym";
|
||||
amount: string;
|
||||
};
|
||||
|
||||
export type CirculatingSupply = {
|
||||
demon: "unym";
|
||||
amount: string;
|
||||
};
|
||||
export type VestingTokens = {
|
||||
demon: "unym";
|
||||
amount: string;
|
||||
};
|
||||
|
||||
export type CirculatingSupply = {
|
||||
demon: "unym";
|
||||
amount: string;
|
||||
};
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
export type AllMixnodes = {
|
||||
export interface AllMixnodes {
|
||||
bond_information: BondInformation;
|
||||
rewarding_details: RewardingDetails;
|
||||
};
|
||||
}
|
||||
|
||||
export type BondInformation = {
|
||||
export interface BondInformation {
|
||||
mix_id: number;
|
||||
owner: string;
|
||||
original_pledge: OriginalPledge;
|
||||
@@ -14,7 +14,7 @@ export type BondInformation = {
|
||||
is_unbonding: boolean;
|
||||
}
|
||||
|
||||
export type RewardingDetails = {
|
||||
export interface RewardingDetails {
|
||||
cost_params: CostParams;
|
||||
operator: string;
|
||||
delegates: string;
|
||||
@@ -24,27 +24,27 @@ export type RewardingDetails = {
|
||||
unique_delegations: number;
|
||||
}
|
||||
|
||||
export type CostParams = {
|
||||
export interface CostParams {
|
||||
profit_margin_percent: string;
|
||||
interval_operating_cost: IntervalOperatingCost;
|
||||
}
|
||||
|
||||
export type IntervalOperatingCost = {
|
||||
export interface IntervalOperatingCost {
|
||||
denom: string;
|
||||
amount: string;
|
||||
}
|
||||
|
||||
export type OriginalPledge = {
|
||||
export interface OriginalPledge {
|
||||
denom: string;
|
||||
amount: string;
|
||||
}
|
||||
|
||||
export type TotalDelegation = {
|
||||
export interface TotalDelegation {
|
||||
denom: string;
|
||||
amount: string;
|
||||
};
|
||||
}
|
||||
|
||||
export type Mixnode = {
|
||||
export interface Mixnode {
|
||||
host: string;
|
||||
mix_port: number;
|
||||
verloc_port: number;
|
||||
@@ -52,9 +52,9 @@ export type Mixnode = {
|
||||
sphinx_key: string;
|
||||
identity_key: string;
|
||||
version: string;
|
||||
};
|
||||
}
|
||||
|
||||
export type MixnodeBond = {
|
||||
export interface MixnodeBond {
|
||||
pledge_amount: OriginalPledge;
|
||||
total_delegation: TotalDelegation;
|
||||
owner: string;
|
||||
@@ -65,21 +65,19 @@ export type MixnodeBond = {
|
||||
accumulated_rewards: string;
|
||||
}
|
||||
|
||||
export type MixnodesDetailed = {
|
||||
export interface MixnodesDetailed {
|
||||
mixnode_details: AllMixnodes;
|
||||
stake_saturation: string;
|
||||
uncapped_stake_saturation: string;
|
||||
performance: string;
|
||||
estimated_operator_apy: string
|
||||
estimated_operator_apy: string;
|
||||
estimated_delegators_apy: string;
|
||||
family: string
|
||||
};
|
||||
family: string;
|
||||
}
|
||||
|
||||
export type BlacklistedMixnodes = {
|
||||
};
|
||||
export interface BlacklistedMixnodes {}
|
||||
|
||||
export type BlacklistedGateways = {
|
||||
};
|
||||
export interface BlacklistedGateways {}
|
||||
|
||||
export interface Gateway {
|
||||
host: string;
|
||||
@@ -99,13 +97,13 @@ export interface AllGateways {
|
||||
proxy: string;
|
||||
}
|
||||
|
||||
export type EpochRewardParams = {
|
||||
export interface EpochRewardParams {
|
||||
interval: Interval;
|
||||
rewarded_set_size: number;
|
||||
active_set_size: number;
|
||||
};
|
||||
}
|
||||
|
||||
export type Interval = {
|
||||
export interface Interval {
|
||||
reward_pool: string;
|
||||
staking_supply: string;
|
||||
staking_supply_scale_factor: string;
|
||||
@@ -116,17 +114,16 @@ export type Interval = {
|
||||
interval_pool_emission: string;
|
||||
}
|
||||
|
||||
export type CurrentEpoch = {
|
||||
export interface CurrentEpoch {
|
||||
id: number;
|
||||
epochs_in_interval: number;
|
||||
current_epoch_start: string;
|
||||
current_epoch_id: number;
|
||||
epoch_length: EpochLength;
|
||||
total_elapsed_epochs: number;
|
||||
};
|
||||
}
|
||||
|
||||
export type EpochLength = {
|
||||
export interface EpochLength {
|
||||
secs: number;
|
||||
nanos: number;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ export interface CurrentEpoch {
|
||||
active_set_work_factor: number;
|
||||
}
|
||||
|
||||
|
||||
export interface Epoch {
|
||||
id: number;
|
||||
epochs_in_interval: number;
|
||||
@@ -49,17 +48,17 @@ export interface RewardParams {
|
||||
}
|
||||
|
||||
export interface ComputeRewardEstimation {
|
||||
performance: string,
|
||||
active_in_rewarded_set: boolean,
|
||||
pledge_amount: number,
|
||||
total_delegation: number,
|
||||
performance: string;
|
||||
active_in_rewarded_set: boolean;
|
||||
pledge_amount: number;
|
||||
total_delegation: number;
|
||||
interval_operating_cost: IntervalOperatingCost;
|
||||
profit_margin_percent: string
|
||||
profit_margin_percent: string;
|
||||
}
|
||||
|
||||
export interface IntervalOperatingCost {
|
||||
denom: string,
|
||||
amount: string
|
||||
denom: string;
|
||||
amount: string;
|
||||
}
|
||||
|
||||
export interface Interval {
|
||||
@@ -124,14 +123,14 @@ export interface History {
|
||||
}
|
||||
|
||||
export interface NodeHistory {
|
||||
mix_id: number,
|
||||
mix_id: number;
|
||||
identity: string;
|
||||
owner: string;
|
||||
history: History[];
|
||||
}
|
||||
|
||||
export interface CoreCount {
|
||||
mix_id: number,
|
||||
mix_id: number;
|
||||
identity: string;
|
||||
count: number;
|
||||
}
|
||||
@@ -140,7 +139,6 @@ export interface ActiveStatus {
|
||||
status: string;
|
||||
}
|
||||
|
||||
|
||||
export interface PledgeAmount {
|
||||
denom: string;
|
||||
amount: string;
|
||||
@@ -228,4 +226,4 @@ export interface DetailedMixnodes {
|
||||
estimated_operator_apy: string;
|
||||
estimated_delegators_apy: string;
|
||||
family: string;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user