时光链.事务库(已废弃):供前后端调用,前端用来创建并签名事务,后台用来验证、准备、执行事务。
Go to file
2024-01-28 12:16:46 +08:00
.gitignore updated .gitignore and seafile-ignore.txt using npm/sysconfig/*-ignore-find2merge.sh 2024-01-28 12:16:46 +08:00
Action.js rename is_chain_address to which_chain_address 2022-08-16 15:30:35 +08:00
ActionLockProof.js 采用新结构:Action*.js 从 node.server 中删除,集中存放于本库。 2019-04-09 20:16:58 +08:00
ActionMultisig.js rename is_chain_address to which_chain_address 2022-08-16 15:30:35 +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 rename ticc.sign/verify/encrypt/decrypt/hash to ticc.xxx_easy 2022-07-23 16:03:24 +08:00
ActionTransfer.js u 2022-07-03 16:02:58 +08:00
index.js 去掉 Action.js 里对 ActionXxx 的引入,这样还是会造成循环引入的。 2020-02-27 16:08:11 +08:00
package.json u 2022-06-05 11:30:32 +08:00
README.md 更新 'README.md' 2019-08-27 07:31:32 +00:00
seafile-ignore.txt updated .gitignore and seafile-ignore.txt using npm/sysconfig/*-ignore-find2merge.sh 2024-01-28 12:16:46 +08: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