Merge pull request #37 from Permissionless-Software-Foundation/ct-unstable

Automatic IPFS has retrieval.
This commit is contained in:
Chris Troutner
2020-07-10 19:55:34 -07:00
committed by GitHub
5 changed files with 203 additions and 36 deletions
+129
View File
@@ -26875,6 +26875,135 @@
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
},
"memo-get-gatsby": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/memo-get-gatsby/-/memo-get-gatsby-1.0.2.tgz",
"integrity": "sha512-oGmKuwRC4oy43pZoiBGF9nQPDeB6xh4YhDm2+LpubaoTdpjw4sr/3bXege8CMj4uIY0/hbiMyaOMZr1we/pkAw==",
"requires": {
"@chris.troutner/bch-js": "3.2.1"
},
"dependencies": {
"@chris.troutner/bch-js": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/@chris.troutner/bch-js/-/bch-js-3.2.1.tgz",
"integrity": "sha512-PWiaDh23RQqhvBnmfsQhMtDWKJJA1ExqXZZEuCTHaQMTsIhTGiIEYChNKAKueh7ARItBaDqHwtcOEtmQyOGjUQ==",
"requires": {
"@uppy/core": "^1.10.4",
"@uppy/tus": "^1.5.12",
"apidoc": "^0.17.7",
"assert": "^2.0.0",
"axios": "^0.19.0",
"bc-bip68": "^1.0.5",
"bch-wallet-bridge.js": "github:web3bch/bch-wallet-bridge.js#master",
"bchaddrjs-slp": "^0.2.5",
"bigi": "^1.4.2",
"bignumber.js": "^9.0.0",
"bip-schnorr": "^0.3.0",
"bip21": "github:Bitcoin-com/bip21",
"bip32-utils": "github:Bitcoin-com/bip32-utils#0.13.1",
"bip38": "^2.0.2",
"bip39": "^3.0.2",
"bip66": "^1.1.5",
"bitcoincash-ops": "github:christroutner/bitcoincash-ops",
"bitcoincashjs-lib": "github:christroutner/bitcoincashjs-lib#master",
"bitcoinjs-message": "^2.0.0",
"bs58": "^4.0.1",
"buffer": "^5.1.0",
"cashaddrjs": "^0.3.3",
"chalk": "^2.3.0",
"clear": "0.1.0",
"coininfo": "github:Bitcoin-com/coininfo",
"commander": "^3.0.0",
"cp-file": "^7.0.0",
"ecurve": "^1.0.6",
"figlet": "^1.2.0",
"git-clone": "^0.1.0",
"ini": "^1.3.5",
"mkdirp": "^0.5.1",
"node-cmd": "^3.0.0",
"node-emoji": "^1.8.1",
"qrcode": "^1.4.1",
"randombytes": "^2.0.6",
"repl.history": "^0.1.4",
"safe-buffer": "^5.1.2",
"satoshi-bitcoin": "^1.0.4",
"slp-mdm": "0.0.6",
"slp-parser": "0.0.4",
"socket.io": "^2.1.1",
"socket.io-client": "^2.1.1",
"touch": "^3.1.0",
"wif": "^2.0.6"
}
},
"apidoc": {
"version": "0.17.7",
"resolved": "https://registry.npmjs.org/apidoc/-/apidoc-0.17.7.tgz",
"integrity": "sha512-9Wf4bRPwCuWOIOxR42dDnsXnFw+rhJg5VrMQK+KmNxJwyIh30UqX6gvjjXSG6YO74MqE87F18bbQXUENK9dPGg==",
"requires": {
"apidoc-core": "~0.8.2",
"commander": "^2.19.0",
"fs-extra": "^7.0.0",
"lodash": "^4.17.10",
"markdown-it": "^8.3.1",
"winston": "^3.0.0"
},
"dependencies": {
"commander": {
"version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
}
}
},
"assert": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz",
"integrity": "sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==",
"requires": {
"es6-object-assign": "^1.1.0",
"is-nan": "^1.2.1",
"object-is": "^1.0.1",
"util": "^0.12.0"
}
},
"commander": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz",
"integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow=="
},
"fs-extra": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz",
"integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==",
"requires": {
"graceful-fs": "^4.1.2",
"jsonfile": "^4.0.0",
"universalify": "^0.1.0"
}
},
"touch": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz",
"integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==",
"requires": {
"nopt": "~1.0.10"
}
},
"util": {
"version": "0.12.3",
"resolved": "https://registry.npmjs.org/util/-/util-0.12.3.tgz",
"integrity": "sha512-I8XkoQwE+fPQEhy9v012V+TSdH2kp9ts29i20TaaDUXsg7x/onePbhFJUExBfv/2ay1ZOp/Vsm3nDlmnFGSAog==",
"requires": {
"inherits": "^2.0.3",
"is-arguments": "^1.0.4",
"is-generator-function": "^1.0.7",
"is-typed-array": "^1.1.3",
"safe-buffer": "^5.1.2",
"which-typed-array": "^1.1.2"
}
}
}
},
"memoize-one": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.1.1.tgz",
+2 -1
View File
@@ -30,11 +30,12 @@
"gatsby-plugin-sharp": "^2.6.17",
"gatsby-source-filesystem": "^2.3.8",
"gatsby-transformer-sharp": "2.5.3",
"memo-get-gatsby": "^1.0.2",
"minimal-slp-wallet": "1.3.9",
"prop-types": "^15.7.2",
"qrcode.react": "^1.0.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"minimal-slp-wallet": "1.3.9",
"react-helmet": "^6.0.0",
"react-jdenticon": "0.0.8",
"react-qr-reader": "^2.2.1",
+35 -28
View File
@@ -18,66 +18,57 @@ class ImportWallet extends React.Component {
privateKey: '',
errMsg: '',
inFetch: false
}
_this.BchWallet = BchWallet
}
render () {
return (
<Row className=''>
<Row className="">
<Col sm={2} />
<Col sm={8}>
<Box
className='hover-shadow border-none mt-2'
className="hover-shadow border-none mt-2"
loaded={!_this.state.inFetch}
>
<Row>
<Col sm={12} className='text-center'>
<Col sm={12} className="text-center">
<h1>
<FontAwesomeIcon
className='title-icon'
size='xs'
icon='file-import'
className="title-icon"
size="xs"
icon="file-import"
/>
<span>Import Wallet</span>
</h1>
</Col>
<Col sm={12} className='text-center mt-2 mb-2'>
<Row className='flex justify-content-center'>
<Col sm={12} className="text-center mt-2 mb-2">
<Row className="flex justify-content-center">
<Col sm={8}>
<div>
<Text
id='import-mnemonic'
name='mnemonic'
placeholder='12 word mnemonic'
label='12 word mnemonic'
labelPosition='above'
onChange={_this.handleUpdate}
/>
<Text
id='privateKey'
name='privateKey'
placeholder='Private Key'
label='Private Key'
labelPosition='above'
id="import-mnemonic"
name="mnemonic"
placeholder="12 word mnemonic"
label="12 word mnemonic"
labelPosition="above"
onChange={_this.handleUpdate}
/>
</div>
</Col>
</Row>
</Col>
<Col sm={12} className='text-center'>
<Col sm={12} className="text-center">
{_this.state.errMsg && (
<p className='error-color'>{_this.state.errMsg}</p>
<p className="error-color">{_this.state.errMsg}</p>
)}
</Col>
<Col sm={12} className='text-center mt-2 mb-2'>
<Col sm={12} className="text-center mt-2 mb-2">
<Button
text='Import'
type='primary'
className='btn-lg'
text="Import"
type="primary"
className="btn-lg"
onClick={_this.handleImportWallet}
/>
</Col>
@@ -201,3 +192,19 @@ ImportWallet.propTypes = {
}
export default ImportWallet
/*
CT 07/10/2020
I removed this element because it doesn't seem to be working. I need to do some
additional research to figure out if it's possible to generate a mnemonic from
a WIF private key.
<Text
id='privateKey'
name='privateKey'
placeholder='Private Key'
label='Private Key'
labelPosition='above'
onChange={_this.handleUpdate}
/>
*/
+5 -5
View File
@@ -26,11 +26,11 @@ class InfoWallets extends React.Component {
<Col sm={12} className='text-center mt-2 mb-2'>
<p>
Bitcoin.com Mint is an open source, non-custodial web wallet
supporting SLP and BCH. Web wallets offer user convenience,
but storing large amounts of money on a web wallet is not
recommended. Creating your own SLP tokens only costs a few
cents worth of BCH.
This is an open source, non-custodial web wallet
supporting Bitcoin Cash (BHC) and SLP tokens. Web wallets
offer user convenience, by they are inherently insecure.
Storing large amounts of money on a web wallet is not
recommended.
</p>
</Col>
</Row>
+32 -2
View File
@@ -4,7 +4,37 @@ import { Row, Col } from 'adminlte-2-react'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faGithub } from '@fortawesome/free-brands-svg-icons'
// Get the IPFS hash from the BCH Blockchain.
import MemoGet from 'memo-get-gatsby'
const memoGet = new MemoGet()
let _this
class Footer extends React.Component {
constructor (props) {
super(props)
_this = this
_this.state = {
ipfsHash: 'No Result',
ipfsHashLink: ''
}
}
async componentDidMount () {
const addr = 'bitcoincash:qq8mk8etntclfdkny2aknh4ylc0uaewalszh5eytnr'
const hash = await memoGet.read(addr)
console.log(`hash: ${hash}`)
this.setState({
ipfsHash: hash,
ipfsHashLink: `https://ipfs.io/ipfs/${hash}`
})
// const bchjs = new BCHJS()
// const balance = await bchjs.Blockbook.balance(addr)
// console.log(`balance: ${JSON.stringify(balance, null, 2)}`)
}
render () {
return (
<section id='footer'>
@@ -66,8 +96,8 @@ class Footer extends React.Component {
<b>IPFS</b>
</span>
<b>|</b>
<a href='https://ipfs.io/ipfs/QmTMpYt66SGSjckXTHF6bPip6h1V5fXT23tEUJgy7pyTkf/'>
QmTMpYt66SGSjckXTHF6bPip6h1V5fXT23tEUJgy7pyTkf
<a href={_this.state.ipfsHashLink}>
{this.state.ipfsHash}
</a>
</li>
</ul>