rename seckey to prikey

This commit is contained in:
Luk Lu
2022-08-14 15:51:14 +08:00
parent bbba2589d5
commit 6bcc378170
2 changed files with 18 additions and 18 deletions

8
btc.js
View File

@@ -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 }
)