@@ -68,7 +68,7 @@ const collectInputs = function() {
68
68
const deferred = Q . defer ( ) ;
69
69
if ( inputs . action === 'set' ) {
70
70
return getVariable ( 'address' , 'On which address are we setting the label: ' ) ( )
71
- . then ( getVariable ( 'label' , 'What label do you want to set on the address: ' ) ) ;
71
+ . then ( getVariable ( 'label' , 'What label do you want to set on the address: ' ) ) ;
72
72
} else if ( inputs . action === 'delete' ) {
73
73
return getVariable ( 'address' , 'From which address are we removing the label: ' ) ( ) ;
74
74
} else {
@@ -79,12 +79,12 @@ const collectInputs = function() {
79
79
} ;
80
80
81
81
return getVariable ( 'walletId' , 'Enter the wallet ID: ' ) ( )
82
- . then ( getVariable ( 'action' , 'Which label action do you wish to perform? [list, set, delete]: ' ) )
83
- . then ( getCreateOrDeleteVariables ( ) ) ;
82
+ . then ( getVariable ( 'action' , 'Which label action do you wish to perform? [list, set, delete]: ' ) )
83
+ . then ( getCreateOrDeleteVariables ( ) ) ;
84
84
} ;
85
85
86
86
const authenticate = function ( ) {
87
- bitgo . authenticate ( { username : inputs . user , password : inputs . password , otp : inputs . otp } , function ( err , result ) {
87
+ bitgo . authenticate ( { username : inputs . user , password : inputs . password , otp : inputs . otp } , function ( err , result ) {
88
88
if ( err ) {
89
89
console . dir ( err ) ;
90
90
throw new Error ( 'Authentication failure!' ) ;
@@ -94,7 +94,7 @@ const authenticate = function() {
94
94
95
95
const runCommands = function ( ) {
96
96
// Now get the wallet
97
- bitgo . wallets ( ) . get ( { type : 'bitcoin' , id : inputs . walletId } , function ( err , wallet ) {
97
+ bitgo . wallets ( ) . get ( { type : 'bitcoin' , id : inputs . walletId } , function ( err , wallet ) {
98
98
if ( err ) {
99
99
console . log ( err ) ;
100
100
process . exit ( - 1 ) ;
@@ -103,22 +103,22 @@ const runCommands = function() {
103
103
switch ( inputs . action ) {
104
104
case 'list' :
105
105
// Get the labels for the addresses in this wallet
106
- wallet . labels ( { } , function ( err , result ) {
106
+ wallet . labels ( { } , function ( err , result ) {
107
107
if ( err ) {
108
108
console . log ( err ) ;
109
109
process . exit ( - 1 ) ;
110
110
}
111
111
if ( result ) {
112
112
const sortedLabels = _ . sortBy ( result , function ( label ) { return label . label + label . address ; } ) ;
113
- sortedLabels . forEach ( function ( label ) {
113
+ sortedLabels . forEach ( function ( label ) {
114
114
const line = ' ' + _ . string . rpad ( label . address , 38 ) + _ . string . prune ( label . label , 60 ) ;
115
115
console . log ( line ) ;
116
116
} ) ;
117
117
}
118
118
} ) ;
119
119
break ;
120
120
case 'set' :
121
- wallet . setLabel ( { label : inputs . label , address : inputs . address } , function ( err , result ) {
121
+ wallet . setLabel ( { label : inputs . label , address : inputs . address } , function ( err , result ) {
122
122
if ( err ) {
123
123
console . log ( err ) ;
124
124
process . exit ( - 1 ) ;
@@ -127,7 +127,7 @@ const runCommands = function() {
127
127
} ) ;
128
128
break ;
129
129
case 'delete' :
130
- wallet . deleteLabel ( { address : inputs . address } , function ( err , result ) {
130
+ wallet . deleteLabel ( { address : inputs . address } , function ( err , result ) {
131
131
if ( err ) {
132
132
console . log ( err ) ;
133
133
process . exit ( - 1 ) ;
@@ -143,8 +143,8 @@ const runCommands = function() {
143
143
144
144
authenticate ( ) ;
145
145
collectInputs ( )
146
- . then ( runCommands )
147
- . catch ( function ( e ) {
148
- console . log ( e ) ;
149
- console . log ( e . stack ) ;
150
- } ) ;
146
+ . then ( runCommands )
147
+ . catch ( function ( e ) {
148
+ console . log ( e ) ;
149
+ console . log ( e . stack ) ;
150
+ } ) ;
0 commit comments