Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9582342a3a | ||
|
|
bbc07e8238 | ||
|
|
4a7be9d61d | ||
|
|
6054ddc6c0 | ||
|
|
a0dac9c35b | ||
|
|
5c5c7924af | ||
|
|
b8a685a8dc | ||
|
|
9f98c64d18 | ||
|
|
1b13f2711b | ||
|
|
55a3736233 | ||
|
|
fd8a6953f3 | ||
|
|
70069a29ec | ||
|
|
b96d40241d | ||
|
|
f3564d7809 | ||
|
|
2941698c2b | ||
|
|
0ca160336f | ||
|
|
e8eaf19490 | ||
|
|
9e984c94c1 | ||
|
|
19b35b0685 | ||
|
|
1ba751acb3 | ||
|
|
fae8b3e98a | ||
|
|
07d937d0ef | ||
|
|
a428ebdd73 | ||
|
|
262e90a2e1 | ||
|
|
17b0ef58a9 | ||
|
|
5064b86fc6 | ||
|
|
b99285cfa5 | ||
|
|
d61d9ff015 | ||
|
|
0d49e4d0c8 | ||
|
|
80e55f53e2 | ||
|
|
1edc128b61 | ||
|
|
8bef4e5cec | ||
|
|
9d88e2eaec | ||
|
|
3569fdb4ff | ||
|
|
4e0eeab3d1 | ||
|
|
f7318d64fc | ||
|
|
90eee866fc | ||
|
|
dfd7af81f9 | ||
|
|
cbee21c07c | ||
|
|
a09a0148c2 | ||
|
|
6c45f432de | ||
|
|
830df53d74 | ||
|
|
af39804ce7 | ||
|
|
fbfd5b8f39 | ||
|
|
edbc11db7f | ||
|
|
0bd3836b31 | ||
|
|
e5d16d0100 | ||
|
|
3cddd6ece1 | ||
|
|
e7a030ddf9 | ||
|
|
9a32c9a930 | ||
|
|
695f85262b | ||
|
|
5c681657cb | ||
|
|
25a50ca2aa | ||
|
|
b61a1545a7 | ||
|
|
86a1631144 | ||
|
|
94682cc4d4 | ||
|
|
6e8a651980 | ||
|
|
0df9658b87 | ||
|
|
5b7c9f7e72 | ||
|
|
aeceeec732 | ||
|
|
3884c74e7d |
No files matched your search
@@ -5,3 +5,4 @@
|
||||
lbryexplorer.zip
|
||||
lbryexplorer.komodoproject
|
||||
.komodotools
|
||||
/.gtm/
|
||||
@@ -5,7 +5,6 @@ dist: trusty
|
||||
sudo: false
|
||||
|
||||
php:
|
||||
- 5.6
|
||||
- 7.0
|
||||
- 7.1
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# LBRY Block Explorer
|
||||
|
||||
A simple PHP block explorer for browsing transactions and claims on the [LBRY](https://lbry.io) blockchain. The explorer was developed using CakePHP which is a model-view-controller (MVC) PHP framework.
|
||||
A simple PHP block explorer for browsing transactions and claims on the [LBRY](https://lbry.com) blockchain. The explorer was developed using CakePHP which is a model-view-controller (MVC) PHP framework.
|
||||
|
||||
## Installation
|
||||
There are some prerequisites that need to be installed before the explorer can be accessed.
|
||||
@@ -76,7 +76,7 @@ Launch the URL for the configured web server root in a browser.
|
||||
|
||||
|
||||
## Contributing
|
||||
Contributions to this project are welcome, encouraged, and compensated. For more details, see https://lbry.io/faq/contributing
|
||||
Contributions to this project are welcome, encouraged, and compensated. For more details, see https://lbry.tech/contribute
|
||||
|
||||
|
||||
## License
|
||||
@@ -88,4 +88,4 @@ We take security seriously. Please contact security@lbry.io regarding any securi
|
||||
|
||||
|
||||
## Contact
|
||||
The primary contact for this project is [@akinwale](https://github.com/akinwale) (akinwale@lbry.io)
|
||||
The primary contact for this project is [@akinwale](https://github.com/akinwale) (akinwale@lbry.com)
|
||||
+2
-1
@@ -6,9 +6,10 @@
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": ">=5.6",
|
||||
"cakephp/cakephp": "^3.6",
|
||||
"cakephp/cakephp": "3.7.1",
|
||||
"mobiledetect/mobiledetectlib": "2.*",
|
||||
"cakephp/migrations": "~1.0",
|
||||
"psr/simple-cache": "^1.0.0",
|
||||
"cakephp/plugin-installer": "~1.0",
|
||||
"mdanter/ecc": "^0.5.0",
|
||||
"nesbot/carbon": "~1.18",
|
||||
|
||||
Generated
+180
-129
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "256edf12def1dab07052f75395a87692",
|
||||
"content-hash": "bfdd477b9edc64f5c9f04b61d9bb6ae2",
|
||||
"packages": [
|
||||
{
|
||||
"name": "aura/intl",
|
||||
@@ -103,16 +103,16 @@
|
||||
},
|
||||
{
|
||||
"name": "cakephp/cakephp",
|
||||
"version": "3.6.13",
|
||||
"version": "3.7.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/cakephp/cakephp.git",
|
||||
"reference": "6a0b9c74710a56c5974d1c8229c7a91dac780402"
|
||||
"reference": "1f6fd21ca27ffc88fa88506a400b94a809e29254"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/cakephp/cakephp/zipball/6a0b9c74710a56c5974d1c8229c7a91dac780402",
|
||||
"reference": "6a0b9c74710a56c5974d1c8229c7a91dac780402",
|
||||
"url": "https://api.github.com/repos/cakephp/cakephp/zipball/1f6fd21ca27ffc88fa88506a400b94a809e29254",
|
||||
"reference": "1f6fd21ca27ffc88fa88506a400b94a809e29254",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -122,6 +122,7 @@
|
||||
"ext-mbstring": "*",
|
||||
"php": ">=5.6.0",
|
||||
"psr/log": "^1.0.0",
|
||||
"psr/simple-cache": "^1.0.0",
|
||||
"zendframework/zend-diactoros": "^1.4.0"
|
||||
},
|
||||
"conflict": {
|
||||
@@ -147,6 +148,7 @@
|
||||
"phpunit/phpunit": "^5.7.14|^6.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-curl": "To enable more efficient network calls in Http\\Client.",
|
||||
"ext-openssl": "To use Security::encrypt() or have secure CSRF token generation.",
|
||||
"lib-ICU": "The intl PHP library, to use Text::transliterate() or Text::slug()"
|
||||
},
|
||||
@@ -185,7 +187,7 @@
|
||||
"rapid-development",
|
||||
"validation"
|
||||
],
|
||||
"time": "2018-11-04T20:29:27+00:00"
|
||||
"time": "2018-12-18T02:39:37+00:00"
|
||||
},
|
||||
{
|
||||
"name": "cakephp/chronos",
|
||||
@@ -427,16 +429,16 @@
|
||||
},
|
||||
{
|
||||
"name": "endroid/qr-code",
|
||||
"version": "3.5.0",
|
||||
"version": "3.5.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/endroid/qr-code.git",
|
||||
"reference": "0095706c3bf2389f15f6c097bab4a00a48fc5ff7"
|
||||
"reference": "d95143907cf178f9073523af4b37feb25bd6cdd0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/endroid/qr-code/zipball/0095706c3bf2389f15f6c097bab4a00a48fc5ff7",
|
||||
"reference": "0095706c3bf2389f15f6c097bab4a00a48fc5ff7",
|
||||
"url": "https://api.github.com/repos/endroid/qr-code/zipball/d95143907cf178f9073523af4b37feb25bd6cdd0",
|
||||
"reference": "d95143907cf178f9073523af4b37feb25bd6cdd0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -483,7 +485,7 @@
|
||||
"qr",
|
||||
"qrcode"
|
||||
],
|
||||
"time": "2018-12-01T12:34:40+00:00"
|
||||
"time": "2018-12-16T12:37:37+00:00"
|
||||
},
|
||||
{
|
||||
"name": "fgrosse/phpasn1",
|
||||
@@ -774,16 +776,16 @@
|
||||
},
|
||||
{
|
||||
"name": "nesbot/carbon",
|
||||
"version": "1.36.1",
|
||||
"version": "1.36.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/briannesbitt/Carbon.git",
|
||||
"reference": "63da8cdf89d7a5efe43aabc794365f6e7b7b8983"
|
||||
"reference": "cd324b98bc30290f233dd0e75e6ce49f7ab2a6c9"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/63da8cdf89d7a5efe43aabc794365f6e7b7b8983",
|
||||
"reference": "63da8cdf89d7a5efe43aabc794365f6e7b7b8983",
|
||||
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/cd324b98bc30290f233dd0e75e6ce49f7ab2a6c9",
|
||||
"reference": "cd324b98bc30290f233dd0e75e6ce49f7ab2a6c9",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -828,7 +830,7 @@
|
||||
"datetime",
|
||||
"time"
|
||||
],
|
||||
"time": "2018-11-22T18:23:02+00:00"
|
||||
"time": "2018-12-28T10:07:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "predis/predis",
|
||||
@@ -977,6 +979,54 @@
|
||||
],
|
||||
"time": "2018-11-20T15:27:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/simple-cache",
|
||||
"version": "1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/simple-cache.git",
|
||||
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
|
||||
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\SimpleCache\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interfaces for simple caching",
|
||||
"keywords": [
|
||||
"cache",
|
||||
"caching",
|
||||
"psr",
|
||||
"psr-16",
|
||||
"simple-cache"
|
||||
],
|
||||
"time": "2017-10-23T01:57:42+00:00"
|
||||
},
|
||||
{
|
||||
"name": "robmorgan/phinx",
|
||||
"version": "v0.8.1",
|
||||
@@ -1045,16 +1095,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/config",
|
||||
"version": "v3.4.19",
|
||||
"version": "v3.4.21",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/config.git",
|
||||
"reference": "8a660daeb65dedbe0b099529f65e61866c055081"
|
||||
"reference": "17c5d8941eb75a03d19bc76a43757738632d87b3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/config/zipball/8a660daeb65dedbe0b099529f65e61866c055081",
|
||||
"reference": "8a660daeb65dedbe0b099529f65e61866c055081",
|
||||
"url": "https://api.github.com/repos/symfony/config/zipball/17c5d8941eb75a03d19bc76a43757738632d87b3",
|
||||
"reference": "17c5d8941eb75a03d19bc76a43757738632d87b3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1105,20 +1155,20 @@
|
||||
],
|
||||
"description": "Symfony Config Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-11-26T10:17:44+00:00"
|
||||
"time": "2019-01-01T13:45:19+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
"version": "v3.4.19",
|
||||
"version": "v3.4.21",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/console.git",
|
||||
"reference": "8f80fc39bbc3b7c47ee54ba7aa2653521ace94bb"
|
||||
"reference": "a700b874d3692bc8342199adfb6d3b99f62cc61a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/8f80fc39bbc3b7c47ee54ba7aa2653521ace94bb",
|
||||
"reference": "8f80fc39bbc3b7c47ee54ba7aa2653521ace94bb",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/a700b874d3692bc8342199adfb6d3b99f62cc61a",
|
||||
"reference": "a700b874d3692bc8342199adfb6d3b99f62cc61a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1174,20 +1224,20 @@
|
||||
],
|
||||
"description": "Symfony Console Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-11-26T12:48:07+00:00"
|
||||
"time": "2019-01-04T04:42:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/contracts",
|
||||
"version": "v1.0.1",
|
||||
"version": "v1.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/contracts.git",
|
||||
"reference": "3edf0ab943d1985a356721952cba36ff31bd6e5f"
|
||||
"reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/contracts/zipball/3edf0ab943d1985a356721952cba36ff31bd6e5f",
|
||||
"reference": "3edf0ab943d1985a356721952cba36ff31bd6e5f",
|
||||
"url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf",
|
||||
"reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1242,20 +1292,20 @@
|
||||
"interoperability",
|
||||
"standards"
|
||||
],
|
||||
"time": "2018-11-24T09:35:08+00:00"
|
||||
"time": "2018-12-05T08:06:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/debug",
|
||||
"version": "v4.2.0",
|
||||
"version": "v4.2.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/debug.git",
|
||||
"reference": "e0a2b92ee0b5b934f973d90c2f58e18af109d276"
|
||||
"reference": "64cb33c81e37d19b7715d4a6a4d49c1c382066dd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/e0a2b92ee0b5b934f973d90c2f58e18af109d276",
|
||||
"reference": "e0a2b92ee0b5b934f973d90c2f58e18af109d276",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/64cb33c81e37d19b7715d4a6a4d49c1c382066dd",
|
||||
"reference": "64cb33c81e37d19b7715d4a6a4d49c1c382066dd",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1298,20 +1348,20 @@
|
||||
],
|
||||
"description": "Symfony Debug Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-11-28T18:24:18+00:00"
|
||||
"time": "2019-01-03T09:07:35+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/filesystem",
|
||||
"version": "v4.2.0",
|
||||
"version": "v4.2.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/filesystem.git",
|
||||
"reference": "2f4c8b999b3b7cadb2a69390b01af70886753710"
|
||||
"reference": "c2ffd9a93f2d6c5be2f68a0aa7953cc229f871f8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/filesystem/zipball/2f4c8b999b3b7cadb2a69390b01af70886753710",
|
||||
"reference": "2f4c8b999b3b7cadb2a69390b01af70886753710",
|
||||
"url": "https://api.github.com/repos/symfony/filesystem/zipball/c2ffd9a93f2d6c5be2f68a0aa7953cc229f871f8",
|
||||
"reference": "c2ffd9a93f2d6c5be2f68a0aa7953cc229f871f8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1348,20 +1398,20 @@
|
||||
],
|
||||
"description": "Symfony Filesystem Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-11-11T19:52:12+00:00"
|
||||
"time": "2019-01-03T09:07:35+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/inflector",
|
||||
"version": "v4.2.0",
|
||||
"version": "v4.2.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/inflector.git",
|
||||
"reference": "f9a637c0359f74404d44cf0da0a3ce53bae0787e"
|
||||
"reference": "9f64271222922ef1a10e43f77d88baf72bf22b0e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/inflector/zipball/f9a637c0359f74404d44cf0da0a3ce53bae0787e",
|
||||
"reference": "f9a637c0359f74404d44cf0da0a3ce53bae0787e",
|
||||
"url": "https://api.github.com/repos/symfony/inflector/zipball/9f64271222922ef1a10e43f77d88baf72bf22b0e",
|
||||
"reference": "9f64271222922ef1a10e43f77d88baf72bf22b0e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1406,20 +1456,20 @@
|
||||
"symfony",
|
||||
"words"
|
||||
],
|
||||
"time": "2018-11-11T19:52:12+00:00"
|
||||
"time": "2019-01-03T09:07:35+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/options-resolver",
|
||||
"version": "v4.2.0",
|
||||
"version": "v4.2.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/options-resolver.git",
|
||||
"reference": "a9c38e8a3da2c03b3e71fdffa6efb0bda51390ba"
|
||||
"reference": "fbcb106aeee72f3450298bf73324d2cc00d083d1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/a9c38e8a3da2c03b3e71fdffa6efb0bda51390ba",
|
||||
"reference": "a9c38e8a3da2c03b3e71fdffa6efb0bda51390ba",
|
||||
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/fbcb106aeee72f3450298bf73324d2cc00d083d1",
|
||||
"reference": "fbcb106aeee72f3450298bf73324d2cc00d083d1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1460,7 +1510,7 @@
|
||||
"configuration",
|
||||
"options"
|
||||
],
|
||||
"time": "2018-11-11T19:52:12+00:00"
|
||||
"time": "2019-01-03T09:07:35+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
@@ -1581,16 +1631,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/property-access",
|
||||
"version": "v4.2.0",
|
||||
"version": "v4.2.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/property-access.git",
|
||||
"reference": "b6df4e1849f389468edb36e2e59877d4a8170723"
|
||||
"reference": "a21d40670000f61a1a4b90a607d54696aad914cd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/property-access/zipball/b6df4e1849f389468edb36e2e59877d4a8170723",
|
||||
"reference": "b6df4e1849f389468edb36e2e59877d4a8170723",
|
||||
"url": "https://api.github.com/repos/symfony/property-access/zipball/a21d40670000f61a1a4b90a607d54696aad914cd",
|
||||
"reference": "a21d40670000f61a1a4b90a607d54696aad914cd",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1644,25 +1694,25 @@
|
||||
"property path",
|
||||
"reflection"
|
||||
],
|
||||
"time": "2018-11-29T14:48:32+00:00"
|
||||
"time": "2019-01-05T16:37:49+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/translation",
|
||||
"version": "v4.2.0",
|
||||
"version": "v4.2.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/translation.git",
|
||||
"reference": "ff9a878c9b8f8bcd4d9138e2d32f508c942773d9"
|
||||
"reference": "939fb792d73f2ce80e6ae9019d205fc480f1c9a0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/translation/zipball/ff9a878c9b8f8bcd4d9138e2d32f508c942773d9",
|
||||
"reference": "ff9a878c9b8f8bcd4d9138e2d32f508c942773d9",
|
||||
"url": "https://api.github.com/repos/symfony/translation/zipball/939fb792d73f2ce80e6ae9019d205fc480f1c9a0",
|
||||
"reference": "939fb792d73f2ce80e6ae9019d205fc480f1c9a0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1.3",
|
||||
"symfony/contracts": "^1.0",
|
||||
"symfony/contracts": "^1.0.2",
|
||||
"symfony/polyfill-mbstring": "~1.0"
|
||||
},
|
||||
"conflict": {
|
||||
@@ -1717,20 +1767,20 @@
|
||||
],
|
||||
"description": "Symfony Translation Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-11-27T07:20:32+00:00"
|
||||
"time": "2019-01-03T09:07:35+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/yaml",
|
||||
"version": "v3.4.19",
|
||||
"version": "v3.4.21",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/yaml.git",
|
||||
"reference": "291e13d808bec481eab83f301f7bff3e699ef603"
|
||||
"reference": "554a59a1ccbaac238a89b19c8e551a556fd0e2ea"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/yaml/zipball/291e13d808bec481eab83f301f7bff3e699ef603",
|
||||
"reference": "291e13d808bec481eab83f301f7bff3e699ef603",
|
||||
"url": "https://api.github.com/repos/symfony/yaml/zipball/554a59a1ccbaac238a89b19c8e551a556fd0e2ea",
|
||||
"reference": "554a59a1ccbaac238a89b19c8e551a556fd0e2ea",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1776,7 +1826,7 @@
|
||||
],
|
||||
"description": "Symfony Yaml Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-11-11T19:48:54+00:00"
|
||||
"time": "2019-01-01T13:45:19+00:00"
|
||||
},
|
||||
{
|
||||
"name": "zendframework/zend-diactoros",
|
||||
@@ -1846,16 +1896,16 @@
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "ajgl/breakpoint-twig-extension",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ajgarlag/AjglBreakpointTwigExtension.git",
|
||||
"reference": "360ec6351ad7e1968ee78abb31430046c2e04fc5"
|
||||
"reference": "bb419d13775d8fb5cd03b31012eaf496b31b444f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/ajgarlag/AjglBreakpointTwigExtension/zipball/360ec6351ad7e1968ee78abb31430046c2e04fc5",
|
||||
"reference": "360ec6351ad7e1968ee78abb31430046c2e04fc5",
|
||||
"url": "https://api.github.com/repos/ajgarlag/AjglBreakpointTwigExtension/zipball/bb419d13775d8fb5cd03b31012eaf496b31b444f",
|
||||
"reference": "bb419d13775d8fb5cd03b31012eaf496b31b444f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1863,9 +1913,9 @@
|
||||
"twig/twig": "^1.14|^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^5",
|
||||
"symfony/framework-bundle": "^2.7|^3.2",
|
||||
"symfony/twig-bundle": "^2.7|^3.2"
|
||||
"symfony/framework-bundle": "^2.7|^3.2|^4.1",
|
||||
"symfony/phpunit-bridge": "^3.4|^4.1",
|
||||
"symfony/twig-bundle": "^2.7|^3.2|^4.1"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-xdebug": "The Xdebug extension is required for the breakpoint to work",
|
||||
@@ -1902,7 +1952,7 @@
|
||||
"breakpoint",
|
||||
"twig"
|
||||
],
|
||||
"time": "2017-11-20T13:04:11+00:00"
|
||||
"time": "2018-12-10T08:22:36+00:00"
|
||||
},
|
||||
{
|
||||
"name": "aptoma/twig-markdown",
|
||||
@@ -2017,23 +2067,23 @@
|
||||
},
|
||||
{
|
||||
"name": "cakephp/bake",
|
||||
"version": "1.8.6",
|
||||
"version": "1.9.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/cakephp/bake.git",
|
||||
"reference": "bfa552a92a01cb1c878b3a3a67899fcd21569818"
|
||||
"reference": "9949a6a867a17cf30996dfc9daceab1c63a7a9c1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/cakephp/bake/zipball/bfa552a92a01cb1c878b3a3a67899fcd21569818",
|
||||
"reference": "bfa552a92a01cb1c878b3a3a67899fcd21569818",
|
||||
"url": "https://api.github.com/repos/cakephp/bake/zipball/9949a6a867a17cf30996dfc9daceab1c63a7a9c1",
|
||||
"reference": "9949a6a867a17cf30996dfc9daceab1c63a7a9c1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"cakephp/cakephp": "^3.6.12",
|
||||
"cakephp/cakephp": "^3.7.0",
|
||||
"cakephp/plugin-installer": "^1.0",
|
||||
"php": ">=5.6.0",
|
||||
"wyrihaximus/twig-view": "^4.3.4"
|
||||
"wyrihaximus/twig-view": "^4.3.7"
|
||||
},
|
||||
"require-dev": {
|
||||
"cakephp/cakephp-codesniffer": "^3.0",
|
||||
@@ -2061,24 +2111,24 @@
|
||||
"bake",
|
||||
"cakephp"
|
||||
],
|
||||
"time": "2018-11-17T03:34:24+00:00"
|
||||
"time": "2019-01-02T12:59:40+00:00"
|
||||
},
|
||||
{
|
||||
"name": "cakephp/debug_kit",
|
||||
"version": "3.16.6",
|
||||
"version": "3.17.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/cakephp/debug_kit.git",
|
||||
"reference": "b6a75d47b2b1be6f6db31fbdf60ed5e062f310db"
|
||||
"reference": "6a9023ecc4ac0983c184cedf8e6142ab8ea4a3ff"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/cakephp/debug_kit/zipball/b6a75d47b2b1be6f6db31fbdf60ed5e062f310db",
|
||||
"reference": "b6a75d47b2b1be6f6db31fbdf60ed5e062f310db",
|
||||
"url": "https://api.github.com/repos/cakephp/debug_kit/zipball/6a9023ecc4ac0983c184cedf8e6142ab8ea4a3ff",
|
||||
"reference": "6a9023ecc4ac0983c184cedf8e6142ab8ea4a3ff",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"cakephp/cakephp": "^3.6.0",
|
||||
"cakephp/cakephp": "^3.7.0",
|
||||
"cakephp/chronos": "^1.0.0",
|
||||
"cakephp/plugin-installer": "^1.0.0",
|
||||
"composer/composer": "^1.3.0",
|
||||
@@ -2121,7 +2171,7 @@
|
||||
"debug",
|
||||
"kit"
|
||||
],
|
||||
"time": "2018-11-22T15:19:18+00:00"
|
||||
"time": "2018-12-02T03:27:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "composer/ca-bundle",
|
||||
@@ -2659,23 +2709,23 @@
|
||||
},
|
||||
{
|
||||
"name": "justinrainbow/json-schema",
|
||||
"version": "5.2.7",
|
||||
"version": "5.2.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/justinrainbow/json-schema.git",
|
||||
"reference": "8560d4314577199ba51bf2032f02cd1315587c23"
|
||||
"reference": "dcb6e1006bb5fd1e392b4daa68932880f37550d4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/8560d4314577199ba51bf2032f02cd1315587c23",
|
||||
"reference": "8560d4314577199ba51bf2032f02cd1315587c23",
|
||||
"url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/dcb6e1006bb5fd1e392b4daa68932880f37550d4",
|
||||
"reference": "dcb6e1006bb5fd1e392b4daa68932880f37550d4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "^2.1",
|
||||
"friendsofphp/php-cs-fixer": "~2.2.20",
|
||||
"json-schema/json-schema-test-suite": "1.2.0",
|
||||
"phpunit/phpunit": "^4.8.35"
|
||||
},
|
||||
@@ -2721,20 +2771,20 @@
|
||||
"json",
|
||||
"schema"
|
||||
],
|
||||
"time": "2018-02-14T22:26:30+00:00"
|
||||
"time": "2019-01-14T23:55:14+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nikic/php-parser",
|
||||
"version": "v4.1.0",
|
||||
"version": "v4.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nikic/PHP-Parser.git",
|
||||
"reference": "d0230c5c77a7e3cfa69446febf340978540958c0"
|
||||
"reference": "594bcae1fc0bccd3993d2f0d61a018e26ac2865a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/d0230c5c77a7e3cfa69446febf340978540958c0",
|
||||
"reference": "d0230c5c77a7e3cfa69446febf340978540958c0",
|
||||
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/594bcae1fc0bccd3993d2f0d61a018e26ac2865a",
|
||||
"reference": "594bcae1fc0bccd3993d2f0d61a018e26ac2865a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2750,7 +2800,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.1-dev"
|
||||
"dev-master": "4.2-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -2772,7 +2822,7 @@
|
||||
"parser",
|
||||
"php"
|
||||
],
|
||||
"time": "2018-10-10T09:24:14+00:00"
|
||||
"time": "2019-01-12T16:31:37+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psy/psysh",
|
||||
@@ -2943,16 +2993,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/finder",
|
||||
"version": "v4.2.0",
|
||||
"version": "v4.2.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/finder.git",
|
||||
"reference": "e53d477d7b5c4982d0e1bfd2298dbee63d01441d"
|
||||
"reference": "9094d69e8c6ee3fe186a0ec5a4f1401e506071ce"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/finder/zipball/e53d477d7b5c4982d0e1bfd2298dbee63d01441d",
|
||||
"reference": "e53d477d7b5c4982d0e1bfd2298dbee63d01441d",
|
||||
"url": "https://api.github.com/repos/symfony/finder/zipball/9094d69e8c6ee3fe186a0ec5a4f1401e506071ce",
|
||||
"reference": "9094d69e8c6ee3fe186a0ec5a4f1401e506071ce",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2988,7 +3038,7 @@
|
||||
],
|
||||
"description": "Symfony Finder Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-11-11T19:52:12+00:00"
|
||||
"time": "2019-01-03T09:07:35+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php72",
|
||||
@@ -3047,16 +3097,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "v4.2.0",
|
||||
"version": "v4.2.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/process.git",
|
||||
"reference": "2b341009ccec76837a7f46f59641b431e4d4c2b0"
|
||||
"reference": "ea043ab5d8ed13b467a9087d81cb876aee7f689a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/2b341009ccec76837a7f46f59641b431e4d4c2b0",
|
||||
"reference": "2b341009ccec76837a7f46f59641b431e4d4c2b0",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/ea043ab5d8ed13b467a9087d81cb876aee7f689a",
|
||||
"reference": "ea043ab5d8ed13b467a9087d81cb876aee7f689a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3092,20 +3142,20 @@
|
||||
],
|
||||
"description": "Symfony Process Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2018-11-20T16:22:05+00:00"
|
||||
"time": "2019-01-03T14:48:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v4.2.0",
|
||||
"version": "v4.2.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
"reference": "db61258540350725f4beb6b84006e32398acd120"
|
||||
"reference": "85bde661b178173d85c6f11ea9d03b61d1212bb2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/db61258540350725f4beb6b84006e32398acd120",
|
||||
"reference": "db61258540350725f4beb6b84006e32398acd120",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/85bde661b178173d85c6f11ea9d03b61d1212bb2",
|
||||
"reference": "85bde661b178173d85c6f11ea9d03b61d1212bb2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3119,6 +3169,7 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-iconv": "*",
|
||||
"symfony/console": "~3.4|~4.0",
|
||||
"symfony/process": "~3.4|~4.0",
|
||||
"twig/twig": "~1.34|~2.4"
|
||||
},
|
||||
@@ -3167,35 +3218,35 @@
|
||||
"debug",
|
||||
"dump"
|
||||
],
|
||||
"time": "2018-11-25T12:50:42+00:00"
|
||||
"time": "2019-01-03T09:07:35+00:00"
|
||||
},
|
||||
{
|
||||
"name": "twig/twig",
|
||||
"version": "v1.35.4",
|
||||
"version": "v1.37.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/twigphp/Twig.git",
|
||||
"reference": "7e081e98378a1e78c29cc9eba4aefa5d78a05d2a"
|
||||
"reference": "66be9366c76cbf23e82e7171d47cbfa54a057a62"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/7e081e98378a1e78c29cc9eba4aefa5d78a05d2a",
|
||||
"reference": "7e081e98378a1e78c29cc9eba4aefa5d78a05d2a",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/66be9366c76cbf23e82e7171d47cbfa54a057a62",
|
||||
"reference": "66be9366c76cbf23e82e7171d47cbfa54a057a62",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"php": ">=5.4.0",
|
||||
"symfony/polyfill-ctype": "^1.8"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/container": "^1.0",
|
||||
"symfony/debug": "^2.7",
|
||||
"symfony/phpunit-bridge": "^3.3"
|
||||
"symfony/phpunit-bridge": "^3.4.19|^4.1.8"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.35-dev"
|
||||
"dev-master": "1.37-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -3233,7 +3284,7 @@
|
||||
"keywords": [
|
||||
"templating"
|
||||
],
|
||||
"time": "2018-07-13T07:12:17+00:00"
|
||||
"time": "2019-01-14T14:59:29+00:00"
|
||||
},
|
||||
{
|
||||
"name": "umpirsky/twig-php-function",
|
||||
@@ -3278,23 +3329,23 @@
|
||||
},
|
||||
{
|
||||
"name": "wyrihaximus/twig-view",
|
||||
"version": "4.3.5",
|
||||
"version": "4.3.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/WyriHaximus/TwigView.git",
|
||||
"reference": "ec2771e6a1fe799f9b16eff19da424cd04d593b7"
|
||||
"reference": "a5ec66690aa045d6eda17ab1c8a5baf0efdcfa45"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/WyriHaximus/TwigView/zipball/ec2771e6a1fe799f9b16eff19da424cd04d593b7",
|
||||
"reference": "ec2771e6a1fe799f9b16eff19da424cd04d593b7",
|
||||
"url": "https://api.github.com/repos/WyriHaximus/TwigView/zipball/a5ec66690aa045d6eda17ab1c8a5baf0efdcfa45",
|
||||
"reference": "a5ec66690aa045d6eda17ab1c8a5baf0efdcfa45",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ajgl/breakpoint-twig-extension": "^0.3.0",
|
||||
"aptoma/twig-markdown": "^2.0",
|
||||
"asm89/twig-cache-extension": "^1.0",
|
||||
"cakephp/cakephp": "^3.5",
|
||||
"cakephp/cakephp": "^3.6",
|
||||
"jasny/twig-extensions": "^1.0",
|
||||
"php": "^5.6 || ^7.0",
|
||||
"twig/twig": "^1.27",
|
||||
@@ -3332,7 +3383,7 @@
|
||||
"twig",
|
||||
"view"
|
||||
],
|
||||
"time": "2018-07-03T15:46:29+00:00"
|
||||
"time": "2018-12-17T21:08:25+00:00"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
|
||||
+27
-8
@@ -1,6 +1,4 @@
|
||||
<?php
|
||||
namespace App\config;
|
||||
|
||||
return [
|
||||
/**
|
||||
* Debug Level:
|
||||
@@ -220,20 +218,20 @@ return [
|
||||
* See vendor\cakephp\cakephp\src\Database\Driver for complete list
|
||||
*/
|
||||
'Datasources' => [
|
||||
'default' => [
|
||||
'default' => [ // Chainquery database connection
|
||||
'className' => 'Cake\Database\Connection',
|
||||
'driver' => 'Cake\Database\Driver\Mysql',
|
||||
'persistent' => false,
|
||||
'host' => 'localhost',
|
||||
'host' => 'chainquery.lbry.io',
|
||||
/**
|
||||
* CakePHP will use the default DB port based on the driver selected
|
||||
* MySQL on MAMP uses port 8889, MAMP users will want to uncomment
|
||||
* the following line and set the port accordingly
|
||||
*/
|
||||
//'port' => 'non_standard_port_number',
|
||||
'username' => 'my_app',
|
||||
//'port' => '3000',
|
||||
'username' => 'username',
|
||||
'password' => 'secret',
|
||||
'database' => 'my_app',
|
||||
'database' => 'my_db',
|
||||
'encoding' => 'utf8',
|
||||
'timezone' => 'UTC',
|
||||
'flags' => [],
|
||||
@@ -259,7 +257,28 @@ return [
|
||||
*/
|
||||
//'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
|
||||
|
||||
'url' => env('DATABASE_URL', null),
|
||||
'url' => env('DATABASE_URL', 'chainquery.lbry.io:3600'),
|
||||
],
|
||||
|
||||
'localdb' => [ // Local db for price history
|
||||
'className' => 'Cake\Database\Connection',
|
||||
'driver' => 'Cake\Database\Driver\Mysql',
|
||||
'persistent' => false,
|
||||
'host' => 'localhost',
|
||||
/**
|
||||
* CakePHP will use the default DB port based on the driver selected
|
||||
* MySQL on MAMP uses port 8889, MAMP users will want to uncomment
|
||||
* the following line and set the port accordingly
|
||||
*/
|
||||
//'port' => '3306',
|
||||
'username' => 'username',
|
||||
'password' => 'secret',
|
||||
'database' => 'lbry',
|
||||
'encoding' => 'utf8',
|
||||
'timezone' => 'UTC',
|
||||
'flags' => [],
|
||||
'cacheMetadata' => true,
|
||||
'log' => false,
|
||||
],
|
||||
|
||||
/**
|
||||
|
||||
+37
-7
@@ -15,19 +15,22 @@
|
||||
|
||||
// You can remove this if you are confident that your PHP version is sufficient.
|
||||
if (version_compare(PHP_VERSION, '5.6.0') < 0) {
|
||||
trigger_error('Your PHP version must be equal or higher than 5.6.0 to}
|
||||
trigger_error('Your PHP version must be equal or higher than 5.6.0 to use CakePHP.', E_USER_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* You can remove this if you are confident you have intl installed.
|
||||
*/
|
||||
if (!extension_loaded('intl')) {
|
||||
trigger_error('You must enable the intl extension to}
|
||||
trigger_error('You must enable the intl extension to use CakePHP.', E_USER_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* You can remove this if you are confident you have mbstring installed.
|
||||
*/
|
||||
if (!extension_loaded('mbstring')) {
|
||||
trigger_error('You must enable the mbstring extension to}
|
||||
trigger_error('You must enable the mbstring extension to use CakePHP.', E_USER_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* Configure paths required to find CakePHP + general filepath
|
||||
@@ -46,6 +49,22 @@ require __DIR__ . '/paths.php';
|
||||
*/
|
||||
require CORE_PATH . 'config' . DS . 'bootstrap.php';
|
||||
|
||||
use App\Application;
|
||||
use Cake\Cache\Cache;
|
||||
use Cake\Console\ConsoleErrorHandler;
|
||||
use Cake\Core\App;
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Core\Configure\Engine\PhpConfig;
|
||||
use Cake\Core\Plugin;
|
||||
use Cake\Database\Type;
|
||||
use Cake\Datasource\ConnectionManager;
|
||||
use Cake\Error\ErrorHandler;
|
||||
use Cake\Log\Log;
|
||||
use Cake\Mailer\Email;
|
||||
use Cake\Mailer\TransportFactory;
|
||||
use Cake\Http\ServerRequest;
|
||||
use Cake\Utility\Inflector;
|
||||
use Cake\Utility\Security;
|
||||
|
||||
/*
|
||||
* Read configuration file and inject configuration into various
|
||||
@@ -133,9 +152,11 @@ if (!Configure::read('App.fullBaseUrl')) {
|
||||
|
||||
Cache::setConfig(Configure::consume('Cache'));
|
||||
ConnectionManager::setConfig(Configure::consume('Datasources'));
|
||||
Email::setConfigTransport(Configure::consume('EmailTransport'));
|
||||
//Email::setConfigTransport(Configure::consume('EmailTransport'));
|
||||
TransportFactory::setConfig(Configure::consume('EmailTransport'));
|
||||
Email::setConfig(Configure::consume('Email'));
|
||||
Log::setConfig(Configure::consume('Log'));
|
||||
//Security::salt(Configure::consume('Security.salt'));
|
||||
Security::setSalt(Configure::consume('Security.salt'));
|
||||
|
||||
/*
|
||||
@@ -148,12 +169,12 @@ Security::setSalt(Configure::consume('Security.salt'));
|
||||
/*
|
||||
* Setup detectors for mobile and tablet.
|
||||
*/
|
||||
Request::addDetector('mobile', function ($request) {
|
||||
ServerRequest::addDetector('mobile', function ($request) {
|
||||
$detector = new \Detection\MobileDetect();
|
||||
|
||||
return $detector->isMobile();
|
||||
});
|
||||
Request::addDetector('tablet', function ($request) {
|
||||
ServerRequest::addDetector('tablet', function ($request) {
|
||||
$detector = new \Detection\MobileDetect();
|
||||
|
||||
return $detector->isTablet();
|
||||
@@ -196,5 +217,14 @@ Type::build('timestamp')
|
||||
*
|
||||
*/
|
||||
|
||||
Configure::load('lbry');
|
||||
/*
|
||||
* Only try to load DebugKit in development mode
|
||||
* Debug Kit should not be installed on a production system
|
||||
*/
|
||||
if (Configure::read('debug')) {
|
||||
//Plugin::load('DebugKit', ['bootstrap' => true]);
|
||||
Application::addPlugin('DebugKit', ['bootstrap' => true]);
|
||||
}
|
||||
|
||||
Configure::load('lbry','lbry.default');
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
* @since 3.0.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
namespace App\config;
|
||||
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Core\Exception\MissingPluginException;
|
||||
use Cake\Core\Plugin;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace App\config;
|
||||
|
||||
return [
|
||||
'Lbry' => [
|
||||
'RpcUrl' => 'http://user:password@127.0.0.1:9245',
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
* @since 3.0.0
|
||||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
namespace App\config;
|
||||
|
||||
|
||||
/**
|
||||
* Use the DS to separate the directories in other defines
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
|
||||
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
|
||||
* @link https://cakephp.org CakePHP(tm) Project
|
||||
* @since 3.5.0
|
||||
* @license https://opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
/*
|
||||
* You can empty out this file, if you are certain that you match all requirements.
|
||||
*/
|
||||
|
||||
/*
|
||||
* You can remove this if you are confident that your PHP version is sufficient.
|
||||
*/
|
||||
if (version_compare(PHP_VERSION, '5.6.0') < 0) {
|
||||
trigger_error('Your PHP version must be equal or higher than 5.6.0 to use CakePHP.' . PHP_EOL, E_USER_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* You can remove this if you are confident you have intl installed.
|
||||
*/
|
||||
if (!extension_loaded('intl')) {
|
||||
trigger_error('You must enable the intl extension to use CakePHP.' . PHP_EOL, E_USER_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* You can remove this if you are confident you have mbstring installed.
|
||||
*/
|
||||
if (!extension_loaded('mbstring')) {
|
||||
trigger_error('You must enable the mbstring extension to use CakePHP.' . PHP_EOL, E_USER_ERROR);
|
||||
}
|
||||
+5
-1
@@ -18,6 +18,10 @@
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
use Cake\Core\Plugin;
|
||||
use Cake\Routing\RouteBuilder;
|
||||
use Cake\Routing\Router;
|
||||
use Cake\Routing\Route\DashedRoute;
|
||||
|
||||
/**
|
||||
* The default class to use for all routes
|
||||
@@ -67,4 +71,4 @@ Router::scope('/', function (RouteBuilder $routes) {
|
||||
$routes->connect('/api/v1/claims/browse', ['controller' => 'Claims', 'action' => 'apibrowse']);
|
||||
|
||||
//$routes->fallbacks(DashedRoute::class);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
PHPBIN=php7.2
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
|
||||
if [ ! -e "config/app.php" ]; then
|
||||
cp "$DIR/config/app.default.php" "$DIR/config/app.php"
|
||||
fi
|
||||
|
||||
if ! which $PHPBIN 2>/dev/null; then
|
||||
PHPBIN=php
|
||||
fi
|
||||
|
||||
#Composer update
|
||||
composer update
|
||||
|
||||
#$PHPBIN composer.phar install
|
||||
|
||||
$PHPBIN --server localhost:8000 --docroot "$DIR/webroot" "$DIR/webroot/index.php"
|
||||
@@ -74,7 +74,7 @@ CREATE TABLE `Addresses`
|
||||
`TotalReceived` DECIMAL(18,8) DEFAULT 0 NOT NULL,
|
||||
`TotalSent` DECIMAL(18,8) DEFAULT 0 NOT NULL,
|
||||
`Balance` DECIMAL(18,8) AS (`TotalReceived` - `TotalSent`) PERSISTENT,
|
||||
`Tag` VARCHAR(30) NOT NULL,
|
||||
`Tag` VARCHAR(30),
|
||||
`TagUrl` VARCHAR(200),
|
||||
`Created` DATETIME NOT NULL,
|
||||
`Modified` DATETIME NOT NULL,
|
||||
|
||||
+2
-14
@@ -12,11 +12,9 @@
|
||||
* @since 3.3.0
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
namespace App;
|
||||
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Core\Plugin;
|
||||
use Cake\Error\Middleware\ErrorHandlerMiddleware;
|
||||
use Cake\Http\BaseApplication;
|
||||
use Cake\Routing\Middleware\AssetMiddleware;
|
||||
@@ -42,23 +40,13 @@ class Application extends BaseApplication
|
||||
// Catch any exceptions in the lower layers,
|
||||
// and make an error page/response
|
||||
->add(ErrorHandlerMiddleware::class)
|
||||
|
||||
// Handle plugin/theme assets like CakePHP normally does.
|
||||
->add(AssetMiddleware::class)
|
||||
|
||||
// Apply routing
|
||||
->add(RoutingMiddleware::class);
|
||||
|
||||
return $middleware;
|
||||
}
|
||||
|
||||
public function bootstrap()
|
||||
{
|
||||
parent::bootstrap(); // TODO: Change the autogenerated stub
|
||||
/*
|
||||
* Only try to load DebugKit in development mode
|
||||
* Debug Kit should not be installed on a production system
|
||||
*/
|
||||
if (Configure::read('debug')) {
|
||||
$this->addPlugin(\DebugKit\Plugin::class);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ class Installer
|
||||
if (in_array($arg, ['Y', 'y', 'N', 'n'])) {
|
||||
return $arg;
|
||||
}
|
||||
throw new \Exception('This is not a valid answer. Please choose Y or n.');
|
||||
throw new Exception('This is not a valid answer. Please choose Y or n.');
|
||||
};
|
||||
$setFolderPermissions = $io->askAndValidate(
|
||||
'<info>Set Folder Permissions ? (Default to Y)</info> [<comment>Y,n</comment>]? ',
|
||||
|
||||
@@ -36,7 +36,6 @@ class AppController extends Controller
|
||||
* e.g. `$this->loadComponent('Security');`
|
||||
*
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
@@ -62,17 +61,17 @@ class AppController extends Controller
|
||||
public function beforeRender(Event $event)
|
||||
{
|
||||
if (!array_key_exists('_serialize', $this->viewVars) &&
|
||||
in_array($this->response->getType(), ['application/json', 'application/xml'])
|
||||
in_array($this->response->type(), ['application/json', 'application/xml'])
|
||||
) {
|
||||
$this->set('_serialize', true);
|
||||
}
|
||||
}
|
||||
|
||||
protected function _jsonResponse($object = [], $statusCode = 200)
|
||||
protected function _jsonResponse($object = [], $statusCode = null)
|
||||
{
|
||||
$this->response->withStatus($statusCode);
|
||||
$this->response->withType('json');
|
||||
$this->response->withStringBody(json_encode($object));
|
||||
$this->response->statusCode($statusCode);
|
||||
$this->response->type('json');
|
||||
$this->response->body(json_encode($object));
|
||||
}
|
||||
|
||||
protected function _jsonError($message, $statusCode = null) {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Controller\AppController;
|
||||
use Cake\Datasource\ConnectionManager;
|
||||
use Cake\Log\Log;
|
||||
|
||||
@@ -12,10 +11,10 @@ class ClaimsController extends AppController {
|
||||
$this->loadModel('Claims');
|
||||
|
||||
$pageLimit = 48;
|
||||
$beforeId = intval($this->request->getQuery('before'));
|
||||
$afterId = intval($this->request->getQuery('after'));
|
||||
$sort = trim($this->request->getQuery('sort'));
|
||||
$nsfw = trim($this->request->getQuery('nsfw'));
|
||||
$beforeId = intval($this->request->query('before'));
|
||||
$afterId = intval($this->request->query('after'));
|
||||
$sort = trim($this->request->query('sort'));
|
||||
$nsfw = trim($this->request->query('nsfw'));
|
||||
switch ($sort) {
|
||||
case 'popular':
|
||||
// TODO: sort by upvote/downvote score
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
*/
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Controller\AppController;
|
||||
use Cake\Event\Event;
|
||||
|
||||
/**
|
||||
@@ -28,7 +27,6 @@ class ErrorController extends AppController
|
||||
* Initialization hook method.
|
||||
*
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function initialize()
|
||||
{
|
||||
|
||||
+317
-341
@@ -2,18 +2,19 @@
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Controller\AppController;
|
||||
use Mdanter\Ecc\EccFactory;
|
||||
use Mdanter\Ecc\Crypto\Signature\Signer;
|
||||
use Mdanter\Ecc\Serializer\PublicKey\PemPublicKeySerializer;
|
||||
use Mdanter\Ecc\Serializer\PublicKey\DerPublicKeySerializer;
|
||||
use Mdanter\Ecc\Serializer\Signature\DerSignatureSerializer;
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Datasource\ConnectionManager;
|
||||
use Cake\Log\Log;
|
||||
use Endroid\QrCode\ErrorCorrectionLevel;
|
||||
use Endroid\QrCode\LabelAlignment;
|
||||
use Endroid\QrCode\QrCode;
|
||||
use Mdanter\Ecc\Crypto\Signature\Signer;
|
||||
use Mdanter\Ecc\EccFactory;
|
||||
use Mdanter\Ecc\Serializer\PublicKey\DerPublicKeySerializer;
|
||||
use Mdanter\Ecc\Serializer\PublicKey\PemPublicKeySerializer;
|
||||
use Mdanter\Ecc\Serializer\Signature\DerSignatureSerializer;
|
||||
use Endroid\QrCode\Response\QrCodeResponse;
|
||||
|
||||
|
||||
class MainController extends AppController {
|
||||
|
||||
@@ -95,21 +96,17 @@ class MainController extends AppController {
|
||||
$lbcUsdPrice = $this->_getLatestPrice();
|
||||
$this->set('lbcUsdPrice', $lbcUsdPrice);
|
||||
|
||||
$blocks = $this->Blocks->find()->select(['Chainwork', 'Confirmations', 'Difficulty', 'Hash', 'Height', 'TransactionHashes', 'BlockTime', 'BlockSize'])->
|
||||
order(['Height' => 'desc'])->limit(6)->toArray();
|
||||
$blocks = $this->Blocks->find()->select(['chainwork', 'confirmations', 'difficulty', 'hash', 'height', 'transaction_hashes', 'block_time', 'block_size'])->order(['height' => 'desc'])->limit(6)->toArray();
|
||||
for ($i = 0; $i < count($blocks); $i++) {
|
||||
$tx_hashes = json_decode($blocks[$i]->TransactionHashes);
|
||||
$blocks[$i]->TransactionCount = count($tx_hashes);
|
||||
$tx_hashes = preg_split('#,#', $blocks[$i]->transaction_hashes);
|
||||
$blocks[$i]->transaction_count = count($tx_hashes);
|
||||
}
|
||||
|
||||
// hash rate
|
||||
$hashRate = $this->_formatHashRate($this->_gethashrate());
|
||||
|
||||
// recent claims
|
||||
$claims = $this->Claims->find()->select(['TransactionHash', 'Name', 'Vout', 'ClaimId', 'ClaimType', 'Author', 'Title', 'Description', 'ContentType',
|
||||
'IsNSFW', 'Language', 'ThumbnailUrl', 'Created'])->
|
||||
distinct(['Claims.ClaimId'])->
|
||||
contain(['Publisher' => ['fields' => ['Name']]])->order(['Claims.Created' => 'DESC'])->limit(5)->toArray();
|
||||
//$claims = $this->Claims->find()->distinct(['Claims.claim_id'])->select($this->Claims)->select(['publisher' => 'C.name'])->leftJoin(['C' => 'claim'], ['C.claim_id = Claims.publisher_id'])->order(['Claims.created_at' => 'DESC'])->limit(5)->toArray();
|
||||
$claims = $this->Claims->find()->select($this->Claims)->select(['publisher' => 'C.name'])->leftJoin(['C' => 'claim'], ['C.claim_id = Claims.publisher_id'])->order(['Claims.created_at' => 'DESC'])->limit(5)->toArray();
|
||||
|
||||
$this->set('recentBlocks', $blocks);
|
||||
$this->set('recentClaims', $claims);
|
||||
@@ -121,7 +118,9 @@ class MainController extends AppController {
|
||||
$this->loadModel('Transactions');
|
||||
|
||||
$canConvert = false;
|
||||
$priceInfo = json_decode($this->redis->get(self::lbcPriceKey));
|
||||
if(isset($this->redis)) {
|
||||
$priceInfo = json_decode($this->redis->get(self::lbcPriceKey));
|
||||
}
|
||||
if (isset($priceInfo->price)) {
|
||||
$canConvert = true;
|
||||
}
|
||||
@@ -130,10 +129,10 @@ class MainController extends AppController {
|
||||
// paginate claims
|
||||
$offset = 0;
|
||||
$pageLimit = 96;
|
||||
$page = intval($this->request->getQuery('page'));
|
||||
$page = intval($this->request->query('page'));
|
||||
|
||||
$conn = ConnectionManager::get('default');
|
||||
$stmt = $conn->execute('SELECT COUNT(Id) AS Total FROM Claims');
|
||||
$stmt = $conn->execute('SELECT COUNT(id) AS Total FROM claim');
|
||||
$count = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
$numClaims = $count->Total;
|
||||
|
||||
@@ -146,12 +145,13 @@ class MainController extends AppController {
|
||||
}
|
||||
|
||||
$offset = ($page - 1) * $pageLimit;
|
||||
$claims = $this->Claims->find()->distinct(['Claims.ClaimId'])->contain(['Stream', 'Publisher' => ['fields' => ['Name']]])->order(['Claims.Created' => 'DESC'])->offset($offset)->limit($pageLimit)->toArray();
|
||||
for ($i = 0; $i < count($claims); $i++) {
|
||||
if ($canConvert && $claims[$i]->Fee > 0 && $claims[$i]->FeeCurrency == 'USD') {
|
||||
$claims[$i]->Price = $claims[$i]->Fee / $priceInfo->price;
|
||||
}
|
||||
$claims = $this->Claims->find()->select($this->Claims)->select(['publisher' => 'C.name'])->leftJoin(['C' => 'claim'], ['C.claim_id = Claims.publisher_id'])->order(['Claims.created_at' => 'DESC'])->offset($offset)->limit($pageLimit)->toArray();
|
||||
|
||||
for ($i = 0; $i < count($claims); $i++) {
|
||||
if ($canConvert && $claims[$i]->fee > 0 && $claims[$i]->fee_currency == 'USD') {
|
||||
$claims[$i]->price = $claims[$i]->fee / $priceInfo->price;
|
||||
}
|
||||
|
||||
if (isset($claims[$i]->Stream)) {
|
||||
$json = json_decode($claims[$i]->Stream->Stream);
|
||||
if (isset($json->metadata->license)) {
|
||||
@@ -169,13 +169,13 @@ class MainController extends AppController {
|
||||
$this->set('currentPage', $page);
|
||||
$this->set('claims', $claims);
|
||||
} else {
|
||||
$claim = $this->Claims->find()->contain(['Stream', 'Publisher' => ['fields' => ['ClaimId', 'Name']]])->where(['Claims.ClaimId' => $id])->order(['Claims.Created' => 'DESC'])->first();
|
||||
$claim = $this->Claims->find()->select($this->Claims)->select(['publisher' => 'C.name'])->leftJoin(['C' => 'claim'], ['C.claim_id = Claims.publisher_id'])->where(['Claims.claim_id' => $id])->order(['Claims.created_at' => 'DESC'])->first();
|
||||
if (!$claim) {
|
||||
return $this->redirect('/');
|
||||
}
|
||||
|
||||
if ($canConvert && $claim->Fee > 0 && $claim->FeeCurrency == 'USD') {
|
||||
$claim->Price = $claim->Fee / $priceInfo->price;
|
||||
if ($canConvert && $claim->fee > 0 && $claim->fee_currency == 'USD') {
|
||||
$claim->price = $claim->fee / $priceInfo->price;
|
||||
}
|
||||
|
||||
if (isset($claim->Stream)) {
|
||||
@@ -189,14 +189,12 @@ class MainController extends AppController {
|
||||
}
|
||||
|
||||
$moreClaims = [];
|
||||
if (isset($claim->Publisher) || $claim->ClaimType == 1) {
|
||||
if (isset($claim->publisher) || $claim->claim_type == 1) {
|
||||
// find more claims for the publisher
|
||||
$moreClaims = $this->Claims->find()->contain(['Stream', 'Publisher' => ['fields' => ['Name']]])->
|
||||
where(['Claims.ClaimType' => 2, 'Claims.Id <>' => $claim->Id, 'Claims.PublisherId' => isset($claim->Publisher) ? $claim->Publisher->ClaimId : $claim->ClaimId])->
|
||||
limit(9)->order(['Claims.Fee' => 'DESC', 'RAND()' => 'DESC'])->toArray();
|
||||
$moreClaims = $this->Claims->find()->select($this->Claims)->select(['publisher' => 'C.name'])->leftJoin(['C' => 'claim'], ['C.claim_id = Claims.publisher_id'])->where(['Claims.claim_type' => 1, 'Claims.id <>' => $claim->id, 'Claims.publisher_id' => isset($claim->publisher) ? $claim->publisher_id : $claim->claim_id])->limit(9)->order(['Claims.fee' => 'DESC', 'RAND()' => 'DESC'])->toArray();
|
||||
for ($i = 0; $i < count($moreClaims); $i++) {
|
||||
if ($canConvert && $moreClaims[$i]->Fee > 0 && $moreClaims[$i]->FeeCurrency == 'USD') {
|
||||
$moreClaims[$i]->Price = $moreClaims[$i]->Fee / $priceInfo->price;
|
||||
if ($canConvert && $moreClaims[$i]->fee > 0 && $moreClaims[$i]->fee_currency == 'USD') {
|
||||
$moreClaims[$i]->price = $moreClaims[$i]->fee / $priceInfo->price;
|
||||
}
|
||||
|
||||
if (isset($moreClaims[$i]->Stream)) {
|
||||
@@ -210,7 +208,6 @@ class MainController extends AppController {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->set('claim', $claim);
|
||||
$this->set('moreClaims', $moreClaims);
|
||||
}
|
||||
@@ -219,119 +216,23 @@ class MainController extends AppController {
|
||||
public function realtime() {
|
||||
$this->loadModel('Blocks');
|
||||
$this->loadModel('Transactions');
|
||||
$this->loadModel('Outputs');
|
||||
|
||||
// load 10 blocks and transactions
|
||||
$conn = ConnectionManager::get('default');
|
||||
$blocks = $this->Blocks->find()->select(['Height', 'BlockTime', 'TransactionHashes'])->order(['Height' => 'desc'])->limit(10)->toArray();
|
||||
$blocks = $this->Blocks->find()->select(['height', 'block_time', 'transaction_hashes'])->order(['height' => 'desc'])->limit(10)->toArray();
|
||||
for ($i = 0; $i < count($blocks); $i++) {
|
||||
$tx_hashes = json_decode($blocks[$i]->TransactionHashes);
|
||||
$blocks[$i]->TransactionCount = count($tx_hashes);
|
||||
$tx_hashes = preg_split('#,#', $blocks[$i]->transaction_hashes);
|
||||
$blocks[$i]->transaction_count = count($tx_hashes);
|
||||
}
|
||||
|
||||
$stmt = $conn->execute('SELECT T.Hash, T.InputCount, T.OutputCount, T.Value, IFNULL(T.TransactionTime, T.CreatedTime) AS TxTime ' .
|
||||
'FROM Transactions T ORDER BY CreatedTime DESC LIMIT 10');
|
||||
$txs = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||
|
||||
$transactions = $this->Transactions->find()->select(['Transactions.id', 'Transactions.hash', 'Transactions.value', 'Transactions.input_count', 'Transactions.output_count', 'Transactions.transaction_time', 'Transactions.created_at'])->order(['Transactions.created_at' => 'desc'])->limit(10)->toArray();
|
||||
|
||||
$this->set('blocks', $blocks);
|
||||
$this->set('txs', $txs);
|
||||
}
|
||||
|
||||
public function apiblocksize($timePeriod = '24h') {
|
||||
$this->autoRender = false;
|
||||
|
||||
if (!$this->request->is('get')) {
|
||||
return $this->_jsonError('Invalid HTTP request method.', 400);
|
||||
}
|
||||
|
||||
$validPeriods = ['24h', '72h', '168h', '30d', '90d', '1y'];
|
||||
if (!in_array($timePeriod, $validPeriods)) {
|
||||
return $this->_jsonError('Invalid time period specified.', 400);
|
||||
}
|
||||
|
||||
$isHourly = (strpos($timePeriod, 'h') !== false);
|
||||
$now = new \DateTime('now', new \DateTimeZone('UTC'));
|
||||
$dateFormat = $isHourly ? 'Y-m-d H:00:00' : 'Y-m-d';
|
||||
$sqlDateFormat = $isHourly ? '%Y-%m-%d %H:00:00' : '%Y-%m-%d';
|
||||
$intervalPrefix = $isHourly ? 'PT' : 'P';
|
||||
$start = $now->sub(new \DateInterval($intervalPrefix . strtoupper($timePeriod)));
|
||||
|
||||
$resultSet = [];
|
||||
|
||||
$conn = ConnectionManager::get('default');
|
||||
|
||||
// get avg block sizes for the time period
|
||||
$stmt = $conn->execute("SELECT AVG(BlockSize) AS AvgBlockSize, DATE_FORMAT(FROM_UNIXTIME(BlockTime), '$sqlDateFormat') AS TimePeriod " .
|
||||
"FROM Blocks WHERE DATE_FORMAT(FROM_UNIXTIME(BlockTime), '$sqlDateFormat') >= ? GROUP BY TimePeriod ORDER BY TimePeriod ASC", [$start->format($dateFormat)]);
|
||||
$avgBlockSizes = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||
foreach ($avgBlockSizes as $size) {
|
||||
if (!isset($resultSet[$size->TimePeriod])) {
|
||||
$resultSet[$size->TimePeriod] = [];
|
||||
}
|
||||
$resultSet[$size->TimePeriod]['AvgBlockSize'] = (float) $size->AvgBlockSize;
|
||||
}
|
||||
|
||||
// get avg prices
|
||||
$stmt = $conn->execute("SELECT AVG(USD) AS AvgUSD, DATE_FORMAT(Created, '$sqlDateFormat') AS TimePeriod " .
|
||||
"FROM PriceHistory WHERE DATE_FORMAT(Created, '$sqlDateFormat') >= ? GROUP BY TimePeriod ORDER BY TimePeriod ASC", [$start->format($dateFormat)]);
|
||||
$avgPrices = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||
foreach ($avgPrices as $price) {
|
||||
if (!isset($resultSet[$price->TimePeriod])) {
|
||||
$resultSet[$price->TimePeriod] = [];
|
||||
}
|
||||
$resultSet[$price->TimePeriod]['AvgUSD'] = (float) $price->AvgUSD;
|
||||
}
|
||||
|
||||
return $this->_jsonResponse(['success' => true, 'data' => $resultSet]);
|
||||
}
|
||||
|
||||
public function apirealtimeblocks() {
|
||||
// load 10 blocks
|
||||
$this->autoRender = false;
|
||||
$this->loadModel('Blocks');
|
||||
$blocks = $this->Blocks->find()->select(['Height', 'BlockTime', 'TransactionHashes'])->order(['Height' => 'desc'])->limit(10)->toArray();
|
||||
for ($i = 0; $i < count($blocks); $i++) {
|
||||
$tx_hashes = json_decode($blocks[$i]->TransactionHashes);
|
||||
$blocks[$i]->TransactionCount = count($tx_hashes);
|
||||
unset($blocks[$i]->TransactionHashes);
|
||||
}
|
||||
|
||||
$this->_jsonResponse(['success' => true, 'blocks' => $blocks]);
|
||||
}
|
||||
|
||||
public function apirealtimetx() {
|
||||
// load 10 transactions
|
||||
$this->autoRender = false;
|
||||
$conn = ConnectionManager::get('default');
|
||||
$stmt = $conn->execute('SELECT T.Hash, T.InputCount, T.OutputCount, T.Value, IFNULL(T.TransactionTime, T.CreatedTime) AS TxTime ' .
|
||||
'FROM Transactions T ORDER BY CreatedTime DESC LIMIT 10');
|
||||
$txs = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||
|
||||
$this->_jsonResponse(['success' => true, 'txs' => $txs]);
|
||||
}
|
||||
|
||||
protected function _formatHashRate($value) {
|
||||
if ($value === 'N/A') {
|
||||
return $value;
|
||||
}
|
||||
|
||||
/*if ($value > 1000000000000) {
|
||||
return number_format( $value / 1000000000000, 2, '.', '' ) . ' TH';
|
||||
}*/
|
||||
if ($value > 1000000000) {
|
||||
return number_format( $value / 1000000000, 2, '.', '' ) . ' GH/s';
|
||||
}
|
||||
if ($value > 1000000) {
|
||||
return number_format( $value / 1000000, 2, '.', '' ) . ' MH/s';
|
||||
}
|
||||
if ($value > 1000) {
|
||||
return number_format( $value / 1000, 2, '.', '' ) . ' KH/s';
|
||||
}
|
||||
|
||||
return number_format($value) . ' H/s';
|
||||
$this->set('txs', $transactions);
|
||||
}
|
||||
|
||||
public function find() {
|
||||
$criteria = $this->request->getQuery('q');
|
||||
$criteria = $this->request->query('q');
|
||||
|
||||
$this->loadModel('Blocks');
|
||||
$this->loadModel('Claims');
|
||||
@@ -340,56 +241,58 @@ class MainController extends AppController {
|
||||
|
||||
if (is_numeric($criteria)) {
|
||||
$height = (int) $criteria;
|
||||
$block = $this->Blocks->find()->select(['Id'])->where(['Height' => $height])->first();
|
||||
$block = $this->Blocks->find()->select(['id'])->where(['height' => $height])->first();
|
||||
if ($block) {
|
||||
return $this->redirect('/blocks/' . $height);
|
||||
}
|
||||
} else if (strlen(trim($criteria)) === 34) {
|
||||
// Address
|
||||
$address = $this->Addresses->find()->select(['Id', 'Address'])->where(['Address' => $criteria])->first();
|
||||
$address = $this->Addresses->find()->select(['id', 'address'])->where(['address' => $criteria])->first();
|
||||
if ($address) {
|
||||
return $this->redirect('/address/' . $address->Address);
|
||||
return $this->redirect('/address/' . $address->address);
|
||||
}
|
||||
} else if (strlen(trim($criteria)) === 40) {
|
||||
// Claim ID
|
||||
$claim = $this->Claims->find()->select(['ClaimId'])->where(['ClaimId' => $criteria])->first();
|
||||
$claim = $this->Claims->find()->select(['claim_id'])->where(['claim_id' => $criteria])->first();
|
||||
if ($claim) {
|
||||
return $this->redirect('/claims/' . $claim->ClaimId);
|
||||
return $this->redirect('/claims/' . $claim->claim_id);
|
||||
}
|
||||
} else if (strlen(trim($criteria)) === 64) { // block or tx hash
|
||||
// Try block hash first
|
||||
$block = $this->Blocks->find()->select(['Height'])->where(['Hash' => $criteria])->first();
|
||||
$block = $this->Blocks->find()->select(['height'])->where(['hash' => $criteria])->first();
|
||||
if ($block) {
|
||||
return $this->redirect('/blocks/' . $block->Height);
|
||||
return $this->redirect('/blocks/' . $block->height);
|
||||
} else {
|
||||
$tx = $this->Transactions->find()->select(['Hash'])->where(['Hash' => $criteria])->first();
|
||||
$tx = $this->Transactions->find()->select(['hash'])->where(['hash' => $criteria])->first();
|
||||
if ($tx) {
|
||||
return $this->redirect('/tx/' . $tx->Hash);
|
||||
return $this->redirect('/tx/' . $tx->hash);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// finally, try exact claim name match
|
||||
$claims = $this->Claims->find()->distinct(['Claims.ClaimId'])->where(['Name' => $criteria])->order(['Claims.Created' => 'DESC'])->limit(10)->toArray();
|
||||
$claims = $this->Claims->find()->distinct(['claim_id'])->where(['name' => $criteria])->order(["FIELD(bid_state, 'Controlling') DESC"])->limit(10)->toArray();
|
||||
if (count($claims) == 1) {
|
||||
return $this->redirect('/claims/' . $claims[0]->ClaimId);
|
||||
return $this->redirect('/claims/' . $claims[0]->claim_id);
|
||||
}
|
||||
else {
|
||||
$this->set('claims', $claims);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function blocks($height = null) {
|
||||
$this->loadModel('Blocks');
|
||||
$this->loadModel('Outputs');
|
||||
$this->loadModel('Transactions');
|
||||
|
||||
if ($height === null) {
|
||||
// paginate blocks
|
||||
$offset = 0;
|
||||
$pageLimit = 50;
|
||||
$page = intval($this->request->getQuery('page'));
|
||||
$page = intval($this->request->query('page'));
|
||||
|
||||
$conn = ConnectionManager::get('default');
|
||||
$stmt = $conn->execute('SELECT COUNT(Id) AS Total FROM Blocks');
|
||||
$stmt = $conn->execute('SELECT COUNT(id) AS Total FROM block');
|
||||
$count = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
$numBlocks = $count->Total;
|
||||
|
||||
@@ -402,10 +305,10 @@ class MainController extends AppController {
|
||||
}
|
||||
|
||||
$offset = ($page - 1) * $pageLimit;
|
||||
$currentBlock = $this->Blocks->find()->select(['Height'])->order(['Height' => 'DESC'])->first();
|
||||
$currentBlock = $this->Blocks->find()->select(['height'])->order(['height' => 'DESC'])->first();
|
||||
$blocks = $this->Blocks->find()->select(
|
||||
['Height', 'Difficulty', 'TransactionHashes', 'BlockSize', 'Nonce', 'BlockTime']
|
||||
)->offset($offset)->limit($pageLimit)->order(['Height' => 'DESC'])->toArray();
|
||||
['height', 'difficulty', 'transaction_hashes', 'block_size', 'nonce', 'block_time']
|
||||
)->offset($offset)->limit($pageLimit)->order(['height' => 'DESC'])->toArray();
|
||||
$this->set('currentBlock', $currentBlock);
|
||||
$this->set('blocks', $blocks);
|
||||
$this->set('pageLimit', $pageLimit);
|
||||
@@ -413,37 +316,23 @@ class MainController extends AppController {
|
||||
$this->set('numRecords', $numBlocks);
|
||||
$this->set('currentPage', $page);
|
||||
} else {
|
||||
$this->loadModel('Transactions');
|
||||
$height = intval($height);
|
||||
if ($height < 0) {
|
||||
return $this->redirect('/');
|
||||
}
|
||||
|
||||
$block = $this->Blocks->find()->where(['Height' => $height])->first();
|
||||
$block = $this->Blocks->find()->where(['height' => $height])->first();
|
||||
if (!$block) {
|
||||
return $this->redirect('/');
|
||||
}
|
||||
|
||||
try {
|
||||
// update the block confirmations
|
||||
$req = ['method' => 'getblock', 'params' => [$block->Hash]];
|
||||
$response = self::curl_json_post(self::$rpcurl, json_encode($req));
|
||||
$json = json_decode($response);
|
||||
$rpc_block = $json->result;
|
||||
if (isset($rpc_block->confirmations)) {
|
||||
$block->Confirmations = $rpc_block->confirmations;
|
||||
$conn = ConnectionManager::get('default');
|
||||
$conn->execute('UPDATE Blocks SET Confirmations = ? WHERE Id = ?', [$rpc_block->confirmations, $block->Id]);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
// try again next time
|
||||
}
|
||||
|
||||
// Get the basic block transaction info
|
||||
$txs = $this->Transactions->find()->select(['InputCount', 'OutputCount', 'Hash', 'Value', 'Version'])->where(['BlockHash' => $block->Hash])->toArray();
|
||||
|
||||
$txs = $this->Transactions->find()->select(['Transactions.id', 'Transactions.value', 'Transactions.input_count', 'Transactions.output_count', 'Transactions.hash', 'Transactions.version'])->where(['Transactions.block_hash_id' => $block->hash])->toArray();
|
||||
$last_block = $this->Blocks->find()->select(['height'])->order(['height' => 'desc'])->first();
|
||||
$confirmations = $last_block->height - $block->height + 1;
|
||||
$this->set('block', $block);
|
||||
$this->set('blockTxs', $txs);
|
||||
$this->set('confirmations', $confirmations);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,43 +341,55 @@ class MainController extends AppController {
|
||||
$this->loadModel('Transactions');
|
||||
$this->loadModel('Inputs');
|
||||
$this->loadModel('Outputs');
|
||||
$this->loadModel('Addresses');
|
||||
$this->loadModel('Claims');
|
||||
|
||||
$sourceAddress = $this->request->getQuery('address');
|
||||
|
||||
$tx = $this->Transactions->find()->select(
|
||||
['Id', 'BlockHash', 'InputCount', 'OutputCount', 'Hash', 'Value', 'TransactionTime', 'TransactionSize', 'Created', 'Version', 'LockTime', 'Raw'])->where(['Hash' => $hash])->first();
|
||||
$sourceAddress = $this->request->query('address');
|
||||
|
||||
$tx = $this->Transactions->find()->where(['Transactions.hash' => $hash])->first();
|
||||
if (!$tx) {
|
||||
return $this->redirect('/');
|
||||
}
|
||||
|
||||
if ($tx->TransactionSize == 0) {
|
||||
$tx->TransactionSize = (strlen($tx->Raw) / 2);
|
||||
$conn = ConnectionManager::get('default');
|
||||
$conn->execute('UPDATE Transactions SET TransactionSize = ? WHERE Id = ?', [$tx->TransactionSize, $tx->Id]);
|
||||
$block = $this->Blocks->find()->select(['confirmations', 'height'])->where(['hash' => $tx->block_hash_id])->first();
|
||||
$confirmations = 0;
|
||||
if($tx->block_hash_id == 'MEMPOOL') {
|
||||
$confirmations = 0;
|
||||
}
|
||||
|
||||
$maxBlock = $this->Blocks->find()->select(['Height'])->order(['Height' => 'desc'])->first();
|
||||
$block = $this->Blocks->find()->select(['Confirmations', 'Height'])->where(['Hash' => $tx->BlockHash])->first();
|
||||
$confirmations = $block ? (($maxBlock->Height - $block->Height) + 1) : '0';
|
||||
$inputs = $this->Inputs->find()->contain(['InputAddresses'])->where(['TransactionId' => $tx->Id])->order(['PrevoutN' => 'asc'])->toArray();
|
||||
$outputs = $this->Outputs->find()->contain(['OutputAddresses', 'SpendInput' => ['fields' => ['Id', 'TransactionHash', 'PrevoutN', 'PrevoutHash']]])->where(['Outputs.TransactionId' => $tx->Id])->order(['Vout' => 'asc'])->toArray();
|
||||
for ($i = 0; $i < count($outputs); $i++) {
|
||||
$outputs[$i]->IsClaim = (strpos($outputs[$i]->ScriptPubKeyAsm, 'CLAIM') > -1);
|
||||
$outputs[$i]->IsSupportClaim = (strpos($outputs[$i]->ScriptPubKeyAsm, 'SUPPORT_CLAIM') > -1);
|
||||
$outputs[$i]->IsUpdateClaim = (strpos($outputs[$i]->ScriptPubKeyAsm, 'UPDATE_CLAIM') > -1);
|
||||
$claim = $this->Claims->find()->where(['TransactionHash' => $tx->Hash, 'Vout' => $outputs[$i]->Vout])->first();
|
||||
else {
|
||||
$last_block = $this->Blocks->find()->select(['height'])->order(['height' => 'desc'])->first();
|
||||
$confirmations = $last_block->height - $block->height + 1;
|
||||
}
|
||||
$inputs = $this->Inputs->find()->where(['transaction_id' => $tx->id])->order(['prevout_n' => 'asc'])->toArray();
|
||||
foreach($inputs as $input) {
|
||||
$inputAddresses = $this->Addresses->find()->select(['id', 'address'])->where(['id' => $input->input_address_id])->toArray();
|
||||
$input->input_addresses = $inputAddresses;
|
||||
}
|
||||
|
||||
$outputs = $this->Outputs->find()->select($this->Outputs)->select(['spend_input_hash' => 'I.transaction_hash', 'spend_input_id' => 'I.id'])->where(['Outputs.transaction_id' => $tx->id])->leftJoin(['I' => 'input'], ['I.id = Outputs.spent_by_input_id'])->order(['Outputs.vout' => 'asc'])->toArray();
|
||||
for ($i = 0; $i < count($outputs); $i++) {
|
||||
$outputs[$i]->IsClaim = (strpos($outputs[$i]->script_pub_key_asm, 'CLAIM') > -1);
|
||||
$outputs[$i]->IsSupportClaim = (strpos($outputs[$i]->script_pub_key_asm, 'SUPPORT_CLAIM') > -1);
|
||||
$outputs[$i]->IsUpdateClaim = (strpos($outputs[$i]->script_pub_key_asm, 'UPDATE_CLAIM') > -1);
|
||||
$claim = $this->Claims->find()->select(['id', 'claim_id', 'claim_address', 'vout', 'transaction_hash_id'])->where(['transaction_hash_id' => $tx->hash, 'vout' => $outputs[$i]->vout])->first();
|
||||
$outputs[$i]->Claim = $claim;
|
||||
|
||||
$output_address = trim($outputs[$i]->address_list, '[""]');
|
||||
if(!$output_address && $claim) {
|
||||
$output_address = $claim->claim_address;
|
||||
}
|
||||
$address = $this->Addresses->find()->select(['address'])->where(['address' => $output_address])->first();
|
||||
$outputs[$i]->output_addresses = [$address];
|
||||
}
|
||||
|
||||
$totalIn = 0;
|
||||
$totalOut = 0;
|
||||
$fee = 0;
|
||||
foreach ($inputs as $in) {
|
||||
$totalIn = bcadd($totalIn, $in->Value, 8);
|
||||
$totalIn = bcadd($totalIn, $in->value, 8);
|
||||
}
|
||||
foreach ($outputs as $out) {
|
||||
$totalOut = bcadd($totalOut, $out->Value, 8);
|
||||
$totalOut = bcadd($totalOut, $out->value, 8);
|
||||
}
|
||||
$fee = bcsub($totalIn, $totalOut, 8);
|
||||
|
||||
@@ -505,29 +406,30 @@ class MainController extends AppController {
|
||||
$this->loadModel('Addresses');
|
||||
|
||||
// exclude bHW58d37s1hBjj3wPBkn5zpCX3F8ZW3uWf (genesis block)
|
||||
$richList = $this->Addresses->find()->where(['Address <>' => 'bHW58d37s1hBjj3wPBkn5zpCX3F8ZW3uWf'])->order(['Balance' => 'DESC'])->limit(500)->toArray();
|
||||
$richList = $this->Addresses->find()->where(['address <>' => 'bHW58d37s1hBjj3wPBkn5zpCX3F8ZW3uWf'])->order(['balance' => 'DESC'])->limit(500)->toArray();
|
||||
|
||||
$priceRate = 0;
|
||||
//$priceInfo = json_decode($this->redis->get(self::lbcPriceKey));
|
||||
$priceInfo->price = 0.05;
|
||||
if (isset($priceInfo->price)) {
|
||||
$priceRate = $priceInfo->price;
|
||||
if(isset($this->redis)) {
|
||||
$priceInfo = json_decode($this->redis->get(self::lbcPriceKey));
|
||||
if (isset($priceInfo->price)) {
|
||||
$priceRate = $priceInfo->price;
|
||||
}
|
||||
}
|
||||
|
||||
$lbryAddresses = ['rFLUohPG4tP3gZHYoyhvADCtrDMiaYb7Qd', 'r9PGXsejVJb9ZfMf3QVdDEJCzxkd9JLxzL', 'r9srwX7DEN7Mex3a8oR1mKSqQmLBizoJvi', 'bRo4FEeqqxY7nWFANsZsuKEWByEgkvz8Qt', 'bU2XUzckfpdEuQNemKvhPT1gexQ3GG3SC2', 'bay3VA6YTQBL4WLobbG7CthmoGeUKXuXkD', 'bLPbiXBp6Vr3NSnsHzDsLNzoy5o36re9Cz', 'bMvUBo1h5WS46ThHtmfmXftz3z33VHL7wc', 'bVUrbCK8hcZ5XWti7b9eNxKEBxzc1rr393', 'bZja2VyhAC84a9hMwT8dwTU6rDRXowrjxH', 'bMvUBo1h5WS46ThHtmfmXftz3z33VHL7wc', 'bMgqQqYfwzWWYBk5o5dBMXtCndVAoeqy6h', 'bMvUBo1h5WS46ThHtmfmXftz3z33VHL7wc'];
|
||||
|
||||
$lbryAddresses = ['rFLUohPG4tP3gZHYoyhvADCtrDMiaYb7Qd', 'r9PGXsejVJb9ZfMf3QVdDEJCzxkd9JLxzL', 'r9srwX7DEN7Mex3a8oR1mKSqQmLBizoJvi', 'bRo4FEeqqxY7nWFANsZsuKEWByEgkvz8Qt', 'bU2XUzckfpdEuQNemKvhPT1gexQ3GG3SC2', 'bay3VA6YTQBL4WLobbG7CthmoGeUKXuXkD', 'bLPbiXBp6Vr3NSnsHzDsLNzoy5o36re9Cz', 'bVUrbCK8hcZ5XWti7b9eNxKEBxzc1rr393', 'bZja2VyhAC84a9hMwT8dwTU6rDRXowrjxH', 'bMgqQqYfwzWWYBk5o5dBMXtCndVAoeqy6h', 'bMvUBo1h5WS46ThHtmfmXftz3z33VHL7wc'];
|
||||
$totalBalance = 0;
|
||||
$maxBalance = 0;
|
||||
$minBalance = 0;
|
||||
foreach ($richList as $item) {
|
||||
$totalBalance = bcadd($totalBalance, $item->Balance, 8);
|
||||
$minBalance = $minBalance == 0 ? $item->Balance : min($minBalance, $item->Balance);
|
||||
$maxBalance = max($maxBalance, $item->Balance);
|
||||
$totalBalance = bcadd($totalBalance, $item->balance, 8);
|
||||
$minBalance = $minBalance == 0 ? $item->balance : min($minBalance, $item->balance);
|
||||
$maxBalance = max($maxBalance, $item->balance);
|
||||
}
|
||||
for ($i = 0; $i < count($richList); $i++) {
|
||||
$item = $richList[$i];
|
||||
$percentage = bcdiv($item->Balance, $totalBalance, 8) * 100;
|
||||
$percentage = bcdiv($item->balance, $totalBalance, 8) * 100;
|
||||
$richList[$i]->Top500Percent = $percentage;
|
||||
$richList[$i]->MinMaxPercent = bcdiv($item->Balance, $maxBalance, 8) * 100;
|
||||
$richList[$i]->MinMaxPercent = bcdiv($item->balance, $maxBalance, 8) * 100;
|
||||
}
|
||||
|
||||
$this->set('richList', $richList);
|
||||
@@ -543,6 +445,7 @@ class MainController extends AppController {
|
||||
$this->loadModel('Transactions');
|
||||
$this->loadModel('Inputs');
|
||||
$this->loadModel('Outputs');
|
||||
$this->loadModel('TransactionAddresses');
|
||||
|
||||
if (!$addr) {
|
||||
return $this->redirect('/');
|
||||
@@ -551,7 +454,7 @@ class MainController extends AppController {
|
||||
$offset = 0;
|
||||
$pageLimit = 50;
|
||||
$numTransactions = 0;
|
||||
$page = intval($this->request->getQuery('page'));
|
||||
$page = intval($this->request->query('page'));
|
||||
|
||||
$canTag = false;
|
||||
$totalRecvAmount = 0;
|
||||
@@ -560,18 +463,11 @@ class MainController extends AppController {
|
||||
$recentTxs = [];
|
||||
|
||||
$tagRequestAmount = 0;
|
||||
// Check for pending tag request
|
||||
$this->loadModel('TagAddressRequests');
|
||||
$pending = $this->TagAddressRequests->find()->where(['Address' => $addr, 'IsVerified <>' => 1])->first();
|
||||
if (!$pending) {
|
||||
$tagRequestAmount = '25.' . rand(11111111, 99999999);
|
||||
}
|
||||
|
||||
$address = $this->Addresses->find()->where(['Address' => $addr])->first();
|
||||
$address = $this->Addresses->find()->where(['address' => $addr])->first();
|
||||
if (!$address) {
|
||||
if (strlen($addr) === 34) {
|
||||
$address = new \stdClass();
|
||||
$address->Address = $addr;
|
||||
$address->address = $addr;
|
||||
} else {
|
||||
return $this->redirect('/');
|
||||
}
|
||||
@@ -579,12 +475,10 @@ class MainController extends AppController {
|
||||
$conn = ConnectionManager::get('default');
|
||||
|
||||
$canTag = true;
|
||||
$addressId = $address->Id;
|
||||
|
||||
$stmt = $conn->execute('SELECT COUNT(TransactionId) AS Total FROM TransactionsAddresses WHERE AddressId = ?', [$addressId]);
|
||||
$count = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
$numTransactions = $count->Total;
|
||||
$all = $this->request->getQuery('all');
|
||||
$transactionAddresses = $this->TransactionAddresses->find()->where(['address_id' => $address->id])->toArray();
|
||||
$numTransactions = count($transactionAddresses);
|
||||
|
||||
$all = $this->request->query('all');
|
||||
if ($all === 'true') {
|
||||
$offset = 0;
|
||||
$pageLimit = $numTransactions;
|
||||
@@ -601,33 +495,28 @@ class MainController extends AppController {
|
||||
|
||||
$offset = ($page - 1) * $pageLimit;
|
||||
}
|
||||
|
||||
$stmt = $conn->execute('SELECT A.TotalReceived, A.TotalSent, A.Balance FROM Addresses A WHERE A.Id = ?', [$address->Id]);
|
||||
$totals = $stmt->fetch(\PDO::FETCH_OBJ);
|
||||
|
||||
$currentBlock = $this->Blocks->find()->select(['Height'])->order(['Height' => 'desc'])->first();
|
||||
$currentHeight = $currentBlock ? intval($currentBlock->Height) : 0;
|
||||
|
||||
|
||||
$stmt = $conn->execute(sprintf(
|
||||
'SELECT T.Id, T.Hash, T.InputCount, T.OutputCount, T.Value, ' .
|
||||
' TA.DebitAmount, TA.CreditAmount, ' .
|
||||
' B.Height, (CASE WHEN B.Height IS NOT NULL THEN ((' . $currentHeight . ' - B.Height) + 1) ELSE NULL END) AS Confirmations, ' .
|
||||
' IFNULL(T.TransactionTime, T.CreatedTime) AS TxTime ' .
|
||||
'FROM Transactions T ' .
|
||||
'LEFT JOIN Blocks B ON T.BlockHash = B.Hash ' .
|
||||
'RIGHT JOIN (SELECT TransactionId, DebitAmount, CreditAmount FROM TransactionsAddresses ' .
|
||||
' WHERE AddressId = ? ORDER BY TransactionTime DESC LIMIT %d, %d) TA ON TA.TransactionId = T.Id', $offset, $pageLimit), [$addressId]);
|
||||
'SELECT T.id, T.hash, T.input_count, T.output_count, T.block_hash_id, ' .
|
||||
' TA.debit_amount, TA.credit_amount, ' .
|
||||
' B.height, B.confirmations, ' .
|
||||
' IFNULL(T.transaction_time, T.created_at) AS transaction_time ' .
|
||||
'FROM transaction T ' .
|
||||
'LEFT JOIN block B ON T.block_hash_id = B.hash ' .
|
||||
'RIGHT JOIN (SELECT transaction_id, debit_amount, credit_amount FROM transaction_address ' .
|
||||
' WHERE address_id = ?) TA ON TA.transaction_id = T.id ' .
|
||||
'ORDER BY transaction_time DESC LIMIT %d, %d', $offset, $pageLimit), [$address->id]);
|
||||
$recentTxs = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||
|
||||
$totalRecvAmount = $totals->TotalReceived == 0 ? '0' : $totals->TotalReceived + 0;
|
||||
$totalSentAmount = $totals->TotalSent == 0 ? '0' : $totals->TotalSent + 0;
|
||||
$balanceAmount = $totals->Balance == 0 ? '0' : $totals->Balance + 0;
|
||||
foreach($transactionAddresses as $ta) {
|
||||
$totalRecvAmount += $ta->credit_amount + 0;
|
||||
$totalSentAmount += $ta->debit_amount + 0;
|
||||
}
|
||||
$balanceAmount = $totalRecvAmount - $totalSentAmount;
|
||||
}
|
||||
|
||||
$this->set('offset', $offset);
|
||||
$this->set('canTag', $canTag);
|
||||
$this->set('pending', $pending);
|
||||
$this->set('tagRequestAmount', $tagRequestAmount);
|
||||
$this->set('address', $address);
|
||||
$this->set('totalReceived', $totalRecvAmount);
|
||||
$this->set('totalSent', $totalSentAmount);
|
||||
@@ -650,56 +539,93 @@ class MainController extends AppController {
|
||||
$qrCode->setSize(300);
|
||||
|
||||
// Set advanced options
|
||||
$qrCode
|
||||
->setWriterByName('png')
|
||||
->setMargin(10)
|
||||
->setEncoding('UTF-8')
|
||||
->setErrorCorrectionLevel(ErrorCorrectionLevel::LOW)
|
||||
->setForegroundColor(['r' => 0, 'g' => 0, 'b' => 0])
|
||||
->setBackgroundColor(['r' => 255, 'g' => 255, 'b' => 255])
|
||||
->setLogoWidth(150)
|
||||
->setValidateResult(false);
|
||||
$qrCode->setWriterByName('png');
|
||||
$qrCode->setMargin(10);
|
||||
$qrCode->setEncoding('UTF-8');
|
||||
$qrCode->setErrorCorrectionLevel(new ErrorCorrectionLevel(ErrorCorrectionLevel::HIGH));
|
||||
$qrCode->setForegroundColor(['r' => 0, 'g' => 0, 'b' => 0, 'a' => 0]);
|
||||
$qrCode->setBackgroundColor(['r' => 255, 'g' => 255, 'b' => 255, 'a' => 0]);
|
||||
$qrCode->setLogoWidth(150);
|
||||
$qrCode->setValidateResult(false);
|
||||
|
||||
header('Content-Type: '.$qrCode->getContentType());
|
||||
echo $qrCode->writeString();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
public function apiblocksize($timePeriod = '24h') {
|
||||
$this->autoRender = false;
|
||||
|
||||
public static function curl_get($url) {
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
Log::debug('Request execution completed.');
|
||||
|
||||
if ($response === false) {
|
||||
$error = curl_error($ch);
|
||||
$errno = curl_errno($ch);
|
||||
curl_close($ch);
|
||||
|
||||
throw new \Exception(sprintf('The request failed: %s', $error), $errno);
|
||||
} else {
|
||||
curl_close($ch);
|
||||
if (!$this->request->is('get')) {
|
||||
return $this->_jsonError('Invalid HTTP request method.', 400);
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
$validPeriods = ['24h', '72h', '168h', '30d', '90d', '1y'];
|
||||
if (!in_array($timePeriod, $validPeriods)) {
|
||||
return $this->_jsonError('Invalid time period specified.', 400);
|
||||
}
|
||||
|
||||
private function _gethashrate() {
|
||||
$req = ['method' => 'getnetworkhashps', 'params' => []];
|
||||
try {
|
||||
$res = json_decode(self::curl_json_post(self::$rpcurl, json_encode($req)));
|
||||
if (!isset($res->result)) {
|
||||
return 0;
|
||||
$isHourly = (strpos($timePeriod, 'h') !== false);
|
||||
$now = new \DateTime('now', new \DateTimeZone('UTC'));
|
||||
$dateFormat = $isHourly ? 'Y-m-d H:00:00' : 'Y-m-d';
|
||||
$sqlDateFormat = $isHourly ? '%Y-%m-%d %H:00:00' : '%Y-%m-%d';
|
||||
$intervalPrefix = $isHourly ? 'PT' : 'P';
|
||||
$start = $now->sub(new \DateInterval($intervalPrefix . strtoupper($timePeriod)));
|
||||
|
||||
$resultSet = [];
|
||||
|
||||
// get avg prices
|
||||
/*
|
||||
$conn_local = ConnectionManager::get('localdb');
|
||||
$stmt_price = $conn_local->execute("SELECT AVG(USD) AS AvgUSD, DATE_FORMAT(Created, '$sqlDateFormat') AS TimePeriod " .
|
||||
"FROM PriceHistory WHERE DATE_FORMAT(Created, '$sqlDateFormat') >= ? GROUP BY TimePeriod ORDER BY TimePeriod ASC", [$start->format($dateFormat)]);
|
||||
$avgPrices = $stmt_price->fetchAll(\PDO::FETCH_OBJ);
|
||||
foreach ($avgPrices as $price) {
|
||||
if (!isset($resultSet[$price->TimePeriod])) {
|
||||
$resultSet[$price->TimePeriod] = [];
|
||||
}
|
||||
return $res->result;
|
||||
} catch (\Exception $e) {
|
||||
return 'N/A';
|
||||
$resultSet[$price->TimePeriod]['AvgUSD'] = (float) $price->AvgUSD;
|
||||
}
|
||||
*/
|
||||
|
||||
$conn = ConnectionManager::get('default');
|
||||
// get avg block sizes for the time period
|
||||
$stmt = $conn->execute("SELECT AVG(block_size) AS AvgBlockSize, DATE_FORMAT(FROM_UNIXTIME(block_time), '$sqlDateFormat') AS TimePeriod " .
|
||||
"FROM block WHERE DATE_FORMAT(FROM_UNIXTIME(block_time), '$sqlDateFormat') >= ? GROUP BY TimePeriod ORDER BY TimePeriod ASC", [$start->format($dateFormat)]);
|
||||
$avgBlockSizes = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||
foreach ($avgBlockSizes as $size) {
|
||||
if (!isset($resultSet[$size->TimePeriod])) {
|
||||
$resultSet[$size->TimePeriod] = [];
|
||||
}
|
||||
$resultSet[$size->TimePeriod]['AvgBlockSize'] = (float) $size->AvgBlockSize;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->_jsonResponse(['success' => true, 'data' => $resultSet]);
|
||||
}
|
||||
|
||||
public function apirealtimeblocks() {
|
||||
// Load 10 blocks
|
||||
$this->autoRender = false;
|
||||
$this->loadModel('Blocks');
|
||||
$blocks = $this->Blocks->find()->select(['Height' => 'height', 'BlockTime' => 'block_time', 'transaction_hashes'])->order(['Height' => 'desc'])->limit(10)->toArray();
|
||||
for ($i = 0; $i < count($blocks); $i++) {
|
||||
$tx_hashes = preg_split('#,#', $blocks[$i]->transaction_hashes);
|
||||
$blocks[$i]->TransactionCount = count($tx_hashes);
|
||||
unset($blocks[$i]->transaction_hashes);
|
||||
}
|
||||
|
||||
$this->_jsonResponse(['success' => true, 'blocks' => $blocks]);
|
||||
}
|
||||
|
||||
public function apirealtimetx() {
|
||||
// Load 10 transactions
|
||||
$this->autoRender = false;
|
||||
$this->loadModel('Transactions');
|
||||
$txs = $this->Transactions->find()->select(['id', 'Value' => 'value', 'Hash' => 'hash', 'InputCount' => 'input_count', 'OutputCount' => 'output_count', 'TxTime' => 'transaction_time'])->order(['TxTime' => 'desc'])->limit(10);
|
||||
|
||||
$this->_jsonResponse(['success' => true, 'txs' => $txs]);
|
||||
}
|
||||
|
||||
protected function _gettxoutsetinfo() {
|
||||
$now = new \DateTime('now', new \DateTimeZone('UTC'));
|
||||
$txOutSetInfo = new \stdClass();
|
||||
@@ -716,7 +642,7 @@ class MainController extends AppController {
|
||||
$lastTOSIDt = new \DateTime($txOutSetInfo->time);
|
||||
$diff = $now->diff($lastTOSIDt);
|
||||
$diffMinutes = $diff->i;
|
||||
if ($diffMinutes >= 15 || $txOutSetInfo->set == 0) { // 15 minutes (or if the price is 0)
|
||||
if ($diffMinutes >= 15 || $txOutSetInfo->set == 'N/A') {
|
||||
$shouldRefreshSet = true;
|
||||
}
|
||||
}
|
||||
@@ -750,9 +676,9 @@ class MainController extends AppController {
|
||||
// Get the max height block
|
||||
$height = 0;
|
||||
$difficulty = 0;
|
||||
$highestBlock = $this->Blocks->find()->select(['Height', 'Difficulty'])->order(['Height' => 'desc'])->first();
|
||||
$height = $highestBlock->Height;
|
||||
$difficulty = $highestBlock->Difficulty;
|
||||
$highestBlock = $this->Blocks->find()->select(['height', 'difficulty'])->order(['height' => 'desc'])->first();
|
||||
$height = $highestBlock->height;
|
||||
$difficulty = $highestBlock->difficulty;
|
||||
$lbcUsdPrice = $this->_getLatestPrice();
|
||||
|
||||
// Calculate hash rate
|
||||
@@ -769,13 +695,12 @@ class MainController extends AppController {
|
||||
public function apirecentblocks() {
|
||||
$this->autoRender = false;
|
||||
$this->loadModel('Blocks');
|
||||
$blocks = $this->Blocks->find()->select(['Difficulty', 'Hash', 'Height', 'TransactionHashes', 'BlockTime', 'BlockSize'])->
|
||||
order(['Height' => 'desc'])->limit(6)->toArray();
|
||||
$blocks = $this->Blocks->find()->select(['Difficulty' => 'difficulty', 'Hash' => 'hash', 'Height' => 'height', 'transaction_hashes', 'BlockTime' => 'block_time', 'BlockSize' => 'block_size'])->order(['Height' => 'desc'])->limit(6)->toArray();
|
||||
for ($i = 0; $i < count($blocks); $i++) {
|
||||
$tx_hashes = json_decode($blocks[$i]->TransactionHashes);
|
||||
$tx_hashes = preg_split('#,#', $blocks[$i]->transaction_hashes);
|
||||
$blocks[$i]->TransactionCount = count($tx_hashes);
|
||||
$blocks[$i]->Difficulty = number_format($blocks[$i]->Difficulty, 2, '.', '');
|
||||
unset($blocks[$i]->TransactionHashes);
|
||||
unset($blocks[$i]->transaction_hashes);
|
||||
}
|
||||
return $this->_jsonResponse(['success' => true, 'blocks' => $blocks]);
|
||||
}
|
||||
@@ -824,13 +749,13 @@ class MainController extends AppController {
|
||||
}
|
||||
|
||||
// check if the tag is taken
|
||||
$addrTag = $this->Addresses->find()->select(['Id'])->where(['LOWER(Tag)' => strtolower($entity->Tag)])->first();
|
||||
$addrTag = $this->Addresses->find()->select(['id'])->where(['LOWER(Tag)' => strtolower($entity->Tag)])->first();
|
||||
if ($addrTag) {
|
||||
return $this->_jsonError('Oops! The tag is already taken. Please specify a different tag.', 400);
|
||||
}
|
||||
|
||||
// check for existing verification
|
||||
$exist = $this->TagAddressRequests->find()->select(['Id'])->where(['Address' => $base58address, 'IsVerified' => 0])->first();
|
||||
$exist = $this->TagAddressRequests->find()->select(['id'])->where(['Address' => $base58address, 'IsVerified' => 0])->first();
|
||||
if ($exist) {
|
||||
return $this->_jsonError('Oops! There is a pending tag verification for this address.', 400);
|
||||
}
|
||||
@@ -850,16 +775,13 @@ class MainController extends AppController {
|
||||
if (!isset($base58address)) {
|
||||
return $this->_jsonError('Base58 address not specified.', 400);
|
||||
}
|
||||
|
||||
// TODO: Add unconfirmed_balance to response
|
||||
$result = $this->Addresses->find()->select(['Balance'])->where(['Address' => $base58address])->first();
|
||||
if (!$result) {
|
||||
// Return 0 for address that does not exist?
|
||||
$result = new \stdClass();
|
||||
$result->Balance = 0;
|
||||
|
||||
$address = $this->Addresses->find()->select(['id', 'balance'])->where(['address' => $base58address])->first();
|
||||
if (!$address) {
|
||||
return $this->_jsonError('Could not find address.', 400);
|
||||
}
|
||||
|
||||
return $this->_jsonResponse(['success' => true, ['balance' => ['confirmed' => $result->Balance, 'unconfirmed' => 0]]]);
|
||||
|
||||
return $this->_jsonResponse(['success' => true, ['balance' => ['confirmed' => $address->balance, 'unconfirmed' => 0]]]);
|
||||
}
|
||||
|
||||
public function apiaddrutxo($base58address = null) {
|
||||
@@ -871,7 +793,7 @@ class MainController extends AppController {
|
||||
}
|
||||
|
||||
$arr = explode(',', $base58address);
|
||||
$addresses = $this->Addresses->find()->select(['Id'])->where(['Address IN' => $arr])->toArray();
|
||||
$addresses = $this->Addresses->find()->select(['id'])->where(['address IN' => $arr])->toArray();
|
||||
if (count($addresses) == 0) {
|
||||
return $this->_jsonError('No base58 address matching the specified parameter was found.', 404);
|
||||
}
|
||||
@@ -879,73 +801,127 @@ class MainController extends AppController {
|
||||
$addressIds = [];
|
||||
$params = [];
|
||||
foreach ($addresses as $address) {
|
||||
$addressIds[] = $address->Id;
|
||||
$addressIds[] = $address->id;
|
||||
$params[] = '?';
|
||||
}
|
||||
|
||||
// Get the unspent outputs for the address
|
||||
$conn = ConnectionManager::get('default');
|
||||
$stmt = $conn->execute(sprintf(
|
||||
'SELECT T.Hash AS TransactionHash, O.Vout, O.Value, O.Addresses, O.ScriptPubKeyAsm, O.ScriptPubKeyHex, O.Type, O.RequiredSignatures, B.Confirmations ' .
|
||||
'FROM Transactions T ' .
|
||||
'JOIN Outputs O ON O.TransactionId = T.Id ' .
|
||||
'JOIN Blocks B ON B.Hash = T.BlockHash ' .
|
||||
'WHERE O.Id IN (SELECT OutputId FROM OutputsAddresses WHERE AddressId IN (%s)) AND O.IsSpent <> 1 ORDER BY T.TransactionTime ASC', implode(',', $params)), $addressIds);
|
||||
'SELECT T.hash AS transaction_hash, O.vout, O.value, O.address_list, O.script_pub_key_asm, O.script_pub_key_hex, O.type, O.required_signatures, B.confirmations ' .
|
||||
'FROM transaction T ' .
|
||||
'JOIN output O ON O.transaction_id = T.id ' .
|
||||
'JOIN block B ON B.hash = T.block_hash_id ' .
|
||||
'WHERE O.id IN (SELECT O2.id FROM output O2 WHERE address_id IN (%s)) AND O.is_spent <> 1 ORDER BY T.transaction_time ASC', implode(',', $params)), $addressIds);
|
||||
$outputs = $stmt->fetchAll(\PDO::FETCH_OBJ);
|
||||
|
||||
$utxo = [];
|
||||
foreach ($outputs as $out) {
|
||||
$utxo[] = [
|
||||
'transaction_hash' => $out->TransactionHash,
|
||||
'output_index' => $out->Vout,
|
||||
'value' => (int) bcmul($out->Value, 100000000),
|
||||
'addresses' => json_decode($out->Addresses),
|
||||
'script' => $out->ScriptPubKeyAsm,
|
||||
'script_hex' => $out->ScriptPubKeyHex,
|
||||
'script_type' => $out->Type,
|
||||
'required_signatures' => (int) $out->RequiredSignatures,
|
||||
'transaction_hash' => $out->transaction_hash,
|
||||
'output_index' => $out->vout,
|
||||
'value' => (int) bcmul($out->value, 100000000),
|
||||
'addresses' => json_decode($out->address_list),
|
||||
'script' => $out->script_pub_key_asm,
|
||||
'script_hex' => $out->script_pub_key_hex,
|
||||
'script_type' => $out->type,
|
||||
'required_signatures' => (int) $out->required_signatures,
|
||||
'spent' => false,
|
||||
'confirmations' => (int) $out->Confirmations
|
||||
'confirmations' => (int) $out->confirmations
|
||||
];
|
||||
}
|
||||
|
||||
return $this->_jsonResponse(['success' => true, 'utxo' => $utxo]);
|
||||
}
|
||||
|
||||
public function apiutxosupply() {
|
||||
public function apiutxosupply() {
|
||||
$this->autoRender = false;
|
||||
$this->loadModel('Addresses');
|
||||
|
||||
$circulating = 0;
|
||||
$reservedcommunity = 0;
|
||||
$reservedoperational = 0;
|
||||
$reservedinstitutional = 0;
|
||||
$reservedtotal = 0;
|
||||
$circulating = 0;
|
||||
|
||||
$txoutsetinfo = $this->_gettxoutsetinfo();
|
||||
$reservedcommunity = $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'rFLUohPG4tP3gZHYoyhvADCtrDMiaYb7Qd'])->first();
|
||||
$reservedoperational = $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'r9PGXsejVJb9ZfMf3QVdDEJCzxkd9JLxzL'])->first();
|
||||
$reservedinstitutional = $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'r9srwX7DEN7Mex3a8oR1mKSqQmLBizoJvi'])->first();
|
||||
//aux is the address of hot wallets and where some of the LBRY operational fund are, but not sold on market.
|
||||
$reservedaux = $this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bRo4FEeqqxY7nWFANsZsuKEWByEgkvz8Qt'])->first() +
|
||||
$this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bU2XUzckfpdEuQNemKvhPT1gexQ3GG3SC2'])->first() +
|
||||
$this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bay3VA6YTQBL4WLobbG7CthmoGeUKXuXkD'])->first() +
|
||||
$this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bLPbiXBp6Vr3NSnsHzDsLNzoy5o36re9Cz'])->first() +
|
||||
$this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bMvUBo1h5WS46ThHtmfmXftz3z33VHL7wc'])->first() +
|
||||
$this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bVUrbCK8hcZ5XWti7b9eNxKEBxzc1rr393'])->first() +
|
||||
$this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bZja2VyhAC84a9hMwT8dwTU6rDRXowrjxH'])->first() +
|
||||
$this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bMvUBo1h5WS46ThHtmfmXftz3z33VHL7wc'])->first() +
|
||||
$this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bCrboXVztuSbZzVToCWSsu1pEr2oxKHu9v'])->first() +
|
||||
$this->Addresses->find()->select(['Balance'])->where(['Address =' => 'bMgqQqYfwzWWYBk5o5dBMXtCndVAoeqy6h'])->first();
|
||||
|
||||
$reservedcommunity = ['rFLUohPG4tP3gZHYoyhvADCtrDMiaYb7Qd'];
|
||||
$reservedoperational = ['r9PGXsejVJb9ZfMf3QVdDEJCzxkd9JLxzL'];
|
||||
$reservedinstitutional = ['r9srwX7DEN7Mex3a8oR1mKSqQmLBizoJvi'];
|
||||
$reservedaux = ['bRo4FEeqqxY7nWFANsZsuKEWByEgkvz8Qt', 'bU2XUzckfpdEuQNemKvhPT1gexQ3GG3SC2', 'bay3VA6YTQBL4WLobbG7CthmoGeUKXuXkD', 'bLPbiXBp6Vr3NSnsHzDsLNzoy5o36re9Cz', 'bMvUBo1h5WS46ThHtmfmXftz3z33VHL7wc', 'bVUrbCK8hcZ5XWti7b9eNxKEBxzc1rr393', 'bZja2VyhAC84a9hMwT8dwTU6rDRXowrjxH', 'bCrboXVztuSbZzVToCWSsu1pEr2oxKHu9v', 'bMgqQqYfwzWWYBk5o5dBMXtCndVAoeqy6h'];
|
||||
$allAddresses = array_merge($reservedcommunity, $reservedoperational, $reservedinstitutional, $reservedaux);
|
||||
|
||||
$reservedtotal = $this->Addresses->find()->select(['id', 'balance' => 'SUM(balance)'])->where(['Addresses.address IN' => $allAddresses])->first();
|
||||
|
||||
$reservedtotal = $reservedcommunity->Balance + $reservedoperational->Balance + $reservedinstitutional->Balance + $reservedaux->Balance;
|
||||
|
||||
|
||||
$circulating = $txoutsetinfo->total_amount - $reservedtotal;
|
||||
$circulating = $txoutsetinfo->total_amount - ($reservedtotal->balance);
|
||||
|
||||
return $this->_jsonResponse(['success' => true, 'utxosupply' => ['total' => $txoutsetinfo->total_amount, 'circulating' => $circulating]]);
|
||||
}
|
||||
|
||||
protected function _formatHashRate($value) {
|
||||
if ($value === 'N/A') {
|
||||
return $value;
|
||||
}
|
||||
|
||||
/*if ($value > 1000000000000) {
|
||||
return number_format( $value / 1000000000000, 2, '.', '' ) . ' TH';
|
||||
}*/
|
||||
if ($value > 1000000000) {
|
||||
return number_format( $value / 1000000000, 2, '.', '' ) . ' GH/s';
|
||||
}
|
||||
if ($value > 1000000) {
|
||||
return number_format( $value / 1000000, 2, '.', '' ) . ' MH/s';
|
||||
}
|
||||
if ($value > 1000) {
|
||||
return number_format( $value / 1000, 2, '.', '' ) . ' KH/s';
|
||||
}
|
||||
|
||||
return number_format($value) . ' H/s';
|
||||
}
|
||||
|
||||
public static function curl_get($url) {
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
$response = curl_exec($ch);
|
||||
Log::debug('Request execution completed.');
|
||||
|
||||
if ($response === false) {
|
||||
$error = curl_error($ch);
|
||||
$errno = curl_errno($ch);
|
||||
curl_close($ch);
|
||||
|
||||
throw new \Exception(sprintf('The request failed: %s', $error), $errno);
|
||||
} else {
|
||||
curl_close($ch);
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
private function _gethashrate() {
|
||||
$req = ['method' => 'getnetworkhashps', 'params' => []];
|
||||
try {
|
||||
$res = json_decode(self::curl_json_post(self::$rpcurl, json_encode($req)));
|
||||
if (!isset($res->result)) {
|
||||
return 0;
|
||||
}
|
||||
return $res->result;
|
||||
} catch (\Exception $e) {
|
||||
return 'N/A';
|
||||
}
|
||||
}
|
||||
|
||||
// private function _gettxoutsetinfo() {
|
||||
// $req = ['method' => 'gettxoutsetinfo', 'params' => []];
|
||||
// try {
|
||||
// $res = json_decode(self::curl_json_post(self::$rpcurl, json_encode($req)));
|
||||
// if (!isset($res->result)) {
|
||||
// return 0;
|
||||
// }
|
||||
// return $res->result;
|
||||
// } catch (\Exception $e) {
|
||||
// return 'N/A';
|
||||
// }
|
||||
// }
|
||||
|
||||
private static function curl_json_post($url, $data, $headers = []) {
|
||||
$ch = curl_init();
|
||||
@@ -969,4 +945,4 @@ class MainController extends AppController {
|
||||
// Close any open file handle
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,10 +14,9 @@
|
||||
*/
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Controller\AppController;
|
||||
use Cake\Core\Configure;
|
||||
use Cake\Http\Exception\ForbiddenException;
|
||||
use Cake\Http\Exception\NotFoundException;
|
||||
use Cake\Network\Exception\ForbiddenException;
|
||||
use Cake\Network\Exception\NotFoundException;
|
||||
use Cake\View\Exception\MissingTemplateException;
|
||||
|
||||
/**
|
||||
@@ -34,7 +33,7 @@ class PagesController extends AppController
|
||||
* Displays a view
|
||||
*
|
||||
* @param string ...$path Path segments.
|
||||
* @return \Cake\Http\Response
|
||||
* @return void|\Cake\Network\Response
|
||||
* @throws \Cake\Network\Exception\ForbiddenException When a directory traversal attempt.
|
||||
* @throws \Cake\Network\Exception\NotFoundException When the view file could not
|
||||
* be found or \Cake\View\Exception\MissingTemplateException in debug mode.
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Model\Behavior;
|
||||
|
||||
use Cake\Event\Event;
|
||||
use Cake\ORM\Behavior;
|
||||
use Cake\ORM\Entity;
|
||||
use Cake\Event\Event;
|
||||
use Cake\Routing\Router;
|
||||
|
||||
class SimpleAuditBehavior extends Behavior {
|
||||
|
||||
+12
-12
@@ -6,30 +6,30 @@ use Cake\ORM\Entity;
|
||||
|
||||
class Claim extends Entity {
|
||||
function getLbryLink() {
|
||||
$link = $this->Name;
|
||||
if (isset($this->Publisher->Name)) {
|
||||
$link = $this->Publisher->Name . '/' . $link;
|
||||
$link = $this->name;
|
||||
if (isset($this->publisher)) {
|
||||
$link = $this->publisher . '/' . $link;
|
||||
}
|
||||
$link = 'lbry://' . $link;
|
||||
return $link;
|
||||
}
|
||||
|
||||
function getExplorerLink() {
|
||||
$link = '/claims/' . $this->ClaimId;
|
||||
$link = '/claims/' . $this->claim_id;
|
||||
return $link;
|
||||
}
|
||||
|
||||
function getContentTag() {
|
||||
$ctTag = null;
|
||||
if (substr($this->ContentType, 0, 5) === 'audio') {
|
||||
if (substr($this->content_type, 0, 5) === 'audio') {
|
||||
$ctTag = 'audio';
|
||||
} else if (substr($this->ContentType, 0, 5) === 'video') {
|
||||
} else if (substr($this->content_type, 0, 5) === 'video') {
|
||||
$ctTag = 'video';
|
||||
} else if (substr($this->ContentType, 0, 5) === 'image') {
|
||||
} else if (substr($this->content_type, 0, 5) === 'image') {
|
||||
$ctTag = 'image';
|
||||
}
|
||||
|
||||
if (!$ctTag && $this->ClaimType == 1) {
|
||||
if (!$ctTag && $this->claim_type == 2) {
|
||||
$ctTag = 'identity';
|
||||
}
|
||||
return $ctTag;
|
||||
@@ -37,11 +37,11 @@ class Claim extends Entity {
|
||||
|
||||
function getAutoThumbText() {
|
||||
$autoThumbText = '';
|
||||
if ($this->ClaimType == 1) {
|
||||
$autoThumbText = strtoupper(substr($this->Name, 1, min( strlen($this->Name), 3 )));
|
||||
if ($this->claim_type == 2) {
|
||||
$autoThumbText = strtoupper(substr($this->name, 1, min(strlen($this->name), 10)));
|
||||
} else {
|
||||
$str = (strlen(trim($this->Title)) > 0) ? $this->Title : $this->Name;
|
||||
$autoThumbText = strtoupper(substr($str, 0, min (strlen($str), 2 )));
|
||||
$str = (strlen(trim($this->title)) > 0) ? $this->title : $this->name;
|
||||
$autoThumbText = strtoupper(substr($str, 0, min(strlen($str), 5)));
|
||||
}
|
||||
return $autoThumbText;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace App\Model\Entity;
|
||||
use Cake\ORM\Entity;
|
||||
|
||||
class PriceHistory extends Entity {
|
||||
|
||||
public $useDbConfig = 'localdb';
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -3,9 +3,9 @@
|
||||
namespace App\Model\Entity;
|
||||
|
||||
use Cake\ORM\Entity;
|
||||
use Cake\ORM\TableRegistry;
|
||||
|
||||
class Transaction extends Entity {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -4,8 +4,7 @@ namespace App\Model\Entity;
|
||||
|
||||
use Cake\ORM\Entity;
|
||||
|
||||
class ClaimStream extends Entity {
|
||||
|
||||
class TransactionAddress extends Entity {
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -8,8 +8,8 @@ class AddressesTable extends Table {
|
||||
public function initialize(array $config) {
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setPrimaryKey('Id');
|
||||
$this->setTable('Addresses');
|
||||
$this->setPrimaryKey('id');
|
||||
$this->setTable('address');
|
||||
|
||||
$this->addBehavior('SimpleAudit');
|
||||
}
|
||||
|
||||
@@ -8,9 +8,11 @@ class BlocksTable extends Table {
|
||||
public function initialize(array $config) {
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setPrimaryKey('Id');
|
||||
$this->setTable('Blocks');
|
||||
$this->setPrimaryKey('id');
|
||||
$this->setTable('block');
|
||||
|
||||
$this->addBehavior('SimpleAudit');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Model\Table;
|
||||
|
||||
use Cake\ORM\Table;
|
||||
|
||||
class ClaimStreamsTable extends Table {
|
||||
public function initialize(array $config) {
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setPrimaryKey('Id');
|
||||
$this->setTable('ClaimStreams');
|
||||
|
||||
//$this->addBehavior('SimpleAudit');
|
||||
}
|
||||
}
|
||||
@@ -8,27 +8,20 @@ class ClaimsTable extends Table {
|
||||
public function initialize(array $config) {
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setPrimaryKey('Id');
|
||||
$this->setTable('Claims');
|
||||
$this->setPrimaryKey('id');
|
||||
$this->setTable('claim');
|
||||
|
||||
//$this->addBehavior('SimpleAudit');
|
||||
$this->addAssociations([
|
||||
'belongsTo' => [
|
||||
'Publisher' => [
|
||||
'publisher' => [
|
||||
'className' => 'App\Model\Table\ClaimsTable',
|
||||
'foreignKey' => 'PublisherId',
|
||||
'bindingKey' => 'ClaimId',
|
||||
'propertyName' => 'Publisher'
|
||||
]
|
||||
],
|
||||
'hasOne' => [
|
||||
'Stream' => [
|
||||
'className' => 'App\Model\Table\ClaimStreamsTable',
|
||||
'foreignKey' => 'Id',
|
||||
'bindingKey' => 'Id',
|
||||
'propertyName' => 'Stream'
|
||||
'foreignKey' => 'publisher_id',
|
||||
'bindingKey' => 'claim_id',
|
||||
'propertyName' => 'publisher'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -8,21 +8,23 @@ class InputsTable extends Table {
|
||||
public function initialize(array $config) {
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setPrimaryKey('Id');
|
||||
$this->setTable('Inputs');
|
||||
$this->setPrimaryKey('id');
|
||||
$this->setTable('input');
|
||||
|
||||
$this->addBehavior('SimpleAudit');
|
||||
|
||||
$this->addAssociations([
|
||||
'belongsToMany' => [
|
||||
'InputAddresses' => [
|
||||
'input_addresses' => [
|
||||
'className' => 'App\Model\Table\AddressesTable',
|
||||
'joinTable' => 'InputsAddresses',
|
||||
'foreignKey' => 'InputId',
|
||||
'targetForeignKey' => 'AddressId',
|
||||
'propertyName' => 'InputAddresses'
|
||||
'joinTable' => 'input_addresses',
|
||||
'foreignKey' => 'input_id',
|
||||
'targetForeignKey' => 'address_id',
|
||||
'propertyName' => 'input_addresses'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -8,28 +8,30 @@ class OutputsTable extends Table {
|
||||
public function initialize(array $config) {
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setPrimaryKey('Id');
|
||||
$this->setTable('Outputs');
|
||||
$this->setPrimaryKey('id');
|
||||
$this->setTable('output');
|
||||
|
||||
$this->addBehavior('SimpleAudit');
|
||||
|
||||
$this->addAssociations([
|
||||
'belongsTo' => [
|
||||
'SpendInput' => [
|
||||
'spend_input' => [
|
||||
'className' => 'App\Model\Table\InputsTable',
|
||||
'foreignKey' => 'SpentByInputId',
|
||||
'propertyName' => 'SpendInput'
|
||||
'foreignKey' => 'spent_by_input_id',
|
||||
'propertyName' => 'spend_input'
|
||||
]
|
||||
],
|
||||
'belongsToMany' => [
|
||||
'OutputAddresses' => [
|
||||
'output_addresses' => [
|
||||
'className' => 'App\Model\Table\AddressesTable',
|
||||
'joinTable' => 'OutputsAddresses',
|
||||
'foreignKey' => 'OutputId',
|
||||
'targetForeignKey' => 'AddressId',
|
||||
'propertyName' => 'OutputAddresses'
|
||||
'joinTable' => 'output_addresses',
|
||||
'foreignKey' => 'output_id',
|
||||
'targetForeignKey' => 'address_id',
|
||||
'propertyName' => 'output_addresses'
|
||||
]
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -11,4 +11,6 @@ class PriceHistoryTable extends Table {
|
||||
$this->setPrimaryKey('Id');
|
||||
$this->setTable('PriceHistory');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -13,4 +13,6 @@ class TagAddressRequestsTable extends Table {
|
||||
|
||||
$this->addBehavior('SimpleAudit');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Model\Table;
|
||||
|
||||
use Cake\ORM\Table;
|
||||
|
||||
class TransactionAddressesTable extends Table {
|
||||
public function initialize(array $config) {
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setTable('transaction_address');
|
||||
$this->addBehavior('SimpleAudit');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -8,9 +8,11 @@ class TransactionsTable extends Table {
|
||||
public function initialize(array $config) {
|
||||
parent::initialize($config);
|
||||
|
||||
$this->setPrimaryKey('Id');
|
||||
$this->setTable('Transactions');
|
||||
$this->setPrimaryKey('id');
|
||||
$this->setTable('transaction');
|
||||
|
||||
$this->addBehavior('SimpleAudit');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -127,7 +127,7 @@ class AuxShell extends Shell {
|
||||
public function pricehistory() {
|
||||
self::lock('pricehistory');
|
||||
|
||||
$conn = ConnectionManager::get('default');
|
||||
$conn = ConnectionManager::get('localdb');
|
||||
$redis = new \Predis\Client(Configure::read('Redis.Url'));
|
||||
|
||||
try {
|
||||
@@ -219,4 +219,6 @@ class AuxShell extends Shell {
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
+17
-12
@@ -274,6 +274,7 @@ class BlockShell extends Shell {
|
||||
self::unlock('buildindex');
|
||||
}
|
||||
|
||||
// TODO: Refactor for unique claim identification by claim_id instead of using the claim name.
|
||||
protected function _getclaimfortxout($pubkeyasm, $tx_hash, $vout, $tx_time = null) {
|
||||
$claim_data = null;
|
||||
$claim_stream_data = null;
|
||||
@@ -295,6 +296,10 @@ class BlockShell extends Shell {
|
||||
if ($json) {
|
||||
$claim = json_decode($json);
|
||||
if ($claim) {
|
||||
if (strpos($claim_name, '#') !== false) {
|
||||
$claim_name = substr($claim_name, 0, strpos($claim_name, '#'));
|
||||
}
|
||||
|
||||
$req = ['method' => 'getvalueforname', 'params' => [$claim_name]];
|
||||
$json = null;
|
||||
try {
|
||||
@@ -1339,8 +1344,8 @@ print_r($response); print_r($json);
|
||||
$inputs[] = [
|
||||
'PrevoutHash' => $in['txid'],
|
||||
'PrevoutN' => $in['vout'],
|
||||
'ScriptSigAsm' => $in->scriptSig['asm'],
|
||||
'ScriptSigHex' => $in->scriptSig['hex'],
|
||||
'ScriptSigAsm' => $in['scriptSig']['asm'],
|
||||
'ScriptSigHex' => $in['scriptSig']['hex'],
|
||||
'Sequence' => $in['sequence']
|
||||
];
|
||||
}
|
||||
@@ -1350,16 +1355,16 @@ print_r($response); print_r($json);
|
||||
$outputs[] = [
|
||||
'Vout' => $out['vout'],
|
||||
'Value' => bcdiv($out['value'], 100000000, 8),
|
||||
'Type' => isset($out->scriptPubKey['type']) ? $out->scriptPubKey['type'] : '',
|
||||
'ScriptPubKeyAsm' => isset($out->scriptPubKey['asm']) ? $out->scriptPubKey['asm'] : '',
|
||||
'ScriptPubKeyHex' => isset($out->scriptPubKey['hex']) ? $out->scriptPubKey['hex'] : '',
|
||||
'RequiredSignatures' => isset($out->scriptPubKey['reqSigs']) ? $out->scriptPubKey['reqSigs'] : '',
|
||||
'Hash160' => isset($out->scriptPubKey['hash160']) ? $out->scriptPubKey['hash160'] : '',
|
||||
'Addresses' => isset($out->scriptPubKey['addresses']) ? json_encode($out->scriptPubKey['addresses']) : null
|
||||
'Type' => isset($out['scriptPubKey']['type']) ? $out['scriptPubKey']['type'] : '',
|
||||
'ScriptPubKeyAsm' => isset($out['scriptPubKey']['asm']) ? $out['scriptPubKey']['asm'] : '',
|
||||
'ScriptPubKeyHex' => isset($out['scriptPubKey']['hex']) ? $out['scriptPubKey']['hex'] : '',
|
||||
'RequiredSignatures' => isset($out['scriptPubKey']['reqSigs']) ? $out['scriptPubKey']['reqSigs'] : '',
|
||||
'Hash160' => isset($out['scriptPubKey']['hash160']) ? $out['scriptPubKey']['hash160'] : '',
|
||||
'Addresses' => isset($out['scriptPubKey']['addresses']) ? json_encode($out['scriptPubKey']['addresses']) : null
|
||||
];
|
||||
|
||||
if (isset($out->scriptPubKey['addresses'])) {
|
||||
foreach ($out->scriptPubKey['addresses'] as $address) {
|
||||
if (isset($out['scriptPubKey']['addresses'])) {
|
||||
foreach ($out['scriptPubKey']['addresses'] as $address) {
|
||||
$addresses[$address] = $address;
|
||||
}
|
||||
}
|
||||
@@ -1983,10 +1988,10 @@ print_r($response); print_r($json);
|
||||
$return = $define[$tx_type];
|
||||
if ($tx_type === 'p2pk') {
|
||||
$return['hash160'] = self::hash160($data[$define[$tx_type]['data_index_for_hash']]);
|
||||
$return->addresses[0] = self::hash160_to_address($return['hash160'], self::pubKeyAddress[0]);
|
||||
$return['addresses'][0] = self::hash160_to_address($return['hash160'], self::pubKeyAddress[0]);
|
||||
} else {
|
||||
$return['hash160'] = $data[$define[$tx_type]['data_index_for_hash']];
|
||||
$return->addresses[0] = self::hash160_to_address($return['hash160'], ($tx_type === 'p2sh') ? self::scriptAddress[0] : self::pubKeyAddress[0]); // TODO: Pay to claim transaction?
|
||||
$return['addresses'][0] = self::hash160_to_address($return['hash160'], ($tx_type === 'p2sh') ? self::scriptAddress[0] : self::pubKeyAddress[0]); // TODO: Pay to claim transaction?
|
||||
}
|
||||
unset($return['data_index_for_hash']);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
$autoThumbText = $claim->getAutoThumbText();
|
||||
$cost = '';
|
||||
if (isset($claim->price) && $claim->price > 0) {
|
||||
$cost = $this->Amount->formatCurrency($claim->price) . ' LBC';
|
||||
} else if (isset($claim->fee) && strtolower($claim->fee_currency) === 'lbc') {
|
||||
$cost = $this->Amount->formatCurrency($claim->fee) . ' LBC';
|
||||
}
|
||||
$a = ['purple', 'orange', 'blue', 'teal', 'green', 'yellow'];
|
||||
// content type
|
||||
$ctTag = $claim->getContentTag();
|
||||
?>
|
||||
<div data-id="<?php echo $claim->claim_id ?>" class="claim-grid-item<?php if ($idx % 3 == 0): ?> last-item<?php endif; ?><?php if ($last_row): ?> last-row<?php endif; ?>">
|
||||
<?php if (strlen(trim($cost)) > 0): ?>
|
||||
<div class="price-tag"><?php echo $cost ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="tags">
|
||||
<?php if ($claim->bid_state == 'Controlling'): ?>
|
||||
<div class="bid-state">Controlling</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($ctTag): ?>
|
||||
<div class="content-type"><?php echo strtoupper($ctTag) ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($claim->is_nsfw): ?>
|
||||
<div class="nsfw">NSFW</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
||||
<?php if (!$claim->is_nsfw && strlen(trim($claim->thumbnail_url)) > 0): ?>
|
||||
<img src="<?php echo htmlspecialchars($claim->thumbnail_url) ?>" alt="" />
|
||||
<?php else: ?>
|
||||
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="metadata">
|
||||
<div class="title" title="<?php echo $claim->claim_type == 1 ? $claim->name : ((strlen(trim($claim->title)) > 0) ? $claim->title : '') ?>"><?php echo $claim->claim_type == 1 ? $claim->name : ((strlen(trim($claim->title)) > 0) ? $claim->title : '<em>No Title</em>') ?></div>
|
||||
<div class="link" title="<?php echo $claim->getLbryLink() ?>"><a href="<?php echo $claim->getLbryLink() ?>" rel="nofollow"><?php echo $claim->getLbryLink() ?></a></div>
|
||||
|
||||
<div class="desc"><?php echo strlen(trim($claim->description)) > 0 ? $claim->description : '<em>No description available</em>' ?></div>
|
||||
|
||||
<div class="label half-width">Transaction</div>
|
||||
<div class="label half-width">Created</div>
|
||||
|
||||
<div class="value half-width"><a href="/tx/<?php echo $claim->transaction_hash_id ?>#output-<?php echo $claim->vout ?>" title="<?php echo $claim->transaction_hash_id ?>"><?php echo $claim->transaction_hash_id ?></a></div>
|
||||
<div class="value half-width" title="<?php echo $claim->created_at->format('j M Y H:i:s') ?> UTC">
|
||||
<?php echo \Carbon\Carbon::createFromTimestamp($claim->created_at->format('U'))->diffForHumans(); ?>
|
||||
</div>
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<?php if ($claim->claim_type == 1): ?>
|
||||
<div class="label half-width">Content Type</div>
|
||||
<div class="label half-width">Language</div>
|
||||
|
||||
<div class="value half-width" title="<?php echo $claim->content_type ?>"><?php echo $claim->content_type ?></div>
|
||||
<div class="value half-width" title="<?php echo $claim->language == 'en' ? 'English' : $claim->language ?>"><?php echo $claim->language == 'en' ? 'English' : $claim->language ?></div>
|
||||
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<!--<div class="label half-width">Author</div>
|
||||
<div class="label half-width">License</div>-->
|
||||
|
||||
|
||||
<!--<div class="value half-width" title="<?php echo strlen(trim($claim->author)) > 0 ? $claim->author : '<em>Unspecified</em>' ?>"><?php echo strlen(trim($claim->author)) > 0 ? $claim->author : '<em>Unspecified</em>' ?></div>
|
||||
|
||||
<div class="value half-width" title="<?php echo strlen(trim($claim->license)) > 0 ? $claim->license : '' ?>">
|
||||
<?php if (strlen(trim($claim->LicenseUrl)) > 0): ?><a href="<?php echo $claim->LicenseUrl ?>" rel="nofollow" target="_blank"><?php endif; ?>
|
||||
<?php echo strlen(trim($claim->License)) > 0 ? $claim->License : '<em>Unspecified</em>' ?>
|
||||
<?php if (strlen(trim($claim->LicenseUrl))): ?></a><?php endif; ?>
|
||||
</div>
|
||||
-->
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php $this->assign('title', 'Address ' . $address->Address) ?>
|
||||
<?php $this->assign('title', 'Address ' . $address->address) ?>
|
||||
|
||||
<?php $this->start('script') ?>
|
||||
<script type="text/javascript">
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
var btnClose = $('.btn-close');
|
||||
$.ajax({
|
||||
url: '/api/v1/address/<?php echo $address->Address ?>/tag',
|
||||
url: '/api/v1/address/<?php echo $address->address ?>/tag',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: req,
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
<div class="address-head">
|
||||
<h3>LBRY Address</h3>
|
||||
<h4><?php echo $address->Address ?></h4>
|
||||
<h4><?php echo $address->address ?></h4>
|
||||
<?php if (isset($address->Tag) && strlen(trim($address->Tag)) > 0): ?>
|
||||
<?php if (strlen(trim($address->TagUrl)) > 0): ?><a href="<?php echo $address->TagUrl ?>" target="_blank" rel="nofollow"><?php echo $address->Tag ?></a><?php else: echo $address->Tag; endif; ?>
|
||||
<?php endif; ?>
|
||||
@@ -95,7 +95,7 @@
|
||||
|
||||
<div class="address-subhead">
|
||||
<div class="address-qr">
|
||||
<img src="/qr/lbry%3A<?php echo $address->Address ?>" alt="lbry:<?php echo $address->Address ?>" />
|
||||
<img src="/qr/lbry%3A<?php echo $address->address ?>" alt="lbry:<?php echo $address->address ?>" />
|
||||
</div>
|
||||
|
||||
<div class="address-summary">
|
||||
@@ -152,14 +152,14 @@
|
||||
|
||||
<?php foreach ($recentTxs as $tx): ?>
|
||||
<tr>
|
||||
<td class="w125"><?php if ($tx->Height === null): ?><em>Unconfirmed</em><?php else: ?><a href="/blocks/<?php echo $tx->Height ?>"><?php echo $tx->Height ?></a><?php endif; ?></td>
|
||||
<td class="w250"><div><a href="/tx/<?php echo $tx->Hash ?>?address=<?php echo $address->Address ?>#<?php echo $address->Address ?>"><?php echo $tx->Hash ?></a></div></td>
|
||||
<td><?php echo \DateTime::createFromFormat('U', $tx->TxTime)->format('d M Y H:i:s') . ' UTC'; ?></td>
|
||||
<td class="right"><?php echo number_format($tx->Confirmations, 0, '', ',') ?></td>
|
||||
<td class="right"><?php echo $tx->InputCount ?></td>
|
||||
<td class="right"><?php echo $tx->OutputCount ?></td>
|
||||
<td class="right<?php echo ' ' . ($tx->DebitAmount > 0 && $tx->CreditAmount > 0 ? 'diff' : ($tx->DebitAmount > 0 ? 'debit' : 'credit')) ?>">
|
||||
<?php echo number_format($tx->CreditAmount - $tx->DebitAmount, 8, '.', ',') ?> LBC
|
||||
<td class="w125"><?php if ($tx->height === null): ?><em>Unconfirmed</em><?php else: ?><a href="/blocks/<?php echo $tx->height ?>"><?php echo $tx->height ?></a><?php endif; ?></td>
|
||||
<td class="w250"><div><a href="/tx/<?php echo $tx->hash ?>?address=<?php echo $address->address ?>#<?php echo $address->address ?>"><?php echo $tx->hash ?></a></div></td>
|
||||
<td><?php echo \DateTime::createFromFormat('U', $tx->transaction_time)->format('d M Y H:i:s') . ' UTC'; ?></td>
|
||||
<td class="right"><?php echo number_format($tx->confirmations, 0, '', ',') ?></td>
|
||||
<td class="right"><?php echo $tx->input_count ?></td>
|
||||
<td class="right"><?php echo $tx->output_count ?></td>
|
||||
<td class="right<?php echo ' ' . ($tx->debit_amount > 0 && $tx->credit_amount > 0 ? 'diff' : ($tx->debit_amount > 0 ? 'debit' : 'credit')) ?>">
|
||||
<?php echo number_format($tx->credit_amount - $tx->debit_amount, 8, '.', ',') ?> LBC
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
@@ -21,21 +21,19 @@
|
||||
</script>
|
||||
<?php $this->end(); ?>
|
||||
|
||||
<?php $this->assign('title', 'Block Height ' . $block->Height) ?>
|
||||
<?php $this->assign('title', 'Block Height ' . $block->height) ?>
|
||||
|
||||
<div class="block-head">
|
||||
<h3>LBRY Block <?php echo $block->Height ?></h3>
|
||||
<h4><?php echo $block->Hash ?></h4>
|
||||
<h3>LBRY Block <?php echo $block->height ?></h3>
|
||||
<h4><?php echo $block->hash ?></h4>
|
||||
</div>
|
||||
|
||||
<div class="block-nav">
|
||||
<?php if (strlen(trim($block->PreviousBlockHash)) > 0): ?>
|
||||
<a class="btn btn-prev" href="/blocks/<?php echo ($block->Height - 1); ?>">« Previous Block</a>
|
||||
<?php if ($block->height > 0): ?>
|
||||
<a class="btn btn-prev" href="/blocks/<?php echo ($block->height - 1); ?>">« Previous Block</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (strlen(trim($block->NextBlockHash)) > 0): ?>
|
||||
<a class="btn btn-next" href="/blocks/<?php echo ($block->Height + 1); ?>">Next Block »</a>
|
||||
<?php endif; ?>
|
||||
<a class="btn btn-next" href="/blocks/<?php echo ($block->height + 1); ?>">Next Block »</a>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
@@ -47,44 +45,46 @@
|
||||
<div class="label half-width">Block Size (bytes)</div>
|
||||
<div class="label half-width">Block Time</div>
|
||||
|
||||
<div class="value half-width"><?php echo number_format($block->BlockSize, 0, '', ',') ?></div>
|
||||
<div class="value half-width"><?php echo \DateTime::createFromFormat('U', $block->BlockTime)->format('j M Y H:i:s') . ' UTC' ?></div>
|
||||
<div class="value half-width"><?php echo number_format($block->block_size, 0, '', ',') ?></div>
|
||||
<div class="value half-width"><?php echo \DateTime::createFromFormat('U', $block->block_time)->format('j M Y H:i:s') . ' UTC' ?></div>
|
||||
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<div class="label half-width">Bits</div>
|
||||
<div class="label half-width">Confirmations</div>
|
||||
|
||||
<div class="value half-width"><?php echo $block->Bits ?></div>
|
||||
<div class="value half-width"><?php echo number_format($block->Confirmations, 0, '', ',') ?></div>
|
||||
<div class="value half-width"><?php echo $block->bits ?></div>
|
||||
<div class="value half-width"><?php echo $confirmations ?></div>
|
||||
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<div class="label half-width">Difficulty</div>
|
||||
<div class="label half-width">Nonce</div>
|
||||
|
||||
<div class="value half-width"><?php echo $this->Amount->format($block->Difficulty, '') ?></div>
|
||||
<div class="value half-width"><?php echo $block->Nonce ?></div>
|
||||
<div class="value half-width"><?php echo $this->Amount->format($block->difficulty, '') ?></div>
|
||||
<div class="value half-width"><?php echo $block->nonce ?></div>
|
||||
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<div class="label">Chainwork</div> <div class="value"><?php echo $block->Chainwork ?></div>
|
||||
<div class="label">Chainwork</div> <div class="value"><?php echo $block->chainwork ?></div>
|
||||
|
||||
<div class="spacer"></div>
|
||||
|
||||
<div class="label">MerkleRoot</div> <div class="value"><?php echo $block->MerkleRoot ?></div>
|
||||
<div class="label">MerkleRoot</div> <div class="value"><?php echo $block->merkle_root ?></div>
|
||||
|
||||
<div class="spacer"></div>
|
||||
|
||||
<div class="label">NameClaimRoot</div> <div class="value"><?php echo $block->NameClaimRoot ?></div>
|
||||
<div class="label">NameClaimRoot</div> <div class="value"><?php echo $block->name_claim_root ?></div>
|
||||
|
||||
<!--
|
||||
<div class="spacer"></div>
|
||||
|
||||
<div class="label">Target</div> <div class="value"><?php echo $block->Target ?></div>
|
||||
-->
|
||||
|
||||
<div class="spacer"></div>
|
||||
|
||||
<div class="label">Version</div> <div class="value"><?php echo $block->Version ?></div>
|
||||
<div class="label">Version</div> <div class="value"><?php echo $block->version ?></div>
|
||||
</div>
|
||||
|
||||
<div class="block-transactions">
|
||||
@@ -109,10 +109,10 @@
|
||||
|
||||
<?php foreach ($blockTxs as $tx): ?>
|
||||
<tr>
|
||||
<td class="w300"><div><a href="/tx/<?php echo $tx->Hash ?>"><?php echo $tx->Hash ?></a></div></td>
|
||||
<td class="right"><?php echo $tx->InputCount ?></td>
|
||||
<td class="right"><?php echo $tx->OutputCount ?></td>
|
||||
<td class="right"><div title="<?php echo $tx->Value ?> LBC"><?php echo $this->Amount->formatCurrency($tx->Value) ?> LBC</div></td>
|
||||
<td class="w300"><div><a href="/tx/<?php echo $tx->hash ?>"><?php echo $tx->hash ?></a></div></td>
|
||||
<td class="right"><?php echo $tx->input_count ?></td>
|
||||
<td class="right"><?php echo $tx->output_count ?></td>
|
||||
<td class="right"><div title="<?php echo $tx->value ?> LBC"><?php echo $this->Amount->formatCurrency($tx->value) ?> LBC</div></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
@@ -181,13 +181,13 @@
|
||||
<tbody>
|
||||
<?php foreach ($blocks as $block): ?>
|
||||
<tr>
|
||||
<td class="right"><a href="/blocks/<?php echo $block->Height ?>"><?php echo $block->Height ?></a></td>
|
||||
<td class="pad-left"><?php echo number_format($block->Difficulty, 8, '.', '') ?></td>
|
||||
<td class="right"><?php echo number_format((($currentBlock->Height - $block->Height) + 1), 0, '', ',') ?></td>
|
||||
<td class="right"><?php echo count(json_decode($block->TransactionHashes)) ?></td>
|
||||
<td class="right"><?php echo round($block->BlockSize / 1024, 2) . 'KB' ?></td>
|
||||
<td class="right pad-left"><?php echo $block->Nonce ?></td>
|
||||
<td class="pad-left"><?php echo \DateTime::createFromFormat('U', $block->BlockTime)->format('d M Y H:i:s') ?> UTC</td>
|
||||
<td class="right"><a href="/blocks/<?php echo $block->height ?>"><?php echo $block->height ?></a></td>
|
||||
<td class="pad-left"><?php echo number_format($block->difficulty, 8, '.', '') ?></td>
|
||||
<td class="right"><?php echo number_format((($currentBlock->height - $block->height) + 1), 0, '', ',') ?></td>
|
||||
<td class="right"><?php echo count(preg_split('#,#', $block->transaction_hashes)) ?></td>
|
||||
<td class="right"><?php echo round($block->block_size / 1024, 2) . 'KB' ?></td>
|
||||
<td class="right pad-left"><?php echo $block->nonce ?></td>
|
||||
<td class="pad-left"><?php echo \DateTime::createFromFormat('U', $block->block_time)->format('d M Y H:i:s') ?> UTC</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
|
||||
+37
-173
@@ -41,13 +41,13 @@
|
||||
$a = ['purple', 'orange', 'blue', 'teal', 'green', 'yellow'];
|
||||
$autoThumbText = $claim->getAutoThumbText();
|
||||
$cost = 'Free';
|
||||
if (isset($claim->Price) && $claim->Price > 0) {
|
||||
$cost = $this->Amount->formatCurrency($claim->Price) . ' LBC';
|
||||
} else if (isset($claim->Fee) && strtolower($claim->FeeCurrency) === 'lbc') {
|
||||
$cost = $this->Amount->formatCurrency($claim->Fee) . ' LBC';
|
||||
if (isset($claim->price) && $claim->price > 0) {
|
||||
$cost = $this->Amount->formatCurrency($claim->price) . ' LBC';
|
||||
} else if (isset($claim->fee) && strtolower($claim->fee_currency) === 'lbc') {
|
||||
$cost = $this->Amount->formatCurrency($claim->fee) . ' LBC';
|
||||
}
|
||||
|
||||
$desc = $claim->Description;
|
||||
$desc = $claim->description;
|
||||
if (strlen(trim($desc)) == 0) {
|
||||
$desc = '<em>No description available.</em>';
|
||||
} else {
|
||||
@@ -57,29 +57,29 @@ if (strlen(trim($desc)) == 0) {
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->assign('title', 'Claim • ' . $claim->Name) ?>
|
||||
<?php $this->assign('title', 'Claim • ' . $claim->name) ?>
|
||||
|
||||
<div class="claims-head">
|
||||
<h3><a href="/claims">LBRY Claims</a> • <?php echo $claim->Name ?></h3>
|
||||
<h4><?php echo $claim->ClaimId ?></h4>
|
||||
<h3><a href="/claims">LBRY Claims</a> • <?php echo $claim->name ?></h3>
|
||||
<h4><?php echo $claim->claim_id ?></h4>
|
||||
</div>
|
||||
|
||||
<div class="claims-body">
|
||||
<div class="claim-info">
|
||||
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
||||
<?php if (!$claim->IsNSFW && strlen(trim($claim->ThumbnailUrl)) > 0): ?>
|
||||
<img src="<?php echo htmlspecialchars($claim->ThumbnailUrl) ?>" alt="" />
|
||||
<?php if (!$claim->is_nsfw && strlen(trim($claim->thumbnail_url)) > 0): ?>
|
||||
<img src="<?php echo htmlspecialchars($claim->thumbnail_url) ?>" alt="" />
|
||||
<?php else: ?>
|
||||
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
<?php if ($claim->ClaimType == 2): ?>
|
||||
<?php if ($claim->claim_type == 1): ?>
|
||||
<div class="label">Published By</div>
|
||||
<div class="value">
|
||||
<?php if (isset($claim->Publisher)): ?>
|
||||
<a href="lbry://<?php echo $claim->Publisher->Name ?>"><?php echo $claim->Publisher->Name ?></a>
|
||||
<?php if (isset($claim->publisher)): ?>
|
||||
<a href="lbry://<?php echo $claim->publisher ?>"><?php echo $claim->publisher ?></a>
|
||||
<?php else: ?>
|
||||
<em>Anonymous</em>
|
||||
<?php endif; ?>
|
||||
@@ -87,17 +87,17 @@ if (strlen(trim($desc)) == 0) {
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="label">Created On</div>
|
||||
<div class="value"><?php echo \DateTime::createFromFormat('U', $claim->TransactionTime > 0 ? $claim->TransactionTime : $claim->Created->format('U'))->format('j M Y H:i:s') ?> UTC</div>
|
||||
<div class="value"><?php echo \DateTime::createFromFormat('U', $claim->transaction_time > 0 ? $claim->transaction_time : $claim->created_at->format('U'))->format('j M Y H:i:s') ?> UTC</div>
|
||||
|
||||
<div class="label">Transaction ID</div>
|
||||
<div class="value"><a href="/tx/<?php echo $claim->TransactionHash ?>#output-<?php echo $claim->Vout ?>"><?php echo $claim->TransactionHash ?></a></div>
|
||||
<div class="value"><a href="/tx/<?php echo $claim->transaction_hash_id ?>#output-<?php echo $claim->vout ?>"><?php echo $claim->transaction_hash_id ?></a></div>
|
||||
|
||||
<?php if ($claim->ClaimType == 2): ?>
|
||||
<?php if ($claim->claim_type == 1): ?>
|
||||
<div class="label half-width">Cost</div>
|
||||
<div class="label half-width">Safe for Work</div>
|
||||
|
||||
<div class="value half-width"><?php echo $cost ?></div>
|
||||
<div class="value half-width"><?php echo $claim->IsNSFW ? 'No' : 'Yes' ?></div>
|
||||
<div class="value half-width"><?php echo $claim->is_nsfw ? 'No' : 'Yes' ?></div>
|
||||
|
||||
<div class="clear"></div>
|
||||
<?php endif; ?>
|
||||
@@ -105,30 +105,34 @@ if (strlen(trim($desc)) == 0) {
|
||||
</div>
|
||||
|
||||
<div class="claim-metadata">
|
||||
<?php if ($claim->ClaimType == 1): ?>
|
||||
<?php if ($claim->claim_type == 2): ?>
|
||||
<div class="title">Identity Claim</div>
|
||||
<div class="desc">This is an identity claim.</div>
|
||||
<?php else: ?>
|
||||
<div class="title"><?php echo $claim->Title ?></div>
|
||||
<div class="desc"><?php echo str_replace("\n", '<br/>', $desc) ?></div>
|
||||
<div class="title"><?php echo $claim->title ?></div>
|
||||
<div class="desc"><?php echo str_replace("\n", '<br />', $desc) ?></div>
|
||||
|
||||
<div class="details">
|
||||
<div class="label half-width">Author</div>
|
||||
<div class="label half-width">Content Type</div>
|
||||
|
||||
|
||||
<div class="value half-width"><?php echo strlen(trim($claim->Author)) > 0 ? $claim->Author : '<em>Unspecified</em>' ?></div>
|
||||
<div class="value half-width"><?php echo strlen(trim($claim->ContentType)) > 0 ? $claim->ContentType : '<em>Unspecified</em>' ?></div>
|
||||
<div class="value half-width"><?php echo strlen(trim($claim->author)) > 0 ? $claim->author : '<em>Unspecified</em>' ?></div>
|
||||
<div class="value half-width"><?php echo strlen(trim($claim->content_type)) > 0 ? $claim->content_type : '<em>Unspecified</em>' ?></div>
|
||||
|
||||
<!--
|
||||
<div class="label half-width">License</div>
|
||||
<div class="label half-width">Language</div>
|
||||
-->
|
||||
<div class="label">Language</div>
|
||||
|
||||
<div class="value half-width"<?php if(strlen(trim($claim->License)) > 0): ?> title="<?php echo $claim->License ?>"<?php endif; ?>>
|
||||
<?php if (strlen(trim($claim->LicenseUrl)) > 0): ?><a href="<?php echo $claim->LicenseUrl ?>" rel="nofollow" target="_blank"><?php endif; ?>
|
||||
<!--
|
||||
<div class="value half-width"<?php if(strlen(trim($claim->license)) > 0): ?> title="<?php echo $claim->license ?>"<?php endif; ?>>
|
||||
<?php if (strlen(trim($claim->license_url)) > 0): ?><a href="<?php echo $claim->LicenseUrl ?>" rel="nofollow" target="_blank"><?php endif; ?>
|
||||
<?php echo strlen(trim($claim->License)) > 0 ? $claim->License : '<em>Unspecified</em>' ?>
|
||||
<?php if (strlen(trim($claim->LicenseUrl))): ?></a><?php endif; ?>
|
||||
</div>
|
||||
<div class="value half-width"><?php echo strlen(trim($claim->Language)) > 0 ? ($claim->Language == 'en' ? 'English' : '') : '<em>Unspecified</em>' ?></div>
|
||||
-->
|
||||
<div class="value half-width"><?php echo strlen(trim($claim->language)) > 0 ? ($claim->language == 'en' ? 'English' : '') : '<em>Unspecified</em>' ?></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<a href="<?php echo $claim->getLbryLink() ?>" class="open-lbry-link">Open in LBRY</a>
|
||||
@@ -140,7 +144,7 @@ if (strlen(trim($desc)) == 0) {
|
||||
<?php if (count($moreClaims) > 0): ?>
|
||||
|
||||
<div class="more-claims">
|
||||
<h4><?php echo isset($claim->Publisher) ? 'More from the publisher' : 'Published by this identity' ?></h4>
|
||||
<h4><?php echo isset($claim->publisher) ? 'More from the publisher' : 'Published by this identity' ?></h4>
|
||||
|
||||
<div class="claims-grid">
|
||||
<?php $idx = 1; $row = 1; $rowCount = ceil(count($moreClaims) / 3);
|
||||
@@ -150,80 +154,9 @@ if (strlen(trim($desc)) == 0) {
|
||||
if ($idx % 3 == 0) {
|
||||
$row++;
|
||||
}
|
||||
|
||||
$autoThumbText = $claim->getAutoThumbText();
|
||||
$cost = '';
|
||||
if (isset($claim->Price) && $claim->Price > 0) {
|
||||
$cost = $this->Amount->formatCurrency($claim->Price) . ' LBC';
|
||||
} else if (isset($claim->Fee) && strtolower($claim->FeeCurrency) === 'lbc') {
|
||||
$cost = $this->Amount->formatCurrency($claim->Fee) . ' LBC';
|
||||
}
|
||||
|
||||
// content type
|
||||
$ctTag = $claim->getContentTag();
|
||||
?>
|
||||
<div data-id="<?php echo $claim->ClaimId ?>" class="claim-grid-item<?php if ($idx % 3 == 0): ?> last-item<?php endif; ?><?php if ($last_row): ?> last-row<?php endif; ?>">
|
||||
<?php if (strlen(trim($cost)) > 0): ?>
|
||||
<div class="price-tag"><?php echo $cost ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="tags">
|
||||
<?php if ($ctTag): ?>
|
||||
<div class="content-type"><?php echo strtoupper($ctTag) ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($claim->IsNSFW): ?>
|
||||
<div class="nsfw">NSFW</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
||||
<?php if (!$claim->IsNSFW && strlen(trim($claim->ThumbnailUrl)) > 0): ?>
|
||||
<img src="<?php echo htmlspecialchars($claim->ThumbnailUrl) ?>" alt="" />
|
||||
<?php else: ?>
|
||||
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="metadata">
|
||||
<div class="title" title="<?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '') ?>"><?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '<em>No Title</em>') ?></div>
|
||||
<div class="link" title="<?php echo $claim->getLbryLink() ?>"><a href="<?php echo $claim->getLbryLink() ?>" rel="nofollow"><?php echo $claim->getLbryLink() ?></a></div>
|
||||
|
||||
<div class="desc"><?php echo strlen(trim($claim->Description)) > 0 ? $claim->Description : '<em>No description available</em>' ?></div>
|
||||
|
||||
<div class="label half-width">Transaction</div>
|
||||
<div class="label half-width">Created</div>
|
||||
|
||||
<div class="value half-width"><a href="/tx/<?php echo $claim->TransactionHash ?>#output-<?php echo $claim->Vout ?>" title="<?php echo $claim->TransactionHash ?>"><?php echo $claim->TransactionHash ?></a></div>
|
||||
<div class="value half-width" title="<?php echo $claim->Created->format('j M Y H:i:s') ?> UTC">
|
||||
<?php echo \Carbon\Carbon::createFromTimestamp($claim->Created->format('U'))->diffForHumans(); ?>
|
||||
</div>
|
||||
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<?php if ($claim->ClaimType == 2): ?>
|
||||
<div class="label half-width">Content Type</div>
|
||||
<div class="label half-width">Language</div>
|
||||
|
||||
<div class="value half-width" title="<?php echo $claim->ContentType ?>"><?php echo $claim->ContentType ?></div>
|
||||
<div class="value half-width" title="<?php echo $claim->Language == 'en' ? 'English' : $claim->Language ?>"><?php echo $claim->Language == 'en' ? 'English' : $claim->Language ?></div>
|
||||
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<div class="label half-width">Author</div>
|
||||
<div class="label half-width">License</div>
|
||||
|
||||
<div class="value half-width" title="<?php echo strlen(trim($claim->Author)) > 0 ? $claim->Author : '<em>Unspecified</em>' ?>"><?php echo strlen(trim($claim->Author)) > 0 ? $claim->Author : '<em>Unspecified</em>' ?></div>
|
||||
<div class="value half-width" title="<?php echo strlen(trim($claim->License)) > 0 ? $claim->License : '' ?>">
|
||||
<?php if (strlen(trim($claim->LicenseUrl)) > 0): ?><a href="<?php echo $claim->LicenseUrl ?>" rel="nofollow" target="_blank"><?php endif; ?>
|
||||
<?php echo strlen(trim($claim->License)) > 0 ? $claim->License : '<em>Unspecified</em>' ?>
|
||||
<?php if (strlen(trim($claim->LicenseUrl))): ?></a><?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php $idx++; endforeach; ?>
|
||||
|
||||
echo $this->element('claimbox', array('claim' => $claim, 'idx' => $idx, 'last_row' => $last_row));
|
||||
$idx++;
|
||||
endforeach; ?>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -252,78 +185,9 @@ if (strlen(trim($desc)) == 0) {
|
||||
if ($idx % 3 == 0) {
|
||||
$row++;
|
||||
}
|
||||
$autoThumbText = $claim->getAutoThumbText();
|
||||
$cost = '';
|
||||
if (isset($claim->Price) && $claim->Price > 0) {
|
||||
$cost = $this->Amount->formatCurrency($claim->Price) . ' LBC';
|
||||
} else if (isset($claim->Fee) && strtolower($claim->FeeCurrency) === 'lbc') {
|
||||
$cost = $this->Amount->formatCurrency($claim->Fee) . ' LBC';
|
||||
}
|
||||
|
||||
// content type
|
||||
$ctTag = $claim->getContentTag();
|
||||
?>
|
||||
<div data-id="<?php echo $claim->ClaimId ?>" class="claim-grid-item<?php if ($idx % 3 == 0): ?> last-item<?php endif; ?><?php if ($last_row): ?> last-row<?php endif; ?>">
|
||||
<?php if (strlen(trim($cost)) > 0): ?>
|
||||
<div class="price-tag"><?php echo $cost ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="tags">
|
||||
<?php if ($ctTag): ?>
|
||||
<div class="content-type"><?php echo strtoupper($ctTag) ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($claim->IsNSFW): ?>
|
||||
<div class="nsfw">NSFW</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
||||
<?php if (!$claim->IsNSFW && strlen(trim($claim->ThumbnailUrl)) > 0): ?>
|
||||
<img src="<?php echo htmlspecialchars($claim->ThumbnailUrl) ?>" alt="" />
|
||||
<?php else: ?>
|
||||
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="metadata">
|
||||
<div class="title" title="<?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '') ?>"><?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '<em>No Title</em>') ?></div>
|
||||
<div class="link" title="<?php echo $claim->getLbryLink() ?>"><a href="<?php echo $claim->getLbryLink() ?>" rel="nofollow"><?php echo $claim->getLbryLink() ?></a></div>
|
||||
|
||||
<div class="desc"><?php echo strlen(trim($claim->Description)) > 0 ? $claim->Description : '<em>No description available</em>' ?></div>
|
||||
|
||||
<div class="label half-width">Transaction</div>
|
||||
<div class="label half-width">Created</div>
|
||||
|
||||
<div class="value half-width"><a href="/tx/<?php echo $claim->TransactionHash ?>#output-<?php echo $claim->Vout ?>" title="<?php echo $claim->TransactionHash ?>"><?php echo $claim->TransactionHash ?></a></div>
|
||||
<div class="value half-width" title="<?php echo $claim->Created->format('j M Y H:i:s') ?> UTC">
|
||||
<?php echo \Carbon\Carbon::createFromTimestamp($claim->TransactionTime > 0 ? $claim->TransactionTime : $claim->Created->format('U'))->diffForHumans(); ?>
|
||||
</div>
|
||||
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<?php if ($claim->ClaimType == 2): ?>
|
||||
<div class="label half-width">Content Type</div>
|
||||
<div class="label half-width">Language</div>
|
||||
|
||||
<div class="value half-width" title="<?php echo $claim->ContentType ?>"><?php echo $claim->ContentType ?></div>
|
||||
<div class="value half-width" title="<?php echo $claim->Language == 'en' ? 'English' : $claim->Language ?>"><?php echo $claim->Language == 'en' ? 'English' : $claim->Language ?></div>
|
||||
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<div class="label half-width">Author</div>
|
||||
<div class="label half-width">License</div>
|
||||
|
||||
<div class="value half-width" title="<?php echo strlen(trim($claim->Author)) > 0 ? $claim->Author : '<em>Unspecified</em>' ?>"><?php echo strlen(trim($claim->Author)) > 0 ? $claim->Author : '<em>Unspecified</em>' ?></div>
|
||||
<div class="value half-width" title="<?php echo strlen(trim($claim->License)) > 0 ? $claim->License : '' ?>">
|
||||
<?php if (strlen(trim($claim->LicenseUrl)) > 0): ?><a href="<?php echo $claim->LicenseUrl ?>" rel="nofollow" target="_blank"><?php endif; ?>
|
||||
<?php echo strlen(trim($claim->License)) > 0 ? $claim->License : '<em>Unspecified</em>' ?>
|
||||
<?php if (strlen(trim($claim->LicenseUrl))): ?></a><?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php $idx++; endforeach; ?>
|
||||
|
||||
echo $this->element('claimbox', array('claim' => $claim, 'idx' => $idx, 'last_row' => $last_row));
|
||||
$idx++;
|
||||
endforeach; ?>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -54,77 +54,9 @@
|
||||
if ($idx % 3 == 0) {
|
||||
$row++;
|
||||
}
|
||||
$autoThumbText = $claim->getAutoThumbText();
|
||||
$cost = '';
|
||||
if (isset($claim->Price) && $claim->Price > 0) {
|
||||
$cost = $this->Amount->formatCurrency($claim->Price) . ' LBC';
|
||||
} else if (isset($claim->Fee) && strtolower($claim->FeeCurrency) === 'lbc') {
|
||||
$cost = $this->Amount->formatCurrency($claim->Fee) . ' LBC';
|
||||
}
|
||||
|
||||
// content type
|
||||
$ctTag = $claim->getContentTag();
|
||||
?>
|
||||
<div data-id="<?php echo $claim->ClaimId ?>" class="claim-grid-item<?php if ($idx % 3 == 0): ?> last-item<?php endif; ?><?php if ($last_row): ?> last-row<?php endif; ?>">
|
||||
<?php if (strlen(trim($cost)) > 0): ?>
|
||||
<div class="price-tag"><?php echo $cost ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="tags">
|
||||
<?php if ($ctTag): ?>
|
||||
<div class="content-type"><?php echo strtoupper($ctTag) ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($claim->IsNSFW): ?>
|
||||
<div class="nsfw">NSFW</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
||||
<?php if (!$claim->IsNSFW && strlen(trim($claim->ThumbnailUrl)) > 0): ?>
|
||||
<img src="<?php echo htmlspecialchars($claim->ThumbnailUrl) ?>" alt="" />
|
||||
<?php else: ?>
|
||||
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="metadata">
|
||||
<div class="title" title="<?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '') ?>"><?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '<em>No Title</em>') ?></div>
|
||||
<div class="link" title="<?php echo $claim->getLbryLink() ?>"><a href="<?php echo $claim->getLbryLink() ?>" rel="nofollow"><?php echo $claim->getLbryLink() ?></a></div>
|
||||
|
||||
<div class="desc"><?php echo strlen(trim($claim->Description)) > 0 ? $claim->Description : '<em>No description available</em>' ?></div>
|
||||
|
||||
<div class="label half-width">Transaction</div>
|
||||
<div class="label half-width">Created</div>
|
||||
|
||||
<div class="value half-width"><a href="/tx/<?php echo $claim->TransactionHash ?>#output-<?php echo $claim->Vout ?>" title="<?php echo $claim->TransactionHash ?>"><?php echo $claim->TransactionHash ?></a></div>
|
||||
<div class="value half-width" title="<?php echo $claim->Created->format('j M Y H:i:s') ?> UTC">
|
||||
<?php echo \Carbon\Carbon::createFromTimestamp($claim->Created->format('U'))->diffForHumans(); ?>
|
||||
</div>
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<?php if ($claim->ClaimType == 2): ?>
|
||||
<div class="label half-width">Content Type</div>
|
||||
<div class="label half-width">Language</div>
|
||||
|
||||
<div class="value half-width" title="<?php echo $claim->ContentType ?>"><?php echo $claim->ContentType ?></div>
|
||||
<div class="value half-width" title="<?php echo $claim->Language == 'en' ? 'English' : $claim->Language ?>"><?php echo $claim->Language == 'en' ? 'English' : $claim->Language ?></div>
|
||||
|
||||
<div class="clear spacer"></div>
|
||||
|
||||
<div class="label half-width">Author</div>
|
||||
<div class="label half-width">License</div>
|
||||
|
||||
<div class="value half-width" title="<?php echo strlen(trim($claim->Author)) > 0 ? $claim->Author : '<em>Unspecified</em>' ?>"><?php echo strlen(trim($claim->Author)) > 0 ? $claim->Author : '<em>Unspecified</em>' ?></div>
|
||||
<div class="value half-width" title="<?php echo strlen(trim($claim->License)) > 0 ? $claim->License : '' ?>">
|
||||
<?php if (strlen(trim($claim->LicenseUrl)) > 0): ?><a href="<?php echo $claim->LicenseUrl ?>" rel="nofollow" target="_blank"><?php endif; ?>
|
||||
<?php echo strlen(trim($claim->License)) > 0 ? $claim->License : '<em>Unspecified</em>' ?>
|
||||
<?php if (strlen(trim($claim->LicenseUrl))): ?></a><?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php $idx++; endforeach; ?>
|
||||
|
||||
echo $this->element('claimbox', array('claim' => $claim, 'idx' => $idx, 'last_row' => $last_row));
|
||||
$idx++;
|
||||
endforeach; ?>
|
||||
<?php else: ?>
|
||||
<div class="no-results">No results were found.</div>
|
||||
<?php endif; ?>
|
||||
|
||||
+21
-28
@@ -113,7 +113,7 @@
|
||||
<div class="home-container">
|
||||
<div class="home-container-cell">
|
||||
<div class="main">
|
||||
<div class="title">LBRY Block Explorer</div><br/>
|
||||
<div class="title">LBRY Block Explorer</div><br>
|
||||
<form method="get" action="/find">
|
||||
<input class="search-input" name="q" type="text" placeholder="Enter a block height or hash, claim id or name, transaction hash or address" />
|
||||
<div class="ctls">
|
||||
@@ -129,12 +129,12 @@
|
||||
<div class="stats">
|
||||
<div class="box box-20">
|
||||
<div class="title">Block Height</div>
|
||||
<div class="value"><?php echo $recentBlocks[0]->Height ?></div>
|
||||
<div class="value"><?php echo $recentBlocks[0]->height ?></div>
|
||||
</div>
|
||||
|
||||
<div class="box box-30">
|
||||
<div class="title">Difficulty</div>
|
||||
<div class="value" title="<?php echo $recentBlocks[0]->Difficulty ?>"><?php echo number_format($recentBlocks[0]->Difficulty, 2, '.', '') ?></div>
|
||||
<div class="value" title="<?php echo $recentBlocks[0]->difficulty ?>"><?php echo number_format($recentBlocks[0]->difficulty, 2, '.', '') ?></div>
|
||||
</div>
|
||||
|
||||
<div class="box box-30">
|
||||
@@ -167,13 +167,13 @@
|
||||
|
||||
<tbody>
|
||||
<?php foreach ($recentBlocks as $block): ?>
|
||||
<tr data-height="<?php echo $block->Height ?>" data-time="<?php echo $block->BlockTime ?>">
|
||||
<td><a href="/blocks/<?php echo $block->Height ?>"><?php echo $block->Height ?></a></td>
|
||||
<td><?php echo \Carbon\Carbon::createFromTimestamp($block->BlockTime)->diffForHumans(); ?></td>
|
||||
<td class="right"><?php echo round($block->BlockSize / 1024, 2) . 'KB' ?></td>
|
||||
<td class="right"><?php echo $block->TransactionCount ?></td>
|
||||
<td class="right"><?php echo number_format($block->Difficulty, 2, '.', '') ?></td>
|
||||
<td class="last-cell"><?php echo DateTime::createFromFormat('U', $block->BlockTime)->format('d M Y H:i:s') . ' UTC' ?></td>
|
||||
<tr data-height="<?php echo $block->height ?>" data-time="<?php echo $block->block_time ?>">
|
||||
<td><a href="/blocks/<?php echo $block->height ?>"><?php echo $block->height ?></a></td>
|
||||
<td><?php echo \Carbon\Carbon::createFromTimestamp($block->block_time)->diffForHumans(); ?></td>
|
||||
<td class="right"><?php echo round($block->block_size / 1024, 2) . 'KB' ?></td>
|
||||
<td class="right"><?php echo $block->transaction_count ?></td>
|
||||
<td class="right"><?php echo number_format($block->difficulty, 2, '.', '') ?></td>
|
||||
<td class="last-cell"><?php echo DateTime::createFromFormat('U', $block->block_time)->format('d M Y H:i:s') . ' UTC' ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
@@ -183,50 +183,43 @@
|
||||
<div class="recent-claims">
|
||||
<h3>Recent Claims</h3>
|
||||
<a class="claim-explorer-link" href="/claims">Claims Explorer</a>
|
||||
<?php $idx = 0; $a = ['purple', 'orange', 'blue', 'teal', 'green', 'yellow']; foreach ($recentClaims as $claim):
|
||||
<?php $idx = 0; $a = ['purple', 'orange', 'blue', 'teal', 'green', 'yellow'];
|
||||
foreach ($recentClaims as $claim):
|
||||
$idx++;
|
||||
$autoThumbText = $claim->getAutoThumbText();
|
||||
$link = $claim->Name;
|
||||
$rawLink = $claim->Name;
|
||||
if (isset($claim->Publisher->Name)) {
|
||||
$link = urlencode($claim->Publisher->Name) . '/' . $link;
|
||||
$rawLink = $claim->Publisher->Name . '/' . $link;
|
||||
}
|
||||
$link = 'lbry://' . $link;
|
||||
$rawLink = 'lbry://' . $rawLink;
|
||||
|
||||
// content type
|
||||
$ctTag = $claim->getContentTag();
|
||||
?>
|
||||
<div data-id="<?php echo $claim->ClaimId ?>" class="claim-box<?php if ($idx == 5): ?> last<?php endif; ?>">
|
||||
<div data-id="<?php echo $claim->claim_id ?>" class="claim-box<?php if ($idx == 5): ?> last<?php endif; ?>">
|
||||
<div class="tags">
|
||||
<?php if ($ctTag): ?>
|
||||
<div class="content-type"><?php echo strtoupper($ctTag) ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($claim->IsNSFW): ?>
|
||||
<?php if ($claim->is_nsfw): ?>
|
||||
<div class="nsfw">NSFW</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
|
||||
<?php if (!$claim->IsNSFW && strlen(trim($claim->ThumbnailUrl)) > 0): ?>
|
||||
<img src="<?php echo strip_tags($claim->ThumbnailUrl) ?>" alt="" />
|
||||
<?php if (!$claim->is_nsfw && strlen(trim($claim->thumbnail_url)) > 0): ?>
|
||||
<img src="<?php echo strip_tags($claim->thumbnail_url) ?>" alt="" />
|
||||
<?php else: ?>
|
||||
<div class="autothumb"><?php echo $autoThumbText ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="metadata">
|
||||
<div class="title" title="<?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : ''); ?>"><?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '<em>No Title</em>') ?></div>
|
||||
<div class="link" title="<?php echo $rawLink ?>"><a href="<?php echo $link ?>"><?php echo $rawLink ?></a></div>
|
||||
<div class="title" title="<?php echo $claim->claim_type == 1 ? $claim->name : ((strlen(trim($claim->title)) > 0) ? $claim->title : ''); ?>"><?php echo $claim->claim_type == 1 ? $claim->name : ((strlen(trim($claim->title)) > 0) ? $claim->title : '<em>No Title</em>') ?></div>
|
||||
<div class="link" title="<?php echo $claim->getLbryLink() ?>"><a href="<?php echo $claim->getLbryLink() ?>"><?php echo $claim->getLbryLink() ?></a></div>
|
||||
|
||||
<div class="clear"></div>
|
||||
<?php if ($claim->ClaimType == 2 && strlen(trim($claim->Description)) > 0): ?>
|
||||
<div class="desc"><?php echo $claim->Description ?></div>
|
||||
<?php if ($claim->claim_type == 2 && strlen(trim($claim->description)) > 0): ?>
|
||||
<div class="desc"><?php echo $claim->description ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<a class="tx-link" href="/tx/<?php echo $claim->TransactionHash ?>#output-<?php echo $claim->Vout ?>" target="_blank">Transaction</a>
|
||||
<a class="tx-link" href="/tx/<?php echo $claim->transaction_hash_id ?>#output-<?php echo $claim->vout ?>" target="_blank">Transaction</a>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
@@ -128,10 +128,10 @@
|
||||
|
||||
<tbody>
|
||||
<?php foreach ($blocks as $block): ?>
|
||||
<tr data-height="<?php echo $block->Height ?>" data-time="<?php echo $block->BlockTime ?>">
|
||||
<td><a href="/blocks/<?php echo $block->Height ?>" target="_blank"><?php echo $block->Height ?></a></td>
|
||||
<td><?php echo \Carbon\Carbon::createFromTimestamp($block->BlockTime)->diffForHumans(); ?></td>
|
||||
<td class="right"><?php echo $block->TransactionCount ?></td>
|
||||
<tr data-height="<?php echo $block->height ?>" data-time="<?php echo $block->block_time ?>">
|
||||
<td><a href="/blocks/<?php echo $block->height ?>" target="_blank"><?php echo $block->height ?></a></td>
|
||||
<td><?php echo \Carbon\Carbon::createFromTimestamp($block->block_time)->diffForHumans(); ?></td>
|
||||
<td class="right"><?php echo $block->transaction_count ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
@@ -153,12 +153,12 @@
|
||||
|
||||
<tbody>
|
||||
<?php foreach ($txs as $tx): ?>
|
||||
<tr data-hash="<?php echo $tx->Hash ?>" data-time="<?php echo $tx->TxTime ?>">
|
||||
<td class="w200"><div><a href="/tx/<?php echo $tx->Hash ?>" target="_blank"><?php echo $tx->Hash ?></a></div></td>
|
||||
<td><?php echo \Carbon\Carbon::createFromTimestamp($tx->TxTime)->diffForHumans(); ?></td>
|
||||
<td class="right"><?php echo $tx->InputCount ?></td>
|
||||
<td class="right"><?php echo $tx->OutputCount ?></td>
|
||||
<td class="right"><?php echo number_format($tx->Value, 8, '.', '') ?> LBC</td>
|
||||
<tr data-hash="<?php echo $tx->hash ?>" data-time="<?php echo $tx->transaction_time ?>">
|
||||
<td class="w200"><div><a href="/tx/<?php echo $tx->hash ?>" target="_blank"><?php echo $tx->hash ?></a></div></td>
|
||||
<td><?php echo $tx->created_at->diffForHumans(); ?></td>
|
||||
<td class="right"><?php echo $tx->input_count ?></td>
|
||||
<td class="right"><?php echo $tx->output_count ?></td>
|
||||
<td class="right"><?php echo number_format($tx->value, 8, '.', '') ?> LBC</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
<?php $rank = 0; foreach ($richList as $item): $rank++; ?>
|
||||
<tr>
|
||||
<td class="right topvalign"><?php echo $rank ?></td>
|
||||
<td class="topvalign"><a href="/address/<?php echo $item->Address ?>" target="_blank"><?php echo $item->Address ?></a>
|
||||
<?php if(in_array($item->Address, $lbryAddresses)): ?>
|
||||
<td class="topvalign"><a href="/address/<?php echo $item->address ?>" target="_blank"><?php echo $item->address ?></a>
|
||||
<?php if(in_array($item->address, $lbryAddresses)): ?>
|
||||
<span class="lbry-address">
|
||||
<img src="/img/lbry.png" height="18px" width="18px" title="Address owned by LBRY Inc."/>
|
||||
</span>
|
||||
@@ -58,16 +58,14 @@
|
||||
<?php if (strlen(trim($item->TagUrl)) > 0): ?><a href="<?php echo $item->TagUrl ?>" target="_blank" rel="nofollow"><?php echo $tiem->Tag ?></a><?php else: echo $item->Tag; endif; ?>
|
||||
</div>
|
||||
<?php endif; ?></td>
|
||||
<td class="right topvalign"><?php echo number_format($item->Balance, 8, '.', ',') ?></td>
|
||||
<td class="right topvalign">$<?php echo number_format(bcmul($item->Balance, $rate, 8), 2, '.', ',') ?></td>
|
||||
<td class="med-pad-left topvalign"><?php echo $item->FirstSeen->format('d M Y H:i:s') . ' UTC'; ?></td>
|
||||
<td class="right topvalign"><?php echo number_format($item->balance, 8, '.', ',') ?></td>
|
||||
<td class="right topvalign">$<?php echo number_format(bcmul($item->balance, $rate, 8), 2, '.', ',') ?></td>
|
||||
<td class="med-pad-left topvalign"><?php echo $item->first_seen->format('d M Y H:i:s') . ' UTC'; ?></td>
|
||||
<td class="w150 center top500-percent-cell"><div class="top500-percent" style="width: <?php echo $item->MinMaxPercent ?>%"></div><div class="text"><?php echo number_format($item->Top500Percent, 5, '.', '') ?>%</div></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
</div>
|
||||
+34
-33
@@ -14,22 +14,22 @@
|
||||
|
||||
<div class="tx-head">
|
||||
<h3>LBRY Transaction</h3>
|
||||
<h4><?php echo $tx->Hash ?></h4>
|
||||
<h4><?php echo $tx->hash ?></h4>
|
||||
</div>
|
||||
|
||||
<div class="tx-time">
|
||||
<div class="created-time">
|
||||
<h3 title="Represents the time this transaction was created on the explorer">Time Created</h3>
|
||||
<div><?php echo $tx->Created->format('j M Y H:i:s') . ' UTC '; ?></div>
|
||||
<div><?php echo $tx->created_at->format('j M Y H:i:s') . ' UTC '; ?></div>
|
||||
</div>
|
||||
|
||||
<div class="conf-time">
|
||||
<h3 title="The time the first confirmation of this transaction happened on the blockchain">Block Time</h3>
|
||||
<div><?php echo ($tx->TransactionTime == null || strlen(trim($tx->TransactionTime)) == 0) ? '<em>Not yet confirmed</em>' :
|
||||
\DateTime::createFromFormat('U', $tx->TransactionTime)->format('j M Y H:i:s') . ' UTC' ?>
|
||||
<div><?php echo ($tx->transaction_time == null || strlen(trim($tx->transaction_time)) == 0) ? '<em>Not yet confirmed</em>' :
|
||||
\DateTime::createFromFormat('U', $tx->transaction_time)->format('j M Y H:i:s') . ' UTC' ?>
|
||||
|
||||
<?php if ($tx->TransactionTime > $tx->Created->getTimestamp()):
|
||||
$diffSeconds = $tx->TransactionTime - $tx->Created->getTimestamp();
|
||||
<?php if ($tx->transaction_time > $tx->created_at->getTimestamp()):
|
||||
$diffSeconds = $tx->transaction_time - $tx->created_at->getTimestamp();
|
||||
if ($diffSeconds <= 60) {
|
||||
echo sprintf(' (+%s second%s)', $diffSeconds, $diffSeconds == 1 ? '' : 's');
|
||||
} else {
|
||||
@@ -47,15 +47,15 @@
|
||||
<div class="tx-summary">
|
||||
<div class="box p25">
|
||||
<div class="title">Amount (LBC)</div>
|
||||
<div class="value"><?php echo $this->Amount->format($tx->Value) ?></div>
|
||||
<div class="value"><?php echo $this->Amount->format($tx->value) ?></div>
|
||||
</div>
|
||||
|
||||
<div class="box p15">
|
||||
<div class="title">Block Height</div>
|
||||
<?php if (!isset($tx->BlockHash) || strlen(trim($tx->BlockHash)) === 0): ?>
|
||||
<?php if (!isset($tx->block_hash_id) || strlen(trim($tx->block_hash_id)) === 0): ?>
|
||||
<div class="value" title="Unconfirmed">Unconf.</div>
|
||||
<?php else: ?>
|
||||
<div class="value" title="<?php echo $tx->BlockHash ?>"><a href="/blocks/<?php echo $block->Height ?>"><?php echo $block->Height ?></a></div>
|
||||
<div class="value" title="<?php echo $tx->block_hash_id ?>"><a href="/blocks/<?php echo $block->height ?>"><?php echo $block->height ?></a></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
@@ -66,17 +66,17 @@
|
||||
|
||||
<div class="box p15">
|
||||
<div class="title">Size (bytes)</div>
|
||||
<div class="value"><?php echo number_format($tx->TransactionSize, 0, '', ',') ?></div>
|
||||
<div class="value"><?php echo number_format($tx->transaction_size, 0, '', ',') ?></div>
|
||||
</div>
|
||||
|
||||
<div class="box p15">
|
||||
<div class="title">Inputs</div>
|
||||
<div class="value"><?php echo $tx->InputCount ?></div>
|
||||
<div class="value"><?php echo $tx->input_count ?></div>
|
||||
</div>
|
||||
|
||||
<div class="box p15 last">
|
||||
<div class="title">Outputs</div>
|
||||
<div class="value"><?php echo $tx->OutputCount ?></div>
|
||||
<div class="value"><?php echo $tx->output_count ?></div>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
@@ -86,28 +86,29 @@
|
||||
<h3>Details</h3>
|
||||
<div class="tx-details-layout">
|
||||
<div class="inputs">
|
||||
<div class="subtitle"><?php echo $tx->InputCount ?> input<?php echo $tx->InputCount === 1 ? '' : 's'; ?></div>
|
||||
<div class="subtitle"><?php echo $tx->input_count ?> input<?php echo $tx->input_count === 1 ? '' : 's'; ?></div>
|
||||
|
||||
<?php
|
||||
$setAddressIds = [];
|
||||
foreach ($inputs as $in):
|
||||
?>
|
||||
<div id="input-<?php echo $in->Id ?>" class="input <?php if (isset($in['InputAddresses']) && count($in['InputAddresses']) > 0 && $in->inputAddresses[0]->Address == $sourceAddress): ?>is-source<?php endif; ?>">
|
||||
<?php if ($in['IsCoinbase']): ?>
|
||||
<div id="input-<?php echo $in->id ?>" class="input <?php if (isset($in->input_addresses) && count($in->input_addresses) > 0 && $in->input_addresses[0]->address == $sourceAddress): ?>is-source<?php endif; ?>">
|
||||
<?php if ($in->is_coinbase): ?>
|
||||
<div>Block Reward (New Coins)</div>
|
||||
<?php else: ?>
|
||||
<?php if (strlen(trim($in->Value)) == 0): ?>
|
||||
<?php if (strlen(trim($in->value)) == 0): ?>
|
||||
<div>Incomplete data</div>
|
||||
<?php else:
|
||||
$addr = $in->inputAddresses[0];
|
||||
$addr = $in->input_addresses[0];
|
||||
|
||||
if (!isset($setAddressIds[$addr->Address])):
|
||||
$setAddressIds[$addr->Address] = 1; ?>
|
||||
<a id="<?php echo $addr->Address ?>"></a>
|
||||
if (!isset($setAddressIds[$addr->address])):
|
||||
$setAddressIds[$addr->address] = 1; ?>
|
||||
<a id="<?php echo $addr->address ?>"></a>
|
||||
<?php endif; ?>
|
||||
<div><span class="value"><?php echo $this->Amount->format($in['Value']) ?> LBC</span> from</div>
|
||||
<div class="address"><a href="/address/<?php echo $addr->Address ?>"><?php echo $addr->Address ?></a>
|
||||
(<a class="output-link" href="/tx/<?php echo $in->PrevoutHash ?>#output-<?php echo $in->PrevoutN ?>">output</a>)
|
||||
<div><span class="value"><?php echo $this->Amount->format($in->value) ?> LBC</span> from</div>
|
||||
<div class="address"><a href="/address/<?php echo $addr->address ?>"><?php echo $addr->address ?></a>
|
||||
(<a class="output-link" href="/tx/<?php echo $in->prevout_hash ?>#output-<?php echo $in->prevout_n ?>">output</a>)
|
||||
|
||||
<?php if (isset($addr->Tag) && strlen(trim($addr->Tag)) > 0): ?>
|
||||
<div class="tag">
|
||||
<?php if (strlen(trim($addr->TagUrl)) > 0): ?><a href="<?php echo $addr->TagUrl ?>" target="_blank" rel="nofollow"><?php echo $addr->Tag ?></a><?php else: echo $addr->Tag; endif; ?>
|
||||
@@ -125,7 +126,7 @@
|
||||
</div>
|
||||
|
||||
<div class="outputs">
|
||||
<div class="subtitle"><?php echo $tx->OutputCount ?> output<?php echo $tx->OutputCount === 1 ? '' : 's'; ?>
|
||||
<div class="subtitle"><?php echo $tx->output_count ?> output<?php echo $tx->output_count === 1 ? '' : 's'; ?>
|
||||
|
||||
<?php if ($fee > 0): ?>
|
||||
<span class="fee"><span class="label">Fee</span> <span class="value"><?php echo $this->Amount->format($fee) ?> LBC</span></span>
|
||||
@@ -134,7 +135,7 @@
|
||||
|
||||
<?php
|
||||
foreach ($outputs as $out): ?>
|
||||
<div id="output-<?php echo $out->Vout ?>" class="output <?php if (isset($out['OutputAddresses']) && count($out['OutputAddresses']) > 0 && $out->outputAddresses[0]->Address == $sourceAddress): ?>is-source<?php endif; ?>">
|
||||
<div id="output-<?php echo $out->vout ?>" class="output <?php if (isset($out->output_addresses) && count($out->output_addresses) > 0 && $out->output_addresses[0]->address == $sourceAddress): ?>is-source<?php endif; ?>">
|
||||
<div class="labels">
|
||||
<?php if($out->Claim && ($out->IsClaim or $out->IsSupportClaim or $out->IsUpdateClaim)): ?><a class="view-claim" href="<?php echo $out->Claim->getExplorerLink() ?>">View</a><?php endif; ?>
|
||||
<?php if($out->IsSupportClaim): ?><div class="support">SUPPORT</div><?php endif; ?>
|
||||
@@ -142,19 +143,19 @@
|
||||
<?php if($out->IsClaim): ?><div class="claim">CLAIM</div><?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php if (strlen(trim($out['Value'])) == 0): ?>
|
||||
<?php if (strlen(trim($out->value)) == 0): ?>
|
||||
<div>Incomplete data</div>
|
||||
<?php else:
|
||||
$addr = $out->outputAddresses[0];
|
||||
$addr = $out->output_addresses[0];
|
||||
|
||||
if (!isset($setAddressIds[$addr->Address])):
|
||||
$setAddressIds[$addr->Address] = 1; ?>
|
||||
<a id="<?php echo $addr->Address ?>"></a>
|
||||
if (!isset($setAddressIds[$addr->address])):
|
||||
$setAddressIds[$addr->address] = 1; ?>
|
||||
<a id="<?php echo $addr->address ?>"></a>
|
||||
<?php endif; ?>
|
||||
<div><span class="value"><?php echo $this->Amount->format($out['Value']) ?> LBC</span> to</div>
|
||||
<div class="address"><a href="/address/<?php echo $addr->Address ?>"><?php echo $addr->Address ?></a>
|
||||
<div><span class="value"><?php echo $this->Amount->format($out->value) ?> LBC</span> to</div>
|
||||
<div class="address"><a href="/address/<?php echo $addr->address ?>"><?php echo $addr->address ?></a>
|
||||
|
||||
<?php if ($out->IsSpent): ?>(<a href="/tx/<?php echo $out->SpendInput->TransactionHash ?>#input-<?php echo $out->SpendInput->Id ?>">spent</a>)<?php else: ?>(unspent)<?php endif; ?>
|
||||
<?php if ($out->is_spent): ?>(<a href="/tx/<?php if(isset($out->spend_input_id)) { echo $out->spend_input_hash; } ?>#input-<?php if(isset($out->spend_input_id)) {echo $out->spend_input_id; } ?>">spent</a>)<?php else: ?>(unspent)<?php endif; ?>
|
||||
|
||||
<?php if (isset($addr->Tag) && strlen(trim($addr->Tag)) > 0): ?>
|
||||
<div class="tag">
|
||||
|
||||
@@ -59,8 +59,8 @@ $cakeDescription = 'CakePHP: the rapid development PHP framework';
|
||||
<div id="url-rewriting-warning" class="alert url-rewriting">
|
||||
<ul>
|
||||
<li class="bullet problem">
|
||||
URL rewriting is not properly configured on your server.<br/>
|
||||
1) <a target="_blank" href="http://book.cakephp.org/3.0/en/installation.html#url-rewriting">Help me configure it</a><br/>
|
||||
URL rewriting is not properly configured on your server.<br />
|
||||
1) <a target="_blank" href="http://book.cakephp.org/3.0/en/installation.html#url-rewriting">Help me configure it</a><br />
|
||||
2) <a target="_blank" href="http://book.cakephp.org/3.0/en/development/configuration.html#general-configuration">I don't / can't use URL rewriting</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -139,7 +139,7 @@ $cakeDescription = 'CakePHP: the rapid development PHP framework';
|
||||
if (method_exists($connectionError, 'getAttributes')):
|
||||
$attributes = $connectionError->getAttributes();
|
||||
if (isset($errorMsg['message'])):
|
||||
$errorMsg .= '<br/>' . $attributes['message'];
|
||||
$errorMsg .= '<br />' . $attributes['message'];
|
||||
endif;
|
||||
endif;
|
||||
}
|
||||
@@ -148,7 +148,7 @@ $cakeDescription = 'CakePHP: the rapid development PHP framework';
|
||||
<?php if ($connected): ?>
|
||||
<li class="bullet success">CakePHP is able to connect to the database.</li>
|
||||
<?php else: ?>
|
||||
<li class="bullet problem">CakePHP is NOT able to connect to the database.<br/><?= $errorMsg ?></li>
|
||||
<li class="bullet problem">CakePHP is NOT able to connect to the database.<br /><?= $errorMsg ?></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -188,7 +188,7 @@ $cakeDescription = 'CakePHP: the rapid development PHP framework';
|
||||
<div class="columns large-12 text-center">
|
||||
<h3 class="more">More about Cake</h3>
|
||||
<p>
|
||||
CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Front Controller and MVC.<br/>
|
||||
CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Front Controller and MVC.<br />
|
||||
Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
namespace App\View;
|
||||
|
||||
use Cake\Event\EventManager;
|
||||
use Cake\Network\Request;
|
||||
use Cake\Http\ServerRequest;
|
||||
use Cake\Network\Response;
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
.bids-chart-container { width: 1200px; margin: 0 auto 48px auto; box-shadow: 0 2px 6px rgba(0,0,0,.175); border: 1px solid rgba(0,0,0,.15); padding: 24px 36px; position: relative; overflow: hidden }
|
||||
.bids-chart-container .load-progress { position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: #1e88e5; animation: indeterminate 4s linear infinite; }
|
||||
.bids-chart-container .chart { height: 414px }
|
||||
.bids-chart-container .btn-chart-export { position: absolute; right: 40px; bottom: 36px }
|
||||
@keyframes indeterminate {
|
||||
from { left: -70%; }
|
||||
to { left: 100% }
|
||||
}
|
||||
@@ -81,6 +81,7 @@ border-radius: 0 8px 8px 0 }
|
||||
.claims-grid .claim-grid-item .thumbnail .autothumb { display: block; margin: 73px auto 0 auto; text-align: center; font-size: 240%; color: #fff; line-height: 54px }
|
||||
.claims-grid .claim-grid-item .tags > div { display: inline-block; padding: 4px 12px; margin-left: 2px }
|
||||
.claims-grid .claim-grid-item .tags .nsfw { background: #e53935; text-align: center; color: #fff; position: relative; left: 1px }
|
||||
.claims-grid .claim-grid-item .tags .bid-state { background: #551CA1; text-align: center; color: #fff; }
|
||||
.claims-grid .claim-grid-item .tags .content-type { background: #880e4f; text-align: center; color: #fff; }
|
||||
.claims-grid .claim-grid-item .metadata { padding: 24px; font-size: 90% }
|
||||
.claims-grid .claim-grid-item .title { font-size: 120%; height: 25px; line-height: 25px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
function buildChartData(claimsData) {
|
||||
var chartData = [];
|
||||
var lastDate = 0;
|
||||
var nbClaimsDay = 0;
|
||||
var nbClaimsTotal = 0;
|
||||
var bidClaimsDay = 0;
|
||||
var bidClaimsTotal = 0;
|
||||
var nbChannelsDay = 0;
|
||||
var nbChannelsTotal = 0;
|
||||
for(var i = 0; i < claimsData.length; i++) {
|
||||
if(claimsData[i].transaction_time == 0) {
|
||||
continue;
|
||||
}
|
||||
var transactionDate = new Date(claimsData[i].transaction_time * 1000);
|
||||
transactionDate.setHours(0,0,0,0)
|
||||
if(lastDate == 0) {
|
||||
lastDate = transactionDate;
|
||||
}
|
||||
if(transactionDate.toString() != lastDate.toString()) {
|
||||
nbClaimsTotal += nbClaimsDay;
|
||||
bidClaimsTotal += bidClaimsDay;
|
||||
var dateData = {
|
||||
date: lastDate,
|
||||
NumberClaims: nbClaimsTotal,
|
||||
BidsClaims: bidClaimsTotal,
|
||||
};
|
||||
chartData.push(dateData);
|
||||
nbClaimsDay = 0;
|
||||
bidClaimsDay = 0;
|
||||
lastDate = transactionDate;
|
||||
}
|
||||
if(claimsData[i].claim_type == 1) {
|
||||
nbClaimsDay += 1;
|
||||
bidClaimsDay += claimsData[i].effective_amount/100000000;
|
||||
}
|
||||
}
|
||||
return chartData;
|
||||
}
|
||||
|
||||
function loadChartData() {
|
||||
var api_url = "https://chainquery.lbry.io/api/sql?query=";
|
||||
var query = "SELECT c1.claim_type, c1.bid_state, c1.effective_amount, c1.transaction_time, o.transaction_time AS 'spent_time' FROM claim c1 LEFT JOIN (SELECT output.claim_id, tx.transaction_time FROM output INNER JOIN input ON input.prevout_hash = output.transaction_hash AND input.prevout_n = output.vout INNER JOIN transaction tx ON tx.id = input.transaction_id) o ON o.claim_id=c1.claim_id AND c1.bid_state='Spent' ORDER BY c1.transaction_time ASC";
|
||||
var url = api_url + query;
|
||||
var loadProgress = $('.bids-chart-container .load-progress');
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'get',
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
chartLoadInProgress = true;
|
||||
loadProgress.css({ display: 'block' });
|
||||
},
|
||||
success: function(response) {
|
||||
if(response.success) {
|
||||
chartData = buildChartData(response.data);
|
||||
if(chart) {
|
||||
chart.dataProvider = chartData;
|
||||
chart.validateNow();
|
||||
chart.validateData();
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.log("Could not fetch block data.");
|
||||
}
|
||||
},
|
||||
complete: function() {
|
||||
chartLoadInProgress = false;
|
||||
loadProgress.css({ display: 'none' });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var chart;
|
||||
var chartData = [];
|
||||
var chartLoadInProgress = false;
|
||||
AmCharts.ready(function() {
|
||||
chart = AmCharts.makeChart('bids-chart', {
|
||||
type: 'serial',
|
||||
theme: 'light',
|
||||
mouseWheelZoomEnabled: true,
|
||||
height: '100%',
|
||||
categoryField: 'date',
|
||||
synchronizeGrid: true,
|
||||
dataProvider: chartData,
|
||||
responsive: {
|
||||
enabled: true,
|
||||
},
|
||||
valueAxes: [
|
||||
{
|
||||
id: 'v-number-claims',
|
||||
axisColor: '#1e88e5',
|
||||
axisThickness: 2,
|
||||
position: 'left',
|
||||
},
|
||||
{
|
||||
id: 'v-bids-claims',
|
||||
axisColor: '#0b7a06',
|
||||
axisThickness: 2,
|
||||
position: 'left',
|
||||
offset: 75,
|
||||
},
|
||||
],
|
||||
categoryAxis: {
|
||||
parseDates: true,
|
||||
autoGridCount: false,
|
||||
minorGridEnabled: true,
|
||||
minorGridAlpha: 0.04,
|
||||
axisColor: '#dadada',
|
||||
twoLineMode: true
|
||||
},
|
||||
graphs: [
|
||||
{
|
||||
id: 'g-number-claims',
|
||||
valueAxis: 'v-number-claims',
|
||||
title: 'Number of claims',
|
||||
valueField: 'NumberClaims',
|
||||
bullet: 'round',
|
||||
bulletBorderThickness: 1,
|
||||
bulletBorderAlpha: 1,
|
||||
bulletColor: '#ffffff',
|
||||
bulletSize: 5,
|
||||
useLineColorForBulletBorder: true,
|
||||
lineColor: '#1e88e5',
|
||||
hideBulletsCount: 101,
|
||||
balloonText: '[[NumberClaims]]',
|
||||
},
|
||||
{
|
||||
id: 'g-bids-claims',
|
||||
valueAxis: 'v-bids-claims',
|
||||
title: 'Bids for claims (LBC)',
|
||||
valueField: 'BidsClaims',
|
||||
bullet: 'round',
|
||||
bulletBorderThickness: 1,
|
||||
bulletBorderAlpha: 1,
|
||||
bulletColor: '#ffffff',
|
||||
bulletSize: 5,
|
||||
useLineColorForBulletBorder: true,
|
||||
lineColor: '#0b7a06',
|
||||
balloonText: '[[BidsClaims]] LBC',
|
||||
hideBulletsCount: 101
|
||||
},
|
||||
],
|
||||
chartCursor: {
|
||||
cursorAlpha: 0.1,
|
||||
fullWidth: true,
|
||||
valueLineBalloonEnabled: true,
|
||||
categoryBalloonColor: '#333333',
|
||||
cursorColor: '#1e88e5'
|
||||
},
|
||||
chartScrollbar: {
|
||||
scrollbarHeight: 36,
|
||||
color: '#888888',
|
||||
gridColor: '#bbbbbb'
|
||||
},
|
||||
legend: {
|
||||
marginLeft: 110,
|
||||
useGraphSettings: true,
|
||||
valueText: "",
|
||||
spacing: 64,
|
||||
|
||||
},
|
||||
export: {
|
||||
enabled: true,
|
||||
fileName: 'lbry-bids-chart',
|
||||
position: 'bottom-right',
|
||||
divId: 'chart-export'
|
||||
}
|
||||
});
|
||||
loadChartData();
|
||||
});
|
||||
@@ -85,7 +85,6 @@ function buildChartData(blockData) {
|
||||
inflationRate = ((supply - lastYearSupply) / lastYearSupply) * 100;
|
||||
if(i % skip == 0) { // Only push 1/<skip> of all blocks to optimize data loading
|
||||
chartData.push({
|
||||
date: new Date(blockTime * 1000),
|
||||
date: new Date(blockTime * 1000),
|
||||
AvailableSupply: supply,
|
||||
RewardLBC: reward,
|
||||
@@ -99,7 +98,7 @@ function buildChartData(blockData) {
|
||||
|
||||
function loadChartData() {
|
||||
var api_url = "https://chainquery.lbry.io/api/sql?query=";
|
||||
var query = "SELECT id, block_time FROM block";
|
||||
var query = "SELECT height, block_time FROM block WHERE confirmations > 0 ORDER BY height";
|
||||
var url = api_url + query;
|
||||
var loadProgress = $('.mining-inflation-chart-container .load-progress');
|
||||
$.ajax({
|
||||
|
||||
Reference in new issue
Block a user