测试开分支,去除对 tic.common 的依赖,转成对 tic.crypto 和 tic.action
This commit is contained in:
8
eth.js
8
eth.js
@@ -2,7 +2,7 @@
|
||||
const eth = require('etherscan-api').init('E3ZFFAEMNN33KX4HHVUZ4KF8XY1FXMR4BI');
|
||||
const secretStorage = require('./utils/secret-storage');
|
||||
const SigningKey = require('./utils/signing-key.js');
|
||||
const ticCommon = require('tic.common').Crypto;
|
||||
const Ticrypto = require('tic.crypto');
|
||||
const HDNode = require('./utils/hdnode');
|
||||
const utils = require('./util.js');
|
||||
const axios = require('axios');
|
||||
@@ -68,7 +68,7 @@ class ETH {
|
||||
}
|
||||
static generateNewAccount(option = {path:defaultPath}){
|
||||
//major path as default path >/0'/0/0
|
||||
var mnemonic = ticCommon.randomSecword();
|
||||
var mnemonic = Ticrypto.randomSecword();
|
||||
return Object.assign(ETH.fromMnemonic(mnemonic, option),{mnemonic,mnemonic})
|
||||
}
|
||||
static fromMnemonic(mnemonic, option = {path:defaultPath}){
|
||||
@@ -198,10 +198,10 @@ class ETH {
|
||||
}
|
||||
static encrypt(data, key){
|
||||
if(!data || !key) throw new Error('Required Params Missing')
|
||||
return ticCommon.encrypt(data,key)
|
||||
return Ticrypto.encrypt(data,key)
|
||||
}
|
||||
static decrypt(data, key){
|
||||
return ticCommon.decrypt(data, key, {format:"json"}) //return null for wrong key
|
||||
return Ticrypto.decrypt(data, key, {format:"json"}) //return null for wrong key
|
||||
}
|
||||
static async estimateGasPrice(){
|
||||
try{
|
||||
|
||||
Reference in New Issue
Block a user