1
This commit is contained in:
parent
9a36a18958
commit
86cdbd5f1d
@ -1,8 +0,0 @@
|
||||
const utils = require('j7/utils');
|
||||
const basewrap = require('./basewrap');
|
||||
|
||||
class Contract extends basewrap.BaseWrap {
|
||||
|
||||
}
|
||||
|
||||
module.exports = Contract;
|
@ -1,8 +0,0 @@
|
||||
const utils = require('j7/utils');
|
||||
const basewrap = require('./basewrap');
|
||||
|
||||
class Web3 extends basewrap.BaseWrap {
|
||||
|
||||
}
|
||||
|
||||
module.exports = Web3;
|
@ -116,8 +116,8 @@ function init() {
|
||||
}
|
||||
load();
|
||||
{
|
||||
traverseMetaList('MarketDb', (dbConf, idx) => {
|
||||
app.registerDb('MarketDb' + idx, dbConf);
|
||||
traverseMetaList('BlockChainDb', (dbConf, idx) => {
|
||||
app.registerDb('BlockChainDb' + idx, dbConf);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -152,45 +152,8 @@ function traverseMetaList(name, cb) {
|
||||
}
|
||||
}
|
||||
|
||||
function getWeb3Conf() {
|
||||
return getMetaByKey('Web3', '0');
|
||||
}
|
||||
|
||||
function getContracts() {
|
||||
return getMetaList('Contract');
|
||||
}
|
||||
|
||||
function getContractByName(name) {
|
||||
return getMetaByKey('Contract', name);
|
||||
}
|
||||
|
||||
function getContractByAddress(address) {
|
||||
let contract = null;
|
||||
getContracts().forEach((item) => {
|
||||
if (item['address'] == address) {
|
||||
contract = item;
|
||||
}
|
||||
});
|
||||
return contract;
|
||||
}
|
||||
|
||||
function getUserAddress() {
|
||||
return getWeb3Conf()['user_address'];
|
||||
}
|
||||
|
||||
function getPrivateKey() {
|
||||
return getWeb3Conf()['private_key'];
|
||||
}
|
||||
|
||||
exports.init = init;
|
||||
|
||||
exports.getMetaByKey = getMetaByKey;
|
||||
exports.traverseMetaList = traverseMetaList;
|
||||
exports.callMetaStatic = callMetaStatic;
|
||||
|
||||
exports.getWeb3Conf = getWeb3Conf;
|
||||
exports.getContracts = getContracts;
|
||||
exports.getContractByName = getContractByName;
|
||||
exports.getContractByAddress = getContractByAddress;
|
||||
exports.getUserAddress = getUserAddress;
|
||||
exports.getPrivateKey = getPrivateKey;
|
||||
|
Loading…
x
Reference in New Issue
Block a user