From d3a579d62cabcde7ff808ace29f48b9ba5ac6bd2 Mon Sep 17 00:00:00 2001 From: zyonyu Date: Mon, 2 Oct 2023 02:15:21 +0800 Subject: [PATCH] nft --- src/App.js | 52 +- src/actions/actionTypes.js | 1 + src/actions/token.js | 22 +- src/components/Button.js | 8 +- src/components/Button.scss | 14 +- src/components/NftDetail/index.js | 195 +++ src/components/NftDetail/index.scss | 105 ++ src/components/TokenBalance/index.js | 196 ++- src/components/TokenBalance/index.scss | 101 +- src/components/TokenTransfer/index.js | 236 ++- src/components/TokenTransferSuccess/index.js | 23 +- src/components/TransactionSuccess.js | 17 +- src/components/index.js | 65 +- src/constants/i18n.js | 1392 +++++++++--------- src/iost/iost.js | 66 +- src/reducers/token.js | 11 +- src/utils/token.js | 30 +- 17 files changed, 1501 insertions(+), 1033 deletions(-) create mode 100644 src/components/NftDetail/index.js create mode 100644 src/components/NftDetail/index.scss diff --git a/src/App.js b/src/App.js index 51c3fb0..5d407f1 100644 --- a/src/App.js +++ b/src/App.js @@ -1,9 +1,31 @@ import React, { Component, Fragment } from 'react' import { connect } from 'react-redux' -import { Login, Account, AccountImport, AccountManage, DeveloperMode, TokenTransfer, TokenTransferFailed, TokenTransferSuccess, - AccountQRCode, AccountCreateStep1, AccountCreateStep2, AccountCreateStep3, AccountSetting, ChangePwd, - Lock, AccountAdd, ChangeLanguage, IostWallet, UserAgreement, GasManage, RamManage, WhiteList, TokenDetail, - AssetManage +import { + Login, + Account, + AccountImport, + AccountManage, + DeveloperMode, + TokenTransfer, + TokenTransferFailed, + TokenTransferSuccess, + AccountQRCode, + AccountCreateStep1, + AccountCreateStep2, + AccountCreateStep3, + AccountSetting, + ChangePwd, + Lock, + AccountAdd, + ChangeLanguage, + IostWallet, + UserAgreement, + GasManage, + RamManage, + WhiteList, + TokenDetail, + AssetManage, + NftDetail, } from 'components' import Settings from 'components/Settings' import Popup from 'components/Popup' @@ -13,7 +35,7 @@ import utils from 'utils' import user from 'utils/user' import * as accountActions from 'actions/accounts' import './App.scss' -import ui from "utils/ui"; +import ui from 'utils/ui' type Props = { children: React.DOM, @@ -34,14 +56,14 @@ class App extends Component { init = async () => { try { const enpassword = await user.getEnPassword() - if(enpassword){ + if (enpassword) { const lockState = await user.getLockState() - if(lockState === false){ + if (lockState === false) { //解锁页面 this.changeLocation('/lock') - }else { + } else { const accounts = await user.getUsers() - if (accounts.length){ + if (accounts.length) { user.setUsers(accounts) const activeAccount = await user.getActiveAccount() const account = activeAccount || accounts[0] @@ -55,14 +77,14 @@ class App extends Component { await user.setActiveAccount(account) this.changeLocation('/account') - chrome.storage.local.get(['activeAccount'], ({activeAccount}) => { + chrome.storage.local.get(['activeAccount'], ({ activeAccount }) => { // console.log('当前账号', activeAccount) }) - }else { + } else { this.changeLocation('/accountImport') } } - }else { + } else { this.changeLocation('/login') } } catch (err) { @@ -70,7 +92,7 @@ class App extends Component { } } - changeLocation = (location) => { + changeLocation = location => { this.setState({ currentLocation: location, }) @@ -127,6 +149,8 @@ class App extends Component { return case '/tokenDetail': return + case '/nftDetail': + return case '/assetManage': return } @@ -143,7 +167,7 @@ class App extends Component { } } -const mapStateToProps = (state) => ({ +const mapStateToProps = state => ({ locale: state.i18n.locale, }) diff --git a/src/actions/actionTypes.js b/src/actions/actionTypes.js index 379c3f2..ab54ecb 100644 --- a/src/actions/actionTypes.js +++ b/src/actions/actionTypes.js @@ -18,6 +18,7 @@ export const TOGGLE_OVERLAY = 'TOGGLE_OVERLAY' export const UPDATE_SAVED_TOKEN_SYMBOLS = 'UPDATE_SAVED_TOKEN_SYMBOLS' export const SELECT_TOKEN = 'SELECT_TOKEN' +export const SELECT_NFT = 'SELECT_NFT' export const SET_USER_INFO = 'SET_USER_INFO' export const RESET_USER_INFO = 'RESET_USER_INFO' diff --git a/src/actions/token.js b/src/actions/token.js index 9acd092..605e027 100644 --- a/src/actions/token.js +++ b/src/actions/token.js @@ -1,18 +1,22 @@ -import { - UPDATE_SAVED_TOKEN_SYMBOLS, - SELECT_TOKEN, -} from 'actions/actionTypes' +import { UPDATE_SAVED_TOKEN_SYMBOLS, SELECT_TOKEN, SELECT_NFT } from 'actions/actionTypes' -export const updateSavedTokenSymbols = (tokenSymbols) => ({ +export const updateSavedTokenSymbols = tokenSymbols => ({ type: UPDATE_SAVED_TOKEN_SYMBOLS, payload: { tokenSymbols, - } + }, }) -export const selectToken = (tokenSymbol) => ({ +export const selectToken = tokenSymbol => ({ type: SELECT_TOKEN, payload: { tokenSymbol: tokenSymbol, - } -}) \ No newline at end of file + }, +}) + +export const selectNft = nftId => ({ + type: SELECT_NFT, + payload: { + nftId: nftId, + }, +}) diff --git a/src/components/Button.js b/src/components/Button.js index 61bd063..091bb2b 100644 --- a/src/components/Button.js +++ b/src/components/Button.js @@ -5,12 +5,10 @@ import LoadingImage from 'components/LoadingImage' import './Button.scss' -type Props = { +type Props = {} -} - -const Button = (props) => ( - diff --git a/src/components/Button.scss b/src/components/Button.scss index c3ffcf2..e7459f5 100644 --- a/src/components/Button.scss +++ b/src/components/Button.scss @@ -1,4 +1,4 @@ -@import "colors.scss"; +@import 'colors.scss'; .Button { width: 300px; @@ -14,14 +14,15 @@ transition: background-color 300ms, color 300ms; &:hover { - background-color: rgba($brand-black2, .8); + background-color: rgba($brand-black2, 0.8); } &:focus { - background-color: rgba($brand-black2, .9); + background-color: rgba($brand-black2, 0.9); } &:disabled { - background-color: #e9e9e9; + background-color: #e9e9e9 !important; + cursor: not-allowed !important; } &.btn-account { @@ -32,7 +33,6 @@ border: 1px solid; } - &--blue { color: $brand-blue; background-color: $white; @@ -40,12 +40,12 @@ &:hover { color: $white; - background-color: rgba($brand-blue, .8); + background-color: rgba($brand-blue, 0.8); } &:focus { color: $white; - background-color: rgba($brand-blue, .6); + background-color: rgba($brand-blue, 0.6); } } } diff --git a/src/components/NftDetail/index.js b/src/components/NftDetail/index.js new file mode 100644 index 0000000..effa2a7 --- /dev/null +++ b/src/components/NftDetail/index.js @@ -0,0 +1,195 @@ +import React, { Component, Fragment } from 'react' +import { connect } from 'react-redux' +import { I18n } from 'react-redux-i18n' +import { Header } from 'components' +import { Toast, Modal, Input } from 'components/index' +import Button from 'components/Button' +import './index.scss' +import iconSrc from 'constants/icon' +import LoadingImage from 'components/LoadingImage' +import cx from 'classnames' +import ui from 'utils/ui' +import iost from 'iostJS/iost' +import token, { getTokenInfo, nftContactId } from 'utils/token' +import utils from 'utils/index' +import user from 'utils/user' +// 1000517 +type Props = {} + +class TokenDetail extends Component { + state = { + isLoading: true, + nftInfo: { + id: '', + owner: '', + name: '', + category: '', + imageUrl: '', + desc_en: '', + desc_zh: '', + }, + sendAccount: '', + sendVisible: false, + sendLoading: false, + receiver: '', + } + + componentDidMount() { + this.getNftDetail() + } + + componentWillUnmount() {} + + moveTo = location => () => { + const { changeLocation } = this.props + ui.settingLocation(location) + changeLocation(location) + } + + backTo = () => { + const { changeLocation, locationList } = this.props + ui.deleteLocation() + const currentLocation = locationList[locationList.length - 1] + changeLocation(currentLocation) + } + + getNftDetail = async () => { + const { selectedNFT } = this.props + const res = await iost.rpc.blockchain._provider + .send('post', 'getContractStorage', { + id: nftContactId, + key: `token_${selectedNFT}`, + by_longest_chain: true, + }) + .then(data => JSON.parse(data.data)) + if (res) { + let desc_en = '', + desc_zh = '' + if (res.meta) { + const meta = JSON.parse(res.meta) + if (meta && meta.length && meta[0].values) { + if (meta[0].values.en && meta[0].values.en.length) { + desc_en = meta[0].values.en.join('\n') + } + if (meta[0].values.cn && meta[0].values.cn.length) { + desc_zh = meta[0].values.cn.join('\n') + } + } + } + + this.setState({ + isLoading: false, + nftInfo: { + id: res.id, + owner: res.owner, + name: res.name, + category: res.category, + imageUrl: res.imageUrl, + desc_en: desc_en, + desc_zh: desc_zh, + }, + }) + } + } + + showSendModal = () => { + this.setState({ + sendVisible: true, + }) + } + + onCloseModal = () => { + this.setState({ + sendVisible: false, + }) + } + + sendNft = async () => { + if (this.state.sendLoading) return + const token = this.state.nftInfo.id + const account = iost.account.getID() + const activeAccount = await user.getActiveAccount() + const receiver = this.state.receiver + iost + .signAndSendNFT( + nftContactId, + 'transfer', + [token, account, receiver, '1', ''], + activeAccount.network === 'LOCALNET' ? activeAccount.chainID : null, + ) + .on('pending', () => { + this.setState({ + sendLoading: true, + }) + }) + .on('success', response => { + this.setState({ sendLoading: false }) + ui.settingTransferInfo({ ...response, isNFT: true }) + this.moveTo('/tokenTransferSuccess')() + }) + .on('failed', err => { + this.setState({ sendLoading: false }) + ui.settingTransferInfo(err) + this.moveTo('/tokenTransferFailed')() + }) + } + + handleChange = e => { + this.setState({ + [e.target.name]: e.target.value, + }) + } + + render() { + const { isLoading, nftInfo, sendVisible, sendLoading, receiver } = this.state + const lang = I18n._getLocale() + const account = iost.account.getID() + return ( + +
+ {isLoading ? ( +
+ +
+ ) : ( +
+
+
+ +
+
拥有者
+
{nftInfo.owner}
+
名字
+
{nftInfo.name}
+
种类
+
{nftInfo.category}
+
详情
+
{lang === 'zh' ? nftInfo.desc_zh : nftInfo.desc_en}
+ {nftInfo.owner === account ? ( + + ) : null} +
+
+ )} + +
+
发送
+ + +
+
+ + ) + } +} + +const mapStateToProps = state => ({ + locationList: state.ui.locationList, + selectedNFT: state.token.selectedNFT, +}) + +export default connect(mapStateToProps)(TokenDetail) diff --git a/src/components/NftDetail/index.scss b/src/components/NftDetail/index.scss new file mode 100644 index 0000000..57d7812 --- /dev/null +++ b/src/components/NftDetail/index.scss @@ -0,0 +1,105 @@ +@import 'colors.scss'; + +.NftDetail-wrapper { + display: inline-block; + background-color: $gray; + height: 540px; + padding: 0 20px; + overflow: hidden; + width: 100%; + &.loading { + text-align: center; + padding-top: 50px; + } + .logo-box { + margin-top: 10px; + .logo { + width: 100px; + height: 100px; + } + } + .content-box { + height: auto; + .title { + font-size: 13px; + line-height: 13px; + font-weight: bold; + margin-bottom: 4px; + margin-top: 15px; + } + .value { + font-size: 13px; + line-height: 13px; + margin-top: 5px; + margin-bottom: 10px; + color: #999; + } + .desc { + white-space: pre-wrap; + line-height: 1.3; + } + } + + .nft-btn-send { + width: 100%; + } + + .btn-nft-send { + margin-top: 20px; + font-size: 16px; + cursor: pointer; + border-radius: 4px; + outline: 0; + text-align: center; + transition: background-color 300ms, color 300ms; + width: 100%; + height: 40px; + line-height: 40px; + background-color: #ffffff; + color: #000000; + border: 1px solid; + text-decoration: none; + &:hover { + background-color: #000000; + color: $white; + } + } +} +.send-nft-modal-wrapper { + background-color: $white; + height: 100px; + border-radius: 4px; + .input-address { + width: 100%; + } + .content-box { + height: auto; + } + .modal-title { + margin-bottom: 10px; + font-weight: bold; + } + .send-nft-container { + width: 300px; + .btn-confirm { + margin-top: 30px; + } + } + // .delete-container { + // width: 300px; + // padding: 18px 20px 0; + // color: #333333; + // .confirmDelTip { + // font-size: 13px; + // font-weight: 300; + // } + // .btn-confirm { + // position: absolute; + // bottom: 20px; + // left: 0; + // right: 0; + // margin: 0 auto; + // width: 250px; + // } + // } +} diff --git a/src/components/TokenBalance/index.js b/src/components/TokenBalance/index.js index 9834948..c546757 100644 --- a/src/components/TokenBalance/index.js +++ b/src/components/TokenBalance/index.js @@ -10,25 +10,23 @@ import { GET_TOKEN_BALANCE_INTERVAL } from 'constants/token' import iconSrc from 'constants/icon' import utils from 'utils' -import ui from "utils/ui"; -import user from "utils/user"; -import token, { defaultAssets } from 'utils/token' - +import ui from 'utils/ui' +import user from 'utils/user' +import token, { defaultAssets, nftContactId } from 'utils/token' +import cx from 'classnames' import './index.scss' -type Props = { - -} - - +type Props = {} class Index extends Component { state = { amount: 0, assetsList: [], isLoading: true, - isError: false + isError: false, + tabIndex: 0, + nftList: [], } _isMounted = false @@ -38,10 +36,11 @@ class Index extends Component { this._isMounted = true this.getData() this.getAssets() + this.getNftList() } getData = async () => { - while(this._isMounted && !this.state.isError){ + while (this._isMounted && !this.state.isError) { await this.getResourceBalance(this.props) await utils.delay(5000) } @@ -51,8 +50,8 @@ class Index extends Component { this.getResourceBalance(nextProps) // 切换账号时,刷新资产 this.getAssets() + this.getNftList() } - componentWillUnmount() { this._isMounted = false @@ -66,7 +65,7 @@ class Index extends Component { let frozenAmount = 0 if (frozen_balances && frozen_balances.length !== 0) { - frozenAmount = frozen_balances.reduce((acc, cur) => (acc += cur.amount, acc), 0) + frozenAmount = frozen_balances.reduce((acc, cur) => ((acc += cur.amount), acc), 0) } this.setState({ @@ -76,13 +75,13 @@ class Index extends Component { }) } - getResourceBalance = (props) => { - return new Promise( async (resolve, reject) => { + getResourceBalance = props => { + return new Promise(async (resolve, reject) => { const { account } = props try { iost.changeNetwork(utils.getNetWork(account)) const { balance, frozen_balances, gas_info, ram_info } = await iost.rpc.blockchain.getAccountInfo(account.name) - const frozenAmount = frozen_balances.reduce((prev, next) => (prev += next.amount, prev), 0) + const frozenAmount = frozen_balances.reduce((prev, next) => ((prev += next.amount), prev), 0) this.setState({ amount: balance, frozenAmount, @@ -91,57 +90,99 @@ class Index extends Component { userGasInfo: { current_total: gas_info.current_total, limit: gas_info.limit, - pledged_info: gas_info.pledged_info + pledged_info: gas_info.pledged_info, }, userRamInfo: { - available: Number((ram_info.available/1024).toFixed(4)), - total: Number((ram_info.total/1024).toFixed(4)), - used: Number((ram_info.used/1024).toFixed(4)), + available: Number((ram_info.available / 1024).toFixed(4)), + total: Number((ram_info.total / 1024).toFixed(4)), + used: Number((ram_info.used / 1024).toFixed(4)), }, - ram: Number((ram_info.available/1024).toFixed(4)), - ram_used: Number((ram_info.used/1024).toFixed(4)), + ram: Number((ram_info.available / 1024).toFixed(4)), + ram_used: Number((ram_info.used / 1024).toFixed(4)), isLoading: false, }) resolve() } catch (err) { - resolve() } - }) } - - goToTokenDetail = (selectSymbol) => () => { + goToTokenDetail = selectSymbol => () => { token.selectToken(selectSymbol) this.props.moveTo('/tokenDetail')() } + goToNFTDetail = id => () => { + token.selectNft(id) + this.props.moveTo('/nftDetail')() + } getAssets = () => { - Promise.all([ - utils.getStorage('assets'), - user.getActiveAccount() - ]).then(([assetsList, account]) => { - if(assetsList){ + Promise.all([utils.getStorage('assets'), user.getActiveAccount()]).then(([assetsList, account]) => { + if (assetsList) { this.setState({ - assetsList: assetsList[`${account.name}-${account.network}`] || [] + assetsList: assetsList[`${account.name}-${account.network}`] || [], }) } }) } + getNftList = async () => { + const { account } = this.props + const accountId = account.name + const result = await iost.rpc.blockchain._provider + .send('post', 'getContractStorage', { + id: nftContactId, + key: `userdata.${accountId}`, + by_longest_chain: true, + }) + .then(data => JSON.parse(data.data)) + if (result && result.nfts.length > 0) { + const list = await Promise.all( + result.nfts.map(id => + iost.rpc.blockchain._provider + .send('post', 'getContractStorage', { + id: nftContactId, + key: `token_${id}`, + by_longest_chain: true, + }) + .then(data => JSON.parse(data.data)), + ), + ) + this.setState({ + nftList: list.map(item => ({ + id: item.id, + name: item.name, + imageUrl: item.imageUrl, + })), + }) + } + } + onTabIndexChange = index => { + this.setState({ + tabIndex: index, + }) + } render() { - const { frozenAmount, amount, gas, gas_used, userGasInfo, userRamInfo, ram, ram_used, isLoading, assetsList } = this.state + const { frozenAmount, amount, gas, gas_used, userGasInfo, userRamInfo, ram, ram_used, isLoading, assetsList, tabIndex, nftList } = this.state const { account, moveTo } = this.props - const url = account?`${account.network == 'MAINNET'?'https://www.iostabc.com': account.network == 'LOCALNET'? account.endpoint || 'http://localhost:30001':'http://54.249.186.224'}/account/${account.name}`:'#' + const url = account + ? `${ + account.network == 'MAINNET' + ? 'https://www.iostabc.com' + : account.network == 'LOCALNET' + ? account.endpoint || 'http://localhost:30001' + : 'http://54.249.186.224' + }/account/${account.name}` + : '#' return ( +
+
this.onTabIndexChange(0)}> + Tokens +
+
this.onTabIndexChange(1)}> + NFTs +
+
-
) - } } - class TokenContent extends Component { state = { isLoading: true, @@ -225,46 +282,53 @@ class TokenContent extends Component { componentWillReceiveProps(nextProps) { const { account } = this.props const { account: newAccount } = nextProps - if(`${account.name}-${account.network}` != `${newAccount.name}-${newAccount.network}`){ + if (`${account.name}-${account.network}` != `${newAccount.name}-${newAccount.network}`) { this.getTokenBalance() } } - - componentWillUnmount() { this.interval && clearInterval(this.interval) } - getTokenBalance = async () => { const { symbol } = this.props const { balance } = await iost.rpc.blockchain.getBalance(iost.account.getID(), symbol) this.setState({ isLoading: false, - balance + balance, }) } - render(){ + render() { const { balance, isLoading } = this.state const { symbol, goToTokenDetail } = this.props - return( + return (
-
- + + {symbol.toUpperCase()} -
- {isLoading ? : balance} + + {isLoading ? : balance}
) } } +class NftContent extends Component { + render() { + const { id, name, imageUrl, goToNFTDetail } = this.props + return ( +
+ {name} + {name} +
+ ) + } +} -const mapStateToProps = (state) => ({ -}) +const mapStateToProps = state => ({}) export default connect(mapStateToProps)(Index) diff --git a/src/components/TokenBalance/index.scss b/src/components/TokenBalance/index.scss index 74182cc..417c286 100644 --- a/src/components/TokenBalance/index.scss +++ b/src/components/TokenBalance/index.scss @@ -1,4 +1,4 @@ -@import "colors.scss"; +@import 'colors.scss'; .TokenBalance-box { display: inline-block; @@ -8,8 +8,7 @@ width: 100%; .logo-box { margin-top: 30px; - >img { - + > img { } .logo { width: 72px; @@ -19,8 +18,7 @@ margin: 15px 0 20px; font-size: 16px; } - .TokenBalance-number-box{ - + .TokenBalance-number-box { } .TokenBalance__amount { font-size: 22px; @@ -49,23 +47,44 @@ // text-decoration: underline; cursor: pointer; } - .TokenBalance__gas{ + .TokenBalance__gas { // text-decoration: underline; cursor: pointer; } - .TokenBalance__resources_manage{ + .TokenBalance__resources_manage { margin-top: 10px; - a{ + a { font-size: 13px; cursor: pointer; text-decoration: underline; - &:first-child{ + &:first-child { margin-right: 12px; } } } } + .tabbar-wrapper { + display: flex; + padding: 0 20px; + .tabbar-item { + flex: 1; + row-gap: 10px; + padding: 10px 0 4px; + border-bottom: 2px solid transparent; + color: #999; + font-weight: 600; + cursor: pointer; + &:first-child { + margin-right: 40px; + } + &.active { + color: #000000; + border-color: #000000; + } + } + } + .progress-wrapper { display: flex; justify-content: space-between; @@ -74,7 +93,7 @@ height: 64px; padding: 15px; cursor: pointer; - box-shadow: 0 2px 10px 0 rgba(0,0,0, 0.05); + box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.05); background-color: $white; border-radius: 4px; font-weight: 400; @@ -83,7 +102,6 @@ line-height: 14px; display: flex; justify-content: space-between; - } .ram-used { font-size: 12px; @@ -93,16 +111,16 @@ } .percent { - color: #1E64E2; + color: #1e64e2; } .progress-wrap { margin: 10px 0 5px; - background-color: #DCE6F2; + background-color: #dce6f2; border-radius: 5px; .progress-inner { border-radius: 5px; - background-color: #6598F4; + background-color: #6598f4; height: 10px; transition: width 1s; } @@ -110,16 +128,19 @@ } } - .coin-list-wrapper { overflow-y: auto; - height: 200px; + height: 170px; margin-top: 10px; + display: none; + &.active { + display: block; + } .coin-box { margin-bottom: 10px; height: 60px; padding: 10px 15px; - box-shadow: 0 2px 10px 0 rgba(0,0,0, 0.05); + box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.05); background-color: $white; border-radius: 4px; display: flex; @@ -127,6 +148,7 @@ align-items: center; font-weight: 400; .img-name { + text-decoration: none; display: flex; align-items: center; .coin-img { @@ -147,11 +169,50 @@ width: 16px; height: 16px; background-size: cover; - background-image: url("/static/images/icon-add.png"); + background-image: url('/static/images/icon-add.png'); margin-right: 5px; } } } - + .nft-list-wrapper { + overflow-y: auto; + height: 170px; + margin-top: 10px; + display: none; + &.active { + display: grid; + grid-template-columns: repeat(3, 1fr); + grid-column: 3; + grid-gap: 10px 10px; + } + .nft-empty { + grid-column-start: 1; + grid-column-end: 4; + text-align: center; + padding-top: 50px; + } + .nft-item { + cursor: pointer; + padding: 6px; + background-color: #ffffff; + font-size: 12px; + height: 140px; + display: flex; + flex-direction: column; + justify-content: space-between; + img { + width: 88px; + height: 88px; + } + span { + display: block; + max-height: 34px; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + } + } + } } - diff --git a/src/components/TokenTransfer/index.js b/src/components/TokenTransfer/index.js index 8720a39..87844d7 100644 --- a/src/components/TokenTransfer/index.js +++ b/src/components/TokenTransfer/index.js @@ -13,28 +13,26 @@ import TokenTransferSuccess from 'components/TokenTransferSuccess' import TokenTransferFailed from 'components/TokenTransferFailed' import ui from 'utils/ui' import utils from 'utils' -import user from "utils/user"; +import user from 'utils/user' import token, { defaultAssets } from 'utils/token' import LoadingImage from 'components/LoadingImage' import './index.scss' -import iconSrc from "constants/icon"; +import iconSrc from 'constants/icon' const defaultConfig = { gasRatio: 1, gasLimit: 100000, delay: 0, expiration: 90, - defaultLimit: "unlimited" + defaultLimit: 'unlimited', } -type Props = { - -} +type Props = {} class Index extends Component { - constructor(props){ + constructor(props) { super(props) this.state = { to: '', @@ -61,7 +59,7 @@ class Index extends Component { } getData = async () => { - while(this._isMounted){ + while (this._isMounted) { await this.getResourceBalance() await utils.delay(5000) } @@ -90,24 +88,25 @@ class Index extends Component { getResourceBalance = () => { return new Promise((resolve, reject) => { - iost.rpc.blockchain.getAccountInfo(iost.account.getID()) - .then(({ balance, frozen_balances, gas_info, ram_info}) => { - const frozenAmount = frozen_balances.reduce((prev, next) => (prev += next.amount, prev), 0) - this.setState({ - frozenAmount, - gas: gas_info.current_total, - ram: ram_info.available, - isLoading: false, + iost.rpc.blockchain + .getAccountInfo(iost.account.getID()) + .then(({ balance, frozen_balances, gas_info, ram_info }) => { + const frozenAmount = frozen_balances.reduce((prev, next) => ((prev += next.amount), prev), 0) + this.setState({ + frozenAmount, + gas: gas_info.current_total, + ram: ram_info.available, + isLoading: false, + }) + resolve() + }) + .catch(err => { + resolve() }) - resolve() - }) - .catch(err => { - resolve() - }) }) } - handleChange = (e) => { + handleChange = e => { this.setState({ [e.target.name]: e.target.value, errorMessage: '', @@ -128,15 +127,20 @@ class Index extends Component { // JSON.stringify([selectedTokenSymbol, accountName, to, amount, memo]), // ) // tx.setTime(defaultConfig.expiration, defaultConfig.delay, 0) - let chainId = ((iost.rpc.getProvider()._host.indexOf('//api.iost.io') < 0) && (iost.rpc.getProvider()._host.indexOf('//127.0.0.1') < 0) && (iost.rpc.getProvider()._host.indexOf('//localhost') < 0)) ? 1023 : 1024; + let chainId = + iost.rpc.getProvider()._host.indexOf('//api.iost.io') < 0 && + iost.rpc.getProvider()._host.indexOf('//127.0.0.1') < 0 && + iost.rpc.getProvider()._host.indexOf('//localhost') < 0 + ? 1023 + : 1024 if (activeAccount.network === 'LOCALNET') { chainId = activeAccount.chainID } const asset = defaultAssets.concat(assetsList).find(item => item.symbol === token) let contract = this.getAssetContract(asset) - if(chainId === 1023 && token === 'husd') { - contract = "ContractaTTuzpKVGHPUMdojrM88LG8DaWsdN7L1ncnpzQsA4aF" + if (chainId === 1023 && token === 'husd') { + contract = 'ContractaTTuzpKVGHPUMdojrM88LG8DaWsdN7L1ncnpzQsA4aF' } const tx = iost.iost.callABI(contract, 'transfer', [token, accountName, to, amount, memo]) @@ -153,14 +157,13 @@ class Index extends Component { tx.gasLimit = +iGASLimit } - // const tx = iost.iost.transfer(selectedTokenSymbol, accountName, to, amount) // 2. Sign on transfer tx // iost.account.signTx(tx) - - iost.iost.setAccount(iost.account); - + + iost.iost.setAccount(iost.account) + const handler = iost.iost.signAndSend(tx) // console.log('handler:', handler) @@ -179,18 +182,18 @@ class Index extends Component { // const handler = new iost.pack.TxHandler(tx, iost.rpc) this.setState({ isSending: true }) - handler.on('pending', (res) => { - // .onPending(async (res) => { + handler + .on('pending', res => { + // .onPending(async (res) => { let times = 90 const inverval = setInterval(async () => { - times--; - if(times){ - iost.rpc.transaction.getTxByHash(res) - .then( data => { + times-- + if (times) { + iost.rpc.transaction.getTxByHash(res).then(data => { const tx_receipt = data.transaction.tx_receipt - if(tx_receipt){ - clearInterval(inverval); - if (tx_receipt.status_code === "SUCCESS") { + if (tx_receipt) { + clearInterval(inverval) + if (tx_receipt.status_code === 'SUCCESS') { this.setState({ isSending: false }) ui.settingTransferInfo(tx_receipt) this.moveTo('/tokenTransferSuccess')() @@ -210,14 +213,14 @@ class Index extends Component { } } }) - }else { - clearInterval(inverval); + } else { + clearInterval(inverval) this.port.postMessage({ actionId, - failed: `Error: tx ${res.hash} on chain timeout.` - }); + failed: `Error: tx ${res.hash} on chain timeout.`, + }) } - },1000) + }, 1000) }) // .onSuccess(async (response) => { // // clearInterval(intervalID) @@ -228,7 +231,7 @@ class Index extends Component { // // content: // // }) // }) - .on('failed', (err) => { + .on('failed', err => { // clearInterval(intervalID) if (typeof err === 'string') { this.setState({ @@ -246,11 +249,11 @@ class Index extends Component { // }) } }) - // .send() - // .listen(1000, 60) + // .send() + // .listen(1000, 60) } - moveTo = (location) => () => { + moveTo = location => () => { const { changeLocation } = this.props changeLocation(location) } @@ -262,47 +265,41 @@ class Index extends Component { changeLocation(currentLocation) } - toggleMenu = () => { this.setState({ isShowing: !this.state.isShowing, }) } - toggleTokenList = (symbol, balance) => { this.setState({ token: symbol, balance, - isShowTokenList: false + isShowTokenList: false, }) } - toggleToken = () => { this.setState({ - isShowTokenList: !this.state.isShowTokenList + isShowTokenList: !this.state.isShowTokenList, }) } getAssets = () => { - Promise.all([ - utils.getStorage('assets'), - user.getActiveAccount() - ]).then(([assetsList, account]) => { - if(assetsList){ + Promise.all([utils.getStorage('assets'), user.getActiveAccount()]).then(([assetsList, account]) => { + if (assetsList) { this.setState({ - assetsList: assetsList[`${account.name}-${account.network}`] || [] + assetsList: assetsList[`${account.name}-${account.network}`] || [], }) } }) } getAssetContract(asset) { - if (typeof asset != "undefined" && asset.onlyIssuerCanTransfer && asset.issuer.startsWith("Contract")) { - return asset.issuer; + if (typeof asset != 'undefined' && asset.onlyIssuerCanTransfer && asset.issuer.startsWith('Contract')) { + return asset.issuer } - return 'token.iost'; + return 'token.iost' } render() { @@ -313,86 +310,48 @@ class Index extends Component {
- - - -
    - { - defaultAssets.map(item =>
  • ) - } - { - assetsList.map(item =>
  • ) - } + + + +
      + {defaultAssets.map(item => ( +
    • + +
    • + ))} + {assetsList.map(item => ( +
    • + +
    • + ))}
-
{I18n.t('Transfer_Amount')} {I18n.t('Transfer_Balance', { num: balance, token })}
- - - - - - + + + + + +
{I18n.t('Transfer_Resource')} - {iGASPrice} iGas + + {iGASPrice} iGas +
- { - isShowing && ( -
- - -
- ) - } + {isShowing && ( +
+ + +
+ )}
- {/*

{I18n.t('Transfer_Tip')}

*/} @@ -404,7 +363,6 @@ class Index extends Component { } } - class TokenContent extends Component { state = { isLoading: false, @@ -415,16 +373,15 @@ class TokenContent extends Component { this.getTokenBalance() } - getTokenBalance = async () => { const { symbol, token } = this.props this.setState({ - isLoading: true + isLoading: true, }) const { balance } = await iost.rpc.blockchain.getBalance(iost.account.getID(), symbol) this.setState({ isLoading: false, - balance + balance, }) if (symbol == token) { @@ -438,18 +395,19 @@ class TokenContent extends Component { this.props.toggleTokenList(symbol, balance) } - render(){ + render() { const { balance, isLoading } = this.state const { symbol } = this.props - return {symbol.toUpperCase()} ({isLoading ? '-' : balance}) + return ( + + {symbol.toUpperCase()} ({isLoading ? '-' : balance}) + + ) } } - - - -const mapStateToProps = (state) => ({ +const mapStateToProps = state => ({ locationList: state.ui.locationList, selectedTokenSymbol: state.token.selectedTokenSymbol, }) diff --git a/src/components/TokenTransferSuccess/index.js b/src/components/TokenTransferSuccess/index.js index d3b2d1e..cb147a3 100644 --- a/src/components/TokenTransferSuccess/index.js +++ b/src/components/TokenTransferSuccess/index.js @@ -1,34 +1,33 @@ import React, { Component, Fragment } from 'react' -import { connect } from "react-redux"; +import { connect } from 'react-redux' import { I18n } from 'react-redux-i18n' import { Header } from 'components' import Button from 'components/Button' import './index.scss' -type Props = { - -} +type Props = {} class TokenTransferSuccess extends Component { componentDidMount() { console.log(this.props.transferInfo) } - moveTo = (location) => () => { + moveTo = location => () => { const { changeLocation } = this.props changeLocation(location) } render() { const { transferInfo: tx } = this.props + const isNFT = tx.isNFT || false return ( -
+
-

{I18n.t('transferSuccess')}

+

{isNFT ? '发送成功' : I18n.t('transferSuccess')}

{I18n.t('txid')}

@@ -36,16 +35,20 @@ class TokenTransferSuccess extends Component {

{I18n.t('gasUsage')}

-

{tx.gas_usage} {I18n.t('iGAS')}

+

+ {tx.gas_usage} {I18n.t('iGAS')} +

- +
) } } -const mapStateToProps = (state) => ({ +const mapStateToProps = state => ({ transferInfo: state.ui.transferInfo, }) diff --git a/src/components/TransactionSuccess.js b/src/components/TransactionSuccess.js index 411f028..b2cf3a9 100644 --- a/src/components/TransactionSuccess.js +++ b/src/components/TransactionSuccess.js @@ -4,9 +4,7 @@ import cx from 'classnames' import './TransactionSuccess.scss' -type Props = { - -} +type Props = {} class TransactionSuccess extends Component { render() { @@ -31,13 +29,20 @@ class TransactionSuccess extends Component { )} {Object.keys(tx.ram_usage).length !== 0 && (

- {I18n.t('ramUsage')}: {Object.values(tx.ram_usage).map(a =>

{a}

)} + {I18n.t('ramUsage')}:{' '} + {Object.values(tx.ram_usage).map(a => ( +

{a}

+ ))}

)} {receipt && (
-

{I18n.t('receiptAmount')}: {receiptContent[3]}

-

{I18n.t('receiptContractFunctionName')}: {receipt.func_name}

+

+ {I18n.t('receiptAmount')}: {receiptContent[3]} +

+

+ {I18n.t('receiptContractFunctionName')}: {receipt.func_name} +

)}
diff --git a/src/components/index.js b/src/components/index.js index 7caf726..f277c8c 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -1,40 +1,42 @@ - -import Header from './Header'; -import Login from './Login'; -import Landing from './Landing'; -import Toast from './Toast'; -import Modal from './Modal'; -import LoadingImage from './LoadingImage'; -import Account from './Account'; -import AccountImport from './AccountImport'; -import AccountManage from './AccountManage'; -import DeveloperMode from './DeveloperMode'; -import TokenBalance from './TokenBalance'; -import TokenTransfer from './TokenTransfer'; -import TokenTransferFailed from './TokenTransferFailed'; -import TokenTransferSuccess from './TokenTransferSuccess'; -import AccountQRCode from './AccountQRCode'; -import AccountCreateStep1 from './AccountCreateStep1'; -import AccountCreateStep2 from './AccountCreateStep2'; -import AccountCreateStep3 from './AccountCreateStep3'; -import AccountSetting from './AccountSetting'; -import ChangePwd from './ChangePwd'; -import Lock from './Lock'; -import AccountAdd from './AccountAdd'; -import ChangeLanguage from './ChangeLanguage'; -import IostWallet from './IostWallet'; -import UserAgreement from './UserAgreement'; -import GasManage from './GasManage'; -import RamManage from './RamManage'; -import WhiteList from './WhiteList'; -import TokenDetail from './TokenDetail'; -import AssetManage from './AssetManage'; +import Header from './Header' +import Login from './Login' +import Landing from './Landing' +import Toast from './Toast' +import Input from './Input' +import Modal from './Modal' +import LoadingImage from './LoadingImage' +import Account from './Account' +import AccountImport from './AccountImport' +import AccountManage from './AccountManage' +import DeveloperMode from './DeveloperMode' +import TokenBalance from './TokenBalance' +import TokenTransfer from './TokenTransfer' +import TokenTransferFailed from './TokenTransferFailed' +import TokenTransferSuccess from './TokenTransferSuccess' +import AccountQRCode from './AccountQRCode' +import AccountCreateStep1 from './AccountCreateStep1' +import AccountCreateStep2 from './AccountCreateStep2' +import AccountCreateStep3 from './AccountCreateStep3' +import AccountSetting from './AccountSetting' +import ChangePwd from './ChangePwd' +import Lock from './Lock' +import AccountAdd from './AccountAdd' +import ChangeLanguage from './ChangeLanguage' +import IostWallet from './IostWallet' +import UserAgreement from './UserAgreement' +import GasManage from './GasManage' +import RamManage from './RamManage' +import WhiteList from './WhiteList' +import TokenDetail from './TokenDetail' +import NftDetail from './NftDetail' +import AssetManage from './AssetManage' export { Header, Login, Landing, Toast, + Input, Modal, LoadingImage, Account, @@ -61,4 +63,5 @@ export { WhiteList, TokenDetail, AssetManage, + NftDetail, } diff --git a/src/constants/i18n.js b/src/constants/i18n.js index a0a0d56..8fd9edc 100644 --- a/src/constants/i18n.js +++ b/src/constants/i18n.js @@ -1,706 +1,712 @@ const enTranslation = { - "firstLogin_SetPassword": "Set Password", - "firstLogin_RepeatPassword": "Repeat Password", - "firstLogin_CreateAccount": "Create Account", - "firstLogin_ImportAccount": "Import Account", - "firstLogin_NoAndCreate1": "No account?", - "firstLogin_NoAndCreate2": "Create at a third-party platform", - "firstLogin_AgreementTip1": "Using this plugin means accepting to", - "firstLogin_AgreementTip2": "User Agreement", - "firstLogin_AgreementTip3": "Please agree to User Agreement ", - "Password_Length": "Password can not be less than 8 digits!", - "Password_Combination": "Password combination contains at least letters and numbers!", - "Password_Different": "Password inconsistent!", - "Password_TryAgain": "Wrong password, please retry!", - - "CreateAccount_AccountName": "Set IOST account name", - "CreateAccount_Tip1": "Please enter 5-11 characters, consisting lower case letters and numbers, numbers cannot be 0.", - "CreateAccount_QueryStatus": "Available status in query", - "CreateAccount_AccountExist": "Account already exists", - "CreateAccount_NextStep": "Next Step", - "CreateAccount_ConfirmPrivate": "Confirm private key pair", - "CreateAccount_Tip2": "Pleae confirm and save the following account information, you can also click to edit.", - "CreateAccount_OwnerPublicKey": "Owner public key", - "CreateAccount_ActivePublicKey": "Active public key", - "CreateAccount_OwnerPrivateKey": "Owner private key", - "CreateAccount_ActivePrivateKey": "Active private key", - "CreateAccount_ChangePrivateKey": "Change private key pair", - "CreateAccount_ToastTip1": "Wrong private key pair", - "CreateAccount_Pay": "Pay", - "CreateAccount_Tip3": "Creating a new account on IOST network costs about 100 IOST. It will be used to purchase 0.98K iRAM to get iGAS fees.", - "CreateAccount_Tip4": "Please select payment method to pay.", - "CreateAccount_PaymentCurrency": "Payment Currency ", - "CreateAccount_PaymentAddress": "Payment Address", - "CreateAccount_CheckCreate": "Check account creation status", - "CreateAccount_ToastTip2": "Account not created yet ", - "CreateAccount_ToastTip3": "Account successfully created", - - "ImportAccount_EnterPrivate": "Fill in account private key", - "ImportAccount_EnterName": "Fill in LocalNet account name", - "ImportAccount_Submit": "Submit", - "ImportAccount_Completed": "Import Completed", - "ImportAccount_Failed": "Import failed, please try again.", - "ImportAccount_LocalNetMessage": "To import a LocalNet account, please also enter account name below:", - "ImportAccount_Tip1": "No corresponding account found", - "ImportAccount_Tip2": "Private key can not be blank", - "ImportAccount_Tip3": "No corresponding public key found ", - "Account_Transfer": "Send", - "Account_Receive": "Deposit", - "Account_Transaction": "Transaction record", - "Account_Confirmed": "Confirmed", - "Account_NotApproved": "Not approved", - "Account_Failed": "Failed", - "Account_AddToken": "Add Token", - - - "Transfer_Amount": "Transfer Amount", - "Transfer_Balance": "Balance: %{num} %{token}", - "Transfer_InputAmount": "Input Amount", - "Transfer_Payee": "Payee", - "Transfer_EnterName": "Enter valid IOST account name", - "Transfer_Note": "Memo", - "Transfer_Optional": "optional", - "Transfer_Resource": "Resource Fees", - "Transfer_Submit": "Submit", - "Transfer_Tip": "If your resources are insufficient, we will help you pledge some IOST to complete the transfer.", - "Transfer_Choose": "Choose Token", - - - "Receive_Title": "This address only accept tokens on IOST blockchain", - "Receive_Copy": "Copy payment address", - "Receive_Tip": "* Now supports xxx wallet", - "Settings_Title": "Settings", - "Settings_accountManage": "Manage Account", - "Settings_changeLanguage": "Change Language", - "Settings_changePwd": "Change Password", - "Settings_lock": "Lock now", - "Settings_whitelist": "Whitelist", - "Settings_iostWallet": "About IOST Wallet", - "Settings_assetManage": "Asset Management", - "Settings_developerMode": "Developer Mode", - - - "ManageAccount_Add": "Import", - "ManageAccount_PublicKey": "PubKey", - "ManageAccount_PrivateKey": "Private Key", - "ManageAccount_Official": "MainNet", - "ManageAccount_Local": "LocalNet", - "ManageAccount_Test": "TestNet", - "ManageAccount_Copy": "Successfully Copied", - "ManageAccount_Delete": "Do you confirm to delete?", - "ManageAccount_DeleteTip": "Please make sure to export the private key before delete your account, account can not be retrieved after deletion.", - "ManageAccount_Confirm": "Confirm", - "AccountAdd_Title": "Add Account", - "ChangeLanguage_china": "Chinese", - "ChangeLanguage_english": "English", - "ChangeLanguage_korea": "Korea", - "ChangeLanguage_japan": "Japanese", - "ChangePassword_CurrentPassword": "Enter Current Password", - "ChangePassword_Verification": "Verification completed", - "ChangePassword_NewPassword": "Set new password", - "ChangePassword_Repeat": "Repeat new password", - "ChangePassword_Wrong": "Wrong password, please retry.", - "Lock_EnterPassword": "Enter Password", - "Lock_Unlock": "Unlock Wallet", - "AboutIOST_nodeVoting": "Join voting for nodes.", - "AboutIOST_userAgreement": "User Agreement", - "AboutIOST_developerMode": "Developer Mode", - - "AssetManage_TokenName": "Token Name", - "AssetManage_Add": "Add", - "AssetManage_AddSuccess": "Token added!", - "AssetManage_AddExisted": "Token already existed", - "AssetManage_AddNotFound": "Token not found, please retry", - "AssetManage_MyAsset": "My Asset", - - "TokenDetail_Full": "Token Full Name", - "TokenDetail_Detail": "Detail", - - - "Dapp_Unlock": "Unlock Now", - "Dapp_Authorization": "Authorization Requested", - "Dapp_Tip1": "* Account authorization does not share your private key", - "Dapp_Tip2": "* Current applications are developed by third parties, please pay attention to screening", - "Dapp_Signature": "Signature Requested", - "Dapp_WhiteList": "Add to white-list", - "Dapp_Cancel": "Cancel", - "Dapp_Confirm": "Confirm", - - "RamManage_Title": "Manage iRAM resource", - "RamManage_Used": "Used", - "RamManage_Remaining": "Balance", - "RamManage_Buy": "Purchase", - "RamManage_Sell": "Sell", - "RamManage_PurchaseAmount": "Purchase Amount(KB)", - "RamManage_PurchasePrice": "Price", - "RamManage_PurchaseEnter": "Input Purchase Amount", - "RamManage_Address": "Resource Receive Address", - "RamManage_Optional": "Optional, default is your address", - "RamManage_SellAmount": "Sell Amount(KB)", - "RamManage_SellPrice": "Sell Price", - "RamManage_SellEnter": "Input Sell Amount ", - - - "GasManage_Title": "Manage iGAS resource", - "GasManage_Lock": "Locked", - "GasManage_Locked": "Locked", - "GasManage_Available": "Available", - "GasManage_Stake": "Pledge", - "GasManage_Stakeing": "抵押中", - "GasManage_UnStake": "Unpledge", - "GasManage_CanUnStake": "Available", - "GasManage_UnStakeing": "Unpledge", - "GasManage_StakeAmount": "Pledge Amount", - "GasManage_UnStakeAmount": "Unpledge Amount", - "GasManage_Balance": "Balance", - "GasManage_StakeEnter": "Input Amount", - "GasManage_StakeAddress": "Resource Receive Address", - "GasManage_UnStakeAddress": "Resource Unpledge Address", - "GasManage_Optional": "Optional, default is your address", - "GasManage_Tip": "* Unpledge resources require 3 natural days and the Unpledging amount is not available.", - "GasManage_Records": "Resource Manage Record", - "GasManage_Records_Item": "Pledge iGAS for %{name}", - - "transferResult": "Transfer Result", - "transferSuccess": "Successfully Transfered", - "transferFailed": "Transfer Failed", - "transferFailedTip": "Transfer Failure Tip", - "txid": "Tx ID", - "gasUsage": "iGAS Usage", - "transferClose": "Close", - + firstLogin_SetPassword: 'Set Password', + firstLogin_RepeatPassword: 'Repeat Password', + firstLogin_CreateAccount: 'Create Account', + firstLogin_ImportAccount: 'Import Account', + firstLogin_NoAndCreate1: 'No account?', + firstLogin_NoAndCreate2: 'Create at a third-party platform', + firstLogin_AgreementTip1: 'Using this plugin means accepting to', + firstLogin_AgreementTip2: 'User Agreement', + firstLogin_AgreementTip3: 'Please agree to User Agreement ', + Password_Length: 'Password can not be less than 8 digits!', + Password_Combination: 'Password combination contains at least letters and numbers!', + Password_Different: 'Password inconsistent!', + Password_TryAgain: 'Wrong password, please retry!', + + CreateAccount_AccountName: 'Set IOST account name', + CreateAccount_Tip1: 'Please enter 5-11 characters, consisting lower case letters and numbers, numbers cannot be 0.', + CreateAccount_QueryStatus: 'Available status in query', + CreateAccount_AccountExist: 'Account already exists', + CreateAccount_NextStep: 'Next Step', + CreateAccount_ConfirmPrivate: 'Confirm private key pair', + CreateAccount_Tip2: 'Pleae confirm and save the following account information, you can also click to edit.', + CreateAccount_OwnerPublicKey: 'Owner public key', + CreateAccount_ActivePublicKey: 'Active public key', + CreateAccount_OwnerPrivateKey: 'Owner private key', + CreateAccount_ActivePrivateKey: 'Active private key', + CreateAccount_ChangePrivateKey: 'Change private key pair', + CreateAccount_ToastTip1: 'Wrong private key pair', + CreateAccount_Pay: 'Pay', + CreateAccount_Tip3: 'Creating a new account on IOST network costs about 100 IOST. It will be used to purchase 0.98K iRAM to get iGAS fees.', + CreateAccount_Tip4: 'Please select payment method to pay.', + CreateAccount_PaymentCurrency: 'Payment Currency ', + CreateAccount_PaymentAddress: 'Payment Address', + CreateAccount_CheckCreate: 'Check account creation status', + CreateAccount_ToastTip2: 'Account not created yet ', + CreateAccount_ToastTip3: 'Account successfully created', + + ImportAccount_EnterPrivate: 'Fill in account private key', + ImportAccount_EnterName: 'Fill in LocalNet account name', + ImportAccount_Submit: 'Submit', + ImportAccount_Completed: 'Import Completed', + ImportAccount_Failed: 'Import failed, please try again.', + ImportAccount_LocalNetMessage: 'To import a LocalNet account, please also enter account name below:', + ImportAccount_Tip1: 'No corresponding account found', + ImportAccount_Tip2: 'Private key can not be blank', + ImportAccount_Tip3: 'No corresponding public key found ', + Account_Transfer: 'Send', + Account_Receive: 'Deposit', + Account_Transaction: 'Transaction record', + Account_Confirmed: 'Confirmed', + Account_NotApproved: 'Not approved', + Account_Failed: 'Failed', + Account_AddToken: 'Add Token', + + Transfer_Amount: 'Transfer Amount', + Transfer_Balance: 'Balance: %{num} %{token}', + Transfer_InputAmount: 'Input Amount', + Transfer_Payee: 'Payee', + Transfer_EnterName: 'Enter valid IOST account name', + Transfer_Note: 'Memo', + Transfer_Optional: 'optional', + Transfer_Resource: 'Resource Fees', + Transfer_Submit: 'Submit', + Transfer_Tip: 'If your resources are insufficient, we will help you pledge some IOST to complete the transfer.', + Transfer_Choose: 'Choose Token', + + Receive_Title: 'This address only accept tokens on IOST blockchain', + Receive_Copy: 'Copy payment address', + Receive_Tip: '* Now supports xxx wallet', + Settings_Title: 'Settings', + Settings_accountManage: 'Manage Account', + Settings_changeLanguage: 'Change Language', + Settings_changePwd: 'Change Password', + Settings_lock: 'Lock now', + Settings_whitelist: 'Whitelist', + Settings_iostWallet: 'About IOST Wallet', + Settings_assetManage: 'Asset Management', + Settings_developerMode: 'Developer Mode', + + ManageAccount_Add: 'Import', + ManageAccount_PublicKey: 'PubKey', + ManageAccount_PrivateKey: 'Private Key', + ManageAccount_Official: 'MainNet', + ManageAccount_Local: 'LocalNet', + ManageAccount_Test: 'TestNet', + ManageAccount_Copy: 'Successfully Copied', + ManageAccount_Delete: 'Do you confirm to delete?', + ManageAccount_DeleteTip: 'Please make sure to export the private key before delete your account, account can not be retrieved after deletion.', + ManageAccount_Confirm: 'Confirm', + AccountAdd_Title: 'Add Account', + ChangeLanguage_china: 'Chinese', + ChangeLanguage_english: 'English', + ChangeLanguage_korea: 'Korea', + ChangeLanguage_japan: 'Japanese', + ChangePassword_CurrentPassword: 'Enter Current Password', + ChangePassword_Verification: 'Verification completed', + ChangePassword_NewPassword: 'Set new password', + ChangePassword_Repeat: 'Repeat new password', + ChangePassword_Wrong: 'Wrong password, please retry.', + Lock_EnterPassword: 'Enter Password', + Lock_Unlock: 'Unlock Wallet', + AboutIOST_nodeVoting: 'Join voting for nodes.', + AboutIOST_userAgreement: 'User Agreement', + AboutIOST_developerMode: 'Developer Mode', + + AssetManage_TokenName: 'Token Name', + AssetManage_Add: 'Add', + AssetManage_AddSuccess: 'Token added!', + AssetManage_AddExisted: 'Token already existed', + AssetManage_AddNotFound: 'Token not found, please retry', + AssetManage_MyAsset: 'My Asset', + + TokenDetail_Full: 'Token Full Name', + TokenDetail_Detail: 'Detail', + + Dapp_Unlock: 'Unlock Now', + Dapp_Authorization: 'Authorization Requested', + Dapp_Tip1: '* Account authorization does not share your private key', + Dapp_Tip2: '* Current applications are developed by third parties, please pay attention to screening', + Dapp_Signature: 'Signature Requested', + Dapp_WhiteList: 'Add to white-list', + Dapp_Cancel: 'Cancel', + Dapp_Confirm: 'Confirm', + + RamManage_Title: 'Manage iRAM resource', + RamManage_Used: 'Used', + RamManage_Remaining: 'Balance', + RamManage_Buy: 'Purchase', + RamManage_Sell: 'Sell', + RamManage_PurchaseAmount: 'Purchase Amount(KB)', + RamManage_PurchasePrice: 'Price', + RamManage_PurchaseEnter: 'Input Purchase Amount', + RamManage_Address: 'Resource Receive Address', + RamManage_Optional: 'Optional, default is your address', + RamManage_SellAmount: 'Sell Amount(KB)', + RamManage_SellPrice: 'Sell Price', + RamManage_SellEnter: 'Input Sell Amount ', + + GasManage_Title: 'Manage iGAS resource', + GasManage_Lock: 'Locked', + GasManage_Locked: 'Locked', + GasManage_Available: 'Available', + GasManage_Stake: 'Pledge', + GasManage_Stakeing: '抵押中', + GasManage_UnStake: 'Unpledge', + GasManage_CanUnStake: 'Available', + GasManage_UnStakeing: 'Unpledge', + GasManage_StakeAmount: 'Pledge Amount', + GasManage_UnStakeAmount: 'Unpledge Amount', + GasManage_Balance: 'Balance', + GasManage_StakeEnter: 'Input Amount', + GasManage_StakeAddress: 'Resource Receive Address', + GasManage_UnStakeAddress: 'Resource Unpledge Address', + GasManage_Optional: 'Optional, default is your address', + GasManage_Tip: '* Unpledge resources require 3 natural days and the Unpledging amount is not available.', + GasManage_Records: 'Resource Manage Record', + GasManage_Records_Item: 'Pledge iGAS for %{name}', + + transferResult: 'Transfer Result', + transferSuccess: 'Successfully Transfered', + transferFailed: 'Transfer Failed', + transferFailedTip: 'Transfer Failure Tip', + txid: 'Tx ID', + gasUsage: 'iGAS Usage', + transferClose: 'Close', + + nft_owner: 'Owner', + nft_name: 'Name', + nft_type: 'Type', + nft_description: 'Description', + nft_send: 'Send', + nft_receiver: 'Receiver', + nft_send_success: 'Sent Successfully', + nft_no_data: 'No data found', } // "Transfer_Balance": "余额:%{num} %{token}", const zhTranslation = { - "firstLogin_SetPassword": "设置密码", - "firstLogin_RepeatPassword": "重复密码", - "firstLogin_CreateAccount": "创建账号", - "firstLogin_ImportAccount": "导入账号", - "firstLogin_NoAndCreate1": "没有账号?", - "firstLogin_NoAndCreate2": "前往第三方平台创建", - "firstLogin_AgreementTip1": "使用本插件即表示同意", - "firstLogin_AgreementTip2": "用户使用协议", - "firstLogin_AgreementTip3": "请同意用户协议", - "Password_Length": "密码长度不得小于8位!", - "Password_Combination": "密码组合至少包含字母和数字!", - "Password_Different": "2次密码不一致!", - "Password_TryAgain": "密码错误,请重试!", - - "CreateAccount_AccountName": "设置 IOST 账户名", - "CreateAccount_Tip1": "请输入5~11位字符,由小写字母和数字组成,数字不可为0。", - "CreateAccount_QueryStatus": "查询可用状态中…", - "CreateAccount_AccountExist": "账号已存在", - "CreateAccount_NextStep": "下一步", - "CreateAccount_ConfirmPrivate": "确认密钥对", - "CreateAccount_Tip2": "请确认并保存以下账户信息,您也可点击修改。", - "CreateAccount_OwnerPublicKey": "Owner public key", - "CreateAccount_ActivePublicKey": "Active public key", - "CreateAccount_OwnerPrivateKey": "Owner private key", - "CreateAccount_ActivePrivateKey": "Active private key", - "CreateAccount_ChangePrivateKey": "更换密钥对", - "CreateAccount_ToastTip1": "错误的密钥对", - "CreateAccount_Pay": "支付费用", - "CreateAccount_Tip3": "在 IOST 网络上创建一个新账户需要支付约100 IOST的费用。它将被用于购买0.98K的iRAM和抵押以获得iGAS费用。", - "CreateAccount_Tip4": "请根据选择的支付方式进行支付。", - "CreateAccount_PaymentCurrency": "支付币种", - "CreateAccount_PaymentAddress": "支付地址", - "CreateAccount_CheckCreate": "检查账户是否创建成功", - "CreateAccount_ToastTip2": "账户尚未创建成功", - "CreateAccount_ToastTip3": "账户创建成功", - - "ImportAccount_EnterPrivate": "您可填写私钥", - "ImportAccount_EnterName": "输入本地网账户名", - "ImportAccount_Submit": "提交", - "ImportAccount_Completed": "导入成功", - "ImportAccount_Failed": "导入失败,请重试", - "ImportAccount_LocalNetMessage": "若导入本地网帐户,请在下面输入帐户名:", - "ImportAccount_Tip1": "未找到对应的账户", - "ImportAccount_Tip2": "私钥不能为空", - "ImportAccount_Tip3": "未找到对应的公钥", - "Account_Transfer": "转账", - "Account_Receive": "收款", - "Account_Transaction": "交易记录", - "Account_Confirmed": "已确认", - "Account_NotApproved": "未批准", - "Account_Failed": "失败", - "Account_AddToken": "添加Token", - - "Transfer_Amount": "转账金额", - "Transfer_Balance": "余额:%{num} %{token}", - "Transfer_InputAmount": "输入金额", - "Transfer_Payee": "收款人", - "Transfer_EnterName": "输入有效的 IOST 账户名", - "Transfer_Note": "备注", - "Transfer_Optional": "选填", - "Transfer_Resource": "资源费用", - "Transfer_Submit": "提交", - "Transfer_Tip": "*如果您的资源不足,在转账时我们将替您抵押部分 IOST 以完成转账。", - "Transfer_Choose": "选择Token", - - - - "Receive_Title": "此地址只支持IOST链币种", - "Receive_Copy": "复制收款地址", - "Receive_Tip": "*目前已支持 XXX 钱包", - - "Settings_Title": "设置", - "Settings_accountManage": "账号管理", - "Settings_changeLanguage": "更改语言", - "Settings_changePwd": "修改密码", - "Settings_lock": "立即锁定", - "Settings_whitelist": "白名单", - "Settings_iostWallet": "关于IOST钱包", - "Settings_assetManage": "资产管理", - "Settings_developerMode": "开发人员模式", - - - "ManageAccount_Add": "添加", - "ManageAccount_PublicKey": "公钥", - "ManageAccount_PrivateKey": "私钥", - "ManageAccount_Official": "主网", - "ManageAccount_Test": "测试网", - "ManageAccount_Local": "本地网", - "ManageAccount_Copy": "复制成功", - "ManageAccount_Delete": "是否确认删除?", - "ManageAccount_DeleteTip": "删除账号前请确定已导出私钥,否则删除后将无法恢复账号。", - "ManageAccount_Confirm": "确认", - "AccountAdd_Title": "添加账号", - - "ChangeLanguage_china": "简体中文", - "ChangeLanguage_english": "英文", - "ChangeLanguage_korea": "韩文", - "ChangeLanguage_japan": "日文", - - "ChangePassword_CurrentPassword": "输入当前密码", - "ChangePassword_Verification": "通过验证", - "ChangePassword_NewPassword": "设置新密码(8位字符)", - "ChangePassword_Repeat": "重复新密码", - "ChangePassword_Wrong": "密码错误,请重试", - - "Lock_EnterPassword": "输入密码", - "Lock_Unlock": "解锁钱包", - - "AboutIOST_nodeVoting": "参与节点投票", - "AboutIOST_userAgreement": "用户协议", - "AboutIOST_developerMode": "开发人员模式", - - "AssetManage_TokenName": "Token名称", - "AssetManage_Add": "添加", - "AssetManage_AddSuccess": "Token添加成功!", - "AssetManage_AddExisted": "Token已存在", - "AssetManage_AddNotFound": "未找到此Token,请重试", - "AssetManage_MyAsset": "我的资产", - - "TokenDetail_Full": "Token全称", - "TokenDetail_Detail": "查看详情", - - - - - "Dapp_Unlock": "立即解锁", - "Dapp_Authorization": "请求授权", - "Dapp_Tip1": "* 账户授权并不会共享您的私钥", - "Dapp_Tip2": "* 当前应用为第三方开发,请注意甄别", - "Dapp_Signature": "请求签名", - "Dapp_WhiteList": "添加到白名单", - "Dapp_Cancel": "取消", - "Dapp_Confirm": "确认", - - - "RamManage_Title": "管理iRAM资源", - "RamManage_Used": "已使用", - "RamManage_Remaining": "剩余", - "RamManage_Buy": "购买", - "RamManage_Sell": "卖出", - "RamManage_PurchaseAmount": "购买量(KB)", - "RamManage_PurchasePrice": "购买价", - "RamManage_PurchaseEnter": "输入购买量", - "RamManage_Address": "资源收取地址", - "RamManage_Optional": "选填,默认为您的地址", - "RamManage_SellAmount": "卖出量(KB)", - "RamManage_SellPrice": "卖出价", - "RamManage_SellEnter": "输入卖出量", - - - "GasManage_Title": "管理iGAS资源", - "GasManage_Lock": "锁定", - "GasManage_Locked": "已锁定", - "GasManage_Available": "可用", - "GasManage_Stake": "抵押", - "GasManage_Stakeing": "抵押中", - "GasManage_UnStake": "赎回", - "GasManage_CanUnStake": "可赎回", - "GasManage_UnStakeing": "赎回中", - "GasManage_StakeAmount": "抵押金额", - "GasManage_UnStakeAmount": "赎回金额", - "GasManage_Balance": "余额", - "GasManage_StakeEnter": "输入金额", - "GasManage_StakeAddress": "收取资源地址", - "GasManage_UnStakeAddress": "赎回资源地址", - "GasManage_Optional": "选填,默认为您的地址", - "GasManage_Tip": "*赎回资源需要3⾃然日,赎回金额不可用。", - "GasManage_Records": "资源管理记录", - "GasManage_Records_Item": "为 %{name} 抵押 iGAS", - - "transferResult": "转账结果", - "transferSuccess": "转账成功", - "transferFailed": "转账失败", - "transferFailedTip": "转账失败提示", - "txid": "交易 ID", - "gasUsage": "iGas 用量", - "transferClose": "关闭", - + firstLogin_SetPassword: '设置密码', + firstLogin_RepeatPassword: '重复密码', + firstLogin_CreateAccount: '创建账号', + firstLogin_ImportAccount: '导入账号', + firstLogin_NoAndCreate1: '没有账号?', + firstLogin_NoAndCreate2: '前往第三方平台创建', + firstLogin_AgreementTip1: '使用本插件即表示同意', + firstLogin_AgreementTip2: '用户使用协议', + firstLogin_AgreementTip3: '请同意用户协议', + Password_Length: '密码长度不得小于8位!', + Password_Combination: '密码组合至少包含字母和数字!', + Password_Different: '2次密码不一致!', + Password_TryAgain: '密码错误,请重试!', + + CreateAccount_AccountName: '设置 IOST 账户名', + CreateAccount_Tip1: '请输入5~11位字符,由小写字母和数字组成,数字不可为0。', + CreateAccount_QueryStatus: '查询可用状态中…', + CreateAccount_AccountExist: '账号已存在', + CreateAccount_NextStep: '下一步', + CreateAccount_ConfirmPrivate: '确认密钥对', + CreateAccount_Tip2: '请确认并保存以下账户信息,您也可点击修改。', + CreateAccount_OwnerPublicKey: 'Owner public key', + CreateAccount_ActivePublicKey: 'Active public key', + CreateAccount_OwnerPrivateKey: 'Owner private key', + CreateAccount_ActivePrivateKey: 'Active private key', + CreateAccount_ChangePrivateKey: '更换密钥对', + CreateAccount_ToastTip1: '错误的密钥对', + CreateAccount_Pay: '支付费用', + CreateAccount_Tip3: '在 IOST 网络上创建一个新账户需要支付约100 IOST的费用。它将被用于购买0.98K的iRAM和抵押以获得iGAS费用。', + CreateAccount_Tip4: '请根据选择的支付方式进行支付。', + CreateAccount_PaymentCurrency: '支付币种', + CreateAccount_PaymentAddress: '支付地址', + CreateAccount_CheckCreate: '检查账户是否创建成功', + CreateAccount_ToastTip2: '账户尚未创建成功', + CreateAccount_ToastTip3: '账户创建成功', + + ImportAccount_EnterPrivate: '您可填写私钥', + ImportAccount_EnterName: '输入本地网账户名', + ImportAccount_Submit: '提交', + ImportAccount_Completed: '导入成功', + ImportAccount_Failed: '导入失败,请重试', + ImportAccount_LocalNetMessage: '若导入本地网帐户,请在下面输入帐户名:', + ImportAccount_Tip1: '未找到对应的账户', + ImportAccount_Tip2: '私钥不能为空', + ImportAccount_Tip3: '未找到对应的公钥', + Account_Transfer: '转账', + Account_Receive: '收款', + Account_Transaction: '交易记录', + Account_Confirmed: '已确认', + Account_NotApproved: '未批准', + Account_Failed: '失败', + Account_AddToken: '添加Token', + + Transfer_Amount: '转账金额', + Transfer_Balance: '余额:%{num} %{token}', + Transfer_InputAmount: '输入金额', + Transfer_Payee: '收款人', + Transfer_EnterName: '输入有效的 IOST 账户名', + Transfer_Note: '备注', + Transfer_Optional: '选填', + Transfer_Resource: '资源费用', + Transfer_Submit: '提交', + Transfer_Tip: '*如果您的资源不足,在转账时我们将替您抵押部分 IOST 以完成转账。', + Transfer_Choose: '选择Token', + + Receive_Title: '此地址只支持IOST链币种', + Receive_Copy: '复制收款地址', + Receive_Tip: '*目前已支持 XXX 钱包', + + Settings_Title: '设置', + Settings_accountManage: '账号管理', + Settings_changeLanguage: '更改语言', + Settings_changePwd: '修改密码', + Settings_lock: '立即锁定', + Settings_whitelist: '白名单', + Settings_iostWallet: '关于IOST钱包', + Settings_assetManage: '资产管理', + Settings_developerMode: '开发人员模式', + + ManageAccount_Add: '添加', + ManageAccount_PublicKey: '公钥', + ManageAccount_PrivateKey: '私钥', + ManageAccount_Official: '主网', + ManageAccount_Test: '测试网', + ManageAccount_Local: '本地网', + ManageAccount_Copy: '复制成功', + ManageAccount_Delete: '是否确认删除?', + ManageAccount_DeleteTip: '删除账号前请确定已导出私钥,否则删除后将无法恢复账号。', + ManageAccount_Confirm: '确认', + AccountAdd_Title: '添加账号', + + ChangeLanguage_china: '简体中文', + ChangeLanguage_english: '英文', + ChangeLanguage_korea: '韩文', + ChangeLanguage_japan: '日文', + + ChangePassword_CurrentPassword: '输入当前密码', + ChangePassword_Verification: '通过验证', + ChangePassword_NewPassword: '设置新密码(8位字符)', + ChangePassword_Repeat: '重复新密码', + ChangePassword_Wrong: '密码错误,请重试', + + Lock_EnterPassword: '输入密码', + Lock_Unlock: '解锁钱包', + + AboutIOST_nodeVoting: '参与节点投票', + AboutIOST_userAgreement: '用户协议', + AboutIOST_developerMode: '开发人员模式', + + AssetManage_TokenName: 'Token名称', + AssetManage_Add: '添加', + AssetManage_AddSuccess: 'Token添加成功!', + AssetManage_AddExisted: 'Token已存在', + AssetManage_AddNotFound: '未找到此Token,请重试', + AssetManage_MyAsset: '我的资产', + + TokenDetail_Full: 'Token全称', + TokenDetail_Detail: '查看详情', + + Dapp_Unlock: '立即解锁', + Dapp_Authorization: '请求授权', + Dapp_Tip1: '* 账户授权并不会共享您的私钥', + Dapp_Tip2: '* 当前应用为第三方开发,请注意甄别', + Dapp_Signature: '请求签名', + Dapp_WhiteList: '添加到白名单', + Dapp_Cancel: '取消', + Dapp_Confirm: '确认', + + RamManage_Title: '管理iRAM资源', + RamManage_Used: '已使用', + RamManage_Remaining: '剩余', + RamManage_Buy: '购买', + RamManage_Sell: '卖出', + RamManage_PurchaseAmount: '购买量(KB)', + RamManage_PurchasePrice: '购买价', + RamManage_PurchaseEnter: '输入购买量', + RamManage_Address: '资源收取地址', + RamManage_Optional: '选填,默认为您的地址', + RamManage_SellAmount: '卖出量(KB)', + RamManage_SellPrice: '卖出价', + RamManage_SellEnter: '输入卖出量', + + GasManage_Title: '管理iGAS资源', + GasManage_Lock: '锁定', + GasManage_Locked: '已锁定', + GasManage_Available: '可用', + GasManage_Stake: '抵押', + GasManage_Stakeing: '抵押中', + GasManage_UnStake: '赎回', + GasManage_CanUnStake: '可赎回', + GasManage_UnStakeing: '赎回中', + GasManage_StakeAmount: '抵押金额', + GasManage_UnStakeAmount: '赎回金额', + GasManage_Balance: '余额', + GasManage_StakeEnter: '输入金额', + GasManage_StakeAddress: '收取资源地址', + GasManage_UnStakeAddress: '赎回资源地址', + GasManage_Optional: '选填,默认为您的地址', + GasManage_Tip: '*赎回资源需要3⾃然日,赎回金额不可用。', + GasManage_Records: '资源管理记录', + GasManage_Records_Item: '为 %{name} 抵押 iGAS', + + transferResult: '转账结果', + transferSuccess: '转账成功', + transferFailed: '转账失败', + transferFailedTip: '转账失败提示', + txid: '交易 ID', + gasUsage: 'iGas 用量', + transferClose: '关闭', + + nft_owner: '拥有者', + nft_name: '名字', + nft_type: '种类', + nft_description: '详情', + nft_send: '发送', + nft_receiver: '接收人', + nft_send_success: '发送成功', + nft_no_data: '暂无数据', } - - const koTranslation = { - "firstLogin_SetPassword": "암호를 설정하세요", - "firstLogin_RepeatPassword": "암호를 다시 입력하세요", - "firstLogin_CreateAccount": "계정 만들기", - "firstLogin_ImportAccount": "계정 가져 오기", - "firstLogin_NoAndCreate1": "계정이 없습니까?", - "firstLogin_NoAndCreate2": "타사 플랫폼에서 생성", - "firstLogin_AgreementTip1": "이 플러그인을 사용한다는 것은 약관에 동의 함을 의미합니다.", - "firstLogin_AgreementTip2": "사용자 동의서", - "firstLogin_AgreementTip3": "사용자 동의서에 동의하십시오.", - "Password_Length": "비밀번호는 8자리보다 짧을 수 없습니다", - "Password_Combination": "비밀번호는 숫자와 문자의 조합으로 만들어져야 됩니다", - "Password_Different": "비밀번호가 불일치 합니다", - "Password_TryAgain": "비밀번호가 틀렸습니다. 다시 시도해 주세요", - - "CreateAccount_AccountName": "IOST 계정 이름 설정", - "CreateAccount_Tip1": "소문자와 숫자로 구성된 5-11자를 입력하십시오. 숫자는 0 일 수 없습니다.", - "CreateAccount_QueryStatus": "쿼리에서 사용 가능한 상태", - "CreateAccount_AccountExist": "계정이 이미 있습니다", - "CreateAccount_NextStep": "다음 단계", - "CreateAccount_ConfirmPrivate": "개인 키 쌍 확인", - "CreateAccount_Tip2": "다음 계정 정보를 확인하고 저장해 주세요. 편집을 원하시는 경우 클릭하시면 됩니다. ", - "CreateAccount_OwnerPublicKey": "소유자 퍼블릭 키", - "CreateAccount_ActivePublicKey": "활성 퍼블릭 키", - "CreateAccount_OwnerPrivateKey": "소유자 프라이빗 키", - "CreateAccount_ActivePrivateKey": "활성 프라이빗 키", - "CreateAccount_ChangePrivateKey": "프라이빗 키 쌍 변경", - "CreateAccount_ToastTip1": "잘못된 프라이빗 키 쌍", - "CreateAccount_Pay": "지불", - "CreateAccount_Tip3": "IOST 네트워크에서 새 계정을 만드는 데는 약 100 IOST가 소요됩니다. 그것은 iGAS 요금을 얻기 위해 0.98K iRAM을 구입하는 데 사용됩니다.", - "CreateAccount_Tip4": "결제 방법을 선택하십시오.", - "CreateAccount_PaymentCurrency": "지불 통화", - "CreateAccount_PaymentAddress": "지불 주소", - "CreateAccount_CheckCreate": "계정 생성 상태 확인", - "CreateAccount_ToastTip2": "아직 계정이 생성되지 않았습니다.", - "CreateAccount_ToastTip3": "账户创建成功", - - "ImportAccount_EnterPrivate": "정식 / 테스트 계정 프라이빗 키 채우기", - "ImportAccount_EnterName": "로컬 네트워크 계정 이름을 적어주세요.", - "ImportAccount_Submit": "제출", - "ImportAccount_Completed": "가져오기 완료", - "ImportAccount_Failed": "가져오기에 실패했습니다. 다시 시도하십시오.", - "ImportAccount_LocalNetMessage": "로컬 네트워크에 로그인 할 계정 이름을 적어주세요:", - "ImportAccount_Tip1": "해당하는 계정정보가 없습니다", - "ImportAccount_Tip2": "프라이빗 키는 빈칸일 수 없습니다", - "ImportAccount_Tip3": "해당하는 퍼블릭 키 정보가 없습니다. ", - "Account_Transfer": "트랜스퍼", - "Account_Receive": "지불 받기", - "Account_Transaction": "거래 기록", - "Account_Confirmed": "확인", - "Account_NotApproved": "승인이 거절 됨", - "Account_Failed": "실패했습니다", - "Account_AddToken": "Add Token", - - - "Transfer_Amount": "트랜스퍼 수량", - "Transfer_Balance": "밸런스: %{num} %{token}", - "Transfer_InputAmount": "인풋 수량", - "Transfer_Payee": "수취인", - "Transfer_EnterName": "유효한 IOST 계정 이름을 입력하십시오.", - "Transfer_Note": "노트", - "Transfer_Optional": "옵셔널", - "Transfer_Resource": "리소스 비용", - "Transfer_Submit": "제출하기", - "Transfer_Tip": "귀하의 리소스가 충분하지 않은 경우 일부 IOST가 송금을 완료 할 것을 약속해드립니다.", - "Transfer_Choose": "Choose Token", - - - - "Receive_Title": "This address only accept tokens on IOST blockchain", - "Receive_Copy": "지불주소 복사", - "Receive_Tip": "* 이제 xxx 지갑을 지원합니다.", - "Settings_Title": "설정", - "Settings_accountManage": "계정 관리", - "Settings_changeLanguage": "언어 변경", - "Settings_changePwd": "비밀번호 변경", - "Settings_lock": "지금 잠구기", - "Settings_whitelist": "화이트리스트", - "Settings_iostWallet": "IOST 지갑 정보", - "Settings_assetManage": "Asset Management", - "Settings_developerMode": "개발자 모드", - - - "ManageAccount_Add": "추가", - "ManageAccount_PublicKey": "퍼블릭 키", - "ManageAccount_PrivateKey": "프라이빗 키", - "ManageAccount_Official": "정식", - "ManageAccount_Test": "테스트", - "ManageAccount_Local": "로컬", - "ManageAccount_Copy": "성공적으로 복사 됨", - "ManageAccount_Delete": "삭제에 동의 하시겠습니까?", - "ManageAccount_DeleteTip": "계정을 삭제하기 전에 프라이빗 키를 반드시 내 보내야합니다. 계정은 삭제 후에는 검색 할 수 없습니다.", - "ManageAccount_Confirm": "확인", - "AccountAdd_Title": "계정 추가", - "ChangeLanguage_china": "중국어 간체", - "ChangeLanguage_english": "영어", - "ChangeLanguage_korea": "한국어", - "ChangeLanguage_japan": "일본어", - "ChangePassword_CurrentPassword": "현재 비밀번호 입력", - "ChangePassword_Verification": "확인 완료", - "ChangePassword_NewPassword": "새 암호 설정", - "ChangePassword_Repeat": "새 암호 다시 쓰기", - "ChangePassword_Wrong": "잘못된 암호입니다. 다시 시도하십시오.", - "Lock_EnterPassword": "암호를 입력", - "Lock_Unlock": "지갑 잠금해제", - "AboutIOST_nodeVoting": "노드 투표에 참여하십시오.", - "AboutIOST_userAgreement": "사용자 동의서", - "AboutIOST_developerMode": "개발자 모드", - - - "AssetManage_TokenName": "Token Name", - "AssetManage_Add": "Add", - "AssetManage_AddSuccess": "Token added!", - "AssetManage_AddExisted": "Token already existed", - "AssetManage_AddNotFound": "Token not found, please retry", - "AssetManage_MyAsset": "My Asset", - - "TokenDetail_Full": "Token Full Name", - "TokenDetail_Detail": "Detail", - - "Dapp_Unlock": "지금 잠금해제하기", - "Dapp_Authorization": "승인 요청 됨", - "Dapp_Tip1": "* 계정 인증은 프라이빗 키를 공유하지 않습니다.", - "Dapp_Tip2": "* 현재 응용 프로그램은 제 3 자에 의해 개발되었습니다. 스크리닝에 주의해 주세요.", - "Dapp_Signature": "서명 요청", - "Dapp_WhiteList": "화이트리스트에 추가", - "Dapp_Cancel": "취소", - "Dapp_Confirm": "확인", - - - "RamManage_Title": "iRAM 리소스를 조정하세요", - "RamManage_Used": "사용중", - "RamManage_Remaining": "사용가능", - "RamManage_Buy": "구매하기", - "RamManage_Sell": "판매하기", - "RamManage_PurchaseAmount": "판매 수량(KB)", - "RamManage_PurchasePrice": "판매 가격", - "RamManage_PurchaseEnter": "구매수량을 적으세요", - "RamManage_Address": "리소스 송금받는 주소", - "RamManage_Optional": "선택사항, 기본값은 당신의 주소입니다", - "RamManage_SellAmount": "판매 수량(KB)", - "RamManage_SellPrice": "판매 금액", - "RamManage_SellEnter": "판매 수량을 적으세요", - - - "GasManage_Title": "iGAS 리소스를 조정하세요", - "GasManage_Lock": "locked", - "GasManage_Locked": "Locked", - "GasManage_Available": "사용가능", - "GasManage_Stake": "스테이킹", - "GasManage_Stakeing": "抵押中", - "GasManage_UnStake": "환불", - "GasManage_CanUnStake": "리펀드 가능수량", - "GasManage_UnStakeing": "환불", - "GasManage_StakeAmount": "스테이킹 수량", - "GasManage_UnStakeAmount": "리펀드 수량", - "GasManage_Balance": "밸런스", - "GasManage_StakeEnter": "인풋 수량", - "GasManage_StakeAddress": "리소스 송금받는 주소", - "GasManage_UnStakeAddress": "리소스 리펀드 주소", - "GasManage_Optional": "선택사항, 기본값은 당신의 주소입니다", - "GasManage_Tip": "* 보너스 신청은 3 일간의 자연수가 필요하며 보너스 신청 금액은 없습니다.", - "GasManage_Records": "리소스 관리 기록", - "GasManage_Records_Item": "iGAS를 %{name}를 위해서 스테이킹하기", - - "transferResult": "결과 전송", - "transferSuccess": "성공적인 전송", - "transferFailed": "전송 실패", - "transferFailedTip": "전송 실패 프롬프트", - "txid": "거래 ID", - "gasUsage": "iGas 소비", - "transferClose": "닫기", - + firstLogin_SetPassword: '암호를 설정하세요', + firstLogin_RepeatPassword: '암호를 다시 입력하세요', + firstLogin_CreateAccount: '계정 만들기', + firstLogin_ImportAccount: '계정 가져 오기', + firstLogin_NoAndCreate1: '계정이 없습니까?', + firstLogin_NoAndCreate2: '타사 플랫폼에서 생성', + firstLogin_AgreementTip1: '이 플러그인을 사용한다는 것은 약관에 동의 함을 의미합니다.', + firstLogin_AgreementTip2: '사용자 동의서', + firstLogin_AgreementTip3: '사용자 동의서에 동의하십시오.', + Password_Length: '비밀번호는 8자리보다 짧을 수 없습니다', + Password_Combination: '비밀번호는 숫자와 문자의 조합으로 만들어져야 됩니다', + Password_Different: '비밀번호가 불일치 합니다', + Password_TryAgain: '비밀번호가 틀렸습니다. 다시 시도해 주세요', + + CreateAccount_AccountName: 'IOST 계정 이름 설정', + CreateAccount_Tip1: '소문자와 숫자로 구성된 5-11자를 입력하십시오. 숫자는 0 일 수 없습니다.', + CreateAccount_QueryStatus: '쿼리에서 사용 가능한 상태', + CreateAccount_AccountExist: '계정이 이미 있습니다', + CreateAccount_NextStep: '다음 단계', + CreateAccount_ConfirmPrivate: '개인 키 쌍 확인', + CreateAccount_Tip2: '다음 계정 정보를 확인하고 저장해 주세요. 편집을 원하시는 경우 클릭하시면 됩니다. ', + CreateAccount_OwnerPublicKey: '소유자 퍼블릭 키', + CreateAccount_ActivePublicKey: '활성 퍼블릭 키', + CreateAccount_OwnerPrivateKey: '소유자 프라이빗 키', + CreateAccount_ActivePrivateKey: '활성 프라이빗 키', + CreateAccount_ChangePrivateKey: '프라이빗 키 쌍 변경', + CreateAccount_ToastTip1: '잘못된 프라이빗 키 쌍', + CreateAccount_Pay: '지불', + CreateAccount_Tip3: + 'IOST 네트워크에서 새 계정을 만드는 데는 약 100 IOST가 소요됩니다. 그것은 iGAS 요금을 얻기 위해 0.98K iRAM을 구입하는 데 사용됩니다.', + CreateAccount_Tip4: '결제 방법을 선택하십시오.', + CreateAccount_PaymentCurrency: '지불 통화', + CreateAccount_PaymentAddress: '지불 주소', + CreateAccount_CheckCreate: '계정 생성 상태 확인', + CreateAccount_ToastTip2: '아직 계정이 생성되지 않았습니다.', + CreateAccount_ToastTip3: '账户创建成功', + + ImportAccount_EnterPrivate: '정식 / 테스트 계정 프라이빗 키 채우기', + ImportAccount_EnterName: '로컬 네트워크 계정 이름을 적어주세요.', + ImportAccount_Submit: '제출', + ImportAccount_Completed: '가져오기 완료', + ImportAccount_Failed: '가져오기에 실패했습니다. 다시 시도하십시오.', + ImportAccount_LocalNetMessage: '로컬 네트워크에 로그인 할 계정 이름을 적어주세요:', + ImportAccount_Tip1: '해당하는 계정정보가 없습니다', + ImportAccount_Tip2: '프라이빗 키는 빈칸일 수 없습니다', + ImportAccount_Tip3: '해당하는 퍼블릭 키 정보가 없습니다. ', + Account_Transfer: '트랜스퍼', + Account_Receive: '지불 받기', + Account_Transaction: '거래 기록', + Account_Confirmed: '확인', + Account_NotApproved: '승인이 거절 됨', + Account_Failed: '실패했습니다', + Account_AddToken: 'Add Token', + + Transfer_Amount: '트랜스퍼 수량', + Transfer_Balance: '밸런스: %{num} %{token}', + Transfer_InputAmount: '인풋 수량', + Transfer_Payee: '수취인', + Transfer_EnterName: '유효한 IOST 계정 이름을 입력하십시오.', + Transfer_Note: '노트', + Transfer_Optional: '옵셔널', + Transfer_Resource: '리소스 비용', + Transfer_Submit: '제출하기', + Transfer_Tip: '귀하의 리소스가 충분하지 않은 경우 일부 IOST가 송금을 완료 할 것을 약속해드립니다.', + Transfer_Choose: 'Choose Token', + + Receive_Title: 'This address only accept tokens on IOST blockchain', + Receive_Copy: '지불주소 복사', + Receive_Tip: '* 이제 xxx 지갑을 지원합니다.', + Settings_Title: '설정', + Settings_accountManage: '계정 관리', + Settings_changeLanguage: '언어 변경', + Settings_changePwd: '비밀번호 변경', + Settings_lock: '지금 잠구기', + Settings_whitelist: '화이트리스트', + Settings_iostWallet: 'IOST 지갑 정보', + Settings_assetManage: 'Asset Management', + Settings_developerMode: '개발자 모드', + + ManageAccount_Add: '추가', + ManageAccount_PublicKey: '퍼블릭 키', + ManageAccount_PrivateKey: '프라이빗 키', + ManageAccount_Official: '정식', + ManageAccount_Test: '테스트', + ManageAccount_Local: '로컬', + ManageAccount_Copy: '성공적으로 복사 됨', + ManageAccount_Delete: '삭제에 동의 하시겠습니까?', + ManageAccount_DeleteTip: '계정을 삭제하기 전에 프라이빗 키를 반드시 내 보내야합니다. 계정은 삭제 후에는 검색 할 수 없습니다.', + ManageAccount_Confirm: '확인', + AccountAdd_Title: '계정 추가', + ChangeLanguage_china: '중국어 간체', + ChangeLanguage_english: '영어', + ChangeLanguage_korea: '한국어', + ChangeLanguage_japan: '일본어', + ChangePassword_CurrentPassword: '현재 비밀번호 입력', + ChangePassword_Verification: '확인 완료', + ChangePassword_NewPassword: '새 암호 설정', + ChangePassword_Repeat: '새 암호 다시 쓰기', + ChangePassword_Wrong: '잘못된 암호입니다. 다시 시도하십시오.', + Lock_EnterPassword: '암호를 입력', + Lock_Unlock: '지갑 잠금해제', + AboutIOST_nodeVoting: '노드 투표에 참여하십시오.', + AboutIOST_userAgreement: '사용자 동의서', + AboutIOST_developerMode: '개발자 모드', + + AssetManage_TokenName: 'Token Name', + AssetManage_Add: 'Add', + AssetManage_AddSuccess: 'Token added!', + AssetManage_AddExisted: 'Token already existed', + AssetManage_AddNotFound: 'Token not found, please retry', + AssetManage_MyAsset: 'My Asset', + + TokenDetail_Full: 'Token Full Name', + TokenDetail_Detail: 'Detail', + + Dapp_Unlock: '지금 잠금해제하기', + Dapp_Authorization: '승인 요청 됨', + Dapp_Tip1: '* 계정 인증은 프라이빗 키를 공유하지 않습니다.', + Dapp_Tip2: '* 현재 응용 프로그램은 제 3 자에 의해 개발되었습니다. 스크리닝에 주의해 주세요.', + Dapp_Signature: '서명 요청', + Dapp_WhiteList: '화이트리스트에 추가', + Dapp_Cancel: '취소', + Dapp_Confirm: '확인', + + RamManage_Title: 'iRAM 리소스를 조정하세요', + RamManage_Used: '사용중', + RamManage_Remaining: '사용가능', + RamManage_Buy: '구매하기', + RamManage_Sell: '판매하기', + RamManage_PurchaseAmount: '판매 수량(KB)', + RamManage_PurchasePrice: '판매 가격', + RamManage_PurchaseEnter: '구매수량을 적으세요', + RamManage_Address: '리소스 송금받는 주소', + RamManage_Optional: '선택사항, 기본값은 당신의 주소입니다', + RamManage_SellAmount: '판매 수량(KB)', + RamManage_SellPrice: '판매 금액', + RamManage_SellEnter: '판매 수량을 적으세요', + + GasManage_Title: 'iGAS 리소스를 조정하세요', + GasManage_Lock: 'locked', + GasManage_Locked: 'Locked', + GasManage_Available: '사용가능', + GasManage_Stake: '스테이킹', + GasManage_Stakeing: '抵押中', + GasManage_UnStake: '환불', + GasManage_CanUnStake: '리펀드 가능수량', + GasManage_UnStakeing: '환불', + GasManage_StakeAmount: '스테이킹 수량', + GasManage_UnStakeAmount: '리펀드 수량', + GasManage_Balance: '밸런스', + GasManage_StakeEnter: '인풋 수량', + GasManage_StakeAddress: '리소스 송금받는 주소', + GasManage_UnStakeAddress: '리소스 리펀드 주소', + GasManage_Optional: '선택사항, 기본값은 당신의 주소입니다', + GasManage_Tip: '* 보너스 신청은 3 일간의 자연수가 필요하며 보너스 신청 금액은 없습니다.', + GasManage_Records: '리소스 관리 기록', + GasManage_Records_Item: 'iGAS를 %{name}를 위해서 스테이킹하기', + + transferResult: '결과 전송', + transferSuccess: '성공적인 전송', + transferFailed: '전송 실패', + transferFailedTip: '전송 실패 프롬프트', + txid: '거래 ID', + gasUsage: 'iGas 소비', + transferClose: '닫기', + + nft_owner: '소유자', + nft_name: '이름', + nft_type: '유형', + nft_description: '설명', + nft_send: '출금', + nft_receiver: '입금', + nft_send_success: '성공적으로 전송 되었습니다', + nft_no_data: '찾을 수 있는 데이터가 없습니다', } const jaTranslation = { - "firstLogin_SetPassword": "ウォレット用パスワードを入力してください", - "firstLogin_RepeatPassword": "パスワードを再入力してください", - "firstLogin_CreateAccount": "アカウントを作る", - "firstLogin_ImportAccount": "秘密鍵をインポートする", - "firstLogin_NoAndCreate1": "アカウントを持っていませんか?", - "firstLogin_NoAndCreate2": "サードパーティ製です(IOST公式ではありません)", - "firstLogin_AgreementTip1": "このウォレットを利用することは", - "firstLogin_AgreementTip2": "利用規約に同意したとみなされます", - "firstLogin_AgreementTip3": "利用規約に同意してください", - "Password_Length": "パスワードは8文字以上にしてください!", - "Password_Combination": "パスワードは少なくとも英字と数字を含んでください!", - "Password_Different": "パスワードが合致しません!", - "Password_TryAgain": "不正なパスワードです、再入力してください!", - - "CreateAccount_AccountName": "IOSTアカウント名を入力してください", - "CreateAccount_Tip1": "小文字英字と数字から構成される5-11文字で入力してください", - "CreateAccount_QueryStatus": "アカウントの文字列が不適切です", - "CreateAccount_AccountExist": "同じアカウント名が既に存在します", - "CreateAccount_NextStep": "次の手順", - "CreateAccount_ConfirmPrivate": "秘密鍵のペアを確定させる", - "CreateAccount_Tip2": "アカウントに関する情報を確定させてください。クリックして編集できます。", - "CreateAccount_OwnerPublicKey": "所有者の公開鍵", - "CreateAccount_ActivePublicKey": "アクティブな公開鍵", - "CreateAccount_OwnerPrivateKey": "所有者の秘密鍵", - "CreateAccount_ActivePrivateKey": "アクティブな秘密鍵", - "CreateAccount_ChangePrivateKey": "秘密鍵ペアの変更", - "CreateAccount_ToastTip1": "秘密鍵が間違っています", - "CreateAccount_Pay": "支払う", - "CreateAccount_Tip3": "新しいIOSTアカウント作成のためには100IOSTのコストが必要です(0.98KBのiRAM購入費用とiGAS費用)", - "CreateAccount_Tip4": "支払方法を選んでください", - "CreateAccount_PaymentCurrency": "支払い通貨", - "CreateAccount_PaymentAddress": "支払いアドレス", - "CreateAccount_CheckCreate": "アカウント作成状況を確認", - "CreateAccount_ToastTip2": "アカウントはまだ出来ていません", - "CreateAccount_ToastTip3": "アカウントはの作成に成功しました", - - "ImportAccount_EnterPrivate": "アカウントの秘密鍵を入力", - "ImportAccount_EnterName": "ローカルのアカウント名を入力", - "ImportAccount_Submit": "送信", - "ImportAccount_Completed": "インポート完了", - "ImportAccount_Failed": "インポート失敗、もう一度お試しください", - "ImportAccount_LocalNetMessage": "ローカルアカウントのインポートのために、アカウント名を入力してください", - "ImportAccount_Tip1": "該当アカウントがありません", - "ImportAccount_Tip2": "秘密鍵は空欄にできません", - "ImportAccount_Tip3": "該当する公開鍵がありません", - "Account_Transfer": "送信", - "Account_Receive": "デポジット", - "Account_Transaction": "トランザクションの記録", - "Account_Confirmed": "完了", - "Account_NotApproved": "非承認", - "Account_Failed": "失敗", - "Account_AddToken": "トークン追加", - - - "Transfer_Amount": "送金量", - "Transfer_Balance": "残高: %{num} %{token}", - "Transfer_InputAmount": "入力アカウント", - "Transfer_Payee": "手数料", - "Transfer_EnterName": "有効なIOSTアカウントを入力してください", - "Transfer_Note": "メモ", - "Transfer_Optional": "オプション", - "Transfer_Resource": "リソース料金", - "Transfer_Submit": "送信", - "Transfer_Tip": "もし、リソースが足りない場合は、IOSTの一部をデポジットして転送を完了させるようサポートします", - "Transfer_Choose": "トークン選択", - - - "Receive_Title": "このアドレスは、IOSTブロックチェーン上のトークンのみを受け付けます", - "Receive_Copy": "支払いアドレスをコピー", - "Receive_Tip": "* 今は xxx ウォレットをサポートしています", - "Settings_Title": "設定", - "Settings_accountManage": "アカウント管理", - "Settings_changeLanguage": "言語変更", - "Settings_changePwd": "パスワード変更", - "Settings_lock": "ウォレットをロック", - "Settings_whitelist": "ホワイトリスト", - "Settings_iostWallet": "iWalletについて", - "Settings_assetManage": "資産管理", - "Settings_developerMode": "開発者モード", - - - "ManageAccount_Add": "インポート", - "ManageAccount_PublicKey": "公開鍵", - "ManageAccount_PrivateKey": "秘密鍵", - "ManageAccount_Official": "メインネット", - "ManageAccount_Local": "ローカルネット", - "ManageAccount_Test": "テストネット", - "ManageAccount_Copy": "コピー成功", - "ManageAccount_Delete": "削除してよろしいですか?", - "ManageAccount_DeleteTip": "アカウントを削除する前に、必ず秘密鍵がバックアップされていることを確認してください", - "ManageAccount_Confirm": "確定", - "AccountAdd_Title": "アカウント追加", - "ChangeLanguage_china": "中国語", - "ChangeLanguage_english": "英語", - "ChangeLanguage_korea": "韓国語", - "ChangeLanguage_japan": "日本語", - "ChangePassword_CurrentPassword": "現在のパスワードを入力", - "ChangePassword_Verification": "認証完了", - "ChangePassword_NewPassword": "新しいパスワードを入力", - "ChangePassword_Repeat": "再入力", - "ChangePassword_Wrong": "パスワードが間違っています、再入力してください", - "Lock_EnterPassword": "パスワード入力", - "Lock_Unlock": "ウォレットロック解除", - "AboutIOST_nodeVoting": "ノード投票に参加", - "AboutIOST_userAgreement": "利用規約", - "AboutIOST_developerMode": "開発者モード", - - "AssetManage_TokenName": "トークン名", - "AssetManage_Add": "追加", - "AssetManage_AddSuccess": "追加しました!", - "AssetManage_AddExisted": "既に存在しています", - "AssetManage_AddNotFound": "トークンが見つかりません", - "AssetManage_MyAsset": "自己資産", - - "TokenDetail_Full": "トークン正式名称", - "TokenDetail_Detail": "詳細", - - - "Dapp_Unlock": "解除しました", - "Dapp_Authorization": "承認が必要です", - "Dapp_Tip1": "* アカウント認証では秘密鍵は共有されません", - "Dapp_Tip2": "* 現在利用しているアプリケーションは、第三者が開発したものです、ご注意ください", - "Dapp_Signature": "署名が要求されました", - "Dapp_WhiteList": "ホワイトリストに追加", - "Dapp_Cancel": "キャンセル", - "Dapp_Confirm": "確定", - - "RamManage_Title": "iRAMリソース管理", - "RamManage_Used": "使用中", - "RamManage_Remaining": "残高", - "RamManage_Buy": "購入", - "RamManage_Sell": "売却", - "RamManage_PurchaseAmount": "購入数量(KB)", - "RamManage_PurchasePrice": "購入価格", - "RamManage_PurchaseEnter": "購入数量を入力", - "RamManage_Address": "リソース受取アドレス", - "RamManage_Optional": "オプション、通常は自分のアドレス", - "RamManage_SellAmount": "売却数量(KB)", - "RamManage_SellPrice": "売却価格", - "RamManage_SellEnter": "売却数量を入力", - - - "GasManage_Title": "iGASリソース管理", - "GasManage_Lock": "ロック中", - "GasManage_Locked": "ロック中", - "GasManage_Available": "利用可能", - "GasManage_Stake": "補充", - "GasManage_Stakeing": "補充中", - "GasManage_UnStake": "補充解除", - "GasManage_CanUnStake": "利用可能", - "GasManage_UnStakeing": "補充解除", - "GasManage_StakeAmount": "補充量", - "GasManage_UnStakeAmount": "補充解除量", - "GasManage_Balance": "残高", - "GasManage_StakeEnter": "数量入力", - "GasManage_StakeAddress": "リソース受領アドレス", - "GasManage_UnStakeAddress": "リソース補充解除アドレス", - "GasManage_Optional": "オプション、通常は自分のアドレス", - "GasManage_Tip": "* 補充解除したIOSTは 72時間経過するまで、利用できません", - "GasManage_Records": "リソース管理記録", - "GasManage_Records_Item": "補充 iGAS は %{name}", - - "transferResult": "送金結果", - "transferSuccess": "送金成功", - "transferFailed": "送金失敗", - "transferFailedTip": "送金失敗のヒント", - "txid": "Tx ID", - "gasUsage": "iGAS利用量", - "transferClose": "閉じる", - + firstLogin_SetPassword: 'ウォレット用パスワードを入力してください', + firstLogin_RepeatPassword: 'パスワードを再入力してください', + firstLogin_CreateAccount: 'アカウントを作る', + firstLogin_ImportAccount: '秘密鍵をインポートする', + firstLogin_NoAndCreate1: 'アカウントを持っていませんか?', + firstLogin_NoAndCreate2: 'サードパーティ製です(IOST公式ではありません)', + firstLogin_AgreementTip1: 'このウォレットを利用することは', + firstLogin_AgreementTip2: '利用規約に同意したとみなされます', + firstLogin_AgreementTip3: '利用規約に同意してください', + Password_Length: 'パスワードは8文字以上にしてください!', + Password_Combination: 'パスワードは少なくとも英字と数字を含んでください!', + Password_Different: 'パスワードが合致しません!', + Password_TryAgain: '不正なパスワードです、再入力してください!', + + CreateAccount_AccountName: 'IOSTアカウント名を入力してください', + CreateAccount_Tip1: '小文字英字と数字から構成される5-11文字で入力してください', + CreateAccount_QueryStatus: 'アカウントの文字列が不適切です', + CreateAccount_AccountExist: '同じアカウント名が既に存在します', + CreateAccount_NextStep: '次の手順', + CreateAccount_ConfirmPrivate: '秘密鍵のペアを確定させる', + CreateAccount_Tip2: 'アカウントに関する情報を確定させてください。クリックして編集できます。', + CreateAccount_OwnerPublicKey: '所有者の公開鍵', + CreateAccount_ActivePublicKey: 'アクティブな公開鍵', + CreateAccount_OwnerPrivateKey: '所有者の秘密鍵', + CreateAccount_ActivePrivateKey: 'アクティブな秘密鍵', + CreateAccount_ChangePrivateKey: '秘密鍵ペアの変更', + CreateAccount_ToastTip1: '秘密鍵が間違っています', + CreateAccount_Pay: '支払う', + CreateAccount_Tip3: '新しいIOSTアカウント作成のためには100IOSTのコストが必要です(0.98KBのiRAM購入費用とiGAS費用)', + CreateAccount_Tip4: '支払方法を選んでください', + CreateAccount_PaymentCurrency: '支払い通貨', + CreateAccount_PaymentAddress: '支払いアドレス', + CreateAccount_CheckCreate: 'アカウント作成状況を確認', + CreateAccount_ToastTip2: 'アカウントはまだ出来ていません', + CreateAccount_ToastTip3: 'アカウントはの作成に成功しました', + + ImportAccount_EnterPrivate: 'アカウントの秘密鍵を入力', + ImportAccount_EnterName: 'ローカルのアカウント名を入力', + ImportAccount_Submit: '送信', + ImportAccount_Completed: 'インポート完了', + ImportAccount_Failed: 'インポート失敗、もう一度お試しください', + ImportAccount_LocalNetMessage: 'ローカルアカウントのインポートのために、アカウント名を入力してください', + ImportAccount_Tip1: '該当アカウントがありません', + ImportAccount_Tip2: '秘密鍵は空欄にできません', + ImportAccount_Tip3: '該当する公開鍵がありません', + Account_Transfer: '送信', + Account_Receive: 'デポジット', + Account_Transaction: 'トランザクションの記録', + Account_Confirmed: '完了', + Account_NotApproved: '非承認', + Account_Failed: '失敗', + Account_AddToken: 'トークン追加', + + Transfer_Amount: '送金量', + Transfer_Balance: '残高: %{num} %{token}', + Transfer_InputAmount: '入力アカウント', + Transfer_Payee: '手数料', + Transfer_EnterName: '有効なIOSTアカウントを入力してください', + Transfer_Note: 'メモ', + Transfer_Optional: 'オプション', + Transfer_Resource: 'リソース料金', + Transfer_Submit: '送信', + Transfer_Tip: 'もし、リソースが足りない場合は、IOSTの一部をデポジットして転送を完了させるようサポートします', + Transfer_Choose: 'トークン選択', + + Receive_Title: 'このアドレスは、IOSTブロックチェーン上のトークンのみを受け付けます', + Receive_Copy: '支払いアドレスをコピー', + Receive_Tip: '* 今は xxx ウォレットをサポートしています', + Settings_Title: '設定', + Settings_accountManage: 'アカウント管理', + Settings_changeLanguage: '言語変更', + Settings_changePwd: 'パスワード変更', + Settings_lock: 'ウォレットをロック', + Settings_whitelist: 'ホワイトリスト', + Settings_iostWallet: 'iWalletについて', + Settings_assetManage: '資産管理', + Settings_developerMode: '開発者モード', + + ManageAccount_Add: 'インポート', + ManageAccount_PublicKey: '公開鍵', + ManageAccount_PrivateKey: '秘密鍵', + ManageAccount_Official: 'メインネット', + ManageAccount_Local: 'ローカルネット', + ManageAccount_Test: 'テストネット', + ManageAccount_Copy: 'コピー成功', + ManageAccount_Delete: '削除してよろしいですか?', + ManageAccount_DeleteTip: 'アカウントを削除する前に、必ず秘密鍵がバックアップされていることを確認してください', + ManageAccount_Confirm: '確定', + AccountAdd_Title: 'アカウント追加', + ChangeLanguage_china: '中国語', + ChangeLanguage_english: '英語', + ChangeLanguage_korea: '韓国語', + ChangeLanguage_japan: '日本語', + ChangePassword_CurrentPassword: '現在のパスワードを入力', + ChangePassword_Verification: '認証完了', + ChangePassword_NewPassword: '新しいパスワードを入力', + ChangePassword_Repeat: '再入力', + ChangePassword_Wrong: 'パスワードが間違っています、再入力してください', + Lock_EnterPassword: 'パスワード入力', + Lock_Unlock: 'ウォレットロック解除', + AboutIOST_nodeVoting: 'ノード投票に参加', + AboutIOST_userAgreement: '利用規約', + AboutIOST_developerMode: '開発者モード', + + AssetManage_TokenName: 'トークン名', + AssetManage_Add: '追加', + AssetManage_AddSuccess: '追加しました!', + AssetManage_AddExisted: '既に存在しています', + AssetManage_AddNotFound: 'トークンが見つかりません', + AssetManage_MyAsset: '自己資産', + + TokenDetail_Full: 'トークン正式名称', + TokenDetail_Detail: '詳細', + + Dapp_Unlock: '解除しました', + Dapp_Authorization: '承認が必要です', + Dapp_Tip1: '* アカウント認証では秘密鍵は共有されません', + Dapp_Tip2: '* 現在利用しているアプリケーションは、第三者が開発したものです、ご注意ください', + Dapp_Signature: '署名が要求されました', + Dapp_WhiteList: 'ホワイトリストに追加', + Dapp_Cancel: 'キャンセル', + Dapp_Confirm: '確定', + + RamManage_Title: 'iRAMリソース管理', + RamManage_Used: '使用中', + RamManage_Remaining: '残高', + RamManage_Buy: '購入', + RamManage_Sell: '売却', + RamManage_PurchaseAmount: '購入数量(KB)', + RamManage_PurchasePrice: '購入価格', + RamManage_PurchaseEnter: '購入数量を入力', + RamManage_Address: 'リソース受取アドレス', + RamManage_Optional: 'オプション、通常は自分のアドレス', + RamManage_SellAmount: '売却数量(KB)', + RamManage_SellPrice: '売却価格', + RamManage_SellEnter: '売却数量を入力', + + GasManage_Title: 'iGASリソース管理', + GasManage_Lock: 'ロック中', + GasManage_Locked: 'ロック中', + GasManage_Available: '利用可能', + GasManage_Stake: '補充', + GasManage_Stakeing: '補充中', + GasManage_UnStake: '補充解除', + GasManage_CanUnStake: '利用可能', + GasManage_UnStakeing: '補充解除', + GasManage_StakeAmount: '補充量', + GasManage_UnStakeAmount: '補充解除量', + GasManage_Balance: '残高', + GasManage_StakeEnter: '数量入力', + GasManage_StakeAddress: 'リソース受領アドレス', + GasManage_UnStakeAddress: 'リソース補充解除アドレス', + GasManage_Optional: 'オプション、通常は自分のアドレス', + GasManage_Tip: '* 補充解除したIOSTは 72時間経過するまで、利用できません', + GasManage_Records: 'リソース管理記録', + GasManage_Records_Item: '補充 iGAS は %{name}', + + transferResult: '送金結果', + transferSuccess: '送金成功', + transferFailed: '送金失敗', + transferFailedTip: '送金失敗のヒント', + txid: 'Tx ID', + gasUsage: 'iGAS利用量', + transferClose: '閉じる', + + nft_owner: 'オーナー', + nft_name: '名前', + nft_type: 'タイプ', + nft_description: '説明', + nft_send: '送信', + nft_receiver: '受信者', + nft_send_success: '送信済み', + nft_no_data: 'データなし', } export default { @@ -708,4 +714,4 @@ export default { ko: koTranslation, zh: zhTranslation, ja: jaTranslation, -} \ No newline at end of file +} diff --git a/src/iost/iost.js b/src/iost/iost.js index 96ca458..a49c483 100644 --- a/src/iost/iost.js +++ b/src/iost/iost.js @@ -234,21 +234,59 @@ const iost = { }) return fire + }, + signAndSendNFT: (contractAddress, contractAction, args, chainID) => { + const tx = iost.iost.callABI(contractAddress, contractAction, args) + tx.gasLimit = 1000000 + + let chainId = + iost.rpc.getProvider()._host.indexOf('//api.iost.io') < 0 && + iost.rpc.getProvider()._host.indexOf('//127.0.0.1') < 0 && + iost.rpc.getProvider()._host.indexOf('//localhost') < 0 + ? 1023 + : 1024 + if (chainID) { + chainId = chainID + } + tx.setChainID(chainId) + + const fire = new Callback() + iost.iost.setAccount(iost.account) + + const handler = iost.iost.signAndSend(tx) + let inverval = null + handler + .on('pending', pending => { + fire.pushMsg('pending', pending) + + let times = 90 + inverval = setInterval(async () => { + times-- + if (times) { + iost.rpc.transaction.getTxByHash(pending).then(data => { + const tx_receipt = data.transaction.tx_receipt + if (tx_receipt) { + clearInterval(inverval) + if (tx_receipt.status_code === 'SUCCESS') { + fire.pushMsg('success', tx_receipt) + } else { + fire.pushMsg('failed', tx_receipt.stack ? tx_receipt.message : tx_receipt) + } + } + }) + } else { + clearInterval(inverval) + fire.pushMsg('failed', `Error: tx ${pending} on chain timeout.`) + } + }, 1000) + }) + .on('failed', err => { + clearInterval(inverval) + console.log('failed: ', err) + fire.pushMsg('failed', err.stack ? err.message : err) + }) - // return { - // onPending: (callback) => { - // fire.pending = callback - // return handler - // }, - // onSuccess: (callback) => { - // fire.success = callback - // return handler - // }, - // onFailed: (callback) => { - // fire.failed = callback - // return handler - // } - // } + return fire }, } diff --git a/src/reducers/token.js b/src/reducers/token.js index a61f028..59e7dc2 100644 --- a/src/reducers/token.js +++ b/src/reducers/token.js @@ -1,13 +1,11 @@ -import { - UPDATE_SAVED_TOKEN_SYMBOLS, - SELECT_TOKEN, -} from 'actions/actionTypes' +import { UPDATE_SAVED_TOKEN_SYMBOLS, SELECT_TOKEN, SELECT_NFT } from 'actions/actionTypes' import { DEFAULT_TOKEN_LIST } from 'constants/token' const initialState = { savedTokenSymbols: DEFAULT_TOKEN_LIST, selectedTokenSymbol: 'iost', + selectedNFT: '', } const tokenReducer = (state = initialState, action) => { @@ -22,6 +20,11 @@ const tokenReducer = (state = initialState, action) => { ...state, selectedTokenSymbol: action.payload.tokenSymbol, } + case SELECT_NFT: + return { + ...state, + selectedNFT: action.payload.nftId, + } default: return state } diff --git a/src/utils/token.js b/src/utils/token.js index b4cb9d3..585fb0e 100644 --- a/src/utils/token.js +++ b/src/utils/token.js @@ -1,25 +1,23 @@ -import { - updateSavedTokenSymbols, - selectToken, - selectedListSymbol, -} from 'actions/token' +import { updateSavedTokenSymbols, selectToken, selectNft, selectedListSymbol } from 'actions/token' import store from '../store' import axios from 'axios' export const token = { - updateSavedTokenSymbols: (tokenSymbols) => store.dispatch(updateSavedTokenSymbols(tokenSymbols)), - selectToken: (tokenSymbol) => store.dispatch(selectToken(tokenSymbol)), + updateSavedTokenSymbols: tokenSymbols => store.dispatch(updateSavedTokenSymbols(tokenSymbols)), + selectToken: tokenSymbol => store.dispatch(selectToken(tokenSymbol)), + selectNft: nftId => store.dispatch(selectNft(nftId)), getTokenSymbols: () => store.getState().token.savedTokenSymbols, } export const getTokenInfo = async (token, account) => { const { network, endpoint } = account - const url = network == 'MAINNET' ? 'https://api.iost.io/' : network == 'LOCALNET' ? endpoint || 'http://127.0.0.1:30001/' : 'https://test.api.iost.io/'; + const url = + network == 'MAINNET' ? 'https://api.iost.io/' : network == 'LOCALNET' ? endpoint || 'http://127.0.0.1:30001/' : 'https://test.api.iost.io/' try { - const { data } = await axios.get(`${url.endsWith("/") ? url : `${url}/` }getTokenInfo/${token}/0`,{ - timeout: 10000 + const { data } = await axios.get(`${url.endsWith('/') ? url : `${url}/`}getTokenInfo/${token}/0`, { + timeout: 10000, }) - if(data.code && data.code != 0){ + if (data.code && data.code != 0) { throw data.message } return data @@ -31,8 +29,10 @@ export const getTokenInfo = async (token, account) => { export default token export const defaultAssets = [ - {symbol: 'iost', fullName: 'iost', onlyIssuerCanTransfer:false }, - {symbol: 'husd', fullName: 'IOST-Peg HUSD Token', onlyIssuerCanTransfer:true, issuer:'Contract3zCNX76rb3LkiAamGxCgBRCNn6C5fXJLaPPhZu2kagY3'}, - {symbol: 'lol', fullName: 'LOL', onlyIssuerCanTransfer:false}, - {symbol: 'abct', fullName: 'iostabc token', onlyIssuerCanTransfer:false} + { symbol: 'iost', fullName: 'iost', onlyIssuerCanTransfer: false }, + { symbol: 'husd', fullName: 'IOST-Peg HUSD Token', onlyIssuerCanTransfer: true, issuer: 'Contract3zCNX76rb3LkiAamGxCgBRCNn6C5fXJLaPPhZu2kagY3' }, + { symbol: 'lol', fullName: 'LOL', onlyIssuerCanTransfer: false }, + { symbol: 'abct', fullName: 'iostabc token', onlyIssuerCanTransfer: false }, ] + +export const nftContactId = 'ContractBZ5HHacSeUJNF3CorAKv3izB29NcnSFvPDTQmqcECHjT'