aboutsummaryrefslogtreecommitdiff
path: root/src/js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js')
-rw-r--r--src/js/fio-util.js19
-rw-r--r--src/js/index.js13
2 files changed, 32 insertions, 0 deletions
diff --git a/src/js/fio-util.js b/src/js/fio-util.js
new file mode 100644
index 0000000..35cb1ba
--- /dev/null
+++ b/src/js/fio-util.js
@@ -0,0 +1,19 @@
1function FIObufferToPublic(pubBuf) {
2 const Buffer = libs.buffer.Buffer;
3 const FIO_PUBLIC_PREFIX = "FIO";
4
5 let checksum = libs.createHash("rmd160").update(pubBuf).digest("hex").slice(0, 8);
6 pubBuf = Buffer.concat([pubBuf, Buffer.from(checksum, "hex")]);
7 return FIO_PUBLIC_PREFIX.concat(libs.bs58.encode(pubBuf));
8}
9
10function FIObufferToPrivate(privBuf) {
11 const Buffer = libs.buffer.Buffer;
12 const FIO_PRIVATE_PREFIX = "80";
13
14 privBuf = Buffer.concat([Buffer.from(FIO_PRIVATE_PREFIX, "hex"), privBuf]);
15 let tmp = libs.createHash("sha256").update(privBuf).digest();
16 let checksum = libs.createHash("sha256").update(tmp).digest("hex").slice(0, 8);
17 privBuf = Buffer.concat([privBuf, Buffer.from(checksum, "hex")]);
18 return libs.bs58.encode(privBuf);
19} \ No newline at end of file
diff --git a/src/js/index.js b/src/js/index.js
index 32825b2..e8072e4 100644
--- a/src/js/index.js
+++ b/src/js/index.js
@@ -1241,6 +1241,12 @@
1241 privkey = eosUtil.bufferToPrivate(keyPair.d.toBuffer(32)); 1241 privkey = eosUtil.bufferToPrivate(keyPair.d.toBuffer(32));
1242 } 1242 }
1243 1243
1244 if (networks[DOM.network.val()].name == "FIO - Foundation for Interwallet Operability") {
1245 address = ""
1246 pubkey = FIObufferToPublic(keyPair.getPublicKeyBuffer());
1247 privkey = FIObufferToPrivate(keyPair.d.toBuffer(32));
1248 }
1249
1244 //Groestlcoin Addresses are different 1250 //Groestlcoin Addresses are different
1245 if(isGRS()) { 1251 if(isGRS()) {
1246 1252
@@ -2499,6 +2505,13 @@
2499 }, 2505 },
2500 }, 2506 },
2501 { 2507 {
2508 name: "FIO - Foundation for Interwallet Operability",
2509 onSelect: function() {
2510 network = libs.bitcoin.networks.bitcoin;
2511 setHdCoin(235);
2512 },
2513 },
2514 {
2502 name: "FIX - FIX", 2515 name: "FIX - FIX",
2503 onSelect: function() { 2516 onSelect: function() {
2504 network = libs.bitcoin.networks.fix; 2517 network = libs.bitcoin.networks.fix;