English / 中文
DAPI是基于Ontology blockchain开发dApp的轻量级去中心化API。本工程是根据OEP-6实现了dAPI ,请参考OEP-6 协议。
使用前请先安装 dAPI provider . 比如 Cyano Wallet.
dAPI使用TypeScript实现, 同时也支持在JavaScript工程中使用.
ontology-dapi 可以作为 CommonJS/ES6 模块或在网页中直接使用.
npm install @ont-dev/ontology-dapi
或者
yarn add @ont-dev/ontology-dapi
var client = require('@ont-dev/ontology-dapi').client;
import { client } from '@ont-dev/ontology-dapi';
导入 '/lib' 文件夹下的 browser.js 文件:
<script src="./lib/browser.js"></script>
使用方法.
var client = dApi.client;
dApp 先注册 dAPI provider的客户端.
import { client } from '@ont-dev/ontology-dapi';
client.registerClient({});
请参考例子, EXAMPLES.md 或 demo app
所有dAPI方法分成这几个模块: asset, identity, message, network, provider, smartContract and utils. 方法定义请参考 OEP-6.
- Node
- Yarn
执行如下命令:
git clone 'https://github.com/ontio/ontology-dapi.git'
cd ontology-dapi
yarn
yarn build:dev
yarn build:prod
- TypeScript - Used language
- Node.js - JavaScript runtime for building
- Matus Zamborsky - Initial work - Backslash47
This project is licensed under the ISC License - see the LICENSE.md file for details