diff --git a/neo3-gui/neo3-gui/ClientApp/public/locales/en/translation.json b/neo3-gui/neo3-gui/ClientApp/public/locales/en/translation.json
index 9f7c8c67..ee2ec2e7 100644
--- a/neo3-gui/neo3-gui/ClientApp/public/locales/en/translation.json
+++ b/neo3-gui/neo3-gui/ClientApp/public/locales/en/translation.json
@@ -28,24 +28,39 @@
"next": "Next",
"ok": "OK",
"prev": "Prev",
- "send": "Send"
+ "send": "Send",
+ "search":"Search"
},
+ "input":{
+ "required":"This input is required.",
+ "checked":"Please confirm all input."
+ },
+ "address book":"Address",
"byte": "Byte",
"bytes": "Bytes",
"confirm count": "Confirmations",
"contract": "Contract",
"contract page": {
"deploy contract": "Deploy Contract",
- "deploy contract nav": "Deploy Contract",
+ "deploy contract nav": "Deploy",
"deploy success": "Deploy successfully, please wait for confirmation",
- "invoke contract nav": "Invoke Contract",
+ "invoke contract": "Invoke Contract",
+ "invoke contract nav": "Invoke",
"invoke fail title": "Invoke failed, please check and retry",
- "invoke result": "Invoke Result",
"please select file path": "Please select file path",
"search contract": "Search Contract",
- "search contract nav": "Search Contract",
+ "search contract nav": "Search",
"select {file} path title": "Select {{file}} file",
- "test invoke": "Test Invoke"
+ "test deploy": "Test Deploy",
+ "test invoke": "Test Invoke",
+ "test result": "Test Result",
+ "search fail": "Please check the hash and try again",
+ "search input check": "Please fill the hash",
+ "choose account":"Choose account",
+ "cosigners":"Cosigners",
+ "invoke method":"Invoke method",
+ "select method":"Select method",
+ "parameters":"Parameters"
},
"copyright": "Copyright",
"count": "Count",
@@ -90,6 +105,7 @@
"unconfirmed transactions": "Unconfirmed Transactions",
"verification script": "Verification Script",
"wallet": "Wallet",
+ "open wallet first": "Please open wallet",
"wallet page": {
"accounts nav": "Accounts",
"assets": "Assets",
@@ -134,8 +150,14 @@
"transfer asset": "Asset",
"transfer nav": "Transfer",
"transfer send success": "Send Success",
+ "transfer send error":"Send failed, please try again later",
"transfer warning": "Safety tip: Do not transfer money to strangers easily.Please confirm the receiving account, transfer amount and asset type carefully.Please carefully identify assets with the same name to avoid being cheated.Do not transfer money to the receiving account (address) of other blockchain.",
"wallet opened": "Wallet is opened"
},
+ "transaction page":{
+ "confirmed":"Confirmed",
+ "unconfirmed":"Unconfirmed"
+ },
+ "transaction list":"Transaction list",
"witness": "Witness"
}
diff --git a/neo3-gui/neo3-gui/ClientApp/public/locales/zh/translation.json b/neo3-gui/neo3-gui/ClientApp/public/locales/zh/translation.json
index 5215daca..408699a3 100644
--- a/neo3-gui/neo3-gui/ClientApp/public/locales/zh/translation.json
+++ b/neo3-gui/neo3-gui/ClientApp/public/locales/zh/translation.json
@@ -28,8 +28,14 @@
"next": "下一步",
"ok": "确认",
"prev": "上一步",
- "send": "发送"
+ "send": "发送",
+ "search":"搜索"
},
+ "input":{
+ "required":"该输入框为必填项",
+ "checked":"请确认已经输入完毕"
+ },
+ "address book":"地址簿",
"byte": "字节",
"bytes": "字节",
"confirm count": "确认数",
@@ -38,14 +44,23 @@
"deploy contract": "部署合约",
"deploy contract nav": "部署合约",
"deploy success": "交易发送成功,请等待区块确认",
+ "invoke contract": "调用合约",
"invoke contract nav": "调用合约",
- "invoke fail title": "运行失败,请检查后再尝试",
- "invoke result": "运行结果",
"please select file path": "请选择文件后再试",
"search contract": "搜索合约",
"search contract nav": "搜索合约",
"select {file} path title": "选择需要的{{file}}文件",
- "test invoke": "试运行"
+ "test deploy": "试运行",
+ "test invoke": "试运行",
+ "test result": "运行结果",
+ "search fail": "请正确输入需要查找的hash",
+ "search input check": "请输入后再试",
+ "choose account":"选择账户",
+ "cosigners":"附加签名",
+ "fail title": "运行失败,请检查后再尝试",
+ "invoke method":"调用方法",
+ "select method":"选择方法",
+ "parameters":"参数列表"
},
"copyright": "保留所有权利",
"count": "数量",
@@ -90,6 +105,7 @@
"unconfirmed transactions": "待确认交易",
"verification script": "验证脚本",
"wallet": "钱包",
+ "open wallet first": "请先打开钱包",
"wallet page": {
"accounts nav": "账户列表",
"assets": "资产列表",
@@ -134,8 +150,14 @@
"transfer asset": "发送资产",
"transfer nav": "转账",
"transfer send success": "交易发送成功",
+ "transfer send error":"交易发送失败,请检查后再试",
"transfer warning": "安全提示:请勿轻易向陌生人转账。请仔细确认收款账户、转账金额、资产类型。请仔细辨别相同资产名称的资产,避免被骗。请勿向其它区块链的收款账户(地址)转账。",
"wallet opened": "钱包文件已打开"
},
+ "transaction page":{
+ "confirmed":"已完成",
+ "unconfirmed":"待确认"
+ },
+ "transaction list":"交易列表",
"witness": "见证人"
}
diff --git a/neo3-gui/neo3-gui/ClientApp/src/components/Advanced/advancedlayout.js b/neo3-gui/neo3-gui/ClientApp/src/components/Advanced/advancedlayout.js
new file mode 100644
index 00000000..9cd0518f
--- /dev/null
+++ b/neo3-gui/neo3-gui/ClientApp/src/components/Advanced/advancedlayout.js
@@ -0,0 +1,64 @@
+/* eslint-disable */
+import React from 'react';
+import 'antd/dist/antd.css';
+import '../../static/css/menu.css'
+import '../../static/css/wallet.css'
+import { Layout, Menu, Icon } from 'antd';
+import { Link } from 'react-router-dom';
+import MenuDown from '../Common/menudown'
+import {
+ HomeOutlined,
+ RadiusUpleftOutlined
+} from '@ant-design/icons';
+import { withTranslation } from 'react-i18next';
+
+
+
+const { Sider } = Layout;
+const { SubMenu } = Menu;
+
+@withTranslation()
+class Advancedlayout extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ size: 'default'
+ };
+ }
+ render = () => {
+ const { t } = this.props;
+ return (
+
+
+
+
+
+
+ );
+ }
+}
+
+export default Advancedlayout;
\ No newline at end of file
diff --git a/neo3-gui/neo3-gui/ClientApp/src/components/Chain/assetdetail.js b/neo3-gui/neo3-gui/ClientApp/src/components/Chain/assetdetail.js
index f6f2ec46..223bfac8 100644
--- a/neo3-gui/neo3-gui/ClientApp/src/components/Chain/assetdetail.js
+++ b/neo3-gui/neo3-gui/ClientApp/src/components/Chain/assetdetail.js
@@ -7,9 +7,11 @@ import axios from 'axios';
import Intitle from '../Common/intitle';
import Transaction from '../Transaction/transaction';
import Sync from '../sync';
+import { withTranslation } from 'react-i18next';
const { Content } = Layout;
+@withTranslation()
class Assetdetail extends React.Component{
constructor(props){
super(props);
@@ -28,7 +30,7 @@ class Assetdetail extends React.Component{
})
}
getAsset = () =>{
- console.log("数据暂无")
+ // console.log("数据暂无")
// var _this = this;
// let _height = this.state.height;
// axios.post('http://localhost:8081', {
@@ -66,6 +68,7 @@ class Assetdetail extends React.Component{
}
render(){
const {blockdetail,witness,nonce} = this.state;
+ const { t } = this.props;
return (
@@ -98,7 +101,7 @@ class Assetdetail extends React.Component{
*/}
-
+
);
diff --git a/neo3-gui/neo3-gui/ClientApp/src/components/Common/addressdetail.js b/neo3-gui/neo3-gui/ClientApp/src/components/Common/addressdetail.js
index 5bc1852c..7d28ba3b 100644
--- a/neo3-gui/neo3-gui/ClientApp/src/components/Common/addressdetail.js
+++ b/neo3-gui/neo3-gui/ClientApp/src/components/Common/addressdetail.js
@@ -2,6 +2,9 @@
//just test replace wallet//
import React from 'react';
import axios from 'axios';
+
+import { observer, inject } from "mobx-react";
+import { withRouter } from "react-router-dom";
import {Link} from 'react-router-dom';
import { Layout, Row, Col, Modal,List, Button,Typography, message } from 'antd';
import Sync from '../sync';
@@ -9,6 +12,7 @@ import Intitle from '../Common/intitle';
import Transaction from '../Transaction/transaction';
import '../../static/css/wallet.css';
import Topath from '../Common/topath';
+import { withTranslation } from 'react-i18next';
import {
CloseCircleOutlined
} from '@ant-design/icons';
@@ -16,6 +20,10 @@ import {
const { confirm } = Modal;
const { Content } = Layout;
+@withTranslation()
+@inject("walletStore")
+@observer
+@withRouter
class Addressdetail extends React.Component{
constructor(props){
super(props);
@@ -28,74 +36,28 @@ class Addressdetail extends React.Component{
};
}
componentDidMount() {
- this.checkAddress();
- this.getBalances();
- }
- checkAddress = () =>{
- let _add = location.pathname.split(":").pop();
- this.setState({address:_add})
- }
- getBalances = () =>{
- var _this = this;
- let _add = location.pathname.split(":").pop();
- axios.post('http://localhost:8081', {
- "id":"51",
- "method": "GetAddressBalance",
- "params":{
- // "addresses":[_add]
- }
- })
- .then(function (response) {
- var _data = response.data;
- console.log(_data);
- console.log(response);
- if(_data.msgType === -1){
- console.log(_data);
- return;
- }else{
- if(_data.result.length>0){
- _this.setState({
- addresslist:_data.result,
- })
- }
- }
- console.log(_this.state)
- })
- .catch(function (error) {
- console.log(error);
- console.log("error");
- });
}
render = () =>{
- const { addresslist,address } = this.state;
+ const accounts = this.props.walletStore.accountlist;
+ const { t } = this.props;
return (
-
-
-
-
-
-
-
- {address}}
- footer={}
- itemLayout="horizontal"
- dataSource={addresslist.balances}
- renderItem={item => (
-
-
- {item.symbol}
- {item.balance}
-
-
- )}
- />
-
-
-
-
-
-
+
+
{t("address book")}
+
+ {accounts.map((item,index)=>{
+ return(
+ -
+ {item.address} NEO {item.neo}
+ {/* NEO {item.neo}
+ GAS {item.gas} */}
+
+ )
+ })}
+
+
+
NeoGUI @ 2020 Neo-Project {t("copyright")}
+
+
);
}
}
diff --git a/neo3-gui/neo3-gui/ClientApp/src/components/Common/dataConverter.js b/neo3-gui/neo3-gui/ClientApp/src/components/Common/dataConverter.js
index 08a73a06..25edf0f1 100644
--- a/neo3-gui/neo3-gui/ClientApp/src/components/Common/dataConverter.js
+++ b/neo3-gui/neo3-gui/ClientApp/src/components/Common/dataConverter.js
@@ -28,7 +28,7 @@ class DataConverter {
*/
toScriptHash(address){
var bytes= bs58check.decode(address);
- return "0x"+ this.reverseHexString(Buffer.from(bytes).toString("hex").slice(2));
+ return "0x"+ Buffer.from(bytes).toString("hex").slice(2);
}
@@ -42,8 +42,6 @@ class DataConverter {
}
return hexString.match(/../g).reverse().join("");
}
-
}
-
export default DataConverter;
\ No newline at end of file
diff --git a/neo3-gui/neo3-gui/ClientApp/src/components/Common/datatrans.js b/neo3-gui/neo3-gui/ClientApp/src/components/Common/datatrans.js
index 7a075583..8fd13ddc 100644
--- a/neo3-gui/neo3-gui/ClientApp/src/components/Common/datatrans.js
+++ b/neo3-gui/neo3-gui/ClientApp/src/components/Common/datatrans.js
@@ -29,7 +29,10 @@ class Datatrans extends React.Component {
outhexstr: "",
outhash: "",
outbighash: "",
- outbigadd: ""
+ outbigadd: "",
+ outlittlehash:"",
+ outlittleadd:"",
+ outhexnum:""
};
}
convert = new DataConvert();
@@ -109,7 +112,7 @@ class Datatrans extends React.Component {
var inbighash = document.getElementById("inBigHash").value.replace(/(^\s*)|(\s*$)/g, "");
if (inbighash) {
if(inbighash.substr(0, 2)=="0x")inbighash = inbighash.slice(2);
- if(inbighash.length!=40){alert("Illegal Format Script Hash!");return;}
+ if(inbighash.length!=40){message.error("输入的格式错误,请检查后再试");return;}
let _address= this.convert.toAddress(inbighash);
_this.setState({
outbighash: _address
@@ -117,15 +120,59 @@ class Datatrans extends React.Component {
}
var inbigadd = document.getElementById("inBigAddress").value.replace(/(^\s*)|(\s*$)/g, "");
if (inbigadd) {
- // if(inbigadd.length!=34){message.error("输入的格式错误,请检查后再试");return;}
- let _hash = this.convert.reverseHexString("NhVvgdk458V1SceGsvMbqChsbSFBtGvdXF");
+ if(inbigadd.length!=34){message.error("输入的格式错误,请检查后再试");return;}
+ let _hash = this.convert.toScriptHash(inbigadd);
console.log(_hash)
+ _this.setState({
+ outbigadd: _hash
+ })
}
}
- addTrans = () =>{
- let address= this.convert.toAddress("NfxTs1w2q9PqkQmExYgsqQzpXDTg4QcuqX");
-
+ littleTrans = () =>{
+ var _this = this;
+ var inlittlehash = document.getElementById("inLittleHash").value.replace(/(^\s*)|(\s*$)/g, "");
+ if (inlittlehash) {
+ if(inlittlehash.substr(0, 2)=="0x")inlittlehash = inlittlehash.slice(2);
+ if(inlittlehash.length!=40){message.error("Hash (Little)的格式错误,请检查后再试");return;}
+ let _little = this.convert.reverseHexString(inlittlehash);
+ let _address= this.convert.toAddress(_little);
+ _this.setState({
+ outlittlehash: _address
+ })
+ }
+ var inlittleadd = document.getElementById("inLittleAdd").value.replace(/(^\s*)|(\s*$)/g, "");
+ if (inlittleadd) {
+ if(inlittleadd.length!=34){message.error("Address 的格式错误,请检查后再试");return;}
+ let _hash = this.convert.toScriptHash(inlittleadd);
+ _hash = this.convert.reverseHexString(_hash);
+ _this.setState({
+ outlittleadd: _hash
+ })
+ }
}
+ // numTrans = () =>{
+ // var _this = this;
+ // var inhexnum = document.getElementById("inHexNum").value.replace(/(^\s*)|(\s*$)/g, "");
+ // if (inhexnum) {
+ // // if(inhexnum.substr(0, 2)=="0x")inhexnum = inhexnum.slice(2);
+ // // if(inhexnum.length!=40){message.error("Hash (Little)的格式错误,请检查后再试");return;}
+ // let _num = this.convert.toNumber(inhexnum);
+ // console.log(_num)
+ // if(!_num) {message.error("Hash (Little)的格式错误,请检查后再试");return;}
+ // _this.setState({
+ // outhexnum: _num
+ // })
+ // }
+ // var inlittleadd = document.getElementById("inLittleAdd").value.replace(/(^\s*)|(\s*$)/g, "");
+ // if (inlittleadd) {
+ // if(inlittleadd.length!=34){message.error("Address 的格式错误,请检查后再试");return;}
+ // let _hash = this.convert.toScriptHash(inlittleadd);
+ // _hash = this.convert.reverseHexString(_hash);
+ // _this.setState({
+ // outlittleadd: _hash
+ // },() => {this.state})
+ // }
+ // }
render() {
return (
Script Hash (Big-endian Little-endian)
-
+
{this.state.outhash}
@@ -166,43 +213,43 @@ class Datatrans extends React.Component {
Address (big endian) Script Hash
-
+
{this.state.outbighash}
-
- {this.state.outbigadd}
+
+ {this.state.outbigadd}
- {/*
+
Address (little endian) Hex String
-
- transfer
+
+ {this.state.outlittlehash}
-
-
+
+ {this.state.outlittleadd}
-
+
-
+ {/*
Number Hex Number
- transfer
+ {this.state.outhexnum}
-
+
*/}
diff --git a/neo3-gui/neo3-gui/ClientApp/src/components/Common/menudown.js b/neo3-gui/neo3-gui/ClientApp/src/components/Common/menudown.js
index c3e79b61..5afa79d2 100644
--- a/neo3-gui/neo3-gui/ClientApp/src/components/Common/menudown.js
+++ b/neo3-gui/neo3-gui/ClientApp/src/components/Common/menudown.js
@@ -7,7 +7,10 @@ import { message } from 'antd';
import { Modal, Button } from 'antd';
import axios from 'axios';
import { Radio } from 'antd';
+import Addressdetail from './addressdetail';
+import Setting from './setting';
import {
+ ReadOutlined,
LogoutOutlined,
SettingOutlined
} from '@ant-design/icons';
@@ -24,23 +27,13 @@ class menuDown extends React.Component {
constructor(props) {
super(props);
this.state = {
- showPass: false
+ showPass: false,
+ title:"设置",
};
}
componentDidMount() {
this.showPass();
}
-
- switchLang = (lng) => {
- const { t, i18n } = this.props;
- console.log("current lang:", Config.Language)
- if (Config.Language === lng) {
- return;
- }
- Config.Language = lng;
- i18n.changeLanguage(lng);
- }
-
showPass = () => {
let _path = location.href.search(/wallet/g);
if (_path <= -1) return;
@@ -53,15 +46,15 @@ class menuDown extends React.Component {
"id": "1234",
"method": "CloseWallet"
})
- .then(() => {
- message.success(t("wallet page.close wallet success"), 2);
- this.props.walletStore.logout();
- this.props.history.push('/');
- })
- .catch(function (error) {
- console.log(error);
- console.log("error");
- });
+ .then(() => {
+ message.success(t("wallet page.close wallet success"), 2);
+ this.props.walletStore.logout();
+ this.props.history.push('/');
+ })
+ .catch(function (error) {
+ console.log(error);
+ console.log("error");
+ });
}
showModal = () => {
this.setState({
@@ -74,6 +67,20 @@ class menuDown extends React.Component {
visible: false,
});
};
+ getInset = (ele) => {
+ const { t } = this.props;
+ return () =>{
+ this.setState({showElem: false})
+ switch(ele){
+ case 0:this.setState({title:t("address book"),children: });break;
+ case 1:this.setState({title:t("settings"),children: });break;
+ default:this.setState({title:t("settings"),children: });break;
+ }
+ this.setState({
+ visible: true,
+ });
+ }
+ }
openUrl(url) {
return () => {
shell.openExternal(url);
@@ -81,28 +88,26 @@ class menuDown extends React.Component {
}
render() {
const walletOpen = this.props.walletStore.isOpen;
- const { t, i18n } = this.props;
+ const { t } = this.props;
return (
- {t("network setting")}
-
-
- {t("mainnet")}
- {t("testnet")}
-
-
-
- {t("language setting")}
-
- this.switchLang("zh")}>中文
- this.switchLang("en")}>English
-
-
- {t("about")}
- {/* 更新完成,请重新启动Neo-GUI
*/}
- {t("current version")} 1.0.1
-
-
-
NeoGUI @ 2020 Neo-Project {t("copyright")}
-
- {/* 查看帮助 */}
- {t("report issues")}
- Neo{t("official website")}
-
-
+ {this.state.children}
)
diff --git a/neo3-gui/neo3-gui/ClientApp/src/components/Common/setting.js b/neo3-gui/neo3-gui/ClientApp/src/components/Common/setting.js
new file mode 100644
index 00000000..e9bad786
--- /dev/null
+++ b/neo3-gui/neo3-gui/ClientApp/src/components/Common/setting.js
@@ -0,0 +1,94 @@
+/* eslint-disable */
+//just test replace wallet//
+import React from 'react';
+import axios from 'axios';
+import {Link} from 'react-router-dom';
+import { Layout, Row, Col, Modal,List, Button,Typography, message } from 'antd';
+
+import { observer, inject } from "mobx-react";
+
+import { withRouter } from "react-router-dom";
+import Sync from '../sync';
+import { Radio } from 'antd';
+import Intitle from '../Common/intitle';
+import Transaction from '../Transaction/transaction';
+import '../../static/css/wallet.css';
+import Topath from '../Common/topath';
+import { withTranslation } from 'react-i18next';
+import Config from "../../config";
+import {
+ LogoutOutlined,
+ SettingOutlined
+} from '@ant-design/icons';
+
+import {
+ CloseCircleOutlined
+} from '@ant-design/icons';
+
+const { shell } = window.electron;
+const { confirm } = Modal;
+const { Content } = Layout;
+
+@withTranslation()
+@inject("walletStore")
+@observer
+@withRouter
+class Setting extends React.Component{
+ constructor(props){
+ super(props);
+ this.state = {
+ size: 'default',
+ address:"",
+ addresslist:[],
+ iconLoading:false,
+ gas:0,
+ };
+ }
+
+ switchLang = (lng) => {
+ const { t, i18n } = this.props;
+ console.log("current lang:", Config.Language)
+ if (Config.Language === lng) {
+ return;
+ }
+ Config.Language = lng;
+ i18n.changeLanguage(lng);
+ }
+ openUrl (url) {
+ return ()=>{
+ shell.openExternal(url);
+ }
+ }
+ render = () =>{
+ const { addresslist,address } = this.state;
+ const { t, i18n } = this.props;
+ return (
+
+
{t("network setting")}
+
+ {t("mainnet")}
+ {t("testnet")}
+
+
+
{t("language setting")}
+
+ this.switchLang("zh")}>中文
+ this.switchLang("en")}>English
+
+
+
{t("about")}
+
{t("current version")} 1.0.1
+
+
+
+ );
+ }
+}
+
+export default Setting;
\ No newline at end of file
diff --git a/neo3-gui/neo3-gui/ClientApp/src/components/Contract/contract.js b/neo3-gui/neo3-gui/ClientApp/src/components/Contract/contract.js
index 2da3b035..473ef585 100644
--- a/neo3-gui/neo3-gui/ClientApp/src/components/Contract/contract.js
+++ b/neo3-gui/neo3-gui/ClientApp/src/components/Contract/contract.js
@@ -16,7 +16,6 @@ import {
import { withTranslation } from "react-i18next";
-
const { Content } = Layout;
const { SubMenu } = Menu;
@@ -30,11 +29,7 @@ class Contract extends React.Component {
show: false
};
}
- toHome = () => {
- }
- toPage = (e) => {
- }
- visi = () => {
+ visi = () =>{
this.setState({
show: !this.state.show,
});
diff --git a/neo3-gui/neo3-gui/ClientApp/src/components/Contract/contractlayout.js b/neo3-gui/neo3-gui/ClientApp/src/components/Contract/contractlayout.js
index 86ba967d..8a09bec1 100644
--- a/neo3-gui/neo3-gui/ClientApp/src/components/Contract/contractlayout.js
+++ b/neo3-gui/neo3-gui/ClientApp/src/components/Contract/contractlayout.js
@@ -90,6 +90,7 @@ class Contractlayout extends React.Component {
{!walletOpen ? (
@@ -97,13 +98,13 @@ class Contractlayout extends React.Component {
}
>
-
+
{ t('contract page.search contract nav') }
-
+
{ t('contract page.deploy contract nav') }
-
+
{ t('contract page.invoke contract nav') }
diff --git a/neo3-gui/neo3-gui/ClientApp/src/components/Contract/deploy.js b/neo3-gui/neo3-gui/ClientApp/src/components/Contract/deploy.js
index e37ed323..17c68835 100644
--- a/neo3-gui/neo3-gui/ClientApp/src/components/Contract/deploy.js
+++ b/neo3-gui/neo3-gui/ClientApp/src/components/Contract/deploy.js
@@ -147,30 +147,30 @@ class Contractdeploy extends React.Component {
"method": "DeployContract",
"params": params
})
- .then(function (response) {
- var _data = response.data;
- if (_data.msgType === -1) {
- let res = _data.error;
- Modal.error({
- title: t('contract page.invoke fail title'),
- width: 400,
- content: (
-
-
{t('error code')}: {res.code}
-
{t('error msg')}: {res.message}
-
- ),
- okText: t("button.ok")
- });
- return;
- } else if (_data.msgType === 3) {
- callback(_data);
- }
- })
- .catch(function (error) {
- console.log(error);
- console.log("error");
- });
+ .then(function (response) {
+ var _data = response.data;
+ if (_data.msgType === -1) {
+ let res = _data.error;
+ Modal.error({
+ title: t('contract page.fail title'),
+ width: 400,
+ content: (
+
+
{t('error code')}: {res.code}
+
{t('error msg')}: {res.message}
+
+ ),
+ okText: t("button.ok")
+ });
+ return;
+ } else if (_data.msgType === 3) {
+ callback(_data);
+ }
+ })
+ .catch(function (error) {
+ console.log(error);
+ console.log("error");
+ });
}
render = () => {
const { t } = this.props;
@@ -213,11 +213,11 @@ class Contractdeploy extends React.Component {
-
{t('contract page.invoke result')}
+
{t('contract page.test result')}
{/* {cost>=0?手续费:{cost} GAS
:null} */}
diff --git a/neo3-gui/neo3-gui/ClientApp/src/components/Contract/invoke.js b/neo3-gui/neo3-gui/ClientApp/src/components/Contract/invoke.js
index 829cf87e..b1b0484c 100644
--- a/neo3-gui/neo3-gui/ClientApp/src/components/Contract/invoke.js
+++ b/neo3-gui/neo3-gui/ClientApp/src/components/Contract/invoke.js
@@ -2,6 +2,7 @@
import React from 'react';
import 'antd/dist/antd.css';
import axios from 'axios';
+import { observer, inject } from "mobx-react";
import { Input,
Icon,
Cascader,
@@ -15,74 +16,312 @@ import { Input,
Button,
} from 'antd';
+import Datatrans from '../Common/datatrans';
import { Layout } from 'antd';
import Intitle from '../Common/intitle'
import '../../static/css/wallet.css'
import Sync from '../sync'
+import { SwapOutlined } from '@ant-design/icons';
+
+import { withRouter } from "react-router-dom";
+import { withTranslation } from "react-i18next";
+
+const { TextArea } = Input;
const { Content } = Layout;
const {dialog} = window.remote;
+const {Option} = Select;
+const layout = {
+ labelCol: { span: 4 },
+ wrapperCol: { span: 20 },
+};
-
+@withTranslation()
+@inject("walletStore")
+@observer
+@withRouter
class Contractinvoke extends React.Component{
constructor(props){
super(props);
this.state = {
size: 'default',
path:"",
- disabled:false
+ disabled:false,
+ visible: false,
+ methods:[],
+ params:[],
+ methodname:""
};
}
toHome = () =>{
location.href=location.origin;
}
- toPage = (e) =>{
+ showDrawer = () => {
+ this.setState({
+ visible: true,
+ });
+ };
+ onClose = () => {
+ this.setState({
+ visible: false,
+ });
+ };
+ showDetail = () =>{
+ this.searchContract(res=>{
+ let list = new Array();
+ list = res.entryPoint?list.concat(res.entryPoint):list;
+ let methods = list.concat(res.methods);
+ this.setState({
+ hash:res.contractHash,
+ methods:methods
+ })
+ });
}
- selectNef = () =>{
- this.opendialog( res =>{
- this.setState({ path: res.filePaths }
- ,()=>{});
- })
- }
- opendialog = callback => {
- var _this = this;
- _this.setState({disabled:true})
- dialog.showOpenDialog({
- title: '保存钱包文件',
- defaultPath: '/',
- filters: [
- {
- name: 'JSON',
- extensions: ['json']
+ searchContract = callback => {
+ const { t } = this.props;
+ let _hash = (this.refs.sinput.input.value).trim();
+ if(!_hash){message.info(t("contract page.search input check"));return;}
+ axios.post('http://localhost:8081', {
+ "id":"1111",
+ "method": "GetContract",
+ "params": {
+ "contractHash":_hash
}
- ]
- }).then(function (res) {
- callback(res);
- }).catch(function (error){
+ })
+ .then(function (response) {
+ var _data = response.data;
+ console.log(_data);
+ if(_data.msgType === -1){
+ message.info(t("contract page.search fail"));
+ return;
+ }else if(_data.msgType === 3){
+ callback(_data.result.manifest.abi)
+ }
+ })
+ .catch(function (error) {
console.log(error);
+ console.log("error");
+ });
+ }
+ showPara = e => {
+ this.setState({
+ params:this.state.methods[e].parameters,
+ methodname:this.state.methods[e].name
+ })
+ }
+ makeParams = (data) =>{
+ let _params = {
+ "contractHash": this.state.hash,
+ "method": this.state.methodname,
+ "parameters":[],
+ "cosigners":[],
+ "sendTx": false
+ };
+
+ let inside = new Array();
+ this.state.params.map((item)=>{
+ item.value = data[item.name];
+ inside = inside.concat(item)
+ })
+ if(inside) _params.parameters = inside;
+
+ let cosigners = new Array();
+ data.cosigners?data.cosigners.map((item)=>{
+ let _list = {};
+ _list.account = item;
+ cosigners = cosigners.concat(_list)
+ }):null;
+ if(cosigners) _params.cosigners = cosigners;
+
+ return _params;
+ }
+ onFill = () => {
+ this.refs.formRef.setFieldsValue({
+ tresult:this.state.tresult
+ });
+ };
+ testInvoke = () => {
+ const { t } = this.props;
+ this.setState({
+ tresult:"",
+ },this.onFill());
+ this.refs.formRef.validateFields().then(data => {
+ let params = this.makeParams(data);
+
+ this.invokeContract(params,res=>{
+ this.setState({
+ tresult:JSON.stringify(res),
+ },this.onFill());
+ });
+ }).catch(function(res){
+ console.log(res)
+ message.error(t("input.checked"));
})
}
- out = fieldsValue =>{
- console.log(fieldsValue)
+ invoke = fieldsValue =>{
+ let params = this.makeParams(fieldsValue);
+ params.sendTx = true;
+ const { t } = this.props;
+ this.setState({
+ tresult:"",
+ },this.onFill());
+ this.invokeContract(params,res=>{
+ Modal.info({
+ title: t('contract page.invoke contract'),
+ width: 600,
+ content: (
+
+
TxID : {res.result.txId?res.result.txId:"--"}
+
GAS : {res.result.gasConsumed?res.result.gasConsumed:"--"}
+
+ ),
+ okText:t('button.ok')
+ });
+ });
+ }
+ invokeContract = (params,callback) =>{
+ console.log(params)
+ const { t } = this.props;
+ axios.post('http://localhost:8081', {
+ "id":"1111",
+ "method": "InvokeContract",
+ "params": params
+ })
+ .then(function (res) {
+ var _data = res.data;
+ console.log(_data)
+ if(_data.msgType === -1){
+ Modal.error({
+ title: t('contract page.fail title'),
+ width: 600,
+ content: (
+
+
{t('error code')}: {_data.error.code}
+
{t('error msg')}: {_data.error.message}
+
+ ),
+ okText: t('button.ok')
+ });
+ return;
+ }else if(_data.msgType === 3){
+ callback(_data)
+ }
+ })
+ .catch(function (error) {
+ console.log(error);
+ console.log("error");
+ });
}
render = () =>{
- const {path} = this.state;
+ const {methods,params,disabled} = this.state;
+ const { t } = this.props;
+ const accounts = this.props.walletStore.accountlist;
return (
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
{t('contract page.test result')}
+
+
+
+
+
+
+
+
+
);
}
}
+
export default Contractinvoke;
\ No newline at end of file
diff --git a/neo3-gui/neo3-gui/ClientApp/src/components/Transaction/transaction.js b/neo3-gui/neo3-gui/ClientApp/src/components/Transaction/transaction.js
index 97db6c1b..2c31f12f 100644
--- a/neo3-gui/neo3-gui/ClientApp/src/components/Transaction/transaction.js
+++ b/neo3-gui/neo3-gui/ClientApp/src/components/Transaction/transaction.js
@@ -4,10 +4,11 @@ import React from 'react';
import { observer, inject } from "mobx-react";
import { withRouter, Link } from 'react-router-dom';
import axios from 'axios';
-import { Layout, Row, Col, List, Button, Typography, message } from 'antd';
+import { Layout, Row, Col, List, Button, Tag, message } from 'antd';
import Intitle from '../Common/intitle';
import { withTranslation } from "react-i18next";
+import { SwapRightOutlined } from '@ant-design/icons';
const { Content } = Layout;
@withTranslation()
@@ -43,16 +44,22 @@ class Transaction extends React.Component {
this.allset(_params);
} else if (page === "blockdetail") {
_params.blockHeight = Number(_hash);
+ this.setState({params:_params})
this.allset(_params);
+ } else if (page === "addressdetail") {
+ _params.address = Number(_hash);
+ this.setState({params:_params})
+ this.nepset(_params);
} else if (page === "assetdetail") {
_params.asset = _hash;
- this.allset(_params);
+ this.setState({params:_params})
+ this.nepset(_params);
} else if (page === "wallettrans") {
this.walletset(_params);
} else if (page === "walletdetail") {
_params.address = _hash;
this.walletset(_params);
- } else {
+ } else{
this.allset(_params);
}
}
@@ -73,6 +80,19 @@ class Transaction extends React.Component {
});
})
}
+ nepset = params => {
+ this.getNeptrans(params, res => {
+ this.setState({
+ loading: false,
+ data: res.result.list,
+ translist: res.result.list,
+ page: this.state.page + 1,
+ iswa: false,
+ isnpe: true,
+ allpage: Math.ceil(res.result.totalCount / this.state.limit)
+ });
+ })
+ }
walletset = params => {
this.getMytrans(params, res => {
this.setState({
@@ -81,6 +101,7 @@ class Transaction extends React.Component {
translist: res.result.list,
page: this.state.page + 1,
iswa: true,
+ isnpe: false,
allpage: Math.ceil(res.result.totalCount / this.state.limit)
});
})
@@ -91,45 +112,68 @@ class Transaction extends React.Component {
"method": "GetMyTransactions",
"params": params
})
- .then(function (response) {
- var _data = response.data;
- if (_data.msgType === -1) {
- message.error("查询失败");
- return;
- } else {
- callback(_data);
- }
- })
- .catch(function (error) {
- console.log(error);
- console.log("error");
- });
- };
+ .then(function (response) {
+ var _data = response.data;
+ if (_data.msgType === -1) {
+ message.error("查询失败");
+ return;
+ } else {
+ callback(_data);
+ }
+ })
+ .catch(function (error) {
+ console.log(error);
+ console.log("error");
+ });
+ }
getAlltrans = (params, callback) => {
+ console.log(params)
axios.post('http://localhost:8081', {
"id": "51",
"method": "QueryTransactions",
"params": params
})
- .then(function (response) {
- var _data = response.data;
- if (_data.msgType === -1) {
- message.error("查询失败");
- return;
- } else {
- callback(_data);
- }
- })
- .catch(function (error) {
- console.log(error);
- console.log("error");
- });
+ .then(function (response) {
+ var _data = response.data;
+ if (_data.msgType === -1) {
+ console.log(_data)
+ message.error("查询失败");
+ return;
+ } else {
+ callback(_data);
+ }
+ })
+ .catch(function (error) {
+ console.log(error);
+ console.log("error");
+ });
+ };
+ getNeptrans = (params, callback) => {
+ axios.post('http://localhost:8081', {
+ "id": "51",
+ "method": "QueryNep5Transactions",
+ "params": params
+ })
+ .then(function (response) {
+ var _data = response.data;
+ if (_data.msgType === -1) {
+ message.error("查询失败");
+ return;
+ } else {
+ callback(_data);
+ }
+ })
+ .catch(function (error) {
+ console.log(error);
+ console.log("error");
+ });
};
loadMore = () => {
this.setState({
loading: true,
});
- var _params = this.madeParams();
+ var _flag = this.madeParams();
+ var _params = Object.assign(this.state.params, _flag);
this.getAlltrans(_params, res => {
const data = this.state.data.concat(res.result.list);
const _page = this.state.page + 1;
@@ -168,13 +212,36 @@ class Transaction extends React.Component {
);
});
}
+ loadNepMore = () =>{
+ this.setState({
+ loading: true,
+ });
+ var _flag = this.madeParams();
+ var _params = Object.assign(this.state.params, _flag);
+ this.getNeptrans(_params, res => {
+ const data = this.state.data.concat(res.result.list);
+ const _page = this.state.page + 1;
+ this.setState(
+ {
+ data: data,
+ translist: data,
+ loading: false,
+ page: _page
+ },
+ () => {
+ window.dispatchEvent(new Event('resize'));
+ },
+ );
+ });
+ }
render = () => {
const { t } = this.props;
- const { translist, loacl, loading, iswa, page, allpage } = this.state;
+ const { translist, loacl, loading, iswa,isnpe, page, allpage } = this.state;
const loadMore = !loading && page <= allpage ? (
{iswa ? ()
- : ()}
+ :isnpe ? ():
+ ()}
) : null;
return (
@@ -184,7 +251,7 @@ class Transaction extends React.Component {
{t("transaction hash")}{t("count")}{t("time")}}
+ header={交易状态{t("transaction hash")}{t("time")}
}
footer={}
itemLayout="horizontal"
loading={loading}
@@ -194,16 +261,23 @@ class Transaction extends React.Component {
renderItem={item => (
{item.txId}}
- description={
-
- From:{item.transfers[0].fromAddress ? item.transfers[0].fromAddress : "--"}
- To:{item.transfers[0].toAddress ? item.transfers[0].toAddress : "--"}
-
- }
+ title={{t('transaction page.confirmed')}}
/>
- {item.blockTime}
- {item.transfers[0].amount}{item.transfers[0].symbol}
+
+
+ {item.txId}
+ {item.blockTime}
+
+ {item.transfers[0]?
+
+ {item.transfers[0].fromAddress ? item.transfers[0].fromAddress : "--"}
+
+ {item.transfers[0].toAddress ? item.transfers[0].toAddress : "--"}
+ {item.transfers[0].amount}{item.transfers[0].symbol}
+
+ :null}
+ {/* // :
Invoke
} */}
+
)}
/>
diff --git a/neo3-gui/neo3-gui/ClientApp/src/components/Transaction/transfer.js b/neo3-gui/neo3-gui/ClientApp/src/components/Transaction/transfer.js
index b177a5f1..293f843a 100644
--- a/neo3-gui/neo3-gui/ClientApp/src/components/Transaction/transfer.js
+++ b/neo3-gui/neo3-gui/ClientApp/src/components/Transaction/transfer.js
@@ -49,20 +49,20 @@ class Transfer extends React.Component {
"method": "GetMyBalances",
"params": {}
})
- .then(function (response) {
- var _data = response.data;
- if (_data.msgType === -1) {
- console.log("需要先打开钱包再进入页面");
- return;
- }
- _this.setState({
- addresslist: _data.result
- })
+ .then(function (response) {
+ var _data = response.data;
+ if (_data.msgType === -1) {
+ message.error(t("open wallet first"));
+ return;
+ }
+ _this.setState({
+ addresslist: _data.result
})
- .catch(function (error) {
- console.log(error);
- console.log("error2");
- });
+ })
+ .catch(function (error) {
+ console.log(error);
+ console.log("error2");
+ });
}
setAddress = target => {
target = target ? target : 0;
@@ -93,30 +93,40 @@ class Transfer extends React.Component {
"asset": fieldsValue.asset
}
})
- .then(function (response) {
- var _data = response.data;
- _this.setState({ iconLoading: false });
- if (_data.msgType === -1) {
- message.error("交易失败");
- message.error("这里需要根据几个不同的情况分析:资金不够、手续费不够、地址错误、其他");
- return;
- } else {
- Modal.info({
- title: t('wallet page.transfer send success'),
- content: (
-
-
{t("transaction hash")}:{_data.result.txId}
-
- ),
- okText: t("button.ok")
- });
- _this.refs.formRef.resetFields()
- }
- })
- .catch(function (error) {
- console.log(error);
- console.log("error");
- });
+ .then(function (response) {
+ var _data = response.data;
+ _this.setState({ iconLoading: false });
+ if(_data.msgType === -1){
+ let res = _data.error;
+ Modal.error({
+ title: t('wallet page.transfer send error'),
+ width: 400,
+ content: (
+
+
{t("error code")}: {res.code}
+
{t("error msg")}: {res.message}
+
+ ),
+ okText:"确认"
+ });
+ return;
+ }else{
+ Modal.info({
+ title: t('wallet page.transfer send success'),
+ content: (
+
+
{t("transaction hash")}:{_data.result.txId}
+
+ ),
+ okText:"确认"
+ });
+ _this.refs.formRef.resetFields()
+ }
+ })
+ .catch(function (error) {
+ console.log(error);
+ console.log("error");
+ });
}
render() {
const { t } = this.props;
diff --git a/neo3-gui/neo3-gui/ClientApp/src/components/Wallet/open.js b/neo3-gui/neo3-gui/ClientApp/src/components/Wallet/open.js
index 0afbbf40..be0f1880 100644
--- a/neo3-gui/neo3-gui/ClientApp/src/components/Wallet/open.js
+++ b/neo3-gui/neo3-gui/ClientApp/src/components/Wallet/open.js
@@ -46,21 +46,26 @@ class Walletopen extends React.Component {
"password": pass
}
})
- .then(function (res) {
- let _data = res.data;
- _this.setState({ iconLoading: false });
- if (_data.msgType == 3) {
+ .then(function (res) {
+ let _data = res.data;
+ _this.setState({ iconLoading: false });
+ if (_data.msgType == 3) {
+ walletStore.setWalletState(true);
+ let page = (location.pathname).search(/contract/g);
+ if(page === 1){
+ _this.props.history.push('/contract');
+ }else{
message.success(t("wallet page.wallet opened"), 3);
- walletStore.setWalletState(true);
_this.props.history.push('/wallet/walletlist');
- } else {
- message.info(t("wallet page.open wallet failed"), 2);
}
- })
- .catch(function (error) {
- console.log(error);
- console.log("error");
- });
+ } else {
+ message.info(t("wallet page.open wallet failed"), 2);
+ }
+ })
+ .catch(function (error) {
+ console.log(error);
+ console.log("error");
+ });
}
opendialog = () => {
const { t } = this.props;
@@ -84,7 +89,6 @@ class Walletopen extends React.Component {
const { t } = this.props;
return (
-
diff --git a/neo3-gui/neo3-gui/ClientApp/src/router/router.js b/neo3-gui/neo3-gui/ClientApp/src/router/router.js
index 8a411cba..97520094 100644
--- a/neo3-gui/neo3-gui/ClientApp/src/router/router.js
+++ b/neo3-gui/neo3-gui/ClientApp/src/router/router.js
@@ -12,8 +12,6 @@ import Chaintrans from '../components/Chain/trans';
import Chainasset from '../components/Chain/asset';
import Assetdetail from '../components/Chain/assetdetail';
-import Advanced from '../components/Advanced/advanced';
-
import Wallet from '../components/Wallet/wallet';
import Walletlayout from '../components/Wallet/walletlayout';
import Walletlist from '../components/Wallet/walletlist';
@@ -29,6 +27,9 @@ import Contractdeploy from '../components/Contract/deploy';
import Contractinvoke from '../components/Contract/invoke';
import Contractdetail from '../components/Contract/contractdetail';
+import Advanced from '../components/Advanced/advanced';
+import Advancedlayout from '../components/Advanced/advancedlayout';
+
import { Layout } from 'antd';
@@ -37,7 +38,6 @@ const BasicRoute = () => (
-
@@ -67,11 +67,18 @@ const BasicRoute = () => (
+
+
+
+
+
+
+
diff --git a/neo3-gui/neo3-gui/ClientApp/src/static/css/contract.css b/neo3-gui/neo3-gui/ClientApp/src/static/css/contract.css
index 2622e961..39627ef1 100644
--- a/neo3-gui/neo3-gui/ClientApp/src/static/css/contract.css
+++ b/neo3-gui/neo3-gui/ClientApp/src/static/css/contract.css
@@ -60,9 +60,56 @@
}
.dis-file{
-
background: transparent;
}
.dis-file .ant-input{
background: transparent;
+}
+
+.form-btn{
+ margin-top: 24px;
+}
+.ant-input{
+ border-radius: 0px;
+}
+.ant-select-single:not(.ant-select-customize-input) .ant-select-selector{
+ border-radius: 0px;
+ height: 36px;
+ padding-top: 2px;
+}
+.ant-select-single:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-search-input{
+ height: 36px;
+}
+
+.param-title{
+ font-weight: 600;
+ padding: 0 10px;
+ color: rgba(0, 0, 0, 0.85);
+ margin-bottom: 5px;
+}
+.param-title span{
+ color: #ff4d4f;
+ vertical-align: middle;
+}
+.param-input{
+ min-height: auto;
+}
+.param-input .ant-form-item-label{
+ text-align: left;
+}
+.param-input label{
+ font-weight: 400!important;
+ min-height: 38px;
+ height: 100%;
+ vertical-align: middle;
+}
+.param-input .ant-form-item-label > label.ant-form-item-required::before{
+ content: "";
+}
+
+.ant-select-selection-item-content{
+ width: 150px;
+ font-size: 12px;
+ border: none;
+ border-radius: 0px;
}
\ No newline at end of file
diff --git a/neo3-gui/neo3-gui/ClientApp/src/static/css/site.css b/neo3-gui/neo3-gui/ClientApp/src/static/css/site.css
index 92056e3f..be16b77d 100644
--- a/neo3-gui/neo3-gui/ClientApp/src/static/css/site.css
+++ b/neo3-gui/neo3-gui/ClientApp/src/static/css/site.css
@@ -1,7 +1,7 @@
body{
font-family: "SF Pro SC", "SF Pro Text", "SF Pro Icons", "PingFang SC", 'Segoe UI', "Microsoft YaHei", "微软雅黑", "Helvetica Neue", "Helvetica", "Arial";
letter-spacing: .05em;
- font-weight: 500;
+ font-weight: 400;
line-height: 22px;
overflow: hidden;
}
@@ -60,7 +60,7 @@ a:hover{
font-weight: 500;
}
.bolder{
- font-weight: bold;
+ font-weight: 600;
}
.t-dark{
color: #000000;
@@ -341,6 +341,10 @@ small,.small{
color: #000000;
transition: all 0.2s;
}
+.ant-list-item-meta-title{
+ font-size: 12px;
+ margin-bottom: 0;
+}
.ant-list-item:hover .ant-list-item-meta-title > a{
text-shadow: 0px 0px 1px #222222;
}
@@ -358,7 +362,9 @@ small,.small{
color: #00AF92;
text-shadow: none!important;
}
-
+.ant-list-footer, .ant-list-item{
+ padding: 8px 12px;
+}
.gui-container{
background: #F0F0F0;
@@ -499,4 +505,18 @@ small,.small{
}
.ant-radio-checked::after{
border: 1px solid #00AF92;
+}
+
+.add-mark{
+ padding: 0px;
+ list-style: none;
+ font-size: 12px;
+ letter-spacing: 1px;
+ font-weight: 400;
+ color: #333333;
+}
+.add-mark li{
+ margin-bottom: 5px;
+ padding-bottom: 5px;
+ border-bottom: 1px solid #FCFCFC;
}
\ No newline at end of file
diff --git a/neo3-gui/neo3-gui/ClientApp/src/static/css/trans.css b/neo3-gui/neo3-gui/ClientApp/src/static/css/trans.css
index aff987ef..a996be13 100644
--- a/neo3-gui/neo3-gui/ClientApp/src/static/css/trans.css
+++ b/neo3-gui/neo3-gui/ClientApp/src/static/css/trans.css
@@ -50,10 +50,10 @@
}
.trans-area label{
display: inline-block;
- width: 120px;
+ width: 100px;
}
.trans-area input{
- width: 320px;
+ width: 340px;
margin-bottom: 5px;
}
.trans-text{
@@ -114,4 +114,56 @@
.detail-ul .trans-table .trans-type{
margin-right: 12px;
min-width: 96px;
+}
+.ant-list-item:hover .trans-detail{
+ color: #000000!important;
+}
+.ant-list-item:hover .trans-detail a{
+ text-shadow: 0px 0px 1px #222222;
+}
+.trans-detail a:hover{
+ text-shadow: none!important;
+}
+.trans-detail{
+ display: inline-block;
+ width: 90%;
+}
+.trans-detail p{
+ margin-top: 4px;
+ margin-bottom: 4px;
+}
+.trans-detail span{
+ min-width: 50px;
+ vertical-align: middle;
+}
+.succes-light{
+ display: inline-block;
+ font-weight: 400;
+ letter-spacing: .3px;
+ min-width: 85px;
+ margin-right: 10px;
+}
+.succes-light::before{
+ content: "";
+ display: inline-block;
+ width: 6px;
+ height: 6px;
+ margin-bottom: 2px;
+ border-radius: 6px;
+ background-color: #00E599;
+ margin-right: 8px;
+}
+.ant-list-header .succes-light::before{
+ display: none;
+}
+
+.trans-detail .trans-amount{
+ width: 90px;
+ margin-right: 2px;
+ text-align: right;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: inline-block;
+ vertical-align: bottom;
}
\ No newline at end of file
diff --git a/neo3-gui/neo3-gui/ClientApp/src/static/images/bg.svg b/neo3-gui/neo3-gui/ClientApp/src/static/images/bg.svg
index c27e9b9b..f8579331 100644
--- a/neo3-gui/neo3-gui/ClientApp/src/static/images/bg.svg
+++ b/neo3-gui/neo3-gui/ClientApp/src/static/images/bg.svg
@@ -1 +1,17 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/neo3-gui/neo3-gui/ClientApp/src/static/js/bundledemo.js b/neo3-gui/neo3-gui/ClientApp/src/static/js/bundledemo.js
index fa697ea8..01f6709c 100644
--- a/neo3-gui/neo3-gui/ClientApp/src/static/js/bundledemo.js
+++ b/neo3-gui/neo3-gui/ClientApp/src/static/js/bundledemo.js
@@ -35,919 +35,4 @@ ArrayBuffer.prototype.toScriptHash = Uint8Array.prototype.toScriptHash = functio
}).then(function (result) {
return new Neo.Uint160(result);
});
-};
-
-var Neo;
-(function (Neo) {
- var Wallets;
- (function (Wallets) {
- var Wallet = (function () {
- function Wallet() { }
- Object.defineProperty(Wallet, "CoinVersion", {
- get: function () { return 0x17; },
- enumerable: true,
- configurable: true
- });
- Wallet.toAddress = function (scriptHash) {
- var data = new Uint8Array(25);
- data[0] = Wallet.CoinVersion;
- Array.copy(new Uint8Array(scriptHash.bits.buffer), 0, data, 1, 20);
- return window.crypto.subtle.digest({ name: "SHA-256" }, new Uint8Array(data.buffer, 0, 21)).then(function (result) {
- return window.crypto.subtle.digest({ name: "SHA-256" }, result);
- }).then(function (result) {
- Array.copy(new Uint8Array(result), 0, data, 21, 4);
- return data.base58Encode();
- });
- };
- Wallet.toScriptHash = function (address) {
- var data = address.base58Decode();
- if (data.length !== 25)
- throw new RangeError();
- if (data[0] !== Wallet.CoinVersion)
- throw new RangeError();
- return window.crypto.subtle.digest({ name: "SHA-256" }, new Uint8Array(data.buffer, 0, data.length - 4)).then(function (result) {
- return window.crypto.subtle.digest({ name: "SHA-256" }, result);
- }).then(function (result) {
- var array = new Uint8Array(result);
- for (var i = 0; i < 4; i++)
- if (array[i] !== data[data.length - 4 + i])
- throw new RangeError();
- array = new Uint8Array(20);
- Array.copy(data, 1, array, 0, 20);
- return new Neo.Uint160(array.buffer);
- });
- };
- return Wallet;
- }());
- Wallets.Wallet = Wallet;
- })(Wallets = Neo.Wallets || (Neo.Wallets = {}));
-})(Neo || (Neo = {}));
-
-
-
-var __extends = function (d, b) {
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var Neo;
-(function (Neo) {
- var DB = 26;
- var DM = (1 << DB) - 1;
- var DV = DM + 1;
- var _minusone, _one, _zero;
-
- var BigInteger = (function () {
- function BigInteger(value) {
- this._sign = 0;
- this._bits = new Array();
- if (typeof value === "number") {
- if (!isFinite(value) || isNaN(value))
- throw new RangeError();
- var parts = BigInteger.getDoubleParts(value);
- if (parts.man.equals(Neo.Uint64.Zero) || parts.exp <= -64)
- return;
- if (parts.exp <= 0) {
- this.fromUint64(parts.man.rightShift(-parts.exp), parts.sign);
- }
- else if (parts.exp <= 11) {
- this.fromUint64(parts.man.leftShift(parts.exp), parts.sign);
- }
- else {
- parts.man = parts.man.leftShift(11);
- parts.exp -= 11;
- var units = Math.ceil((parts.exp + 64) / DB);
- var cu = Math.ceil(parts.exp / DB);
- var cbit = cu * DB - parts.exp;
- for (var i = cu; i < units; i++)
- this._bits[i] = parts.man.rightShift(cbit + (i - cu) * DB).toUint32() & DM;
- if (cbit > 0)
- this._bits[cu - 1] = (parts.man.toUint32() << (DB - cbit)) & DM;
- this._sign = parts.sign;
- this.clamp();
- }
- }
- else if (typeof value === "string") {
- this.fromString(value);
- }
- else if (value instanceof ArrayBuffer) {
- this.fromUint8Array(new Uint8Array(value));
- }
- else if (value instanceof Uint8Array) {
- this.fromUint8Array(value);
- }
- }
- Object.defineProperty(BigInteger, "MinusOne", {
- get: function () { return _minusone || (_minusone = new BigInteger(-1)); },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(BigInteger, "One", {
- get: function () { return _one || (_one = new BigInteger(1)); },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(BigInteger, "Zero", {
- get: function () { return _zero || (_zero = new BigInteger(0)); },
- enumerable: true,
- configurable: true
- });
- BigInteger.add = function (x, y) {
- var bi_x = typeof x === "number" ? new BigInteger(x) : x;
- var bi_y = typeof y === "number" ? new BigInteger(y) : y;
- if (bi_x._sign === 0)
- return bi_y;
- if (bi_y._sign === 0)
- return bi_x;
- if ((bi_x._sign > 0) !== (bi_y._sign > 0))
- return BigInteger.subtract(bi_x, bi_y.negate());
- var bits_r = new Array();
- BigInteger.addTo(bi_x._bits, bi_y._bits, bits_r);
- return BigInteger.create(bi_x._sign, bits_r);
- };
- BigInteger.prototype.add = function (other) {
- return BigInteger.add(this, other);
- };
- BigInteger.addTo = function (x, y, r) {
- if (x.length < y.length) {
- var t = x;
- x = y;
- y = t;
- }
- var c = 0, i = 0;
- while (i < y.length) {
- c += x[i] + y[i];
- r[i++] = c & DM;
- c >>>= DB;
- }
- while (i < x.length) {
- c += x[i];
- r[i++] = c & DM;
- c >>>= DB;
- }
- if (c > 0)
- r[i] = c;
- };
- BigInteger.prototype.bitLength = function () {
- var l = this._bits.length;
- if (l === 0)
- return 0;
- return --l * DB + BigInteger.bitLengthInternal(this._bits[l]);
- };
- BigInteger.bitLengthInternal = function (w) {
- return (w < 1 << 15 ? (w < 1 << 7
- ? (w < 1 << 3 ? (w < 1 << 1
- ? (w < 1 << 0 ? (w < 0 ? 32 : 0) : 1)
- : (w < 1 << 2 ? 2 : 3)) : (w < 1 << 5
- ? (w < 1 << 4 ? 4 : 5)
- : (w < 1 << 6 ? 6 : 7)))
- : (w < 1 << 11
- ? (w < 1 << 9 ? (w < 1 << 8 ? 8 : 9) : (w < 1 << 10 ? 10 : 11))
- : (w < 1 << 13 ? (w < 1 << 12 ? 12 : 13) : (w < 1 << 14 ? 14 : 15)))) : (w < 1 << 23 ? (w < 1 << 19
- ? (w < 1 << 17 ? (w < 1 << 16 ? 16 : 17) : (w < 1 << 18 ? 18 : 19))
- : (w < 1 << 21 ? (w < 1 << 20 ? 20 : 21) : (w < 1 << 22 ? 22 : 23))) : (w < 1 << 27
- ? (w < 1 << 25 ? (w < 1 << 24 ? 24 : 25) : (w < 1 << 26 ? 26 : 27))
- : (w < 1 << 29 ? (w < 1 << 28 ? 28 : 29) : (w < 1 << 30 ? 30 : 31)))));
- };
- BigInteger.prototype.clamp = function () {
- var l = this._bits.length;
- while (l > 0 && (this._bits[--l] | 0) === 0)
- this._bits.pop();
- while (l > 0)
- this._bits[--l] |= 0;
- if (this._bits.length === 0)
- this._sign = 0;
- };
- BigInteger.compare = function (x, y) {
- var bi_x = typeof x === "number" ? new BigInteger(x) : x;
- var bi_y = typeof y === "number" ? new BigInteger(y) : y;
- if (bi_x._sign >= 0 && bi_y._sign < 0)
- return +1;
- if (bi_x._sign < 0 && bi_y._sign >= 0)
- return -1;
- var c = BigInteger.compareAbs(bi_x, bi_y);
- return bi_x._sign < 0 ? -c : c;
- };
- BigInteger.compareAbs = function (x, y) {
- if (x._bits.length > y._bits.length)
- return +1;
- if (x._bits.length < y._bits.length)
- return -1;
- for (var i = x._bits.length - 1; i >= 0; i--)
- if (x._bits[i] > y._bits[i])
- return +1;
- else if (x._bits[i] < y._bits[i])
- return -1;
- return 0;
- };
- BigInteger.prototype.compareTo = function (other) {
- return BigInteger.compare(this, other);
- };
- BigInteger.create = function (sign, bits, clamp) {
- if (clamp === void 0) { clamp = false; }
- var bi = Object.create(BigInteger.prototype);
- bi._sign = sign;
- bi._bits = bits;
- if (clamp)
- bi.clamp();
- return bi;
- };
- BigInteger.divRem = function (x, y) {
- var bi_x = typeof x === "number" ? new BigInteger(x) : x;
- var bi_y = typeof y === "number" ? new BigInteger(y) : y;
- if (bi_y._sign === 0)
- throw new RangeError();
- if (bi_x._sign === 0)
- return { result: BigInteger.Zero, remainder: BigInteger.Zero };
- if (bi_y._sign === 1 && bi_y._bits === null)
- return { result: bi_x, remainder: BigInteger.Zero };
- if (bi_y._sign === -1 && bi_y._bits === null)
- return { result: bi_x.negate(), remainder: BigInteger.Zero };
- var sign_result = (bi_x._sign > 0) === (bi_y._sign > 0) ? +1 : -1;
- var c = BigInteger.compareAbs(bi_x, bi_y);
- if (c === 0)
- return { result: sign_result > 0 ? BigInteger.One : BigInteger.MinusOne, remainder: BigInteger.Zero };
- if (c < 0)
- return { result: BigInteger.Zero, remainder: bi_x };
- var bits_result = new Array();
- var bits_rem = new Array();
- Array.copy(bi_x._bits, 0, bits_rem, 0, bi_x._bits.length);
- var df = bi_y._bits[bi_y._bits.length - 1];
- for (var i = bi_x._bits.length - 1; i >= bi_y._bits.length - 1; i--) {
- var offset = i - bi_y._bits.length + 1;
- var d = bits_rem[i] + (bits_rem[i + 1] || 0) * DV;
- var max = Math.floor(d / df);
- if (max > DM)
- max = DM;
- var min = 0;
- while (min !== max) {
- var bits_sub_1 = new Array(offset + bi_y._bits.length);
- for (var i_1 = 0; i_1 < offset; i_1++)
- bits_sub_1[i_1] = 0;
- bits_result[offset] = Math.ceil((min + max) / 2);
- BigInteger.multiplyTo(bi_y._bits, [bits_result[offset]], bits_sub_1, offset);
- if (BigInteger.subtractTo(bits_rem, bits_sub_1))
- max = bits_result[offset] - 1;
- else
- min = bits_result[offset];
- }
- var bits_sub = new Array(offset + bi_y._bits.length);
- for (var i_2 = 0; i_2 < offset; i_2++)
- bits_sub[i_2] = 0;
- bits_result[offset] = min;
- BigInteger.multiplyTo(bi_y._bits, [bits_result[offset]], bits_sub, offset);
- BigInteger.subtractTo(bits_rem, bits_sub, bits_rem);
- }
- return { result: BigInteger.create(sign_result, bits_result, true), remainder: BigInteger.create(bi_x._sign, bits_rem, true) };
- };
- BigInteger.fromString = function (str, radix) {
- if (radix === void 0) { radix = 10; }
- var bi = Object.create(BigInteger.prototype);
- bi.fromString(str, radix);
- return bi;
- };
- BigInteger.prototype.fromString = function (str, radix) {
- if (radix === void 0) { radix = 10; }
- if (radix < 2 || radix > 36)
- throw new RangeError();
- if (str.length === 0) {
- return;
- }
- var bits_radix = [radix];
- var bits_a = [0];
- var first = str.charCodeAt(0);
- var withsign = first === 0x2b || first === 0x2d;
- this._sign = first === 0x2d ? -1 : +1;
- this._bits = [];
- for (var i = withsign ? 1 : 0; i < str.length; i++) {
- bits_a[0] = str.charCodeAt(i);
- if (bits_a[0] >= 0x30 && bits_a[0] <= 0x39)
- bits_a[0] -= 0x30;
- else if (bits_a[0] >= 0x41 && bits_a[0] <= 0x5a)
- bits_a[0] -= 0x37;
- else if (bits_a[0] >= 0x61 && bits_a[0] <= 0x7a)
- bits_a[0] -= 0x57;
- else
- throw new RangeError();
- var bits_temp = new Array();
- BigInteger.multiplyTo(this._bits, bits_radix, bits_temp);
- BigInteger.addTo(bits_temp, bits_a, this._bits);
- }
- this.clamp();
- };
- BigInteger.fromUint8Array = function (arr, sign, littleEndian) {
- if (sign === void 0) { sign = 1; }
- if (littleEndian === void 0) { littleEndian = true; }
- var bi = Object.create(BigInteger.prototype);
- bi.fromUint8Array(arr, sign, littleEndian);
- return bi;
- };
- BigInteger.prototype.fromUint8Array = function (arr, sign, littleEndian) {
- if (sign === void 0) { sign = 1; }
- if (littleEndian === void 0) { littleEndian = true; }
- if (!littleEndian) {
- var arr_new = new Uint8Array(arr.length);
- for (var i = 0; i < arr.length; i++)
- arr_new[arr.length - 1 - i] = arr[i];
- arr = arr_new;
- }
- var actual_length = BigInteger.getActualLength(arr);
- var bits = actual_length * 8;
- var units = Math.ceil(bits / DB);
- this._bits = [];
- for (var i = 0; i < units; i++) {
- var cb = i * DB;
- var cu = Math.floor(cb / 8);
- cb %= 8;
- this._bits[i] = ((arr[cu] | arr[cu + 1] << 8 | arr[cu + 2] << 16 | arr[cu + 3] << 24) >>> cb) & DM;
- }
- this._sign = sign < 0 ? -1 : +1;
- this.clamp();
- };
- BigInteger.prototype.fromUint64 = function (i, sign) {
- while (i.bits[0] !== 0 || i.bits[1] !== 0) {
- this._bits.push(i.toUint32() & DM);
- i = i.rightShift(DB);
- }
- this._sign = sign;
- this.clamp();
- };
- BigInteger.getActualLength = function (arr) {
- var actual_length = arr.length;
- for (var i = arr.length - 1; i >= 0; i--)
- if (arr[i] !== 0) {
- actual_length = i + 1;
- break;
- }
- return actual_length;
- };
- BigInteger.getDoubleParts = function (dbl) {
- var uu = new Uint32Array(2);
- new Float64Array(uu.buffer)[0] = dbl;
- var result = {
- sign: 1 - ((uu[1] >>> 30) & 2),
- man: new Neo.Uint64(uu[0], uu[1] & 0x000FFFFF),
- exp: (uu[1] >>> 20) & 0x7FF,
- fFinite: true
- };
- if (result.exp === 0) {
- if (!result.man.equals(Neo.Uint64.Zero))
- result.exp = -1074;
- }
- else if (result.exp === 0x7FF) {
- result.fFinite = false;
- }
- else {
- result.man = result.man.or(new Neo.Uint64(0, 0x00100000));
- result.exp -= 1075;
- }
- return result;
- };
- BigInteger.prototype.isZero = function () {
- return this._sign === 0;
- };
- BigInteger.mod = function (x, y) {
- var bi_x = typeof x === "number" ? new BigInteger(x) : x;
- var bi_y = typeof y === "number" ? new BigInteger(y) : y;
- var bi_new = BigInteger.divRem(bi_x, bi_y).remainder;
- if (bi_new._sign < 0)
- bi_new = BigInteger.add(bi_new, bi_y);
- return bi_new;
- };
- BigInteger.multiply = function (x, y) {
- var bi_x = typeof x === "number" ? new BigInteger(x) : x;
- var bi_y = typeof y === "number" ? new BigInteger(y) : y;
- if (bi_x._sign === 0)
- return bi_x;
- if (bi_y._sign === 0)
- return bi_y;
- if (bi_x._sign === 1 && bi_x._bits === null)
- return bi_y;
- if (bi_x._sign === -1 && bi_x._bits === null)
- return bi_y.negate();
- if (bi_y._sign === 1 && bi_y._bits === null)
- return bi_x;
- if (bi_y._sign === -1 && bi_y._bits === null)
- return bi_x.negate();
- var bits_r = new Array();
- BigInteger.multiplyTo(bi_x._bits, bi_y._bits, bits_r);
- return BigInteger.create((bi_x._sign > 0) === (bi_y._sign > 0) ? +1 : -1, bits_r);
- };
- BigInteger.prototype.multiply = function (other) {
- return BigInteger.multiply(this, other);
- };
- BigInteger.multiplyTo = function (x, y, r, offset) {
- if (offset === void 0) { offset = 0; }
- if (x.length > y.length) {
- var t = x;
- x = y;
- y = t;
- }
- for (var i = x.length + y.length - 2; i >= 0; i--)
- r[i + offset] = 0;
- for (var i = 0; i < x.length; i++) {
- if (x[i] === 0)
- continue;
- for (var j = 0; j < y.length; j++) {
- var c = x[i] * y[j];
- if (c === 0)
- continue;
- var k = i + j;
- do {
- c += r[k + offset] || 0;
- r[k + offset] = c & DM;
- c = Math.floor(c / DV);
- k++;
- } while (c > 0);
- }
- }
- };
- BigInteger.parse = function (str) {
- return BigInteger.fromString(str);
- };
- BigInteger.pow = function (value, exponent) {
- var bi_v = typeof value === "number" ? new BigInteger(value) : value;
- if (exponent < 0 || exponent > 0x7fffffff)
- throw new RangeError();
- if (exponent === 0)
- return BigInteger.One;
- if (exponent === 1)
- return bi_v;
- if (bi_v._sign === 0)
- return bi_v;
- if (bi_v._bits.length === 1) {
- if (bi_v._bits[0] === 1)
- return bi_v;
- if (bi_v._bits[0] === -1)
- return (exponent & 1) !== 0 ? bi_v : BigInteger.One;
- }
- var h = BigInteger.bitLengthInternal(exponent);
- var bi_new = BigInteger.One;
- for (var i = 0; i < h; i++) {
- var e = 1 << i;
- if (e > 1)
- bi_v = BigInteger.multiply(bi_v, bi_v);
- if ((exponent & e) !== 0)
- bi_new = BigInteger.multiply(bi_v, bi_new);
- }
- return bi_new;
- };
- BigInteger.prototype.pow = function (exponent) {
- return BigInteger.pow(this, exponent);
- };
- BigInteger.random = function (bitLength, rng) {
- if (bitLength === 0)
- return BigInteger.Zero;
- var bytes = new Uint8Array(Math.ceil(bitLength / 8));
- if (rng === null) {
- for (var i = 0; i < bytes.length; i++)
- bytes[i] = Math.random() * 256;
- }
- else {
- rng.getRandomValues(bytes);
- }
- bytes[bytes.length - 1] &= 0xff >>> (8 - bitLength % 8);
- return new BigInteger(bytes);
- };
-
- BigInteger.subtract = function (x, y) {
- var bi_x = typeof x === "number" ? new BigInteger(x) : x;
- var bi_y = typeof y === "number" ? new BigInteger(y) : y;
- if (bi_x._sign === 0)
- return bi_y.negate();
- if (bi_y._sign === 0)
- return bi_x;
- if ((bi_x._sign > 0) !== (bi_y._sign > 0))
- return BigInteger.add(bi_x, bi_y.negate());
- var c = BigInteger.compareAbs(bi_x, bi_y);
- if (c === 0)
- return BigInteger.Zero;
- if (c < 0)
- return BigInteger.subtract(bi_y, bi_x).negate();
- var bits_r = new Array();
- BigInteger.subtractTo(bi_x._bits, bi_y._bits, bits_r);
- return BigInteger.create(bi_x._sign, bits_r, true);
- };
- BigInteger.prototype.subtract = function (other) {
- return BigInteger.subtract(this, other);
- };
- BigInteger.subtractTo = function (x, y, r) {
- if (r === null)
- r = [];
- var l = Math.min(x.length, y.length);
- var c = 0, i = 0;
- while (i < l) {
- c += x[i] - y[i];
- r[i++] = c & DM;
- c >>= DB;
- }
- if (x.length < y.length)
- while (i < y.length) {
- c -= y[i];
- r[i++] = c & DM;
- c >>= DB;
- }
- else
- while (i < x.length) {
- c += x[i];
- r[i++] = c & DM;
- c >>= DB;
- }
- return c < 0;
- };
- BigInteger.prototype.toInt32 = function () {
- if (this._sign === 0)
- return 0;
- if (this._bits.length === 1)
- return this._bits[0] * this._sign;
- return ((this._bits[0] | this._bits[1] * DV) & 0x7fffffff) * this._sign;
- };
- BigInteger.prototype.toString = function (radix) {
- if (radix === void 0) { radix = 10; }
- if (this._sign === 0)
- return "0";
- if (radix < 2 || radix > 36)
- throw new RangeError();
- var s = "";
- for (var bi = this; bi._sign !== 0;) {
- var r = BigInteger.divRem(bi, radix);
- var rem = Math.abs(r.remainder.toInt32());
- if (rem < 10)
- rem += 0x30;
- else
- rem += 0x57;
- s = String.fromCharCode(rem) + s;
- bi = r.result;
- }
- if (this._sign < 0)
- s = "-" + s;
- return s;
- };
- BigInteger.prototype.toUint8Array = function (littleEndian, length) {
- if (littleEndian === void 0) { littleEndian = true; }
- if (this._sign === 0)
- return new Uint8Array(length || 1);
- var cb = Math.ceil(this._bits.length * DB / 8);
- var array = new Uint8Array(length || cb);
- for (var i = 0; i < array.length; i++) {
- var offset = littleEndian ? i : array.length - 1 - i;
- var cbits = i * 8;
- var cu = Math.floor(cbits / DB);
- cbits %= DB;
- if (DB - cbits < 8)
- array[offset] = (this._bits[cu] >>> cbits | this._bits[cu + 1] << (DB - cbits)) & 0xff;
- else
- array[offset] = this._bits[cu] >>> cbits & 0xff;
- }
- length = length || BigInteger.getActualLength(array);
- if (length < array.length)
- array = array.subarray(0, length);
- return array;
- };
- return BigInteger;
- }());
- Neo.BigInteger = BigInteger;
-
- var UintVariable = (function () {
- function UintVariable(bits) {
- if (typeof bits === "number") {
- if (bits <= 0 || bits % 32 !== 0)
- throw new RangeError();
- this._bits = new Uint32Array(bits / 32);
- }
- else if (bits instanceof Uint8Array) {
- if (bits.length === 0 || bits.length % 4 !== 0)
- throw new RangeError();
- if (bits.byteOffset % 4 === 0) {
- this._bits = new Uint32Array(bits.buffer, bits.byteOffset, bits.length / 4);
- }
- else {
- var bits_new = new Uint8Array(bits);
- this._bits = new Uint32Array(bits_new.buffer);
- }
- }
- else if (bits instanceof Uint32Array) {
- this._bits = bits;
- }
- else if (bits instanceof Array) {
- if (bits.length === 0)
- throw new RangeError();
- this._bits = new Uint32Array(bits);
- }
- }
- Object.defineProperty(UintVariable.prototype, "bits", {
- get: function () {
- return this._bits;
- },
- enumerable: true,
- configurable: true
- });
- UintVariable.prototype.equals = function (other) {
- var max = Math.max(this._bits.length, other._bits.length);
- for (var i = 0; i < max; i++)
- if ((this._bits[i] || 0) !== (other._bits[i] || 0))
- return false;
- return true;
- };
- UintVariable.prototype.toString = function () {
- var s = "";
- for (var i = this._bits.length * 32 - 4; i >= 0; i -= 4)
- s += ((this._bits[i >>> 5] >>> (i % 32)) & 0xf).toString(16);
- return s;
- };
- return UintVariable;
- }());
- Neo.UintVariable = UintVariable;
- var _zero;
- var Uint160 = (function (_super) {
- __extends(Uint160, _super);
- function Uint160(value) {
- var _this = this;
- if (value === null)
- value = new ArrayBuffer(20);
- if (value.byteLength !== 20)
- throw new RangeError();
- _this = _super.call(this, new Uint32Array(value)) || this;
- return _this;
- }
- Object.defineProperty(Uint160, "Zero", {
- get: function () { return _zero || (_zero = new Uint160()); },
- enumerable: true,
- configurable: true
- });
- Uint160.parse = function (str) {
- if (str.length !== 40)
- throw new RangeError();
- var x = str.hexToBytes();
- var y = new Uint8Array(x.length);
- for (var i = 0; i < y.length; i++)
- y[i] = x[x.length - i - 1];
- return new Uint160(y.buffer);
- };
- return Uint160;
- }(Neo.UintVariable));
- Neo.Uint160 = Uint160;
-
- var _max, _min;
- var Uint64 = (function (_super) {
- __extends(Uint64, _super);
- function Uint64(low, high) {
- if (low === void 0) { low = 0; }
- if (high === void 0) { high = 0; }
- return _super.call(this, [low, high]) || this;
- }
- Object.defineProperty(Uint64, "MaxValue", {
- get: function () { return _max || (_max = new Uint64(0xffffffff, 0xffffffff)); },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Uint64, "MinValue", {
- get: function () { return _min || (_min = new Uint64()); },
- enumerable: true,
- configurable: true
- });
- Object.defineProperty(Uint64, "Zero", {
- get: function () { return Uint64.MinValue; },
- enumerable: true,
- configurable: true
- });
- Uint64.prototype.and = function (other) {
- if (typeof other === "number") {
- return this.and(new Uint64(other));
- }
- else {
- var bits = new Uint32Array(this._bits.length);
- for (var i = 0; i < bits.length; i++)
- bits[i] = this._bits[i] & other._bits[i];
- return new Uint64(bits[0], bits[1]);
- }
- };
- Uint64.prototype.not = function () {
- var bits = new Uint32Array(this._bits.length);
- for (var i = 0; i < bits.length; i++)
- bits[i] = ~this._bits[i];
- return new Uint64(bits[0], bits[1]);
- };
- Uint64.prototype.or = function (other) {
- if (typeof other === "number") {
- return this.or(new Uint64(other));
- }
- else {
- var bits = new Uint32Array(this._bits.length);
- for (var i = 0; i < bits.length; i++)
- bits[i] = this._bits[i] | other._bits[i];
- return new Uint64(bits[0], bits[1]);
- }
- };
- Uint64.parse = function (str) {
- var bi = Neo.BigInteger.parse(str);
- if (bi.bitLength() > 64)
- throw new RangeError();
- var array = new Uint32Array(bi.toUint8Array(true, 8).buffer);
- return new Uint64(array[0], array[1]);
- };
- Uint64.prototype.rightShift = function (shift) {
- if (shift === 0)
- return this;
- var shift_units = shift >>> 5;
- shift = shift & 0x1f;
- var bits = new Uint32Array(this._bits.length);
- for (var i = 0; i < bits.length - shift_units; i++)
- if (shift === 0)
- bits[i] = this._bits[i + shift_units];
- else
- bits[i] = this._bits[i + shift_units] >>> shift | this._bits[i + shift_units + 1] << (32 - shift);
- return new Uint64(bits[0], bits[1]);
- };
- Uint64.prototype.subtract = function (other) {
- var low = this._bits[0] - other._bits[0];
- var high = this._bits[1] - other._bits[1] - (this._bits[0] < other._bits[0] ? 1 : 0);
- return new Uint64(low, high);
- };
- Uint64.prototype.toString = function () {
- return (new Neo.BigInteger(this._bits.buffer)).toString();
- };
- Uint64.prototype.toUint32 = function () {
- return this._bits[0];
- };
- return Uint64;
- }(Neo.UintVariable));
- Neo.Uint64 = Uint64;
-})(Neo || (Neo = {}));
-
-var Neo;
-(function (Neo) {
- var Cryptography;
- (function (Cryptography) {
- var Base58 = (function () {
- function Base58() {
- }
- Base58.decode = function (input) {
- var bi = Neo.BigInteger.Zero;
- for (var i = input.length - 1; i >= 0; i--) {
- var index = Base58.Alphabet.indexOf(input[i]);
- if (index === -1)
- throw new RangeError();
- bi = Neo.BigInteger.add(bi, Neo.BigInteger.multiply(Neo.BigInteger.pow(Base58.Alphabet.length, input.length - 1 - i), index));
- }
- var bytes = bi.toUint8Array();
- var leadingZeros = 0;
- for (var i = 0; i < input.length && input[i] === Base58.Alphabet[0]; i++) {
- leadingZeros++;
- }
- var tmp = new Uint8Array(bytes.length + leadingZeros);
- for (var i = 0; i < bytes.length; i++)
- tmp[i + leadingZeros] = bytes[bytes.length - 1 - i];
- return tmp;
- };
- Base58.encode = function (input) {
- var value = Neo.BigInteger.fromUint8Array(input, 1, false);
- var s = "";
- while (!value.isZero()) {
- var r = Neo.BigInteger.divRem(value, Base58.Alphabet.length);
- s = Base58.Alphabet[r.remainder.toInt32()] + s;
- value = r.result;
- }
- for (var i = 0; i < input.length; i++) {
- if (input[i] === 0)
- s = Base58.Alphabet[0] + s;
- else
- break;
- }
- return s;
- };
- return Base58;
- }());
- Base58.Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
- Cryptography.Base58 = Base58;
- })(Cryptography = Neo.Cryptography || (Neo.Cryptography = {}));
-})(Neo || (Neo = {}));
-var Neo;
-(function (Neo) {
- var Cryptography;
- (function (Cryptography) {
- String.prototype.base58Decode = function () {
- return Cryptography.Base58.decode(this);
- };
- Uint8Array.prototype.base58Encode = function () {
- return Cryptography.Base58.encode(this);
- };
- Uint8Array.prototype.base64UrlEncode = function () {
- var str = String.fromCharCode.apply(null, this);
- str = window.btoa(str);
- return str.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
- };
- var getAlgorithmName = function (algorithm) { return typeof algorithm === "string" ? algorithm : algorithm.name; };
- var w = window;
- if (window.crypto === null)
- window.crypto = { subtle: null, getRandomValues: null };
- if (window.crypto.getRandomValues === null) {
- if (w.msCrypto) {
- w.crypto.getRandomValues = function (array) { return w.msCrypto.getRandomValues(array); };
- }
- else {
- Cryptography.RandomNumberGenerator.startCollectors();
- window.crypto.getRandomValues = Cryptography.RandomNumberGenerator.getRandomValues;
- }
- }
- if (window.crypto.subtle === null) {
- window.crypto.subtle = {
- decrypt: function (algorithm, key, data) { return new Promise(function (resolve, reject) {
- if (typeof algorithm === "string" || algorithm.name !== "AES-CBC" || !algorithm.iv || algorithm.iv.byteLength !== 16 || data.byteLength % 16 !== 0) {
- reject(new RangeError());
- return;
- }
- try {
- var aes = new Cryptography.Aes(key.export(), algorithm.iv);
- resolve(aes.decrypt(data));
- }
- catch (e) {
- reject(e);
- }
- }); },
- deriveBits: null,
- deriveKey: null,
- digest: function (algorithm, data) { return new Promise(function (resolve, reject) {
- if (getAlgorithmName(algorithm) !== "SHA-256") {
- reject(new RangeError());
- return;
- }
- try {
- resolve(Cryptography.Sha256.computeHash(data));
- }
- catch (e) {
- reject(e);
- }
- }); },
- encrypt: function (algorithm, key, data) { return new Promise(function (resolve, reject) {
- if (typeof algorithm === "string" || algorithm.name !== "AES-CBC" || !algorithm.iv || algorithm.iv.byteLength !== 16) {
- reject(new RangeError());
- return;
- }
- try {
- var aes = new Cryptography.Aes(key.export(), algorithm.iv);
- resolve(aes.encrypt(data));
- }
- catch (e) {
- reject(e);
- }
- }); },
- exportKey: function (format, key) { return new Promise(function (resolve, reject) {
- if (format !== "jwk" || !(key instanceof Cryptography.AesCryptoKey)) {
- reject(new RangeError());
- return;
- }
- try {
- var k = key;
- resolve({
- alg: "A256CBC",
- ext: true,
- k: k.export().base64UrlEncode(),
- key_ops: k.usages,
- kty: "oct"
- });
- }
- catch (e) {
- reject(e);
- }
- }); },
- generateKey: function (algorithm, extractable, keyUsages) { return new Promise(function (resolve, reject) {
- if (typeof algorithm === "string" || algorithm.name !== "AES-CBC" || (algorithm.length !== 128 && algorithm.length !== 192 && algorithm.length !== 256)) {
- reject(new RangeError());
- return;
- }
- try {
- resolve(Cryptography.AesCryptoKey.create(algorithm.length));
- }
- catch (e) {
- reject(e);
- }
- }); },
- importKey: function (format, keyData, algorithm, extractable, keyUsages) { return new Promise(function (resolve, reject) {
- if ((format !== "raw" && format !== "jwk") || getAlgorithmName(algorithm) !== "AES-CBC") {
- reject(new RangeError());
- return;
- }
- try {
- if (format === "jwk")
- keyData = keyData.k.base64UrlDecode();
- resolve(Cryptography.AesCryptoKey.import(keyData));
- }
- catch (e) {
- reject(e);
- }
- }); },
- sign: null,
- unwrapKey: null,
- verify: null,
- wrapKey: null,
- };
- }
- try {
- window.crypto.subtle.generateKey({ name: "ECDSA", namedCurve: "P-256" }, false, ["sign", "verify"]).catch();
- }
- catch (ex) {
- }
- })(Cryptography = Neo.Cryptography || (Neo.Cryptography = {}));
-})(Neo || (Neo = {}));
-
-window.Neo = Neo;
\ No newline at end of file
+};
\ No newline at end of file