remove unused calcScriptHash function
This commit is contained in:
		
							parent
							
								
									5b2470955d
								
							
						
					
					
						commit
						63ccecf410
					
				@ -3,7 +3,6 @@ import { IEsploraApi } from './bitcoin/esplora-api.interface';
 | 
				
			|||||||
import { Common } from './common';
 | 
					import { Common } from './common';
 | 
				
			||||||
import bitcoinApi, { bitcoinCoreApi } from './bitcoin/bitcoin-api-factory';
 | 
					import bitcoinApi, { bitcoinCoreApi } from './bitcoin/bitcoin-api-factory';
 | 
				
			||||||
import * as bitcoinjs from 'bitcoinjs-lib';
 | 
					import * as bitcoinjs from 'bitcoinjs-lib';
 | 
				
			||||||
import crypto from 'node:crypto';
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TransactionUtils {
 | 
					class TransactionUtils {
 | 
				
			||||||
  constructor() { }
 | 
					  constructor() { }
 | 
				
			||||||
@ -171,14 +170,6 @@ class TransactionUtils {
 | 
				
			|||||||
      16
 | 
					      16
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					 | 
				
			||||||
  public calcScriptHash(script: string): string {
 | 
					 | 
				
			||||||
    if (!/^[0-9a-fA-F]*$/.test(script) || script.length % 2 !== 0) {
 | 
					 | 
				
			||||||
      throw new Error('script is not a valid hex string');
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    const buf = Buffer.from(script, 'hex');
 | 
					 | 
				
			||||||
    return crypto.createHash('sha256').update(buf).digest('hex');
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default new TransactionUtils();
 | 
					export default new TransactionUtils();
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user