{"id":17939410,"url":"https://github.com/libitx/shapeshifter","last_synced_at":"2025-03-24T10:32:08.764Z","repository":{"id":57547387,"uuid":"286127393","full_name":"libitx/shapeshifter","owner":"libitx","description":"Shapeshifter is an Elixir library for switching between Bitcoin transaction formats.","archived":false,"fork":false,"pushed_at":"2021-11-23T14:49:52.000Z","size":163,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-24T01:21:20.958Z","etag":null,"topics":["bitcoin","bsv","elixir"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libitx.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":"2020-08-08T22:18:43.000Z","updated_at":"2022-03-08T12:30:15.000Z","dependencies_parsed_at":"2022-09-26T18:40:51.873Z","dependency_job_id":null,"html_url":"https://github.com/libitx/shapeshifter","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/libitx%2Fshapeshifter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libitx%2Fshapeshifter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libitx%2Fshapeshifter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libitx%2Fshapeshifter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libitx","download_url":"https://codeload.github.com/libitx/shapeshifter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245252427,"owners_count":20585060,"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":["bitcoin","bsv","elixir"],"created_at":"2024-10-29T00:07:14.189Z","updated_at":"2025-03-24T10:32:08.248Z","avatar_url":"https://github.com/libitx.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shapeshifter\n\n![Shapeshifter lets you quickly and simply switch between Bitcoin transaction formats](https://github.com/libitx/shapeshifter/raw/master/media/poster.png)\n\n![Hex.pm](https://img.shields.io/hexpm/v/shapeshifter?color=informational)\n![GitHub](https://img.shields.io/github/license/libitx/shapeshifter?color=informational)\n![Build Status](https://img.shields.io/github/workflow/status/libitx/shapeshifter/Elixir%20CI)\n\nShapeshifter is an Elixir library for switching between Bitcoin transaction formats. Quickly and simply shift between raw tx binaries, `BSV.Tx` structs, and `TXO` and `BOB` transaction formats.\n\n## Sponsors\n\n\u003cp align=\"center\"\u003eSupported by:\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://coingeek.com\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n    \u003cimg src=\"https://www.chronoslabs.net/img/badges/coingeek.png\" width=\"180\" alt=\"Coingeek\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nYour sponsorship will help us continue to release and maintain software that Bitcoin businesses and developers depend on.\n\n#### 👉 [Sponsor Chronos Labs' open source work](https://www.chronoslabs.net/sponsor/)\n\n## Installation\n\nThe package can be installed by adding `shapeshifter` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:shapeshifter, \"~\u003e 0.2\"}\n  ]\nend\n```\n\n## Usage\n\nUsing Shapeshifter couldn't be simpler. Under the hood Shapeshifter uses pattern matching to automatically determine the source format, so all you need to do is pass a transaction object of any format to the appropriate function of the format you want to convert to (from: `to_raw/2`, `to_tx/1`, `to_txo/1` or `to_bob/1`).\n\n```elixir\n# Convert to raw tx\nShapeshifter.to_raw(tx)\n# =\u003e \u003c\u003c1, 0, 0, 0, ...\u003e\u003e\n\n# Convert to raw tx with hex encoding\nShapeshifter.to_raw(tx, encoding: :hex)\n# =\u003e \"01000000...\"\n\n# Convert to BSV.Tx struct\nShapeshifter.to_tx(tx)\n# =\u003e %BSV.Tx{}\n\n# Convert to TXO map\nShapeshifter.to_txo(tx)\n# =\u003e %{\"in\" =\u003e [...], \"out\" =\u003e [...], ...}\n\n# Convert to BOB map\nShapeshifter.to_bob(tx)\n# =\u003e %{\"in\" =\u003e [...], \"out\" =\u003e [...], ...}\n```\n\nFor more advanced use, Shapeshifter can also be used to convert individual inputs and outputs between the supported formats.\n\nFor more examples, refer to the [full documentation](https://hexdocs.pm/shapeshifter).\n\n## License\n\nShapeshifter is open source and released under the [Apache-2 License](https://github.com/libitx/shapeshifter/blob/master/LICENSE).\n\n© Copyright 2020-2021 Chronos Labs Ltd.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibitx%2Fshapeshifter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibitx%2Fshapeshifter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibitx%2Fshapeshifter/lists"}