用于与开放平台交互的sdk库。

open-api-sdk的Python项目详细描述


打开api sdk

open api-sdk是一个与开放平台交互的库。

内容

安装

使用pip:

$ pip install open-api-sdk

开始

开放平台使用openkeys来允许访问api。您可以在Account.上注册新的openkey

open平台希望openkey包含在对服务器的所有api请求中。

我们假设此时您已经拥有了openkey。

要访问库,请导入一个openplatform类并使用openkey调用一个实例,如下所示:

fromopenp_pyimportOpenPy# Access API via instance of OpenPlatform classop=OpenPy(open_key)

open_key-你的公开密钥。

在下面的示例中,假设op是用open_key

实例化OpenPlatform类的结果。

api

页面请求属性
AttributeTypeDescription
offsetLongPage offset
limitIntPage limit

页面响应属性
AttributeTypeDescription
totalCountLongTotal count of entities in a database
list[]List of entities with type T (T is generic)
脚手架

脚手架属性
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
脚手架属性属性
AttributeTypeDescription
nameStringProperty name
typePropertyTypeProperty type
defaultValueStringProperty default value
全部获取(
scaffolds=op.scaffold.get_all()
获取单个(地址)
address='0x1c297f40beb075936d6dbe4b245b92738867ecb1'# an address of the scaffold (example)scaffold=op.scaffold.get_single(address)
脚手架汇总属性
AttributeTypeDescription
scaffoldScaffoldScaffold
transactionIndexBigIntegerTransaction index
tokenBalanceBigIntegerScaffold token balance
enabledBooleanScaffold enabled
currencyStringFiat amount currency
shareHoldersShareHolderScaffold shareholders
获取摘要(地址)
summary=op.scaffold.get_summary(address)
获取交易(地址)
transactions=op.scaffold.get_summary(address)
设置web hook请求data
AttributeTypeDescription
addressStringScaffold address
webHookStringScaffold webhook for events
示例:
data={'webHook':'https://example.com'}
设置Webhook(地址、数据)
scaffold=op.scaffold.set_webhook(address,data)
部署脚手架请求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
示例:
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"}]}
部署脚手架(数据)
scaffold=op.scaffold.deploy(data)
停用脚手架(地址)
scaffold=op.scaffold.deactivate(address)
配额属性
AttributeTypeDescription
currentCountIntCurrent deactivated scaffolds count
limitCountIntLimit of deactivated scaffolds count
获取配额()
quota=op.scaffold.get_quota()

股东

股东属性
AttributeTypeDescription
addressStringShareholder address
percentIntShareholder percent
示例:
# Shareholder attributesdata={'address':'0x0000000000000000000000000000000000000000','percent':30}
添加(地址、数据)
summary=op.shareholder.create(address,data)
更新股东请求data
AttributeTypeDescription
percentIntShareholder percent
示例:
data={'percent':50}
更新(地址、持有人地址、数据)
shareholder_address="0xDc29484cc9C02Ee01015f33BcA8bBb5C7293Fb54"# an example of shareholder's addresssummary=op.shareholder.update(address,shareholder_address,data)
删除(地址,持有者地址)
summary=op.shareholder.remove(address,shareholder_address)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java AfterburnerFX加载错误文件xyz。未找到fxml,正在尝试使用驼峰案例   java如何灵活地使用通用对象?   JAVA JPA保存到TSV而不是SQL   java关闭当前窗口并弹出上一个窗口(windowListener)   java删除\删除绑定对象   java构造函数。newInstance()在JUnit和实际运行时中的行为不同   java将字符串中的字符翻转到字母顺序   如何让java等待事件?   使用Flyway的java MySQL JDBC驱动程序   java ImageAdapter从HashMap put方法返回NullPointerException   java Camel:找不到restlet bean   java Gradle下载源依赖项   POST方法Spring和Thymeleaf中的java编码问题   用于管理后台作业的java Spring兼容机制   java在连续发送25MB文件5到10次的同时,我通过javamail收到以下异常   java应用程序在试图更改重新加载的片段中的FloatingActionButton的状态时不断崩溃   运行小程序时出现java Magic value错误   java如何使用jdbc连接将excel工作表中的数据存储到mysql数据库   Eclipse,来自src的Java。文件夹?