Skip to content

Repository files navigation

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:

fromopenp_pyimportOpenPy# Access API via instance of OpenPlatform classop=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

AttributeTypeDescription
offsetLongPage offset
limitIntPage limit

Page response attributes

AttributeTypeDescription
totalCountLongTotal count of entities in a database
list[]List of entities with type T (T is generic)

Scaffold

Scaffold attributes
AttributeTypeDescription
addressStringScaffold address
abiStringScaffold json interface
descriptionStringScaffold description
fiatAmountStringScaffold fiat amount
currencyStringFiat amount currency
conversionAmountStringFiat amount converted to ethereum
developerAddressStringScaffold developer address
webHookStringScaffold webhook for events
propertiesScaffoldProperty[]Scaffold properties
Scaffold properties attributes
AttributeTypeDescription
nameStringProperty name
typePropertyTypeProperty type
defaultValueStringProperty 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
AttributeTypeDescription
scaffoldScaffoldScaffold
transactionIndexBigIntegerTransaction index
tokenBalanceBigIntegerScaffold token balance
enabledBooleanScaffold enabled
currencyStringFiat amount currency
shareHoldersShareHolderScaffold shareholders
get_summary(address)
summary=op.scaffold.get_summary(address)
get_transactions(address)
transactions=op.scaffold.get_summary(address)
Set web hook request data
AttributeTypeDescription
addressStringScaffold address
webHookStringScaffold webhook for events
example:
data= {'webHook': 'https://example.com'}
set_webhook(address, data)
scaffold=op.scaffold.set_webhook(address, data)
Deploy scaffold request data
AttributeTypeDescription
openKeyStringUser open key
descriptionStringScaffold description
fiatAmountStringScaffold fiat amount
currencyStringFiat amount currency
conversionAmountStringFiat amount converted to ethereum
developerAddressStringScaffold developer address
webHookStringScaffold webhook for events
propertiesScaffoldProperty[]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
AttributeTypeDescription
currentCountIntCurrent deactivated scaffolds count
limitCountIntLimit of deactivated scaffolds count
get_quota()
quota=op.scaffold.get_quota()

Shareholder

Shareholder attributes
AttributeTypeDescription
addressStringShareholder address
percentIntShareholder percent
example:
# Shareholder attributesdata= {
'address': '0x0000000000000000000000000000000000000000',
'percent': 30
}
add(address, data)
summary=op.shareholder.create(address, data)
Update shareholder request data
AttributeTypeDescription
percentIntShareholder percent
example:
data= {'percent': 50}
update(address , holder_address , data)
shareholder_address="0xDc29484cc9C02Ee01015f33BcA8bBb5C7293Fb54"# an example of shareholder's addresssummary=op.shareholder.update(address, shareholder_address, data)
remove(address, holder_address)
summary=op.shareholder.remove(address, shareholder_address)

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages