Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding localStorage CryptoJS and others to make SimpleWalleFlorincoin.js work on server side #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/static/js/SimpleWalletFlorincoin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,23 @@
*
* Created by Someguy123 (http://someguy123.com)
* Modified by bitspill
* Modified by daviortega - server-side
*/

const jsdom = require("jsdom");
const { JSDOM } = jsdom;
const { window } = new JSDOM(`<!DOCTYPE html>`);
const $ = require('jquery')(window);

let Bitcoin = require ('./SimpleDeps.js')

if (typeof localStorage === "undefined" || localStorage === null) {
var LocalStorage = require('node-localstorage').LocalStorage;
localStorage = new LocalStorage('./scratch');
}

let CryptoJS = require('crypto-js')

var flovaultBaseURL = "https://flovault.alexandria.io";
var florinsightBaseURL = "https://florinsight.alexandria.io";

Expand All @@ -16,6 +32,9 @@ var Wallet = (function () {
this.addresses = {};
this.balances = {};
this.coin_network = Bitcoin.networks.florincoin;
console.log('here')
console.log(Bitcoin)
console.log(typeof Bitcoin)
this.CryptoConfig = {
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Iso10126,
Expand Down