@@ -7,7 +7,7 @@ var async = require('async');
7
7
var events = require ( 'events' ) ;
8
8
var Bitcore = require ( 'bitcore-lib-zel' ) ;
9
9
var Bitcore_ = {
10
- zel : Bitcore ,
10
+ ZEL : Bitcore ,
11
11
} ;
12
12
var Mnemonic = require ( 'bitcore-mnemonic' ) ;
13
13
var sjcl = require ( 'sjcl' ) ;
@@ -291,7 +291,7 @@ API.prototype.seedFromRandom = function(opts) {
291
291
$ . checkArgument ( _ . isUndefined ( opts ) || _ . isObject ( opts ) , 'DEPRECATED: argument should be an options object.' ) ;
292
292
293
293
opts = opts || { } ;
294
- this . credentials = Credentials . create ( opts . coin || 'zel ' , opts . network || 'livenet' ) ;
294
+ this . credentials = Credentials . create ( opts . coin || 'ZEL ' , opts . network || 'livenet' ) ;
295
295
} ;
296
296
297
297
@@ -381,7 +381,7 @@ API.prototype.seedFromRandomWithMnemonic = function(opts) {
381
381
$ . checkArgument ( _ . isUndefined ( opts ) || _ . isObject ( opts ) , 'DEPRECATED: argument should be an options object.' ) ;
382
382
383
383
opts = opts || { } ;
384
- this . credentials = Credentials . createWithMnemonic ( opts . coin || 'zel ' , opts . network || 'livenet' , opts . passphrase , opts . language || 'en' , opts . account || 0 ) ;
384
+ this . credentials = Credentials . createWithMnemonic ( opts . coin || 'ZEL ' , opts . network || 'livenet' , opts . passphrase , opts . language || 'en' , opts . account || 0 ) ;
385
385
} ;
386
386
387
387
API . prototype . getMnemonic = function ( ) {
@@ -409,7 +409,7 @@ API.prototype.clearMnemonic = function() {
409
409
*/
410
410
API . prototype . seedFromExtendedPrivateKey = function ( xPrivKey , opts ) {
411
411
opts = opts || { } ;
412
- this . credentials = Credentials . fromExtendedPrivateKey ( opts . coin || 'zel ' , xPrivKey , opts . account || 0 , opts . derivationStrategy || Constants . DERIVATION_STRATEGIES . BIP44 , opts ) ;
412
+ this . credentials = Credentials . fromExtendedPrivateKey ( opts . coin || 'ZEL ' , xPrivKey , opts . account || 0 , opts . derivationStrategy || Constants . DERIVATION_STRATEGIES . BIP44 , opts ) ;
413
413
} ;
414
414
415
415
@@ -429,7 +429,7 @@ API.prototype.seedFromMnemonic = function(words, opts) {
429
429
$ . checkArgument ( _ . isUndefined ( opts ) || _ . isObject ( opts ) , 'DEPRECATED: second argument should be an options object.' ) ;
430
430
431
431
opts = opts || { } ;
432
- this . credentials = Credentials . fromMnemonic ( opts . coin || 'zel ' , opts . network || 'livenet' , words , opts . passphrase , opts . account || 0 , opts . derivationStrategy || Constants . DERIVATION_STRATEGIES . BIP44 , opts ) ;
432
+ this . credentials = Credentials . fromMnemonic ( opts . coin || 'ZEL ' , opts . network || 'livenet' , words , opts . passphrase , opts . account || 0 , opts . derivationStrategy || Constants . DERIVATION_STRATEGIES . BIP44 , opts ) ;
433
433
} ;
434
434
435
435
/**
@@ -447,7 +447,7 @@ API.prototype.seedFromExtendedPublicKey = function(xPubKey, source, entropySourc
447
447
$ . checkArgument ( _ . isUndefined ( opts ) || _ . isObject ( opts ) ) ;
448
448
449
449
opts = opts || { } ;
450
- this . credentials = Credentials . fromExtendedPublicKey ( opts . coin || 'zel ' , xPubKey , source , entropySourceHex , opts . account || 0 , opts . derivationStrategy || Constants . DERIVATION_STRATEGIES . BIP44 ) ;
450
+ this . credentials = Credentials . fromExtendedPublicKey ( opts . coin || 'ZEL ' , xPubKey , source , entropySourceHex , opts . account || 0 , opts . derivationStrategy || Constants . DERIVATION_STRATEGIES . BIP44 ) ;
451
451
} ;
452
452
453
453
@@ -542,7 +542,7 @@ API.prototype.importFromMnemonic = function(words, opts, cb) {
542
542
opts = opts || { } ;
543
543
544
544
function derive ( nonCompliantDerivation ) {
545
- return Credentials . fromMnemonic ( opts . coin || 'zel ' , opts . network || 'livenet' , words , opts . passphrase , opts . account || 0 , opts . derivationStrategy || Constants . DERIVATION_STRATEGIES . BIP44 , {
545
+ return Credentials . fromMnemonic ( opts . coin || 'ZEL ' , opts . network || 'livenet' , words , opts . passphrase , opts . account || 0 , opts . derivationStrategy || Constants . DERIVATION_STRATEGIES . BIP44 , {
546
546
nonCompliantDerivation : nonCompliantDerivation ,
547
547
entropySourcePath : opts . entropySourcePath ,
548
548
walletPrivKey : opts . walletPrivKey ,
@@ -590,7 +590,7 @@ API.prototype.importFromExtendedPrivateKey = function(xPrivKey, opts, cb) {
590
590
}
591
591
592
592
try {
593
- this . credentials = Credentials . fromExtendedPrivateKey ( opts . coin || 'zel ' , xPrivKey , opts . account || 0 , opts . derivationStrategy || Constants . DERIVATION_STRATEGIES . BIP44 , opts ) ;
593
+ this . credentials = Credentials . fromExtendedPrivateKey ( opts . coin || 'ZEL ' , xPrivKey , opts . account || 0 , opts . derivationStrategy || Constants . DERIVATION_STRATEGIES . BIP44 , opts ) ;
594
594
} catch ( e ) {
595
595
log . info ( 'xPriv error:' , e ) ;
596
596
return cb ( new Errors . INVALID_BACKUP ) ;
@@ -619,7 +619,7 @@ API.prototype.importFromExtendedPublicKey = function(xPubKey, source, entropySou
619
619
opts = opts || { } ;
620
620
log . debug ( 'Importing from Extended Private Key' ) ;
621
621
try {
622
- this . credentials = Credentials . fromExtendedPublicKey ( opts . coin || 'zel ' , xPubKey , source , entropySourceHex , opts . account || 0 , opts . derivationStrategy || Constants . DERIVATION_STRATEGIES . BIP44 , opts ) ;
622
+ this . credentials = Credentials . fromExtendedPublicKey ( opts . coin || 'ZEL ' , xPubKey , source , entropySourceHex , opts . account || 0 , opts . derivationStrategy || Constants . DERIVATION_STRATEGIES . BIP44 , opts ) ;
623
623
} catch ( e ) {
624
624
log . info ( 'xPriv error:' , e ) ;
625
625
return cb ( new Errors . INVALID_BACKUP ) ;
@@ -656,7 +656,7 @@ API.prototype.getBalanceFromPrivateKey = function(privateKey, coin, cb) {
656
656
657
657
if ( _ . isFunction ( coin ) ) {
658
658
cb = coin ;
659
- coin = 'zel ' ;
659
+ coin = 'ZEL ' ;
660
660
}
661
661
var B = Bitcore_ [ coin ] ;
662
662
@@ -675,7 +675,7 @@ API.prototype.buildTxFromPrivateKey = function(privateKey, destinationAddress, o
675
675
676
676
opts = opts || { } ;
677
677
678
- var coin = opts . coin || 'zel ' ;
678
+ var coin = opts . coin || 'ZEL ' ;
679
679
var B = Bitcore_ [ coin ] ;
680
680
var privateKey = B . PrivateKey ( privateKey ) ;
681
681
var address = privateKey . publicKey . toAddress ( ) ;
@@ -984,7 +984,7 @@ API.parseSecret = function(secret) {
984
984
985
985
var walletPrivKey = Bitcore . PrivateKey . fromString ( secretSplit [ 1 ] ) ;
986
986
var networkChar = secretSplit [ 2 ] ;
987
- var coin = secretSplit [ 3 ] || 'zel ' ;
987
+ var coin = secretSplit [ 3 ] || 'ZEL ' ;
988
988
989
989
return {
990
990
walletId : walletId ,
@@ -1254,10 +1254,10 @@ API.prototype.decryptPrivateKey = function(password) {
1254
1254
API . prototype . getFeeLevels = function ( coin , network , cb ) {
1255
1255
var self = this ;
1256
1256
1257
- $ . checkArgument ( coin || _ . includes ( [ 'zel ' , 'bch' ] , coin ) ) ;
1257
+ $ . checkArgument ( coin || _ . includes ( [ 'ZEL ' , 'bch' ] , coin ) ) ;
1258
1258
$ . checkArgument ( network || _ . includes ( [ 'livenet' , 'testnet' ] , network ) ) ;
1259
1259
1260
- self . _doGetRequest ( '/v2/feelevels/?coin=' + ( coin || 'zel ' ) + '&network=' + ( network || 'livenet' ) , function ( err , result ) {
1260
+ self . _doGetRequest ( '/v2/feelevels/?coin=' + ( coin || 'ZEL ' ) + '&network=' + ( network || 'livenet' ) , function ( err , result ) {
1261
1261
if ( err ) return cb ( err ) ;
1262
1262
return cb ( err , result ) ;
1263
1263
} ) ;
@@ -1304,8 +1304,8 @@ API.prototype.createWallet = function(walletName, copayerName, m, n, opts, cb) {
1304
1304
if ( opts ) $ . shouldBeObject ( opts ) ;
1305
1305
opts = opts || { } ;
1306
1306
1307
- var coin = opts . coin || 'zel ' ;
1308
- if ( ! _ . includes ( [ 'zel ' , 'bch' ] , coin ) ) return cb ( new Error ( 'Invalid coin' ) ) ;
1307
+ var coin = opts . coin || 'ZEL ' ;
1308
+ if ( ! _ . includes ( [ 'ZEL ' , 'bch' ] , coin ) ) return cb ( new Error ( 'Invalid coin' ) ) ;
1309
1309
1310
1310
var network = opts . network || 'livenet' ;
1311
1311
if ( ! _ . includes ( [ 'testnet' , 'livenet' ] , network ) ) return cb ( new Error ( 'Invalid network' ) ) ;
@@ -1385,8 +1385,8 @@ API.prototype.joinWallet = function(secret, copayerName, opts, cb) {
1385
1385
1386
1386
opts = opts || { } ;
1387
1387
1388
- var coin = opts . coin || 'zel ' ;
1389
- if ( ! _ . includes ( [ 'zel ' , 'bch' ] , coin ) ) return cb ( new Error ( 'Invalid coin' ) ) ;
1388
+ var coin = opts . coin || 'ZEL ' ;
1389
+ if ( ! _ . includes ( [ 'ZEL ' , 'bch' ] , coin ) ) return cb ( new Error ( 'Invalid coin' ) ) ;
1390
1390
1391
1391
try {
1392
1392
var secretData = API . parseSecret ( secret ) ;
@@ -1880,7 +1880,7 @@ API.prototype.getBalance = function(opts, cb) {
1880
1880
var args = [ ] ;
1881
1881
if ( opts . twoStep ) args . push ( '?twoStep=1' ) ;
1882
1882
if ( opts . coin ) {
1883
- if ( ! _ . includes ( [ 'zel ' , 'bch' ] , opts . coin ) ) return cb ( new Error ( 'Invalid coin' ) ) ;
1883
+ if ( ! _ . includes ( [ 'ZEL ' , 'bch' ] , opts . coin ) ) return cb ( new Error ( 'Invalid coin' ) ) ;
1884
1884
args . push ( 'coin=' + opts . coin ) ;
1885
1885
}
1886
1886
var qs = '' ;
@@ -2082,8 +2082,8 @@ API.signTxProposalFromAirGapped = function(key, txp, unencryptedPkr, m, n, opts)
2082
2082
var self = this ;
2083
2083
opts = opts || { }
2084
2084
2085
- var coin = opts . coin || 'zel ' ;
2086
- if ( ! _ . includes ( [ 'zel ' , 'bch' ] , coin ) ) return cb ( new Error ( 'Invalid coin' ) ) ;
2085
+ var coin = opts . coin || 'ZEL ' ;
2086
+ if ( ! _ . includes ( [ 'ZEL ' , 'bch' ] , coin ) ) return cb ( new Error ( 'Invalid coin' ) ) ;
2087
2087
2088
2088
var publicKeyRing = JSON . parse ( unencryptedPkr ) ;
2089
2089
0 commit comments