时光链.事务库(已废弃):供前后端调用,前端用来创建并签名事务,后台用来验证、准备、执行事务。
Go to file
2020-03-16 08:15:13 +08:00
.gitignore 从tic.common转化而来,彻底脱离对 Base/*, _Ling.js 的依赖,只保留并提供 Action及其子类。 2018-11-27 10:42:05 +08:00
Action.js getActionType 和 createTypedAction 2020-03-16 07:57:47 +08:00
ActionLockProof.js 采用新结构:Action*.js 从 node.server 中删除,集中存放于本库。 2019-04-09 20:16:58 +08:00
ActionMultisig.js 不在 index.js 里引入 Action.js,避免循环引入。 2020-02-27 15:27:04 +08:00
ActionRegisterChain.js DAD._table 改为 MOM._table 2020-02-10 16:04:07 +08:00
ActionStore.js DAD._table 改为 MOM._table 2020-02-10 16:04:07 +08:00
ActionTac.js 采用新结构:Action*.js 从 node.server 中删除,集中存放于本库。 2019-04-09 20:16:58 +08:00
ActionTransfer.js 更新countAction值;前端送来的Amount要确保转成Number 2020-02-29 15:31:36 +08:00
index.js 在 Action.js 里:把 wo 改名为 TypedActionDict; 去掉 _initTypeDict,require('...') 即可 2020-03-15 21:19:38 +08:00
package.json 刷新 package.json 里的库 2020-02-27 15:29:28 +08:00
README.md 更新 'README.md' 2019-08-27 07:31:32 +00:00

tic.action

时光链事务库:前后端通用的事务库。前端用来生成用户指定的事务并签名,后台用来验证、准备、执行用户提交的事务。

Table of Contents

  1. Installation Guide
  2. Usage
  3. API Specification
  4. References

1. Installation Guide

在前后端软件的 package.json 的依赖清单中引入本库:

npm install git+https://git.faronear.org/tic/tic.action#RELEASE_OR_BRANCH --save

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