Skip to main content

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


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.11.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

lzr_near_api_py-0.1.11-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file lzr-near-api-py-0.1.11.tar.gz.

File metadata

  • Download URL: lzr-near-api-py-0.1.11.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for lzr-near-api-py-0.1.11.tar.gz
Algorithm Hash digest
SHA256 f0f76bb8f14846485607dcd1c751c7e69f491c181ac4d612d643b45546409eb6
MD5 e54ed74b861e903e0733a35f66691c9e
BLAKE2b-256 f31a5a7f559d9fc02765fa7080a0475534160588de574b8ae0fe2ab1e0e29e82

See more details on using hashes here.

File details

Details for the file lzr_near_api_py-0.1.11-py3-none-any.whl.

File metadata

File hashes

Hashes for lzr_near_api_py-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 33a96fdd318fc5a062b0a7876d89954307f66407f8f7a0779852f90ebf3ac4cd
MD5 8e98a9f528145024bd07d97cc5228e6d
BLAKE2b-256 7ea0c1e8f2794213d47d79414e7fc654f165ea89268e27b32fe6728621712b5c

See more details on using hashes here.

Supported by

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