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

Commit 1a5d9a8

Browse files
authored
Merge pull request #1928 from blockstack/hotfix/name-price-fix
Fix name price error.
2 parents dd88492 + 138270b commit 1a5d9a8

6 files changed

Lines changed: 1414 additions & 2190 deletions

File tree

app/js/account/store/settings/default.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const DEFAULT_API = {
2323
insightUrl: 'https://utxo.blockstack.org/insight-api/addr/{address}',
2424
btcBalanceUrl: 'https://blockchain.info/q/addressbalance/',
2525
broadcastUrl: 'https://utxo.blockstack.org/insight-api/tx/send',
26-
priceUrl: `${DEFAULT_CORE_API_ENDPOINT}/v1/prices/names/{name}`,
26+
priceUrl: `${DEFAULT_CORE_API_ENDPOINT}/v2/prices/names/{name}`,
2727
networkFeeUrl: 'https://bitcoinfees.21.co/api/v1/fees/recommended',
2828
walletPaymentAddressUrl: `${DEFAULT_CORE_API_ENDPOINT}/v1/wallet/payment_address`,
2929
pendingQueuesUrl: `${DEFAULT_CORE_API_ENDPOINT}/v1/blockchains/bitcoin/pending`,

app/js/profiles/components/registration/RegistrationSelectView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import log4js from 'log4js'
1717

1818
const logger = log4js.getLogger(__filename)
1919
const CHECK_FOR_PAYMENT_INTERVAL = 10000
20-
export const PRICE_BUFFER = 0.0005 // btc
20+
export const PRICE_BUFFER = 0.0015 // btc
2121
function mapStateToProps(state) {
2222
return {
2323
api: state.settings.api,

app/js/profiles/components/registration/UsernameResult.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const UsernameResult = (props: Props) => {
2626
} = availability || {}
2727

2828
let price = (availability && availability.price) || 0
29-
price = roundTo.up(price, 6) + PRICE_BUFFER
29+
price = roundTo.up(price + PRICE_BUFFER, 6)
3030

3131
const renderChecking = () => (
3232
<div className="account-check">

app/js/profiles/store/availability/actions.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import {
66
isNameAvailable, getNamePrices
77
} from '@utils/index'
88

9+
import { satoshisToBtc } from '@utils/bitcoin-utils'
10+
11+
912
const logger = log4js.getLogger(__filename)
1013

1114
function checkingNameAvailability(domainName) {
@@ -83,7 +86,7 @@ function checkNameAvailabilityAndPrice(api, domainName) {
8386
dispatch(namePrice(domainName, 0))
8487
} else {
8588
return getNamePrices(api.priceUrl, domainName).then((prices) => {
86-
const price = prices.total_estimated_cost.btc
89+
const price = satoshisToBtc(prices.name_price.satoshis)
8790
dispatch(namePrice(domainName, price))
8891
}).catch((error) => {
8992
logger.error('checkNameAvailabilityAndPrice: getNamePrices: error', error)

0 commit comments

Comments
 (0)