open-api-sdk
Open-api-sdk is a library for interaction with Open Platform.
Content
Installing
Using pip:
$ pip install open-api-sdk
Get started
OPEN Platform uses OpenKeys to allow access to the API. You can register a new OpenKey at your Account.
OPEN Platform expects the OpenKey to be included in all API requests to the server in a header.
We assume that you have the OpenKey by this moment.
To access the library import an OpenPlatform class and call an instance with the OpenKey as following:
from openp_py import OpenPy
# Access API via instance of OpenPlatform class
op = OpenPy(open_key)
open_key - your open key.
In the following examples, it is assumed that op is a result of instantiating the OpenPlatform class with the open_key
API
Page request attributes
| Attribute | Type | Description |
|---|---|---|
| offset | Long | Page offset |
| limit | Int | Page limit |
Page response attributes
| Attribute | Type | Description |
|---|---|---|
| totalCount | Long | Total count of entities in a database |
| list | [] | List of entities with type T (T is generic) |
Scaffold
Scaffold attributes
| Attribute | Type | Description |
|---|---|---|
| address | String | Scaffold address |
| abi | String | Scaffold json interface |
| description | String | Scaffold description |
| fiatAmount | String | Scaffold fiat amount |
| currency | String | Fiat amount currency |
| conversionAmount | String | Fiat amount converted to ethereum |
| developerAddress | String | Scaffold developer address |
| webHook | String | Scaffold webhook for events |
| properties | ScaffoldProperty[] | Scaffold properties |
Scaffold properties attributes
| Attribute | Type | Description |
|---|---|---|
| name | String | Property name |
| type | PropertyType | Property type |
| defaultValue | String | Property default value |
get_all()
scaffolds = op.scaffold.get_all()
get_single(address)
address = '0x1c297f40beb075936d6dbe4b245b92738867ecb1' # an address of the scaffold (example)
scaffold = op.scaffold.get_single(address)
Scaffold summary attributes
| Attribute | Type | Description |
|---|---|---|
| scaffold | Scaffold | Scaffold |
| transactionIndex | BigInteger | Transaction index |
| tokenBalance | BigInteger | Scaffold token balance |
| enabled | Boolean | Scaffold enabled |
| currency | String | Fiat amount currency |
| shareHolders | ShareHolder | Scaffold shareholders |
get_summary(address)
summary = op.scaffold.get_summary(address)
get_transactions(address)
transactions = op.scaffold.get_summary(address)
Set web hook request data
| Attribute | Type | Description |
|---|---|---|
| address | String | Scaffold address |
| webHook | String | Scaffold webhook for events |
example:
data = {'webHook': 'https://example.com'}
set_webhook(address, data)
scaffold = op.scaffold.set_webhook(address, data)
Deploy scaffold request data
| Attribute | Type | Description |
|---|---|---|
| openKey | String | User open key |
| description | String | Scaffold description |
| fiatAmount | String | Scaffold fiat amount |
| currency | String | Fiat amount currency |
| conversionAmount | String | Fiat amount converted to ethereum |
| developerAddress | String | Scaffold developer address |
| webHook | String | Scaffold webhook for events |
| properties | ScaffoldProperty[] | Scaffold properties |
example:
data = {
'openKey': open_key,
'developerAddress': '0x0000000000000000000000000000000000000000',
'description': "any_description",
'fiatAmount': "123",
'currency': "USD",
'conversionAmount': '0.2139521163',
'properties': [
{
'name': "property_name",
'type': "STRING",
'defaultValue': "property_value"
}
]
}
deploy_scaffold(data)
scaffold = op.scaffold.deploy(data)
deactivate_scaffold(address)
scaffold = op.scaffold.deactivate(address)
Quota attributes
| Attribute | Type | Description |
|---|---|---|
| currentCount | Int | Current deactivated scaffolds count |
| limitCount | Int | Limit of deactivated scaffolds count |
get_quota()
quota = op.scaffold.get_quota()
Shareholder
Shareholder attributes
| Attribute | Type | Description |
|---|---|---|
| address | String | Shareholder address |
| percent | Int | Shareholder percent |
example:
# Shareholder attributes
data = {
'address': '0x0000000000000000000000000000000000000000',
'percent': 30
}
add(address, data)
summary = op.shareholder.create(address, data)
Update shareholder request data
| Attribute | Type | Description |
|---|---|---|
| percent | Int | Shareholder percent |
example:
data = {'percent': 50}
update(address , holder_address , data)
shareholder_address = "0xDc29484cc9C02Ee01015f33BcA8bBb5C7293Fb54" # an example of shareholder's address
summary = op.shareholder.update(address, shareholder_address, data)
remove(address, holder_address)
summary = op.shareholder.remove(address, shareholder_address)
Metadata
Release files for open-api-sdk 3.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| open-api-sdk-3.0.0.tar.gz | 7.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| open_api_sdk-3.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.6 kB
Release files / open-api-sdk-3.0.0.tar.gz
| Download URL | open-api-sdk-3.0.0.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
98c2ce623b4103414ab6ca62d195ae95a85440290677c03266f04496e614fe08
|
|
BLAKE2b-256 checksum How to use checksums |
f51fe19511b6fb78f885fdbaaeb9af7581e32df8071bc569940f1fe3caf59b72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.8.0
|
Release files / open_api_sdk-3.0.0-py3-none-any.whl
| Download URL | open_api_sdk-3.0.0-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
914e27915e3f3e8d80a7122bd6644c164aa7076fe19ecfffa9793f295df43a74
|
|
BLAKE2b-256 checksum How to use checksums |
61bacb94986ef6548501fb7dae02f286fbe4ed93436f3e759d275e016b9c1966
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.8.0
|
Security for open-api-sdk 3.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.