mirror of
https://github.com/fullstack-cash/fullstack-gatsby-theme-bch-wallet.git
synced 2026-09-22 17:22:05 -07:00
Switched to exact versions of npm deps
This commit is contained in:
Generated
+2347
-18558
File diff suppressed because it is too large
Load Diff
+46
-46
@@ -23,56 +23,56 @@
|
||||
"unit": "mocha test/unit/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@capacitor/android": "^3.3.2",
|
||||
"@capacitor/cli": "^3.3.2",
|
||||
"@capacitor/core": "^3.3.2",
|
||||
"@chris.troutner/gatsby-plugin-ipfs": "^2.0.3",
|
||||
"@chris.troutner/ipfs": "^2.0.2",
|
||||
"adminlte-2-react": "^0.1.27",
|
||||
"assert": "^2.0.0",
|
||||
"browserify-zlib": "^0.2.0",
|
||||
"capacitor-resources": "^2.0.5",
|
||||
"copy-to-clipboard": "^3.3.1",
|
||||
"crypto-browserify": "^3.12.0",
|
||||
"gatsby": "^4.1.0",
|
||||
"gatsby-plugin-image": "^2.1.0",
|
||||
"gatsby-plugin-manifest": "^4.1.0",
|
||||
"gatsby-plugin-offline": "^4.7.1",
|
||||
"gatsby-plugin-react-helmet": "^5.1.0",
|
||||
"gatsby-plugin-sharp": "^4.1.0",
|
||||
"gatsby-source-filesystem": "^4.1.0",
|
||||
"gatsby-transformer-sharp": "^4.1.0",
|
||||
"https-browserify": "^1.0.0",
|
||||
"jsonrpc-lite": "^2.2.0",
|
||||
"p-queue": "^7.1.0",
|
||||
"p-retry": "^5.0.0",
|
||||
"path-browserify": "^1.0.1",
|
||||
"process": "^0.11.10",
|
||||
"prop-types": "^15.7.2",
|
||||
"qrcode.react": "^1.0.1",
|
||||
"react": "^17.0.1",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-helmet": "^6.1.0",
|
||||
"@capacitor/android": "3.3.2",
|
||||
"@capacitor/cli": "3.3.2",
|
||||
"@capacitor/core": "3.3.2",
|
||||
"@chris.troutner/gatsby-plugin-ipfs": "2.0.3",
|
||||
"adminlte-2-react": "0.1.27",
|
||||
"assert": "2.0.0",
|
||||
"browserify-zlib": "0.2.0",
|
||||
"capacitor-resources": "2.0.5",
|
||||
"copy-to-clipboard": "3.3.1",
|
||||
"crypto-browserify": "3.12.0",
|
||||
"fs-extra": "10.0.0",
|
||||
"gatsby": "4.1.0",
|
||||
"gatsby-plugin-image": "2.1.0",
|
||||
"gatsby-plugin-manifest": "4.1.0",
|
||||
"gatsby-plugin-offline": "4.7.1",
|
||||
"gatsby-plugin-react-helmet": "5.1.0",
|
||||
"gatsby-plugin-sharp": "4.1.0",
|
||||
"gatsby-source-filesystem": "4.1.0",
|
||||
"gatsby-transformer-sharp": "4.1.0",
|
||||
"https-browserify": "1.0.0",
|
||||
"jsonrpc-lite": "2.2.0",
|
||||
"p-queue": "7.1.0",
|
||||
"p-retry": "5.0.0",
|
||||
"path-browserify": "1.0.1",
|
||||
"process": "0.11.10",
|
||||
"prop-types": "15.7.2",
|
||||
"qrcode.react": "1.0.1",
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2",
|
||||
"react-helmet": "6.1.0",
|
||||
"react-jdenticon": "0.0.9",
|
||||
"react-qr-reader": "^2.2.1",
|
||||
"react-redux": "^7.2.4",
|
||||
"semver": "^7.3.5",
|
||||
"sharp": "^0.29.3",
|
||||
"slp-mutable-data": "^1.2.2",
|
||||
"stream-browserify": "^3.0.0",
|
||||
"stream-http": "^3.2.0"
|
||||
"react-qr-reader": "2.2.1",
|
||||
"react-redux": "7.2.4",
|
||||
"semver": "7.3.5",
|
||||
"sharp": "0.29.3",
|
||||
"stream-browserify": "3.0.0",
|
||||
"stream-http": "3.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^7.18.0",
|
||||
"eslint-config-prettier": "^7.2.0",
|
||||
"eslint-config-standard": "^16.0.2",
|
||||
"eslint-plugin-prettier": "^3.3.1",
|
||||
"eslint-plugin-standard": "^5.0.0",
|
||||
"husky": "^4.3.8",
|
||||
"mocha": "^9.1.3",
|
||||
"buffer": "6.0.3",
|
||||
"eslint": "7.18.0",
|
||||
"eslint-config-prettier": "7.2.0",
|
||||
"eslint-config-standard": "16.0.2",
|
||||
"eslint-plugin-prettier": "3.3.1",
|
||||
"eslint-plugin-standard": "5.0.0",
|
||||
"husky": "4.3.8",
|
||||
"mocha": "9.1.3",
|
||||
"prettier": "2.2.1",
|
||||
"semantic-release": "^17.3.7",
|
||||
"standard": "^16.0.3"
|
||||
"semantic-release": "17.3.7",
|
||||
"standard": "16.0.3"
|
||||
},
|
||||
"keywords": [
|
||||
"gatsby",
|
||||
|
||||
@@ -13,7 +13,7 @@ const { Text } = Inputs
|
||||
|
||||
let _this
|
||||
class JsonWebTokens extends React.Component {
|
||||
constructor(props) {
|
||||
constructor (props) {
|
||||
super(props)
|
||||
|
||||
_this = this
|
||||
@@ -26,7 +26,7 @@ class JsonWebTokens extends React.Component {
|
||||
_this.BchWallet = BchWallet
|
||||
}
|
||||
|
||||
render() {
|
||||
render () {
|
||||
return (
|
||||
<Row>
|
||||
<Col sm={12}>
|
||||
@@ -70,7 +70,7 @@ class JsonWebTokens extends React.Component {
|
||||
)
|
||||
}
|
||||
|
||||
setJwt() {
|
||||
setJwt () {
|
||||
const { JWT } = _this.props.walletInfo
|
||||
if (JWT) {
|
||||
const jwtElem = document.getElementById('jwt')
|
||||
@@ -78,36 +78,35 @@ class JsonWebTokens extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
handleUpdate(event) {
|
||||
handleUpdate (event) {
|
||||
const value = event.target.value
|
||||
_this.setState({
|
||||
[event.target.name]: value
|
||||
})
|
||||
}
|
||||
|
||||
async handleUpdateJWT() {
|
||||
async handleUpdateJWT () {
|
||||
try {
|
||||
const { mnemonic, selectedServer } = _this.props.walletInfo
|
||||
const _interface = _this.props.walletInfo.interface
|
||||
|
||||
|
||||
const apiToken = _this.state.JWT
|
||||
|
||||
// Update instance with JWT
|
||||
if (mnemonic) {
|
||||
let bchjsOptions = { apiToken: apiToken }
|
||||
const bchjsOptions = { apiToken: apiToken }
|
||||
if (selectedServer) {
|
||||
bchjsOptions.restURL = selectedServer
|
||||
}
|
||||
|
||||
bchjsOptions.interface = _interface
|
||||
//console.log('bchjs options : ', bchjsOptions)
|
||||
// console.log('bchjs options : ', bchjsOptions)
|
||||
const bchWalletLib = new _this.BchWallet(mnemonic, bchjsOptions)
|
||||
|
||||
// Update bchjs instances of minimal-slp-wallet libraries
|
||||
bchWalletLib.tokens.sendBch.bchjs = new bchWalletLib.BCHJS(bchjsOptions)
|
||||
bchWalletLib.tokens.utxos.bchjs = new bchWalletLib.BCHJS(bchjsOptions)
|
||||
|
||||
|
||||
_this.props.setBchWallet(bchWalletLib)
|
||||
}
|
||||
|
||||
@@ -124,7 +123,7 @@ class JsonWebTokens extends React.Component {
|
||||
}
|
||||
|
||||
// Reset form and component state
|
||||
resetValues() {
|
||||
resetValues () {
|
||||
_this.setState({
|
||||
JWT: '',
|
||||
errMsg: ''
|
||||
@@ -133,7 +132,7 @@ class JsonWebTokens extends React.Component {
|
||||
jwtElem.value = ''
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
componentDidMount () {
|
||||
_this.setJwt()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ class Servers extends React.Component {
|
||||
|
||||
bchjsOptions.restURL = restURL
|
||||
bchjsOptions.interface = _interface
|
||||
//console.log('bchjs options : ', bchjsOptions)
|
||||
// console.log('bchjs options : ', bchjsOptions)
|
||||
|
||||
const bchWalletLib = new _this.BchWallet(mnemonic, bchjsOptions)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import TokenModal from './token-modal'
|
||||
import Spinner from '../../../images/loader.gif'
|
||||
// import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||
import SendTokens from './send-tokens'
|
||||
import { SlpMutableData } from 'slp-mutable-data'
|
||||
// import { SlpMutableData } from 'slp-mutable-data'
|
||||
let _this
|
||||
class Tokens extends React.Component {
|
||||
constructor (props) {
|
||||
@@ -31,22 +31,22 @@ class Tokens extends React.Component {
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
text="Refresh"
|
||||
icon="fa-redo"
|
||||
type="primary"
|
||||
className="btn-md ml-1 mt-1 mb-1"
|
||||
text='Refresh'
|
||||
icon='fa-redo'
|
||||
type='primary'
|
||||
className='btn-md ml-1 mt-1 mb-1'
|
||||
onClick={() => _this.handleGetTokens(true)}
|
||||
/>
|
||||
{_this.state.txId && (
|
||||
<div className="txIdContainer">
|
||||
<div className='txIdContainer'>
|
||||
<button onClick={() => _this.setState({ txId: null })}>
|
||||
×
|
||||
</button>
|
||||
<Col xs={12} className="text-center mt-1">
|
||||
<Box title="Transaction ID" type="primary" className="p-0">
|
||||
<Col xs={12} className='text-center mt-1'>
|
||||
<Box title='Transaction ID' type='primary' className='p-0'>
|
||||
<a
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
href={`${_this.state.explorerURL}/${_this.state.txId}`}
|
||||
>
|
||||
{_this.state.txId}
|
||||
@@ -71,46 +71,46 @@ class Tokens extends React.Component {
|
||||
)}
|
||||
{_this.state.inFetch
|
||||
? (
|
||||
<div className="spinner">
|
||||
<img alt="Loading..." src={Spinner} width={100} />
|
||||
</div>
|
||||
<div className='spinner'>
|
||||
<img alt='Loading...' src={Spinner} width={100} />
|
||||
</div>
|
||||
)
|
||||
: (
|
||||
<Content>
|
||||
{_this.state.errMsg && (
|
||||
<Box padding="true" className="container-nofound">
|
||||
<Row>
|
||||
<Col xs={12}>
|
||||
<em>{_this.state.errMsg}</em>
|
||||
</Col>
|
||||
</Row>
|
||||
</Box>
|
||||
)}
|
||||
<Content>
|
||||
{_this.state.errMsg && (
|
||||
<Box padding='true' className='container-nofound'>
|
||||
<Row>
|
||||
<Col xs={12}>
|
||||
<em>{_this.state.errMsg}</em>
|
||||
</Col>
|
||||
</Row>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
{_this.state.tokens.length > 0 && (
|
||||
<>
|
||||
<Row>
|
||||
{_this.state.tokens.map((val, i) => {
|
||||
if (val.qty > 0) {
|
||||
return (
|
||||
<Col sm={4} key={`token-${i}`}>
|
||||
<TokenCard
|
||||
key={`token-${i}`}
|
||||
id={`token-${i}`}
|
||||
token={val}
|
||||
showToken={_this.showToken}
|
||||
selectToken={_this.selectToken}
|
||||
/>
|
||||
</Col>
|
||||
)
|
||||
} else {
|
||||
return <span key={`token-${i}`} />
|
||||
}
|
||||
})}
|
||||
</Row>
|
||||
</>
|
||||
)}
|
||||
</Content>
|
||||
{_this.state.tokens.length > 0 && (
|
||||
<>
|
||||
<Row>
|
||||
{_this.state.tokens.map((val, i) => {
|
||||
if (val.qty > 0) {
|
||||
return (
|
||||
<Col sm={4} key={`token-${i}`}>
|
||||
<TokenCard
|
||||
key={`token-${i}`}
|
||||
id={`token-${i}`}
|
||||
token={val}
|
||||
showToken={_this.showToken}
|
||||
selectToken={_this.selectToken}
|
||||
/>
|
||||
</Col>
|
||||
)
|
||||
} else {
|
||||
return <span key={`token-${i}`} />
|
||||
}
|
||||
})}
|
||||
</Row>
|
||||
</>
|
||||
)}
|
||||
</Content>
|
||||
)}
|
||||
<TokenModal
|
||||
bchWallet={_this.props.bchWallet}
|
||||
@@ -227,9 +227,9 @@ class Tokens extends React.Component {
|
||||
Rate limits exceeded, increase rate limits with a JWT token from
|
||||
<a
|
||||
style={{ marginLeft: '5px' }}
|
||||
target="_blank"
|
||||
href="https://fullstack.cash"
|
||||
rel="noopener noreferrer"
|
||||
target='_blank'
|
||||
href='https://fullstack.cash'
|
||||
rel='noopener noreferrer'
|
||||
>
|
||||
FullStack.cash
|
||||
</a>
|
||||
@@ -271,20 +271,22 @@ class Tokens extends React.Component {
|
||||
async handleMutableData (tokensArr) {
|
||||
try {
|
||||
const tokens = []
|
||||
const slpMutableLib = new SlpMutableData()
|
||||
// const slpMutableLib = new SlpMutableData()
|
||||
for (let i = 0; i < tokensArr.length; i++) {
|
||||
const token = tokensArr[i]
|
||||
try {
|
||||
const data = await slpMutableLib.get.mutableData(token.tokenId)
|
||||
token.mutableData = data
|
||||
// console.log(`data: ${JSON.stringify(data, null, 2)}`)
|
||||
} catch (error) {
|
||||
// console.warn(error)
|
||||
// Skip error
|
||||
console.log(
|
||||
`Could not access mutable data for ${token.ticker} (${token.tokenId})`
|
||||
)
|
||||
}
|
||||
|
||||
// try {
|
||||
// const data = await slpMutableLib.get.mutableData(token.tokenId)
|
||||
// token.mutableData = data
|
||||
// // console.log(`data: ${JSON.stringify(data, null, 2)}`)
|
||||
// } catch (error) {
|
||||
// // console.warn(error)
|
||||
// // Skip error
|
||||
// console.log(
|
||||
// `Could not access mutable data for ${token.ticker} (${token.tokenId})`
|
||||
// )
|
||||
// }
|
||||
|
||||
tokens.push(token)
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ class NewWallet extends React.Component {
|
||||
_this.setState({
|
||||
inFetch: true
|
||||
})
|
||||
|
||||
|
||||
const bchjsOptions = _this.getBchjsOptions()
|
||||
|
||||
const bchWalletLib = new _this.BchWallet(null, bchjsOptions)
|
||||
@@ -123,11 +123,12 @@ class NewWallet extends React.Component {
|
||||
_this.handleError(error)
|
||||
}
|
||||
}
|
||||
getBchjsOptions (){
|
||||
|
||||
getBchjsOptions () {
|
||||
try {
|
||||
const currentWallet = _this.props.walletInfo
|
||||
// force interface from props
|
||||
if(_this.props.interface){
|
||||
if (_this.props.interface) {
|
||||
currentWallet.interface = _this.props.interface
|
||||
}
|
||||
|
||||
@@ -136,30 +137,30 @@ class NewWallet extends React.Component {
|
||||
const jwtToken = currentWallet.JWT
|
||||
const restURL = currentWallet.selectedServer
|
||||
const bchjsOptions = {}
|
||||
|
||||
if(_interface === 'consumer-api'){
|
||||
|
||||
if (_interface === 'consumer-api') {
|
||||
bchjsOptions.interface = _interface
|
||||
return bchjsOptions
|
||||
}
|
||||
|
||||
|
||||
if (jwtToken) {
|
||||
bchjsOptions.apiToken = jwtToken
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (restURL) {
|
||||
bchjsOptions.restURL = restURL
|
||||
}
|
||||
|
||||
|
||||
if (_interface === 'rest-api') {
|
||||
bchjsOptions.interface = _interface
|
||||
}
|
||||
|
||||
|
||||
return bchjsOptions
|
||||
} catch (error) {
|
||||
console.warn(error)
|
||||
}
|
||||
}
|
||||
|
||||
handleError (error) {
|
||||
// console.error(error)
|
||||
let errMsg = ''
|
||||
|
||||
@@ -115,7 +115,6 @@ class ImportWallet extends React.Component {
|
||||
|
||||
const bchjsOptions = _this.getBchjsOptions()
|
||||
|
||||
|
||||
const bchWalletLib = new _this.BchWallet(
|
||||
_this.state.mnemonic,
|
||||
bchjsOptions
|
||||
@@ -162,11 +161,12 @@ class ImportWallet extends React.Component {
|
||||
_this.handleError(error)
|
||||
}
|
||||
}
|
||||
getBchjsOptions (){
|
||||
|
||||
getBchjsOptions () {
|
||||
try {
|
||||
const currentWallet = _this.props.walletInfo
|
||||
// force interface from props
|
||||
if(_this.props.interface){
|
||||
if (_this.props.interface) {
|
||||
currentWallet.interface = _this.props.interface
|
||||
}
|
||||
|
||||
@@ -175,30 +175,30 @@ class ImportWallet extends React.Component {
|
||||
const jwtToken = currentWallet.JWT
|
||||
const restURL = currentWallet.selectedServer
|
||||
const bchjsOptions = {}
|
||||
|
||||
if(_interface === 'consumer-api'){
|
||||
|
||||
if (_interface === 'consumer-api') {
|
||||
bchjsOptions.interface = _interface
|
||||
return bchjsOptions
|
||||
}
|
||||
|
||||
|
||||
if (jwtToken) {
|
||||
bchjsOptions.apiToken = jwtToken
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (restURL) {
|
||||
bchjsOptions.restURL = restURL
|
||||
}
|
||||
|
||||
|
||||
if (_interface === 'rest-api') {
|
||||
bchjsOptions.interface = _interface
|
||||
}
|
||||
|
||||
|
||||
return bchjsOptions
|
||||
} catch (error) {
|
||||
console.warn(error)
|
||||
}
|
||||
}
|
||||
|
||||
// Reset form and component state
|
||||
resetValues () {
|
||||
_this.setState({
|
||||
|
||||
@@ -79,7 +79,7 @@ const instanceWallet = () => {
|
||||
const bchjsOptions = getBchjsOptions()
|
||||
|
||||
const bchWalletLib = new BchWallet(localStorageInfo.mnemonic, bchjsOptions)
|
||||
|
||||
|
||||
// Update bchjs instances of minimal-slp-wallet libraries
|
||||
bchWalletLib.tokens.sendBch.bchjs = new bchWalletLib.BCHJS(bchjsOptions)
|
||||
bchWalletLib.tokens.utxos.bchjs = new bchWalletLib.BCHJS(bchjsOptions)
|
||||
@@ -90,22 +90,21 @@ const instanceWallet = () => {
|
||||
}
|
||||
}
|
||||
|
||||
const getBchjsOptions = ()=> {
|
||||
const getBchjsOptions = () => {
|
||||
try {
|
||||
const _interface = localStorageInfo.interface || 'consumer-api'
|
||||
|
||||
const jwtToken = localStorageInfo.JWT
|
||||
const restURL = localStorageInfo.selectedServer
|
||||
const bchjsOptions = {}
|
||||
|
||||
if(_interface === 'consumer-api'){
|
||||
|
||||
if (_interface === 'consumer-api') {
|
||||
bchjsOptions.interface = _interface
|
||||
return bchjsOptions
|
||||
}
|
||||
|
||||
if (jwtToken) {
|
||||
bchjsOptions.apiToken = jwtToken
|
||||
|
||||
}
|
||||
|
||||
if (restURL) {
|
||||
@@ -121,7 +120,6 @@ const getBchjsOptions = ()=> {
|
||||
bchjsOptions.fee = FEE
|
||||
console.log(`Using ${bchjsOptions.fee} sats per byte for tx fees.`)
|
||||
|
||||
|
||||
return bchjsOptions
|
||||
} catch (error) {
|
||||
console.warn(error)
|
||||
|
||||
Reference in New Issue
Block a user