-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: prod build fixes, website downloads
- Loading branch information
1 parent
553de1a
commit 12288aa
Showing
21 changed files
with
251 additions
and
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'website': minor | ||
--- | ||
|
||
Binary downloads are now the latest stable version. |
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,5 @@ | ||
--- | ||
'explorer': minor | ||
--- | ||
|
||
The explorer now shows average prices on the home page. |
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
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 |
---|---|---|
@@ -1,54 +1,47 @@ | ||
import { TBToBytes, monthsToBlocks } from '@siafoundation/design-system' | ||
import { | ||
SiaCentralExchangeRates, | ||
SiaCentralHost, | ||
} from '@siafoundation/sia-central' | ||
import { SiaCentralExchangeRates } from '@siafoundation/sia-central' | ||
import BigNumber from 'bignumber.js' | ||
import { humanSiacoin } from '@siafoundation/sia-js' | ||
|
||
type Props = { | ||
host: SiaCentralHost | ||
price: string | ||
rates: SiaCentralExchangeRates | ||
} | ||
|
||
export function getStorageCost({ host, rates }: Props) { | ||
export function getStorageCost({ price, rates }: Props) { | ||
return rates | ||
? `$${new BigNumber(host.settings.storage_price) | ||
? `$${new BigNumber(price) | ||
.times(TBToBytes(1)) | ||
.times(monthsToBlocks(1)) | ||
.div(1e24) | ||
.times(rates.sc.usd || 1) | ||
.toFixed(2)}/TB` | ||
: `${humanSiacoin( | ||
new BigNumber(host.settings.storage_price) | ||
.times(TBToBytes(1)) | ||
.times(monthsToBlocks(1)), | ||
new BigNumber(price).times(TBToBytes(1)).times(monthsToBlocks(1)), | ||
{ fixed: 0 } | ||
)}/TB` | ||
} | ||
|
||
export function getDownloadCost({ host, rates }: Props) { | ||
export function getDownloadCost({ price, rates }: Props) { | ||
return rates | ||
? `$${new BigNumber(host.settings.download_price) | ||
? `$${new BigNumber(price) | ||
.times(TBToBytes(1)) | ||
.div(1e24) | ||
.times(rates.sc.usd || 1) | ||
.toFixed(2)}/TB` | ||
: `${humanSiacoin( | ||
new BigNumber(host.settings.download_price).times(TBToBytes(1)), | ||
{ fixed: 0 } | ||
)}/TB` | ||
: `${humanSiacoin(new BigNumber(price).times(TBToBytes(1)), { | ||
fixed: 0, | ||
})}/TB` | ||
} | ||
|
||
export function getUploadCost({ host, rates }: Props) { | ||
export function getUploadCost({ price, rates }: Props) { | ||
return rates | ||
? `$${new BigNumber(host.settings.upload_price) | ||
? `$${new BigNumber(price) | ||
.times(TBToBytes(1)) | ||
.div(1e24) | ||
.times(rates.sc.usd || 1) | ||
.toFixed(2)}/TB` | ||
: `${humanSiacoin( | ||
new BigNumber(host.settings.upload_price).times(TBToBytes(1)), | ||
{ fixed: 0 } | ||
)}/TB` | ||
: `${humanSiacoin(new BigNumber(price).times(TBToBytes(1)), { | ||
fixed: 0, | ||
})}/TB` | ||
} |
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
Oops, something went wrong.