rename seckey_to_pubkey to prikey_to_pubkey
This commit is contained in:
8
tic.js
8
tic.js
@@ -8,7 +8,7 @@ const TIC_NODE = require('./netConfig').TIC_NODE
|
||||
|
||||
class TIC {
|
||||
constructor (prikey, option = {}) {
|
||||
if (!prikey || !ticc.is_seckey({ prikey })) throw 'ERROR:Invalid Seckey'
|
||||
if (!prikey || !ticc.is_prikey({ prikey })) throw 'ERROR:Invalid Seckey'
|
||||
Object.defineProperties(this, {
|
||||
prikey: {
|
||||
value: prikey,
|
||||
@@ -16,13 +16,13 @@ class TIC {
|
||||
writable: false
|
||||
},
|
||||
pubkey: {
|
||||
value: ticc.seckey_to_pubkey({ prikey }),
|
||||
value: ticc.prikey_to_pubkey({ prikey }),
|
||||
enumerable: true,
|
||||
writable: false
|
||||
},
|
||||
address: {
|
||||
value: ticc.pubkey_to_address({
|
||||
pubkey: ticc.seckey_to_pubkey(prikey)
|
||||
pubkey: ticc.prikey_to_pubkey(prikey)
|
||||
}),
|
||||
enumerable: true,
|
||||
writable: false
|
||||
@@ -93,7 +93,7 @@ class TIC {
|
||||
}
|
||||
|
||||
static isValidAddress (address) {
|
||||
return ticc.is_chain_address({ address })
|
||||
return ticc.which_chain_address({ address })
|
||||
}
|
||||
|
||||
async sendTransaction (toAddress, amount, option = { gasFee: TIC_TXFEE }) {
|
||||
|
||||
Reference in New Issue
Block a user