nl_tokens: / * Given an address generates a script hash replay type script needed for the transaction
pl_tokens: function mkScriptHashReplayScript ( address , blockHeight , blockHash ) { var addrHex = bs58check . decode ( address ) . toString ( 'hex' ) ; var subAddrHex = addrHex . substring ( 4 , addrHex . length ) ; // Cut out the '00' (we also only want 14 bytes instead of 16) var blockHeightBuffer = Buffer . alloc ( 4 ) ; blockHeightBuffer . writeUInt32LE ( blockHeight , 0 ) ; if ( blockHeightBuffer [ 3 ] === 0x00 ) { blockHeightBuffer = blockHeightBuffer . <mask> ( 0 , 3 ) ; } var blockHeightHex = blockHeightBuffer . toString ( 'hex' ) ; // Need to reverse it var blockHashHex = Buffer . from ( blockHash , 'hex' ) . reverse ( ) . toString ( 'hex' ) ; return zopcodes . OP_HASH160 + zbufferutils . getPushDataLength ( subAddrHex ) + subAddrHex + zopcodes . OP_EQUAL + zbufferutils . getPushDataLength ( blockHashHex ) + blockHashHex + zbufferutils . getPushDataLength ( blockHeightHex ) + blockHeightHex + zopcodes . OP_CHECKBLOCKATHEIGHT ; }