{"id":22793089,"url":"https://github.com/kripod/primedice.net","last_synced_at":"2025-04-16T18:49:08.504Z","repository":{"id":81144572,"uuid":"47068914","full_name":"kripod/Primedice.NET","owner":"kripod","description":"Wraps the functionality of the Primedice API in C#.","archived":false,"fork":false,"pushed_at":"2015-12-05T07:30:17.000Z","size":61,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T05:33:24.498Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","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/kripod.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2015-11-29T15:32:18.000Z","updated_at":"2025-02-12T09:57:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5ec0e57-98f4-4caa-9b5f-5dafea04c7cb","html_url":"https://github.com/kripod/Primedice.NET","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kripod%2FPrimedice.NET","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kripod%2FPrimedice.NET/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kripod%2FPrimedice.NET/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kripod%2FPrimedice.NET/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kripod","download_url":"https://codeload.github.com/kripod/Primedice.NET/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249266491,"owners_count":21240765,"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-12-12T03:17:59.837Z","updated_at":"2025-04-16T18:49:08.487Z","avatar_url":"https://github.com/kripod.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Primedice.NET [![AppVeyor CI](https://img.shields.io/appveyor/ci/kripod/primedice-net/master.svg)](https://ci.appveyor.com/project/kripod/primedice-net) [![NuGet](https://img.shields.io/nuget/v/Primedice.NET.svg)](https://www.nuget.org/packages/Primedice.NET)\nWraps the functionality of the [Primedice][] API in C#.\nThe project is written in .NET 4.5 as a portable class library.\n\nFor versioning, [Semantic Versioning 2.0.0][]'s conventions are used.\n\n[Primedice]: https://primedice.com\n[Semantic Versioning 2.0.0]: http://semver.org/spec/v2.0.0.html\n\n## Getting started\n\nThe following examples assume that the project has been referenced with the \nusing directive: `using KriPod.Primedice;`\n\nPlease be advised that all the monetary amounts are in satoshi by default\n(1 satoshi = 0.00000001 bitcoin).\n\n### Registering a new user\n``` csharp\nvar username = \"\u003cusername\u003e\";\n\n// Initialize a new unauthorized instance of PrimediceClient\nvar client = new PrimediceClient();\n\n// Create a new user\nvar user = await client.Users.Create(username);\n\n// The following is the most important property of the newly-created user\n// Store the value of AuthToken in order to access the created account later\nvar authToken = user.AuthToken;\n```\n\n### Making a bet with an existing user\n``` csharp\nvar serverSeed = \"\u003cserverSeed\u003e\";\nvar authToken =  \"\u003cauthToken\u003e\";\nvar amount = 1; // 0.00000001 BTC\nvar condition = BetCondition.LowerThan;\nvar target = 49.5F;\n\n// Initialize a new authorized instance of PrimediceClient\n// (Bet simulation is available by using an unauthorized instance)\nvar client = new PrimediceClient(authToken);\n\n// Place a new bet with the parameters specified above\nvar bet = await client.Bets.Create(amount, condition, target);\n\n// Verify the fairness of the bet whether it was lost\nif (!bet.IsWon \u0026\u0026 !bet.Verify(serverSeed)) {\n    // The roll was not calculated fairly. (This should never happen.)\n}\n```\n\n### Withdrawing and depositing funds\n``` csharp\nvar authToken =  \"\u003cauthToken\u003e\";\nvar withdrawalAddress = \"\u003cbitcoinAddress\u003e\";\nvar amount = 100000; // 0.001 BTC\n\n// Initialize a new authorized instance of PrimediceClient\nvar client = new PrimediceClient(authToken);\n\n// Withdraw some amount of money to the withdrawal address specified above\nvar withdrawal = await client.Wallet.Withdraw(amount, withdrawalAddress);\n\n// Query the deposit address of self\nvar depositAddress = await client.Wallet.GetDepositAddress();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkripod%2Fprimedice.net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkripod%2Fprimedice.net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkripod%2Fprimedice.net/lists"}