import { Script } from "./script" ; const gatewayScript = ( gGubKeyHash , gHash ) : Script => new Script ( ) . addData ( gHash ) . addOp ( Script . OP . OP_DROP ) . addOp ( Script . OP . OP_DUP ) . addOp ( Script . OP . OP_HASH160 ) . addData ( gGubKeyHash ) . addOp ( Script . OP . OP_EQUALVERIFY ) . addOp ( Script . OP . OP_CHECKSIG ) ; export const createAddressBuffer = ( gGubKeyHash , gHash , prefix ) : Buffer => gatewayScript ( gGubKeyHash , gHash ) . toAddress ( prefix ) ; export const calculatePubKeyScript = ( gGubKeyHash , gHash ) : Buffer => gatewayScript ( gGubKeyHash , gHash ) . toScriptHashOut ( ) ;