rename seckey to prikey
This commit is contained in:
8
btc.js
8
btc.js
@@ -10,7 +10,7 @@ const BTC_TXFEE = 30
|
||||
|
||||
class BTC {
|
||||
constructor (privateKey) {
|
||||
if (!ticc.is_seckey({ seckey: privateKey }))
|
||||
if (!ticc.is_seckey({ prikey: privateKey }))
|
||||
throw new Error('Invalid PrivateKey')
|
||||
var publicKey = ticc.seckey_to_pubkey(privateKey)
|
||||
Object.defineProperties(this, {
|
||||
@@ -22,7 +22,7 @@ class BTC {
|
||||
publicKey: {
|
||||
enumerable: true,
|
||||
writable: false,
|
||||
value: ticc.seckey_to_pubkey({ seckey: privateKey, coin: 'BTC' })
|
||||
value: ticc.seckey_to_pubkey({ prikey: privateKey, coin: 'BTC' })
|
||||
},
|
||||
address: {
|
||||
enumerable: true,
|
||||
@@ -61,7 +61,7 @@ class BTC {
|
||||
var mnemonic = ticc.randomize_secword()
|
||||
return Object.assign(
|
||||
new BTC(
|
||||
ticc.secword_to_keypair({ secword: mnemonic, coin: 'BTC' }).seckey
|
||||
ticc.secword_to_keypair({ secword: mnemonic, coin: 'BTC' }).prikey
|
||||
),
|
||||
{ mnemonic: mnemonic }
|
||||
)
|
||||
@@ -70,7 +70,7 @@ class BTC {
|
||||
HDNode.isValidMnemonic(mnemonic)
|
||||
return Object.assign(
|
||||
new BTC(
|
||||
ticc.secword_to_keypair({ secword: mnemonic, coin: 'BTC' }).seckey
|
||||
ticc.secword_to_keypair({ secword: mnemonic, coin: 'BTC' }).prikey
|
||||
),
|
||||
{ mnemonic: mnemonic }
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user