把大多数ticc方法的参数类型统一为 { ... } 对象
This commit is contained in:
parent
94152ec736
commit
bbba2589d5
3
btc.js
3
btc.js
@ -10,7 +10,8 @@ const BTC_TXFEE = 30
|
||||
|
||||
class BTC {
|
||||
constructor (privateKey) {
|
||||
if (!ticc.is_seckey(privateKey)) throw new Error('Invalid PrivateKey')
|
||||
if (!ticc.is_seckey({ seckey: privateKey }))
|
||||
throw new Error('Invalid PrivateKey')
|
||||
var publicKey = ticc.seckey_to_pubkey(privateKey)
|
||||
Object.defineProperties(this, {
|
||||
privateKey: {
|
||||
|
2
tic.js
2
tic.js
@ -8,7 +8,7 @@ const TIC_NODE = require('./netConfig').TIC_NODE
|
||||
|
||||
class TIC {
|
||||
constructor (seckey, option = {}) {
|
||||
if (!seckey || !ticc.is_seckey(seckey)) throw 'ERROR:Invalid Seckey'
|
||||
if (!seckey || !ticc.is_seckey({ seckey })) throw 'ERROR:Invalid Seckey'
|
||||
Object.defineProperties(this, {
|
||||
seckey: {
|
||||
value: seckey,
|
||||
|
Loading…
Reference in New Issue
Block a user