Skip to main content

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)

Source distribution for lzr-near-api-py 0.1.11
File Size Uploaded
lzr-near-api-py-0.1.11.tar.gz 14.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lzr-near-api-py 0.1.11
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.11 This release

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page