new Transaction(consArgs) → {Transaction}
构建RepChain交易对象
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
consArgs |
Object | 交易对象实例构造参数
Properties
|
- Source:
Returns:
Transaction对象实例
- Type
- Transaction
Methods
sign(signArgs) → {Buffer}
对新创建的交易实例进行签名
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
signArgs |
Object | 签名所需参数
Properties
|
- Source:
Returns:
- 已签名交易数据
- Type
- Buffer
verifySignature(pubKey, alg) → {boolean}
对已签名的交易对象进行签名验证
Parameters:
Name | Type | Description |
---|---|---|
pubKey |
String | pem格式的公钥 |
alg |
String | 使用的签名算法 |
- Source:
Returns:
验签是否成功
- Type
- boolean