insight-ui
Advanced tools
Comparing version 5.0.0-beta.37 to 5.0.0-beta.38
{ | ||
"name": "insight-ui", | ||
"description": "An open-source frontend for the Insight API. The Insight API provides you with a convenient, powerful and simple way to query and broadcast data on the bitcoin network and build your own services with it.", | ||
"version": "5.0.0-beta.37", | ||
"version": "5.0.0-beta.38", | ||
"repository": "git://github.com/bitpay/insight-ui.git", | ||
@@ -6,0 +6,0 @@ "bugs": { |
// Source: public/src/js/app.js | ||
var defaultLanguage = localStorage.getItem('insight-language') || 'en'; | ||
var defaultCurrency = localStorage.getItem('insight-currency') || 'BCH'; | ||
var defaultCurrency = localStorage.getItem('insight-currency') || 'BTC'; | ||
@@ -17,2 +17,3 @@ angular.module('insight',[ | ||
'insight.socket', | ||
'insight.api', | ||
'insight.blocks', | ||
@@ -30,2 +31,3 @@ 'insight.transactions', | ||
angular.module('insight.socket', []); | ||
angular.module('insight.api', []); | ||
angular.module('insight.blocks', []); | ||
@@ -274,3 +276,3 @@ angular.module('insight.transactions', []); | ||
response = _roundFloat((value * this.factor), 2); | ||
} else if (this.symbol === 'mBCH') { | ||
} else if (this.symbol === 'mBTC') { | ||
this.factor = 1000; | ||
@@ -281,5 +283,5 @@ response = _roundFloat((value * this.factor), 5); | ||
response = _roundFloat((value * this.factor), 2); | ||
} else { | ||
} else { // assumes symbol is BTC | ||
this.factor = 1; | ||
response = value; | ||
response = _roundFloat((value * this.factor), 8); | ||
} | ||
@@ -301,5 +303,5 @@ // prevent sci notation | ||
Currency.get({}, function(res) { | ||
$rootScope.currency.factor = $rootScope.currency.kraken = res.data.kraken; | ||
$rootScope.currency.factor = $rootScope.currency.bitstamp = res.data.bitstamp; | ||
}); | ||
} else if (currency === 'mBCH') { | ||
} else if (currency === 'mBTC') { | ||
$rootScope.currency.factor = 1000; | ||
@@ -315,3 +317,3 @@ } else if (currency === 'bits') { | ||
Currency.get({}, function(res) { | ||
$rootScope.currency.factor = $rootScope.currency.kraken = res.data.kraken; | ||
$rootScope.currency.factor = $rootScope.currency.bitstamp = res.data.bitstamp; | ||
}); | ||
@@ -368,4 +370,4 @@ | ||
factor: 1, | ||
kraken: 0, | ||
symbol: 'BCH' | ||
bitstamp: 0, | ||
symbol: 'BTC' | ||
}; | ||
@@ -464,3 +466,3 @@ | ||
angular.module('insight.messages').controller('VerifyMessageController', | ||
function($scope, $http) { | ||
function($scope, $http, Api) { | ||
$scope.message = { | ||
@@ -486,3 +488,3 @@ address: '', | ||
$scope.verification.address = $scope.message.address; | ||
$http.post(window.apiPrefix + '/messages/verify', $scope.message) | ||
$http.post(Api.apiPrefix + '/messages/verify', $scope.message) | ||
.success(function(data, status, headers, config) { | ||
@@ -958,3 +960,3 @@ if(typeof(data.result) != 'boolean') { | ||
angular.module('insight.transactions').controller('SendRawTransactionController', | ||
function($scope, $http) { | ||
function($scope, $http, Api) { | ||
$scope.transaction = ''; | ||
@@ -973,3 +975,3 @@ $scope.status = 'ready'; // ready|loading|sent|error | ||
$scope.status = 'loading'; | ||
$http.post(window.apiPrefix + '/tx/send', postData) | ||
$http.post(Api.apiPrefix + '/tx/send', postData) | ||
.success(function(data, status, headers, config) { | ||
@@ -999,4 +1001,4 @@ if(typeof(data.txid) != 'string') { | ||
angular.module('insight.address').factory('Address', | ||
function($resource) { | ||
return $resource(window.apiPrefix + '/addr/:addrStr/?noTxList=1', { | ||
function($resource, Api) { | ||
return $resource(Api.apiPrefix + '/addr/:addrStr/?noTxList=1', { | ||
addrStr: '@addStr' | ||
@@ -1021,7 +1023,17 @@ }, { | ||
// Source: public/src/js/services/api.js | ||
angular.module('insight.api') | ||
.factory('Api', | ||
function() { | ||
return { | ||
apiPrefix: '/api' | ||
} | ||
}); | ||
// Source: public/src/js/services/blocks.js | ||
angular.module('insight.blocks') | ||
.factory('Block', | ||
function($resource) { | ||
return $resource(window.apiPrefix + '/block/:blockHash', { | ||
function($resource, Api) { | ||
return $resource(Api.apiPrefix + '/block/:blockHash', { | ||
blockHash: '@blockHash' | ||
@@ -1045,8 +1057,8 @@ }, { | ||
.factory('Blocks', | ||
function($resource) { | ||
return $resource(window.apiPrefix + '/blocks'); | ||
function($resource, Api) { | ||
return $resource(Api.apiPrefix + '/blocks'); | ||
}) | ||
.factory('BlockByHeight', | ||
function($resource) { | ||
return $resource(window.apiPrefix + '/block-index/:blockHeight'); | ||
function($resource, Api) { | ||
return $resource(Api.apiPrefix + '/block-index/:blockHeight'); | ||
}); | ||
@@ -1056,4 +1068,4 @@ | ||
angular.module('insight.currency').factory('Currency', | ||
function($resource) { | ||
return $resource(window.apiPrefix + '/currency'); | ||
function($resource, Api) { | ||
return $resource(Api.apiPrefix + '/currency'); | ||
}); | ||
@@ -1069,4 +1081,4 @@ | ||
.factory('Version', | ||
function($resource) { | ||
return $resource(window.apiPrefix + '/version'); | ||
function($resource, Api) { | ||
return $resource(Api.apiPrefix + '/version'); | ||
}); | ||
@@ -1151,4 +1163,4 @@ | ||
.factory('Status', | ||
function($resource) { | ||
return $resource(window.apiPrefix + '/status', { | ||
function($resource, Api) { | ||
return $resource(Api.apiPrefix + '/status', { | ||
q: '@q' | ||
@@ -1158,8 +1170,8 @@ }); | ||
.factory('Sync', | ||
function($resource) { | ||
return $resource(window.apiPrefix + '/sync'); | ||
function($resource, Api) { | ||
return $resource(Api.apiPrefix + '/sync'); | ||
}) | ||
.factory('PeerSync', | ||
function($resource) { | ||
return $resource(window.apiPrefix + '/peer'); | ||
function($resource, Api) { | ||
return $resource(Api.apiPrefix + '/peer'); | ||
}); | ||
@@ -1170,4 +1182,4 @@ | ||
.factory('Transaction', | ||
function($resource) { | ||
return $resource(window.apiPrefix + '/tx/:txId', { | ||
function($resource, Api) { | ||
return $resource(Api.apiPrefix + '/tx/:txId', { | ||
txId: '@txId' | ||
@@ -1191,4 +1203,4 @@ }, { | ||
.factory('TransactionsByBlock', | ||
function($resource) { | ||
return $resource(window.apiPrefix + '/txs', { | ||
function($resource, Api) { | ||
return $resource(Api.apiPrefix + '/txs', { | ||
block: '@block' | ||
@@ -1198,4 +1210,4 @@ }); | ||
.factory('TransactionsByAddress', | ||
function($resource) { | ||
return $resource(window.apiPrefix + '/txs', { | ||
function($resource, Api) { | ||
return $resource(Api.apiPrefix + '/txs', { | ||
address: '@address' | ||
@@ -1205,4 +1217,4 @@ }); | ||
.factory('Transactions', | ||
function($resource) { | ||
return $resource(window.apiPrefix + '/txs'); | ||
function($resource, Api) { | ||
return $resource(Api.apiPrefix + '/txs'); | ||
}); | ||
@@ -1209,0 +1221,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8743247
139353