From 6a551d9e1ea41b727be9782bd90f2edbc976de5f Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Mon, 16 Mar 2015 10:37:28 +1100 Subject: [PATCH] networks: s/magicPrefix/messagePrefix, adds magic constant --- src/networks.js | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/networks.js b/src/networks.js index 7395aa4..3a5ffc5 100644 --- a/src/networks.js +++ b/src/networks.js @@ -3,7 +3,8 @@ var networks = { bitcoin: { - magicPrefix: '\x18Bitcoin Signed Message:\n', + magic: 0xd9b4bef9, + messagePrefix: '\x18Bitcoin Signed Message:\n', bip32: { public: 0x0488b21e, private: 0x0488ade4 @@ -16,7 +17,8 @@ var networks = { estimateFee: estimateFee('bitcoin') }, testnet: { - magicPrefix: '\x18Bitcoin Signed Message:\n', + magic: 0xd9b4bef9, + messagePrefix: '\x18Bitcoin Signed Message:\n', bip32: { public: 0x043587cf, private: 0x04358394 @@ -29,7 +31,8 @@ var networks = { estimateFee: estimateFee('testnet') }, litecoin: { - magicPrefix: '\x19Litecoin Signed Message:\n', + magic: 0xd9b4bef9, + messagePrefix: '\x19Litecoin Signed Message:\n', bip32: { public: 0x019da462, private: 0x019d9cfe @@ -43,7 +46,7 @@ var networks = { estimateFee: estimateFee('litecoin') }, dogecoin: { - magicPrefix: '\x19Dogecoin Signed Message:\n', + messagePrefix: '\x19Dogecoin Signed Message:\n', bip32: { public: 0x02facafd, private: 0x02fac398 @@ -57,7 +60,7 @@ var networks = { estimateFee: estimateFee('dogecoin') }, viacoin: { - magicPrefix: '\x18Viacoin Signed Message:\n', + messagePrefix: '\x18Viacoin Signed Message:\n', bip32: { public: 0x0488b21e, private: 0x0488ade4 @@ -71,7 +74,7 @@ var networks = { estimateFee: estimateFee('viacoin') }, viacointestnet: { - magicPrefix: '\x18Viacoin Signed Message:\n', + messagePrefix: '\x18Viacoin Signed Message:\n', bip32: { public: 0x043587cf, private: 0x04358394 @@ -85,7 +88,7 @@ var networks = { estimateFee: estimateFee('viacointestnet') }, gamerscoin: { - magicPrefix: '\x19Gamerscoin Signed Message:\n', + messagePrefix: '\x19Gamerscoin Signed Message:\n', bip32: { public: 0x019da462, private: 0x019d9cfe @@ -99,7 +102,7 @@ var networks = { estimateFee: estimateFee('gamerscoin') }, jumbucks: { - magicPrefix: '\x19Jumbucks Signed Message:\n', + messagePrefix: '\x19Jumbucks Signed Message:\n', bip32: { public: 0x037a689a, private: 0x037a6460 @@ -113,7 +116,7 @@ var networks = { estimateFee: estimateFee('jumbucks') }, zetacoin: { - magicPrefix: '\x18Zetacoin Signed Message:\n', + messagePrefix: '\x18Zetacoin Signed Message:\n', bip32: { public: 0x0488b21e, private: 0x0488ade4 @@ -146,4 +149,11 @@ function estimateFee (type) { } } +// FIXME: 1.5.3 compatibility patch(s) +for (var networkName in networks) { + var network = networks[networkName] + + network.magicPrefix = network.messagePrefix +} + module.exports = networks