-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
1,126 additions
and
565 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"standard.enable": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "ansy", | ||
"version": "1.4.0", | ||
"version": "2.0.0", | ||
"main": "src/index.js", | ||
"author": "Yak Jun Xiang <[email protected]>", | ||
"license": "MIT", | ||
|
@@ -15,6 +15,7 @@ | |
"dependencies": { | ||
"bigi": "^1.4.2", | ||
"bs58": "^4.0.1", | ||
"bs58check": "^2.0.2", | ||
"crypto-js": "^3.1.9-1", | ||
"ecurve": "^1.0.5", | ||
"hash.js": "^1.1.3", | ||
|
@@ -24,7 +25,8 @@ | |
"qrcode": "^0.8.2", | ||
"react": "^15.6.1", | ||
"react-dom": "^15.6.1", | ||
"react-scripts": "^1.0.10" | ||
"react-scripts": "^1.0.10", | ||
"scryptsy": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^3.19.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
import QR from './QR.js' | ||
import Wallet from './Wallet' | ||
|
||
export default class NEP2Wallet extends Wallet { | ||
constructor(props) { | ||
super(props) | ||
this.state.nep2 = this.props.data.nep2 | ||
} | ||
toggle() { | ||
this.props.toggleCallback(this.state.address, 'Normal') | ||
} | ||
render() { | ||
let leftAlign = { textAlign: 'left' } | ||
const uiStyle = { flexGrow: 0, flexBasis: 0, width: 0 } | ||
const cardStyle = { flexGrow: 1, margin: 0 } | ||
const noSpace = { padding: 0, paddingLeft: "0.6rem" } | ||
const noResize = { resize: "none" } | ||
return ( | ||
<div className="wallet full flex three"> | ||
<article className="card paper" style={cardStyle}> | ||
<header style={noSpace}> | ||
<div className="flex grow"> | ||
<input className="wallet-input" placeholder="Address / Public Key" /> | ||
</div> | ||
</header> | ||
<div> | ||
<div className="flex two"> | ||
<QR name="Address" str={this.state.address} /> | ||
<QR name="Public Key" str={this.state.public} /> | ||
</div> | ||
<footer style={noSpace}> | ||
<div className="flex grow"> | ||
<textarea className="wallet-input" rows={2} style={noResize} placeholder={this.state.address} /> | ||
</div> | ||
</footer> | ||
</div> | ||
</article> | ||
<article className="card paper" style={cardStyle}> | ||
<header style={noSpace}> | ||
<div className="flex grow"> | ||
<input className="wallet-input" defaultValue="Private Keys" style={leftAlign} /> | ||
</div> | ||
</header> | ||
<div> | ||
<div className="flex one"> | ||
<QR name="NEP2" str={this.state.nep2} /> | ||
</div> | ||
<footer style={noSpace}> | ||
<div className="flex grow"> | ||
<textarea className="wallet-input" rows={2} defaultValue={this.state.nep2} style={noResize} /> | ||
</div> | ||
</footer> | ||
</div> | ||
</article> | ||
<div className="wallet-ui no-print" style={uiStyle}> | ||
<button onClick={this.remove}>X</button> | ||
{this.props.data.private ? <button onClick={this.toggle}>{'<'}</button> : null} | ||
</div> | ||
</div> | ||
) | ||
} | ||
} | ||
NEP2Wallet.propTypes = { | ||
data: PropTypes.object.isRequired, | ||
removeCallback: PropTypes.func | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.