{"id":21685862,"url":"https://github.com/bogny/cryptocurrency","last_synced_at":"2026-01-07T06:53:41.751Z","repository":{"id":56959646,"uuid":"175845058","full_name":"BoGnY/cryptocurrency","owner":"BoGnY","description":"All cryptocurrencies infos in a single package without using a database.","archived":false,"fork":false,"pushed_at":"2019-12-11T09:20:58.000Z","size":542,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-03T23:56:42.482Z","etag":null,"topics":["crypto","crypto-library","cryptocoins","cryptocurrencies","cryptocurrency"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BoGnY.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-15T15:23:15.000Z","updated_at":"2024-07-22T14:04:56.000Z","dependencies_parsed_at":"2022-08-21T09:51:02.714Z","dependency_job_id":null,"html_url":"https://github.com/BoGnY/cryptocurrency","commit_stats":null,"previous_names":["crypto-technology/cryptocurrency"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BoGnY%2Fcryptocurrency","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BoGnY%2Fcryptocurrency/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BoGnY%2Fcryptocurrency/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BoGnY%2Fcryptocurrency/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BoGnY","download_url":"https://codeload.github.com/BoGnY/cryptocurrency/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246162998,"owners_count":20733535,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crypto","crypto-library","cryptocoins","cryptocurrencies","cryptocurrency"],"created_at":"2024-11-25T16:23:26.353Z","updated_at":"2026-01-07T06:53:41.721Z","avatar_url":"https://github.com/BoGnY.png","language":"PHP","readme":"# Cryptocurrency package\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Total Downloads][ico-downloads]][link-downloads]\n[![Build Status][ico-travis]][link-travis]\n[![Last commit][ico-commit]][link-commit]\n[![License][ico-license]][link-license]\n[![Requires PHP7.1][ico-php]][link-php]\n\nAll cryptocurrencies infos in a single package without using a database.\n\n## Installation\n\n``` bash\n$ composer require crypto-technology/cryptocurrency\n```\n\n## Usage\n\n```php\n# See index.php for all examples\n\n// Initialize new CryptocurrencyCollection()\n$crypto_coll = new \\CryptoTech\\Cryptocurrency\\CryptocurrencyCollection();\n// Load the array with all cryptocurrencies enabled\n$crypto_enabled = (include 'config/cryptocurrency.php')['crypto_enabled'];\n\n// Inject the enabled cryptocurrencies' array in the collection\n$crypto_coll-\u003eloadEnabledCrypto($crypto_enabled);\n\n$cryptocurrency = new \\CryptoTech\\Cryptocurrency\\Cryptocurrency();\n$bitcoin = $cryptocurrency-\u003eload('Bitcoin');\n\n// Return (int) cryptocurrency id (CoinMarketCap ID)\nvar_dump($bitcoin-\u003egetId());\n\n// Return (string) cryptocurrency name\nvar_dump($bitcoin-\u003egetName());\n\n// Return (string) cryptocurrency symbol\nvar_dump($bitcoin-\u003egetSymbol());\n\n// Return (string) cryptocurrency type\n// Can be 'coin' or 'token'\nvar_dump($bitcoin-\u003egetType());\n\n// Return (string) cryptocurrency logo path with specified size\n// Size can be '16', '32', '64', '128' or '200'\n// Path must be the sub-path that allows you to get the correct logo path\n// (sub-path must be point to the parent directory of crypto-logo directory)\nvar_dump($bitcoin-\u003egetLogo('128', '.'.DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR));\n\n// Return (boolean) cryptocurrency mineable state\nvar_dump($bitcoin-\u003eisMineable());\n\n// Return (string) cryptocurrency description\nvar_dump($bitcoin-\u003egetDescription());\n\n// Return (array) cryptocurrency official project url\nvar_dump($bitcoin-\u003egetProjectUrl());\n\n// Return (array) cryptocurrency explorer urls\n// These urls can be used, for example, with sprintf($url, $wallet_address)\n// because each url is returned in the format 'https://explorer/address/%s'\n// where %s can be replaced with a wallet address for get information\n// on that specific wallet address (the page response should be, in almost\n// all cases, in json format)\nvar_dump($bitcoin-\u003egetExplorerUrl());\n\n// Return (array) cryptocurrency sourcecode url\nvar_dump($bitcoin-\u003egetSourceCodeUrl());\n```\n\nMore information can be found in the `CryptocurrencyInterface` interface PhpDocumentation.  \nThe `Cryptocurrency` class contains, in addition to the get methods, also set methods (only for description and for project, explorer and sourcecode urls), which allow you to momentarily overwrite the default values.\n\n## Changelog\n\nPlease see the [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Testing\n\n``` bash\n# For Windows system\n$ composer test-win\n\n# For Unix system\n$ composer test-unix\n```\n\n## Contributing\n\nYour help is always welcome! Feel free to open issues, ask questions, talk about it and discuss this tool.  \nOf course there are some [contributing guidelines](CONTRIBUTING.md) and a [code of conduct](CODE_OF_CONDUCT.md), which I invite you to check out.  \nFor all other contributions, see below.\n\nAfter every code changes, but before submit your pull request, please apply Php Cs Fixer code fixing:\n``` bash\n# For Windows system\n$ composer php-cs-fixer-win\n\n# For Unix system\n$ composer php-cs-fixer-unix\n```\n\n## Security\n\nThe `CryptoTech\\Cryptocurrency` package will be checked for security vulnerabilities using [Roave Security Advisories][link-roave] checker.\nIf you discover any security related issues, please email [security@cryptotech.srl](mailto:security@cryptotech.srl) instead of using the issue tracker.\n\n## Code\n\ncloc|github.com/AlDanial/cloc v 1.80  T=0.03 s (1995.2 files/s, 115665.7 lines/s)\n--- | ---\n\nLanguage|files|blank %|comment %|code|scale|3rd|gen.|equiv\n:-------|-------:|-------:|-------:|-------:|-------:|-------:|-------:|-------:\nPHP|63|11.38|48.77|1475|3.5|5162.5\nMarkdown|3|24.84|0.00|121|1|121\nJSON|1|0.00|0.00|63|2.5|157.5\nYAML|1|23.53|0.00|13|0.9|11.7\n--------|--------|--------|--------|--------|--------|--------|--------|--------\nSUM:|68|11.80|45.79|1672|x|3.26|=|5452.70\n\n## Credits\n\n- [Crypto Technology srl][link-author]\n- [Luca Bognolo][link-coauthor]\n- [All Contributors][link-contributors]\n\n## Versioning\nWe use [SemVer][link-semver] for versioning. For the versions available, see [the tags][link-tags] on this repository.\n\n## License\n\nThe GNU General Public License version 3. Please see the [license file](LICENSE) for more information.\nThis work [is licensed](LICENSE) under the [GNU GPL v3][link-license].\n\n[ico-version]: https://img.shields.io/packagist/v/crypto-technology/cryptocurrency.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/packagist/dt/crypto-technology/cryptocurrency.svg?style=flat-square\n[ico-travis]: https://img.shields.io/travis/com/crypto-technology/cryptocurrency/master.svg?style=flat-square\n[ico-commit]: https://img.shields.io/github/last-commit/crypto-technology/cryptocurrency.svg?style=flat-square\n[ico-license]: https://img.shields.io/github/license/crypto-technology/cryptocurrency.svg?style=flat-square\n[ico-php]: https://img.shields.io/badge/php-7.1-blue.svg?style=flat-square\n\n[link-packagist]: https://packagist.org/packages/crypto-technology/cryptocurrency\n[link-downloads]: https://packagist.org/packages/crypto-technology/cryptocurrency\n[link-travis]: https://travis-ci.com/crypto-technology/cryptocurrency\n[link-commit]: https://github.com/crypto-technology/cryptocurrency/commits\n[link-license]: https://www.gnu.org/licenses/gpl-3.0.en.html\n[link-php]: https://secure.php.net/downloads.php\n[link-roave]: https://github.com/Roave/SecurityAdvisories\n[link-author]: https://cryptotech.srl\n[link-coauthor]: https://bogny.eu\n[link-contributors]: https://github.com/crypto-technology/cryptocurrency/contributors\n[link-semver]: https://semver.org/\n[link-tags]: https://github.com/crypto-technology/cryptocurrency/tags\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbogny%2Fcryptocurrency","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbogny%2Fcryptocurrency","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbogny%2Fcryptocurrency/lists"}