Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/0.21.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
larrysalibra committed Nov 8, 2017
2 parents d85a09a + 89e14a8 commit 96d77a1
Show file tree
Hide file tree
Showing 46 changed files with 549 additions and 1,078 deletions.
Binary file added app/images/app-icon-amgiving-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/app-icon-amgiving-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/app-icon-arenaplay-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/app-icon-arenaplay-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/app-icon-eder-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/app-icon-eder-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/app-icon-portfolio-bounty-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/app-icon-portfolio-bounty-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/app-icon-postly-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/app-icon-postly-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/app-icon-souq-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/app-icon-souq-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/app-icon-symmitree-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/app-icon-symmitree-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions app/js/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getCoreAPIPasswordFromURL, getLogServerPortFromURL } from './utils/api-
import SupportButton from './components/SupportButton'
import { SanityActions } from './store/sanity'
import { CURRENT_VERSION } from './store/reducers'
import { isCoreEndpointDisabled } from './utils/window-utils'
import { openInNewTab } from './utils'

import log4js from 'log4js'
Expand Down Expand Up @@ -102,9 +103,15 @@ class App extends Component {
const coreAPIPassword = getCoreAPIPasswordFromURL()
const logServerPort = getLogServerPortFromURL()
let api = this.props.api


if (coreAPIPassword !== null) {
api = Object.assign({}, api, { coreAPIPassword })
this.props.updateApi(api)
} else if (isCoreEndpointDisabled()) {
logger.debug('Core-less build. Pretending to have a valid core connection.')
api = Object.assign({}, api, { coreAPIPassword: 'PretendPasswordAPI' })
this.props.updateApi(api)
}

if (logServerPort !== null) {
Expand Down
22 changes: 22 additions & 0 deletions app/js/HomeScreenPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { connect } from 'react-redux'
import Navbar from './components/Navbar'
import { AppsActions } from './store/apps'
import appList from './data/apps'
import { isWebAppBuild } from './utils/window-utils'

function mapStateToProps(state) {
return {
Expand Down Expand Up @@ -38,6 +39,21 @@ const AppIcon = (props) => (
</div>
)

const disclaimerWeb = `The Blockstack Tokens are a crypto asset that is currently being
developed by Blockstack Token LLC, a Delaware limited liability
company, whose website can be found at www.blockstack.com. The
website you are currently visiting (browser.blockstack.org) is
sponsored by Blockstack PBC, an affiliate of Blockstack Token LLC,
and should not be viewed as an offer or sale of securities.`

const disclaimerApp = `The Blockstack Tokens are a crypto asset that is currently being
developed by Blockstack Token LLC, a Delaware limited liability
company, whose website can be found at www.blockstack.com. The
application you are currently using (The Blockstack Browser) is
sponsored by Blockstack PBC, an affiliate of Blockstack Token LLC,
and should not be viewed as an offer or sale of securities.`


AppIcon.propTypes = {
launchLink: PropTypes.string.isRequired,
iconImage: PropTypes.string.isRequired,
Expand Down Expand Up @@ -121,6 +137,12 @@ class HomeScreenPage extends Component {
</div>
</div>

<div className="m-t-70">
<p className="small text-muted">
{isWebAppBuild() ? disclaimerWeb : disclaimerApp}
</p>
</div>

</div>
</div>
</div>
Expand Down
17 changes: 15 additions & 2 deletions app/js/UpdateStatePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { IdentityActions } from './profiles/store/identity'
import { decrypt } from './utils'
import { CURRENT_VERSION, updateState } from './store/reducers'
import { BLOCKSTACK_STATE_VERSION_KEY } from './App'
import { isWebAppBuild } from './utils/window-utils'
import log4js from 'log4js'

const logger = log4js.getLogger('UpdateStatePage.js')
Expand Down Expand Up @@ -146,6 +147,7 @@ class UpdateStatePage extends Component {

render() {
const alert = this.state.alert
const isWebApp = isWebAppBuild()
return (
<Modal
isOpen
Expand All @@ -161,8 +163,19 @@ class UpdateStatePage extends Component {
:
null
}
<h3 className="modal-heading">Finish updating Blockstack</h3>
<p>Enter your password to finish updating Blockstack.</p>
<div>
{isWebApp ?
<div>
<h3 className="modal-heading">We updated the Blockstack Browser</h3>
<p>Please enter your password to complete the update process.</p>
</div>
:
<div>
<h3 className="modal-heading">Finish updating Blockstack</h3>
<p>Enter your password to finish updating Blockstack.</p>
</div>
}
</div>
<form className="modal-form" onSubmit={this.upgradeBlockstackState}>
<InputGroup
name="password"
Expand Down
45 changes: 32 additions & 13 deletions app/js/account/store/account/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { authorizationHeaderValue,
getIdentityOwnerAddressNode,
getBitcoinAddressNode,
getInsightUrl } from '../../../utils'
import { isCoreEndpointDisabled } from '../../../utils/window-utils'
import roundTo from 'round-to'
import * as types from './types'
import log4js from 'log4js'
Expand Down Expand Up @@ -161,21 +162,20 @@ function emailNotifications(email, optIn) {
headers: requestHeaders,
body: JSON.stringify(requestBody)
}
const emailNotificationsUrl = 'https://blockstack-portal-emailer.appartisan.com/notifications'
const emailNotificationsUrl = 'https://blockstack-portal-emailer.appartisan.com/notifications?mailingListOptIn='
let url = `${emailNotificationsUrl}false`
if (optIn === true) {
logger.debug('emailNotifications: user opted-in')
return fetch(emailNotificationsUrl, options)
.then(() => {
logger.debug(`emailNotifications: registered ${email} for notifications`)
}, (error) => {
logger.error('emailNotifications: error', error)
}).catch(error => {
logger.error('emailNotifications: error', error)
})
} else {
logger.debug('emailNotifications: user opted-out')
return Promise.resolve()
logger.debug('emailNotifications: user opted-in to mailing list')
url = `${emailNotificationsUrl}true`
}
return fetch(url, options)
.then(() => {
logger.debug(`emailNotifications: registered ${email} for notifications`)
}, (error) => {
logger.error('emailNotifications: error', error)
}).catch(error => {
logger.error('emailNotifications: error', error)
})
}
}

Expand All @@ -195,6 +195,12 @@ function storageIsConnected() {

function refreshCoreWalletBalance(addressBalanceUrl, coreAPIPassword) {
return dispatch => {
if (isCoreEndpointDisabled()) {
logger.debug('Mocking core wallet balance in webapp build')
dispatch(updateCoreWalletBalance(0))
return
}

logger.trace('refreshCoreWalletBalance: Beginning refresh...')
logger.debug(`refreshCoreWalletBalance: addressBalanceUrl: ${addressBalanceUrl}`)
const headers = { Authorization: authorizationHeaderValue(coreAPIPassword) }
Expand All @@ -216,6 +222,12 @@ function refreshCoreWalletBalance(addressBalanceUrl, coreAPIPassword) {

function getCoreWalletAddress(walletPaymentAddressUrl, coreAPIPassword) {
return dispatch => {
if (isCoreEndpointDisabled()) {
logger.debug('Mocking core wallet address in webapp build')
dispatch(updateCoreWalletAddress('Not supported in simple webapp.'))
return
}

const headers = { Authorization: authorizationHeaderValue(coreAPIPassword) }
fetch(walletPaymentAddressUrl, { headers })
.then((response) => response.text())
Expand All @@ -241,6 +253,13 @@ function resetCoreWithdrawal() {
function withdrawBitcoinFromCoreWallet(coreWalletWithdrawUrl, recipientAddress,
coreAPIPassword, amount = null, paymentKey = null) {
return dispatch => {
if (isCoreEndpointDisabled()) {
dispatch(withdrawCoreBalanceError('Core wallet withdrawls not allowed in' +
' the simple webapp build'))
return
}


const requestBody = {
address: recipientAddress,
min_confs: 0
Expand Down
29 changes: 18 additions & 11 deletions app/js/account/store/settings/default.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { DROPBOX } from '../../../account/utils/index'
import { isCoreEndpointDisabled } from '../../../utils/window-utils'

export const REGTEST_CORE_API_PASSWORD = 'blockstack_integration_test_api_password'
export const REGTEST_CORE_INSIGHT_API_URL =
Expand All @@ -8,27 +9,33 @@ export const REGTEST_CORE_INSIGHT_API_URL =
// the user's settings.api state doesn't
// already have an existing key.
// To change a value, use a new key.

let DEFAULT_CORE_API_ENDPOINT = 'http://localhost:6270'
if ( isCoreEndpointDisabled() ) {
DEFAULT_CORE_API_ENDPOINT = 'https://core.blockstack.org'
}

const DEFAULT_API = {
apiCustomizationEnabled: true,
nameLookupUrl: 'http://localhost:6270/v1/names/{name}',
nameLookupUrl: DEFAULT_CORE_API_ENDPOINT + '/v1/names/{name}',
searchServiceUrl: 'https://core.blockstack.org/v1/search?query={query}',
registerUrl: 'http://localhost:6270/v1/names',
bitcoinAddressLookupUrl: 'http://localhost:6270/v1/addresses/bitcoin/{address}',
zeroConfBalanceUrl: 'http://localhost:6270/v1/wallet/balance/0',
registerUrl: DEFAULT_CORE_API_ENDPOINT + '/v1/names',
bitcoinAddressLookupUrl: DEFAULT_CORE_API_ENDPOINT + '/v1/addresses/bitcoin/{address}',
zeroConfBalanceUrl: DEFAULT_CORE_API_ENDPOINT + '/v1/wallet/balance/0',
insightUrl: 'https://utxo.blockstack.org/insight-api/addr/{address}',
broadcastUrl: 'https://utxo.blockstack.org/insight-api/tx/send',
priceUrl: 'http://localhost:6270/v1/prices/names/{name}',
priceUrl: DEFAULT_CORE_API_ENDPOINT + '/v1/prices/names/{name}',
networkFeeUrl: 'https://bitcoinfees.21.co/api/v1/fees/recommended',
walletPaymentAddressUrl: 'http://localhost:6270/v1/wallet/payment_address',
pendingQueuesUrl: 'http://localhost:6270/v1/blockchains/bitcoin/pending',
coreWalletWithdrawUrl: 'http://localhost:6270/v1/wallet/balance',
walletPaymentAddressUrl: DEFAULT_CORE_API_ENDPOINT + '/v1/wallet/payment_address',
pendingQueuesUrl: DEFAULT_CORE_API_ENDPOINT + '/v1/blockchains/bitcoin/pending',
coreWalletWithdrawUrl: DEFAULT_CORE_API_ENDPOINT + '/v1/wallet/balance',
bitcoinAddressUrl: 'https://explorer.blockstack.org/address/{identifier}',
ethereumAddressUrl: 'https://tradeblock.com/ethereum/account/{identifier}',
pgpKeyUrl: 'https://pgp.mit.edu/pks/lookup?search={identifier}&op=vindex&fingerprint=on',
btcPriceUrl: 'https://www.bitstamp.net/api/v2/ticker/btcusd/',
corePingUrl: 'http://localhost:6270/v1/node/ping',
zoneFileUrl: 'http://localhost:6270/v1/names/{name}/zonefile',
nameTransferUrl: 'http://localhost:6270/v1/names/{name}/owner',
corePingUrl: DEFAULT_CORE_API_ENDPOINT + '/v1/node/ping',
zoneFileUrl: DEFAULT_CORE_API_ENDPOINT + '/v1/names/{name}/zonefile',
nameTransferUrl: DEFAULT_CORE_API_ENDPOINT + '/v1/names/{name}/owner',
subdomains: {
'foo.id': {
registerUrl: 'http://localhost:7103/register'
Expand Down
3 changes: 2 additions & 1 deletion app/js/account/utils/blockstack-inc.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@ export function connectToGaiaHub(gaiaHubUrl: string, challengeSignerHex: string)
export function redirectToConnectToGaiaHub() {
logger.trace('redirectToConnectToGaiaHub')
const port = location.port === '' ? 80 : location.port
window.top.location.href = `http://localhost:${port}/account/storage#gaiahub`
const host = location.hostname
window.top.location.href = `http://${host}:${port}/account/storage#gaiahub`
}
35 changes: 35 additions & 0 deletions app/js/auth/components/AuthModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import Image from '../../components/Image'
import { AppsNode } from '../../utils/account-utils'
import { setCoreStorageConfig } from '../../utils/api-utils'
import { isCoreEndpointDisabled } from '../../utils/window-utils'
import { getTokenFileUrlFromZoneFile } from '../../utils/zone-utils'
import { HDNode } from 'bitcoinjs-lib'
import { validateScopes } from '../utils'
Expand Down Expand Up @@ -345,6 +346,40 @@ class AuthModal extends Component {
const appManifestLoading = this.props.appManifestLoading
const processing = this.state.processing
const invalidScopes = this.state.invalidScopes
const decodedToken = this.state.decodedToken
const noStorage = (decodedToken
&& decodedToken.payload.scopes
&& !decodedToken.payload.scopes.includes('store_write'))

const coreShortCircuit = (!appManifestLoading
&& appManifest !== null
&& !invalidScopes
&& !noStorage
&& isCoreEndpointDisabled())
if (coreShortCircuit) {
return (
<div className="">
<Modal
isOpen
onRequestClose={this.closeModal}
contentLabel="This is My Modal"
shouldCloseOnOverlayClick
style={{ overlay: { zIndex: 10 } }}
className="container-fluid"
portalClassName="auth-modal"
>
<h3>Sign In Request</h3>
<div>
<p>
This application requires using Gaia storage, which is not supported yet
in our webapp. Feature coming soon!
</p>
</div>
</Modal>
</div>
)
}

const requestingEmail = this.state.requestingEmail
return (
<div className="">
Expand Down
91 changes: 91 additions & 0 deletions app/js/data/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,97 @@ const apps = {
launchLink: 'https://dotpodcast.co/',
developer: 'DotPodcast',
status: 'in_progress'
}, {
name: 'Postly',
displayName: 'Postly',
description: 'The best way to share and discover content with friends.',
version: '1.0.0',
appIcon: {
small: 'app-icon-postly-256x256.png',
large: 'app-icon-postly-512x512.png'
},
website: 'https://www.postly.co/blockstack',
launchLink: 'https://www.postly.co/blockstack',
developer: 'Postly',
status: 'in_progress'
}, {
name: 'Arenaplay',
displayName: 'Arenaplay',
description: 'Games where players time is valued.',
version: '1.0.0',
appIcon: {
small: 'app-icon-arenaplay-256x256.png',
large: 'app-icon-arenaplay-512x512.png'
},
website: 'https://arenaplay.io/start',
launchLink: 'https://arenaplay.io/start',
developer: 'Arenaplay',
status: 'in_progress'
}, {
name: 'AMGiving',
displayName: 'AMGiving',
description: 'Creating transparency in charitable giving.',
version: '1.0.0',
appIcon: {
small: 'app-icon-amgiving-256x256.png',
large: 'app-icon-amgiving-512x512.png'
},
website: 'http://amgiving.io',
launchLink: 'http://amgiving.io',
developer: 'AMGiving',
status: 'in_progress'
}, {
name: 'Symmitree',
displayName: 'Symmitree',
description: 'Providing free connectivity to the displaced and deprived.',
version: '1.0.0',
appIcon: {
small: 'app-icon-symmitree-256x256.png',
large: 'app-icon-symmitree-512x512.png'
},
website: 'http://symmitree.com',
launchLink: 'http://symmitree.com',
developer: 'Symmitree',
status: 'in_progress'
}, {
name: 'Eder',
displayName: 'Eder',
description: 'A decentralized stash for your personal data.',
version: '1.0.0',
appIcon: {
small: 'app-icon-eder-256x256.png',
large: 'app-icon-eder-512x512.png'
},
website: 'http://eder.io',
launchLink: 'http://eder.io',
developer: 'Eder',
status: 'in_progress'
}, {
name: 'Portfolio Bounty',
displayName: 'Portfolio Bounty',
description: 'https://tokenportfolio.eventbrite.com.',
version: '1.0.0',
appIcon: {
small: 'app-icon-portfolio-bounty-256x256.png',
large: 'app-icon-portfolio-bounty-512x512.png'
},
website: 'https://tokenportfolio.eventbrite.com',
launchLink: 'https://tokenportfolio.eventbrite.com',
developer: 'Portfolio Bounty',
status: 'in_progress'
}, {
name: 'Souq',
displayName: 'Souq',
description: 'Project Management Platform.',
version: '1.0.0',
appIcon: {
small: 'app-icon-souq-256x256.png',
large: 'app-icon-souq-512x512.png'
},
website: 'http://beta.cryptocracy.io',
launchLink: 'http://beta.cryptocracy.io',
developer: 'Souq',
status: 'in_progress'
}
]
}
Expand Down
Loading

0 comments on commit 96d77a1

Please sign in to comment.