Package: open-api-sdk
open-api-sdkOpen-api-sdk is a library for interaction with Open Platform.ContentInstallingGet startedAPIScaffoldShareholderInstallingUsing pip:$pipinstallopen-api-sdkGet startedOPEN Platform uses OpenKeys to allow access to the API. You can register a new OpenKey at yourAccount.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 thatopis a result of instantiating theOpenPlatformclass with theopen_keyAPIPage request attributesAttributeTypeDescriptionoffsetLongPage offsetlimitIntPage limitPage response attributesAttributeTypeDescriptiontotalCountLongTotal count of entities in a databaselist[]List of entities with type T (T is generic)ScaffoldScaffold attributesAttributeTypeDescriptionaddressStringScaffold addressabiStringScaffold json interfacedescriptionStringScaffold descriptionfiatAmountStringScaffold fiat amountcurrencyStringFiat amount currencyconversionAmountStringFiat amount converted to ethereumdeveloperAddressStringScaffold developer addresswebHookStringScaffold webhook for eventspropertiesScaffoldProperty[]Scaffold propertiesScaffold properties attributesAttributeTypeDescriptionnameStringProperty nametypePropertyTypeProperty typedefaultValueStringProperty default valueget_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 attributesAttributeTypeDescriptionscaffoldScaffoldScaffoldtransactionIndexBigIntegerTransaction indextokenBalanceBigIntegerScaffold token balanceenabledBooleanScaffold enabledcurrencyStringFiat amount currencyshareHoldersShareHolderScaffold shareholdersget_summary(address)summary=op.scaffold.get_summary(address)get_transactions(address)transactions=op.scaffold.get_summary(address)Set web hook requestdataAttributeTypeDescriptionaddressStringScaffold addresswebHookStringScaffold webhook for eventsexample:data={'webHook':'https://example.com'}set_webhook(address, data)scaffold=op.scaffold.set_webhook(address,data)Deploy scaffold requestdataAttributeTypeDescriptionopenKeyStringUser open keydescriptionStringScaffold descriptionfiatAmountStringScaffold fiat amountcurrencyStringFiat amount currencyconversionAmountStringFiat amount converted to ethereumdeveloperAddressStringScaffold developer addresswebHookStringScaffold webhook for eventspropertiesScaffoldProperty[]Scaffold propertiesexample: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 attributesAttributeTypeDescriptioncurrentCountIntCurrent deactivated scaffolds countlimitCountIntLimit of deactivated scaffolds countget_quota()quota=op.scaffold.get_quota()ShareholderShareholder attributesAttributeTypeDescriptionaddressStringShareholder addresspercentIntShareholder percentexample:# Shareholder attributesdata={'address':'0x0000000000000000000000000000000000000000','percent':30}add(address, data)summary=op.shareholder.create(address,data)Update shareholder requestdataAttributeTypeDescriptionpercentIntShareholder percentexample: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)