{"id":21602308,"url":"https://github.com/cryptomkt/cryptomkt-httplug-php","last_synced_at":"2025-03-18T13:23:25.607Z","repository":{"id":56959634,"uuid":"135627289","full_name":"cryptomkt/cryptomkt-httplug-php","owner":"cryptomkt","description":null,"archived":false,"fork":false,"pushed_at":"2018-07-10T19:36:05.000Z","size":70,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-25T04:17:41.806Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cryptomkt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-31T19:35:42.000Z","updated_at":"2020-04-23T15:18:47.000Z","dependencies_parsed_at":"2022-08-21T09:51:01.971Z","dependency_job_id":null,"html_url":"https://github.com/cryptomkt/cryptomkt-httplug-php","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptomkt%2Fcryptomkt-httplug-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptomkt%2Fcryptomkt-httplug-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptomkt%2Fcryptomkt-httplug-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cryptomkt%2Fcryptomkt-httplug-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cryptomkt","download_url":"https://codeload.github.com/cryptomkt/cryptomkt-httplug-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244228456,"owners_count":20419421,"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":[],"created_at":"2024-11-24T19:12:47.405Z","updated_at":"2025-03-18T13:23:25.587Z","avatar_url":"https://github.com/cryptomkt.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CryptoMarket PHP Client\n\nOfficial Client library [CryptoMarket API v1][1] to integrate CryptoMarket into your\nPHP project, using HTTPlug client abstraction [HTTPlug][3].\n\n## Installation\n\nThis library could be installed using Composer. Please read the [Composer Documentation](https://getcomposer.org/doc/01-basic-usage.md).\n\n```json\n\"require\": {\n    \"cryptomkt/cryptomkt-httplug-php\": \"dev-master\"\n}\n```\n\n## Authentication\n\n### API Key\n\nUse an API key and secret to access your own Crypto Market account.\n\n```php\nuse Cryptomkt\\Exchange\\Client;\nuse Cryptomkt\\Exchange\\Configuration;\n\n$configuration = Configuration::apiKey($apiKey, $apiSecret);\n$client = Client::create($configuration);\n```\n\n### Warnings\n\nThis library will log all warnings to a\nstandard PSR-3 logger if one is configured.\n\n```php\nuse Cryptomkt\\Exchange\\Client;\nuse Cryptomkt\\Exchange\\Configuration;\n\n$configuration = Configuration::apiKey($apiKey, $apiSecret);\n$configuration-\u003esetLogger($logger);\n$client = Client::create($configuration);\n```\n\n### Responses\n\nEach resource object has a `getRawData()` method which you can use to access any field that\nare not mapped to the object properties.\n\n```php\n$data = $markets-\u003egetRawData();\n```\n\nRaw data from the last HTTP response is also available on the client object.\n\n```php\n$data = $client-\u003edecodeLastResponse();\n```\n\n## Usage\n\nFor more references, go to the [official documentation](https://developers.cryptomkt.com/).\n\n### Market Data\n\n**List markets**\n\n```php\n$markets = $client-\u003egetMarkets();\n```\n\n**Get ticker**\n\n```php\n$arguments = array('market' =\u003e 'ETHARS');\n$ticker = $client-\u003egetTicker($arguments); \n```\n\n**Get trades**\n\n```php\n$arguments = array('market' =\u003e 'ETHCLP','start' =\u003e '2017-05-20', 'end' =\u003e '2017-05-30', 'page' =\u003e 1);\n$trades = $client-\u003egetTrades($arguments);\n```\n\n### Orders\n\n**Get orders**\n\n```php\n$arguments = array('market' =\u003e 'ETHARS','type' =\u003e 'buy', 'page' =\u003e 1);\n$orders = $client-\u003egetOrders($arguments); \n```\n\n**Get order**\n\n```php\n$arguments = array('id' =\u003e 'M107435');\n$order = $client-\u003egetOrder($arguments);  \n```\n\n**Get active orders**\n\n```php\n$arguments = array('market' =\u003e 'ETHCLP', 'page' =\u003e 0);\n$active_orders = $client-\u003egetActiveOrders($arguments); \n```\n\n**Get executed orders**\n\n```php\n$arguments = array('market' =\u003e 'ETHCLP', 'page' =\u003e 0);\nvar_dump($client-\u003egetExecutedOrders($arguments)); \n```\n\n**Create order**\n\n```php\n$arguments = array(\n        'amount' =\u003e '0.3',\n        'market' =\u003e 'ethclp',\n        'price' =\u003e '200000',\n        'type' =\u003e 'sell'\n    );\n$response = $client-\u003ecreateOrder($arguments); \n```\n\n**Cancel order**\n\n```php\n$arguments = array('id' =\u003e 'M107441');\n$response = $client-\u003ecancelOrder($arguments); \n```\n\n### Balance\n\n**Get balance**\n\n```php\n$response = $client-\u003egetBalance(); \n```\n\n**Create pay order**\n\n```php\n$arguments = array(\n    'to_receive' =\u003e '3000',\n    'to_receive_currency' =\u003e 'CLP',\n    'payment_receiver' =\u003e 'receiver@email.com',\n    'external_id' =\u003e '123456CM',\n    'callback_url' =\u003e '',\n    'error_url' =\u003e '',\n    'success_url' =\u003e '',\n    'refund_email' =\u003e 'refund@email.com'\n);\n\n$response = $client-\u003ecreatePayOrder($arguments);  \n```\n\n### Pay orders\n\n**Get pay order**\n\n```php\n$arguments = array('id' =\u003e 'P13565');\n$response = $client-\u003egetPayOrder($arguments);  \n```\n\n**Get pay orders**\n\n```php\n$arguments = array('start_date' =\u003e '1/05/2018','end_date' =\u003e '31/05/2018');\n$response = $client-\u003egetPayOrders($arguments);  \n```\n\n## Contributing and testing\n\nThe test suite is built using PHPUnit. Run the suite of unit tests by running\nthe `phpunit` command.\n\n```\nphpunit\n```\n\n[1]: https://developers.cryptomkt.com\n[2]: https://packagist.org/packages/cryptomkt/cryptomkt\n[3]: https://github.com/php-http/httplug\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptomkt%2Fcryptomkt-httplug-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcryptomkt%2Fcryptomkt-httplug-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptomkt%2Fcryptomkt-httplug-php/lists"}