{"id":28196014,"url":"https://github.com/primaryobjects/cardanomsg","last_synced_at":"2025-05-16T14:15:07.010Z","repository":{"id":268192415,"uuid":"903607118","full_name":"primaryobjects/cardanomsg","owner":"primaryobjects","description":"Store and retrieve text or JSON in the Cardano blockchain metadata.","archived":false,"fork":false,"pushed_at":"2025-02-22T00:32:47.000Z","size":21,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-25T06:50:05.141Z","etag":null,"topics":["ada","bitcoin","blockchain","cardano","crypto","metadata","pypi","pypi-package","python","transaction"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/cardanomsg/0.1.3/","language":"Python","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/primaryobjects.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-15T03:39:54.000Z","updated_at":"2025-03-27T15:27:37.000Z","dependencies_parsed_at":"2024-12-15T03:51:11.158Z","dependency_job_id":"0c5189aa-560f-4bb0-a2fc-1b4b485a2b1b","html_url":"https://github.com/primaryobjects/cardanomsg","commit_stats":null,"previous_names":["primaryobjects/cardanomsg"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primaryobjects%2Fcardanomsg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primaryobjects%2Fcardanomsg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primaryobjects%2Fcardanomsg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primaryobjects%2Fcardanomsg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/primaryobjects","download_url":"https://codeload.github.com/primaryobjects/cardanomsg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254544811,"owners_count":22088808,"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":["ada","bitcoin","blockchain","cardano","crypto","metadata","pypi","pypi-package","python","transaction"],"created_at":"2025-05-16T14:15:05.019Z","updated_at":"2025-05-16T14:15:07.000Z","avatar_url":"https://github.com/primaryobjects.png","language":"Python","readme":"# cardanomsg\n\nStore and retrieve text or JSON in the Cardano blockchain metadata.\n\n## Installation\n\nYou can install the module using pip:\n\n```sh\npip install cardanomsg\n```\n\n## Usage\n\nA [BlockFrost](https://blockfrost.io/) API account is required *(to prevent needing to run the blockchain locally on your PC)*.\n\n## Send message\n\nSend a message in a transaction.\n\n```python\nfrom cardanomsg.transaction import send_message\ntransaction_hash = send_message(\"\u003cBLOCKFROST_PROJECT_ID\u003e\", \"wallet.skey\", \"\u003cRECIPIENT_ADDRESS\u003e\", 1000000, \"Hello World\")\n```\n\n## Send message with label\n\nSend a message with a searchable label in a transaction.\n\n```\nlabel = uuid.uuid4().int \u0026 (1\u003c\u003c32)-1\npayload = {\n    \"id\": 12345,\n    \"text\": \"Hello World\"\n}\ntransaction_hash = send_message(\"\u003cBLOCKFROST_PROJECT_ID\u003e\", \"wallet.skey\", \"\u003cRECIPIENT_ADDRESS\u003e\", 1000000, payload, label)\n```\n\n*The label must be numeric. Wait 1-3 minutes after submitting the transaction to find your label.*\n\n## Get message\n\nGet a message from a transaction.\n\n```python\nfrom cardanomsg.transaction import get_message\nmessage = get_message(\"\u003cBLOCKFROST_PROJECT_ID\u003e\", \"079112f6a5192c6eeae57de0607d61e07dea864efc2bbad7aa953795a5c56aae\")[0].json_metadata\n```\n\nYou can also view the message on the blockchain using Cardanoscan.\n\nhttps://preview.cardanoscan.io/transaction/079112f6a5192c6eeae57de0607d61e07dea864efc2bbad7aa953795a5c56aae?tab=metadata\n\n```\nSummary | UTXOs | Metadata (1)\n\nMetadata Hash: 2f86fa9fdfcb606ab2b5f060bd125848e45187cf2c798ab389e6a9af98ba8ad1\nPublic Label: 1\nValue: \"Hello World\"\n```\n\n## Find message\n\nFind messages using a label.\n\n```python\nfrom cardanomsg.transaction import find_message\nmessages = find_message(\u003cBLOCKFROST_PROJECT_ID\u003e, 1782959986)\nfor message in messages:\n    print(message.json_metadata)\n```\n\n*The label must be numeric.*\n\n## Create wallet\n\nCreate a wallet.\n\n```\nfrom cardanomsg.wallet import create\nresult = create()\n```\n\nTwo files will be created: `wallet.skey` and `wallet.addr`.\n\nThe contents of `wallet.skey` is the secret key with the following format.\n\n```json\n{\n  \"type\": \"PaymentSigningKeyShelley_ed25519\",\n  \"description\": \"Payment Signing Key\",\n  \"cborHex\": \"\u003cSENDER_SECRET_KEY\u003e\"\n}\n```\n\n## Publishing to PyPi\n\nUse the following steps to publish a new version to PyPi.\n\n1. Update the version number in [pyproject.toml](https://github.com/primaryobjects/cardanomsg/blob/main/pyproject.toml#L7) and [setup.py](https://github.com/primaryobjects/cardanomsg/blob/main/setup.py#L7).\n2. Package the distributable: `py -m build`\n3. Upload the package: `py -m twine upload dist/*`\n4. Confirm the new version at https://pypi.org/project/cardanomsg\n\n## License\n\nMIT\n\n## Author\n\nKory Becker\nhttp://primaryobjects.com\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimaryobjects%2Fcardanomsg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprimaryobjects%2Fcardanomsg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimaryobjects%2Fcardanomsg/lists"}