{"id":20117953,"url":"https://github.com/tokenchain/koin.backend","last_synced_at":"2026-05-12T14:34:09.302Z","repository":{"id":115596266,"uuid":"157583443","full_name":"tokenchain/koin.backend","owner":"tokenchain","description":"Backend of koinkoin made in go with https://iris-go.com/","archived":false,"fork":false,"pushed_at":"2018-11-10T17:21:47.000Z","size":1942,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-02T19:49:35.531Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"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/tokenchain.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-14T17:09:09.000Z","updated_at":"2020-03-04T15:06:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"200e47d9-40a7-495d-a300-b9874c998baf","html_url":"https://github.com/tokenchain/koin.backend","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tokenchain/koin.backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokenchain%2Fkoin.backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokenchain%2Fkoin.backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokenchain%2Fkoin.backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokenchain%2Fkoin.backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tokenchain","download_url":"https://codeload.github.com/tokenchain/koin.backend/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokenchain%2Fkoin.backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32943516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T09:19:52.626Z","status":"ssl_error","status_checked_at":"2026-05-12T09:17:33.438Z","response_time":102,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-13T19:08:59.064Z","updated_at":"2026-05-12T14:34:09.297Z","avatar_url":"https://github.com/tokenchain.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Koin.bet\n\nKoin.bet is a simple game that allows you to bet a certain amount of koins with a certain percentage of success. If it's win you win a commission of your bet, otherwise you lose it.\n\n## File: datas.env \n\nNeed to contains this fields:\n```\nredis_host=redis\nredis_port=6379\n\nmail=koin@gmail.com\nmail_pwd=password_here\nmail_host=smtp.gmail.com\nmail_port=465\n\n```\n\n\n\n\n\n\n\n## API\n\n#### Note on error\n\nOn each endpoint check if an error field is present, if it's the case the error message would be like this:\n\n| Field name    | Type         |\n| ------------- |:------------:|\n| `code`       | int        |\n| `error`      | string        |\n| `name`      | string        |\n\nThe `code` is the identifier of the error. \nThe `error` field is the message of the error.\n\n### User\n\n#### GET {{host}}/api/user/new\n__Description__: Will create a user with a random hash and 100 coins. \u003cbr\u003e\n__Rate limiter__: 1 request per hour \u003cbr\u003e\n__Response__: \u003cbr\u003e\n\n| Field name    | Type         |\n| ------------- |:------------:|\n| `hash`       | string        |\n| `coins`      | uint64        |\n| `email`      | string        |\n| `name`       | string        |\n\n#### GET {{host}}/api/bet/mail/?mail={{hash}}\n\n__Description__: Send a mail with the hash of the player. \u003cbr\u003e\n__Rate limiter__: 1 request per hour \u003cbr\u003e\n__Response__: \u003cbr\u003e\n\n| Name          | Type          |\n| ------------- |:-------------:|\n| `success`       | bool        |\n\n\n#### GET {{host}}/api/user/update\n\n__Description__: Update the name or the mail of an user \u003cbr\u003e\n__Rate limiter__: 1 request per second \u003cbr\u003e\n__Header__: `hash: string` \u003cbr\u003e\n__Form__: \u003cbr\u003e\n\n| Name          | Type          |\n| ------------- |:-------------:|\n| `name?`       | string        |\n| `mail?`      | string        |\n\n__Note__: `?` mean that is __optional__. \u003cbr\u003e\n__Response__:\n\n| Name          | Type          |\n| ------------- |:-------------:|\n| `success`       | bool        |\n\n#### GET {{host}}/api/user/?hash={{hash}}\n\n__Description__: Get information about an user. \u003cbr\u003e\n__Rate limiter__: 20 request per seconds \u003cbr\u003e\n__Response__: \u003cbr\u003e\n\n| Field name    | Type         |\n| ------------- |:------------:|\n| `hash`       | string        |\n| `coins`      | uint64        |\n| `email`      | string        |\n| `name`       | string        |\n\n### Bet\n\n#### POST {{host}}/api/bet \u003cbr\u003e\n\n__Description__: bet a amount with a percentage \u003cbr\u003e\n__Header__: `hash: string` \u003cbr\u003e\n__Rate limiter__: 2 request per second \u003cbr\u003e\n__Form__: \u003cbr\u003e\n\n| Name          | Type          | Description     |\n| ------------- |:-------------:|:----------------|\n| `coins`       | uint64        | coins to bet.   |\n| `chance`      | int           | chance to win.   |\n\n__Response__:\n\n| Name          | Type          | Description                 |\n| ------------- |:-------------:|:----------------------------|\n| `result`        | int        | is the number generated by the Bet method       |\n| `earn`         | uint64        | is the number that the user win or lose.     | \n| `win`          | bool           | is a boolean to say if yes or no the user has win.        | \n| `chance`       | int        | is a boolean to say if yes or no the user has win. | \n| `coins`       | uint64        | is the amount of coins that the player bet. | \n| `afterCoins`       | uint64        | is the amount of new coins after add or remove the gain. | \n| `beforeCoins`       | uint64        | is the amount of old coins before bet.| \n\n#### POST {{host}}/api/bet/stats/?hash={{hash}}\n\n__Response__:\n\n| Name          | Description                 |\n| ------------- |:----------------------------|\n| `hash` | is the identifier. |\n| `count` | is the total bet effectuated. |\n| `averageEarn` | is the average of earn. |\n| `averageLose` | is the average of lose. |\n| `averageCoins` | is the average of coins bet. |\n| `averageChance` | is the average of chance bet. |\n| `averageResult` | is the average of result number generated. |\n| `maxAmount` | is the max coins amount bet. |\n| `minAmount` | is the min coins amount bet. |\n| `maxChance` | is the highest chance bet. |\n| `minChance` | is the lowest chance bet. |\n| `maxEarn` | is the maximum bettor earn. |\n| `minEarn` | is the minimum a bettor earn. |\n| `maxLose` | is the maximum bettor lose. |\n| `minLose` | is the minimum a bettor lose. |\n| `success` | is the amount of positive bet. |\n| `failed` | is the amount of negative bet. |\n| `totalCoins` | is the total chance bet. |\n| `totalEarn` | is the total a bettor earn. |\n| `totalLose` | is the total a bettor lose. |\n| `totalChance` | is the total a bettor chance. |\n| `totalResult` | is the total of result obtained. |\n| `greedy` | represent the bettor as 'greedy'. |\n| `fearful` | represent the bettor as 'fearful'. |\n\n__Note__: all of theses types are __uint64__ \u003cbr\u003e\n__Note 2__: use `global` as a hash to get global statistics over all bettors.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokenchain%2Fkoin.backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftokenchain%2Fkoin.backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokenchain%2Fkoin.backend/lists"}