Skip to main content

A module to send ADA with a message in the metadata.

Project description

cardanomsg

Send ADA with a message in the metadata using the Cardano blockchain.

Installation

You can install the module using pip:

pip install cardanomsg

Usage

A BlockFrost API account is required (to prevent needing to run the blockchain locally on your PC).

Send message

Send a message in a transaction.

from cardanomsg.transaction import send_message
transaction_hash = send_message("<BLOCKFROST_PROJECT_ID>", "wallet.skey", "<RECIPIENT_ADDRESS>", 1000000, "Hello World")

Get message

Get a message from a transaction.

from cardanomsg.transaction import get_message
message = get_message("<BLOCKFROST_PROJECT_ID>", "079112f6a5192c6eeae57de0607d61e07dea864efc2bbad7aa953795a5c56aae")[0].json_metadata

You can also view the message on the blockchain using Cardanoscan.

https://preview.cardanoscan.io/transaction/079112f6a5192c6eeae57de0607d61e07dea864efc2bbad7aa953795a5c56aae?tab=metadata

Summary | UTXOs | Metadata (1)

Metadata Hash: 2f86fa9fdfcb606ab2b5f060bd125848e45187cf2c798ab389e6a9af98ba8ad1
Public Label: 1
Value: "Hello World"

Create wallet

Create a wallet.

from cardanomsg.wallet import create
result = create()

Two files will be created: wallet.skey and wallet.addr.

The contents of wallet.skey is the secret key with the following format.

{
  "type": "PaymentSigningKeyShelley_ed25519",
  "description": "Payment Signing Key",
  "cborHex": "<SENDER_SECRET_KEY>"
}

License

MIT

Author

Kory Becker http://primaryobjects.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cardanomsg-0.1.2.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cardanomsg-0.1.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file cardanomsg-0.1.2.tar.gz.

File metadata

  • Download URL: cardanomsg-0.1.2.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.6

File hashes

Hashes for cardanomsg-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8d9c06eea6ccfe57cfd454326a7ddfdb0952445d347796ea2e6345a5377aa593
MD5 15f1e21ad357dfd16d09d2a9fa457eef
BLAKE2b-256 3de6119f809d1669846907b7df5b3db178fdf2d13be7179336698f838303a5aa

See more details on using hashes here.

File details

Details for the file cardanomsg-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: cardanomsg-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.6

File hashes

Hashes for cardanomsg-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1c24b2d863531a41f10e26c938e5c05952a62e8b03220a22dcb9df1256df2864
MD5 e2b5e3572378ee98b55f36e374ae98af
BLAKE2b-256 2b8bc6bc2cbe2eeb0e8685357effcffdbffce5044080fea482d443adfba01bfe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page