yenpoint-1satordinals


Nameyenpoint-1satordinals JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryA library for creating 1Sat Ordinals NFTs on BSV blockchain
upload_time2025-01-06 07:13:25
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseNone
keywords blockchain bsv nft ordinals
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Yenpoint 1Sat Ordinals

A Python library for creating 1Sat Ordinals NFTs on the BSV blockchain.

## Installation

```bash
pip install yenpoint_1satordinals
```

## Usage

1. Preparing Ordinal NFT outputs

Use the add_1sat_outputs function.
You need three arguments, ordinal address, data, and change address.

    ordinal_address: the destination address of inscribing 1 sat ordinal NFT

    data: it can take text strings or your file path to the data that you want to inscribe.

    change_address: the address to recieve your change ammount


An example of Inscribing texts
```python
from yenpoint_1satordinals import add_1sat_outputs
from pathlib import Path


outputs = add_1sat_outputs(
    ordinal_address="your_ordinal_address",
    data="Hello, World!",
    change_address="your_change_address"
)
```
or 

An example of Inscribing data
You should define the path to the file that you want to inscribe first
```python
from yenpoint_1satordinals import add_1sat_outputs

data_path = Path("data/image1.jpeg")

outputs = add_1sat_outputs(
                    ordinal_address="1HZqesnTJK8HK4Uypvvt7FgHoBdosBvTiS",
                    data=data_path,
                    change_address="1MWLhxkoucmstD5VGLZeiaq5YMdDRMn9oS"
            )
```

Preparing the Transaction

```python
    
    from bsv.transaction_input import TransactionInput
    from bsv.transaction import Transaction
    from bsv import PrivateKey
    from bsv.script import P2PKH

        
    # Here adding the code of creating ordinal outputs
    
    
    
    tx_input = TransactionInput(
                    source_transaction=previous_tx,
                    source_txid=previous_tx.txid(),
                    source_output_index=previous_tx_vout,
                    unlocking_script_template=P2PKH().unlock(sender_private_key)
                )

    
    tx = Transaction([tx_input], outputs)

    tx.fee()
    tx.sign()
   
```



Example of customising the Transaction, adding an additional output

```python
    from bsv.transaction_input import TransactionInput
    from bsv.transaction_output import TransactionOutput
    from bsv.transaction import Transaction
    from bsv import PrivateKey
    from bsv.script import P2PKH
    
    
        # Here adding the code of creating ordinal outputs


    tx_input = TransactionInput(
                    source_transaction=previous_tx,
                    source_txid=previous_tx.txid(),
                    source_output_index=previous_tx_vout,
                    unlocking_script_template=P2PKH().unlock(sender_private_key)
                )

    
    Additional_output = TransactionOutput(
                locking_script=P2PKH().lock("1QnWY1CWbWGeqobBBoxdZZ3DDeWUC2VLn"),
                satoshis=33,
                change=False
            )

    tx = Transaction([tx_input], outputs + [Additional_output])


    tx.fee()
    tx.sign()
```


Do you async & await for the transaction broadcast.
```python
    import asyncio

    async def main():
        try:
             # All other codes
             
            await tx.broadcast()

    except Exception as e:
    print(f"Error occurred: {str(e)}")
    
if __name__ == "__main__":
    asyncio.run(main())

```

* It automaticaly creates an oridnal, fee, and change outputs.
* The fee of inscription is less than 0.1 cent, 998 satoshi. (The commarcial license for cheaper fee rate.)
* You also have to pay the mining fee for miners, 1 satoshi/ kb of data.


## License


This library is available for individual use. For commercial use, including metadata, and parsing features, an Enterprise license is required. See [LICENSE.md](LICENSE.md) for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "yenpoint-1satordinals",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "blockchain, BSV, NFT, ordinals",
    "author": null,
    "author_email": "Ken Sato <info@yenpoint.jp>",
    "download_url": "https://files.pythonhosted.org/packages/f9/bb/6c38f7643f7aef19b2baeca29f4f927ddb1cb1666c3489237134f11679f7/yenpoint_1satordinals-0.1.1.tar.gz",
    "platform": null,
    "description": "# Yenpoint 1Sat Ordinals\n\nA Python library for creating 1Sat Ordinals NFTs on the BSV blockchain.\n\n## Installation\n\n```bash\npip install yenpoint_1satordinals\n```\n\n## Usage\n\n1. Preparing Ordinal NFT outputs\n\nUse the add_1sat_outputs function.\nYou need three arguments, ordinal address, data, and change address.\n\n    ordinal_address: the destination address of inscribing 1 sat ordinal NFT\n\n    data: it can take text strings or your file path to the data that you want to inscribe.\n\n    change_address: the address to recieve your change ammount\n\n\nAn example of Inscribing texts\n```python\nfrom yenpoint_1satordinals import add_1sat_outputs\nfrom pathlib import Path\n\n\noutputs = add_1sat_outputs(\n    ordinal_address=\"your_ordinal_address\",\n    data=\"Hello, World!\",\n    change_address=\"your_change_address\"\n)\n```\nor \n\nAn example of Inscribing data\nYou should define the path to the file that you want to inscribe first\n```python\nfrom yenpoint_1satordinals import add_1sat_outputs\n\ndata_path = Path(\"data/image1.jpeg\")\n\noutputs = add_1sat_outputs(\n                    ordinal_address=\"1HZqesnTJK8HK4Uypvvt7FgHoBdosBvTiS\",\n                    data=data_path,\n                    change_address=\"1MWLhxkoucmstD5VGLZeiaq5YMdDRMn9oS\"\n            )\n```\n\nPreparing the Transaction\n\n```python\n    \n    from bsv.transaction_input import TransactionInput\n    from bsv.transaction import Transaction\n    from bsv import PrivateKey\n    from bsv.script import P2PKH\n\n        \n    # Here adding the code of creating ordinal outputs\n    \n    \n    \n    tx_input = TransactionInput(\n                    source_transaction=previous_tx,\n                    source_txid=previous_tx.txid(),\n                    source_output_index=previous_tx_vout,\n                    unlocking_script_template=P2PKH().unlock(sender_private_key)\n                )\n\n    \n    tx = Transaction([tx_input], outputs)\n\n    tx.fee()\n    tx.sign()\n   \n```\n\n\n\nExample of customising the Transaction, adding an additional output\n\n```python\n    from bsv.transaction_input import TransactionInput\n    from bsv.transaction_output import TransactionOutput\n    from bsv.transaction import Transaction\n    from bsv import PrivateKey\n    from bsv.script import P2PKH\n    \n    \n        # Here adding the code of creating ordinal outputs\n\n\n    tx_input = TransactionInput(\n                    source_transaction=previous_tx,\n                    source_txid=previous_tx.txid(),\n                    source_output_index=previous_tx_vout,\n                    unlocking_script_template=P2PKH().unlock(sender_private_key)\n                )\n\n    \n    Additional_output = TransactionOutput(\n                locking_script=P2PKH().lock(\"1QnWY1CWbWGeqobBBoxdZZ3DDeWUC2VLn\"),\n                satoshis=33,\n                change=False\n            )\n\n    tx = Transaction([tx_input], outputs + [Additional_output])\n\n\n    tx.fee()\n    tx.sign()\n```\n\n\nDo you async & await for the transaction broadcast.\n```python\n    import asyncio\n\n    async def main():\n        try:\n             # All other codes\n             \n            await tx.broadcast()\n\n    except Exception as e:\n    print(f\"Error occurred: {str(e)}\")\n    \nif __name__ == \"__main__\":\n    asyncio.run(main())\n\n```\n\n* It automaticaly creates an oridnal, fee, and change outputs.\n* The fee of inscription is less than 0.1 cent, 998 satoshi. (The commarcial license for cheaper fee rate.)\n* You also have to pay the mining fee for miners, 1 satoshi/ kb of data.\n\n\n## License\n\n\nThis library is available for individual use. For commercial use, including metadata, and parsing features, an Enterprise license is required. See [LICENSE.md](LICENSE.md) for details.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A library for creating 1Sat Ordinals NFTs on BSV blockchain",
    "version": "0.1.1",
    "project_urls": {
        "Repository": "https://github.com/Yenpoint/yenpoint_1satordinals",
        "website": "https://yenpoint.com"
    },
    "split_keywords": [
        "blockchain",
        " bsv",
        " nft",
        " ordinals"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ca04dfcc332799ebe3fa67fe9a2375183d4580b9bad666e6080eb671eddd3433",
                "md5": "fdb0610b1e156a6e19ec84911e1ffe61",
                "sha256": "2af38dae6c5f8ee3f189c97c58116e9852a5c54bf56a6fb5e6485679c469d4ed"
            },
            "downloads": -1,
            "filename": "yenpoint_1satordinals-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fdb0610b1e156a6e19ec84911e1ffe61",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 8015,
            "upload_time": "2025-01-06T07:13:23",
            "upload_time_iso_8601": "2025-01-06T07:13:23.369278Z",
            "url": "https://files.pythonhosted.org/packages/ca/04/dfcc332799ebe3fa67fe9a2375183d4580b9bad666e6080eb671eddd3433/yenpoint_1satordinals-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f9bb6c38f7643f7aef19b2baeca29f4f927ddb1cb1666c3489237134f11679f7",
                "md5": "f58cb8d1d95057b1ff47da7d16892ee5",
                "sha256": "d121b51dc92b7bf86b8c455bad53a1520067d4711b0eb471994ed3a8f18acd1e"
            },
            "downloads": -1,
            "filename": "yenpoint_1satordinals-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "f58cb8d1d95057b1ff47da7d16892ee5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 8457,
            "upload_time": "2025-01-06T07:13:25",
            "upload_time_iso_8601": "2025-01-06T07:13:25.718301Z",
            "url": "https://files.pythonhosted.org/packages/f9/bb/6c38f7643f7aef19b2baeca29f4f927ddb1cb1666c3489237134f11679f7/yenpoint_1satordinals-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-06 07:13:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Yenpoint",
    "github_project": "yenpoint_1satordinals",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "yenpoint-1satordinals"
}
        
Elapsed time: 0.41538s