@@ -145,7 +145,7 @@ export class ABlockWallet {
145145 *
146146 * @param {string } seedPhrase - Seed phrase
147147 * @param {IClientConfig } config - Additional configuration parameters
148- * @param initOffline - Optionally initialize the client without initializing network settings
148+ * @param initOffline - Optionally initialize the client without initializing network settings
149149 * @return {* } {IClientResponse}
150150 * @memberof ABlockWallet
151151 */
@@ -182,7 +182,7 @@ export class ABlockWallet {
182182 * Common network initialization (retrieval of PoW list for compute and storage)
183183 *
184184 * @param {IClientConfig } config - Configuration parameters
185- * @return {* } {IClientResponse}
185+ * @return {* } {IClientResponse}
186186 * @memberof ABlockWallet
187187 */
188188 public async initNetwork ( config : IClientConfig ) : Promise < IClientResponse > {
@@ -194,7 +194,7 @@ export class ABlockWallet {
194194 if ( this . mempoolHost == undefined )
195195 return {
196196 status : 'error' ,
197- reason : IErrorInternal . NoComputeHostProvided
197+ reason : IErrorInternal . NoComputeHostProvided ,
198198 } as IClientResponse ;
199199
200200 // Initialize routes proof-of-work for compute host
@@ -205,7 +205,6 @@ export class ABlockWallet {
205205 ) ;
206206 if ( initComputeResult . status == 'error' ) return initComputeResult ;
207207
208-
209208 // Optional - Initialize routes proof-of-work for storage host
210209 if ( this . storageHost !== undefined ) {
211210 this . storageRoutesPoW = new Map ( ) ;
@@ -356,9 +355,9 @@ export class ABlockWallet {
356355 */
357356 public async fetchTransactions ( transactionHashes : string [ ] ) : Promise < IClientResponse > {
358357 try {
359- if ( ! this . keyMgmt )
360- throw new Error ( IErrorInternal . ClientNotInitialized ) ;
361- if ( ! this . storageHost || ! this . storageRoutesPoW ) /* Storage is optional on wallet init, but must be initialized here */
358+ if ( ! this . keyMgmt ) throw new Error ( IErrorInternal . ClientNotInitialized ) ;
359+ if ( ! this . storageHost || ! this . storageRoutesPoW )
360+ /* Storage is optional on wallet init, but must be initialized here */
362361 throw new Error ( IErrorInternal . StorageNotInitialized ) ;
363362 const headers = this . getRequestIdAndNonceHeadersForRoute (
364363 this . mempoolRoutesPoW ,
@@ -508,10 +507,8 @@ export class ABlockWallet {
508507 */
509508 async getNotaryBurnAddress ( ) : Promise < IClientResponse > {
510509 try {
511- if ( ! this . keyMgmt )
512- throw new Error ( IErrorInternal . ClientNotInitialized ) ;
513- if ( ! this . notaryHost )
514- throw new Error ( IErrorInternal . NotaryNotInitialized ) ;
510+ if ( ! this . keyMgmt ) throw new Error ( IErrorInternal . ClientNotInitialized ) ;
511+ if ( ! this . notaryHost ) throw new Error ( IErrorInternal . NotaryNotInitialized ) ;
515512 const headers = this . getRequestIdAndNonceHeadersForRoute (
516513 new Map ( ) ,
517514 IAPIRoute . GetNotaryBurnAddress ,
@@ -555,10 +552,8 @@ export class ABlockWallet {
555552 signatures : IGenericKeyPair < string > ,
556553 ) : Promise < IClientResponse > {
557554 try {
558- if ( ! this . keyMgmt )
559- throw new Error ( IErrorInternal . ClientNotInitialized ) ;
560- if ( ! this . notaryHost )
561- throw new Error ( IErrorInternal . NotaryNotInitialized ) ;
555+ if ( ! this . keyMgmt ) throw new Error ( IErrorInternal . ClientNotInitialized ) ;
556+ if ( ! this . notaryHost ) throw new Error ( IErrorInternal . NotaryNotInitialized ) ;
562557 const headers = this . getRequestIdAndNonceHeadersForRoute (
563558 new Map ( ) ,
564559 IAPIRoute . GetNotarySignature ,
@@ -600,10 +595,7 @@ export class ABlockWallet {
600595 * @return {* } {Promise<IClientResponse>}
601596 * @memberof ABlockWallet
602597 */
603- signMessage (
604- keyPairsToSignWith : IKeypairEncrypted [ ] ,
605- message : string ,
606- ) : IClientResponse {
598+ signMessage ( keyPairsToSignWith : IKeypairEncrypted [ ] , message : string ) : IClientResponse {
607599 try {
608600 if ( this . keyMgmt === undefined ) throw new Error ( IErrorInternal . ClientNotInitialized ) ;
609601 const keyPairs = throwIfErr ( this . keyMgmt . decryptKeypairs ( keyPairsToSignWith ) ) ;
@@ -644,7 +636,6 @@ export class ABlockWallet {
644636 }
645637 }
646638
647-
648639 /**
649640 * Make a payment of a specified token amount to a payment address
650641 *
@@ -711,8 +702,7 @@ export class ABlockWallet {
711702 try {
712703 if ( ! this . mempoolHost || ! this . keyMgmt || ! this . mempoolRoutesPoW )
713704 throw new Error ( IErrorInternal . ClientNotInitialized ) ;
714- if ( ! this . intercomHost )
715- throw new Error ( IErrorInternal . IntercomNotInitialized ) ;
705+ if ( ! this . intercomHost ) throw new Error ( IErrorInternal . IntercomNotInitialized ) ;
716706 const senderKeypair = throwIfErr ( this . keyMgmt . decryptKeypair ( receiveAddress ) ) ;
717707 const [ allAddresses , keyPairMap ] = throwIfErr (
718708 this . keyMgmt . getAllAddressesAndKeypairMap ( allKeypairs ) ,
@@ -858,8 +848,7 @@ export class ABlockWallet {
858848 try {
859849 if ( ! this . mempoolHost || ! this . keyMgmt || ! this . mempoolRoutesPoW )
860850 throw new Error ( IErrorInternal . ClientNotInitialized ) ;
861- if ( ! this . intercomHost )
862- throw new Error ( IErrorInternal . IntercomNotInitialized ) ;
851+ if ( ! this . intercomHost ) throw new Error ( IErrorInternal . IntercomNotInitialized ) ;
863852
864853 // Generate a key-pair map
865854 const [ allAddresses , keyPairMap ] = throwIfErr (
@@ -1174,23 +1163,21 @@ export class ABlockWallet {
11741163 }
11751164
11761165 /**
1177- * Get keypairs from localStorage. (Browser)
1178- * It is recommended to use user defined methods for I/O operations (see https://github.com/ABlockOfficial/A-Block.js#getting-started)
1179- *
1180- * @export
1181- * @param {string } keypairs IKeypairEncrypted[] flattened to a string
1182- * @return {* } {void}
1183- */
1166+ * Get keypairs from localStorage. (Browser)
1167+ * It is recommended to use user defined methods for I/O operations (see https://github.com/ABlockOfficial/A-Block.js#getting-started)
1168+ *
1169+ * @export
1170+ * @param {string } keypairs IKeypairEncrypted[] flattened to a string
1171+ * @return {* } {void}
1172+ */
11841173 getKeypairs ( ) : IClientResponse {
11851174 try {
11861175 if ( ! this . keyMgmt ) throw new Error ( IErrorInternal . ClientNotInitialized ) ;
11871176 return {
11881177 status : 'success' ,
11891178 reason : ISuccessInternal . KeypairObtained ,
11901179 content : {
1191- getKeypairsResponse : throwIfErr (
1192- this . keyMgmt . getKeypairs ( )
1193- ) ,
1180+ getKeypairsResponse : throwIfErr ( this . keyMgmt . getKeypairs ( ) ) ,
11941181 } ,
11951182 } ;
11961183 } catch ( error ) {
@@ -1311,8 +1298,7 @@ export class ABlockWallet {
13111298 try {
13121299 if ( ! this . mempoolHost || ! this . keyMgmt || ! this . mempoolRoutesPoW )
13131300 throw new Error ( IErrorInternal . ClientNotInitialized ) ;
1314- if ( ! this . intercomHost )
1315- throw new Error ( IErrorInternal . IntercomNotInitialized ) ;
1301+ if ( ! this . intercomHost ) throw new Error ( IErrorInternal . IntercomNotInitialized ) ;
13161302 const [ allAddresses , keyPairMap ] = throwIfErr (
13171303 this . keyMgmt . getAllAddressesAndKeypairMap ( allKeypairs ) ,
13181304 ) ;
0 commit comments