near-api-py
This is and extension of the near-api-py repository
Status: super rough, APIs are subject to change
A Python library for development of applications that are using NEAR platform.
Installation
pip install near-api-py
Usage example
Send money
near_provider = near_api.providers.JsonProvider("https://rpc.testnet.near.org")
sender_key_pair = near_api.signer.KeyPair("ed25519:[SENDER_PRIVATE_KEY]")
sender_signer = near_api.signer.Signer("sender.testnet", sender_key_pair)
sender_account = near_api.account.Account(near_provider, sender_signer)
out = sender_account.send_money("vsab.testnet", 1000)
print(out)
Smart contract call method
contract_id = "contract.testnet"
signer_id = "signer.testnet"
signer_key = "ed25519:[SIGNER_SECRET_KEY]"
args = {"counter": 1, "action": "increase"}
near_provider = near_api.providers.JsonProvider("https://rpc.testnet.near.org")
key_pair = near_api.signer.KeyPair(signer_key)
signer = near_api.signer.Signer(signer_id, key_pair)
account = near_api.account.Account(near_provider, signer)
out = account.function_call(contract_id, "counter_set", args)
print(out)
Contribution
First, install the package in development mode:
python setup.py develop
To run tests, use nose (pip install nose):
nosetests
License
This repository is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See LICENSE and LICENSE-APACHE for details.
Metadata
Release files for lzr-near-api-py 0.1.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lzr-near-api-py-0.1.11.tar.gz | 14.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lzr_near_api_py-0.1.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.9 kB
Release files / lzr-near-api-py-0.1.11.tar.gz
| Download URL | lzr-near-api-py-0.1.11.tar.gz |
|---|---|
| Size | 14.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0f76bb8f14846485607dcd1c751c7e69f491c181ac4d612d643b45546409eb6
|
|
BLAKE2b-256 checksum How to use checksums |
f31a5a7f559d9fc02765fa7080a0475534160588de574b8ae0fe2ab1e0e29e82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Release files / lzr_near_api_py-0.1.11-py3-none-any.whl
| Download URL | lzr_near_api_py-0.1.11-py3-none-any.whl |
|---|---|
| Size | 14.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
33a96fdd318fc5a062b0a7876d89954307f66407f8f7a0779852f90ebf3ac4cd
|
|
BLAKE2b-256 checksum How to use checksums |
7ea0c1e8f2794213d47d79414e7fc654f165ea89268e27b32fe6728621712b5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|