Browse Source

warn deprecated method invoked

activeAddress
Ivan Socolsky 9 years ago
parent
commit
6a45e00a4c
No known key found for this signature in database GPG Key ID: FAECE6A05FAA4F56
  1. 11
      lib/expressapp.js

11
lib/expressapp.js

@ -103,6 +103,10 @@ ExpressApp.prototype.start = function(opts, cb) {
} }
}; };
function logDeprecated(req) {
log.warn('DEPRECATED', req.method, req.url, '(' + req.header('x-client-version') + ')');
};
function getCredentials(req) { function getCredentials(req) {
var identity = req.header('x-identity'); var identity = req.header('x-identity');
if (!identity) return; if (!identity) return;
@ -146,6 +150,7 @@ ExpressApp.prototype.start = function(opts, cb) {
// DEPRECATED // DEPRECATED
router.post('/v1/wallets/', function(req, res) { router.post('/v1/wallets/', function(req, res) {
logDeprecated(req);
var server = getServer(req, res); var server = getServer(req, res);
req.body.supportBIP44AndP2PKH = false; req.body.supportBIP44AndP2PKH = false;
server.createWallet(req.body, function(err, walletId) { server.createWallet(req.body, function(err, walletId) {
@ -177,6 +182,7 @@ ExpressApp.prototype.start = function(opts, cb) {
// DEPRECATED // DEPRECATED
router.post('/v1/wallets/:id/copayers/', function(req, res) { router.post('/v1/wallets/:id/copayers/', function(req, res) {
logDeprecated(req);
req.body.walletId = req.params['id']; req.body.walletId = req.params['id'];
req.body.supportBIP44AndP2PKH = false; req.body.supportBIP44AndP2PKH = false;
var server = getServer(req, res); var server = getServer(req, res);
@ -199,6 +205,7 @@ ExpressApp.prototype.start = function(opts, cb) {
// DEPRECATED // DEPRECATED
router.get('/v1/wallets/', function(req, res) { router.get('/v1/wallets/', function(req, res) {
logDeprecated(req);
getServerWithAuth(req, res, function(server) { getServerWithAuth(req, res, function(server) {
server.getStatus({ server.getStatus({
includeExtendedInfo: true includeExtendedInfo: true
@ -251,6 +258,7 @@ ExpressApp.prototype.start = function(opts, cb) {
router.post('/v1/txproposals/', function(req, res) { router.post('/v1/txproposals/', function(req, res) {
log.warn('DEPRECATED v1/txproposals');
getServerWithAuth(req, res, function(server) { getServerWithAuth(req, res, function(server) {
server.createTxLegacy(req.body, function(err, txp) { server.createTxLegacy(req.body, function(err, txp) {
if (err) return returnError(err, res, req); if (err) return returnError(err, res, req);
@ -270,6 +278,7 @@ ExpressApp.prototype.start = function(opts, cb) {
// DEPRECATED // DEPRECATED
router.post('/v1/addresses/', function(req, res) { router.post('/v1/addresses/', function(req, res) {
logDeprecated(req);
getServerWithAuth(req, res, function(server) { getServerWithAuth(req, res, function(server) {
server.createAddress({ server.createAddress({
ignoreMaxGap: true ignoreMaxGap: true
@ -282,6 +291,7 @@ ExpressApp.prototype.start = function(opts, cb) {
// DEPRECATED // DEPRECATED
router.post('/v2/addresses/', function(req, res) { router.post('/v2/addresses/', function(req, res) {
logDeprecated(req);
getServerWithAuth(req, res, function(server) { getServerWithAuth(req, res, function(server) {
server.createAddress({ server.createAddress({
ignoreMaxGap: true ignoreMaxGap: true
@ -327,6 +337,7 @@ ExpressApp.prototype.start = function(opts, cb) {
// DEPRECATED // DEPRECATED
router.get('/v1/feelevels/', function(req, res) { router.get('/v1/feelevels/', function(req, res) {
logDeprecated(req);
var opts = {}; var opts = {};
if (req.query.network) opts.network = req.query.network; if (req.query.network) opts.network = req.query.network;
var server = getServer(req, res); var server = getServer(req, res);

Loading…
Cancel
Save