open source

This commit is contained in:
dingyi
2021-03-15 01:14:32 +08:00
commit f4f0d29a40
208 changed files with 24908 additions and 0 deletions
+57
View File
@@ -0,0 +1,57 @@
/*
* @Description:
* @Author: dingyi
* @Date: 2020-07-13 09:41:17
* @lastTime: 2020-12-11 16:07:06
* @LastEditors: dingyi
*/
"use strict"
// 可用于验证地址是否正确
import bech32 from 'bech32'
import hex from './hex'
import hashJs from "hash.js";
import { Base64 } from 'js-base64';
const b32 = {
decode(value) {
const words = bech32.decode(value)
return Buffer.from(bech32.fromWords(words.words)).toString(`hex`)
},
encode(value, prefix = `cosmos1`, type = `hex`) {
const words = bech32.toWords(Buffer.from(value, type))
return bech32.encode(prefix, words)
}
}
export default b32
export function base64ToPubkey(b64) {
const hexUnit = Base64.toUint8Array(b64)
const hex16 = Buffer.from(hexUnit).toString('hex')
return b32.encode(hex16)
}
export function addressToHex(pubkey) {
const bech32Str = bech32.decode(pubkey);
const words = bech32Str.words;
const str = bech32.fromWords(words);
let hexStr = hex.bytesToHex(str);
const resHex = hexStr.replace("1624DE6420", "");
const pubkeyStr = hex.hexToBytes(resHex);
const bytes = Buffer.from(pubkeyStr, "base64");
const hashStr = hashJs
.sha256()
.update(bytes)
.digest("hex");
const res = hashStr
.slice(0, 40)
.toString("hex")
.toUpperCase();
return res;
}
export function validatorAddressToAccount(validatorAddress) {
const chainName = window.chain.prefix; // TODO: 地址前缀问题
const bech32Address = bech32.decode(validatorAddress);
return bech32.encode(chainName, bech32Address.words);
}
+56
View File
@@ -0,0 +1,56 @@
"use strict"
const BN = require(`bignumber.js`).BigNumber
export const coinsToObject = function(coinArray) {
return (
coinArray &&
coinArray.reduce(
(dictionary, { denom, amount }) => ({
...dictionary,
[denom]: Number(amount) || 0
}),
{}
)
)
}
// could be used in optimistic update PR, pls uncomment or delete when addressed
export const calculateShares = function(validator, tokens) {
const myTokens = new BN(tokens || 0)
const totalShares = new BN(validator.delegator_shares)
const totalTokens = new BN(validator.tokens)
if (totalTokens.eq(0)) return new BN(0)
return myTokens.times(totalShares).div(totalTokens)
}
export const calculateTokens = function(validator, shares) {
// this is the based on the idea that tokens should equal
// (myShares / totalShares) * totalTokens where totalShares
// and totalTokens are both represented as fractions
const myShares = new BN(shares || 0)
const totalShares = new BN(validator.delegator_shares)
const totalTokens = new BN(validator.tokens)
if (totalShares.eq(0)) return new BN(0)
return myShares.times(totalTokens).div(totalShares)
}
export const sleep = function(amount) {
return new Promise(resolve => {
setTimeout(resolve, amount)
})
}
export function toMicroDenom(denom) {
const lookup = {
ATOM: "uatom",
MUON: "umuon",
LUNA: "uluna",
TREE: "seed",
NGM: "ungm"
}
return lookup[denom] ? lookup[denom] : denom.toLowerCase()
}
+161
View File
@@ -0,0 +1,161 @@
/*
* @Author: your name
* @Date: 2020-03-07 01:02:00
* @lastTime: 2020-08-28 10:00:06
* @LastEditors: 丁一鸣
* @Description: In User Settings Edit
* @FilePath: \look-web\src\utils\format.js
*/
import dayjs from 'dayjs'
import i18n from './lang'
export function formatPoint(num) {
return parseFloat(Number(Number(num).toFixed(2)))
}
export function formatPointPecent(num) {
return parseFloat(Number((Number(num) * 100).toFixed(2))) + '%'
}
export function timeToDay(time, type) {
if (!type) type = 1000 * 1000 * 1000
let num = Number(time) / (60 * 60 * 24 * type) // 天
let str = i18n.t('message.parameter_day') // 天
// 小于一天
if (num < 1) {
// 小时
num = num * 24
str = i18n.t('message.parameter_hour')
if (num < 1) {
// 分钟
num = num * 60
str = i18n.t('message.parameter_min')
// 整数分钟
if (num >= 1 && (num + '').indexOf('.') === -1) {
num = num + str
}
// 秒级
if (num < 1) {
// 秒
num = parseFloat((num * 60).toFixed(2))
str = i18n.t('message.parameter_sen')
num = num + str
}
// 有小数点的分钟
if (num > 1 && (num + '').indexOf('.') > 0) {
const arr = (num + '').split('.')
let integer = arr[0] + str
let sencond = parseFloat(((num - Number(arr[0])) * 60).toFixed(2)) + ' ' + i18n.t('message.parameter_sen') // 秒
num = integer + sencond
}
}
// 整数时
if (num >= 1 && (num + '').indexOf('.') === -1) {
num = num + str
}
// 小数时
if (num > 1 && (num + '').indexOf('.') > 0) {
const arr = (num + '').split('.')
let integer = arr[0] + str
let sencond = parseFloat(((num - Number(arr[0])) * 60).toFixed(2)) + ' ' + i18n.t('message.parameter_min') // 分钟
num = integer + sencond
}
}
return num
}
export function toDenom(denom) {
const lookup = {
uatom: "ATOM"
}
if (lookup[denom]) {
return lookup[denom]
}
if (denom.charAt(0) === `u`) {
return denom.substr(1).toUpperCase()
}
return denom.toUpperCase()
}
export function toMicroDenom(denom) {
const lookup = {
ATOM: "uatom",
MUON: "umuon",
LUNA: "uluna",
TREE: "seed",
NGM: "ungm"
}
return lookup[denom] ? lookup[denom] : denom.toLowerCase()
}
export function toTimestamp(time) {
return dayjs(time).valueOf()
}
export function formatTime(time) {
return dayjs(time).format('YYYY-MM-DD HH:mm')
}
// 只格式不换算单位
export function formatUatomContent(uatom, noPoint) {
uatom = Number(uatom) + ''
const uatomInt = uatom.split('.')[0]
const uatomPoint = uatom.split('.')[1]
// 千分位
let intStr = ''
const len = uatomInt.length
const still = len % 3
for (let i = 3; i <= len; i = i + 3) {
intStr = uatomInt.substr(-i, 3) + (intStr ? ',' + intStr : intStr)
}
intStr = (still > 0 ? uatomInt.substr(0, still) : '') + (still > 0 && intStr ? ',' : '') + (intStr ? intStr : '')
// 存在小数
if (uatomPoint && !noPoint) {
intStr += ('.' + uatomPoint.substr(0, 2))
}
return intStr
}
// 换算 uatom
export function formatUatom(uatom, noUnit, isInt, denom, leng) {
// 小数
let intStr = ''
uatom = Number(uatom) + ''
let numLen = leng || 6
if (uatom.length > numLen) {
try {
let point = uatom.substr(-numLen)
const pointNum = Number('0.' + point) + ''
point = pointNum.split('.')[1] || ''
const int = uatom.substr(0, uatom.length - numLen)
// 千分位
const len = int.length
const still = len % 3
for (let i = 3; i <= len; i = i + 3) {
intStr = int.substr(-i, 3) + (intStr ? ',' + intStr : intStr)
}
intStr = (still > 0 ? int.substr(0, still) : '') + (still > 0 && intStr ? ',' : '') + (intStr ? intStr : '') + (point ? '.' + point : '')
} catch (err) { }
} else {
intStr = Number(uatom / Math.pow(10, numLen)) + ''
}
// 取整数
if (isInt) {
intStr = intStr.split('.')[0]
}
let unitStr = ' ATOM';
if (window.chainId === 'kava') {
unitStr = ' KAVA'
}
if (window.chainId === 'irishub') {
unitStr = ' IRIS'
}
if (window.chainId === 'cell-test-01') {
unitStr = ' Cell'
}
return intStr + (noUnit ? '' : ' ' + denom || unitStr)
}
+33
View File
@@ -0,0 +1,33 @@
const hex = {
hexToBytes(hex) {
let bytes = [];
for (let c = 0; c < hex.length; c += 2) {
bytes.push(parseInt(hex.substr(c, 2), 16));
}
return bytes;
},
bytesToHex(bytes) {
let hex = [];
for (let i = 0; i < bytes.length; i++) {
hex.push((bytes[i] >>> 4).toString(16));
hex.push((bytes[i] & 0xF).toString(16));
}
return hex.join("").toUpperCase();
},
stringToHex(str){
let bytes = [];
for(var i = 0; i < str.length; i++){
bytes.push(str.charCodeAt(i).toString(16));
}
return bytes.join("");
},
isHex(str){
str = str.replace("0x","");
return /^[0-9a-fA-F]*$/i.test(str);
}
};
export default hex
+56
View File
@@ -0,0 +1,56 @@
/*
* @Author: your name
* @Date: 2020-03-08 21:59:04
* @lastTime: 2020-12-11 11:20:32
* @LastEditors: dingyi
* @Description: In User Settings Edit
* @FilePath: /look-web/src/utils/initChain.js
*/
// 判断地址,设置当前所在域,设置请求的 lcd, rpc 地址
import dayjs from "dayjs";
import chains from '../chains'
let hostChain
const host = window.location.host
const locationChainId = location.hash.split('chain=')[1]
const chainArr = [
...chains.Mainnet,
...chains.Testnet
]
for (const item of chainArr) {
if (item.host === host) {
hostChain = JSON.stringify(item)
} else if (item.chainId === locationChainId) {
hostChain = JSON.stringify(item)
}
}
let chain = window.sessionStorage.getItem('chain') || hostChain
if (chain) {
chain = JSON.parse(chain)
}
if (!chain) {
chain = chains.Mainnet[0]
}
window.chain = chain
console.log(window.chain)
export function switchChain(chain) {
if (location.hostname === 'localhost') {
window.sessionStorage.setItem('chain', JSON.stringify(chain))
window.location.href = '/#/validator?chain=' + chain.chainId
location.reload()
return
}
if (chain.host && (location.hostname !== 'localhost' && location.hostname !== chain.host)) {
window.location.href = '//' + chain.host + '/#/validator'
} else {
window.sessionStorage.setItem('chain', JSON.stringify(chain))
window.location.href = '//look.ping.pub/#/validator?chain=' + chain.chainId
if (location.host === 'look.ping.pub') {
location.reload()
}
}
}
+266
View File
@@ -0,0 +1,266 @@
export default {
message: {
kava_more: '更多',
parameter_cdp: 'CDP参数',
// 新
committee: '投票',
// dashboard
lang: '中文',
validators: '节点',
blocks: '区块链',
uptime: '在线状态',
governance: '治理',
parameters: '参数',
wallet: '钱包',
testnet: '测试链',
mainnet: '正式链',
// chain-add
createNewChain: '添加新节点',
chaindadd_name: '节点名称',
chaindadd_chainId: '节点ID',
chaindadd_logo: '图标地址',
chaindadd_lcd: 'LCD 地址',
chaindadd_rpc: 'RPC 地址',
chaindadd_prefix: '地址前缀',
chaindadd_unit: '节点单位',
chaindadd_version: '内核版本',
chaindadd_api: '接口版本',
chaindadd_apiV1: 'Cosmos SDK',
chaindadd_apiV2: 'IRISHub',
chaindadd_type: '节点分类',
chaindadd_mainnet: '正式链',
chaindadd_testnet: '测试链',
chaindadd_gos: 'GoZ',
chaindadd_desc: '节点介绍',
chaindadd_test: '测试接口',
chaindadd_http: "请给 LCD 和 RPC 地址添加协议(https:// 或 http://), 例如 https://lcd.nylira.net 或 http://lcd.nylira.net.",
chaindadd_save: '立即保存',
chaindadd_tip: '请输入',
chaindadd_success: '添加成功',
// block
block_lastBlockHash: '上一块',
block_hash: '当前块',
block_proposer: '出块节点',
block_time: '时间',
block_detail: '细节',
block_transactions: '交易',
block_txhash: '交易哈希值',
block_sentby: '转账人',
block_memo: '备注',
// block-height
blockheight_more: '更多',
blockheight_header: '基础',
blockheight_Address: '地址',
blockheight_VotingPower: '质押权',
blockheight_ProposerPriority: '优先权',
blockheight_Height: '高度',
blockheight_Proposer: '提议人',
blockheight_BlockHash: '区块Hash',
blockheight_LastBlockHash: '前一区块Hash',
blockheight_BlockTime: '区块时间',
blockheight_NumberofTransactions: '交易数量',
blockheight_TotalofTransactions: '交易总数',
blockheight_ChainId: '链ID',
blockheight_BlockApp: '区块应用',
blockheight_BlockVersion: '区块版本',
blockheight_Evidence: '证明',
blockheight_EvidenceHash: '证明 Hash',
blockheight_AppHash: '应用 Hash',
blockheight_ValidatorsHash: '验证人 Hash',
blockheight_NextValidatorsHash: '后一验证人 Hash',
blockheight_ConsensusHash: '共识 Hash',
blockheight_PartsHash: '部分 Hash',
blockheight_DataHash: '数据 Hash',
blockheight_LastCommitHash: '上一次提交 Hash',
blockheight_LastResultsHash: '上一次结果 Hash',
// governance
governance_Join: '参与',
governance_Yes: '赞同',
governance_Abstain: '否决',
governance_No: '反对',
governance_NoVeto: '放弃',
// governance-id
governanceid_vote: '投票',
governanceid_proposalId: '治理ID',
governanceid_submit_time: '提交时间',
governanceid_voting_start_time: '投票开始时间',
governanceid_proposalType: '提案类型',
governanceid_deposit_end_time: '质押结束时间',
governanceid_voting_end_time: '投票结束时间',
governanceid_total_deposit: '质押',
governanceid_status: '状态',
governanceid_votes: '投票',
governanceid_description: '描述',
governanceid_tallyingProcedure: '投票统计',
governanceid_DEPOSITS: '质押',
governanceid_Yes: '赞成',
governanceid_Abstain: '弃权',
governanceid_No: '反对',
governanceid_NoVeto: '强烈反对',
governanceid_Depositor: '质押人',
governanceid_Amount: '总数',
governanceid_Voter: '投票人',
governanceid_Option: '比例',
// parameter
parameter_VersionParameters: '版本参数',
parameter_NodeParameters: '节点参数',
parameter_GovernanceParameters: '治理参数',
parameter_Deposit: '质押',
parameter_MaxDepositPeriod: '最大质押期',
parameter_Voting: '投票',
parameter_VotingPeriod: '投票期',
parameter_Tallying: '投票统计',
parameter_Quorum: '参与度',
parameter_Threshold: '生效门槛',
parameter_Veto: '否决门槛',
parameter_StakingParameters: '委托参数',
parameter_SlashingParameters: '惩罚参数',
parameter_DistributionParameters: '分配参数',
parameter_MintParameters: '通胀参数',
parameter_UnbondingTime: '解委托期限',
parameter_MaxValidators: '最大验证节点数',
parameter_MaxEntries: '最大入口数',
parameter_BondDenom: '质押单位',
parameter_MaxEvidenceAge: '最大证据年龄',
parameter_SignedBlocksWindow: '区块签名窗口',
parameter_MinSignedPerWindow: '每个窗口最少签名',
parameter_DowntimeJailDuration: '掉线监禁期限',
parameter_DoubleSignSlash: '双签惩罚',
parameter_DowntimeSlash: '掉线惩罚',
parameter_CommunityTax: '社区税',
parameter_BaseProposerReward: '基础出块收益',
parameter_BonusProposerReward: '出块奖励',
parameter_WithdrawAddrEnabled: '启用赎回地址',
parameter_GoalBonded: '质押目标',
parameter_Inflation: '通胀率',
parameter_InflationMax: '最大通胀率',
parameter_InflationMin: '最小通胀率',
parameter_InflationChange: '通胀率变化幅度',
parameter_BlocksPerYear: '年出块总数',
parameter_AnnualProvisions: '年通胀总额',
parameter_MintDenom: '通胀单位',
parameter_min: ' 分 ',
parameter_hour: ' 小时',
parameter_day: ' 天',
parameter_sen: ' 秒',
// tx-hash
txhash_Information: '信息',
txhash_TxHash: '交易哈希值',
txhash_Status: '状态',
txhash_Height: '高度',
txhash_Fee: '费用',
txhash_Gas: '网络费 ( 已使用 / 计划使用 )',
txhash_Time: '时间',
txhash_Msgs: '消息',
txhash_moniker: '名称',
txhash_identity: '身份编号',
txhash_website: '网站',
txhash_CommissionRate: '佣金比例',
txhash_CommissionMaxRate: '佣金最大比例',
txhash_CommissionMaxChangeRate: '佣金最大变化比例',
// validator
validator_network: '网络ID',
validator_version: '网络版本',
validator_go: 'Go 版本',
validator_application_version: '应用版本',
validator_BlockHeight: '区块高度',
validator_Validators: '验证节点',
validator_Bonded: '',
validator_EarningRate: '年化收益率',
validator_Active: '活跃节点',
validator_Inactive: '非活跃节点',
validator_Legend: '图例',
validator_ofbondedtokens: '质押比例',
validator_Validator: '验证人',
validator_CommissionMax: '佣金值/最大值',
validator_Rewards: '年化收益率',
validator_BondedTokens: '质押数',
validator_DailyChanges: '日变化',
validator_UnbondingHeight: '解绑高度',
validator_UnbondingTime: '解绑时间',
// validator-address
validatoraddress_EarningRate: '年化收益率',
validatoraddress_VotingPower: '质押权',
validatoraddress_SelfDelegation: '自委托数量',
validatoraddress_Uptime: '运行情况',
validatoraddress_Commission: '佣金',
validatoraddress_Rate: '利率',
validatoraddress_Max: '最大值',
validatoraddress_Change: '变化值',
validatoraddress_Address: '账户地址',
validatoraddress_ValidatorAddress: '验证人地址',
validatoraddress_Publickey: '公钥',
validatoraddress_HEXAddress: '十六进制地址',
validatoraddress_Info: '信息',
validatoraddress_Delegations: '委托信息',
validatoraddress_Delegator: '委托人',
validatoraddress_Amount: '数量',
validatoraddress_Share: '比例',
// wallet
wallet_Addressisrequired: '必须查看一个地址。',
wallet_Useanexistingaddress: '使用已存在的地址',
wallet_switch: '切换',
wallet_Send: '转账',
wallet_AvailableAmount: '可用数量',
wallet_DelegatedAmount: '委托数量',
wallet_Rewards: '收益',
wallet_Total: '总资产',
wallet_Delegations: '委托信息',
wallet_Validator: '验证人',
wallet_Transcantions: '交易',
wallet_Block: '区块',
wallet_Height: '高度',
wallet_txhash: '交易哈希值',
// wallet-add
walletadd_Chooseaway: '选择一种查看地址的方式',
walletadd_UseLedger: '使用 Ledger',
walletadd_Inputaddress: '输入地址',
walletadd_Pleasefollowthesteps: '请按如下步骤操作',
walletadd_1: '打开你的 Ledger 并输入 PIN 码。',
walletadd_2: '打开 cosmos 应用',
walletadd_3: '选择 Ledger 账号 (默认 0, 0).',
walletadd_Account: '账户序号',
walletadd_Index: '次序号',
walletadd_Continue: '继续',
walletadd_features: '实验性Web平台功能',
walletadd_dueto: '由于最近的 ledger 更新,在Windows上使用 ledger 现在需要启用“实验性Web平台功能”。',
walletadd_pleasecopy: '请将下面的链接复制到新选项卡中,并将“实验性Web平台功能”标志设置为“已启用”',
walletadd_getmyledger: '获取我的 ledger 里的地址',
walletadd_Enteraddresstoview: '查看已存在的地址',
walletadd_pleaseinputaddress: '请输入地址',
walletadd_copy: '复制成功。',
walletadd_GetAddress: '获取地址',
// wallet-send
walletsend_Send: '转账',
walletsend_From: '钱包地址',
walletsend_Max: '最大值',
walletsend_RecipientAddress: '转账地址',
walletsend_address: '地址',
walletsend_Amount: '数量',
walletsend_Memo: '备注 (选项)',
walletsend_LedgerAccountIndex: 'Ledger 的账户序号和次序号 (默认值 0,0)',
walletsend_Account: '账户序号',
walletsend_Index: '次序号',
walletsend_Gas: '费用',
walletsend_Total: '总计',
walletsend_Sendbyledger: '用 ledger 验证转账',
walletsend_exception: '如果有任何异常,请刷新本页后再试。',
walletsend_sign: '你可以查看交易信息并操作签名验证。',
walletsend_openledger: '请打开 ledger 和内部的 cosmos 应用',
walletsend_Canceltransaction: '取消交易',
walletsend_Success: '成功',
walletsend_BlockHeight: '块高度',
walletsend_TxHash: '交易哈希值',
walletsend_SendAgain: '再次转账',
walletsend_checkit: '请稍后再试。',
walletsend_notbeenfoun: '交易信息暂时未查询到',
walletsend_gettransaction: '再次检查交易记录',
walletsend_SubmissionFailed: '提交失败',
walletsend_pleasecheck: '请检查修改后再次提交',
walletsend_Pleaseinputtoaddress: '请输入转账地址',
walletsend_pleaseinputamount: '请输入数量',
walletsend_memodefault: '转账来自 look.ping.pub 2020',
walletsend_Pleaseinputform: '请填写表单。',
walletsend_successfulsignature: '签名成功,交易已提交!',
}
}
+265
View File
@@ -0,0 +1,265 @@
export default {
message: {
kava_more: 'more',
parameter_cdp: 'CDP',
committee: 'Committee',
// dashboard
lang: 'English',
validators: 'Validators',
blocks: 'Blocks',
uptime: 'Uptime',
governance: 'Governance',
parameters: 'Parameters',
wallet: 'Wallet',
testnet: 'Testnet',
mainnet: 'Mainnet',
// chain-add
createNewChain: 'Add New Chain',
chaindadd_name: 'Chain Name',
chaindadd_chainId: 'Chain Id',
chaindadd_logo: 'Logo Url',
chaindadd_lcd: 'LCD Url',
chaindadd_rpc: 'RPC Url',
chaindadd_prefix: 'Address Prefix',
chaindadd_unit: 'Token',
chaindadd_version: 'Core Version',
chaindadd_api: 'Api Version',
chaindadd_apiV1: 'Cosmos SDK',
chaindadd_apiV2: 'IRISHub',
chaindadd_type: 'Chain Type',
chaindadd_mainnet: 'Mainnet',
chaindadd_testnet: 'Testnet',
chaindadd_gos: 'GoZ',
chaindadd_desc: 'Chain Description',
chaindadd_http: "Please add the protocol to the LCD and RPC completely, like https://lcd.nylira.net or http://lcd.nylira.net.",
chaindadd_test: 'Test LCD api',
chaindadd_save: 'Save Now',
chaindadd_tip: 'Please input',
chaindadd_success: 'Add Success',
// block
block_lastBlockHash: 'Last Block Hash',
block_hash: 'Hash',
block_proposer: 'Proposer',
block_time: 'Time',
block_detail: 'Detail',
block_transactions: 'Transactions',
block_txhash: 'Tx Hash',
block_sentby: 'Sent by',
block_memo: 'Memo',
// block-height
blockheight_more: 'More',
blockheight_header: 'Header',
blockheight_Address: 'Address',
blockheight_VotingPower: 'Voting Power',
blockheight_ProposerPriority: 'Proposer Priority',
blockheight_Height: 'Height',
blockheight_Proposer: 'Proposer',
blockheight_BlockHash: 'Block Hash',
blockheight_LastBlockHash: 'Last Block Hash',
blockheight_BlockTime: 'Block Time',
blockheight_NumberofTransactions: 'Number of Transactions',
blockheight_TotalofTransactions: 'Total of Transactions',
blockheight_ChainId: 'Chain Id',
blockheight_BlockApp: 'Block App',
blockheight_BlockVersion: 'Block Version',
blockheight_Evidence: 'Evidence',
blockheight_EvidenceHash: 'Evidence Hash',
blockheight_AppHash: 'App Hash',
blockheight_ValidatorsHash: 'Validators Hash',
blockheight_NextValidatorsHash: 'Next Validators Hash',
blockheight_ConsensusHash: 'Consensus Hash',
blockheight_PartsHash: 'Parts Hash',
blockheight_DataHash: 'Data Hash',
blockheight_LastCommitHash: 'Last Commit Hash',
blockheight_LastResultsHash: 'Last Results Hash',
// governance
governance_Join: 'Turnout',
governance_Yes: 'Yes',
governance_Abstain: 'Abstain',
governance_No: 'No',
governance_NoVeto: 'No Veto',
// governance-id
governanceid_vote: 'Vote',
governanceid_proposalId: 'Proposal ID',
governanceid_submit_time: 'Submit Time',
governanceid_voting_start_time: 'Voting Start Time',
governanceid_proposalType: 'Proposal Type',
governanceid_deposit_end_time: 'Deposit End Time',
governanceid_voting_end_time: 'End Voting Time',
governanceid_total_deposit: 'Deposit',
governanceid_status: 'Status',
governanceid_votes: 'Votes',
governanceid_description: 'Description',
governanceid_tallyingProcedure: 'Tallying Procedure',
governanceid_DEPOSITS: 'DEPOSITS',
governanceid_Yes: 'Yes',
governanceid_Abstain: 'Abstain',
governanceid_No: 'No',
governanceid_NoVeto: 'No Veto',
governanceid_Depositor: 'Depositor',
governanceid_Amount: 'Amount',
governanceid_Voter: 'Voter',
governanceid_Option: 'Option',
// parameter
parameter_VersionParameters: 'Version Parameters',
parameter_NodeParameters: 'Validator Parameters',
parameter_GovernanceParameters: 'Governance Parameters',
parameter_Deposit: 'Deposit',
parameter_MaxDepositPeriod: 'Max Deposit Period',
parameter_Voting: 'Voting',
parameter_VotingPeriod: 'Voting Period',
parameter_Tallying: 'Tallying',
parameter_Quorum: 'Quorum',
parameter_Threshold: 'Threshold',
parameter_Veto: 'Veto',
parameter_StakingParameters: 'Staking Parameters',
parameter_SlashingParameters: 'Slashing Parameters',
parameter_DistributionParameters: 'Distribution Parameters',
parameter_MintParameters: 'Mint Parameters',
parameter_UnbondingTime: 'Unbonding Time',
parameter_MaxValidators: 'Max Validators',
parameter_MaxEntries: 'Max Entries',
parameter_BondDenom: 'Bond Denom',
parameter_MaxEvidenceAge: 'Max Evidence Age',
parameter_SignedBlocksWindow: 'Signed Blocks Window',
parameter_MinSignedPerWindow: 'Min Signed Per Window',
parameter_DowntimeJailDuration: 'Downtime Jail Duration',
parameter_DoubleSignSlash: 'Double Sign Slash',
parameter_DowntimeSlash: 'Downtime Slash',
parameter_CommunityTax: 'Community Tax',
parameter_BaseProposerReward: 'Base Proposer Reward',
parameter_BonusProposerReward: 'Bonus Proposer Reward',
parameter_WithdrawAddrEnabled: 'Withdraw Addr Enabled',
parameter_GoalBonded: 'Goal Bonded',
parameter_Inflation: 'Inflation',
parameter_InflationMax: 'Inflation Max',
parameter_InflationMin: 'Inflation Min',
parameter_InflationChange: 'Inflation Change',
parameter_BlocksPerYear: 'Blocks Per Year',
parameter_AnnualProvisions: 'Annual Provisions',
parameter_MintDenom: 'Mint Denom',
parameter_min: ' min ',
parameter_hour: ' hour',
parameter_day: ' day',
parameter_sen: ' sec',
// tx-hash
txhash_Information: 'Information',
txhash_TxHash: 'TxHash',
txhash_Status: 'Status',
txhash_Height: 'Height',
txhash_Fee: 'Fee',
txhash_Gas: 'Gas ( used / wanted )',
txhash_Time: 'Time',
txhash_Msgs: 'Msgs',
txhash_moniker: 'moniker',
txhash_identity: 'identity',
txhash_website: 'website',
txhash_CommissionRate: 'Commission Rate',
txhash_CommissionMaxRate: 'Commission Max Rate',
txhash_CommissionMaxChangeRate: 'Commission Max Change Rate',
// validator
validator_network: 'Network',
validator_version: 'Network Version',
validator_go: 'Go',
validator_application_version: 'Application Version',
validator_BlockHeight: 'Block Height',
validator_Validators: 'Validators',
validator_Bonded: 'Bonded',
validator_EarningRate: 'Earning Rate',
validator_Active: 'Active',
validator_Inactive: 'Inactive',
validator_Legend: 'Legend',
validator_ofbondedtokens: 'of bonded tokens',
validator_Validator: 'Validator',
validator_CommissionMax: 'Commission/Max',
validator_Rewards: 'Rewards',
validator_BondedTokens: 'Bonded Tokens',
validator_DailyChanges: 'Daily Changes',
validator_UnbondingHeight: 'Unbonding Height',
validator_UnbondingTime: 'Unbonding Time',
// validator-address
validatoraddress_EarningRate: 'Earning Rate',
validatoraddress_VotingPower: 'Voting Power',
validatoraddress_SelfDelegation: 'Self Delegation',
validatoraddress_Uptime: 'Uptime',
validatoraddress_Commission: 'Commission',
validatoraddress_Rate: 'Rate',
validatoraddress_Max: 'Max',
validatoraddress_Change: 'Change',
validatoraddress_Address: 'Account Address',
validatoraddress_ValidatorAddress: 'Validator Address',
validatoraddress_Publickey: 'Public key',
validatoraddress_HEXAddress: 'HEX Address',
validatoraddress_Info: 'Info',
validatoraddress_Delegations: 'Delegations',
validatoraddress_Delegator: 'Delegator',
validatoraddress_Amount: 'Amount',
validatoraddress_Share: 'Share',
// wallet
wallet_Addressisrequired: 'Address is required.',
wallet_Useanexistingaddress: 'Use an existing address',
wallet_switch: 'switch',
wallet_Send: 'Send',
wallet_AvailableAmount: 'Available Amount',
wallet_DelegatedAmount: 'Delegated Amount',
wallet_Rewards: 'Rewards',
wallet_Total: 'Total',
wallet_Delegations: 'Delegations',
wallet_Validator: 'Validator',
wallet_Transcantions: 'Transcantions',
wallet_Block: 'Block',
wallet_Height: 'Height',
wallet_txhash: 'txhash',
// wallet-add
walletadd_Chooseaway: 'Choose a way',
walletadd_UseLedger: 'Use Ledger',
walletadd_Inputaddress: 'Input address',
walletadd_Pleasefollowthesteps: 'Please follow the steps',
walletadd_1: 'Power up your Ledger Nano and enter your pin.',
walletadd_2: 'Open ledger cosmos app.',
walletadd_3: 'Select Ledger Account (Default 0, 0).',
walletadd_Account: 'Account',
walletadd_Index: 'Index',
walletadd_Continue: 'Continue',
walletadd_features: 'Experimental Web Platform features',
walletadd_dueto: 'Due to recent Ledger updates, using a Ledger on Windows now requires "Experimental Web Platform features" to be enabled.',
walletadd_pleasecopy: 'Please copy the link below into a new tab and set the "Experimental Web Platform features" flag to "Enabled"',
walletadd_getmyledger: 'Get My ledger Nano Address',
walletadd_Enteraddresstoview: 'Enter address to view',
walletadd_pleaseinputaddress: 'please input address',
walletadd_copy: 'Copy Successful.',
walletadd_GetAddress: 'Get Address',
// wallet-send
walletsend_Send: 'Send',
walletsend_From: 'From',
walletsend_Max: 'Max',
walletsend_RecipientAddress: 'Recipient Address',
walletsend_address: 'address',
walletsend_Amount: 'Amount',
walletsend_Memo: 'Memo (optional)',
walletsend_LedgerAccountIndex: 'Ledger Account Index (default 0,0)',
walletsend_Account: 'Account',
walletsend_Index: 'Index',
walletsend_Gas: 'Gas',
walletsend_Total: 'Total',
walletsend_Sendbyledger: 'Send by ledger',
walletsend_exception: 'If there are any exceptions, refresh the page and try again.',
walletsend_sign: 'You can view transaction information and sign.',
walletsend_openledger: 'Please open ledger and cosmos app.',
walletsend_Canceltransaction: 'Cancel transaction',
walletsend_Success: 'Success',
walletsend_BlockHeight: 'Block Height',
walletsend_TxHash: 'Tx Hash',
walletsend_SendAgain: 'Send Again',
walletsend_checkit: 'Please check it later.',
walletsend_notbeenfoun: 'Transaction information has not been found.',
walletsend_gettransaction: 'Get Transaction Again',
walletsend_SubmissionFailed: 'Submission Failed.',
walletsend_pleasecheck: 'Please check and modify the following information beforeresubmitting.',
walletsend_Pleaseinputtoaddress: 'Please input toaddress',
walletsend_pleaseinputamount: 'please input amount',
walletsend_memodefault: 'send via look.ping.pub 2020',
walletsend_Pleaseinputform: 'Please input form.',
walletsend_successfulsignature: 'Successful signature and Transaction submitted!',
}
}
+265
View File
@@ -0,0 +1,265 @@
export default {
message: {
kava_more: 'more',
parameter_cdp: 'CDP',
committee: 'Committee',
// dashboard
lang: 'Español',
validators: 'Validadores',
blocks: 'Bloques',
uptime: 'Tiempo de actividad',
governance: 'Gobernanza',
parameters: 'Parámetros',
wallet: 'Wallet',
testnet: 'Testnet',
mainnet: 'Mainnet',
// chain-add
createNewChain: 'Añadir nuevo nodo',
chaindadd_name: 'Nombre del nodo',
chaindadd_chainId: 'Id nodal',
chaindadd_logo: 'Dirección del icono',
chaindadd_lcd: 'Dirección LCD',
chaindadd_rpc: 'Dirección RPC',
chaindadd_prefix: 'Prefijo de dirección',
chaindadd_unit: 'Unidad nodal',
chaindadd_version: 'Versión interna',
chaindadd_api: 'Versión de interfaz',
chaindadd_apiV1: 'Cosmos SDK',
chaindadd_apiV2: 'IRISHub',
chaindadd_type: 'Clasificación de nodos',
chaindadd_mainnet: 'Cadena formal',
chaindadd_testnet: 'Cadena de ensayo',
chaindadd_gos: 'GoZ',
chaindadd_desc: 'Introducción al nodo',
chaindadd_test: 'Interfaz de ensayo',
chaindadd_http: "Añadir protocolos a las direcciones de LCD y RPC (https: / / o http: /), por ejemplo https://lcd.nylira.net 或 http://lcd.nylira.net.",
chaindadd_save: 'Guardar inmediatamente',
chaindadd_tip: 'Por favor.',
chaindadd_success: 'Successfully added',
// block
block_lastBlockHash: 'Hash del último bloque',
block_hash: 'Hash',
block_proposer: 'Autor',
block_time: 'Tiempo',
block_detail: 'Detalles',
block_transactions: 'Transacciones',
block_txhash: 'Tx Hash',
block_sentby: 'Enviado por',
block_memo: 'Memo',
// block-height
blockheight_more: 'Más',
blockheight_header: 'Cabecera',
blockheight_Address: 'Wallet',
blockheight_VotingPower: 'Poder de voto',
blockheight_ProposerPriority: 'Proposer Priority',
blockheight_Height: 'Altura',
blockheight_Proposer: 'Autor',
blockheight_BlockHash: 'Hash del bloque',
blockheight_LastBlockHash: 'Hash del último bloque',
blockheight_BlockTime: 'Tiempo de bloque',
blockheight_NumberofTransactions: 'Número de transacciones',
blockheight_TotalofTransactions: 'Total de transacciones',
blockheight_ChainId: 'ID de la cadena',
blockheight_BlockApp: 'Bloque del APP',
blockheight_BlockVersion: 'Versión del Bloque',
blockheight_Evidence: 'Evidencia',
blockheight_EvidenceHash: 'Hash de evidencia',
blockheight_AppHash: 'Hash del APP',
blockheight_ValidatorsHash: 'Hash de validadores',
blockheight_NextValidatorsHash: 'Hash del siguiente validador',
blockheight_ConsensusHash: 'Hash de consenso',
blockheight_PartsHash: 'Hash de las partes',
blockheight_DataHash: 'Data Hash',
blockheight_LastCommitHash: 'Hash del último commit',
blockheight_LastResultsHash: 'Hash del último resultado',
// governance
governance_Join: 'participate in',
governance_Yes: 'agree with',
governance_Abstain: 'veto',
governance_No: 'opposition',
governance_NoVeto: 'give up',
// governance-id
governanceid_vote: 'Voto',
governanceid_proposalId: 'ID de la propuesta',
governanceid_submit_time: 'Fecha de envío',
governanceid_voting_start_time: 'Tiempo de inicio para el período de votación',
governanceid_proposalType: 'Tipo de Propuesta',
governanceid_deposit_end_time: 'Tiempo final para depósitos',
governanceid_voting_end_time: 'Final de tiempo para el voto',
governanceid_total_deposit: 'Depósito',
governanceid_status: 'Estado',
governanceid_votes: 'Votos',
governanceid_description: 'Descripción',
governanceid_tallyingProcedure: 'Procedimiento de conteo',
governanceid_DEPOSITS: 'DEPÓSITOS',
governanceid_Yes: 'Si',
governanceid_Abstain: 'Abstención',
governanceid_No: 'No',
governanceid_NoVeto: 'No con Veto',
governanceid_Depositor: 'Depositante',
governanceid_Amount: 'Cantidad',
governanceid_Voter: 'Votante',
governanceid_Option: 'Opción',
// parameter
parameter_VersionParameters: 'Version parameters',
parameter_NodeParameters: 'Parámetros del validador',
parameter_GovernanceParameters: 'Parámetros de gobernanza',
parameter_Deposit: 'Depósito',
parameter_MaxDepositPeriod: 'Período máximo de depósito',
parameter_Voting: 'Votación',
parameter_VotingPeriod: 'Período de votación',
parameter_Tallying: 'Recuento',
parameter_Quorum: 'Quorum',
parameter_Threshold: 'Umbral',
parameter_Veto: 'Veto',
parameter_StakingParameters: 'Parámetros de la participación',
parameter_SlashingParameters: 'Parámetros de recorte',
parameter_DistributionParameters: 'Parámetros de la distribución',
parameter_MintParameters: 'Parámetros del minado',
parameter_UnbondingTime: 'Tiempo para la desvinculación',
parameter_MaxValidators: 'Validadores máximos',
parameter_MaxEntries: 'Entradas máximas',
parameter_BondDenom: 'Denominación del vínculo',
parameter_MaxEvidenceAge: 'Tiempo máximo de la evidencia',
parameter_SignedBlocksWindow: 'Ventana para los bloques firmados',
parameter_MinSignedPerWindow: 'Firma mínima por ventana',
parameter_DowntimeJailDuration: 'Tiempo de inactividad encarcelado',
parameter_DoubleSignSlash: 'Penalización de doble firma',
parameter_DowntimeSlash: 'Penalización por tiempo de inactividad',
parameter_CommunityTax: 'Impuesto de la Comunidad',
parameter_BaseProposerReward: 'Recompensa para el solicitante base',
parameter_BonusProposerReward: 'Recompensa para el candidato a la bonificación',
parameter_WithdrawAddrEnabled: 'Dirección de retiro habilitada',
parameter_GoalBonded: 'Objetivo garantizado',
parameter_Inflation: 'Inflación',
parameter_InflationMax: 'Inflación Máxima',
parameter_InflationMin: 'Inflación Mínima',
parameter_InflationChange: 'Cambio en la Inflación',
parameter_BlocksPerYear: 'Bloques por año',
parameter_AnnualProvisions: 'Provisiones anuales',
parameter_MintDenom: 'Denominación creada',
parameter_min: ' minutos ',
parameter_hour: 'horas',
parameter_day: 'días',
parameter_sen: ' sec',
// tx-hash
txhash_Information: 'Información',
txhash_TxHash: 'TxHash',
txhash_Status: 'Estado',
txhash_Height: 'Altura',
txhash_Fee: 'Comisión',
txhash_Gas: 'Gas ( usado / deseado )',
txhash_Time: 'Tiempo',
txhash_Msgs: 'Mensajes',
txhash_moniker: 'moniker',
txhash_identity: 'identidad',
txhash_website: 'sitio web',
txhash_CommissionRate: 'Ratio de comisión',
txhash_CommissionMaxRate: 'Ratio máximo de comisión',
txhash_CommissionMaxChangeRate: 'Ratio máximo de cambio de comisión',
// validator
validator_network: 'Network ID',
validator_version: 'Network version',
validator_go: 'Go version',
validator_application_version: 'Application version',
validator_BlockHeight: 'Altura de bloque',
validator_Validators: 'Validadores',
validator_Bonded: 'Vinculado',
validator_EarningRate: 'Tasa de beneficio',
validator_Active: 'Activo',
validator_Inactive: 'Inactivo',
validator_Legend: 'Leyenda',
validator_ofbondedtokens: 'de tokens vinculados',
validator_Validator: 'Validador',
validator_CommissionMax: 'Comisión/Max',
validator_Rewards: 'Recompensas',
validator_BondedTokens: 'Tokens vinculados',
validator_DailyChanges: 'Cambios diarios',
validator_UnbondingHeight: 'Altura para la desvinculación',
validator_UnbondingTime: 'Tiempo para la desvinculación',
// validator-address
validatoraddress_EarningRate: 'Tasa de beneficios',
validatoraddress_VotingPower: 'Poder de votación',
validatoraddress_SelfDelegation: 'Delegación propia',
validatoraddress_Uptime: 'Tiempo de actividad',
validatoraddress_Commission: 'Comisión',
validatoraddress_Rate: 'Ratio',
validatoraddress_Max: 'Máximo',
validatoraddress_Change: 'Cambio',
validatoraddress_Address: 'Dirección de la cuenta',
validatoraddress_ValidatorAddress: 'Dirección del validador',
validatoraddress_Publickey: 'Clave pública',
validatoraddress_HEXAddress: 'Dirección HEX',
validatoraddress_Info: 'Información',
validatoraddress_Delegations: 'Delegaciones',
validatoraddress_Delegator: 'Delegador',
validatoraddress_Amount: 'Cantidad',
validatoraddress_Share: 'Compartido',
// wallet
wallet_Addressisrequired: 'La dirección es requerida.',
wallet_Useanexistingaddress: 'Usar una dirección existente',
wallet_switch: 'Cambie',
wallet_Send: 'Envío',
wallet_AvailableAmount: 'Cantidad disponible',
wallet_DelegatedAmount: 'Cantidad delegada',
wallet_Rewards: 'Beneficios',
wallet_Total: 'Total',
wallet_Delegations: 'Delegaciones',
wallet_Validator: 'Validador',
wallet_Transcantions: 'Transacciones',
wallet_Block: 'Bloque',
wallet_Height: 'Altura',
wallet_txhash: 'txhash',
// wallet-add
walletadd_Chooseaway: 'Elija una opción',
walletadd_UseLedger: 'Use Ledger',
walletadd_Inputaddress: 'Dirección de entrada',
walletadd_Pleasefollowthesteps: 'Por favor, siga los pasos',
walletadd_1: 'Enciende tu Ledger Nano e introduce tu pin.',
walletadd_2: 'Abrir la aplicación de Cosmos en Ledger.',
walletadd_3: 'Elija la cuenta de la Ledger (Por defecto 0, 0).',
walletadd_Account: 'Cuenta',
walletadd_Index: 'Índice',
walletadd_Continue: 'Continua',
walletadd_features: 'Características de la Plataforma Web Experimental',
walletadd_dueto: 'Debido a las recientes actualizaciones de Ledger, el uso de Ledger en Windows ahora requiere que se habiliten las "características de la Plataforma Web Experimental".',
walletadd_pleasecopy: 'Por favor, copie el enlace de abajo en una nueva pestaña y ponga la marca de "Características de la Plataforma Web Experimental" a "Habilitado"',
walletadd_getmyledger: 'Obtener mi dirección de Ledger Nano',
walletadd_Enteraddresstoview: 'Introduzca la dirección para ser vista',
walletadd_pleaseinputaddress: 'por favor, introduzca la dirección',
walletadd_copy: 'Copia correcta.',
walletadd_GetAddress: 'Obtener la dirección',
// wallet-send
walletsend_Send: 'Enviar',
walletsend_From: 'Desde',
walletsend_Max: 'Máximo',
walletsend_RecipientAddress: 'Dirección de destino',
walletsend_address: 'dirección',
walletsend_Amount: 'Cantidad',
walletsend_Memo: 'Memo (opcional)',
walletsend_LedgerAccountIndex: 'Índice de la cuenta Ledger (por defecto 0,0)',
walletsend_Account: 'Cuenta',
walletsend_Index: 'Índice',
walletsend_Gas: 'Gas',
walletsend_Total: 'Total',
walletsend_Sendbyledger: 'Enviado desde Ledger',
walletsend_exception: 'Si hay alguna excepción, actualice la página y vuelva a intentarlo.',
walletsend_sign: 'Puede ver la información de la transacción y firmar.',
walletsend_openledger: 'Por favor, abra la aplicación de Cosmos en Ledger.',
walletsend_Canceltransaction: 'Cancelar la transacción',
walletsend_Success: 'Realizado',
walletsend_BlockHeight: 'Altura de bloque',
walletsend_TxHash: 'Tx Hash',
walletsend_SendAgain: 'Enviar de nuevo',
walletsend_checkit: 'Por favor, compruébelo más tarde.',
walletsend_notbeenfoun: 'No se ha encontrado información sobre la transacción.',
walletsend_gettransaction: 'Obtener la transacción de nuevo',
walletsend_SubmissionFailed: 'Fallo en el envío.',
walletsend_pleasecheck: 'Por favor, compruebe y modifique la siguiente información antes de enviarla.',
walletsend_Pleaseinputtoaddress: 'Por favor, introduzca la dirección',
walletsend_pleaseinputamount: 'por favor, introduzca la cantidad',
walletsend_memodefault: 'envío mediante look.ping.pub 2020',
walletsend_Pleaseinputform: 'Por favor, introduzca el formulario.',
walletsend_successfulsignature: 'Firma exitosa y transacción enviada!',
}
}
+273
View File
@@ -0,0 +1,273 @@
/*
* @Description:
* @Autor: dingyi
* @Date: 2020-04-01 21:41:06
* @LastEditors: 丁一鸣
* @lastTime: 2020-08-28 09:59:18
* @FilePath: \look-web\src\utils\lang\fr.js
*/
export default {
message: {
kava_more: 'more',
parameter_cdp: 'CDP',
committee: 'Committee',
// dashboard
lang: 'Français',
validators: 'Validateurs',
blocks: 'Blocs',
uptime: 'Uptime',
governance: 'Gouvernance',
parameters: 'Paramètres',
wallet: 'Wallet',
testnet: 'Testnet',
mainnet: 'Mainnet',
// chain-add
createNewChain: 'Add New Chain',
chaindadd_name: 'Chain Name',
chaindadd_chainId: 'Chain Id',
chaindadd_logo: 'Logo Url',
chaindadd_lcd: 'LCD Url',
chaindadd_rpc: 'RPC Url',
chaindadd_prefix: 'Address Prefix',
chaindadd_unit: 'Token',
chaindadd_version: 'Core Version',
chaindadd_api: 'Api Version',
chaindadd_apiV1: 'Cosmos SDK',
chaindadd_apiV2: 'IRISHub',
chaindadd_type: 'Chain Type',
chaindadd_mainnet: 'Mainnet',
chaindadd_testnet: 'Testnet',
chaindadd_gos: 'GoZ',
chaindadd_desc: 'Chain Description',
chaindadd_http: "Please add the protocol to the LCD and RPC completely, like https://lcd.nylira.net or http://lcd.nylira.net.",
chaindadd_test: 'Test LCD api',
chaindadd_save: 'Save Now',
chaindadd_tip: 'Please input',
chaindadd_success: 'Add Success',
// block
block_lastBlockHash: 'Hash Dernier Bloc',
block_hash: 'Hash',
block_proposer: 'Proposant',
block_time: 'Heure',
block_detail: 'Détails',
block_transactions: 'Transactions',
block_txhash: 'Hash Tx',
block_sentby: 'Envoyé par',
block_memo: 'Memo',
// block-height
blockheight_more: 'Savoir Plus',
blockheight_header: 'Header',
blockheight_Address: 'Adresse',
blockheight_VotingPower: 'Pouvoir de Vote',
blockheight_ProposerPriority: 'Priorité du Proposant',
blockheight_Height: 'Hauteur',
blockheight_Proposer: 'Proposant',
blockheight_BlockHash: 'Hash Bloc',
blockheight_LastBlockHash: 'Hash Dernier Bloc',
blockheight_BlockTime: 'Heure Bloc',
blockheight_NumberofTransactions: 'Nombre de Transactions',
blockheight_TotalofTransactions: 'Total des Transactions',
blockheight_ChainId: 'Id Chain',
blockheight_BlockApp: 'Bloc App',
blockheight_BlockVersion: 'Bloc Version',
blockheight_Evidence: 'Evidence',
blockheight_EvidenceHash: 'Hash Evidence',
blockheight_AppHash: 'Hash App',
blockheight_ValidatorsHash: 'Hash Validateurs',
blockheight_NextValidatorsHash: 'Hash Prochain Validateurs',
blockheight_ConsensusHash: 'Hash Consensus',
blockheight_PartsHash: 'Hash Pièces',
blockheight_DataHash: 'Hash Data',
blockheight_LastCommitHash: 'Hash Dernier Commit',
blockheight_LastResultsHash: 'Hash Dernier Résultat',
// governance
governance_Join: 'Turnout',
governance_Yes: 'Yes',
governance_Abstain: 'Abstain',
governance_No: 'No',
governance_NoVeto: 'No Veto',
// governance-id
governanceid_vote: 'Vote',
governanceid_proposalId: 'ID Proposal',
governanceid_submit_time: 'Heure de présentation',
governanceid_voting_start_time: `Heure Début du vote`,
governanceid_proposalType: 'Typologie Proposal',
governanceid_deposit_end_time: 'Délai de Dépôt',
governanceid_voting_end_time: 'Délai de Vote',
governanceid_total_deposit: 'Dépôt',
governanceid_status: 'État',
governanceid_votes: 'Votes',
governanceid_description: 'Description',
governanceid_tallyingProcedure: 'Comptage des Votes',
governanceid_DEPOSITS: 'DÉPÔTS',
governanceid_Yes: 'Oui',
governanceid_Abstain: 'Abstention',
governanceid_No: 'Non',
governanceid_NoVeto: 'Non avec Veto',
governanceid_Depositor: 'Dépositaire',
governanceid_Amount: 'Montant',
governanceid_Voter: 'Électeur',
governanceid_Option: 'Option',
// parameter
parameter_VersionParameters: 'Version Parameters',
parameter_NodeParameters: 'Paramètres Validateurs',
parameter_GovernanceParameters: 'Paramètres Gouvernance',
parameter_Deposit: 'Dépôt',
parameter_MaxDepositPeriod: 'Durée Max Dépôt',
parameter_Voting: 'Vote',
parameter_VotingPeriod: 'Durée du Vote',
parameter_Tallying: 'Comptage',
parameter_Quorum: 'Quorum',
parameter_Threshold: 'Seuil',
parameter_Veto: 'Veto',
parameter_StakingParameters: 'Paramètres Staking',
parameter_SlashingParameters: 'Paramètres Slashing',
parameter_DistributionParameters: 'Paramètres Distribution',
parameter_MintParameters: 'Paramètres Mint',
parameter_UnbondingTime: 'Durée Période Unbonding',
parameter_MaxValidators: 'Validateurs Max',
parameter_MaxEntries: 'Entrez Max',
parameter_BondDenom: 'Denom Valeur',
parameter_MaxEvidenceAge: 'Période Max Evidence',
parameter_SignedBlocksWindow: 'Fenêtre Blocs Signés',
parameter_MinSignedPerWindow: 'Min Signatures par Fenêtre',
parameter_DowntimeJailDuration: 'Durée Downtime Jail',
parameter_DoubleSignSlash: 'Slash pour Double Sign',
parameter_DowntimeSlash: 'Slash pour Downtime',
parameter_CommunityTax: 'Taxes Community',
parameter_BaseProposerReward: 'Proposer Base Reward',
parameter_BonusProposerReward: 'Proposer Bonus Reward',
parameter_WithdrawAddrEnabled: 'Retrait Autorisé',
parameter_GoalBonded: 'Bond Objectif',
parameter_Inflation: 'Inflation',
parameter_InflationMax: 'Inflation Max',
parameter_InflationMin: 'Inflation Min',
parameter_InflationChange: 'Changement Inflation',
parameter_BlocksPerYear: 'Blocs chaque Année',
parameter_AnnualProvisions: 'Rendements annuels',
parameter_MintDenom: 'Denom Mint',
parameter_min: ' min ',
parameter_hour: 'heures',
parameter_day: 'jours',
parameter_sen: ' sec',
// tx-hash
txhash_Information: 'Informations',
txhash_TxHash: 'HashTx',
txhash_Status: 'État',
txhash_Height: 'Hauteur',
txhash_Fee: 'Fee',
txhash_Gas: 'Gas ( used / wanted )',
txhash_Time: 'Heure',
txhash_Msgs: 'Msgs',
txhash_moniker: 'moniker',
txhash_identity: 'Identité',
txhash_website: 'website',
txhash_CommissionRate: 'Taux de Commission',
txhash_CommissionMaxRate: 'Taux de Commission Max',
txhash_CommissionMaxChangeRate: 'Max Variation de Commission',
// validator
validator_network: 'Network',
validator_version: 'Network Version',
validator_go: 'Go',
validator_application_version: 'Application Version',
validator_BlockHeight: 'Hauteur Bloc',
validator_Validators: 'Validateurs',
validator_Bonded: 'Bonded',
validator_EarningRate: 'Taux de Rendement',
validator_Active: 'Actif',
validator_Inactive: 'Inactif',
validator_Legend: 'Légende',
validator_ofbondedtokens: 'de tokens liés',
validator_Validator: 'Validateurs',
validator_CommissionMax: 'Commission/Max',
validator_Rewards: 'Rewards',
validator_BondedTokens: 'Tokens Liés',
validator_DailyChanges: 'Changements',
validator_UnbondingHeight: 'Hauteur Unbonding',
validator_UnbondingTime: 'Heure Unbonding',
// validator-address
validatoraddress_EarningRate: 'Taux de Rendement',
validatoraddress_VotingPower: 'Pouvoir de Vote',
validatoraddress_SelfDelegation: 'Self Délégations',
validatoraddress_Uptime: 'Uptime',
validatoraddress_Commission: 'Taux',
validatoraddress_Rate: 'Pourcentage',
validatoraddress_Max: 'Max',
validatoraddress_Change: 'Changement',
validatoraddress_Address: 'Compte Adresse',
validatoraddress_ValidatorAddress: 'Validateurs Addresse',
validatoraddress_Publickey: 'Clé Publique',
validatoraddress_HEXAddress: 'Addresse HEX',
validatoraddress_Info: 'Info',
validatoraddress_Delegations: 'Délégations',
validatoraddress_Delegator: 'Client',
validatoraddress_Amount: 'Quantité',
validatoraddress_Share: 'Share',
// wallet
wallet_Addressisrequired: `L'adresse est requise.`,
wallet_Useanexistingaddress: 'Indiquer une adresse existante',
wallet_switch: 'change',
wallet_Send: 'Invoie',
wallet_AvailableAmount: 'Montant disponible',
wallet_DelegatedAmount: 'Montant Délégué',
wallet_Rewards: 'Rewards',
wallet_Total: 'Total',
wallet_Delegations: 'Délégations',
wallet_Validator: 'Validateurs',
wallet_Transcantions: 'Transcantions',
wallet_Block: 'Bloc',
wallet_Height: 'Hauteur',
wallet_txhash: 'hashtx',
// wallet-add
walletadd_Chooseaway: 'Choisir le mode',
walletadd_UseLedger: 'User Ledger',
walletadd_Inputaddress: `Indiquer l'adresse`,
walletadd_Pleasefollowthesteps: 'Veuillez suivre les instructions.',
walletadd_1: 'Allumer votre Ledger Nano et entrer le code PIN.',
walletadd_2: `Sélectionner l'application Cosmos dans le Ledger.`,
walletadd_3: 'Sélectionner le compte du Ledger (Default 0, 0).',
walletadd_Account: 'Account',
walletadd_Index: 'Index',
walletadd_Continue: 'Continue',
walletadd_features: 'Experimental Web Platform features',
walletadd_dueto: 'En conséquence des récentes mises à jour de Ledger, pour utiliser un Ledger sur Windows, il faut maintenant activer "Experimental Web Platform features".',
walletadd_pleasecopy: 'Veuillez copier le link ci-dessous dans un nouvel onglet et mettre le paramètre "Experimental Web Platform features" sur "Enabled".',
walletadd_getmyledger: `Obtenir l'adresse de mon Ledger Nano`,
walletadd_Enteraddresstoview: `Saisir l'adresse pour afficher`,
walletadd_pleaseinputaddress: `Saisir l'adresse`,
walletadd_copy: 'Copie Réussie.',
walletadd_GetAddress: `Obtenir l'adresse`,
// wallet-send
walletsend_Send: 'Envoyer',
walletsend_From: 'Par',
walletsend_Max: 'Max',
walletsend_RecipientAddress: 'Adresse du bénéficiaire',
walletsend_address: 'Addresse',
walletsend_Amount: 'Montant',
walletsend_Memo: 'Memo (facultatif)',
walletsend_LedgerAccountIndex: 'Liste Compte Ledger (default 0,0)',
walletsend_Account: 'Compte',
walletsend_Index: 'Liste',
walletsend_Gas: 'Gas',
walletsend_Total: 'Total',
walletsend_Sendbyledger: 'Envoyer via le Ledger',
walletsend_exception: 'En cas de problème, refresh la page et réessayez.',
walletsend_sign: 'Vous pouvez consulter les informations relatives aux transactions et signer.',
walletsend_openledger: `Allumer le Ledger et sélectionner l'app Cosmos.`,
walletsend_Canceltransaction: 'Supprimer la transaction',
walletsend_Success: 'Succès',
walletsend_BlockHeight: 'Hauteur Bloc',
walletsend_TxHash: 'Hash Tx',
walletsend_SendAgain: 'Envoyer à nouveau',
walletsend_checkit: 'Vérifier plus tard..',
walletsend_notbeenfoun: `Les informations relatives à la transaction n'ont pas été retrouvées.`,
walletsend_gettransaction: 'Réaliser une nouvelle transaction.',
walletsend_SubmissionFailed: 'Échec de la transmission.',
walletsend_pleasecheck: 'Vérifier et modifier les informations suivantes avant de soumettre.',
walletsend_Pleaseinputtoaddress: `Indiquer l'adresse du destinataire`,
walletsend_pleaseinputamount: 'Indiquer le montant',
walletsend_memodefault: 'Envoyer via look.ping.pub 2020',
walletsend_Pleaseinputform: 'Indiquer form.',
walletsend_successfulsignature: 'Signature réussie et Transaction enregistrée!',
}
}
+52
View File
@@ -0,0 +1,52 @@
/*
* @Description:
* @Autor: dingyi
* @Date: 2020-03-28 21:13:04
* @LastEditors: Please set LastEditors
* @LastEditTime: 2020-06-07 09:16:15
* @FilePath: \look-web\src\utils\lang\index.js
*/
import Vue from "vue";
import VueI18n from "vue-i18n";
Vue.use(VueI18n);
import cn from "./cn";
import en from "./en";
import it from "./it";
import fr from "./fr";
import ru from "./ru";
import es from "./es";
const messages = {
en,
cn,
it,
fr,
ru,
es,
};
let lang = window.localStorage.getItem("lang");
if (!lang) {
lang =
window.navigator.language === "zh-CN"
? "cn"
: window.navigator.language === "it"
? "it"
: window.navigator.language === "fr"
? "fr"
: window.navigator.language === "ru"
? "ru"
: window.navigator.language === "es"
? "es"
: "en";
}
const i18n = new VueI18n({
locale: lang, // set locale
messages,
});
export default i18n;
+265
View File
@@ -0,0 +1,265 @@
export default {
message: {
kava_more: 'more',
parameter_cdp: 'CDP',
committee: 'Committee',
// dashboard
lang: 'Italiano',
validators: 'Validatori',
blocks: 'Blocchi',
uptime: 'Uptime',
governance: 'Governance',
parameters: 'Parametri',
wallet: 'Wallet',
testnet: 'Testnet',
mainnet: 'Mainnet',
// chain-add
createNewChain: 'Add New Chain',
chaindadd_name: 'Chain Name',
chaindadd_chainId: 'Chain Id',
chaindadd_logo: 'Logo Url',
chaindadd_lcd: 'LCD Url',
chaindadd_rpc: 'RPC Url',
chaindadd_prefix: 'Address Prefix',
chaindadd_unit: 'Token',
chaindadd_version: 'Core Version',
chaindadd_api: 'Api Version',
chaindadd_apiV1: 'Cosmos SDK',
chaindadd_apiV2: 'IRISHub',
chaindadd_type: 'Chain Type',
chaindadd_mainnet: 'Mainnet',
chaindadd_testnet: 'Testnet',
chaindadd_gos: 'GoZ',
chaindadd_desc: 'Chain Description',
chaindadd_http: "Please add the protocol to the LCD and RPC completely, like https://lcd.nylira.net or http://lcd.nylira.net.",
chaindadd_test: 'Test LCD api',
chaindadd_save: 'Save Now',
chaindadd_tip: 'Please input',
chaindadd_success: 'Add Success',
// block
block_lastBlockHash: 'Hash Ultimo Blocco',
block_hash: 'Hash',
block_proposer: 'Proponente',
block_time: 'Tempo',
block_detail: 'Dettagli',
block_transactions: 'Transazioni',
block_txhash: 'Hash Tx',
block_sentby: 'Inviato da',
block_memo: 'Memo',
// block-height
blockheight_more: 'Altro',
blockheight_header: 'Header',
blockheight_Address: 'Indirizzo',
blockheight_VotingPower: 'Potere di Voto',
blockheight_ProposerPriority: 'Priorità Proponente',
blockheight_Height: 'Altezza',
blockheight_Proposer: 'Proponente',
blockheight_BlockHash: 'Hash Blocco',
blockheight_LastBlockHash: 'Hash Ultimo Blocco',
blockheight_BlockTime: 'Tempo Blocco',
blockheight_NumberofTransactions: 'Numero Transazioni',
blockheight_TotalofTransactions: 'Transazioni Totali ',
blockheight_ChainId: 'ID Chain',
blockheight_BlockApp: 'App Blocco',
blockheight_BlockVersion: 'Versione Blocco',
blockheight_Evidence: 'Dimostrazione',
blockheight_EvidenceHash: 'Hash Dimostrazione',
blockheight_AppHash: 'Hash App',
blockheight_ValidatorsHash: 'Hash Validatore',
blockheight_NextValidatorsHash: 'Hash Validatore Successivo',
blockheight_ConsensusHash: 'Hash Consensus',
blockheight_PartsHash: 'Hash Parti',
blockheight_DataHash: 'Hash Dati',
blockheight_LastCommitHash: 'Hash Ultimo Committente',
blockheight_LastResultsHash: 'Hash Ultimi Risultati',
// governance
governance_Join: 'Turnout',
governance_Yes: 'Yes',
governance_Abstain: 'Abstain',
governance_No: 'No',
governance_NoVeto: 'No Veto',
// governance-id
governanceid_vote: 'Voto',
governanceid_proposalId: 'ID Proposta',
governanceid_submit_time: 'Ora di Presentazione',
governanceid_voting_start_time: 'Ora di Inizio Votazione',
governanceid_proposalType: 'Tipo di Proposta',
governanceid_deposit_end_time: 'Ora di Fine Deposito',
governanceid_voting_end_time: 'Ora di Fine Votazione',
governanceid_total_deposit: 'Deposito',
governanceid_status: 'Stato',
governanceid_votes: 'Voti',
governanceid_description: 'Descrizione',
governanceid_tallyingProcedure: 'Conteggio Voti',
governanceid_DEPOSITS: 'DEPOSITI',
governanceid_Yes: 'Sì',
governanceid_Abstain: 'Astenuti',
governanceid_No: 'No',
governanceid_NoVeto: 'No con Veto',
governanceid_Depositor: 'Depositario',
governanceid_Amount: 'Ammontare',
governanceid_Voter: 'Votante',
governanceid_Option: 'Scelta',
// parameter
parameter_VersionParameters: 'Version Parameters',
parameter_NodeParameters: 'Parametri Validatori',
parameter_GovernanceParameters: 'Parametri Governance',
parameter_Deposit: 'Deposito',
parameter_MaxDepositPeriod: 'Durata Periodo Deposito',
parameter_Voting: 'Votazione',
parameter_VotingPeriod: 'Durata Periodo Votazione',
parameter_Tallying: 'Conteggio',
parameter_Quorum: 'Quorum',
parameter_Threshold: 'Soglia',
parameter_Veto: 'Veto',
parameter_StakingParameters: 'Parametri Staking',
parameter_SlashingParameters: 'Parametri Slashing',
parameter_DistributionParameters: 'Parametri di Distribuzione',
parameter_MintParameters: 'Parametri della Zecca',
parameter_UnbondingTime: 'Tempo Revoca Delega',
parameter_MaxValidators: 'Numero Max Validatori',
parameter_MaxEntries: 'Immissioni Max',
parameter_BondDenom: 'Denom Valore',
parameter_MaxEvidenceAge: 'Tempo Max Dimostrazione',
parameter_SignedBlocksWindow: 'Finestra Blocchi Firmati',
parameter_MinSignedPerWindow: 'Firme Min per Finestra',
parameter_DowntimeJailDuration: 'Durata Downtime Jail',
parameter_DoubleSignSlash: ' Slash per Double Sign',
parameter_DowntimeSlash: 'Slash per Downtime',
parameter_CommunityTax: 'Tassa Comunitaria',
parameter_BaseProposerReward: 'Reward Base Proponente',
parameter_BonusProposerReward: 'Reward Bonus Proponente',
parameter_WithdrawAddrEnabled: 'Prelievo Abilitato',
parameter_GoalBonded: 'Obiettivo Stabilito',
parameter_Inflation: 'Inflazione',
parameter_InflationMax: 'Inflazione Max',
parameter_InflationMin: 'Inflazione Min',
parameter_InflationChange: 'Cambio Inflazione',
parameter_BlocksPerYear: 'Blocchi per Anno',
parameter_AnnualProvisions: 'Rendite Annuali',
parameter_MintDenom: 'Denom Valore',
parameter_min: ' min ',
parameter_hour: 'ore',
parameter_day: 'giorni',
parameter_sen: ' sec',
// tx-hash
txhash_Information: 'Informazioni',
txhash_TxHash: 'HashTx',
txhash_Status: 'Stato',
txhash_Height: 'Altezza',
txhash_Fee: 'Fee',
txhash_Gas: 'Gas ( usato / desiderato )',
txhash_Time: 'Tempo',
txhash_Msgs: 'Msgs',
txhash_moniker: 'moniker',
txhash_identity: 'identità',
txhash_website: 'sito web',
txhash_CommissionRate: 'Tasso Commissioni',
txhash_CommissionMaxRate: 'Tasso Max Commissioni',
txhash_CommissionMaxChangeRate: 'Variazione Max Tasso Max Commissioni',
// validator
validator_network: 'Network',
validator_version: 'Network Version',
validator_go: 'Go',
validator_application_version: 'Application Version',
validator_BlockHeight: 'Altezza Blocco',
validator_Validators: 'Validatori',
validator_Bonded: 'Delegati',
validator_EarningRate: 'Percentuale Profitto',
validator_Active: 'Attivo',
validator_Inactive: 'Inattivo',
validator_Legend: 'Legenda',
validator_ofbondedtokens: 'di token delegati',
validator_Validator: 'Validatore',
validator_CommissionMax: 'Commissione/Max',
validator_Rewards: 'Reward',
validator_BondedTokens: 'Token Delegati',
validator_DailyChanges: 'Cambiamenti',
validator_UnbondingHeight: 'Altezza Unbonding',
validator_UnbondingTime: 'Tempo Unbonding',
// validator-address
validatoraddress_EarningRate: 'Percentuale Profitto',
validatoraddress_VotingPower: 'Potere di Voto',
validatoraddress_SelfDelegation: 'Auto Delega',
validatoraddress_Uptime: 'Uptime',
validatoraddress_Commission: 'Commissione',
validatoraddress_Rate: 'Tasso',
validatoraddress_Max: 'Max',
validatoraddress_Change: 'Cambiamento',
validatoraddress_Address: 'Indirizzo Address',
validatoraddress_ValidatorAddress: 'Indirizzo Validatore',
validatoraddress_Publickey: 'Chiave Pubblica',
validatoraddress_HEXAddress: 'Indirizzo HEX',
validatoraddress_Info: 'Info',
validatoraddress_Delegations: 'Delegazioni',
validatoraddress_Delegator: 'Delegatore',
validatoraddress_Amount: 'Ammontare',
validatoraddress_Share: 'Percentuale',
// wallet
wallet_Addressisrequired: 'Indirizzo Necessario.',
wallet_Useanexistingaddress: 'Inserire Indirizzo Valido',
wallet_switch: 'Cambia',
wallet_Send: 'Invia',
wallet_AvailableAmount: 'Importo Disponibile',
wallet_DelegatedAmount: 'Importo Delegato',
wallet_Rewards: 'Reward',
wallet_Total: 'Totale',
wallet_Delegations: 'Delegazioni',
wallet_Validator: 'Validatore',
wallet_Transcantions: 'Transazioni',
wallet_Block: 'Blocco',
wallet_Height: 'Altezza',
wallet_txhash: 'HashTx',
// wallet-add
walletadd_Chooseaway: 'Scegli Metodo',
walletadd_UseLedger: 'Usa Ledger',
walletadd_Inputaddress: 'Inserisci Indirizzo',
walletadd_Pleasefollowthesteps: 'Si prega di seguire attentamente i passaggi',
walletadd_1: 'Accendi il tuo Ledger Nano ed inserisci il PIN.',
walletadd_2: "Apri L'App Cosmos su Ledger.",
walletadd_3: "Seleziona l'Account Ledger (Default 0, 0).",
walletadd_Account: 'Account',
walletadd_Index: 'Index',
walletadd_Continue: 'Continue',
walletadd_features: 'Experimental Web Platform features',
walletadd_dueto: 'A seguito di un recente aggiornamento, per usare Ledger da Windows è necessario attivare "Experimental Web Platform features".',
walletadd_pleasecopy: `Copia il seguente link in una nuova tab ed imposta l'opzione "Experimental Web Platform features" su "Enabled"`,
walletadd_getmyledger: "Ottieni l' Indirizzo del mio Ledger Nano",
walletadd_Enteraddresstoview: `Inserisci l'Indirizzo per Visualizzare`,
walletadd_pleaseinputaddress: `Inserisci l'Indirizzo`,
walletadd_copy: 'Copiato.',
walletadd_GetAddress: 'Ottieni Indirizzo',
// wallet-send
walletsend_Send: 'Invia',
walletsend_From: 'Da',
walletsend_Max: 'Max',
walletsend_RecipientAddress: 'Indirizzo Destinatario',
walletsend_address: 'Indirizzo',
walletsend_Amount: 'Ammontare',
walletsend_Memo: 'Memo (opzionale)',
walletsend_LedgerAccountIndex: 'Index Ledger Account (default 0,0)',
walletsend_Account: 'Account',
walletsend_Index: 'Index',
walletsend_Gas: 'Gas',
walletsend_Total: 'Totale',
walletsend_Sendbyledger: 'Inviato da Ledger',
walletsend_exception: 'Se si riscontrano problemi, aggiorna la pagina e riprova.',
walletsend_sign: 'Puoi vedere le informazioni sulla transazione e firmarla.',
walletsend_openledger: `Apri il Ledger e l'App Cosmos.`,
walletsend_Canceltransaction: 'Cancella la Transazione',
walletsend_Success: 'Completata con Successo',
walletsend_BlockHeight: 'Altezza Blocco',
walletsend_TxHash: 'Hash Tx',
walletsend_SendAgain: 'Invia Nuovamente',
walletsend_checkit: 'Verifica più tardi.',
walletsend_notbeenfoun: 'Le informazioni sulla transazione non sono state trovate.',
walletsend_gettransaction: 'Ottieni la Transazione Nuovamente',
walletsend_SubmissionFailed: 'Invio Fallito.',
walletsend_pleasecheck: 'Verifica e modifica le seguenti informazioni prima di procedere con invio.',
walletsend_Pleaseinputtoaddress: `Si prega di inserire l'Indirizzo`,
walletsend_pleaseinputamount: `Si prega di inserire l'ammontare desiderato`,
walletsend_memodefault: 'Invia tramite look.ping.pub 2020',
walletsend_Pleaseinputform: 'Si prega di inserire il Modulo.',
walletsend_successfulsignature: 'Firma e transazione effettuate con successo!',
}
}
+273
View File
@@ -0,0 +1,273 @@
/*
* @Description:
* @Autor: dingyi
* @Date: 2020-04-04 17:30:51
* @LastEditors: 丁一鸣
* @lastTime: 2020-08-28 09:59:35
* @FilePath: \look-web\src\utils\lang\ru.js
*/
export default {
message: {
kava_more: 'more',
parameter_cdp: 'CDP',
committee: 'Committee',
// dashboard
lang: 'Русский',
validators: 'Валидаторы',
blocks: 'Блоки',
uptime: 'Аптайм',
governance: 'Управление',
parameters: 'Параметры',
wallet: 'Кошелек',
testnet: 'Тестовая сеть',
mainnet: 'Основная сеть',
// chain-add
createNewChain: 'Add New Chain',
chaindadd_name: 'Chain Name',
chaindadd_chainId: 'Chain Id',
chaindadd_logo: 'Logo Url',
chaindadd_lcd: 'LCD Url',
chaindadd_rpc: 'RPC Url',
chaindadd_prefix: 'Address Prefix',
chaindadd_unit: 'Token',
chaindadd_version: 'Core Version',
chaindadd_api: 'Api Version',
chaindadd_apiV1: 'Cosmos SDK',
chaindadd_apiV2: 'IRISHub',
chaindadd_type: 'Chain Type',
chaindadd_mainnet: 'Mainnet',
chaindadd_testnet: 'Testnet',
chaindadd_gos: 'GoZ',
chaindadd_desc: 'Chain Description',
chaindadd_http: "Please add the protocol to the LCD and RPC completely, like https://lcd.nylira.net or http://lcd.nylira.net.",
chaindadd_test: 'Test LCD api',
chaindadd_save: 'Save Now',
chaindadd_tip: 'Please input',
chaindadd_success: 'Add Success',
// block
block_lastBlockHash: 'Хэш Последнего Блока',
block_hash: 'Хэш',
block_proposer: 'Валидатор',
block_time: 'Время',
block_detail: 'Подробнее',
block_transactions: 'Транзакции',
block_txhash: 'Хэш Транзакции',
block_sentby: 'Отправлен',
block_memo: 'Мемо',
// block-height
blockheight_more: 'Подробнее',
blockheight_header: 'Заголовок',
blockheight_Address: 'Адрес',
blockheight_VotingPower: 'Количество Голосов',
blockheight_ProposerPriority: 'Приоритет Валидатора',
blockheight_Height: 'Высота',
blockheight_Proposer: 'Валидатор',
blockheight_BlockHash: 'Хэш Блока',
blockheight_LastBlockHash: 'Хэш Последнего Блока',
blockheight_BlockTime: 'Время Блока',
blockheight_NumberofTransactions: 'Количество Транзакций',
blockheight_TotalofTransactions: 'Всего Транзакций',
blockheight_ChainId: 'Идентификатор Сети',
blockheight_BlockApp: 'Приложение Блока',
blockheight_BlockVersion: 'Версия Блока',
blockheight_Evidence: 'Доказательство',
blockheight_EvidenceHash: 'Хэш Доказательства',
blockheight_AppHash: 'Хэш Приложения',
blockheight_ValidatorsHash: 'Хэш Валидаторов',
blockheight_NextValidatorsHash: 'Хэш Следующих Валидаторов',
blockheight_ConsensusHash: 'Хэш Консенсуса',
blockheight_PartsHash: 'Хэш Части',
blockheight_DataHash: 'Хэш Данных',
blockheight_LastCommitHash: 'Хэш Последнего Коммита',
blockheight_LastResultsHash: 'Хэш Последнего Результата',
// governance
governance_Join: 'Turnout',
governance_Yes: 'Yes',
governance_Abstain: 'Abstain',
governance_No: 'No',
governance_NoVeto: 'No Veto',
// governance-id
governanceid_vote: 'Голос',
governanceid_proposalId: 'ID Предложения',
governanceid_submit_time: 'Время Отправки',
governanceid_voting_start_time: 'Время Начала Голосования',
governanceid_proposalType: 'Тип Предложения',
governanceid_deposit_end_time: 'Время Окончания Депозита',
governanceid_voting_end_time: 'Время Окончания Голосования',
governanceid_total_deposit: 'Депозит',
governanceid_status: 'Статус',
governanceid_votes: 'Голоса',
governanceid_description: 'Описание',
governanceid_tallyingProcedure: 'Процедура подсчета',
governanceid_DEPOSITS: 'ДЕПОЗИТЫ',
governanceid_Yes: 'Да',
governanceid_Abstain: 'Воздержался',
governanceid_No: 'Нет',
governanceid_NoVeto: 'Нет (Вето)',
governanceid_Depositor: 'Вкладчик',
governanceid_Amount: 'Количество',
governanceid_Voter: 'Голосующий',
governanceid_Option: 'Выбор',
// parameter
parameter_VersionParameters: 'Version Parameters',
parameter_NodeParameters: 'Параметры Валидаторов',
parameter_GovernanceParameters: 'Параметры Управления',
parameter_Deposit: 'Депозит',
parameter_MaxDepositPeriod: 'Максимальный Период Депозита',
parameter_Voting: 'Голосование',
parameter_VotingPeriod: 'Период Голосования',
parameter_Tallying: 'Подсчет',
parameter_Quorum: 'Кворум',
parameter_Threshold: 'Порог',
parameter_Veto: 'Вето',
parameter_StakingParameters: 'Параметры Стейкинга',
parameter_SlashingParameters: 'Параметры Слэшинга',
parameter_DistributionParameters: 'Параметры Распределения',
parameter_MintParameters: 'Параметры Создания Новых Монет',
parameter_UnbondingTime: 'Время Разблокировки Монет',
parameter_MaxValidators: 'Максимальное Число Валидаторов',
parameter_MaxEntries: 'Максильное Число Заявок',
parameter_BondDenom: 'Деном Залога',
parameter_MaxEvidenceAge: 'Максимальный Возраст Доказательства',
parameter_SignedBlocksWindow: 'Окно Подписания Блоков',
parameter_MinSignedPerWindow: 'Минимальное Количество Подписанных Блоков в Окне',
parameter_DowntimeJailDuration: 'Время Заключения за Бездействие',
parameter_DoubleSignSlash: 'Наказание за Двойное Подписывание',
parameter_DowntimeSlash: 'Наказание за Отсутствие',
parameter_CommunityTax: 'Комиссия сообщества',
parameter_BaseProposerReward: 'Базовая Награда для Валидатора',
parameter_BonusProposerReward: 'Бонусная Награда для Валидатора',
parameter_WithdrawAddrEnabled: 'Доступность Адреса Вывода',
parameter_GoalBonded: 'Цель для связки',
parameter_Inflation: 'Инфляция',
parameter_InflationMax: 'Максимальная Инфляция',
parameter_InflationMin: 'Минимальная Инфляция',
parameter_InflationChange: 'Изменение Инфляции',
parameter_BlocksPerYear: 'Количество Блоков в Год',
parameter_AnnualProvisions: 'Ежегодный запас',
parameter_MintDenom: 'Выпускаемый Деном',
parameter_min: ' минут ',
parameter_hour: 'часов',
parameter_day: 'дней',
parameter_sen: ' sec',
// tx-hash
txhash_Information: 'Информация',
txhash_TxHash: 'Хэш Транзакции',
txhash_Status: 'Статус',
txhash_Height: 'Высота',
txhash_Fee: 'Комиссия',
txhash_Gas: 'Газ ( использованный / желаемый )',
txhash_Time: 'Время',
txhash_Msgs: 'Сообщения',
txhash_moniker: 'имя',
txhash_identity: 'личность',
txhash_website: 'вебсайт',
txhash_CommissionRate: 'Ставка Комиссии',
txhash_CommissionMaxRate: 'Максимальная Ставка Комиссии',
txhash_CommissionMaxChangeRate: 'Максимальное Изменение Ставки Комиссии',
// validator
validator_network: 'Network',
validator_version: 'Network Version',
validator_go: 'Go',
validator_application_version: 'Application Version',
validator_BlockHeight: 'Высота Блока',
validator_Validators: 'Валидаторы',
validator_Bonded: 'Залочено',
validator_EarningRate: 'Процентная Ставка',
validator_Active: 'Активные',
validator_Inactive: 'Неактивные',
validator_Legend: 'Легенда',
validator_ofbondedtokens: 'залоченных токенов',
validator_Validator: 'Валидатор',
validator_CommissionMax: 'Комиссия/Максимальная',
validator_Rewards: 'Вознаграждение',
validator_BondedTokens: 'Токенов Залочено',
validator_DailyChanges: 'Изменение за день',
validator_UnbondingHeight: 'Высота Высвобождения',
validator_UnbondingTime: 'Время Высвобождения',
// validator-address
validatoraddress_EarningRate: 'Процентная ставка',
validatoraddress_VotingPower: 'Количество голосов',
validatoraddress_SelfDelegation: 'Свое Делегирование',
validatoraddress_Uptime: 'Аптайм',
validatoraddress_Commission: 'Комиссия',
validatoraddress_Rate: 'Ставка',
validatoraddress_Max: 'Максимум',
validatoraddress_Change: 'Изменение',
validatoraddress_Address: 'Адрес Аккаунта',
validatoraddress_ValidatorAddress: 'Адрес Валидатора',
validatoraddress_Publickey: 'Публичный ключ',
validatoraddress_HEXAddress: 'HEX Адрес',
validatoraddress_Info: 'Информация',
validatoraddress_Delegations: 'Голоса',
validatoraddress_Delegator: 'доверитель',
validatoraddress_Amount: 'количество',
validatoraddress_Share: 'делить',
// wallet
wallet_Addressisrequired: 'Введите Адрес.',
wallet_Useanexistingaddress: 'Используйте существующий адрес',
wallet_switch: 'изменить',
wallet_Send: 'Отправить',
wallet_AvailableAmount: 'Доступный Баланс',
wallet_DelegatedAmount: 'Делегированный Баланс',
wallet_Rewards: 'Награда',
wallet_Total: 'Всего',
wallet_Delegations: 'Делегирования',
wallet_Validator: 'Валидатор',
wallet_Transcantions: 'Транзакции',
wallet_Block: 'Блок',
wallet_Height: 'Высота',
wallet_txhash: 'Хэш транзакции',
// wallet-add
walletadd_Chooseaway: 'Выберите вариант',
walletadd_UseLedger: 'Использовать Ledger',
walletadd_Inputaddress: 'Ввести Адрес',
walletadd_Pleasefollowthesteps: 'Пожалуйста, следуйте этим инструкциям:',
walletadd_1: 'Подсоедините ваш Ledger и введите ПИН.',
walletadd_2: 'Откройте приложение Cosmos.',
walletadd_3: 'Выберите аккаунт (По умолчанию 0, 0).',
walletadd_Account: 'Аккаунт',
walletadd_Index: 'Индекс',
walletadd_Continue: 'Продолжайте',
walletadd_features: 'Experimental Web Platform features', //this flag name is NOT translated to russian in chrome yet
walletadd_dueto: 'Вследствие последних обновлений, использование Ledger на Windows теперь требует активацию флага "Experimental Web Platform features"',
walletadd_pleasecopy: 'Пожалуйста скопируйте ссылку ниже в новую вкладку и активируйте флаг "Experimental Web Platform features"',
walletadd_getmyledger: 'Получить адрес с Ledger',
walletadd_Enteraddresstoview: 'Введите адрес для просмотра',
walletadd_pleaseinputaddress: 'пожалуйста введите адрес',
walletadd_copy: 'Успешно скопировано.',
walletadd_GetAddress: 'Получить Адрес',
// wallet-send
walletsend_Send: 'Отправить',
walletsend_From: 'От',
walletsend_Max: 'Максимум',
walletsend_RecipientAddress: 'Адрес Получателя',
walletsend_address: 'адрес',
walletsend_Amount: 'Количество',
walletsend_Memo: 'Мемо (опционально)',
walletsend_LedgerAccountIndex: 'Индекс Ledger Аккаунта (По умолчанию 0,0)',
walletsend_Account: 'Аккаунт',
walletsend_Index: 'Индекс',
walletsend_Gas: 'Газ',
walletsend_Total: 'Всего',
walletsend_Sendbyledger: 'Подтвердить на Ledger',
walletsend_exception: 'Если появятся какие-либо ошибки, обновите страницу и попробуйте снова.',
walletsend_sign: 'Вы можете посмотреть информацию о транзакции и подписать.',
walletsend_openledger: 'Пожалуйста, разблокируйте Ledger и откройте приложение Cosmos.',
walletsend_Canceltransaction: 'Отменить транзакцию',
walletsend_Success: 'Успешно',
walletsend_BlockHeight: 'Высота блока',
walletsend_TxHash: 'Хэш транзакции',
walletsend_SendAgain: 'Отправить Снова',
walletsend_checkit: 'Пожалуйста, попробуйте позже.',
walletsend_notbeenfoun: 'Информация о транзакции не найдена.',
walletsend_gettransaction: 'Получить Транзакцию Заново',
walletsend_SubmissionFailed: 'Ошибка отправки.',
walletsend_pleasecheck: 'Пожалуйста проверьте и исправьте данную информамцию перед отправкой.',
walletsend_Pleaseinputtoaddress: 'Пожалуйста, введите адрес',
walletsend_pleaseinputamount: 'пожалуйста, введите количество',
walletsend_memodefault: 'отправлено с помощью look.ping.pub 2020',
walletsend_Pleaseinputform: 'Пожалуйста, заполните форму.',
walletsend_successfulsignature: 'Транзакция успешно подписана и отправлена!',
}
}
+70
View File
@@ -0,0 +1,70 @@
// 基于 ledger cosmos 获取地址
const testModeAllowed = false;
function parseLedgerErrors(error) {
// TODO move this error rewrite into the ledger lib
/* istanbul ignore next: specific error rewrite */
if (error.message.trim().startsWith("Device is already open")) {
throw new Error(
"Something went wrong connecting to your Ledger. Please refresh your page and try again."
);
}
throw error;
}
export async function getLedgerConnector({ account, index }) {
const networkId = "cosmos";
const address_prefix = "cosmos";
switch (networkId) {
case "cosmos": {
const { default: Ledger } = await import("@lunie/cosmos-ledger");
const HDPATH = [44, 118, account, 0, index];
const ledger = new Ledger(
{
testModeAllowed: false
},
HDPATH,
address_prefix
);
return ledger;
}
default:
throw new Error(
"Doesn't support connecting to the Ledger for this network."
);
}
}
export async function showAddressOnLedger() {
const ledger = await getLedgerConnector();
try {
await ledger.confirmLedgerAddress();
} catch (err) {
parseLedgerErrors(err);
} finally {
// cleanup. if we leave this open, the next connection will brake for HID
// TODO move this into the leder lib
if (ledger && ledger.cosmosApp) {
ledger.cosmosApp.transport.close();
}
}
}
export const getAddressFromLedger = async (account) => {
const ledger = await getLedgerConnector(account);
try {
const address = await ledger.getCosmosAddress(); // TODO this should become `getAddress` to also work for not Cosmos networks
return address;
} catch (err) {
parseLedgerErrors(err);
} finally {
// cleanup. if we leave this open, the next connection will brake for HID
// TODO move this into the leder lib
if (ledger && ledger.cosmosApp) {
ledger.cosmosApp.transport.close();
}
}
};
+40
View File
@@ -0,0 +1,40 @@
/*
* @Author: your name
* @Date: 2020-03-01 02:53:24
* @LastEditTime: 2020-03-01 13:37:08
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /serverless/look/src/views/wallet-ledger/utils/signer.js
*/
import { getLedgerConnector } from "./getAddress";
export async function getSigner(submitType, account, index) {
if (submitType === `ledger`) {
if (!account) account = 0;
if (!index) index = 0;
return async signMessage => {
const ledger = await getLedgerConnector({ account, index });
let publicKey, signature;
try {
publicKey = await ledger.getPubKey();
signature = await ledger.sign(signMessage);
} catch (err) {
/* istanbul ignore next: specific error rewrite */
if (err.message.trim().startsWith("Device is already open")) {
throw new Error(
"Something went wrong connecting to your Ledger. Please refresh your page and try again."
);
}
throw err;
}
// cleanup. if we leave this open, the next connection will brake for HID
ledger.cosmosApp.transport.close();
return {
signature,
publicKey
};
};
}
}
+115
View File
@@ -0,0 +1,115 @@
import { getSigner } from "./getSigner";
import * as msgType from "./v1-msg";
export function getMsg() {
return msgType;
}
export async function MsgSend({
senderAddress,
toAddress,
memo,
account_number,
sequence,
gas,
amount,
account,
amounts,
index
}) {
const msg = msgType.MsgSend(senderAddress, {
toAddress,
amounts
});
return await getTx(
{
account,
account_number,
amount,
gas,
index,
memo,
sequence
},
msg
);
}
export async function MsgDelegate({
senderAddress,
validatorAddress,
memo,
account_number,
sequence,
gas,
amount,
account,
index,
denom
}) {
const msg = msgType.MsgDelegate(senderAddress, {
validatorAddress,
amount,
denom
});
return await getTx(
{
account,
account_number,
amount,
gas,
index,
memo,
sequence
},
msg
);
}
export async function getTx(
{ account, account_number, amount, gas, index, memo, sequence },
msg
) {
const msgs = [msg];
const fee = {
amount: [{ amount: gas + "", denom: "uatom" }],
gas: gas + Number(amount) + ""
};
const sendMsg = {
account_number,
chain_id: "cosmoshub-3",
fee,
memo,
msgs,
sequence
};
let signer;
try {
signer = await getSigner("ledger", account, index);
} catch (e) {
console.log(e);
}
if (!signer) return;
const { signature, publicKey } = await signer(JSON.stringify(sendMsg));
const txSign = {
signature: signature.toString(`base64`),
account_number,
sequence,
pub_key: {
type: `tendermint/PubKeySecp256k1`,
value: publicKey.toString(`base64`)
}
};
let txBroadcast = {
tx: {
msg: msgs,
fee,
memo,
signatures: [txSign]
},
mode: "async"
};
return txBroadcast;
}
+141
View File
@@ -0,0 +1,141 @@
// Bank
export function MsgSend(
senderAddress,
{
toAddress,
amounts // [{ denom, amount}]
}
) {
return {
type: `cosmos-sdk/MsgSend`,
value: {
amount: amounts,
from_address: senderAddress,
to_address: toAddress
}
};
}
// Staking
export function MsgDelegate(
senderAddress,
{ validatorAddress, amount, denom }
) {
/* istanbul ignore next */
return {
type: `cosmos-sdk/MsgDelegate`,
value: {
amount: [{ amount, denom }],
delegator_address: senderAddress,
validator_address: validatorAddress
}
};
}
export function MsgUndelegate(
senderAddress,
{ validatorAddress, amount, denom }
) {
/* istanbul ignore next */
return {
type: `cosmos-sdk/MsgUndelegate`,
value: {
amount: Coin({ amount, denom }),
delegator_address: senderAddress,
validator_address: validatorAddress
}
};
}
export function MsgRedelegate(
senderAddress,
{ validatorSourceAddress, validatorDestinationAddress, amount, denom }
) {
/* istanbul ignore next */
return {
type: `cosmos-sdk/MsgBeginRedelegate`,
value: {
amount: Coin({ amount, denom }),
delegator_address: senderAddress,
validator_dst_address: validatorDestinationAddress,
validator_src_address: validatorSourceAddress
}
};
}
// Governance
export function MsgSubmitProposal(
senderAddress,
{
title,
description,
initialDeposits // [{ denom, amount }]
}
) {
/* istanbul ignore next */
return {
type: `cosmos-sdk/MsgSubmitProposal`,
value: {
content: {
type: "cosmos-sdk/TextProposal",
value: {
description,
title
}
},
initial_deposit: initialDeposits.map(Coin),
proposer: senderAddress
}
};
}
export function MsgVote(senderAddress, { proposalId, option }) {
/* istanbul ignore next */
return {
type: `cosmos-sdk/MsgVote`,
value: {
option,
proposal_id: proposalId,
voter: senderAddress
}
};
}
export function MsgDeposit(
senderAddress,
{
proposalId,
amounts // [{ denom, amount }]
}
) {
/* istanbul ignore next */
return {
type: `cosmos-sdk/MsgDeposit`,
value: {
amount: amounts.map(Coin),
depositor: senderAddress,
proposal_id: proposalId
}
};
}
export function MsgWithdrawDelegationReward(
senderAddress,
{ validatorAddress }
) {
/* istanbul ignore next */
return {
type: `cosmos-sdk/MsgWithdrawDelegationReward`,
value: {
delegator_address: senderAddress,
validator_address: validatorAddress
}
};
}
function Coin({ amount, denom }) {
return {
amount: String(amount),
denom
};
}
+235
View File
@@ -0,0 +1,235 @@
"use strict"
import BigNumber from "bignumber.js"
/**
* Defines all numerical methods
* @module num
*/
// truncate decimals to not round when using Intl.NumberFormat
function truncate(number, digits) {
return Math.trunc(number * Math.pow(10, digits)) / Math.pow(10, digits)
}
export const SMALLEST = 1e-6
const language = window.navigator.userLanguage || window.navigator.language
function setDecimalLength(value, length) {
if (value === undefined || value === null || Number.isNaN(value)) return null
// rounding up the last decimal
const roundedValue =
Math.round(value * Math.pow(10, length)) / Math.pow(10, length)
return new Intl.NumberFormat(language, {
minimumFractionDigits: length > 3 ? length : 0
}).format(truncate(roundedValue, length))
}
export function twoDecimals(value) {
return Number(setDecimalLength(value, 2))
}
export function shortDecimals(value) {
return setDecimalLength(value, 3)
}
export function fullDecimals(value) {
return setDecimalLength(value, 6)
}
export function pretty(number = 0) {
return new Intl.NumberFormat(language, {
minimumFractionDigits: 2,
maximumFractionDigits: 2
}).format(Math.round(number * 100) / 100)
}
export function prettyLong(number = 0) {
return new Intl.NumberFormat(language, {
maximumFractionDigits: 20,
useGrouping: true
}).format(number)
}
// pretty print long decimals not in scientific notation
export function prettyDecimals(number = 0) {
let longDecimals = new Intl.NumberFormat(language, {
minimumFractionDigits: 20,
maximumFractionDigits: 20
}).format(number)
// remove all trailing zeros
while (longDecimals.charAt(longDecimals.length - 1) === `0`) {
longDecimals = longDecimals.substr(0, longDecimals.length - 1)
}
// remove decimal separator from whole numbers
if (Number.isNaN(Number(longDecimals.charAt(longDecimals.length - 1)))) {
longDecimals = longDecimals.substr(0, longDecimals.length - 1)
}
return longDecimals
}
export function prettyInt(number = 0) {
return new Intl.NumberFormat(language).format(Math.round(number))
}
export function percentInt(number = 0) {
return new Intl.NumberFormat(language).format(Math.round(number * 100)) + `%`
}
export function percent(number = 0) {
return (
parseFloat(new Intl.NumberFormat(language, {
minimumFractionDigits: 2,
maximumFractionDigits: 2
}).format(Math.round(number * 10000) / 100)) + `%`
)
}
export function bigFigure(number = 0) {
let formatted = Math.round(number * 100) / 100
let suffix = ""
if (Math.abs(Number(formatted)) >= 1e12) {
formatted = Number(formatted) / 1e12
suffix = "T"
} else if (Math.abs(Number(formatted)) >= 1e9) {
formatted = Number(formatted) / 1e9
suffix = "B"
} else if (Math.abs(Number(formatted)) >= 1e6) {
formatted = Number(formatted) / 1e6
suffix = "M"
}
return (
new Intl.NumberFormat(language, {
minimumFractionDigits: 0,
maximumFractionDigits: 1
}).format(formatted) + ` ${suffix}`
)
}
export function bigFigureOrShortDecimals(number) {
// here we check how many positive digits the number has to see how we should format it
if (Math.abs(Number(number)) < 1e6) {
return shortDecimals(number)
} else {
return bigFigure(number)
}
}
export function bigFigureOrPercent(number) {
// once again, the same logic
if (Math.abs(Number(number)) < 1e4) {
return percent(number)
} else {
return bigFigure(number * 100)
.toString()
.concat(` %`)
}
}
export function atoms(number = 0) {
return BigNumber(number)
.div(1e6)
.toNumber()
}
export function toIris(number = 0) {
return BigNumber(number)
.div(1e18)
.toNumber()
}
export function uatoms(number = 0) {
return (
BigNumber(number)
.times(1e6)
// .toFixed(0) // Temporary here. Waiting for Aleksei/fee in extension #3567 to be merged
.toString()
)
}
// convert micro denoms like uatom to display denoms like ATOM
export function viewDenom(denom) {
if (denom.charAt(0) === `u`) {
return denom.substr(1).toUpperCase()
}
return denom.toUpperCase()
}
export function createDisplayCoin({ amount, denom }, length = 3) {
return {
amount: amount && setDecimalLength(atoms(amount), length),
denom: viewDenom(denom)
}
}
// This will take an object and for each (k,v) will return
// v rounded such that the sum of all v is 100.
// Used the following as a reference:
// https://stackoverflow.com/questions/13483430/how-to-make-rounded-percentages-add-up-to-100
// Note: We pass an object, and want to keep the (key, value) association.
export const roundObjectPercentages = dataMap => {
// This algorithm workson integers and we want 2 decimal places.
// So round up first.
const scale = 100
let asArray = Object.entries(dataMap).map(([key, value]) => {
return [key, value * scale]
})
const sumRounded = (acc, x) => {
return acc + Math.round(x[1])
}
// The leftOver is the difference beween 100 and
// the sum of the rounded values.
var leftOver = scale * 100 - asArray.reduce(sumRounded, 0)
//
const cmpNumberValue = (a, b) => {
return b[1] - Math.round(a[1]) - a[1]
}
// Here we distribute the leftOver as evenly as possible amongst the rounded values.
// The values are sorted first.
asArray.sort(cmpNumberValue)
const result = asArray.map(function(x, i) {
// Note: leftOver can be negative.
const rounded = [
x[0],
(Math.round(x[1]) + (leftOver > i) - (i >= asArray.length + leftOver)) /
100.0
]
return rounded
})
// Turn the array back into the original data structure layout
const resultObject = {}
result.forEach(x => {
resultObject[x[0]] = x[1]
})
return resultObject
}
export default {
SMALLEST,
atoms,
uatoms,
viewDenom,
createDisplayCoin,
shortDecimals,
fullDecimals,
pretty,
prettyInt,
prettyLong,
percent,
percentInt,
prettyDecimals,
roundObjectPercentages,
bigFigure,
bigFigureOrShortDecimals,
bigFigureOrPercent
}