{"id":21722042,"url":"https://github.com/homanp/ohh","last_synced_at":"2025-10-26T20:47:59.160Z","repository":{"id":262846527,"uuid":"888541902","full_name":"homanp/ohh","owner":"homanp","description":"Typescript library for creating and managing poker hand histories using the open hand history standard.","archived":false,"fork":false,"pushed_at":"2024-11-20T10:07:17.000Z","size":62,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-06T15:54:29.601Z","etag":null,"topics":["cash-game","hand-history","no-limit-texas-holdem","omaha","open-hand-history","poker","tournament"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/open-hand-tracker","language":"TypeScript","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/homanp.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":"2024-11-14T15:20:39.000Z","updated_at":"2025-09-27T15:33:49.000Z","dependencies_parsed_at":"2024-11-14T16:35:50.750Z","dependency_job_id":"40f280df-621d-459f-a6fc-30d51298aaf1","html_url":"https://github.com/homanp/ohh","commit_stats":null,"previous_names":["homanp/ohh"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/homanp/ohh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homanp%2Fohh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homanp%2Fohh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homanp%2Fohh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homanp%2Fohh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/homanp","download_url":"https://codeload.github.com/homanp/ohh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/homanp%2Fohh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281171358,"owners_count":26455534,"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","status":"online","status_checked_at":"2025-10-26T02:00:06.575Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cash-game","hand-history","no-limit-texas-holdem","omaha","open-hand-history","poker","tournament"],"created_at":"2024-11-26T02:20:35.541Z","updated_at":"2025-10-26T20:47:59.120Z","avatar_url":"https://github.com/homanp.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"https://github.com/user-attachments/assets/c9305341-9c90-42f1-83ff-d016904e3da2\" alt=\"OHH Logo\" height=\"100\" /\u003e\n\n# Open Hand History\n\nA TypeScript library for creating and managing poker hand histories following the [Open Hand History](https://hh-specs.handhistory.org/) standard.\n\n[Installation](#installation) | [Quick Start](#quick-start) | [API Reference](#api-reference) | [Development](#development) | [Contributing](#contributing)\n\n\u003c/div\u003e\n\n## Installation\n\n```bash\nnpm install open-hand-tracker\n```\n\n## Quick Start\n\n```typescript\nimport { OpenHandHistory } from 'open-hand-tracker';\n\n// Initialize hand history\nconst ohh = new OpenHandHistory({\n  siteName: 'MyPokerSite',\n  tableSize: 6\n  // other properties...\n});\n\n// Add a player\nohh.addPlayer({\n  name: 'Player 1',\n  id: 1,\n  starting_stack: 1000,\n  seat: 1\n});\n\n// Add a round\nohh.addRound({\n  id: 1,\n  street: 'PREFLOP',\n  actions: []\n});\n\n// Add action to round\nohh.addActionToRound(1, {\n  action_number: 1,\n  player_id: 1,\n  action: 'RAISE',\n  amount: 100\n});\n\n// Calcuatle winnings\nwin_amount = ohh.calculateWinningAmount(1, 50); // Pass the player ID \n\n// Add pot \nohh.addPot({\n  number: 1,\n  amount: 50,\n  player_wins: [{ player_id: 1, win_amount: win_amount }],\n});\n\n// Get JSON representation\nohh.getJSON()\n\n// Save to file\nohh.saveToFile('hand_history.json');\n```\n\n## API Reference\n\n### OpenHandHistory\n\n#### Constructor Options\n```typescript\n{\n  specVersion?: string;         // Default: '1.4.6'\n  internalVersion?: string;     // Default: '1.4.6'\n  networkName?: string;         // Default: 'CustomGame'\n  siteName?: string;            // Default: 'HomeGame'\n  gameType?: string;            // Default: 'Holdem'\n  tableName?: string;           // Default: 'Sample Table'\n  tableSize?: number;           // Default: 3\n  gameNumber?: string;          // Default: '1'\n  startDateUTC?: string;        // Default: current date\n  currency?: string;            // Default: 'Chips'\n  anteAmount?: number;          // Default: 0\n  smallBlindAmount?: number;    // Default: 1\n  bigBlindAmount?: number;      // Default: 2\n  betCap?: number;              // Default: 0\n  betType?: string;             // Default: 'NL'\n  dealerSeat?: number;          // Default: 1\n  heroPlayerId?: number;        // Default: 0\n}\n```\n\n#### Methods\n\n##### `addPlayer(player: Player): void`\nAdd a player to the hand history.\n```typescript\ninterface Player {\n  name: string;\n  id: number;\n  starting_stack: number;\n  seat: number;\n  cards?: string[];\n}\n```\n\n##### `addRound(round: Round): void`\nAdd a new round to the hand history.\n```typescript\ninterface Round {\n  id: number;\n  cards?: string[];\n  street: \"Preflop\" | \"Flop\" | \"Turn\" | \"River\" | \"Showdown\"\n  actions: Action[];\n}\n```\n\n##### `addActionToRound(roundId: number, action: Action): void`\nAdd an action to a specific round.\n```typescript\ninterface Action {\n  action_number: number;\n  player_idd: number;\n  action: string;\n  amount?: number;\n  is_allin?: boolean;\n}\n```\n\n##### `addPot(pot: Pot): void`\nAdd a pot to the hand history.\n```typescript\ninterface Pot {\n  rake?: number;\n  number: number;\n  amount: number;\n  player_wins: { player_id: number; win_amount: number }[];\n}\n```\n\n##### `calculateWinningAmount(player_id: number, totalPot: number): number`\nCalculates the winners winnings\n\n##### `toJSON(): string`\nConvert the hand history to JSON string.\n\n##### `saveToFile(filename: string): void`\nSave the hand history to a file.\n\n## Development\n\n### Setup\n```bash\ngit clone https://github.com/yourusername/open-hand-history.git\ncd open-hand-history\nnpm install\n```\n\n### Testing\n```bash\nnpm test\n```\n\n### Building\n```bash\nnpm run build\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomanp%2Fohh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhomanp%2Fohh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhomanp%2Fohh/lists"}