forked from irisnet/irisnet-crypto
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
33 lines (29 loc) · 797 Bytes
/
index.js
File metadata and controls
33 lines (29 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const Crypto = require("./src/crypto");
const Builder = require("./src/builder").Builder;
const config = require('./config');
const Codec = require('./src/util/codec');
function getBuilder(chainName,network){
setNetwork(network);
return Builder.getBuilder(chainName)
}
function getCrypto(chainName,network){
setNetwork(network);
return Crypto.getCrypto(chainName)
}
function setNetwork(network){
if(network && network === 'testnet'){
config.iris.bech32 = {
accAddr: "faa",
valAddr: "fva",
accPub: "fap"
};
}else {
config.iris.bech32 = {
accAddr: "iaa",
valAddr: "iva",
accPub: "iap"
};
}
return config
}
module.exports = {getCrypto,getBuilder,config,Codec};