{"id":13829117,"url":"https://github.com/gorjan-mishevski/puzzle","last_synced_at":"2025-07-09T09:32:39.907Z","repository":{"id":57574262,"uuid":"114886488","full_name":"gorjan-mishevski/puzzle","owner":"gorjan-mishevski","description":"Golang light CryptoCompare library, api wrapper","archived":false,"fork":false,"pushed_at":"2018-01-05T20:26:01.000Z","size":94,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-04T10:01:04.757Z","etag":null,"topics":["cryptocompare","cryptocompare-api","cryptocurrency","golang","golang-library"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gorjan-mishevski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-20T12:44:43.000Z","updated_at":"2019-05-15T14:57:09.000Z","dependencies_parsed_at":"2022-09-18T04:11:04.723Z","dependency_job_id":null,"html_url":"https://github.com/gorjan-mishevski/puzzle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gorjan-mishevski%2Fpuzzle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gorjan-mishevski%2Fpuzzle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gorjan-mishevski%2Fpuzzle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gorjan-mishevski%2Fpuzzle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gorjan-mishevski","download_url":"https://codeload.github.com/gorjan-mishevski/puzzle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225533010,"owners_count":17484179,"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":["cryptocompare","cryptocompare-api","cryptocurrency","golang","golang-library"],"created_at":"2024-08-04T10:00:19.913Z","updated_at":"2024-11-20T10:30:28.716Z","avatar_url":"https://github.com/gorjan-mishevski.png","language":"Go","readme":"\n\u003cp align=\"center\"\u003e\n        \u003ca href=\"https://github.com/gorjan-mishevski/puzzle\" target=\"_blank\"\u003e\n                \u003cimg width=\"300\" src=\"https://preview.ibb.co/ejVcew/Puzzle_Crypto_Logo.png\" alt=\"Puzzle_Crypto_Logo\" border=\"0\"\u003e\n        \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n        \u003ca href=\"https://goreportcard.com/report/github.com/gorjan-mishevski/puzzle\"\u003e\n                \u003cimg src=\"https://goreportcard.com/badge/github.com/gorjan-mishevski/puzzle\"\u003e\n        \u003c/a\u003e\n         \u003ca href=\"https://godoc.org/github.com/gorjan-mishevski/puzzle\"\u003e\n                \u003cimg src=\"https://img.shields.io/badge/go-documentation-blue.svg?style=flat-square\"\u003e\n        \u003c/a\u003e\n        \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\n                \u003cimg src=\"https://img.shields.io/badge/License-MIT-green.svg\"\u003e\n        \u003c/a\u003e\n\u003c/p\u003e\n     \n# PUZZLE\nGolang CryptoCompare library\n\nIf you are searching for a nice wrapper library that used CryptoCompare API this is the one. ☝️\n\nThis library has a lot of struct's (or type asserted response instead of interface{}) that extend the response, thus ensuring nice clean access to the data and providing easy way to add more functionalities with methods on the structs.\n\nCurrently I deliberatly don't add any interfaces and methods becouse I want you to use whatever methods fits best.\n\n# Installation\n```go\ngo get github.com/gorjan-mishevski/puzzle\n```\n\n# Usage\n\n\u003ch3\u003e Example 1 \u003c/h3\u003e\nLet's start simple. Get the current value from a given currency.\u003cbr\u003e\nEX: I want to know what is the rate from US to ETH, BTC.\u003cbr\u003e\u003cbr\u003e\n\u003cb\u003e1 USD dollar\u003c/b\u003e 💵 \u003cb\u003e-\u003e ETH\u003c/b\u003e 💎\n\n```go\nresponse := puzzle.BaseAgainsMultiPrice(\"USD\", []string{\"ETH\", \"BTC\"})\n```\n1st Argument is the currency you take as base. \u003cbr\u003e\n2nd Argument is a slice of currencies you want the rate.\n\nResponse:\n```\nresponse \u003c*puzzle.Currency\u003e\n        base: \"USD\"\n        rates: \u003cmap[string]float64\u003e\n                [\"ETH\"]: 0.001556\n                [\"BTC\"]: 0.000002355\n```\n\u003chr\u003e\n\u003ch3\u003e Example 2 \u003c/h3\u003e\nLet's see how to get from multiple currencies to multiples rates.\u003cbr\u003e\n\n```go\nresponse := puzzle.MultiPrice([]string{\"USD\", \"EUR\"}, []string{\"ETH\", \"BTC\"})\n```\n1st Argument wants a slice of currencies to be taken as base.\u003cbr\u003e\n2nd Argument is a slice of currencies you want the rate.\u003cbr\u003e\n\nResponse:\n```\nresponse \u003cmap[string]map[string]float64\u003e\n        \"USD\": \u003cmap[string]float64\u003e\n                \"ETH\": 0.0000034\n                \"BTC\": 0.0000000344\n        \"EUR\": \u003cmap[string]float64\u003e\n                \"ETH\": 0.0000034\n                \"BTC\": 0.0000000344\n```\n\u003chr\u003e\n\u003ch3\u003e Example 3 \u003c/h3\u003e\nWe can check the rates for a given day.\n\u003cbr\u003e\n\n```go\nresponse := puzzle.PriceHistoryByDay(\"USD\", []string{\"ETH\", \"BTC\"}, 1452680400)\n```\n\n1st Argument is the base we want to converto from.\u003cbr\u003e\n2nd Argument the currency we want to get it's rate.\u003cbr\u003e\n3rd Argument is the timestamp. Note, it will get the price at the end of the day GMT based on the requested timestamp.\u003cbr\u003e\n\nResponse:\n\n```\nresponse \u003c*puzzle.Currency\u003e\n        base: \"USD\"\n        rates: \u003cmap[string]float64\u003e\n                [\"ETH\"]: 0.001556\n                [\"BTC\"]: 0.000002355\n```\n\u003chr\u003e\n\n\u003ch3\u003e Example 4 \u003c/h3\u003e\nNow let's get more complicated. Let's say we want a complete trading information with dynamic to -\u003e from currencies.\n\u003cbr\u003e\n\n```go\nresponse := puzzle.MultiPriceTradingInfo([]string{\"USD\", \"EUR\"}, []string{\"ETH\", \"BTC\"})\n```\n\nResponse:\u003cbr\u003e\n```\nresponse \u003cpuzzle.MultiPriceMarket\u003e\n        \"RAW\": \u003cmap[string]puzzle.MultiPriceFrom\u003e\n                \"USD\": \u003cpuzzle.MultiPriceFrom\u003e\n                        From: \"USD\"\n                        To: \u003cmap[string]puzzle.MultiPriceTo\u003e\n                                \"ETH\": \u003cpuzzle.MultiPriceTo\u003e\n                                        Name: \"ETH\"\n                                        Field: \u003cmap[string]interface{}\u003e\n                                                ... Here we have random field data.\n                                                For now they are as interface but they can be\n                                                mapped.\n                                \"BTC\": \u003cpuzzle.MultiPriceTo\u003e\n                                        ...\n                \"EUR\": \u003cpuzzle.MultiPriceFrom\u003e\n                        ...\n                        \n        \"DYNAMIC\": ...\n```\n\u003chr\u003e\n","funding_links":[],"categories":["Awesome CryptoCompare [![Awesome](https://github.com/CryptoCompareLTD/awesome-cryptocompare/blob/master/awesomecc.svg)](https://github.com/sindresorhus/awesome)"],"sub_categories":["Golang"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgorjan-mishevski%2Fpuzzle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgorjan-mishevski%2Fpuzzle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgorjan-mishevski%2Fpuzzle/lists"}