改进文档。
This commit is contained in:
parent
c0f03840e0
commit
ca15dc3eeb
32
README.md
32
README.md
@ -4,16 +4,38 @@
|
|||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
1. [Installation Guide](./doc/Installation.md)
|
1. [Installation Guide](#1-installation-guide)
|
||||||
2. [API Specification](./doc/API.md)
|
2. [Usage](#2-usage)
|
||||||
3. [References](#references)
|
3. [API Specification](#3-api-specification)
|
||||||
|
4. [References](#4-references)
|
||||||
|
|
||||||
## 1. Installation Guide
|
## 1. Installation Guide
|
||||||
前后端软件引入本库后即可使用:
|
|
||||||
|
在前后端软件的 package.json 的依赖清单中引入本库:
|
||||||
```
|
```
|
||||||
npm install git+https://git.faronear.org/tic/tic.action#latest_stable --save
|
npm install git+https://git.faronear.org/tic/tic.action#latest_stable --save
|
||||||
```
|
```
|
||||||
|
|
||||||
## 3. References
|
## 2. Usage
|
||||||
|
|
||||||
|
首先在前端JS里创建事务:
|
||||||
|
```
|
||||||
|
let ActTransfer=require('tic.action/ActTransfer') // 引用
|
||||||
|
let action=new ActTransfer({ amount: 金额, toAddress: 对方地址}) // 组装事务对象
|
||||||
|
action.packMe(keypair) // 用当前用户的公私钥,对该事务进行签名
|
||||||
|
```
|
||||||
|
|
||||||
|
然后把事务发送到时光链,例如通过 jQuery:
|
||||||
|
```
|
||||||
|
$.post(
|
||||||
|
'https://test.bittic.net/api/Action/prepare',
|
||||||
|
{ Action:action },
|
||||||
|
'json'
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
## 3. API Specification
|
||||||
|
|
||||||
|
## 4. References
|
||||||
|
|
||||||
+ 返回根文档: <https://git.faronear.org/tic/doc/>
|
+ 返回根文档: <https://git.faronear.org/tic/doc/>
|
||||||
|
Loading…
Reference in New Issue
Block a user