Compare commits
1 Commits
5d23f2efa1
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db65de0771 |
17
README.md
17
README.md
@@ -4,21 +4,23 @@
|
||||
|
||||
## Table of Contents
|
||||
|
||||
1. [Installation Guide](#1-installation-guide)
|
||||
2. [Usage](#2-usage)
|
||||
3. [API Specification](#3-api-specification)
|
||||
4. [References](#4-references)
|
||||
1. [Installation Guide](#1-installation-guide)
|
||||
2. [Usage](#2-usage)
|
||||
3. [API Specification](#3-api-specification)
|
||||
4. [References](#4-references)
|
||||
|
||||
## 1. Installation Guide
|
||||
|
||||
在前后端软件的 package.json 的依赖清单中引入本库:
|
||||
|
||||
```
|
||||
npm install git+https://git.faronear.org/tic/tic.action#RELEASE_OR_BRANCH --save
|
||||
npm install git+https://git.tic.cc/tic/tic.action#RELEASE_OR_BRANCH --save
|
||||
```
|
||||
|
||||
## 2. Usage
|
||||
|
||||
首先在前端JS里创建事务:
|
||||
首先在前端 JS 里创建事务:
|
||||
|
||||
```
|
||||
let ActTransfer=require('tic.action/ActTransfer') // 引用
|
||||
let action=new ActTransfer({ amount: 金额, toAddress: 对方地址}) // 组装事务对象
|
||||
@@ -26,6 +28,7 @@ action.packMe(keypair) // 用当前用户的公私钥,对该事务进行签名
|
||||
```
|
||||
|
||||
然后把事务发送到时光链,例如通过 jQuery:
|
||||
|
||||
```
|
||||
$.post(
|
||||
'https://test.bittic.net/api/Action/prepare',
|
||||
@@ -38,4 +41,4 @@ $.post(
|
||||
|
||||
## 4. References
|
||||
|
||||
+ 返回根文档: <https://git.faronear.org/tic/_tic/>
|
||||
- 返回根文档: <https://git.tic.cc/tic/_tic/>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
"name": "tic-traction",
|
||||
"version": "0.1.0",
|
||||
"dependencies": {
|
||||
"so.ling": "git+https://git.faronear.org/so/so.ling",
|
||||
"tic-crypto": "git+https://git.faronear.org/tic/tic-crypto"
|
||||
"so.ling": "git+https://git.tic.cc/so/so.ling",
|
||||
"tic-crypto": "git+https://git.tic.cc/tic/tic-crypto"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"scripts": {},
|
||||
|
||||
@@ -22,6 +22,12 @@
|
||||
*.nosf/
|
||||
*.nosf.*/
|
||||
|
||||
## everything 'git pull or fetch' will update `.git/FETCH_HEAD`, even if the content doesn't change. To avoid too many useless updates of this file in Seafile history:
|
||||
FETCH_HEAD
|
||||
*/FETCH_HEAD
|
||||
|
||||
.Trash/
|
||||
|
||||
.DS_Store
|
||||
*/.DS_Store
|
||||
|
||||
@@ -48,12 +54,18 @@ _desktop.ini
|
||||
node_modules/
|
||||
*/node_modules/
|
||||
package-lock.json
|
||||
*/package-lock.json
|
||||
|
||||
pages4loader.json5
|
||||
*/pages4loader.json5
|
||||
|
||||
.deploy_git/
|
||||
*/.deploy_git/
|
||||
|
||||
# next.js 项目
|
||||
.next/
|
||||
*/.next/
|
||||
|
||||
# HBuilder 目录
|
||||
unpackage/
|
||||
*/unpackage/
|
||||
|
||||
Reference in New Issue
Block a user