Python implementation of NANO currency related functions
Project description
nanopy
- Install by running
pip install nanopy.- Install
mnemonicto generate mnemonic wallets. - Install
requestsorwebsocket-clientto use http or websocket RPC, respectively.
- Install
Usage
# create an account (defaults to NANO network) and set secret key
seed = "0000000...."
acc = npy.Account()
acc.sk = npy.deterministic_key(seed)
# if it is not a new account, set the current state of the account (frontier, raw bal, rep)
acc.state = ("1234....", 1200000000000000, npy.Account(addr="nano_repaddress..."))
# create a receive block and optionally, change rep along with it
_hash = "5678...."
raw_amt = acc.network.to_raw("10")
rep = npy.Account(addr="nano_newrepaddress...")
rb = acc.receive(_hash, raw_amt, rep)
# create a send block
to = npy.Account(addr="nano_sendaddress...")
raw_amt = acc.network.to_raw("1")
sb = acc.send(to, raw_amt)
# broadcast
rpc.process(rb.json)
rpc.process(sb.json)
Wallet
Although not part of the package, the light wallet included in the repository can be a reference to understand how the library works.
- Configuration is in
~/.config/nanopy.ini -n,--network. Choose the network to interact with - nano, banano, or beta. The default network is nano.- Checks state of accounts in
~/.config/nanopy.iniby default. - Open a wallet,
nanopy-wallet open KEY, and use seeds from system keyring.KEYis an entry previously generated by this wallet. Seenanopy-wallet open -hfor options.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nanopy-28.0.1.post7.tar.gz
(116.5 kB
view details)
File details
Details for the file nanopy-28.0.1.post7.tar.gz.
File metadata
- Download URL: nanopy-28.0.1.post7.tar.gz
- Upload date:
- Size: 116.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a65f0a8f76b8acb915e051f84aa2b0a5b824b9e2bff370dad3b911a9234bd82b
|
|
| MD5 |
e3f61c1823ca76791b3a9ef53e67d8ce
|
|
| BLAKE2b-256 |
1fc78707bdaadee9efda70fcad0e496af22746dcff55349bc5fd4d3290852234
|
Provenance
The following attestation bundles were made for nanopy-28.0.1.post7.tar.gz:
Publisher:
nanopy.yml on nkr0/nanopy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nanopy-28.0.1.post7.tar.gz -
Subject digest:
a65f0a8f76b8acb915e051f84aa2b0a5b824b9e2bff370dad3b911a9234bd82b - Sigstore transparency entry: 1027068774
- Sigstore integration time:
-
Permalink:
nkr0/nanopy@ebd3d938b8335dc922022ebb3b1ec2917c5479e8 -
Branch / Tag:
refs/tags/28.0.1-6 - Owner: https://github.com/nkr0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
nanopy.yml@ebd3d938b8335dc922022ebb3b1ec2917c5479e8 -
Trigger Event:
push
-
Statement type: