@@ -13,7 +13,7 @@ if (!fs.existsSync(HOME + '/.bitpay')) {
1313}
1414
1515bitpay
16- . version ( '0.0.1 ' )
16+ . version ( '0.0.2 ' )
1717 . option ( '-o, --output [directory]' , 'export directory for keys' , HOME + '/.bitpay' )
1818 . option ( '-i, --input [directory]' , 'import directory for keys' , HOME + '/.bitpay' )
1919 . option ( '-p, --password [password]' , 'password for encrypting/decrypting your key' , '' )
@@ -52,15 +52,15 @@ bitpay
5252 if ( ! fs . existsSync ( bitpay . input + '/api.key' ) ) {
5353 return console . log ( 'Error:' , 'Access key not found, did you run `bitpay keygen`?' ) ;
5454 }
55- var secret = fs . readFileSync ( bitpay . input + '/api.key ' ) . toString ( ) ;
55+ var sin = fs . readFileSync ( bitpay . input + '/api.pub ' ) . toString ( ) ;
5656 var client = new BitPay ( ) ;
5757 // handle errors
5858 client . on ( 'error' , function ( err ) {
5959 console . log ( 'Error:' , err ) ;
6060 } ) ;
6161 // associate key
6262 client . as ( 'public' ) . post ( 'clients' , {
63- id : bitauth . getSin ( bitauth . decrypt ( bitpay . password , secret ) ) ,
63+ id : sin ,
6464 email : bitpay . email ,
6565 label : 'node-bitpay-client'
6666 } , function ( err , result ) {
0 commit comments