No project description provided
Project description
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.
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
lzr-near-api-py-0.1.9.tar.gz
(14.3 kB
view hashes)
Built Distribution
Close
Hashes for lzr_near_api_py-0.1.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc4d4708ddb7b62c20c814cab2d3d6e5beffa703b9275595af08cbfed405c828 |
|
MD5 | 82386cf728a6d9bd22bb6b88f3ae6c37 |
|
BLAKE2b-256 | 2be2ef6d4f8585e2a74cb114947597b26b43869fffdefa9281fb04dc3b1eef82 |